From 9c83c64d0103f721db0d91fcc048c7b4fece720b Mon Sep 17 00:00:00 2001 From: phobia Date: Sat, 30 Jan 2016 21:34:06 +1100 Subject: [PATCH] Fixed issues with Broadsword Added max building height of 100 --- .../game/clans/clans/ClansDataAccessLayer.java | 2 ++ .../clans/tntGenerator/TntGeneratorManager.java | 2 +- .../src/mineplex/game/clans/gameplay/Gameplay.java | 14 ++++++++++++-- .../clans/items/legendaries/GiantsBroadsword.java | 10 +++++----- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansDataAccessLayer.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansDataAccessLayer.java index b848e7d28..b3bdba522 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansDataAccessLayer.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansDataAccessLayer.java @@ -750,6 +750,8 @@ public class ClansDataAccessLayer if (callback != null) { callback.run(ran); + } else { + if(!ran) System.out.println("Tnt Gen didn't save!"); } } }); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/tntGenerator/TntGeneratorManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/tntGenerator/TntGeneratorManager.java index 6506f4914..b6f4edf09 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/tntGenerator/TntGeneratorManager.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/tntGenerator/TntGeneratorManager.java @@ -174,7 +174,7 @@ public class TntGeneratorManager extends MiniPlugin ClanInfo owner = _clansManager.getClanUtility().getOwner(event.getClickedBlock().getLocation()); if(owner == null) return; //Wilderness TntGenerator generator = owner.getGenerator(); - + System.out.println("Unable to find generator"); //Create generator if not exist if(generator == null || !generator.getBlock().equals(event.getClickedBlock())) { generator = new TntGenerator(event.getClickedBlock()); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/Gameplay.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/Gameplay.java index ed9bbd104..e3a425c34 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/Gameplay.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/Gameplay.java @@ -253,7 +253,7 @@ public class Gameplay extends MiniPlugin event.setCancelled(true); } } - + @EventHandler(priority = EventPriority.LOWEST) public void RedstoneCancel(BlockPlaceEvent event) { @@ -263,7 +263,17 @@ public class Gameplay extends MiniPlugin event.setCancelled(true); } } - + + @EventHandler(priority = EventPriority.LOWEST) + public void MaxHeight(BlockPlaceEvent event) + { + if (event.getBlock().getLocation().getBlockY() > 100) + { + UtilPlayer.message(event.getPlayer(), F.main("Game", "You cannot place blocks this high.")); + event.setCancelled(true); + } + } + /** * Disable all Piston related events in Clans * diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/GiantsBroadsword.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/GiantsBroadsword.java index 7e6e18f42..e7059080f 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/GiantsBroadsword.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/GiantsBroadsword.java @@ -13,9 +13,9 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent; public class GiantsBroadsword extends LegendaryItem { - public static final int SLOW_AMPLIFIER = 4; - public static final int REGEN_AMPLIFIER = 1; - public static final int EFFECT_DURATION = 10; // Duration of potion effect + public static final int SLOW_AMPLIFIER = 43; + public static final int REGEN_AMPLIFIER = 4; + public static final int EFFECT_DURATION = 20; // Duration of potion effect // (in ticks) public GiantsBroadsword() @@ -62,7 +62,7 @@ public class GiantsBroadsword extends LegendaryItem private void buffPlayer(Player player) { - grantPotionEffect(player, PotionEffectType.SLOW, 40, 5); - grantPotionEffect(player, PotionEffectType.REGENERATION, 2, 5); //Regen 4 + grantPotionEffect(player, PotionEffectType.SLOW, EFFECT_DURATION, SLOW_AMPLIFIER); + grantPotionEffect(player, PotionEffectType.REGENERATION, 2, REGEN_AMPLIFIER); //Regen } }