mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Don't use Config for builtin JSON resources
it doesn't make sense to use a config in these cases, and also it just hides problems when the files are missing.
This commit is contained in:
@ -43,7 +43,6 @@ use pocketmine\nbt\tag\ShortTag;
|
||||
use pocketmine\nbt\tag\StringTag;
|
||||
use pocketmine\Player;
|
||||
use pocketmine\utils\Binary;
|
||||
use pocketmine\utils\Config;
|
||||
|
||||
class Item implements ItemIds, \JsonSerializable{
|
||||
public const TAG_ENCH = "ench";
|
||||
@ -119,9 +118,9 @@ class Item implements ItemIds, \JsonSerializable{
|
||||
public static function initCreativeItems(){
|
||||
self::clearCreativeItems();
|
||||
|
||||
$creativeItems = new Config(\pocketmine\RESOURCE_PATH . "vanilla" . DIRECTORY_SEPARATOR . "creativeitems.json", Config::JSON, []);
|
||||
$creativeItems = json_decode(file_get_contents(\pocketmine\RESOURCE_PATH . "vanilla" . DIRECTORY_SEPARATOR . "creativeitems.json"), true);
|
||||
|
||||
foreach($creativeItems->getAll() as $data){
|
||||
foreach($creativeItems as $data){
|
||||
$item = Item::jsonDeserialize($data);
|
||||
if($item->getName() === "Unknown"){
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user