diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/BlockToss.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/BlockToss.java index adf037ef6..4813d73f5 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/BlockToss.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/BlockToss.java @@ -26,6 +26,7 @@ import mineplex.core.recharge.Recharge; import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.UpdateType; import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilServer; @@ -43,7 +44,14 @@ public class BlockToss extends SkillCharge implements IThrown { private HashMap _holding = new HashMap(); private HashMap _falling = new HashMap(); - + + private Material[] _blacklist = new Material[] + { + Material.TNT, + Material.IRON_DOOR, + Material.IRON_DOOR_BLOCK, + }; + public BlockToss(SkillFactory skills, String name, ClassType classType, SkillType skillType, int cost, int levels) { super(skills, name, classType, skillType, cost, levels, @@ -101,32 +109,16 @@ public class BlockToss extends SkillCharge implements IThrown //Recharge if (!Recharge.Instance.use(player, GetName(), 1000, false, false)) - return; + return; - //Door - if (grab.getRelative(BlockFace.UP).getTypeId() == 64 || grab.getRelative(BlockFace.UP).getTypeId() == 71) - { - UtilPlayer.message(player, F.main(GetName(), "You cannot grab this block.")); + //Blacklist + for (Material mat : _blacklist) + if (mat == grab.getType()) + return; + + //Usable + if (UtilBlock.usable(grab)) return; - } - - //TrapDoor or ladder - for (int x = -1; x <= 1; x++) - { - for (int z = -1; z <= 1; z++) - { - if (x != z && (z == 0 || x == 0)) - { - Block block = grab.getRelative(x, 0, z); - - if (block.getType() == Material.TRAP_DOOR || block.getType() == Material.LADDER) - { - UtilPlayer.message(player, F.main(GetName(), "You cannot grab this block.")); - return; - } - } - } - } //Block to Item FallingBlock block = player.getWorld().spawnFallingBlock(player.getEyeLocation(), event.getClickedBlock().getType(), (byte)0);