-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixed error when a player quits with the GUI open. * Fixed plugin not detecting item to be purchased. * Fixed unserialize error after adding item to the shop. * NBT::$replace now uses IntArrayTag to save the replaced block's damage. * Added /cs removebyid <itemId> <itemDamage> * Added "default-price" option in config.yml * Added "banned-items" (These items are banned from being /cs add ed). * Fixed many more bugs.
- Loading branch information
Showing
7 changed files
with
119 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
--- | ||
|
||
... | ||
default-price: 15000 | ||
banned-items: | ||
- 35:1 | ||
- 7 | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
namespace ChestShop; | ||
|
||
use pocketmine\{Player, Server}; | ||
use pocketmine\scheduler\AsyncTask; | ||
use pocketmine\utils\TextFormat as TF; | ||
|
||
class RemoveByIdTask extends AsyncTask{ | ||
|
||
/* | ||
* $data = [ | ||
* (string) (playername) | ||
* (int) (itemid) | ||
* (int) (itemdamage) | ||
* (int) (assoc array) | ||
* ]; | ||
*/ | ||
private $data; | ||
public function __construct(array $data){ | ||
$this->data = $data; | ||
} | ||
|
||
public function onRun(){ | ||
$res = []; | ||
foreach($this->data[3] as $k => $v){ | ||
if($v[0] == $this->data[1] && $v[1] == $this->data[2]){ | ||
$res[] = $k; | ||
} | ||
} | ||
$this->setResult($res); | ||
} | ||
|
||
public function onCompletion(Server $server){ | ||
$res = $this->getResult(); | ||
if(($player = $server->getPlayerExact($this->data[0])) instanceof Player){ | ||
$player->sendMessage(Main::PREFIX.TF::YELLOW.count($res).' items were removed off auction house (ID: '.$this->data[1].', DAMAGE: '.$this->data[2].').'); | ||
} | ||
$server->getPluginManager()->getPlugin("ChestShop")->removeItemsByKey($res); | ||
} | ||
} |