From 106a7dab2e7b0ea2ec2d4a701dc3f3382a5e342f Mon Sep 17 00:00:00 2001 From: Cheese Date: Sat, 5 Sep 2015 09:48:06 +1000 Subject: [PATCH 1/3] removed ability for entities to change blcoks in hub --- .../src/mineplex/hub/modules/WorldManager.java | 8 ++++++++ Plugins/Mineplex.StaffServer/.classpath | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/WorldManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/WorldManager.java index 5008cf505..8729a6e55 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/WorldManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/WorldManager.java @@ -31,6 +31,7 @@ import org.bukkit.entity.Item; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Pig; import org.bukkit.entity.Player; +import org.bukkit.entity.Silverfish; import org.bukkit.entity.Skeleton; import org.bukkit.entity.Skeleton.SkeletonType; import org.bukkit.entity.Snowman; @@ -44,6 +45,7 @@ import org.bukkit.event.block.BlockIgniteEvent.IgniteCause; import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.block.BlockSpreadEvent; import org.bukkit.event.block.LeavesDecayEvent; +import org.bukkit.event.entity.EntityChangeBlockEvent; import org.bukkit.event.entity.EntityCombustEvent; import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.EntityTargetEvent; @@ -162,6 +164,12 @@ public class WorldManager extends MiniPlugin { event.setCancelled(true); } + + @EventHandler + public void BlockEntityChange(EntityChangeBlockEvent event) + { + event.setCancelled(true); + } @EventHandler(priority = EventPriority.LOWEST) public void Explosion(EntityExplodeEvent event) diff --git a/Plugins/Mineplex.StaffServer/.classpath b/Plugins/Mineplex.StaffServer/.classpath index e03947a20..acc97657a 100644 --- a/Plugins/Mineplex.StaffServer/.classpath +++ b/Plugins/Mineplex.StaffServer/.classpath @@ -11,6 +11,6 @@ - + From fc5ccd4a5ed0ff98f53c2505dd3383b7fd54a096 Mon Sep 17 00:00:00 2001 From: Cheese Date: Sat, 5 Sep 2015 10:04:54 +1000 Subject: [PATCH 2/3] fixed 'self scoring' in Soccer removed silverfish on wither pet despawn --- .../src/mineplex/core/pet/PetManager.java | 6 +++ .../mineplex/hub/modules/SoccerManager.java | 42 ++++++++++++------- 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java index a95bcb150..0983baf8c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java @@ -228,8 +228,14 @@ public class PetManager extends MiniClientPlugin if (_activePetOwners.containsKey(player.getName())) { final Creature pet = _activePetOwners.get(player.getName()); + + //Wither Silverfish + if (pet.getPassenger() != null) + pet.getPassenger().remove(); + pet.remove(); + if (removeOwner) { _activePetOwners.remove(player.getName()); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/SoccerManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/SoccerManager.java index ab3b37f02..1d55d9f03 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/SoccerManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/SoccerManager.java @@ -83,8 +83,9 @@ public class SoccerManager extends MiniPlugin private Vector _ballVel; private long _ballDeadTime = -1; - private String _lastKicker = ""; - private Color _lastKick = null; + private String _lastRedKicker = ""; + private String _lastBlueKicker = ""; + private Color _lastKickColor = null; //Item Rebound protected Vector _vel; @@ -176,7 +177,7 @@ public class SoccerManager extends MiniPlugin if (_ball == null) return; - if (_lastKick == Color.AQUA) + if (_lastKickColor == Color.AQUA) { for (int i = 0 ; i < 3 ; i++) UtilParticle.PlayParticle(ParticleType.RED_DUST, _ball.getLocation().add(0.0, 0.5, 0.0), -1, 1, 1, 1, 0, @@ -213,13 +214,22 @@ public class SoccerManager extends MiniPlugin UtilAction.zeroVelocity(player); - _lastKick = getTeamColor(player); - if (_lastKick == null) - _lastKicker = player.getName(); - else if (_lastKick == Color.RED) - _lastKicker = C.cRed + player.getName(); - else if (_lastKick == Color.AQUA) - _lastKicker = C.cAqua + player.getName(); + _lastKickColor = getTeamColor(player); + if (_lastKickColor == Color.RED) + { + _lastRedKicker = C.cRed + player.getName(); + + if (_lastBlueKicker.length() == 0) + _lastBlueKicker = C.cRed + player.getName(); + } + + else if (_lastKickColor == Color.AQUA) + { + _lastBlueKicker = C.cAqua + player.getName(); + + if (_lastRedKicker.length() == 0) + _lastRedKicker = C.cRed + player.getName(); + } } } } @@ -239,14 +249,15 @@ public class SoccerManager extends MiniPlugin for (Player player : _active) UtilTextMiddle.display("Goal! (" + C.cRed + _redGoals + C.cWhite + " : " + C.cBlue + _blueGoals + C.cWhite + ")", - _lastKicker + C.cWhite + " scored for " + C.cAqua + "Blue Team", 0, 70, 20, player); + _lastBlueKicker + C.cWhite + " scored for " + C.cAqua + "Blue Team", 0, 70, 20, player); _ball.remove(); _ball = null; + + _lastRedKicker = ""; + _lastBlueKicker = ""; } - - return; } @@ -264,10 +275,13 @@ public class SoccerManager extends MiniPlugin for (Player player : _active) UtilTextMiddle.display("Goal! (" + C.cRed + _redGoals + C.cWhite + " : " + C.cBlue + _blueGoals + C.cWhite + ")", - _lastKicker + C.cWhite + " scored for " + C.cRed + "Red Team", 0, 70, 20, player); + _lastRedKicker + C.cWhite + " scored for " + C.cRed + "Red Team", 0, 70, 20, player); _ball.remove(); _ball = null; + + _lastRedKicker = ""; + _lastBlueKicker = ""; } return; From 0ac808ba43c88252c8751f7266d801c072ea0737 Mon Sep 17 00:00:00 2001 From: Cheese Date: Sat, 5 Sep 2015 10:30:11 +1000 Subject: [PATCH 3/3] stacker pref is now only for pvp stacking. --- .../core/preferences/ui/PreferencesPage.java | 2 +- .../src/mineplex/hub/HubManager.java | 2 +- .../mineplex/hub/modules/StackerManager.java | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/preferences/ui/PreferencesPage.java b/Plugins/Mineplex.Core/src/mineplex/core/preferences/ui/PreferencesPage.java index 981f2c56b..8007a3aef 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/preferences/ui/PreferencesPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/preferences/ui/PreferencesPage.java @@ -243,7 +243,7 @@ public class PreferencesPage extends ShopPageBase return UtilTime.elapsed(_portalTime.get(player.getName()), 5000); } - public boolean CanBump(LivingEntity ent) + public boolean hasPlayerStackingEnabled(LivingEntity ent) { if (!(ent instanceof Player)) return true; diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/StackerManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/StackerManager.java index ed43ae6d2..2f8a774d4 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/StackerManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/StackerManager.java @@ -95,12 +95,6 @@ public class StackerManager extends MiniPlugin implements IThrown return; } - if (!Manager.CanBump(stacker)) - { - UtilPlayer.message(stacker, F.main("Stacker", "You are not playing stacker.")); - return; - } - if (stacker.getVehicle() != null || _tempStackShift.contains(stacker)) { UtilPlayer.message(stacker, F.main("Stacker", "You cannot stack while stacked...")); @@ -123,9 +117,15 @@ public class StackerManager extends MiniPlugin implements IThrown if (stackee instanceof Player) { - if (!Manager.CanBump(((Player)stackee))) + if (!Manager.hasPlayerStackingEnabled(stacker)) { - UtilPlayer.message(stacker, F.main("Stacker", F.name(UtilEnt.getName(stackee)) + " is not playing stacker.")); + UtilPlayer.message(stacker, F.main("Stacker", "You have player stacking disabled.")); + return; + } + + if (!Manager.hasPlayerStackingEnabled(((Player)stackee))) + { + UtilPlayer.message(stacker, F.main("Stacker", F.name(UtilEnt.getName(stackee)) + " has player stacking disabled.")); return; } @@ -242,7 +242,7 @@ public class StackerManager extends MiniPlugin implements IThrown if (target.getCustomName() != null || (target.getPassenger() != null && target.getPassenger() instanceof LivingEntity && ((LivingEntity)target.getPassenger()).getCustomName() != null)) return; - if (!Manager.CanBump(target)) + if (!Manager.hasPlayerStackingEnabled(target)) return; //Velocity