diff --git a/src/block/BlockTypeIds.php b/src/block/BlockTypeIds.php index e4d49746f..7bda65963 100644 --- a/src/block/BlockTypeIds.php +++ b/src/block/BlockTypeIds.php @@ -822,8 +822,12 @@ final class BlockTypeIds{ public const WARPED_CEILING_CENTER_HANGING_SIGN = 10792; public const WARPED_CEILING_EDGES_HANGING_SIGN = 10793; public const WARPED_WALL_HANGING_SIGN = 10794; + public const COPPER_BARS = 10795; + public const COPPER_CHAIN = 10796; + public const COPPER_LANTERN = 10797; + public const COPPER_TORCH = 10798; - public const FIRST_UNUSED_BLOCK_ID = 10795; + public const FIRST_UNUSED_BLOCK_ID = 10799; private static int $nextDynamicId = self::FIRST_UNUSED_BLOCK_ID; diff --git a/src/block/Chain.php b/src/block/Chain.php index 12b379852..7d25bf7f7 100644 --- a/src/block/Chain.php +++ b/src/block/Chain.php @@ -30,7 +30,7 @@ use pocketmine\math\Axis; use pocketmine\math\AxisAlignedBB; use pocketmine\math\Facing; -final class Chain extends Transparent implements PillarRotation{ +class Chain extends Transparent implements PillarRotation{ use PillarRotationTrait; public function getSupportType(Facing $facing) : SupportType{ diff --git a/src/block/CopperBars.php b/src/block/CopperBars.php new file mode 100644 index 000000000..82966ca99 --- /dev/null +++ b/src/block/CopperBars.php @@ -0,0 +1,31 @@ + new Opaque($id, "Iron Block", $ironBreakInfo)); self::register("iron_bars", fn(BID $id) => new Thin($id, "Iron Bars", $ironBreakInfo)); + self::register("copper_bars", fn(BID $id) => new CopperBars($id, "Copper Bars", $ironBreakInfo)); self::register("iron_door", fn(BID $id) => new Door($id, "Iron Door", new Info(BreakInfo::pickaxe(5.0)))); self::register("iron_trapdoor", fn(BID $id) => new Trapdoor($id, "Iron Trapdoor", new Info(BreakInfo::pickaxe(5.0, ToolTier::WOOD)))); @@ -1049,6 +1054,7 @@ final class VanillaBlocks{ $lanternBreakInfo = new Info(BreakInfo::pickaxe(3.5)); self::register("lantern", fn(BID $id) => new Lantern($id, "Lantern", $lanternBreakInfo, 15)); self::register("soul_lantern", fn(BID $id) => new Lantern($id, "Soul Lantern", $lanternBreakInfo, 10)); + self::register("copper_lantern", fn(BID $id) => new CopperLantern($id, "Copper Lantern", $lanternBreakInfo, 15)); self::register("lapis_lazuli", fn(BID $id) => new Opaque($id, "Lapis Lazuli Block", new Info(BreakInfo::pickaxe(3.0, ToolTier::STONE)))); self::register("lava", fn(BID $id) => new Lava($id, "Lava", new Info(BreakInfo::indestructible(500.0)))); @@ -1227,6 +1233,7 @@ final class VanillaBlocks{ self::register("tall_grass", fn(BID $id) => new TallGrass($id, "Tall Grass", new Info(BreakInfo::instant(ToolType::SHEARS, 1)))); self::register("blue_torch", fn(BID $id) => new Torch($id, "Blue Torch", new Info(BreakInfo::instant()))); + self::register("copper_torch", fn(BID $id) => new Torch($id, "Copper Torch", new Info(BreakInfo::instant()))); self::register("purple_torch", fn(BID $id) => new Torch($id, "Purple Torch", new Info(BreakInfo::instant()))); self::register("red_torch", fn(BID $id) => new Torch($id, "Red Torch", new Info(BreakInfo::instant()))); self::register("green_torch", fn(BID $id) => new Torch($id, "Green Torch", new Info(BreakInfo::instant()))); @@ -1704,6 +1711,7 @@ final class VanillaBlocks{ self::register("warped_roots", fn(BID $id) => new NetherRoots($id, "Warped Roots", $netherRootsInfo)); self::register("chain", fn(BID $id) => new Chain($id, "Chain", new Info(BreakInfo::pickaxe(5.0, ToolTier::WOOD, 30.0)))); + self::register("copper_chain", fn(BID $id) => new CopperChain($id, "Copper Chain", new Info(BreakInfo::pickaxe(5.0, ToolTier::WOOD, 30.0)))); self::register("respawn_anchor", fn(BID $id) => new RespawnAnchor($id, "Respawn Anchor", new Info(BreakInfo::pickaxe(50.0, ToolTier::DIAMOND, 6000.0)))); } @@ -1765,7 +1773,6 @@ final class VanillaBlocks{ self::register("tinted_glass", fn(BID $id) => new TintedGlass($id, "Tinted Glass", new Info(new BreakInfo(0.3)))); - //blast resistance should be 30 if we were matched with java :( $copperBreakInfo = new Info(BreakInfo::pickaxe(3.0, ToolTier::STONE, 30.0)); self::register("lightning_rod", fn(BID $id) => new LightningRod($id, "Lightning Rod", $copperBreakInfo)); diff --git a/src/data/bedrock/block/convert/VanillaBlockMappings.php b/src/data/bedrock/block/convert/VanillaBlockMappings.php index dae9d7991..90009f835 100644 --- a/src/data/bedrock/block/convert/VanillaBlockMappings.php +++ b/src/data/bedrock/block/convert/VanillaBlockMappings.php @@ -43,6 +43,7 @@ use pocketmine\block\ChiseledBookshelf; use pocketmine\block\ChorusFlower; use pocketmine\block\CocoaBlock; use pocketmine\block\Copper; +use pocketmine\block\CopperLantern; use pocketmine\block\DaylightSensor; use pocketmine\block\DetectorRail; use pocketmine\block\Dirt; @@ -665,6 +666,25 @@ final class VanillaBlockMappings{ ]) ->properties([$commonProperties->slabPositionProperty]) ); + + $reg->mapFlattenedId(FlattenedIdModel::create(Blocks::COPPER_BARS())->idComponents([...$commonProperties->copperIdPrefixes, "copper_bars"])); + $reg->mapFlattenedId(FlattenedIdModel::create(Blocks::COPPER_CHAIN()) + ->idComponents([...$commonProperties->copperIdPrefixes, "copper_chain"]) + ->properties([$commonProperties->pillarAxis]) + ); + $reg->mapFlattenedId(FlattenedIdModel::create(Blocks::COPPER_LANTERN()) + ->idComponents([...$commonProperties->copperIdPrefixes, "copper_lantern"]) + ->properties([ + new BoolProperty(StateNames::HANGING, fn(CopperLantern $b) => $b->isHanging(), fn(CopperLantern $b, bool $v) => $b->setHanging($v)) + ]) + ); + $reg->mapFlattenedId(FlattenedIdModel::create(Blocks::LIGHTNING_ROD()) + ->idComponents([...$commonProperties->copperIdPrefixes, "lightning_rod"]) + ->properties([ + $commonProperties->anyFacingClassic, + new DummyProperty(StateNames::POWERED_BIT, false) //TODO + ]) + ); } private static function registerFlattenedEnumMappings(BlockSerializerDeserializerRegistrar $reg, CommonProperties $commonProperties) : void{ @@ -1188,6 +1208,7 @@ final class VanillaBlockMappings{ private static function registerTorchMappings(BlockSerializerDeserializerRegistrar $reg, CommonProperties $commonProperties) : void{ foreach([ [Blocks::BLUE_TORCH(), Ids::COLORED_TORCH_BLUE], + [Blocks::COPPER_TORCH(), Ids::COPPER_TORCH], [Blocks::GREEN_TORCH(), Ids::COLORED_TORCH_GREEN], [Blocks::PURPLE_TORCH(), Ids::COLORED_TORCH_PURPLE], [Blocks::RED_TORCH(), Ids::COLORED_TORCH_RED], @@ -1359,10 +1380,6 @@ final class VanillaBlockMappings{ new ValueFromStringProperty(StateNames::LEVER_DIRECTION, ValueMappings::getInstance()->leverFacing, fn(Lever $b) => $b->getFacing(), fn(Lever $b, LeverFacing $v) => $b->setFacing($v)), new BoolProperty(StateNames::OPEN_BIT, fn(Lever $b) => $b->isActivated(), fn(Lever $b, bool $v) => $b->setActivated($v)), ])); - $reg->mapModel(Model::create(Blocks::LIGHTNING_ROD(), Ids::LIGHTNING_ROD)->properties([ - $commonProperties->anyFacingClassic, - new DummyProperty(StateNames::POWERED_BIT, false) //TODO - ])); $reg->mapModel(Model::create(Blocks::LIT_PUMPKIN(), Ids::LIT_PUMPKIN)->properties([$commonProperties->horizontalFacingCardinal])); $reg->mapModel(Model::create(Blocks::LOOM(), Ids::LOOM)->properties([$commonProperties->horizontalFacingSWNE])); diff --git a/src/entity/Squid.php b/src/entity/Squid.php index 7d6d9bbb3..be20a3fdf 100644 --- a/src/entity/Squid.php +++ b/src/entity/Squid.php @@ -45,7 +45,7 @@ class Squid extends WaterAnimal{ private int $switchDirectionTicker = 0; - protected function getInitialSizeInfo() : EntitySizeInfo{ return new EntitySizeInfo(0.95, 0.95); } + protected function getInitialSizeInfo() : EntitySizeInfo{ return new EntitySizeInfo(0.8, 0.8); } public function initEntity(CompoundTag $nbt) : void{ $this->setMaxHealth(10); diff --git a/src/entity/Villager.php b/src/entity/Villager.php index cbb06d1e6..edd186bed 100644 --- a/src/entity/Villager.php +++ b/src/entity/Villager.php @@ -46,7 +46,7 @@ class Villager extends Living implements Ageable{ private int $profession = self::PROFESSION_FARMER; protected function getInitialSizeInfo() : EntitySizeInfo{ - return new EntitySizeInfo(1.8, 0.6); //TODO: eye height?? + return new EntitySizeInfo(1.9, 0.6); //TODO: eye height?? } public function getName() : string{ diff --git a/src/entity/Zombie.php b/src/entity/Zombie.php index e8ee1c448..30b4802df 100644 --- a/src/entity/Zombie.php +++ b/src/entity/Zombie.php @@ -33,7 +33,7 @@ class Zombie extends Living{ public function getNetworkTypeId() : string{ return EntityIds::ZOMBIE; } protected function getInitialSizeInfo() : EntitySizeInfo{ - return new EntitySizeInfo(1.8, 0.6); //TODO: eye height ?? + return new EntitySizeInfo(1.9, 0.6); //TODO: eye height ?? } public function getName() : string{ diff --git a/src/item/StringToItemParser.php b/src/item/StringToItemParser.php index 77676ea01..e222fc098 100644 --- a/src/item/StringToItemParser.php +++ b/src/item/StringToItemParser.php @@ -106,6 +106,10 @@ final class StringToItemParser extends StringToTParser{ $register("copper_bulb", fn() => Blocks::COPPER_BULB()->setOxidation($oxidation)->setWaxed($waxed)); $register("copper_door", fn() => Blocks::COPPER_DOOR()->setOxidation($oxidation)->setWaxed($waxed)); $register("copper_trapdoor", fn() => Blocks::COPPER_TRAPDOOR()->setOxidation($oxidation)->setWaxed($waxed)); + $register("copper_bars", fn() => Blocks::COPPER_BARS()->setOxidation($oxidation)->setWaxed($waxed)); + $register("copper_chain", fn() => Blocks::COPPER_CHAIN()->setOxidation($oxidation)->setWaxed($waxed)); + $register("copper_lantern", fn() => Blocks::COPPER_LANTERN()->setOxidation($oxidation)->setWaxed($waxed)); + $register("lightning_rod", fn() => Blocks::LIGHTNING_ROD()->setOxidation($oxidation)->setWaxed($waxed)); } } @@ -279,6 +283,7 @@ final class StringToItemParser extends StringToTParser{ $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("copper_torch", fn() => Blocks::COPPER_TORCH()); $result->registerBlock("coral", fn() => Blocks::CORAL()); $result->registerBlock("coral_block", fn() => Blocks::CORAL_BLOCK()); $result->registerBlock("coral_fan", fn() => Blocks::CORAL_FAN()); @@ -771,7 +776,6 @@ final class StringToItemParser extends StringToTParser{ $result->registerBlock("light", fn() => Blocks::LIGHT()); $result->registerBlock("light_block", fn() => Blocks::LIGHT()); $result->registerBlock("light_weighted_pressure_plate", fn() => Blocks::WEIGHTED_PRESSURE_PLATE_LIGHT()); - $result->registerBlock("lightning_rod", fn() => Blocks::LIGHTNING_ROD()); $result->registerBlock("lilac", fn() => Blocks::LILAC()); $result->registerBlock("lily_of_the_valley", fn() => Blocks::LILY_OF_THE_VALLEY()); $result->registerBlock("lily_pad", fn() => Blocks::LILY_PAD()); diff --git a/tests/phpunit/block/block_factory_consistency_check.json b/tests/phpunit/block/block_factory_consistency_check.json index b96607c0b..356d6adfb 100644 --- a/tests/phpunit/block/block_factory_consistency_check.json +++ b/tests/phpunit/block/block_factory_consistency_check.json @@ -145,10 +145,14 @@ "CONCRETE": 16, "CONCRETE_POWDER": 16, "COPPER": 8, + "COPPER_BARS": 8, "COPPER_BULB": 32, + "COPPER_CHAIN": 24, "COPPER_DOOR": 256, "COPPER_GRATE": 8, + "COPPER_LANTERN": 16, "COPPER_ORE": 1, + "COPPER_TORCH": 5, "COPPER_TRAPDOOR": 128, "CORAL": 10, "CORAL_BLOCK": 10, @@ -453,7 +457,7 @@ "LEGACY_STONECUTTER": 1, "LEVER": 16, "LIGHT": 16, - "LIGHTNING_ROD": 6, + "LIGHTNING_ROD": 48, "LILAC": 2, "LILY_OF_THE_VALLEY": 1, "LILY_PAD": 1,