mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 00:07:30 +00:00
Added new ores
This commit is contained in:
parent
a8dae96bb0
commit
d725ded7b6
@ -145,7 +145,6 @@ class BlockFactory{
|
||||
$this->register(new Chest(new BID(Ids::CHEST, TileChest::class), "Chest", $chestBreakInfo));
|
||||
$this->register(new Clay(new BID(Ids::CLAY), "Clay Block", new BreakInfo(0.6, ToolType::SHOVEL)));
|
||||
$this->register(new Coal(new BID(Ids::COAL), "Coal Block", new BreakInfo(5.0, ToolType::PICKAXE, ToolTier::WOOD()->getHarvestLevel(), 30.0)));
|
||||
$this->register(new CoalOre(new BID(Ids::COAL_ORE), "Coal Ore", new BreakInfo(3.0, ToolType::PICKAXE, ToolTier::WOOD()->getHarvestLevel())));
|
||||
|
||||
$cobblestoneBreakInfo = new BreakInfo(2.0, ToolType::PICKAXE, ToolTier::WOOD()->getHarvestLevel(), 30.0);
|
||||
$this->register($cobblestone = new Opaque(new BID(Ids::COBBLESTONE), "Cobblestone", $cobblestoneBreakInfo));
|
||||
@ -162,7 +161,6 @@ class BlockFactory{
|
||||
$this->register(new DetectorRail(new BID(Ids::DETECTOR_RAIL), "Detector Rail", $railBreakInfo));
|
||||
|
||||
$this->register(new Opaque(new BID(Ids::DIAMOND), "Diamond Block", new BreakInfo(5.0, ToolType::PICKAXE, ToolTier::IRON()->getHarvestLevel(), 30.0)));
|
||||
$this->register(new DiamondOre(new BID(Ids::DIAMOND_ORE), "Diamond Ore", new BreakInfo(3.0, ToolType::PICKAXE, ToolTier::IRON()->getHarvestLevel())));
|
||||
$this->register(new Dirt(new BID(Ids::DIRT), "Dirt", new BreakInfo(0.5, ToolType::SHOVEL)));
|
||||
$this->register(new DoublePlant(new BID(Ids::SUNFLOWER), "Sunflower", BreakInfo::instant()));
|
||||
$this->register(new DoublePlant(new BID(Ids::LILAC), "Lilac", BreakInfo::instant()));
|
||||
@ -173,7 +171,6 @@ class BlockFactory{
|
||||
$this->register(new DragonEgg(new BID(Ids::DRAGON_EGG), "Dragon Egg", new BreakInfo(3.0, ToolType::PICKAXE, ToolTier::WOOD()->getHarvestLevel())));
|
||||
$this->register(new DriedKelp(new BID(Ids::DRIED_KELP), "Dried Kelp Block", new BreakInfo(0.5, ToolType::NONE, 0, 12.5)));
|
||||
$this->register(new Opaque(new BID(Ids::EMERALD), "Emerald Block", new BreakInfo(5.0, ToolType::PICKAXE, ToolTier::IRON()->getHarvestLevel(), 30.0)));
|
||||
$this->register(new EmeraldOre(new BID(Ids::EMERALD_ORE), "Emerald Ore", new BreakInfo(3.0, ToolType::PICKAXE, ToolTier::IRON()->getHarvestLevel())));
|
||||
$this->register(new EnchantingTable(new BID(Ids::ENCHANTING_TABLE, TileEnchantingTable::class), "Enchanting Table", new BreakInfo(5.0, ToolType::PICKAXE, ToolTier::WOOD()->getHarvestLevel(), 6000.0)));
|
||||
$this->register(new EndPortalFrame(new BID(Ids::END_PORTAL_FRAME), "End Portal Frame", BreakInfo::indestructible()));
|
||||
$this->register(new EndRod(new BID(Ids::END_ROD), "End Rod", BreakInfo::instant()));
|
||||
@ -211,7 +208,6 @@ class BlockFactory{
|
||||
$this->register(new GlowingObsidian(new BID(Ids::GLOWING_OBSIDIAN), "Glowing Obsidian", new BreakInfo(10.0, ToolType::PICKAXE, ToolTier::DIAMOND()->getHarvestLevel(), 50.0)));
|
||||
$this->register(new Glowstone(new BID(Ids::GLOWSTONE), "Glowstone", new BreakInfo(0.3, ToolType::PICKAXE)));
|
||||
$this->register(new Opaque(new BID(Ids::GOLD), "Gold Block", new BreakInfo(3.0, ToolType::PICKAXE, ToolTier::IRON()->getHarvestLevel(), 30.0)));
|
||||
$this->register(new Opaque(new BID(Ids::GOLD_ORE), "Gold Ore", new BreakInfo(3.0, ToolType::PICKAXE, ToolTier::IRON()->getHarvestLevel())));
|
||||
|
||||
$grassBreakInfo = new BreakInfo(0.6, ToolType::SHOVEL);
|
||||
$this->register(new Grass(new BID(Ids::GRASS), "Grass", $grassBreakInfo));
|
||||
@ -239,7 +235,6 @@ class BlockFactory{
|
||||
$ironDoorBreakInfo = new BreakInfo(5.0, ToolType::PICKAXE, ToolTier::WOOD()->getHarvestLevel(), 25.0);
|
||||
$this->register(new Door(new BID(Ids::IRON_DOOR), "Iron Door", $ironDoorBreakInfo));
|
||||
$this->register(new Trapdoor(new BID(Ids::IRON_TRAPDOOR), "Iron Trapdoor", $ironDoorBreakInfo));
|
||||
$this->register(new Opaque(new BID(Ids::IRON_ORE), "Iron Ore", new BreakInfo(3.0, ToolType::PICKAXE, ToolTier::STONE()->getHarvestLevel())));
|
||||
$this->register(new ItemFrame(new BID(Ids::ITEM_FRAME, TileItemFrame::class), "Item Frame", new BreakInfo(0.25)));
|
||||
$this->register(new Jukebox(new BID(Ids::JUKEBOX, TileJukebox::class), "Jukebox", new BreakInfo(0.8, ToolType::AXE))); //TODO: in PC the hardness is 2.0, not 0.8, unsure if this is a MCPE bug or not
|
||||
$this->register(new Ladder(new BID(Ids::LADDER), "Ladder", new BreakInfo(0.4, ToolType::AXE)));
|
||||
@ -249,7 +244,6 @@ class BlockFactory{
|
||||
$this->register(new Lantern(new BID(Ids::SOUL_LANTERN), "Soul Lantern", $lanternBreakInfo, 10));
|
||||
|
||||
$this->register(new Opaque(new BID(Ids::LAPIS_LAZULI), "Lapis Lazuli Block", new BreakInfo(3.0, ToolType::PICKAXE, ToolTier::STONE()->getHarvestLevel())));
|
||||
$this->register(new LapisOre(new BID(Ids::LAPIS_LAZULI_ORE), "Lapis Lazuli Ore", new BreakInfo(3.0, ToolType::PICKAXE, ToolTier::STONE()->getHarvestLevel())));
|
||||
$this->register(new Lava(new BID(Ids::LAVA), "Lava", BreakInfo::indestructible(500.0)));
|
||||
$this->register(new Lectern(new BID(Ids::LECTERN, TileLectern::class), "Lectern", new BreakInfo(2.0, ToolType::AXE)));
|
||||
$this->register(new Lever(new BID(Ids::LEVER), "Lever", new BreakInfo(0.5)));
|
||||
@ -270,7 +264,6 @@ class BlockFactory{
|
||||
$this->register(new Opaque(new BID(Ids::CRACKED_NETHER_BRICKS), "Cracked Nether Bricks", $netherBrickBreakInfo));
|
||||
|
||||
$this->register(new NetherPortal(new BID(Ids::NETHER_PORTAL), "Nether Portal", BreakInfo::indestructible(0.0)));
|
||||
$this->register(new NetherQuartzOre(new BID(Ids::NETHER_QUARTZ_ORE), "Nether Quartz Ore", new BreakInfo(3.0, ToolType::PICKAXE, ToolTier::WOOD()->getHarvestLevel())));
|
||||
$this->register(new NetherReactor(new BID(Ids::NETHER_REACTOR_CORE), "Nether Reactor Core", new BreakInfo(3.0, ToolType::PICKAXE, ToolTier::WOOD()->getHarvestLevel())));
|
||||
$this->register(new Opaque(new BID(Ids::NETHER_WART_BLOCK), "Nether Wart Block", new BreakInfo(1.0, ToolType::HOE)));
|
||||
$this->register(new NetherWartPlant(new BID(Ids::NETHER_WART), "Nether Wart", BreakInfo::instant()));
|
||||
@ -317,7 +310,6 @@ class BlockFactory{
|
||||
$this->register(new Redstone(new BID(Ids::REDSTONE), "Redstone Block", new BreakInfo(5.0, ToolType::PICKAXE, ToolTier::WOOD()->getHarvestLevel(), 30.0)));
|
||||
$this->register(new RedstoneComparator(new BID(Ids::REDSTONE_COMPARATOR, TileComparator::class), "Redstone Comparator", BreakInfo::instant()));
|
||||
$this->register(new RedstoneLamp(new BID(Ids::REDSTONE_LAMP), "Redstone Lamp", new BreakInfo(0.3)));
|
||||
$this->register(new RedstoneOre(new BID(Ids::REDSTONE_ORE), "Redstone Ore", new BreakInfo(3.0, ToolType::PICKAXE, ToolTier::IRON()->getHarvestLevel())));
|
||||
$this->register(new RedstoneRepeater(new BID(Ids::REDSTONE_REPEATER), "Redstone Repeater", BreakInfo::instant()));
|
||||
$this->register(new RedstoneTorch(new BID(Ids::REDSTONE_TORCH), "Redstone Torch", BreakInfo::instant()));
|
||||
$this->register(new RedstoneWire(new BID(Ids::REDSTONE_WIRE), "Redstone", BreakInfo::instant()));
|
||||
@ -575,6 +567,8 @@ class BlockFactory{
|
||||
$this->registerBlocksR14();
|
||||
$this->registerBlocksR16();
|
||||
$this->registerBlocksR17();
|
||||
|
||||
$this->registerOres();
|
||||
}
|
||||
|
||||
private function registerMushroomBlocks() : void{
|
||||
@ -712,6 +706,32 @@ class BlockFactory{
|
||||
$this->register(new Element(new BID(Ids::ELEMENT_OGANESSON), "Oganesson", $instaBreak, "og", 118, 7));
|
||||
}
|
||||
|
||||
private function registerOres() : void{
|
||||
$stoneOreBreakInfo = fn(ToolTier $toolTier) => new BreakInfo(3.0, ToolType::PICKAXE, $toolTier->getHarvestLevel());
|
||||
$this->register(new CoalOre(new BID(Ids::COAL_ORE), "Coal Ore", $stoneOreBreakInfo(ToolTier::WOOD())));
|
||||
$this->register(new CopperOre(new BID(Ids::COPPER_ORE), "Copper Ore", $stoneOreBreakInfo(ToolTier::STONE())));
|
||||
$this->register(new DiamondOre(new BID(Ids::DIAMOND_ORE), "Diamond Ore", $stoneOreBreakInfo(ToolTier::IRON())));
|
||||
$this->register(new EmeraldOre(new BID(Ids::EMERALD_ORE), "Emerald Ore", $stoneOreBreakInfo(ToolTier::IRON())));
|
||||
$this->register(new GoldOre(new BID(Ids::GOLD_ORE), "Gold Ore", $stoneOreBreakInfo(ToolTier::IRON())));
|
||||
$this->register(new IronOre(new BID(Ids::IRON_ORE), "Iron Ore", $stoneOreBreakInfo(ToolTier::STONE())));
|
||||
$this->register(new LapisOre(new BID(Ids::LAPIS_LAZULI_ORE), "Lapis Lazuli Ore", $stoneOreBreakInfo(ToolTier::STONE())));
|
||||
$this->register(new RedstoneOre(new BID(Ids::REDSTONE_ORE), "Redstone Ore", $stoneOreBreakInfo(ToolTier::IRON())));
|
||||
|
||||
$deepslateOreBreakInfo = fn(ToolTier $toolTier) => new BreakInfo(4.5, ToolType::PICKAXE, $toolTier->getHarvestLevel());
|
||||
$this->register(new CoalOre(new BID(Ids::DEEPSLATE_COAL_ORE), "Deepslate Coal Ore", $deepslateOreBreakInfo(ToolTier::WOOD())));
|
||||
$this->register(new CopperOre(new BID(Ids::DEEPSLATE_COPPER_ORE), "Deepslate Copper Ore", $deepslateOreBreakInfo(ToolTier::STONE())));
|
||||
$this->register(new DiamondOre(new BID(Ids::DEEPSLATE_DIAMOND_ORE), "Deepslate Diamond Ore", $deepslateOreBreakInfo(ToolTier::IRON())));
|
||||
$this->register(new EmeraldOre(new BID(Ids::DEEPSLATE_EMERALD_ORE), "Deepslate Emerald Ore", $deepslateOreBreakInfo(ToolTier::IRON())));
|
||||
$this->register(new GoldOre(new BID(Ids::DEEPSLATE_GOLD_ORE), "Deepslate Gold Ore", $deepslateOreBreakInfo(ToolTier::IRON())));
|
||||
$this->register(new IronOre(new BID(Ids::DEEPSLATE_IRON_ORE), "Deepslate Iron Ore", $deepslateOreBreakInfo(ToolTier::STONE())));
|
||||
$this->register(new LapisOre(new BID(Ids::DEEPSLATE_LAPIS_LAZULI_ORE), "Deepslate Lapis Lazuli Ore", $deepslateOreBreakInfo(ToolTier::STONE())));
|
||||
$this->register(new RedstoneOre(new BID(Ids::DEEPSLATE_REDSTONE_ORE), "Deepslate Redstone Ore", $deepslateOreBreakInfo(ToolTier::IRON())));
|
||||
|
||||
$netherrackOreBreakInfo = new BreakInfo(3.0, ToolType::PICKAXE, ToolTier::WOOD()->getHarvestLevel());
|
||||
$this->register(new NetherQuartzOre(new BID(Ids::NETHER_QUARTZ_ORE), "Nether Quartz Ore", $netherrackOreBreakInfo));
|
||||
$this->register(new NetherGoldOre(new BID(Ids::NETHER_GOLD_ORE), "Nether Gold Ore", $netherrackOreBreakInfo));
|
||||
}
|
||||
|
||||
private function registerBlocksR13() : void{
|
||||
$this->register(new Light(new BID(Ids::LIGHT), "Light Block", BreakInfo::indestructible()));
|
||||
}
|
||||
|
@ -660,6 +660,16 @@ final class BlockTypeIds{
|
||||
public const WARPED_WALL_SIGN = 10633;
|
||||
|
||||
public const HONEYCOMB = 10635;
|
||||
public const DEEPSLATE_COAL_ORE = 10636;
|
||||
public const DEEPSLATE_DIAMOND_ORE = 10637;
|
||||
public const DEEPSLATE_EMERALD_ORE = 10638;
|
||||
public const DEEPSLATE_LAPIS_LAZULI_ORE = 10639;
|
||||
public const DEEPSLATE_REDSTONE_ORE = 10640;
|
||||
public const DEEPSLATE_IRON_ORE = 10641;
|
||||
public const DEEPSLATE_GOLD_ORE = 10642;
|
||||
public const DEEPSLATE_COPPER_ORE = 10643;
|
||||
public const COPPER_ORE = 10644;
|
||||
public const NETHER_GOLD_ORE = 10645;
|
||||
|
||||
public const FIRST_UNUSED_BLOCK_ID = 10636;
|
||||
public const FIRST_UNUSED_BLOCK_ID = 10646;
|
||||
}
|
||||
|
36
src/block/CopperOre.php
Normal file
36
src/block/CopperOre.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block;
|
||||
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\item\VanillaItems;
|
||||
|
||||
final class CopperOre extends Opaque{
|
||||
|
||||
public function getDropsForCompatibleTool(Item $item) : array{
|
||||
return [VanillaItems::RAW_COPPER()];
|
||||
}
|
||||
|
||||
public function isAffectedBySilkTouch() : bool{ return true; }
|
||||
}
|
36
src/block/GoldOre.php
Normal file
36
src/block/GoldOre.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block;
|
||||
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\item\VanillaItems;
|
||||
|
||||
final class GoldOre extends Opaque{
|
||||
|
||||
public function getDropsForCompatibleTool(Item $item) : array{
|
||||
return [VanillaItems::RAW_GOLD()];
|
||||
}
|
||||
|
||||
public function isAffectedBySilkTouch() : bool{ return true; }
|
||||
}
|
36
src/block/IronOre.php
Normal file
36
src/block/IronOre.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block;
|
||||
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\item\VanillaItems;
|
||||
|
||||
final class IronOre extends Opaque{
|
||||
|
||||
public function getDropsForCompatibleTool(Item $item) : array{
|
||||
return [VanillaItems::RAW_IRON()];
|
||||
}
|
||||
|
||||
public function isAffectedBySilkTouch() : bool{ return true; }
|
||||
}
|
37
src/block/NetherGoldOre.php
Normal file
37
src/block/NetherGoldOre.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block;
|
||||
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\item\VanillaItems;
|
||||
use function mt_rand;
|
||||
|
||||
final class NetherGoldOre extends Opaque{
|
||||
|
||||
public function getDropsForCompatibleTool(Item $item) : array{
|
||||
return [VanillaItems::GOLD_NUGGET()->setCount(mt_rand(2, 6))];
|
||||
}
|
||||
|
||||
public function isAffectedBySilkTouch() : bool{ return true; }
|
||||
}
|
@ -133,6 +133,7 @@ use pocketmine\utils\CloningRegistryTrait;
|
||||
* @method static ChemistryTable COMPOUND_CREATOR()
|
||||
* @method static Concrete CONCRETE()
|
||||
* @method static ConcretePowder CONCRETE_POWDER()
|
||||
* @method static CopperOre COPPER_ORE()
|
||||
* @method static Coral CORAL()
|
||||
* @method static CoralBlock CORAL_BLOCK()
|
||||
* @method static FloorCoralFan CORAL_FAN()
|
||||
@ -186,6 +187,14 @@ use pocketmine\utils\CloningRegistryTrait;
|
||||
* @method static Slab DEEPSLATE_BRICK_SLAB()
|
||||
* @method static Stair DEEPSLATE_BRICK_STAIRS()
|
||||
* @method static Wall DEEPSLATE_BRICK_WALL()
|
||||
* @method static CoalOre DEEPSLATE_COAL_ORE()
|
||||
* @method static CopperOre DEEPSLATE_COPPER_ORE()
|
||||
* @method static DiamondOre DEEPSLATE_DIAMOND_ORE()
|
||||
* @method static EmeraldOre DEEPSLATE_EMERALD_ORE()
|
||||
* @method static GoldOre DEEPSLATE_GOLD_ORE()
|
||||
* @method static IronOre DEEPSLATE_IRON_ORE()
|
||||
* @method static LapisOre DEEPSLATE_LAPIS_LAZULI_ORE()
|
||||
* @method static RedstoneOre DEEPSLATE_REDSTONE_ORE()
|
||||
* @method static Opaque DEEPSLATE_TILES()
|
||||
* @method static Slab DEEPSLATE_TILE_SLAB()
|
||||
* @method static Stair DEEPSLATE_TILE_STAIRS()
|
||||
@ -347,7 +356,7 @@ use pocketmine\utils\CloningRegistryTrait;
|
||||
* @method static GlowingObsidian GLOWING_OBSIDIAN()
|
||||
* @method static Glowstone GLOWSTONE()
|
||||
* @method static Opaque GOLD()
|
||||
* @method static Opaque GOLD_ORE()
|
||||
* @method static GoldOre GOLD_ORE()
|
||||
* @method static Opaque GRANITE()
|
||||
* @method static Slab GRANITE_SLAB()
|
||||
* @method static Stair GRANITE_STAIRS()
|
||||
@ -375,7 +384,7 @@ use pocketmine\utils\CloningRegistryTrait;
|
||||
* @method static Opaque IRON()
|
||||
* @method static Thin IRON_BARS()
|
||||
* @method static Door IRON_DOOR()
|
||||
* @method static Opaque IRON_ORE()
|
||||
* @method static IronOre IRON_ORE()
|
||||
* @method static Trapdoor IRON_TRAPDOOR()
|
||||
* @method static ItemFrame ITEM_FRAME()
|
||||
* @method static Jukebox JUKEBOX()
|
||||
@ -445,6 +454,7 @@ use pocketmine\utils\CloningRegistryTrait;
|
||||
* @method static Slab NETHER_BRICK_SLAB()
|
||||
* @method static Stair NETHER_BRICK_STAIRS()
|
||||
* @method static Wall NETHER_BRICK_WALL()
|
||||
* @method static NetherGoldOre NETHER_GOLD_ORE()
|
||||
* @method static NetherPortal NETHER_PORTAL()
|
||||
* @method static NetherQuartzOre NETHER_QUARTZ_ORE()
|
||||
* @method static NetherReactor NETHER_REACTOR_CORE()
|
||||
@ -764,6 +774,7 @@ final class VanillaBlocks{
|
||||
self::register("compound_creator", $factory->fromTypeId(Ids::COMPOUND_CREATOR));
|
||||
self::register("concrete", $factory->fromTypeId(Ids::CONCRETE));
|
||||
self::register("concrete_powder", $factory->fromTypeId(Ids::CONCRETE_POWDER));
|
||||
self::register("copper_ore", $factory->fromTypeId(Ids::COPPER_ORE));
|
||||
self::register("coral", $factory->fromTypeId(Ids::CORAL));
|
||||
self::register("coral_block", $factory->fromTypeId(Ids::CORAL_BLOCK));
|
||||
self::register("coral_fan", $factory->fromTypeId(Ids::CORAL_FAN));
|
||||
@ -817,6 +828,14 @@ final class VanillaBlocks{
|
||||
self::register("deepslate_brick_stairs", $factory->fromTypeId(Ids::DEEPSLATE_BRICK_STAIRS));
|
||||
self::register("deepslate_brick_wall", $factory->fromTypeId(Ids::DEEPSLATE_BRICK_WALL));
|
||||
self::register("deepslate_bricks", $factory->fromTypeId(Ids::DEEPSLATE_BRICKS));
|
||||
self::register("deepslate_coal_ore", $factory->fromTypeId(Ids::DEEPSLATE_COAL_ORE));
|
||||
self::register("deepslate_copper_ore", $factory->fromTypeId(Ids::DEEPSLATE_COPPER_ORE));
|
||||
self::register("deepslate_diamond_ore", $factory->fromTypeId(Ids::DEEPSLATE_DIAMOND_ORE));
|
||||
self::register("deepslate_emerald_ore", $factory->fromTypeId(Ids::DEEPSLATE_EMERALD_ORE));
|
||||
self::register("deepslate_gold_ore", $factory->fromTypeId(Ids::DEEPSLATE_GOLD_ORE));
|
||||
self::register("deepslate_iron_ore", $factory->fromTypeId(Ids::DEEPSLATE_IRON_ORE));
|
||||
self::register("deepslate_lapis_lazuli_ore", $factory->fromTypeId(Ids::DEEPSLATE_LAPIS_LAZULI_ORE));
|
||||
self::register("deepslate_redstone_ore", $factory->fromTypeId(Ids::DEEPSLATE_REDSTONE_ORE));
|
||||
self::register("deepslate_tile_slab", $factory->fromTypeId(Ids::DEEPSLATE_TILE_SLAB));
|
||||
self::register("deepslate_tile_stairs", $factory->fromTypeId(Ids::DEEPSLATE_TILE_STAIRS));
|
||||
self::register("deepslate_tile_wall", $factory->fromTypeId(Ids::DEEPSLATE_TILE_WALL));
|
||||
@ -1075,6 +1094,7 @@ final class VanillaBlocks{
|
||||
self::register("nether_brick_stairs", $factory->fromTypeId(Ids::NETHER_BRICK_STAIRS));
|
||||
self::register("nether_brick_wall", $factory->fromTypeId(Ids::NETHER_BRICK_WALL));
|
||||
self::register("nether_bricks", $factory->fromTypeId(Ids::NETHER_BRICKS));
|
||||
self::register("nether_gold_ore", $factory->fromTypeId(Ids::NETHER_GOLD_ORE));
|
||||
self::register("nether_portal", $factory->fromTypeId(Ids::NETHER_PORTAL));
|
||||
self::register("nether_quartz_ore", $factory->fromTypeId(Ids::NETHER_QUARTZ_ORE));
|
||||
self::register("nether_reactor_core", $factory->fromTypeId(Ids::NETHER_REACTOR_CORE));
|
||||
|
@ -432,6 +432,7 @@ final class BlockObjectToBlockStateSerializer implements BlockStateSerializer{
|
||||
return Writer::create(Ids::CONCRETE_POWDER)
|
||||
->writeColor($block->getColor());
|
||||
});
|
||||
$this->mapSimple(Blocks::COPPER_ORE(), Ids::COPPER_ORE);
|
||||
$this->map(Blocks::CORAL(), function(Coral $block) : Writer{
|
||||
return Writer::create(Ids::CORAL)
|
||||
->writeBool(StateNames::DEAD_BIT, $block->isDead())
|
||||
@ -510,6 +511,14 @@ final class BlockObjectToBlockStateSerializer implements BlockStateSerializer{
|
||||
$this->mapSlab(Blocks::DEEPSLATE_BRICK_SLAB(), Ids::DEEPSLATE_BRICK_SLAB, Ids::DEEPSLATE_BRICK_DOUBLE_SLAB);
|
||||
$this->mapStairs(Blocks::DEEPSLATE_BRICK_STAIRS(), Ids::DEEPSLATE_BRICK_STAIRS);
|
||||
$this->map(Blocks::DEEPSLATE_BRICK_WALL(), fn(Wall $block) => Helper::encodeWall($block, new Writer(Ids::DEEPSLATE_BRICK_WALL)));
|
||||
$this->mapSimple(Blocks::DEEPSLATE_COAL_ORE(), Ids::DEEPSLATE_COAL_ORE);
|
||||
$this->mapSimple(Blocks::DEEPSLATE_COPPER_ORE(), Ids::DEEPSLATE_COPPER_ORE);
|
||||
$this->mapSimple(Blocks::DEEPSLATE_DIAMOND_ORE(), Ids::DEEPSLATE_DIAMOND_ORE);
|
||||
$this->mapSimple(Blocks::DEEPSLATE_EMERALD_ORE(), Ids::DEEPSLATE_EMERALD_ORE);
|
||||
$this->mapSimple(Blocks::DEEPSLATE_GOLD_ORE(), Ids::DEEPSLATE_GOLD_ORE);
|
||||
$this->mapSimple(Blocks::DEEPSLATE_IRON_ORE(), Ids::DEEPSLATE_IRON_ORE);
|
||||
$this->mapSimple(Blocks::DEEPSLATE_LAPIS_LAZULI_ORE(), Ids::DEEPSLATE_LAPIS_ORE);
|
||||
$this->map(Blocks::DEEPSLATE_REDSTONE_ORE(), fn(RedstoneOre $block) => new Writer($block->isLit() ? Ids::LIT_DEEPSLATE_REDSTONE_ORE : Ids::DEEPSLATE_REDSTONE_ORE));
|
||||
$this->mapSimple(Blocks::DEEPSLATE_TILES(), Ids::DEEPSLATE_TILES);
|
||||
$this->mapSlab(Blocks::DEEPSLATE_TILE_SLAB(), Ids::DEEPSLATE_TILE_SLAB, Ids::DEEPSLATE_TILE_DOUBLE_SLAB);
|
||||
$this->mapStairs(Blocks::DEEPSLATE_TILE_STAIRS(), Ids::DEEPSLATE_TILE_STAIRS);
|
||||
@ -891,6 +900,7 @@ final class BlockObjectToBlockStateSerializer implements BlockStateSerializer{
|
||||
$this->map(Blocks::NETHER_BRICK_SLAB(), fn(Slab $block) => Helper::encodeStoneSlab1($block, StringValues::STONE_SLAB_TYPE_NETHER_BRICK));
|
||||
$this->mapStairs(Blocks::NETHER_BRICK_STAIRS(), Ids::NETHER_BRICK_STAIRS);
|
||||
$this->map(Blocks::NETHER_BRICK_WALL(), fn(Wall $block) => Helper::encodeLegacyWall($block, StringValues::WALL_BLOCK_TYPE_NETHER_BRICK));
|
||||
$this->mapSimple(Blocks::NETHER_GOLD_ORE(), Ids::NETHER_GOLD_ORE);
|
||||
$this->map(Blocks::NETHER_PORTAL(), function(NetherPortal $block) : Writer{
|
||||
return Writer::create(Ids::PORTAL)
|
||||
->writeString(StateNames::PORTAL_AXIS, match($block->getAxis()){
|
||||
|
@ -270,6 +270,7 @@ final class BlockStateToBlockObjectDeserializer implements BlockStateDeserialize
|
||||
return Blocks::CONCRETE_POWDER()
|
||||
->setColor($in->readColor());
|
||||
});
|
||||
$this->map(Ids::COPPER_ORE, fn() => Blocks::COPPER_ORE());
|
||||
$this->map(Ids::CORAL, function(Reader $in) : Block{
|
||||
return Blocks::CORAL()
|
||||
->setCoralType($in->readCoralType())
|
||||
@ -336,6 +337,14 @@ final class BlockStateToBlockObjectDeserializer implements BlockStateDeserialize
|
||||
$this->mapSlab(Ids::DEEPSLATE_BRICK_SLAB, Ids::DEEPSLATE_BRICK_DOUBLE_SLAB, fn() => Blocks::DEEPSLATE_BRICK_SLAB());
|
||||
$this->mapStairs(Ids::DEEPSLATE_BRICK_STAIRS, fn() => Blocks::DEEPSLATE_BRICK_STAIRS());
|
||||
$this->map(Ids::DEEPSLATE_BRICK_WALL, fn(Reader $in) => Helper::decodeWall(Blocks::DEEPSLATE_BRICK_WALL(), $in));
|
||||
$this->map(Ids::DEEPSLATE_COAL_ORE, fn() => Blocks::DEEPSLATE_COAL_ORE());
|
||||
$this->map(Ids::DEEPSLATE_COPPER_ORE, fn() => Blocks::DEEPSLATE_COPPER_ORE());
|
||||
$this->map(Ids::DEEPSLATE_DIAMOND_ORE, fn() => Blocks::DEEPSLATE_DIAMOND_ORE());
|
||||
$this->map(Ids::DEEPSLATE_EMERALD_ORE, fn() => Blocks::DEEPSLATE_EMERALD_ORE());
|
||||
$this->map(Ids::DEEPSLATE_GOLD_ORE, fn() => Blocks::DEEPSLATE_GOLD_ORE());
|
||||
$this->map(Ids::DEEPSLATE_IRON_ORE, fn() => Blocks::DEEPSLATE_IRON_ORE());
|
||||
$this->map(Ids::DEEPSLATE_LAPIS_ORE, fn() => Blocks::DEEPSLATE_LAPIS_LAZULI_ORE());
|
||||
$this->map(Ids::DEEPSLATE_REDSTONE_ORE, fn() => Blocks::DEEPSLATE_REDSTONE_ORE()->setLit(false));
|
||||
$this->map(Ids::DEEPSLATE_TILES, fn() => Blocks::DEEPSLATE_TILES());
|
||||
$this->mapSlab(Ids::DEEPSLATE_TILE_SLAB, Ids::DEEPSLATE_TILE_DOUBLE_SLAB, fn() => Blocks::DEEPSLATE_TILE_SLAB());
|
||||
$this->mapStairs(Ids::DEEPSLATE_TILE_STAIRS, fn() => Blocks::DEEPSLATE_TILE_STAIRS());
|
||||
@ -689,6 +698,7 @@ final class BlockStateToBlockObjectDeserializer implements BlockStateDeserialize
|
||||
->setFacing($in->readHorizontalFacing())
|
||||
->setLit(true);
|
||||
});
|
||||
$this->map(Ids::LIT_DEEPSLATE_REDSTONE_ORE, fn() => Blocks::DEEPSLATE_REDSTONE_ORE()->setLit(true));
|
||||
$this->map(Ids::LIT_FURNACE, function(Reader $in) : Block{
|
||||
return Blocks::FURNACE()
|
||||
->setFacing($in->readHorizontalFacing())
|
||||
@ -766,6 +776,7 @@ final class BlockStateToBlockObjectDeserializer implements BlockStateDeserialize
|
||||
$this->map(Ids::NETHER_BRICK, fn() => Blocks::NETHER_BRICKS());
|
||||
$this->map(Ids::NETHER_BRICK_FENCE, fn() => Blocks::NETHER_BRICK_FENCE());
|
||||
$this->mapStairs(Ids::NETHER_BRICK_STAIRS, fn() => Blocks::NETHER_BRICK_STAIRS());
|
||||
$this->map(Ids::NETHER_GOLD_ORE, fn() => Blocks::NETHER_GOLD_ORE());
|
||||
$this->map(Ids::NETHER_WART, function(Reader $in) : Block{
|
||||
return Blocks::NETHER_WART()
|
||||
->setAge($in->readBoundedInt(StateNames::AGE, 0, 3));
|
||||
|
@ -211,6 +211,7 @@ final class StringToItemParser extends StringToTParser{
|
||||
$result->registerBlock("concrete", fn() => Blocks::CONCRETE());
|
||||
$result->registerBlock("concrete_powder", fn() => Blocks::CONCRETE_POWDER());
|
||||
$result->registerBlock("concretepowder", fn() => Blocks::CONCRETE_POWDER());
|
||||
$result->registerBlock("copper_ore", fn() => Blocks::COPPER_ORE());
|
||||
$result->registerBlock("coral", fn() => Blocks::CORAL());
|
||||
$result->registerBlock("coral_block", fn() => Blocks::CORAL_BLOCK());
|
||||
$result->registerBlock("coral_fan", fn() => Blocks::CORAL_FAN());
|
||||
@ -284,6 +285,14 @@ final class StringToItemParser extends StringToTParser{
|
||||
$result->registerBlock("deepslate_tile_slab", fn() => Blocks::DEEPSLATE_TILE_SLAB());
|
||||
$result->registerBlock("deepslate_tile_stairs", fn() => Blocks::DEEPSLATE_TILE_STAIRS());
|
||||
$result->registerBlock("deepslate_tile_wall", fn() => Blocks::DEEPSLATE_TILE_WALL());
|
||||
$result->registerBlock("deepslate_coal_ore", fn() => Blocks::DEEPSLATE_COAL_ORE());
|
||||
$result->registerBlock("deepslate_copper_ore", fn() => Blocks::DEEPSLATE_COPPER_ORE());
|
||||
$result->registerBlock("deepslate_diamond_ore", fn() => Blocks::DEEPSLATE_DIAMOND_ORE());
|
||||
$result->registerBlock("deepslate_emerald_ore", fn() => Blocks::DEEPSLATE_EMERALD_ORE());
|
||||
$result->registerBlock("deepslate_gold_ore", fn() => Blocks::DEEPSLATE_GOLD_ORE());
|
||||
$result->registerBlock("deepslate_iron_ore", fn() => Blocks::DEEPSLATE_IRON_ORE());
|
||||
$result->registerBlock("deepslate_lapis_lazuli_ore", fn() => Blocks::DEEPSLATE_LAPIS_LAZULI_ORE());
|
||||
$result->registerBlock("deepslate_redstone_ore", fn() => Blocks::DEEPSLATE_REDSTONE_ORE());
|
||||
$result->registerBlock("detector_rail", fn() => Blocks::DETECTOR_RAIL());
|
||||
$result->registerBlock("diamond_block", fn() => Blocks::DIAMOND());
|
||||
$result->registerBlock("diamond_ore", fn() => Blocks::DIAMOND_ORE());
|
||||
@ -738,6 +747,7 @@ final class StringToItemParser extends StringToTParser{
|
||||
$result->registerBlock("nether_brick_wall", fn() => Blocks::NETHER_BRICK_WALL());
|
||||
$result->registerBlock("nether_bricks", fn() => Blocks::NETHER_BRICKS());
|
||||
$result->registerBlock("nether_bricks_stairs", fn() => Blocks::NETHER_BRICK_STAIRS());
|
||||
$result->registerBlock("nether_gold_ore", fn() => Blocks::NETHER_GOLD_ORE());
|
||||
$result->registerBlock("nether_portal", fn() => Blocks::NETHER_PORTAL());
|
||||
$result->registerBlock("nether_quartz_ore", fn() => Blocks::NETHER_QUARTZ_ORE());
|
||||
$result->registerBlock("nether_reactor", fn() => Blocks::NETHER_REACTOR_CORE());
|
||||
|
Loading…
x
Reference in New Issue
Block a user