public static function init() { if (self::$list === null) { self::$list = new \SplFixedArray(65536); self::$list[self::IRON_SHOVEL] = IronShovel::class; self::$list[self::IRON_PICKAXE] = IronPickaxe::class; self::$list[self::IRON_AXE] = IronAxe::class; self::$list[self::FLINT_STEEL] = FlintSteel::class; self::$list[self::APPLE] = Apple::class; self::$list[self::BOW] = Bow::class; self::$list[self::ANVIL_BLOCK] = AnvilBlock::class; self::$list[self::ARROW] = Arrow::class; self::$list[self::COAL] = Coal::class; self::$list[self::DIAMOND] = Diamond::class; self::$list[self::IRON_INGOT] = IronIngot::class; self::$list[self::GOLD_INGOT] = GoldIngot::class; self::$list[self::IRON_SWORD] = IronSword::class; self::$list[self::WOODEN_SWORD] = WoodenSword::class; self::$list[self::WOODEN_SHOVEL] = WoodenShovel::class; self::$list[self::WOODEN_PICKAXE] = WoodenPickaxe::class; self::$list[self::WOODEN_AXE] = WoodenAxe::class; self::$list[self::STONE_SWORD] = StoneSword::class; self::$list[self::STONE_SHOVEL] = StoneShovel::class; self::$list[self::STONE_PICKAXE] = StonePickaxe::class; self::$list[self::STONE_AXE] = StoneAxe::class; self::$list[self::DIAMOND_SWORD] = DiamondSword::class; self::$list[self::DIAMOND_SHOVEL] = DiamondShovel::class; self::$list[self::DIAMOND_PICKAXE] = DiamondPickaxe::class; self::$list[self::DIAMOND_AXE] = DiamondAxe::class; self::$list[self::STICK] = Stick::class; self::$list[self::BOWL] = Bowl::class; self::$list[self::MUSHROOM_STEW] = MushroomStew::class; self::$list[self::GOLD_SWORD] = GoldSword::class; self::$list[self::GOLD_SHOVEL] = GoldShovel::class; self::$list[self::GOLD_PICKAXE] = GoldPickaxe::class; self::$list[self::GOLD_AXE] = GoldAxe::class; self::$list[self::STRING] = StringItem::class; self::$list[self::FEATHER] = Feather::class; self::$list[self::GUNPOWDER] = Gunpowder::class; self::$list[self::WOODEN_HOE] = WoodenHoe::class; self::$list[self::STONE_HOE] = StoneHoe::class; self::$list[self::IRON_HOE] = IronHoe::class; self::$list[self::DIAMOND_HOE] = DiamondHoe::class; self::$list[self::GOLD_HOE] = GoldHoe::class; self::$list[self::WHEAT_SEEDS] = WheatSeeds::class; self::$list[self::WHEAT] = Wheat::class; self::$list[self::BREAD] = Bread::class; self::$list[self::LEATHER_CAP] = LeatherCap::class; self::$list[self::LEATHER_TUNIC] = LeatherTunic::class; self::$list[self::LEATHER_PANTS] = LeatherPants::class; self::$list[self::LEATHER_BOOTS] = LeatherBoots::class; self::$list[self::CHAIN_HELMET] = ChainHelmet::class; self::$list[self::CHAIN_CHESTPLATE] = ChainChestplate::class; self::$list[self::CHAIN_LEGGINGS] = ChainLeggings::class; self::$list[self::CHAIN_BOOTS] = ChainBoots::class; self::$list[self::IRON_HELMET] = IronHelmet::class; self::$list[self::IRON_CHESTPLATE] = IronChestplate::class; self::$list[self::IRON_LEGGINGS] = IronLeggings::class; self::$list[self::IRON_BOOTS] = IronBoots::class; self::$list[self::DIAMOND_HELMET] = DiamondHelmet::class; self::$list[self::DIAMOND_CHESTPLATE] = DiamondChestplate::class; self::$list[self::DIAMOND_LEGGINGS] = DiamondLeggings::class; self::$list[self::DIAMOND_BOOTS] = DiamondBoots::class; self::$list[self::GOLD_HELMET] = GoldHelmet::class; self::$list[self::GOLD_CHESTPLATE] = GoldChestplate::class; self::$list[self::GOLD_LEGGINGS] = GoldLeggings::class; self::$list[self::GOLD_BOOTS] = GoldBoots::class; self::$list[self::FLINT] = Flint::class; self::$list[self::RAW_PORKCHOP] = RawPorkchop::class; self::$list[self::COOKED_PORKCHOP] = CookedPorkchop::class; self::$list[self::PAINTING] = Painting::class; self::$list[self::GOLDEN_APPLE] = GoldenApple::class; //self::$list[self::ENCHANTED_GOLDEN_APPLE] = EnchantedGoldenApple::class; self::$list[self::SIGN] = Sign::class; self::$list[self::OAK_DOOR] = OakDoor::class; self::$list[self::ACACIA_DOOR] = AcaciaDoor::class; self::$list[self::BIRCH_DOOR] = BirchDoor::class; self::$list[self::DARK_OAK_DOOR] = DarkOakDoor::class; self::$list[self::JUNGLE_DOOR] = JungleDoor::class; self::$list[self::SPRUCE_DOOR] = SpruceDoor::class; self::$list[self::IRON_DOOR] = IronDoor::class; self::$list[self::BUCKET] = Bucket::class; self::$list[self::MINECART] = Minecart::class; self::$list[self::IRON_DOOR] = IronDoor::class; self::$list[self::REDSTONE] = Redstone::class; self::$list[self::SNOWBALL] = Snowball::class; self::$list[self::BOAT] = Boat::class; self::$list[self::LEATHER] = Leather::class; self::$list[self::BRICK] = Brick::class; self::$list[self::CLAY] = Clay::class; self::$list[self::SUGARCANE] = Sugarcane::class; self::$list[self::PAPER] = Paper::class; self::$list[self::BOOK] = Book::class; self::$list[self::SLIMEBALL] = Slimeball::class; self::$list[self::EGG] = Egg::class; self::$list[self::COMPASS] = Compass::class; self::$list[self::FISHING_ROD] = FishingRod::class; self::$list[self::CLOCK] = Clock::class; self::$list[self::GLOWSTONE_DUST] = GlowstoneDust::class; self::$list[self::RAW_FISH] = Fish::class; self::$list[self::COOKED_FISH] = CookedFish::class; self::$list[self::DYE] = Dye::class; self::$list[self::BONE] = Bone::class; self::$list[self::SUGAR] = Sugar::class; self::$list[self::CAKE] = Cake::class; self::$list[self::BED] = Bed::class; self::$list[self::COOKIE] = Cookie::class; self::$list[self::SHEARS] = Shears::class; self::$list[self::MELON] = Melon::class; self::$list[self::PUMPKIN_SEEDS] = PumpkinSeeds::class; self::$list[self::MELON_SEEDS] = MelonSeeds::class; self::$list[self::RAW_BEEF] = RawBeef::class; self::$list[self::STEAK] = Steak::class; self::$list[self::RAW_CHICKEN] = RawChicken::class; self::$list[self::COOKED_CHICKEN] = CookedChicken::class; self::$list[self::ROTTEN_FLESH] = RottenFlesh::class; self::$list[self::BLAZE_ROD] = BlazeRod::class; self::$list[self::GHAST_TEAR] = GhastTear::class; self::$list[self::GOLD_NUGGET] = GoldNugget::class; self::$list[self::NETHER_WART] = NetherWart::class; self::$list[self::POTION] = Potion::class; self::$list[self::GLASS_BOTTLE] = GlassBottle::class; self::$list[self::BLAZE_POWDER] = BlazePowder::class; self::$list[self::BREWING_STAND] = BrewingStand::class; self::$list[self::GLISTERING_MELON] = GlisteringMelon::class; self::$list[self::SPAWN_EGG] = SpawnEgg::class; self::$list[self::EXP_BOTTLE] = EXPBottle::class; self::$list[self::EMERALD] = Emerald::class; self::$list[self::FLOWER_POT] = FlowerPot::class; self::$list[self::CARROT] = Carrot::class; self::$list[self::POTATO] = Potato::class; self::$list[self::BAKED_POTATO] = BakedPotato::class; self::$list[self::SKULL] = Skull::class; self::$list[self::PUMPKIN_PIE] = PumpkinPie::class; self::$list[self::ENCHANTED_BOOK] = EnchantedBook::class; self::$list[self::NETHER_BRICK] = NetherBrick::class; self::$list[self::QUARTZ] = NetherQuartz::class; self::$list[self::RAW_RABBIT] = RawRabbit::class; self::$list[self::COOKED_RABBIT] = CookedRabbit::class; self::$list[self::RABBIT_STEW] = RabbitStew::class; self::$list[self::RABBIT_FOOT] = RabbitFoot::class; //self::$list[self::SPRUCE_DOOR] = SpruceDoor::class; self::$list[self::SPLASH_POTION] = SplashPotion::class; self::$list[self::BEETROOT] = Beetroot::class; self::$list[self::BEETROOT_SEEDS] = BeetrootSeeds::class; self::$list[self::BEETROOT_SOUP] = BeetrootSoup::class; for ($i = 0; $i < 256; ++$i) { if (Block::$list[$i] !== null) { self::$list[$i] = Block::$list[$i]; } } } self::initCreativeItems(); }
private static function writeCompoundTag(CompoundTag $tag) { if (self::$cachedParser === null) { self::$cachedParser = new NBT(NBT::LITTLE_ENDIAN); } self::$cachedParser->setData($tag); return self::$cachedParser->write(); }
public static function init() { if (self::$list === null) { self::$list = new \SplFixedArray(65536); self::$list[self::SUGARCANE] = Sugarcane::class; self::$list[self::WHEAT_SEEDS] = WheatSeeds::class; self::$list[self::PUMPKIN_SEEDS] = PumpkinSeeds::class; self::$list[self::MELON_SEEDS] = MelonSeeds::class; self::$list[self::MUSHROOM_STEW] = MushroomStew::class; self::$list[self::BEETROOT_SOUP] = BeetrootSoup::class; self::$list[self::CARROT] = Carrot::class; self::$list[self::POTATO] = Potato::class; self::$list[self::BEETROOT_SEEDS] = BeetrootSeeds::class; self::$list[self::SIGN] = Sign::class; self::$list[self::WOODEN_DOOR] = WoodenDoor::class; self::$list[self::BUCKET] = Bucket::class; self::$list[self::IRON_DOOR] = IronDoor::class; self::$list[self::CAKE] = Cake::class; self::$list[self::BED] = Bed::class; self::$list[self::PAINTING] = Painting::class; self::$list[self::COAL] = Coal::class; self::$list[self::APPLE] = Apple::class; self::$list[self::SPAWN_EGG] = SpawnEgg::class; self::$list[self::DIAMOND] = Diamond::class; self::$list[self::STICK] = Stick::class; self::$list[self::SNOWBALL] = Snowball::class; self::$list[self::BOWL] = Bowl::class; self::$list[self::FEATHER] = Feather::class; self::$list[self::BRICK] = Brick::class; self::$list[self::LEATHER_CAP] = LeatherCap::class; self::$list[self::LEATHER_TUNIC] = LeatherTunic::class; self::$list[self::LEATHER_PANTS] = LeatherPants::class; self::$list[self::LEATHER_BOOTS] = LeatherBoots::class; self::$list[self::CHAIN_HELMET] = ChainHelmet::class; self::$list[self::CHAIN_CHESTPLATE] = ChainChestplate::class; self::$list[self::CHAIN_LEGGINGS] = ChainLeggings::class; self::$list[self::CHAIN_BOOTS] = ChainBoots::class; self::$list[self::IRON_HELMET] = IronHelmet::class; self::$list[self::IRON_CHESTPLATE] = IronChestplate::class; self::$list[self::IRON_LEGGINGS] = IronLeggings::class; self::$list[self::IRON_BOOTS] = IronBoots::class; self::$list[self::GOLD_HELMET] = GoldHelmet::class; self::$list[self::GOLD_CHESTPLATE] = GoldChestplate::class; self::$list[self::GOLD_LEGGINGS] = GoldLeggings::class; self::$list[self::GOLD_BOOTS] = GoldBoots::class; self::$list[self::DIAMOND_HELMET] = DiamondHelmet::class; self::$list[self::DIAMOND_CHESTPLATE] = DiamondChestplate::class; self::$list[self::DIAMOND_LEGGINGS] = DiamondLeggings::class; self::$list[self::DIAMOND_BOOTS] = DiamondBoots::class; self::$list[self::IRON_SWORD] = IronSword::class; self::$list[self::IRON_INGOT] = IronIngot::class; self::$list[self::GOLD_INGOT] = GoldIngot::class; self::$list[self::IRON_SHOVEL] = IronShovel::class; self::$list[self::IRON_PICKAXE] = IronPickaxe::class; self::$list[self::IRON_AXE] = IronAxe::class; self::$list[self::IRON_HOE] = IronHoe::class; self::$list[self::DIAMOND_SWORD] = DiamondSword::class; self::$list[self::DIAMOND_SHOVEL] = DiamondShovel::class; self::$list[self::DIAMOND_PICKAXE] = DiamondPickaxe::class; self::$list[self::DIAMOND_AXE] = DiamondAxe::class; self::$list[self::DIAMOND_HOE] = DiamondHoe::class; self::$list[self::GOLD_SWORD] = GoldSword::class; self::$list[self::GOLD_SHOVEL] = GoldShovel::class; self::$list[self::GOLD_PICKAXE] = GoldPickaxe::class; self::$list[self::GOLD_AXE] = GoldAxe::class; self::$list[self::GOLD_HOE] = GoldHoe::class; self::$list[self::STONE_SWORD] = StoneSword::class; self::$list[self::STONE_SHOVEL] = StoneShovel::class; self::$list[self::STONE_PICKAXE] = StonePickaxe::class; self::$list[self::STONE_AXE] = StoneAxe::class; self::$list[self::STONE_HOE] = StoneHoe::class; self::$list[self::WOODEN_SWORD] = WoodenSword::class; self::$list[self::WOODEN_SHOVEL] = WoodenShovel::class; self::$list[self::WOODEN_PICKAXE] = WoodenPickaxe::class; self::$list[self::WOODEN_AXE] = WoodenAxe::class; self::$list[self::WOODEN_HOE] = WoodenHoe::class; self::$list[self::FLINT_STEEL] = FlintSteel::class; self::$list[self::SHEARS] = Shears::class; self::$list[self::BOW] = Bow::class; self::$list[self::RAW_FISH] = Fish::class; self::$list[self::COOKED_FISH] = CookedFish::class; for ($i = 0; $i < 256; ++$i) { if (Block::$list[$i] !== null) { self::$list[$i] = Block::$list[$i]; } } } self::initCreativeItems(); }
public static function init() { if (self::$list === null) { self::$list = new \SplFixedArray(65536); self::$list[self::IRON_SHOVEL] = IronShovel::class; self::$list[self::IRON_PICKAXE] = IronPickaxe::class; self::$list[self::IRON_AXE] = IronAxe::class; self::$list[self::FLINT_STEEL] = FlintSteel::class; self::$list[self::APPLE] = Apple::class; self::$list[self::BOW] = Bow::class; self::$list[self::ARROW] = Arrow::class; self::$list[self::COAL] = Coal::class; self::$list[self::DIAMOND] = Diamond::class; self::$list[self::IRON_INGOT] = IronIngot::class; self::$list[self::GOLD_INGOT] = GoldIngot::class; self::$list[self::IRON_SWORD] = IronSword::class; self::$list[self::WOODEN_SWORD] = WoodenSword::class; self::$list[self::WOODEN_SHOVEL] = WoodenShovel::class; self::$list[self::WOODEN_PICKAXE] = WoodenPickaxe::class; self::$list[self::WOODEN_AXE] = WoodenAxe::class; self::$list[self::STONE_SWORD] = StoneSword::class; self::$list[self::STONE_SHOVEL] = StoneShovel::class; self::$list[self::STONE_PICKAXE] = StonePickaxe::class; self::$list[self::STONE_AXE] = StoneAxe::class; self::$list[self::DIAMOND_SWORD] = DiamondSword::class; self::$list[self::DIAMOND_SHOVEL] = DiamondShovel::class; self::$list[self::DIAMOND_PICKAXE] = DiamondPickaxe::class; self::$list[self::DIAMOND_AXE] = DiamondAxe::class; self::$list[self::STICK] = Stick::class; self::$list[self::BOWL] = Bowl::class; self::$list[self::MUSHROOM_STEW] = MushroomStew::class; self::$list[self::GOLD_SWORD] = GoldSword::class; self::$list[self::GOLD_SHOVEL] = GoldShovel::class; self::$list[self::GOLD_PICKAXE] = GoldPickaxe::class; self::$list[self::GOLD_AXE] = GoldAxe::class; self::$list[self::STRING] = StringItem::class; self::$list[self::FEATHER] = Feather::class; self::$list[self::GUNPOWDER] = Gunpowder::class; self::$list[self::WOODEN_HOE] = WoodenHoe::class; self::$list[self::STONE_HOE] = StoneHoe::class; self::$list[self::IRON_HOE] = IronHoe::class; self::$list[self::DIAMOND_HOE] = DiamondHoe::class; self::$list[self::GOLD_HOE] = GoldHoe::class; self::$list[self::WHEAT_SEEDS] = WheatSeeds::class; self::$list[self::WHEAT] = Wheat::class; self::$list[self::BREAD] = Bread::class; self::$list[self::LEATHER_CAP] = LeatherCap::class; self::$list[self::LEATHER_TUNIC] = LeatherTunic::class; self::$list[self::LEATHER_PANTS] = LeatherPants::class; self::$list[self::LEATHER_BOOTS] = LeatherBoots::class; self::$list[self::CHAIN_HELMET] = ChainHelmet::class; self::$list[self::CHAIN_CHESTPLATE] = ChainChestplate::class; self::$list[self::CHAIN_LEGGINGS] = ChainLeggings::class; self::$list[self::CHAIN_BOOTS] = ChainBoots::class; self::$list[self::IRON_HELMET] = IronHelmet::class; self::$list[self::IRON_CHESTPLATE] = IronChestplate::class; self::$list[self::IRON_LEGGINGS] = IronLeggings::class; self::$list[self::IRON_BOOTS] = IronBoots::class; self::$list[self::DIAMOND_HELMET] = DiamondHelmet::class; self::$list[self::DIAMOND_CHESTPLATE] = DiamondChestplate::class; self::$list[self::DIAMOND_LEGGINGS] = DiamondLeggings::class; self::$list[self::DIAMOND_BOOTS] = DiamondBoots::class; self::$list[self::GOLD_HELMET] = GoldHelmet::class; self::$list[self::GOLD_CHESTPLATE] = GoldChestplate::class; self::$list[self::GOLD_LEGGINGS] = GoldLeggings::class; self::$list[self::GOLD_BOOTS] = GoldBoots::class; self::$list[self::FLINT] = Flint::class; self::$list[self::RAW_PORKCHOP] = RawPorkchop::class; self::$list[self::COOKED_PORKCHOP] = CookedPorkchop::class; self::$list[self::PAINTING] = Painting::class; self::$list[self::GOLDEN_APPLE] = GoldenApple::class; self::$list[self::SIGN] = Sign::class; self::$list[self::WOODEN_DOOR] = WoodenDoor::class; self::$list[self::BUCKET] = Bucket::class; self::$list[self::MINECART] = Minecart::class; self::$list[self::IRON_DOOR] = IronDoor::class; self::$list[self::REDSTONE] = Redstone::class; self::$list[self::SNOWBALL] = Snowball::class; self::$list[self::LEATHER] = Leather::class; self::$list[self::BRICK] = Brick::class; self::$list[self::CLAY] = Clay::class; self::$list[self::SUGARCANE] = Sugarcane::class; self::$list[self::PAPER] = Paper::class; self::$list[self::BOOK] = Book::class; self::$list[self::SLIMEBALL] = Slimeball::class; self::$list[self::EGG] = Egg::class; self::$list[self::COMPASS] = Compass::class; self::$list[self::CLOCK] = Clock::class; self::$list[self::GLOWSTONE_DUST] = GlowstoneDust::class; self::$list[self::RAW_FISH] = Fish::class; self::$list[self::COOKED_FISH] = CookedFish::class; self::$list[self::DYE] = Dye::class; self::$list[self::BONE] = Bone::class; self::$list[self::SUGAR] = Sugar::class; self::$list[self::CAKE] = Cake::class; self::$list[self::BED] = Bed::class; self::$list[self::COOKIE] = Cookie::class; self::$list[self::SHEARS] = Shears::class; self::$list[self::MELON] = Melon::class; self::$list[self::PUMPKIN_SEEDS] = PumpkinSeeds::class; self::$list[self::MELON_SEEDS] = MelonSeeds::class; self::$list[self::RAW_BEEF] = RawBeef::class; self::$list[self::STEAK] = Steak::class; self::$list[self::RAW_CHICKEN] = RawChicken::class; self::$list[self::COOKED_CHICKEN] = CookedChicken::class; self::$list[self::GOLD_NUGGET] = GoldNugget::class; self::$list[self::SPAWN_EGG] = SpawnEgg::class; self::$list[self::EMERALD] = Emerald::class; self::$list[self::CARROT] = Carrot::class; self::$list[self::POTATO] = Potato::class; self::$list[self::BAKED_POTATO] = BakedPotato::class; self::$list[self::PUMPKIN_PIE] = PumpkinPie::class; self::$list[self::NETHER_BRICK] = NetherBrick::class; self::$list[self::QUARTZ] = Quartz::class; self::$list[self::QUARTZ] = NetherQuartz::class; // self::$list[self::CAMERA] = Camera::class; self::$list[self::BEETROOT] = Beetroot::class; self::$list[self::BEETROOT_SEEDS] = BeetrootSeeds::class; self::$list[self::BEETROOT_SOUP] = BeetrootSoup::class; for ($i = 0; $i < 256; ++$i) { if (Block::$list[$i] !== null) { self::$list[$i] = Block::$list[$i]; } } } self::initCreativeItems(); }
public static function init() { if (count(self::$list) === 0) { self::$list = [self::SUGARCANE => Sugarcane::class, self::WHEAT_SEEDS => WheatSeeds::class, self::PUMPKIN_SEEDS => PumpkinSeeds::class, self::MELON_SEEDS => MelonSeeds::class, self::MUSHROOM_STEW => MushroomStew::class, self::BEETROOT_SOUP => BeetrootSoup::class, self::CARROT => Carrot::class, self::POTATO => Potato::class, self::BEETROOT_SEEDS => BeetrootSeeds::class, self::SIGN => Sign::class, self::WOODEN_DOOR => WoodenDoor::class, self::BUCKET => Bucket::class, self::IRON_DOOR => IronDoor::class, self::CAKE => Cake::class, self::BED => Bed::class, self::PAINTING => Painting::class, self::COAL => Coal::class, self::APPLE => Apple::class, self::SPAWN_EGG => SpawnEgg::class, self::DIAMOND => Diamond::class, self::STICK => Stick::class, self::BOWL => Bowl::class, self::FEATHER => Feather::class, self::BRICK => Brick::class, self::IRON_SWORD => IronSword::class, self::IRON_INGOT => IronIngot::class, self::GOLD_INGOT => GoldIngot::class, self::IRON_SHOVEL => IronShovel::class, self::IRON_PICKAXE => IronPickaxe::class, self::IRON_AXE => IronAxe::class, self::IRON_HOE => IronHoe::class, self::DIAMOND_SWORD => DiamondSword::class, self::DIAMOND_SHOVEL => DiamondShovel::class, self::DIAMOND_PICKAXE => DiamondPickaxe::class, self::DIAMOND_AXE => DiamondAxe::class, self::DIAMOND_HOE => DiamondHoe::class, self::GOLD_SWORD => GoldSword::class, self::GOLD_SHOVEL => GoldShovel::class, self::GOLD_PICKAXE => GoldPickaxe::class, self::GOLD_AXE => GoldAxe::class, self::GOLD_HOE => GoldHoe::class, self::STONE_SWORD => StoneSword::class, self::STONE_SHOVEL => StoneShovel::class, self::STONE_PICKAXE => StonePickaxe::class, self::STONE_AXE => StoneAxe::class, self::STONE_HOE => StoneHoe::class, self::WOODEN_SWORD => WoodenSword::class, self::WOODEN_SHOVEL => WoodenShovel::class, self::WOODEN_PICKAXE => WoodenPickaxe::class, self::WOODEN_AXE => WoodenAxe::class, self::WOODEN_HOE => WoodenHoe::class, self::FLINT_STEEL => FlintSteel::class, self::SHEARS => Shears::class, self::BOW => Bow::class]; foreach (Block::$list as $id => $class) { self::$list[$id] = $class; } } }