diff --git a/nms-patches/Block.patch b/nms-patches/Block.patch index 1c99929a7c..ee6badf7da 100644 --- a/nms-patches/Block.patch +++ b/nms-patches/Block.patch @@ -1,5 +1,14 @@ --- a/net/minecraft/server/Block.java +++ b/net/minecraft/server/Block.java +@@ -17,7 +17,7 @@ + public static final RegistryBlocks REGISTRY = new RegistryBlocks(Block.a); + public static final RegistryBlockID REGISTRY_ID = new RegistryBlockID(); + protected final int g; +- protected final float strength; ++ public final float strength; // PAIL: private -> public + protected final float durability; + protected final boolean j; + protected final SoundEffectType stepSound; @@ -212,7 +212,7 @@ } diff --git a/src/test/java/org/bukkit/PerMaterialTest.java b/src/test/java/org/bukkit/PerMaterialTest.java index 98bd2fbbbf..57e779ec53 100644 --- a/src/test/java/org/bukkit/PerMaterialTest.java +++ b/src/test/java/org/bukkit/PerMaterialTest.java @@ -215,4 +215,18 @@ public class PerMaterialTest extends AbstractTestingBase { assertFalse(material.isInteractable()); } } + + @Test + public void testBlockHardness() { + if (material.isBlock()) { + assertThat(material.getHardness(), is(CraftMagicNumbers.getBlock(material).strength)); + } + } + + @Test + public void testBlastResistance() { + if (material.isBlock()) { + assertThat(material.getBlastResistance(), is(CraftMagicNumbers.getBlock(material).k())); // PAIL getDurability + } + } }