Merge remote-tracking branch 'origin/minor-next' into major-next

This commit is contained in:
Dylan K. Taylor
2025-08-24 23:18:21 +01:00
57 changed files with 4984 additions and 3636 deletions

View File

@ -600,6 +600,12 @@ parameters:
count: 1
path: ../../../src/crash/CrashDumpRenderer.php
-
message: '#^Parameter \#1 \$faces of method pocketmine\\block\\Vine\:\:setFaces\(\) expects list\<2\|3\|4\|5\>, array\<int\> given\.$#'
identifier: argument.type
count: 1
path: ../../../src/data/bedrock/block/convert/VanillaBlockMappings.php
-
message: '#^Parameter \#1 \$blockToItemId of class pocketmine\\data\\bedrock\\item\\BlockItemIdMap constructor expects array\<string, string\>, array\<mixed, mixed\> given\.$#'
identifier: argument.type

View File

@ -18,78 +18,138 @@ parameters:
count: 1
path: ../../../src/Server.php
-
message: '#^Method pocketmine\\block\\Block\:\:readStateFromWorld\(\) is marked as impure but does not have any side effects\.$#'
identifier: impureMethod.pure
count: 1
path: ../../../src/block/Block.php
-
message: '#^Method pocketmine\\block\\DoubleTallGrass\:\:traitGetDropsForIncompatibleTool\(\) return type has no value type specified in iterable type array\.$#'
identifier: missingType.iterableValue
count: 1
path: ../../../src/block/DoubleTallGrass.php
-
message: '#^Creating callable from a non\-native static method pocketmine\\item\\VanillaItems\:\:ACACIA_HANGING_SIGN\(\)\.$#'
identifier: callable.nonNativeMethod
count: 1
path: ../../../src/block/VanillaBlocks.php
-
message: '#^Creating callable from a non\-native static method pocketmine\\item\\VanillaItems\:\:ACACIA_SIGN\(\)\.$#'
identifier: callable.nonNativeMethod
count: 1
path: ../../../src/block/VanillaBlocks.php
-
message: '#^Creating callable from a non\-native static method pocketmine\\item\\VanillaItems\:\:BIRCH_HANGING_SIGN\(\)\.$#'
identifier: callable.nonNativeMethod
count: 1
path: ../../../src/block/VanillaBlocks.php
-
message: '#^Creating callable from a non\-native static method pocketmine\\item\\VanillaItems\:\:BIRCH_SIGN\(\)\.$#'
identifier: callable.nonNativeMethod
count: 1
path: ../../../src/block/VanillaBlocks.php
-
message: '#^Creating callable from a non\-native static method pocketmine\\item\\VanillaItems\:\:CHERRY_HANGING_SIGN\(\)\.$#'
identifier: callable.nonNativeMethod
count: 1
path: ../../../src/block/VanillaBlocks.php
-
message: '#^Creating callable from a non\-native static method pocketmine\\item\\VanillaItems\:\:CHERRY_SIGN\(\)\.$#'
identifier: callable.nonNativeMethod
count: 1
path: ../../../src/block/VanillaBlocks.php
-
message: '#^Creating callable from a non\-native static method pocketmine\\item\\VanillaItems\:\:CRIMSON_HANGING_SIGN\(\)\.$#'
identifier: callable.nonNativeMethod
count: 1
path: ../../../src/block/VanillaBlocks.php
-
message: '#^Creating callable from a non\-native static method pocketmine\\item\\VanillaItems\:\:CRIMSON_SIGN\(\)\.$#'
identifier: callable.nonNativeMethod
count: 1
path: ../../../src/block/VanillaBlocks.php
-
message: '#^Creating callable from a non\-native static method pocketmine\\item\\VanillaItems\:\:DARK_OAK_HANGING_SIGN\(\)\.$#'
identifier: callable.nonNativeMethod
count: 1
path: ../../../src/block/VanillaBlocks.php
-
message: '#^Creating callable from a non\-native static method pocketmine\\item\\VanillaItems\:\:DARK_OAK_SIGN\(\)\.$#'
identifier: callable.nonNativeMethod
count: 1
path: ../../../src/block/VanillaBlocks.php
-
message: '#^Creating callable from a non\-native static method pocketmine\\item\\VanillaItems\:\:JUNGLE_HANGING_SIGN\(\)\.$#'
identifier: callable.nonNativeMethod
count: 1
path: ../../../src/block/VanillaBlocks.php
-
message: '#^Creating callable from a non\-native static method pocketmine\\item\\VanillaItems\:\:JUNGLE_SIGN\(\)\.$#'
identifier: callable.nonNativeMethod
count: 1
path: ../../../src/block/VanillaBlocks.php
-
message: '#^Creating callable from a non\-native static method pocketmine\\item\\VanillaItems\:\:MANGROVE_HANGING_SIGN\(\)\.$#'
identifier: callable.nonNativeMethod
count: 1
path: ../../../src/block/VanillaBlocks.php
-
message: '#^Creating callable from a non\-native static method pocketmine\\item\\VanillaItems\:\:MANGROVE_SIGN\(\)\.$#'
identifier: callable.nonNativeMethod
count: 1
path: ../../../src/block/VanillaBlocks.php
-
message: '#^Creating callable from a non\-native static method pocketmine\\item\\VanillaItems\:\:OAK_HANGING_SIGN\(\)\.$#'
identifier: callable.nonNativeMethod
count: 1
path: ../../../src/block/VanillaBlocks.php
-
message: '#^Creating callable from a non\-native static method pocketmine\\item\\VanillaItems\:\:OAK_SIGN\(\)\.$#'
identifier: callable.nonNativeMethod
count: 1
path: ../../../src/block/VanillaBlocks.php
-
message: '#^Creating callable from a non\-native static method pocketmine\\item\\VanillaItems\:\:PALE_OAK_HANGING_SIGN\(\)\.$#'
identifier: callable.nonNativeMethod
count: 1
path: ../../../src/block/VanillaBlocks.php
-
message: '#^Creating callable from a non\-native static method pocketmine\\item\\VanillaItems\:\:PALE_OAK_SIGN\(\)\.$#'
identifier: callable.nonNativeMethod
count: 1
path: ../../../src/block/VanillaBlocks.php
-
message: '#^Creating callable from a non\-native static method pocketmine\\item\\VanillaItems\:\:SPRUCE_HANGING_SIGN\(\)\.$#'
identifier: callable.nonNativeMethod
count: 1
path: ../../../src/block/VanillaBlocks.php
-
message: '#^Creating callable from a non\-native static method pocketmine\\item\\VanillaItems\:\:SPRUCE_SIGN\(\)\.$#'
identifier: callable.nonNativeMethod
count: 1
path: ../../../src/block/VanillaBlocks.php
-
message: '#^Creating callable from a non\-native static method pocketmine\\item\\VanillaItems\:\:WARPED_HANGING_SIGN\(\)\.$#'
identifier: callable.nonNativeMethod
count: 1
path: ../../../src/block/VanillaBlocks.php
-
message: '#^Creating callable from a non\-native static method pocketmine\\item\\VanillaItems\:\:WARPED_SIGN\(\)\.$#'
identifier: callable.nonNativeMethod
@ -252,9 +312,3 @@ parameters:
count: 2
path: ../../phpunit/promise/PromiseTest.php
-
message: '#^Strict comparison using \=\=\= between 0 and 0 will always evaluate to true\.$#'
identifier: identical.alwaysTrue
count: 1
path: ../rules/UnsafeForeachArrayWithStringKeysRule.php

View File

@ -1,6 +1,8 @@
{
"stateCounts": {
"ACACIA_BUTTON": 12,
"ACACIA_CEILING_CENTER_HANGING_SIGN": 16,
"ACACIA_CEILING_EDGES_HANGING_SIGN": 4,
"ACACIA_DOOR": 32,
"ACACIA_FENCE": 1,
"ACACIA_FENCE_GATE": 16,
@ -13,6 +15,7 @@
"ACACIA_SLAB": 3,
"ACACIA_STAIRS": 8,
"ACACIA_TRAPDOOR": 16,
"ACACIA_WALL_HANGING_SIGN": 4,
"ACACIA_WALL_SIGN": 4,
"ACACIA_WOOD": 6,
"ACTIVATOR_RAIL": 12,
@ -43,6 +46,8 @@
"BIG_DRIPLEAF_HEAD": 16,
"BIG_DRIPLEAF_STEM": 4,
"BIRCH_BUTTON": 12,
"BIRCH_CEILING_CENTER_HANGING_SIGN": 16,
"BIRCH_CEILING_EDGES_HANGING_SIGN": 4,
"BIRCH_DOOR": 32,
"BIRCH_FENCE": 1,
"BIRCH_FENCE_GATE": 16,
@ -55,6 +60,7 @@
"BIRCH_SLAB": 3,
"BIRCH_STAIRS": 8,
"BIRCH_TRAPDOOR": 16,
"BIRCH_WALL_HANGING_SIGN": 4,
"BIRCH_WALL_SIGN": 4,
"BIRCH_WOOD": 6,
"BLACKSTONE": 1,
@ -91,6 +97,8 @@
"CHAIN": 3,
"CHEMICAL_HEAT": 1,
"CHERRY_BUTTON": 12,
"CHERRY_CEILING_CENTER_HANGING_SIGN": 16,
"CHERRY_CEILING_EDGES_HANGING_SIGN": 4,
"CHERRY_DOOR": 32,
"CHERRY_FENCE": 1,
"CHERRY_FENCE_GATE": 16,
@ -102,6 +110,7 @@
"CHERRY_SLAB": 3,
"CHERRY_STAIRS": 8,
"CHERRY_TRAPDOOR": 16,
"CHERRY_WALL_HANGING_SIGN": 4,
"CHERRY_WALL_SIGN": 4,
"CHERRY_WOOD": 6,
"CHEST": 4,
@ -152,6 +161,8 @@
"CRACKED_STONE_BRICKS": 1,
"CRAFTING_TABLE": 1,
"CRIMSON_BUTTON": 12,
"CRIMSON_CEILING_CENTER_HANGING_SIGN": 16,
"CRIMSON_CEILING_EDGES_HANGING_SIGN": 4,
"CRIMSON_DOOR": 32,
"CRIMSON_FENCE": 1,
"CRIMSON_FENCE_GATE": 16,
@ -164,6 +175,7 @@
"CRIMSON_STAIRS": 8,
"CRIMSON_STEM": 6,
"CRIMSON_TRAPDOOR": 16,
"CRIMSON_WALL_HANGING_SIGN": 4,
"CRIMSON_WALL_SIGN": 4,
"CRYING_OBSIDIAN": 1,
"CUT_COPPER": 8,
@ -175,6 +187,8 @@
"CUT_SANDSTONE_SLAB": 3,
"DANDELION": 1,
"DARK_OAK_BUTTON": 12,
"DARK_OAK_CEILING_CENTER_HANGING_SIGN": 16,
"DARK_OAK_CEILING_EDGES_HANGING_SIGN": 4,
"DARK_OAK_DOOR": 32,
"DARK_OAK_FENCE": 1,
"DARK_OAK_FENCE_GATE": 16,
@ -187,6 +201,7 @@
"DARK_OAK_SLAB": 3,
"DARK_OAK_STAIRS": 8,
"DARK_OAK_TRAPDOOR": 16,
"DARK_OAK_WALL_HANGING_SIGN": 4,
"DARK_OAK_WALL_SIGN": 4,
"DARK_OAK_WOOD": 6,
"DARK_PRISMARINE": 1,
@ -409,6 +424,8 @@
"ITEM_FRAME": 12,
"JUKEBOX": 1,
"JUNGLE_BUTTON": 12,
"JUNGLE_CEILING_CENTER_HANGING_SIGN": 16,
"JUNGLE_CEILING_EDGES_HANGING_SIGN": 4,
"JUNGLE_DOOR": 32,
"JUNGLE_FENCE": 1,
"JUNGLE_FENCE_GATE": 16,
@ -421,6 +438,7 @@
"JUNGLE_SLAB": 3,
"JUNGLE_STAIRS": 8,
"JUNGLE_TRAPDOOR": 16,
"JUNGLE_WALL_HANGING_SIGN": 4,
"JUNGLE_WALL_SIGN": 4,
"JUNGLE_WOOD": 6,
"LAB_TABLE": 4,
@ -443,6 +461,8 @@
"LOOM": 4,
"MAGMA": 1,
"MANGROVE_BUTTON": 12,
"MANGROVE_CEILING_CENTER_HANGING_SIGN": 16,
"MANGROVE_CEILING_EDGES_HANGING_SIGN": 4,
"MANGROVE_DOOR": 32,
"MANGROVE_FENCE": 1,
"MANGROVE_FENCE_GATE": 16,
@ -455,6 +475,7 @@
"MANGROVE_SLAB": 3,
"MANGROVE_STAIRS": 8,
"MANGROVE_TRAPDOOR": 16,
"MANGROVE_WALL_HANGING_SIGN": 4,
"MANGROVE_WALL_SIGN": 4,
"MANGROVE_WOOD": 6,
"MATERIAL_REDUCER": 4,
@ -493,6 +514,8 @@
"NETHER_WART_BLOCK": 1,
"NOTE_BLOCK": 1,
"OAK_BUTTON": 12,
"OAK_CEILING_CENTER_HANGING_SIGN": 16,
"OAK_CEILING_EDGES_HANGING_SIGN": 4,
"OAK_DOOR": 32,
"OAK_FENCE": 1,
"OAK_FENCE_GATE": 16,
@ -505,14 +528,19 @@
"OAK_SLAB": 3,
"OAK_STAIRS": 8,
"OAK_TRAPDOOR": 16,
"OAK_WALL_HANGING_SIGN": 4,
"OAK_WALL_SIGN": 4,
"OAK_WOOD": 6,
"OBSIDIAN": 1,
"OMINOUS_BANNER": 16,
"OMINOUS_WALL_BANNER": 4,
"ORANGE_TULIP": 1,
"OXEYE_DAISY": 1,
"PACKED_ICE": 1,
"PACKED_MUD": 1,
"PALE_OAK_BUTTON": 12,
"PALE_OAK_CEILING_CENTER_HANGING_SIGN": 16,
"PALE_OAK_CEILING_EDGES_HANGING_SIGN": 4,
"PALE_OAK_DOOR": 32,
"PALE_OAK_FENCE": 1,
"PALE_OAK_FENCE_GATE": 16,
@ -524,6 +552,7 @@
"PALE_OAK_SLAB": 3,
"PALE_OAK_STAIRS": 8,
"PALE_OAK_TRAPDOOR": 16,
"PALE_OAK_WALL_HANGING_SIGN": 4,
"PALE_OAK_WALL_SIGN": 4,
"PALE_OAK_WOOD": 6,
"PEONY": 2,
@ -654,6 +683,8 @@
"SPONGE": 2,
"SPORE_BLOSSOM": 1,
"SPRUCE_BUTTON": 12,
"SPRUCE_CEILING_CENTER_HANGING_SIGN": 16,
"SPRUCE_CEILING_EDGES_HANGING_SIGN": 4,
"SPRUCE_DOOR": 32,
"SPRUCE_FENCE": 1,
"SPRUCE_FENCE_GATE": 16,
@ -666,6 +697,7 @@
"SPRUCE_SLAB": 3,
"SPRUCE_STAIRS": 8,
"SPRUCE_TRAPDOOR": 16,
"SPRUCE_WALL_HANGING_SIGN": 4,
"SPRUCE_WALL_SIGN": 4,
"SPRUCE_WOOD": 6,
"STAINED_CLAY": 16,
@ -709,6 +741,8 @@
"WALL_BANNER": 64,
"WALL_CORAL_FAN": 40,
"WARPED_BUTTON": 12,
"WARPED_CEILING_CENTER_HANGING_SIGN": 16,
"WARPED_CEILING_EDGES_HANGING_SIGN": 4,
"WARPED_DOOR": 32,
"WARPED_FENCE": 1,
"WARPED_FENCE_GATE": 16,
@ -721,6 +755,7 @@
"WARPED_STAIRS": 8,
"WARPED_STEM": 6,
"WARPED_TRAPDOOR": 16,
"WARPED_WALL_HANGING_SIGN": 4,
"WARPED_WALL_SIGN": 4,
"WARPED_WART_BLOCK": 1,
"WATER": 32,
@ -734,26 +769,41 @@
"WOOL": 16
},
"tiles": {
"ACACIA_CEILING_CENTER_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"ACACIA_CEILING_EDGES_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"ACACIA_SIGN": "pocketmine\\block\\tile\\Sign",
"ACACIA_WALL_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"ACACIA_WALL_SIGN": "pocketmine\\block\\tile\\Sign",
"BANNER": "pocketmine\\block\\tile\\Banner",
"BARREL": "pocketmine\\block\\tile\\Barrel",
"BEACON": "pocketmine\\block\\tile\\Beacon",
"BED": "pocketmine\\block\\tile\\Bed",
"BELL": "pocketmine\\block\\tile\\Bell",
"BIRCH_CEILING_CENTER_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"BIRCH_CEILING_EDGES_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"BIRCH_SIGN": "pocketmine\\block\\tile\\Sign",
"BIRCH_WALL_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"BIRCH_WALL_SIGN": "pocketmine\\block\\tile\\Sign",
"BLAST_FURNACE": "pocketmine\\block\\tile\\BlastFurnace",
"BREWING_STAND": "pocketmine\\block\\tile\\BrewingStand",
"CAMPFIRE": "pocketmine\\block\\tile\\Campfire",
"CAULDRON": "pocketmine\\block\\tile\\Cauldron",
"CHERRY_CEILING_CENTER_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"CHERRY_CEILING_EDGES_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"CHERRY_SIGN": "pocketmine\\block\\tile\\Sign",
"CHERRY_WALL_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"CHERRY_WALL_SIGN": "pocketmine\\block\\tile\\Sign",
"CHEST": "pocketmine\\block\\tile\\Chest",
"CHISELED_BOOKSHELF": "pocketmine\\block\\tile\\ChiseledBookshelf",
"CRIMSON_CEILING_CENTER_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"CRIMSON_CEILING_EDGES_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"CRIMSON_SIGN": "pocketmine\\block\\tile\\Sign",
"CRIMSON_WALL_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"CRIMSON_WALL_SIGN": "pocketmine\\block\\tile\\Sign",
"DARK_OAK_CEILING_CENTER_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"DARK_OAK_CEILING_EDGES_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"DARK_OAK_SIGN": "pocketmine\\block\\tile\\Sign",
"DARK_OAK_WALL_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"DARK_OAK_WALL_SIGN": "pocketmine\\block\\tile\\Sign",
"DAYLIGHT_SENSOR": "pocketmine\\block\\tile\\DaylightSensor",
"DYED_SHULKER_BOX": "pocketmine\\block\\tile\\ShulkerBox",
@ -765,29 +815,49 @@
"HOPPER": "pocketmine\\block\\tile\\Hopper",
"ITEM_FRAME": "pocketmine\\block\\tile\\ItemFrame",
"JUKEBOX": "pocketmine\\block\\tile\\Jukebox",
"JUNGLE_CEILING_CENTER_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"JUNGLE_CEILING_EDGES_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"JUNGLE_SIGN": "pocketmine\\block\\tile\\Sign",
"JUNGLE_WALL_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"JUNGLE_WALL_SIGN": "pocketmine\\block\\tile\\Sign",
"LAVA_CAULDRON": "pocketmine\\block\\tile\\Cauldron",
"LECTERN": "pocketmine\\block\\tile\\Lectern",
"MANGROVE_CEILING_CENTER_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"MANGROVE_CEILING_EDGES_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"MANGROVE_SIGN": "pocketmine\\block\\tile\\Sign",
"MANGROVE_WALL_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"MANGROVE_WALL_SIGN": "pocketmine\\block\\tile\\Sign",
"MOB_HEAD": "pocketmine\\block\\tile\\MobHead",
"MONSTER_SPAWNER": "pocketmine\\block\\tile\\MonsterSpawner",
"NOTE_BLOCK": "pocketmine\\block\\tile\\Note",
"OAK_CEILING_CENTER_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"OAK_CEILING_EDGES_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"OAK_SIGN": "pocketmine\\block\\tile\\Sign",
"OAK_WALL_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"OAK_WALL_SIGN": "pocketmine\\block\\tile\\Sign",
"OMINOUS_BANNER": "pocketmine\\block\\tile\\Banner",
"OMINOUS_WALL_BANNER": "pocketmine\\block\\tile\\Banner",
"PALE_OAK_CEILING_CENTER_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"PALE_OAK_CEILING_EDGES_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"PALE_OAK_SIGN": "pocketmine\\block\\tile\\Sign",
"PALE_OAK_WALL_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"PALE_OAK_WALL_SIGN": "pocketmine\\block\\tile\\Sign",
"POTION_CAULDRON": "pocketmine\\block\\tile\\Cauldron",
"REDSTONE_COMPARATOR": "pocketmine\\block\\tile\\Comparator",
"SHULKER_BOX": "pocketmine\\block\\tile\\ShulkerBox",
"SMOKER": "pocketmine\\block\\tile\\Smoker",
"SOUL_CAMPFIRE": "pocketmine\\block\\tile\\Campfire",
"SPRUCE_CEILING_CENTER_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"SPRUCE_CEILING_EDGES_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"SPRUCE_SIGN": "pocketmine\\block\\tile\\Sign",
"SPRUCE_WALL_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"SPRUCE_WALL_SIGN": "pocketmine\\block\\tile\\Sign",
"TRAPPED_CHEST": "pocketmine\\block\\tile\\Chest",
"WALL_BANNER": "pocketmine\\block\\tile\\Banner",
"WARPED_CEILING_CENTER_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"WARPED_CEILING_EDGES_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"WARPED_SIGN": "pocketmine\\block\\tile\\Sign",
"WARPED_WALL_HANGING_SIGN": "pocketmine\\block\\tile\\HangingSign",
"WARPED_WALL_SIGN": "pocketmine\\block\\tile\\Sign",
"WATER_CAULDRON": "pocketmine\\block\\tile\\Cauldron"
}

View File

@ -42,6 +42,8 @@ final class BlockSerializerDeserializerTest extends TestCase{
public function setUp() : void{
$this->deserializer = new BlockStateToObjectDeserializer();
$this->serializer = new BlockObjectToStateSerializer();
$registrar = new BlockSerializerDeserializerRegistrar($this->deserializer, $this->serializer);
VanillaBlockMappings::init($registrar);
}
public function testAllKnownBlockStatesSerializableAndDeserializable() : void{
@ -49,16 +51,21 @@ final class BlockSerializerDeserializerTest extends TestCase{
try{
$blockStateData = $this->serializer->serializeBlock($block);
}catch(BlockStateSerializeException $e){
self::fail($e->getMessage());
self::fail("Failed to serialize " . $block->getName() . ": " . $e->getMessage());
}
try{
$newBlock = $this->deserializer->deserializeBlock($blockStateData);
}catch(BlockStateDeserializeException $e){
self::fail($e->getMessage());
self::fail("Failed to deserialize " . $blockStateData->getName() . ": " . $e->getMessage() . " with data " . $blockStateData->toNbt());
}
if($block->getTypeId() === BlockTypeIds::POTION_CAULDRON){
//this pretends to be a water cauldron in the blockstate, and stores its actual data in the blockentity
if(match ($block->getTypeId()) {
BlockTypeIds::POTION_CAULDRON,
BlockTypeIds::OMINOUS_BANNER,
BlockTypeIds::OMINOUS_WALL_BANNER => true,
default => false
}){
//these pretend to be something else in the blockstate, and the variant switching is done via block entity data
continue;
}