mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Updated creative inventory json with better NBT encode/decode, fixes enchanted books issues
This commit is contained in:
parent
911529a6cc
commit
5a8008367f
@ -228,13 +228,10 @@ class Item implements ItemIds, \JsonSerializable{
|
||||
$creativeItems = new Config(Server::getInstance()->getFilePath() . "src/pocketmine/resources/creativeitems.json", Config::JSON, []);
|
||||
|
||||
foreach($creativeItems->getAll() as $data){
|
||||
$item = Item::get($data["id"], $data["damage"]);
|
||||
$item = Item::get($data["id"], $data["damage"], $data["count"], $data["nbt"]);
|
||||
if($item->getName() === "Unknown"){
|
||||
continue;
|
||||
}
|
||||
if(isset($data["nbt"])){
|
||||
$item->setNamedTag(NBT::parseJson(json_encode($data["nbt"])));
|
||||
}
|
||||
self::addCreativeItem($item);
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user