Added raw copper, gold and iron blocks

This commit is contained in:
Dylan K. Taylor 2022-07-02 23:17:10 +01:00
parent 0d0296d535
commit 0e0b858b69
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
6 changed files with 23 additions and 1 deletions

View File

@ -874,6 +874,10 @@ class BlockFactory{
private function registerBlocksR17() : void{
//in java this can be acquired using any tool - seems to be a parity issue in bedrock
$this->register(new Opaque(new BID(Ids::AMETHYST), "Amethyst", new BreakInfo(1.5, ToolType::PICKAXE, ToolTier::WOOD()->getHarvestLevel())));
$this->register(new Opaque(new BID(Ids::RAW_COPPER), "Raw Copper Block", new BreakInfo(5, ToolType::PICKAXE, ToolTier::STONE()->getHarvestLevel())));
$this->register(new Opaque(new BID(Ids::RAW_GOLD), "Raw Gold Block", new BreakInfo(5, ToolType::PICKAXE, ToolTier::IRON()->getHarvestLevel())));
$this->register(new Opaque(new BID(Ids::RAW_IRON), "Raw Iron Block", new BreakInfo(5, ToolType::PICKAXE, ToolTier::STONE()->getHarvestLevel())));
}
/**

View File

@ -586,6 +586,9 @@ final class BlockTypeIds{
public const POLISHED_BLACKSTONE_BRICK_WALL = 10559;
public const CRACKED_POLISHED_BLACKSTONE_BRICKS = 10560;
public const LIGHT = 10561;
public const RAW_COPPER = 10562;
public const RAW_GOLD = 10563;
public const RAW_IRON = 10564;
public const FIRST_UNUSED_BLOCK_ID = 10562;
public const FIRST_UNUSED_BLOCK_ID = 10565;
}

View File

@ -469,6 +469,9 @@ use pocketmine\utils\CloningRegistryTrait;
* @method static Slab QUARTZ_SLAB()
* @method static Stair QUARTZ_STAIRS()
* @method static Rail RAIL()
* @method static Opaque RAW_COPPER()
* @method static Opaque RAW_GOLD()
* @method static Opaque RAW_IRON()
* @method static Redstone REDSTONE()
* @method static RedstoneComparator REDSTONE_COMPARATOR()
* @method static RedstoneLamp REDSTONE_LAMP()
@ -1027,6 +1030,9 @@ final class VanillaBlocks{
self::register("quartz_slab", $factory->get(Ids::QUARTZ_SLAB, 0));
self::register("quartz_stairs", $factory->get(Ids::QUARTZ_STAIRS, 0));
self::register("rail", $factory->get(Ids::RAIL, 0));
self::register("raw_copper", $factory->get(Ids::RAW_COPPER, 0));
self::register("raw_gold", $factory->get(Ids::RAW_GOLD, 0));
self::register("raw_iron", $factory->get(Ids::RAW_IRON, 0));
self::register("red_mushroom", $factory->get(Ids::RED_MUSHROOM, 0));
self::register("red_mushroom_block", $factory->get(Ids::RED_MUSHROOM_BLOCK, 10));
self::register("red_nether_brick_slab", $factory->get(Ids::RED_NETHER_BRICK_SLAB, 0));

View File

@ -938,6 +938,9 @@ final class BlockObjectToBlockStateSerializer implements BlockStateSerializer{
return Writer::create(Ids::RAIL)
->writeInt(StateNames::RAIL_DIRECTION, $block->getShape());
});
$this->mapSimple(Blocks::RAW_COPPER(), Ids::RAW_COPPER_BLOCK);
$this->mapSimple(Blocks::RAW_GOLD(), Ids::RAW_GOLD_BLOCK);
$this->mapSimple(Blocks::RAW_IRON(), Ids::RAW_IRON_BLOCK);
$this->mapSimple(Blocks::REDSTONE(), Ids::REDSTONE_BLOCK);
$this->map(Blocks::REDSTONE_COMPARATOR(), function(RedstoneComparator $block) : Writer{
return Writer::create($block->isPowered() ? Ids::POWERED_COMPARATOR : Ids::UNPOWERED_COMPARATOR)

View File

@ -824,6 +824,9 @@ final class BlockStateToBlockObjectDeserializer implements BlockStateDeserialize
return Blocks::RAIL()
->setShape($in->readBoundedInt(StateNames::RAIL_DIRECTION, 0, 9));
});
$this->map(Ids::RAW_COPPER_BLOCK, fn() => Blocks::RAW_COPPER());
$this->map(Ids::RAW_GOLD_BLOCK, fn() => Blocks::RAW_GOLD());
$this->map(Ids::RAW_IRON_BLOCK, fn() => Blocks::RAW_IRON());
$this->map(Ids::RED_FLOWER, function(Reader $in) : Block{
return match($type = $in->readString(StateNames::FLOWER_TYPE)){
StringValues::FLOWER_TYPE_ALLIUM => Blocks::ALLIUM(),

View File

@ -781,6 +781,9 @@ final class StringToItemParser extends StringToTParser{
$result->registerBlock("quartz_slab", fn() => Blocks::QUARTZ_SLAB());
$result->registerBlock("quartz_stairs", fn() => Blocks::QUARTZ_STAIRS());
$result->registerBlock("rail", fn() => Blocks::RAIL());
$result->registerBlock("raw_copper_block", fn() => Blocks::RAW_COPPER());
$result->registerBlock("raw_gold_block", fn() => Blocks::RAW_GOLD());
$result->registerBlock("raw_iron_block", fn() => Blocks::RAW_IRON());
$result->registerBlock("red_flower", fn() => Blocks::POPPY());
$result->registerBlock("red_mushroom", fn() => Blocks::RED_MUSHROOM());
$result->registerBlock("red_mushroom_block", fn() => Blocks::RED_MUSHROOM_BLOCK());