diff options
author | Christos Miniotis <chrismin1302@gmail.com> | 2018-08-02 15:26:02 +0300 |
---|---|---|
committer | md_5 <git@md-5.net> | 2018-08-03 09:09:05 +1000 |
commit | 5d489ff4ee40b985352250acc69d56664a2ea2b4 (patch) | |
tree | 097433379ed0030f4be7b40800b7e21f96ce33a2 /src/test/java/org | |
parent | 391e018a7902d05684f43433d0398287d92499dc (diff) | |
download | craftbukkit-5d489ff4ee40b985352250acc69d56664a2ea2b4.tar craftbukkit-5d489ff4ee40b985352250acc69d56664a2ea2b4.tar.gz craftbukkit-5d489ff4ee40b985352250acc69d56664a2ea2b4.tar.lz craftbukkit-5d489ff4ee40b985352250acc69d56664a2ea2b4.tar.xz craftbukkit-5d489ff4ee40b985352250acc69d56664a2ea2b4.zip |
SPIGOT-3936: Add isInteractable to Material
Diffstat (limited to 'src/test/java/org')
-rw-r--r-- | src/test/java/org/bukkit/PerMaterialTest.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/java/org/bukkit/PerMaterialTest.java b/src/test/java/org/bukkit/PerMaterialTest.java index dfa24769..98bd2fbb 100644 --- a/src/test/java/org/bukkit/PerMaterialTest.java +++ b/src/test/java/org/bukkit/PerMaterialTest.java @@ -26,7 +26,12 @@ import org.junit.runners.Parameterized.Parameters; import com.google.common.collect.Lists; import java.util.Map; import net.minecraft.server.Block; +import net.minecraft.server.BlockPosition; import net.minecraft.server.Blocks; +import net.minecraft.server.EntityHuman; +import net.minecraft.server.EnumDirection; +import net.minecraft.server.EnumHand; +import net.minecraft.server.IBlockData; import org.bukkit.craftbukkit.util.CraftMagicNumbers; import org.bukkit.enchantments.EnchantmentTarget; @@ -198,4 +203,16 @@ public class PerMaterialTest extends AbstractTestingBase { assertThat(material.isItem(), is(equalTo(CraftMagicNumbers.getItem(material) != null))); } } + + @Test + public void testInteractable() throws ReflectiveOperationException { + if (material.isBlock()) { + assertThat(material.isInteractable(), + is(!CraftMagicNumbers.getBlock(material).getClass() + .getMethod("interact", IBlockData.class, net.minecraft.server.World.class, BlockPosition.class, EntityHuman.class, EnumHand.class, EnumDirection.class, float.class, float.class, float.class) + .getDeclaringClass().equals(Block.class))); + } else { + assertFalse(material.isInteractable()); + } + } } |