mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-01 12:41:50 +01:00
Add Unit Tests for geHardness and getBlastResistance
This commit is contained in:
parent
53d3ac0a97
commit
c4220dc24f
2 changed files with 23 additions and 0 deletions
|
@ -1,5 +1,14 @@
|
||||||
--- a/net/minecraft/server/Block.java
|
--- a/net/minecraft/server/Block.java
|
||||||
+++ b/net/minecraft/server/Block.java
|
+++ b/net/minecraft/server/Block.java
|
||||||
|
@@ -17,7 +17,7 @@
|
||||||
|
public static final RegistryBlocks<MinecraftKey, Block> REGISTRY = new RegistryBlocks(Block.a);
|
||||||
|
public static final RegistryBlockID<IBlockData> 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 @@
|
@@ -212,7 +212,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -215,4 +215,18 @@ public class PerMaterialTest extends AbstractTestingBase {
|
||||||
assertFalse(material.isInteractable());
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue