From a553ddbb0b4c0041c88e767cf786f14c25aba0a5 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Fri, 15 Feb 2013 02:38:34 +0100 Subject: [PATCH] Implement unit test for hasGravity(). Adds BUKKIT-3832 By: nitnelave --- .../src/test/java/org/bukkit/PerMaterialTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/paper-server/src/test/java/org/bukkit/PerMaterialTest.java b/paper-server/src/test/java/org/bukkit/PerMaterialTest.java index f55920bf68..ab4333c37f 100644 --- a/paper-server/src/test/java/org/bukkit/PerMaterialTest.java +++ b/paper-server/src/test/java/org/bukkit/PerMaterialTest.java @@ -10,6 +10,7 @@ import net.minecraft.server.BlockFire; import net.minecraft.server.Item; import net.minecraft.server.ItemFood; import net.minecraft.server.ItemRecord; +import net.minecraft.server.BlockSand; import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.inventory.ItemStack; @@ -127,4 +128,13 @@ public class PerMaterialTest extends AbstractTestingBase { assertFalse(material.isOccluding()); } } + + @Test + public void hasGravity() { + if (material.isBlock()) { + assertThat(material.hasGravity(), is(Block.byId[material.getId()] instanceof BlockSand)); + } else { + assertFalse(material.hasGravity()); + } + } }