From b44cd63f4122f4bc1b8da79fa1f5b470554f7839 Mon Sep 17 00:00:00 2001 From: Martijn Muijsers Date: Mon, 12 Feb 2024 22:39:15 +0100 Subject: [PATCH] Fix some tests --- ...Bukkit-enums-Remember-original-order.patch | 73 +++++++++++++++++-- ...32-Cache-Block-and-Item-registry-key.patch | 16 ++-- ...k-Item-and-BlockState-registry-index.patch | 16 ++-- ...t-enums-Complete-legacy-conversion-T.patch | 21 +++--- ...t-enums-Remove-hard-coded-properties.patch | 26 +++---- ...t-enums-Remove-hard-coded-properties.patch | 16 ++-- ...t-enums-Remove-hard-coded-properties.patch | 6 +- ...t-enums-Remove-hard-coded-properties.patch | 8 +- ...t-enums-Remove-hard-coded-properties.patch | 14 ++-- ...t-enums-Remove-hard-coded-properties.patch | 6 +- 10 files changed, 130 insertions(+), 72 deletions(-) diff --git a/patches/api/0026-Modifiable-Bukkit-enums-Remember-original-order.patch b/patches/api/0026-Modifiable-Bukkit-enums-Remember-original-order.patch index 775d06d..e1d579a 100644 --- a/patches/api/0026-Modifiable-Bukkit-enums-Remember-original-order.patch +++ b/patches/api/0026-Modifiable-Bukkit-enums-Remember-original-order.patch @@ -16,10 +16,10 @@ Fiddle - https://fiddlemc.org diff --git a/src/main/java/org/fiddlemc/fiddle/material/OrderedEmptyMaterial.java b/src/main/java/org/fiddlemc/fiddle/material/OrderedEmptyMaterial.java new file mode 100644 -index 0000000000000000000000000000000000000000..0847d6bce01e09c3058beb2617a5dedc62fcf56f +index 0000000000000000000000000000000000000000..1f399711d91de87bf40e06536fdd2fcf9ff25450 --- /dev/null +++ b/src/main/java/org/fiddlemc/fiddle/material/OrderedEmptyMaterial.java -@@ -0,0 +1,1880 @@ +@@ -0,0 +1,1937 @@ +// Fiddle start - modifiable Bukkit enums - Material - remember original order + +package org.fiddlemc.fiddle.material; @@ -47,6 +47,19 @@ index 0000000000000000000000000000000000000000..0847d6bce01e09c3058beb2617a5dedc + POLISHED_DEEPSLATE, + CALCITE, + TUFF, ++ TUFF_SLAB, ++ TUFF_STAIRS, ++ TUFF_WALL, ++ CHISELED_TUFF, ++ POLISHED_TUFF, ++ POLISHED_TUFF_SLAB, ++ POLISHED_TUFF_STAIRS, ++ POLISHED_TUFF_WALL, ++ TUFF_BRICKS, ++ TUFF_BRICK_SLAB, ++ TUFF_BRICK_STAIRS, ++ TUFF_BRICK_WALL, ++ CHISELED_TUFF_BRICKS, + DRIPSTONE_BLOCK, + GRASS_BLOCK, + DIRT, @@ -116,6 +129,10 @@ index 0000000000000000000000000000000000000000..0847d6bce01e09c3058beb2617a5dedc + EXPOSED_COPPER, + WEATHERED_COPPER, + OXIDIZED_COPPER, ++ CHISELED_COPPER, ++ EXPOSED_CHISELED_COPPER, ++ WEATHERED_CHISELED_COPPER, ++ OXIDIZED_CHISELED_COPPER, + CUT_COPPER, + EXPOSED_CUT_COPPER, + WEATHERED_CUT_COPPER, @@ -132,6 +149,10 @@ index 0000000000000000000000000000000000000000..0847d6bce01e09c3058beb2617a5dedc + WAXED_EXPOSED_COPPER, + WAXED_WEATHERED_COPPER, + WAXED_OXIDIZED_COPPER, ++ WAXED_CHISELED_COPPER, ++ WAXED_EXPOSED_CHISELED_COPPER, ++ WAXED_WEATHERED_CHISELED_COPPER, ++ WAXED_OXIDIZED_CHISELED_COPPER, + WAXED_CUT_COPPER, + WAXED_EXPOSED_CUT_COPPER, + WAXED_WEATHERED_CUT_COPPER, @@ -207,7 +228,7 @@ index 0000000000000000000000000000000000000000..0847d6bce01e09c3058beb2617a5dedc + CHISELED_SANDSTONE, + CUT_SANDSTONE, + COBWEB, -+ GRASS, ++ SHORT_GRASS, + FERN, + AZALEA, + FLOWERING_AZALEA, @@ -734,6 +755,14 @@ index 0000000000000000000000000000000000000000..0847d6bce01e09c3058beb2617a5dedc + BAMBOO_DOOR, + CRIMSON_DOOR, + WARPED_DOOR, ++ COPPER_DOOR, ++ EXPOSED_COPPER_DOOR, ++ WEATHERED_COPPER_DOOR, ++ OXIDIZED_COPPER_DOOR, ++ WAXED_COPPER_DOOR, ++ WAXED_EXPOSED_COPPER_DOOR, ++ WAXED_WEATHERED_COPPER_DOOR, ++ WAXED_OXIDIZED_COPPER_DOOR, + IRON_TRAPDOOR, + OAK_TRAPDOOR, + SPRUCE_TRAPDOOR, @@ -746,6 +775,14 @@ index 0000000000000000000000000000000000000000..0847d6bce01e09c3058beb2617a5dedc + BAMBOO_TRAPDOOR, + CRIMSON_TRAPDOOR, + WARPED_TRAPDOOR, ++ COPPER_TRAPDOOR, ++ EXPOSED_COPPER_TRAPDOOR, ++ WEATHERED_COPPER_TRAPDOOR, ++ OXIDIZED_COPPER_TRAPDOOR, ++ WAXED_COPPER_TRAPDOOR, ++ WAXED_EXPOSED_COPPER_TRAPDOOR, ++ WAXED_WEATHERED_COPPER_TRAPDOOR, ++ WAXED_OXIDIZED_COPPER_TRAPDOOR, + OAK_FENCE_GATE, + SPRUCE_FENCE_GATE, + BIRCH_FENCE_GATE, @@ -975,6 +1012,7 @@ index 0000000000000000000000000000000000000000..0847d6bce01e09c3058beb2617a5dedc + RED_BED, + BLACK_BED, + COOKIE, ++ CRAFTER, + FILLED_MAP, + SHEARS, + MELON_SLICE, @@ -1006,6 +1044,7 @@ index 0000000000000000000000000000000000000000..0847d6bce01e09c3058beb2617a5dedc + BAT_SPAWN_EGG, + BEE_SPAWN_EGG, + BLAZE_SPAWN_EGG, ++ BREEZE_SPAWN_EGG, + CAT_SPAWN_EGG, + CAMEL_SPAWN_EGG, + CAVE_SPIDER_SPAWN_EGG, @@ -1289,6 +1328,24 @@ index 0000000000000000000000000000000000000000..0847d6bce01e09c3058beb2617a5dedc + SHELTER_POTTERY_SHERD, + SKULL_POTTERY_SHERD, + SNORT_POTTERY_SHERD, ++ COPPER_GRATE, ++ EXPOSED_COPPER_GRATE, ++ WEATHERED_COPPER_GRATE, ++ OXIDIZED_COPPER_GRATE, ++ WAXED_COPPER_GRATE, ++ WAXED_EXPOSED_COPPER_GRATE, ++ WAXED_WEATHERED_COPPER_GRATE, ++ WAXED_OXIDIZED_COPPER_GRATE, ++ COPPER_BULB, ++ EXPOSED_COPPER_BULB, ++ WEATHERED_COPPER_BULB, ++ OXIDIZED_COPPER_BULB, ++ WAXED_COPPER_BULB, ++ WAXED_EXPOSED_COPPER_BULB, ++ WAXED_WEATHERED_COPPER_BULB, ++ WAXED_OXIDIZED_COPPER_BULB, ++ TRIAL_SPAWNER, ++ TRIAL_KEY, + WATER, + LAVA, + TALL_SEAGRASS, @@ -1902,16 +1959,16 @@ index 0000000000000000000000000000000000000000..0847d6bce01e09c3058beb2617a5dedc +} diff --git a/src/test/java/org/fiddlemc/fiddle/material/OrderedEmptyMaterialTest.java b/src/test/java/org/fiddlemc/fiddle/material/OrderedEmptyMaterialTest.java new file mode 100644 -index 0000000000000000000000000000000000000000..41728dd38bd9f3a98a91e4848016a4068521eac6 +index 0000000000000000000000000000000000000000..0f93abaf6239d8a4ffe0a4a3ba5843a950a2fffe --- /dev/null +++ b/src/test/java/org/fiddlemc/fiddle/material/OrderedEmptyMaterialTest.java @@ -0,0 +1,20 @@ +package org.fiddlemc.fiddle.material; + +import org.bukkit.Material; -+import org.junit.Test; ++import org.junit.jupiter.api.Test; + -+import static org.junit.Assert.assertEquals; ++import static org.junit.jupiter.api.Assertions.assertEquals; + +public class OrderedEmptyMaterialTest { + @@ -1919,9 +1976,9 @@ index 0000000000000000000000000000000000000000..41728dd38bd9f3a98a91e4848016a406 + public void equalsOriginalOrder() { + var materialValues = Material.values(); + var orderedEmptyMaterialValues = OrderedEmptyMaterial.values(); -+ assertEquals("OrderedEmptyMaterial has the same number of values as Material", materialValues.length, orderedEmptyMaterialValues.length); ++ assertEquals(materialValues.length, orderedEmptyMaterialValues.length, "OrderedEmptyMaterial has a different number of values as Material"); + for (int i = 0; i < materialValues.length; i++) { -+ assertEquals("The OrderedEmptyMaterial instance at ordinal " + i + " has the same name as the Material value at that ordinal", materialValues[i].name(), orderedEmptyMaterialValues[i].name()); ++ assertEquals(materialValues[i].name(), orderedEmptyMaterialValues[i].name(), "The OrderedEmptyMaterial instance at ordinal " + i + " has a different name as the Material value at that ordinal"); + } + } + diff --git a/patches/server/0032-Cache-Block-and-Item-registry-key.patch b/patches/server/0032-Cache-Block-and-Item-registry-key.patch index 87c374d..a36da1c 100644 --- a/patches/server/0032-Cache-Block-and-Item-registry-key.patch +++ b/patches/server/0032-Cache-Block-and-Item-registry-key.patch @@ -126,16 +126,16 @@ index e74f8c9b43894534fe624988ec9a3ca190ae5770..ac34e35521bb6772d25d1d5f43b9edd0 + } diff --git a/src/test/java/org/fiddlemc/fiddle/block/PerBlockTest.java b/src/test/java/org/fiddlemc/fiddle/block/PerBlockTest.java -index 4ad77f8ce7b43b5b54d7f7d1f9dfdebdd0ca9d8f..bc9f7245a13a8a336cda803c8b23010098e7d83d 100644 +index 4ad77f8ce7b43b5b54d7f7d1f9dfdebdd0ca9d8f..cc59e81f1670e34f357d96c9be316af382322301 100644 --- a/src/test/java/org/fiddlemc/fiddle/block/PerBlockTest.java +++ b/src/test/java/org/fiddlemc/fiddle/block/PerBlockTest.java @@ -5,6 +5,9 @@ package org.fiddlemc.fiddle.block; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.level.block.Block; import org.bukkit.support.AbstractTestingBase; -+import org.junit.Test; ++import org.junit.jupiter.api.Test; + -+import static org.junit.Assert.assertEquals; ++import static org.junit.jupiter.api.Assertions.assertEquals; public class PerBlockTest extends AbstractTestingBase { @@ -147,23 +147,23 @@ index 4ad77f8ce7b43b5b54d7f7d1f9dfdebdd0ca9d8f..bc9f7245a13a8a336cda803c8b230100 + @Test + public void keyInBlockRegistry() { + for (Block block : getBlocks()) { -+ assertEquals("Lookup value equals keyInBlockRegistry for " + block, BuiltInRegistries.BLOCK.getKey(block), block.keyInBlockRegistry); ++ assertEquals(BuiltInRegistries.BLOCK.getKey(block), block.keyInBlockRegistry, "Lookup value does not equal keyInBlockRegistry for " + block); + } + } + // Fiddle end - cache registry keys as fields - block + } diff --git a/src/test/java/org/fiddlemc/fiddle/item/PerItemTest.java b/src/test/java/org/fiddlemc/fiddle/item/PerItemTest.java -index d1d9ee8190fa648efacea96ddaf5b55801e2ade7..ee38ae7143ebb5c05e51ab31956a6023f558625b 100644 +index d1d9ee8190fa648efacea96ddaf5b55801e2ade7..799295777aaa2ed7d90b8a2a37c1dc30cfc3bf72 100644 --- a/src/test/java/org/fiddlemc/fiddle/item/PerItemTest.java +++ b/src/test/java/org/fiddlemc/fiddle/item/PerItemTest.java @@ -5,6 +5,9 @@ package org.fiddlemc.fiddle.item; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.item.Item; import org.bukkit.support.AbstractTestingBase; -+import org.junit.Test; ++import org.junit.jupiter.api.Test; + -+import static org.junit.Assert.assertEquals; ++import static org.junit.jupiter.api.Assertions.assertEquals; public class PerItemTest extends AbstractTestingBase { @@ -175,7 +175,7 @@ index d1d9ee8190fa648efacea96ddaf5b55801e2ade7..ee38ae7143ebb5c05e51ab31956a6023 + @Test + public void keyInItemRegistry() { + for (Item item : getItems()) { -+ assertEquals("Lookup value equals keyInItemRegistry for " + item, BuiltInRegistries.ITEM.getKey(item), item.keyInItemRegistry); ++ assertEquals(BuiltInRegistries.ITEM.getKey(item), item.keyInItemRegistry, "Lookup value does not equal keyInItemRegistry for " + item); + } + } + // Fiddle end - cache registry keys as fields - item diff --git a/patches/server/0033-Cache-Block-Item-and-BlockState-registry-index.patch b/patches/server/0033-Cache-Block-Item-and-BlockState-registry-index.patch index 44a6ac0..0c0c3c3 100644 --- a/patches/server/0033-Cache-Block-Item-and-BlockState-registry-index.patch +++ b/patches/server/0033-Cache-Block-Item-and-BlockState-registry-index.patch @@ -253,7 +253,7 @@ index 94ff1dd6849f1e4f225254ff5c36421c7632b897..c5a0911cd33229c8a952293aacfc30b2 } diff --git a/src/test/java/org/fiddlemc/fiddle/block/PerBlockTest.java b/src/test/java/org/fiddlemc/fiddle/block/PerBlockTest.java -index bc9f7245a13a8a336cda803c8b23010098e7d83d..f6d757b6401b19ce66037442e0b40530fe5e7782 100644 +index cc59e81f1670e34f357d96c9be316af382322301..51c4f8d436fb54bca00abb6f14753641e8f1bae7 100644 --- a/src/test/java/org/fiddlemc/fiddle/block/PerBlockTest.java +++ b/src/test/java/org/fiddlemc/fiddle/block/PerBlockTest.java @@ -24,4 +24,26 @@ public class PerBlockTest extends AbstractTestingBase { @@ -264,8 +264,8 @@ index bc9f7245a13a8a336cda803c8b23010098e7d83d..f6d757b6401b19ce66037442e0b40530 + @Test + public void indexInBlockRegistry() { + for (Block block : getBlocks()) { -+ assertEquals("Lookup value equals indexInBlockRegistry for " + block, BuiltInRegistries.BLOCK.getId(block), block.indexInBlockRegistry); -+ assertEquals("Lookup value equals indexInVanillaOnlyBlockRegistry for " + block, Block.VANILLA_ONLY_BLOCK_REGISTRY.getId(block), block.indexInVanillaOnlyBlockRegistry); ++ assertEquals(BuiltInRegistries.BLOCK.getId(block), block.indexInBlockRegistry, "Lookup value does not equal indexInBlockRegistry for " + block); ++ assertEquals(Block.VANILLA_ONLY_BLOCK_REGISTRY.getId(block), block.indexInVanillaOnlyBlockRegistry, "Lookup value does not equal indexInVanillaOnlyBlockRegistry for " + block); + } + } + // Fiddle end - cache registry indices as fields - block @@ -275,8 +275,8 @@ index bc9f7245a13a8a336cda803c8b23010098e7d83d..f6d757b6401b19ce66037442e0b40530 + public void indexInBlockStateRegistry() { + for (Block block : getBlocks()) { + for (var state : block.getStateDefinition().getPossibleStates()) { -+ assertEquals("Lookup value equals indexInBlockStateRegistry for " + state, Block.BLOCK_STATE_REGISTRY.getId(state), state.indexInBlockStateRegistry); -+ assertEquals("Lookup value equals indexInVanillaOnlyBlockStateRegistry for " + state, Block.VANILLA_ONLY_BLOCK_STATE_REGISTRY.getId(state), state.indexInVanillaOnlyBlockStateRegistry); ++ assertEquals(Block.BLOCK_STATE_REGISTRY.getId(state), state.indexInBlockStateRegistry, "Lookup does not equal indexInBlockStateRegistry for " + state); ++ assertEquals(Block.VANILLA_ONLY_BLOCK_STATE_REGISTRY.getId(state), state.indexInVanillaOnlyBlockStateRegistry, "Lookup value does not equal indexInVanillaOnlyBlockStateRegistry for " + state); + } + } + } @@ -284,7 +284,7 @@ index bc9f7245a13a8a336cda803c8b23010098e7d83d..f6d757b6401b19ce66037442e0b40530 + } diff --git a/src/test/java/org/fiddlemc/fiddle/item/PerItemTest.java b/src/test/java/org/fiddlemc/fiddle/item/PerItemTest.java -index ee38ae7143ebb5c05e51ab31956a6023f558625b..0fa9b94adb8fa061cf294f94a84245509ffd7de9 100644 +index 799295777aaa2ed7d90b8a2a37c1dc30cfc3bf72..227e5d9c75791b6472feac1323cbab40fb76f655 100644 --- a/src/test/java/org/fiddlemc/fiddle/item/PerItemTest.java +++ b/src/test/java/org/fiddlemc/fiddle/item/PerItemTest.java @@ -24,4 +24,14 @@ public class PerItemTest extends AbstractTestingBase { @@ -295,8 +295,8 @@ index ee38ae7143ebb5c05e51ab31956a6023f558625b..0fa9b94adb8fa061cf294f94a8424550 + @Test + public void indexInItemRegistry() { + for (Item item : getItems()) { -+ assertEquals("Lookup value equals indexInItemRegistry for " + item, BuiltInRegistries.ITEM.getId(item), item.indexInItemRegistry); -+ assertEquals("Lookup value equals indexInVanillaOnlyItemRegistry for " + item, Item.VANILLA_ONLY_ITEM_REGISTRY.getId(item), item.indexInVanillaOnlyItemRegistry); ++ assertEquals(BuiltInRegistries.ITEM.getId(item), item.indexInItemRegistry, "Lookup value does not equal indexInItemRegistry for " + item); ++ assertEquals(Item.VANILLA_ONLY_ITEM_REGISTRY.getId(item), item.indexInVanillaOnlyItemRegistry, "Lookup value does not equal indexInVanillaOnlyItemRegistry for " + item); + } + } + // Fiddle end - cache registry indices as fields - item diff --git a/patches/server/0037-Modifiable-Bukkit-enums-Complete-legacy-conversion-T.patch b/patches/server/0037-Modifiable-Bukkit-enums-Complete-legacy-conversion-T.patch index 1834a95..2dcb251 100644 --- a/patches/server/0037-Modifiable-Bukkit-enums-Complete-legacy-conversion-T.patch +++ b/patches/server/0037-Modifiable-Bukkit-enums-Complete-legacy-conversion-T.patch @@ -11,10 +11,10 @@ Fiddle - https://fiddlemc.org diff --git a/src/test/java/org/fiddlemc/fiddle/material/legacy/PerLegacyMaterialTest.java b/src/test/java/org/fiddlemc/fiddle/material/legacy/PerLegacyMaterialTest.java new file mode 100644 -index 0000000000000000000000000000000000000000..95e539a0c7ede3a4bed906a6e624ab328480d0e6 +index 0000000000000000000000000000000000000000..3087de012e42239a362b612bb9474c3d8dd2ab10 --- /dev/null +++ b/src/test/java/org/fiddlemc/fiddle/material/legacy/PerLegacyMaterialTest.java -@@ -0,0 +1,38 @@ +@@ -0,0 +1,39 @@ +// Fiddle - modifiable Bukkit enums - Material - make legacy conversion complete - tests + +package org.fiddlemc.fiddle.material.legacy; @@ -22,11 +22,12 @@ index 0000000000000000000000000000000000000000..95e539a0c7ede3a4bed906a6e624ab32 +import org.bukkit.Material; +import org.bukkit.craftbukkit.legacy.CraftLegacy; +import org.bukkit.support.AbstractTestingBase; -+import org.junit.Test; ++import org.junit.jupiter.api.Test; + +import java.util.Arrays; + -+import static org.junit.Assert.*; ++import static org.junit.jupiter.api.Assertions.assertEquals; ++import static org.junit.jupiter.api.Assertions.assertNotNull; + +/** + * Does a number of sanity checks on {@linkplain Material#isLegacy() legacy} {@link Material}s. @@ -46,8 +47,8 @@ index 0000000000000000000000000000000000000000..95e539a0c7ede3a4bed906a6e624ab32 + var nonLegacy = CraftLegacy.fromLegacy(material, itemPriority); + + // then -+ assertNotNull("Non-legacy is non-null for " + material + " with item priority = " + itemPriority, nonLegacy); -+ assertEquals("Non-legacy is non-air (unless original is legacy air) for " + material + " with item priority = " + itemPriority,material == Material.LEGACY_AIR, nonLegacy == Material.AIR); ++ assertNotNull(nonLegacy, "Non-legacy mapping is null for " + material + " with item priority = " + itemPriority); ++ assertEquals(material == Material.LEGACY_AIR, nonLegacy == Material.AIR, "Non-legacy mapping is air while original is non-air (or the other way around) for " + material + " with item priority = " + itemPriority); + } + } + } @@ -55,7 +56,7 @@ index 0000000000000000000000000000000000000000..95e539a0c7ede3a4bed906a6e624ab32 +} diff --git a/src/test/java/org/fiddlemc/fiddle/material/legacy/PerNonLegacyMaterialTest.java b/src/test/java/org/fiddlemc/fiddle/material/legacy/PerNonLegacyMaterialTest.java new file mode 100644 -index 0000000000000000000000000000000000000000..4a0b27c8472e8f694841a7dd76066e5023c17148 +index 0000000000000000000000000000000000000000..bee17680ef980db47e3ea84f273be73b549420ee --- /dev/null +++ b/src/test/java/org/fiddlemc/fiddle/material/legacy/PerNonLegacyMaterialTest.java @@ -0,0 +1,38 @@ @@ -66,12 +67,12 @@ index 0000000000000000000000000000000000000000..4a0b27c8472e8f694841a7dd76066e50 +import org.bukkit.Material; +import org.bukkit.craftbukkit.legacy.CraftLegacy; +import org.bukkit.support.AbstractTestingBase; -+import org.junit.Test; ++import org.junit.jupiter.api.Test; + +import java.util.Arrays; +import java.util.function.Predicate; + -+import static org.junit.Assert.assertEquals; ++import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * Does a number of sanity checks on {@linkplain Material#isLegacy() non-legacy Materials}. @@ -91,7 +92,7 @@ index 0000000000000000000000000000000000000000..4a0b27c8472e8f694841a7dd76066e50 + var nonLegacy = CraftLegacy.fromLegacy(material, itemPriority); + + // then -+ assertEquals("Non-legacy is self for " + material + " with item priority = " + itemPriority, material, nonLegacy); ++ assertEquals(material, nonLegacy, "Non-legacy mapping is not self for " + material + " with item priority = " + itemPriority); + } + } + } diff --git a/patches/server/0038-Modifiable-Bukkit-enums-Remove-hard-coded-properties.patch b/patches/server/0038-Modifiable-Bukkit-enums-Remove-hard-coded-properties.patch index 678532a..60c173e 100644 --- a/patches/server/0038-Modifiable-Bukkit-enums-Remove-hard-coded-properties.patch +++ b/patches/server/0038-Modifiable-Bukkit-enums-Remove-hard-coded-properties.patch @@ -252,10 +252,10 @@ index a139e20ddfb460b81c2d652800a24efefd823913..b89febef77c4aadcd210d154d38d766a + } diff --git a/src/test/java/org/fiddlemc/fiddle/material/legacy/PerLegacyMaterialTest.java b/src/test/java/org/fiddlemc/fiddle/material/legacy/PerLegacyMaterialTest.java -index 95e539a0c7ede3a4bed906a6e624ab328480d0e6..5584b3271cdbd62faab7d6b9949e5750326650b6 100644 +index 3087de012e42239a362b612bb9474c3d8dd2ab10..731582108911693263a7526cc60b0b2f8345b964 100644 --- a/src/test/java/org/fiddlemc/fiddle/material/legacy/PerLegacyMaterialTest.java +++ b/src/test/java/org/fiddlemc/fiddle/material/legacy/PerLegacyMaterialTest.java -@@ -35,4 +35,83 @@ public class PerLegacyMaterialTest extends AbstractTestingBase { +@@ -36,4 +36,83 @@ public class PerLegacyMaterialTest extends AbstractTestingBase { } } @@ -263,77 +263,77 @@ index 95e539a0c7ede3a4bed906a6e624ab328480d0e6..5584b3271cdbd62faab7d6b9949e5750 + @Test + public void isBlock() { + for (Material material : getMaterials()) { -+ assertEquals("isBlock equals legacy isBlock for " + material, material.isBlockLegacy(), material.isBlock()); ++ assertEquals(material.isBlockLegacy(), material.isBlock(), "isBlock does not equal legacy isBlock for " + material); + } + } + + @Test + public void isEdible() { + for (Material material : getMaterials()) { -+ assertEquals("isEdible equals legacy isEdible for " + material, material.isEdibleLegacy(), material.isEdible()); ++ assertEquals(material.isEdibleLegacy(), material.isEdible(), "isEdible does not equal legacy isEdible for " + material); + } + } + + @Test + public void isRecord() { + for (Material material : getMaterials()) { -+ assertEquals("isRecord equals legacy iisRecord for " + material, material.isRecordLegacy(), material.isRecord()); ++ assertEquals(material.isRecordLegacy(), material.isRecord(), "isRecord does not equal legacy iisRecord for " + material); + } + } + + @Test + public void isSolid() { + for (Material material : getMaterials()) { -+ assertEquals("isSolid equals legacy isSolid for " + material, material.isSolidLegacy(), material.isSolid()); ++ assertEquals(material.isSolidLegacy(), material.isSolid(), "isSolid does not equal legacy isSolid for " + material); + } + } + + @Test + public void isAir() { + for (Material material : getMaterials()) { -+ assertEquals("isAir equals legacy isAir for " + material, material.isAirLegacy(), material.isAir()); ++ assertEquals(material.isAirLegacy(), material.isAir(), "isAir does not equal legacy isAir for " + material); + } + } + + @Test + public void isFlammable() { + for (Material material : getMaterials()) { -+ assertEquals("isFlammable equals legacy isFlammable for " + material, material.isFlammableLegacy(), material.isFlammable()); ++ assertEquals(material.isFlammableLegacy(), material.isFlammable(), "isFlammable does not equal legacy isFlammable for " + material); + } + } + + @Test + public void isBurnable() { + for (Material material : getMaterials()) { -+ assertEquals("isBurnable equals legacy isBurnable for " + material, material.isBurnableLegacy(), material.isBurnable()); ++ assertEquals(material.isBurnableLegacy(), material.isBurnable(), "isBurnable does not equal legacy isBurnable for " + material); + } + } + + @Test + public void isFuel() { + for (Material material : getMaterials()) { -+ assertEquals("isFuel equals legacy isFuel for " + material, material.isFuelLegacy(), material.isFuel()); ++ assertEquals(material.isFuelLegacy(), material.isFuel(), "isFuel does not equal legacy isFuel for " + material); + } + } + + @Test + public void isOccluding() { + for (Material material : getMaterials()) { -+ assertEquals("isOccluding equals legacy isOccluding for " + material, material.isOccludingLegacy(), material.isOccluding()); ++ assertEquals(material.isOccludingLegacy(), material.isOccluding(), "isOccluding does not equal legacy isOccluding for " + material); + } + } + + @Test + public void hasGravity() { + for (Material material : getMaterials()) { -+ assertEquals("hasGravity equals legacy hasGravity for " + material, material.hasGravityLegacy(), material.hasGravity()); ++ assertEquals(material.hasGravityLegacy(), material.hasGravity(), "hasGravity does not equal legacy hasGravity for " + material); + } + } + + @Test + public void isItem() { + for (Material material : getMaterials()) { -+ assertEquals("isItem equals legacy isItem for " + material, material.isItemLegacy(), material.isItem()); ++ assertEquals(material.isItemLegacy(), material.isItem(), "isItem does not equal legacy isItem for " + material); + } + } + // Fiddle end - modifiable Bukkit enums - Material - remove hard-coded properties - most properties diff --git a/patches/server/0039-Modifiable-Bukkit-enums-Remove-hard-coded-properties.patch b/patches/server/0039-Modifiable-Bukkit-enums-Remove-hard-coded-properties.patch index 536e93c..6e75831 100644 --- a/patches/server/0039-Modifiable-Bukkit-enums-Remove-hard-coded-properties.patch +++ b/patches/server/0039-Modifiable-Bukkit-enums-Remove-hard-coded-properties.patch @@ -108,10 +108,10 @@ index b89febef77c4aadcd210d154d38d766a6650cff2..72c7ef7867f88e9add4a6d64a1fad1fe @Override public boolean isBlock(Material material) { diff --git a/src/test/java/org/fiddlemc/fiddle/material/legacy/PerLegacyMaterialTest.java b/src/test/java/org/fiddlemc/fiddle/material/legacy/PerLegacyMaterialTest.java -index 5584b3271cdbd62faab7d6b9949e5750326650b6..6e983a44d7f014483722321714b9e049156b141c 100644 +index 731582108911693263a7526cc60b0b2f8345b964..5623ab42b73caba6be48c264c0f1bddfe1b63d19 100644 --- a/src/test/java/org/fiddlemc/fiddle/material/legacy/PerLegacyMaterialTest.java +++ b/src/test/java/org/fiddlemc/fiddle/material/legacy/PerLegacyMaterialTest.java -@@ -35,6 +35,31 @@ public class PerLegacyMaterialTest extends AbstractTestingBase { +@@ -36,6 +36,31 @@ public class PerLegacyMaterialTest extends AbstractTestingBase { } } @@ -119,7 +119,7 @@ index 5584b3271cdbd62faab7d6b9949e5750326650b6..6e983a44d7f014483722321714b9e049 + @Test + public void getMaxStackSize() { + for (Material material : getMaterials()) { -+ assertEquals("getMaxStackSize equals hard-coded getMaxStackSize for " + material, material.getMaxStackSizeHardcoded(), material.getMaxStackSize()); ++ assertEquals(material.getMaxStackSizeHardcoded(), material.getMaxStackSize(), "getMaxStackSize does not equal hard-coded getMaxStackSize for " + material); + } + } + // Fiddle end - modifiable Bukkit enums - Material - remove hard-coded properties - max stack size @@ -128,14 +128,14 @@ index 5584b3271cdbd62faab7d6b9949e5750326650b6..6e983a44d7f014483722321714b9e049 + @Test + public void getMaxDurability_hardcoded() { + for (Material material : getMaterials()) { -+ assertEquals("getMaxDurability equals hard-coded getMaxDurability for " + material, material.getMaxDurabilityHardcoded(), material.getMaxDurability()); ++ assertEquals(material.getMaxDurability(), material.getMaxDurabilityHardcoded(), "getMaxDurability does not equal hard-coded getMaxDurability for " + material); + } + } + + @Test + public void getMaxDurability_legacy() { + for (Material material : getMaterials()) { -+ assertEquals("getMaxDurability equals legacy getMaxDurability for " + material, material.getMaxDurabilityLegacy(), material.getMaxDurability()); ++ assertEquals(material.getMaxDurabilityLegacy(), material.getMaxDurability(), "getMaxDurability does not equal legacy getMaxDurability for " + material); + } + } + // Fiddle end - modifiable Bukkit enums - Material - remove hard-coded properties - durability @@ -144,7 +144,7 @@ index 5584b3271cdbd62faab7d6b9949e5750326650b6..6e983a44d7f014483722321714b9e049 @Test public void isBlock() { diff --git a/src/test/java/org/fiddlemc/fiddle/material/legacy/PerNonLegacyMaterialTest.java b/src/test/java/org/fiddlemc/fiddle/material/legacy/PerNonLegacyMaterialTest.java -index 4a0b27c8472e8f694841a7dd76066e5023c17148..5f2a50ccbcaff6213b6f0cd6afd0eba545cbe520 100644 +index bee17680ef980db47e3ea84f273be73b549420ee..f11b7d202160a598ab2d431960d02791f3abcb28 100644 --- a/src/test/java/org/fiddlemc/fiddle/material/legacy/PerNonLegacyMaterialTest.java +++ b/src/test/java/org/fiddlemc/fiddle/material/legacy/PerNonLegacyMaterialTest.java @@ -35,4 +35,22 @@ public class PerNonLegacyMaterialTest extends AbstractTestingBase { @@ -155,7 +155,7 @@ index 4a0b27c8472e8f694841a7dd76066e5023c17148..5f2a50ccbcaff6213b6f0cd6afd0eba5 + @Test + public void getMaxStackSize() { + for (Material material : getMaterials()) { -+ assertEquals("getMaxStackSize equals hard-coded getMaxStackSize for " + material, material.getMaxStackSizeHardcoded(), material.getMaxStackSize()); ++ assertEquals(material.getMaxStackSizeHardcoded(), material.getMaxStackSize(), "getMaxStackSize does not equal hard-coded getMaxStackSize for " + material); + } + } + // Fiddle end - modifiable Bukkit enums - Material - remove hard-coded properties - max stack size @@ -164,7 +164,7 @@ index 4a0b27c8472e8f694841a7dd76066e5023c17148..5f2a50ccbcaff6213b6f0cd6afd0eba5 + @Test + public void getMaxDurability() { + for (Material material : getMaterials()) { -+ assertEquals("getMaxDurability equals hard-coded getMaxDurability for " + material, material.getMaxDurabilityHardcoded(), material.getMaxDurability()); ++ assertEquals(material.getMaxDurabilityHardcoded(), material.getMaxDurability(), "getMaxDurability does not equal hard-coded getMaxDurability for " + material); + } + } + // Fiddle end - modifiable Bukkit enums - Material - remove hard-coded properties - durability diff --git a/patches/server/0040-Modifiable-Bukkit-enums-Remove-hard-coded-properties.patch b/patches/server/0040-Modifiable-Bukkit-enums-Remove-hard-coded-properties.patch index 7b638db..074d538 100644 --- a/patches/server/0040-Modifiable-Bukkit-enums-Remove-hard-coded-properties.patch +++ b/patches/server/0040-Modifiable-Bukkit-enums-Remove-hard-coded-properties.patch @@ -171,10 +171,10 @@ index 72c7ef7867f88e9add4a6d64a1fad1fe73262bb3..42a99ea7d67f74348f64ca33a0db5ddb public boolean isFlammable(Material material) { return this.isFlammableCache.get(material); diff --git a/src/test/java/org/fiddlemc/fiddle/material/legacy/PerLegacyMaterialTest.java b/src/test/java/org/fiddlemc/fiddle/material/legacy/PerLegacyMaterialTest.java -index 6e983a44d7f014483722321714b9e049156b141c..468f1ef483294c7ec7b1712dc8f88865ea9e5874 100644 +index 5623ab42b73caba6be48c264c0f1bddfe1b63d19..404343e96be4c5834fd159578530fb6e1a7a763a 100644 --- a/src/test/java/org/fiddlemc/fiddle/material/legacy/PerLegacyMaterialTest.java +++ b/src/test/java/org/fiddlemc/fiddle/material/legacy/PerLegacyMaterialTest.java -@@ -96,6 +96,15 @@ public class PerLegacyMaterialTest extends AbstractTestingBase { +@@ -97,6 +97,15 @@ public class PerLegacyMaterialTest extends AbstractTestingBase { } } @@ -182,7 +182,7 @@ index 6e983a44d7f014483722321714b9e049156b141c..468f1ef483294c7ec7b1712dc8f88865 + @Test + public void isTransparent() { + for (Material material : getMaterials()) { -+ assertEquals("isTransparent equals legacy isTransparent for " + material, material.isTransparentLegacy(), material.isTransparent()); ++ assertEquals(material.isTransparentLegacy(), material.isTransparent(), "isTransparent does not equal legacy isTransparent for " + material); + } + } + // Fiddle end - modifiable Bukkit enums - Material - remove hard-coded properties - is transparent diff --git a/patches/server/0041-Modifiable-Bukkit-enums-Remove-hard-coded-properties.patch b/patches/server/0041-Modifiable-Bukkit-enums-Remove-hard-coded-properties.patch index d48f88e..89681d2 100644 --- a/patches/server/0041-Modifiable-Bukkit-enums-Remove-hard-coded-properties.patch +++ b/patches/server/0041-Modifiable-Bukkit-enums-Remove-hard-coded-properties.patch @@ -10,7 +10,7 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) Fiddle - https://fiddlemc.org diff --git a/src/test/java/org/fiddlemc/fiddle/material/legacy/PerNonLegacyMaterialTest.java b/src/test/java/org/fiddlemc/fiddle/material/legacy/PerNonLegacyMaterialTest.java -index 5f2a50ccbcaff6213b6f0cd6afd0eba545cbe520..b1a96deb7a50eb9fed7f2e25a083375be8e1e3eb 100644 +index f11b7d202160a598ab2d431960d02791f3abcb28..22dc1eb2e1849b90f952c244d5f2060c8c35839e 100644 --- a/src/test/java/org/fiddlemc/fiddle/material/legacy/PerNonLegacyMaterialTest.java +++ b/src/test/java/org/fiddlemc/fiddle/material/legacy/PerNonLegacyMaterialTest.java @@ -3,12 +3,14 @@ @@ -20,13 +20,13 @@ index 5f2a50ccbcaff6213b6f0cd6afd0eba545cbe520..b1a96deb7a50eb9fed7f2e25a083375b +import org.bukkit.NamespacedKey; import org.bukkit.craftbukkit.legacy.CraftLegacy; import org.bukkit.support.AbstractTestingBase; - import org.junit.Test; + import org.junit.jupiter.api.Test; import java.util.Arrays; import java.util.function.Predicate; +import java.util.Locale; - import static org.junit.Assert.assertEquals; + import static org.junit.jupiter.api.Assertions.assertEquals; @@ -35,6 +37,15 @@ public class PerNonLegacyMaterialTest extends AbstractTestingBase { } @@ -36,7 +36,7 @@ index 5f2a50ccbcaff6213b6f0cd6afd0eba545cbe520..b1a96deb7a50eb9fed7f2e25a083375b + @Test + public void getKey() { + for (Material material : getMaterials()) { -+ assertEquals("getKey is correct for " + material, NamespacedKey.minecraft(material.name().toLowerCase(Locale.ROOT)), material.getKey()); ++ assertEquals(NamespacedKey.minecraft(material.name().toLowerCase(Locale.ROOT)), material.getKey(), "getKey is incorrect for " + material); + } + } + // Fiddle end - modifiable Bukkit enums - Material - remove hard-coded properties - key diff --git a/patches/server/0042-Modifiable-Bukkit-enums-Remove-hard-coded-properties.patch b/patches/server/0042-Modifiable-Bukkit-enums-Remove-hard-coded-properties.patch index 1c2b8db..61b40af 100644 --- a/patches/server/0042-Modifiable-Bukkit-enums-Remove-hard-coded-properties.patch +++ b/patches/server/0042-Modifiable-Bukkit-enums-Remove-hard-coded-properties.patch @@ -67,7 +67,7 @@ index 42a99ea7d67f74348f64ca33a0db5ddb639b0691..208a72638ee3e984c34d2ba2a473479a @Override public boolean isBlock(Material material) { diff --git a/src/test/java/org/fiddlemc/fiddle/material/legacy/PerLegacyMaterialTest.java b/src/test/java/org/fiddlemc/fiddle/material/legacy/PerLegacyMaterialTest.java -index 468f1ef483294c7ec7b1712dc8f88865ea9e5874..ce1651edc34e52086fffe62f8a6f6785c6c3ac59 100644 +index 404343e96be4c5834fd159578530fb6e1a7a763a..b5162d77e33a806a74b24233ad38127029071702 100644 --- a/src/test/java/org/fiddlemc/fiddle/material/legacy/PerLegacyMaterialTest.java +++ b/src/test/java/org/fiddlemc/fiddle/material/legacy/PerLegacyMaterialTest.java @@ -5,6 +5,7 @@ package org.fiddlemc.fiddle.material.legacy; @@ -75,10 +75,10 @@ index 468f1ef483294c7ec7b1712dc8f88865ea9e5874..ce1651edc34e52086fffe62f8a6f6785 import org.bukkit.craftbukkit.legacy.CraftLegacy; import org.bukkit.support.AbstractTestingBase; +import org.fiddlemc.fiddle.material.MaterialDefaultImplementations; - import org.junit.Test; + import org.junit.jupiter.api.Test; import java.util.Arrays; -@@ -60,6 +61,22 @@ public class PerLegacyMaterialTest extends AbstractTestingBase { +@@ -61,6 +62,22 @@ public class PerLegacyMaterialTest extends AbstractTestingBase { } // Fiddle end - modifiable Bukkit enums - Material - remove hard-coded properties - durability @@ -86,14 +86,14 @@ index 468f1ef483294c7ec7b1712dc8f88865ea9e5874..ce1651edc34e52086fffe62f8a6f6785 + @Test + public void computeData_general() { + for (Material material : getMaterials()) { -+ assertEquals("computeData equals hard-coded data for " + material, material.data, material.computeData()); ++ assertEquals(material.data, material.computeData(), "computeData does not equal hard-coded data for " + material); + } + } + + @Test + public void computeData_legacy() { + for (Material material : getMaterials()) { -+ assertEquals("computeData equals legacy computeData for " + material, MaterialDefaultImplementations.computeDataLegacy(material), material.computeData()); ++ assertEquals(MaterialDefaultImplementations.computeDataLegacy(material), material.computeData(), "computeData does not equal legacy computeData for " + material); + } + } + // Fiddle end - modifiable Bukkit enums - Material - remove hard-coded properties - data @@ -102,7 +102,7 @@ index 468f1ef483294c7ec7b1712dc8f88865ea9e5874..ce1651edc34e52086fffe62f8a6f6785 @Test public void isBlock() { diff --git a/src/test/java/org/fiddlemc/fiddle/material/legacy/PerNonLegacyMaterialTest.java b/src/test/java/org/fiddlemc/fiddle/material/legacy/PerNonLegacyMaterialTest.java -index b1a96deb7a50eb9fed7f2e25a083375be8e1e3eb..3234b4e74e22c25e534913697b578cefee6995e9 100644 +index 22dc1eb2e1849b90f952c244d5f2060c8c35839e..fd41b0c76fc42e689fe650ff393df91a9ec1cc9e 100644 --- a/src/test/java/org/fiddlemc/fiddle/material/legacy/PerNonLegacyMaterialTest.java +++ b/src/test/java/org/fiddlemc/fiddle/material/legacy/PerNonLegacyMaterialTest.java @@ -64,4 +64,13 @@ public class PerNonLegacyMaterialTest extends AbstractTestingBase { @@ -113,7 +113,7 @@ index b1a96deb7a50eb9fed7f2e25a083375be8e1e3eb..3234b4e74e22c25e534913697b578cef + @Test + public void computeData() { + for (Material material : getMaterials()) { -+ assertEquals("computeData equals hard-coded data for " + material, material.data, material.computeData()); ++ assertEquals(material.data, material.computeData(), "computeData does not equal hard-coded data for " + material); + } + } + // Fiddle end - modifiable Bukkit enums - Material - remove hard-coded properties - data diff --git a/patches/server/0043-Modifiable-Bukkit-enums-Remove-hard-coded-properties.patch b/patches/server/0043-Modifiable-Bukkit-enums-Remove-hard-coded-properties.patch index e5a03e0..e6b4a10 100644 --- a/patches/server/0043-Modifiable-Bukkit-enums-Remove-hard-coded-properties.patch +++ b/patches/server/0043-Modifiable-Bukkit-enums-Remove-hard-coded-properties.patch @@ -10,10 +10,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) Fiddle - https://fiddlemc.org diff --git a/src/test/java/org/fiddlemc/fiddle/material/legacy/PerLegacyMaterialTest.java b/src/test/java/org/fiddlemc/fiddle/material/legacy/PerLegacyMaterialTest.java -index ce1651edc34e52086fffe62f8a6f6785c6c3ac59..72df25bd4166ce19963a66b9894cd20a89fb3769 100644 +index b5162d77e33a806a74b24233ad38127029071702..903a76b0ca91d43269282939d79a92851ce86961 100644 --- a/src/test/java/org/fiddlemc/fiddle/material/legacy/PerLegacyMaterialTest.java +++ b/src/test/java/org/fiddlemc/fiddle/material/legacy/PerLegacyMaterialTest.java -@@ -36,6 +36,16 @@ public class PerLegacyMaterialTest extends AbstractTestingBase { +@@ -37,6 +37,16 @@ public class PerLegacyMaterialTest extends AbstractTestingBase { } } @@ -22,7 +22,7 @@ index ce1651edc34e52086fffe62f8a6f6785c6c3ac59..72df25bd4166ce19963a66b9894cd20a + @SuppressWarnings("deprecation") + public void getId() { + for (Material material : getMaterials()) { -+ assertEquals("getId equals legacy getId for " + material, material.getIdLegacy(), material.getId()); ++ assertEquals(material.getIdLegacy(), material.getId(), "getId does not equal legacy getId for " + material); + } + } + // Fiddle end - modifiable Bukkit enums - Material - remove hard-coded properties - id