From eff71c3e17277f228292e4ad847af5d511851a25 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Wed, 22 Jul 2015 08:10:57 +1200 Subject: [PATCH] Champions: Add Morten G's changes to fix BlockToss --- .../classcombat/Skill/Brute/BlockToss.java | 7 +++++ .../arcade/game/games/common/Domination.java | 28 +++++++++++++++++++ .../game/games/common/TeamDeathmatch.java | 27 ++++++++++++++++++ 3 files changed, 62 insertions(+) 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 9bf9994fc..62e021929 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 @@ -111,6 +111,13 @@ public class BlockToss extends SkillCharge implements IThrown return; } + // Ladder and beacon grabs + if (grab.getType() == Material.LADDER || grab.getType() == Material.BEACON) + { + UtilPlayer.message(player, F.main(GetName(), "You cannot grab this block.")); + return; + } + //TrapDoor or ladder for (int x = -1; x <= 1; x++) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/Domination.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/Domination.java index cc96c5dad..1ff47bd80 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/Domination.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/Domination.java @@ -6,12 +6,17 @@ import java.util.HashMap; + import org.bukkit.ChatColor; import org.bukkit.Location; +import org.bukkit.Material; import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; +import org.bukkit.event.block.BlockPhysicsEvent; +import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.ItemDespawnEvent; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryType; @@ -127,6 +132,29 @@ public class Domination extends TeamGame team.SetColor(ChatColor.BLUE); } + @EventHandler(priority = EventPriority.HIGHEST) + public void blockliquidFlow(BlockPhysicsEvent event) + { + Material matOfBlock = event.getBlock().getType(); + + if (matOfBlock == Material.STATIONARY_WATER || matOfBlock == Material.SAND || matOfBlock == Material.GRAVEL || matOfBlock == Material.STATIONARY_LAVA) + { + event.setCancelled(true); + } + } + + @EventHandler(priority = EventPriority.HIGHEST) + public void onTNTExplode(EntityExplodeEvent event) + { + if (!IsLive()) + return; + + if (event.getEntityType() == EntityType.PRIMED_TNT) + { + event.setCancelled(true); + } + } + @EventHandler public void Updates(UpdateEvent event) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/TeamDeathmatch.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/TeamDeathmatch.java index 4ea0687be..1e26628f7 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/TeamDeathmatch.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/TeamDeathmatch.java @@ -5,11 +5,15 @@ import java.util.HashMap; import org.bukkit.ChatColor; import org.bukkit.Location; +import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; +import org.bukkit.event.block.BlockPhysicsEvent; +import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.EntityShootBowEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.scoreboard.Objective; @@ -95,6 +99,29 @@ public class TeamDeathmatch extends TeamGame } } + @EventHandler(priority = EventPriority.HIGHEST) + public void blockliquidFlow(BlockPhysicsEvent event) + { + Material matOfBlock = event.getBlock().getType(); + + if (matOfBlock == Material.STATIONARY_WATER || matOfBlock == Material.SAND || matOfBlock == Material.GRAVEL || matOfBlock == Material.STATIONARY_LAVA) + { + event.setCancelled(true); + } + } + + @EventHandler(priority = EventPriority.HIGHEST) + public void onTNTExplode(EntityExplodeEvent event) + { + if (!IsLive()) + return; + + if (event.getEntityType() == EntityType.PRIMED_TNT) + { + event.setCancelled(true); + } + } + @EventHandler public void PlayerKillAward(CombatDeathEvent event) {