From 1bf8ccfc430cdc8638ec99a86526230dbc237062 Mon Sep 17 00:00:00 2001 From: Sam Sun Date: Thu, 26 May 2016 11:20:42 -0400 Subject: [PATCH 1/9] Bump worldevent required rank --- .../game/clans/clans/worldevent/command/WorldEventCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/worldevent/command/WorldEventCommand.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/worldevent/command/WorldEventCommand.java index 7a830d9c6..73d55f096 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/worldevent/command/WorldEventCommand.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/worldevent/command/WorldEventCommand.java @@ -10,7 +10,7 @@ public class WorldEventCommand extends MultiCommandBase { public WorldEventCommand(WorldEventManager plugin) { - super(plugin, Rank.SNR_MODERATOR, "worldevent", "we", "event"); + super(plugin, Rank.ADMIN, "worldevent", "we", "event"); AddCommand(new StartCommand(Plugin)); AddCommand(new ClearCommand(Plugin)); From ef0dcdb0df6a028b44d66e2017fc81fb4cfcfca2 Mon Sep 17 00:00:00 2001 From: Sam Sun Date: Thu, 26 May 2016 11:23:29 -0400 Subject: [PATCH 2/9] Bump invsee required rank too --- .../game/clans/clans/invsee/commands/InvseeCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/invsee/commands/InvseeCommand.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/invsee/commands/InvseeCommand.java index 00f0e24b8..1b76c130e 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/invsee/commands/InvseeCommand.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/invsee/commands/InvseeCommand.java @@ -19,7 +19,7 @@ public class InvseeCommand extends CommandBase { public InvseeCommand(InvseeManager plugin) { - super(plugin, Rank.ADMIN, "invsee"); + super(plugin, Rank.CMOD, "invsee"); } @Override From daf1d1a9ba372170255fbfaaf1c3f2441931d60e Mon Sep 17 00:00:00 2001 From: samczsun Date: Wed, 25 May 2016 19:35:20 -0400 Subject: [PATCH 3/9] Fix duplication glitch using fissure --- .../game/clans/clans/ClansManager.java | 11 +++++ .../classcombat/Skill/Mage/FissureData.java | 7 +++ .../Mage/events/FissureModifyBlockEvent.java | 46 +++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/events/FissureModifyBlockEvent.java diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java index 69af91170..dca0a3881 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansManager.java @@ -81,6 +81,7 @@ import mineplex.minecraft.game.classcombat.Class.ClientClass; import mineplex.minecraft.game.classcombat.Class.IPvpClass; import mineplex.minecraft.game.classcombat.Class.repository.token.CustomBuildToken; import mineplex.minecraft.game.classcombat.Condition.SkillConditionManager; +import mineplex.minecraft.game.classcombat.Skill.Mage.events.FissureModifyBlockEvent; import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import mineplex.minecraft.game.classcombat.item.ItemFactory; import mineplex.minecraft.game.classcombat.shop.ClassCombatShop; @@ -99,6 +100,7 @@ import org.bukkit.entity.Horse; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; import org.bukkit.event.block.Action; import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.SignChangeEvent; @@ -310,6 +312,15 @@ public class ClansManager extends MiniClientPluginimplements IRelati ClanTerritory territory = _clanUtility.getClaim(location); return territory == null || !territory.Safe; }); + registerEvents(new Listener() + { + @EventHandler + public void on(FissureModifyBlockEvent event) + { + Material targetType = event.getTargetBlock().getType(); + event.setCancelled(targetType == Material.POTATO || targetType == Material.CARROT); + } + }); _worldEvent.setFactory(skillManager); _classManager = new ClassManager(plugin, _clientManager, donationManager, skillManager, itemFactory, webServerAddress); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/FissureData.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/FissureData.java index 45833b8d1..8fd59a6d1 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/FissureData.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/FissureData.java @@ -8,6 +8,8 @@ import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilServer; +import mineplex.minecraft.game.classcombat.Skill.Mage.events.FissureModifyBlockEvent; import org.bukkit.Effect; import org.bukkit.Location; import org.bukkit.block.Block; @@ -122,6 +124,11 @@ public class FissureData { return false; } + FissureModifyBlockEvent event = UtilServer.CallEvent(new FissureModifyBlockEvent(block)); + if (event.isCancelled()) + { + return false; + } if (block.getType().toString().contains("BANNER")) return false; if (block.getRelative(BlockFace.UP).getType().toString().contains("BANNER")) diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/events/FissureModifyBlockEvent.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/events/FissureModifyBlockEvent.java new file mode 100644 index 000000000..fe34bd51e --- /dev/null +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/events/FissureModifyBlockEvent.java @@ -0,0 +1,46 @@ +package mineplex.minecraft.game.classcombat.Skill.Mage.events; + +import org.bukkit.block.Block; +import org.bukkit.event.Cancellable; +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; + +public class FissureModifyBlockEvent extends Event implements Cancellable +{ + private static final HandlerList HANDLER_LIST = new HandlerList(); + + private final Block _targetBlock; + + private boolean _cancelled; + + public FissureModifyBlockEvent(Block targetBlock) + { + this._targetBlock = targetBlock; + } + + public boolean isCancelled() + { + return this._cancelled; + } + + public void setCancelled(boolean cancelled) + { + this._cancelled = cancelled; + } + + public Block getTargetBlock() + { + return this._targetBlock; + } + + @Override + public HandlerList getHandlers() + { + return HANDLER_LIST; + } + + public static HandlerList getHandlerList() + { + return HANDLER_LIST; + } +} From f1f464f3a4886d28c9ab3a538fe4e15f69dd908f Mon Sep 17 00:00:00 2001 From: samczsun Date: Thu, 26 May 2016 14:37:58 -0400 Subject: [PATCH 4/9] Change listener priority again. Fixes PC-209 --- .../src/mineplex/core/packethandler/PacketHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/packethandler/PacketHandler.java b/Plugins/Mineplex.Core/src/mineplex/core/packethandler/PacketHandler.java index 5e76bf104..3018daa85 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/packethandler/PacketHandler.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/packethandler/PacketHandler.java @@ -31,7 +31,7 @@ public class PacketHandler extends MiniPlugin super("PacketHandler", plugin); } - @EventHandler(priority = EventPriority.MONITOR) + @EventHandler(priority = EventPriority.LOWEST) public void onPlayerJoin(PlayerJoinEvent event) { _playerVerifierMap.put(event.getPlayer(), new PacketVerifier(event.getPlayer(), this)); From 079476143596dbcc9f6fed8cbc36ce4e50de553e Mon Sep 17 00:00:00 2001 From: samczsun Date: Thu, 26 May 2016 14:46:27 -0400 Subject: [PATCH 5/9] Forgot a nullcheck --- .../src/mineplex/game/clans/clans/ClansGame.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansGame.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansGame.java index 8247f16c0..11f7fdf5d 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansGame.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansGame.java @@ -329,7 +329,7 @@ public class ClansGame extends MiniPlugin ClanInfo clan = _clans.getClan(player); ClanInfo mimicClan = _clans.getClanAdmin().getMimic(player, false); ClanInfo blockClan = _clans.getClanUtility().getClaim(loc) == null ? null : _clans.getClan(_clans.getClanUtility().getClaim(loc).Owner); - if (blockClan.equals(mimicClan)) access = ClanRelation.SELF; + if (blockClan != null && blockClan.equals(mimicClan)) access = ClanRelation.SELF; // Doors, chests, & furnaces if (blockClan != null && (!blockClan.equals(clan) && !blockClan.equals(mimicClan)) && (event.getAction() == Action.RIGHT_CLICK_BLOCK && (loc.getBlock().getType().name().contains("DOOR") || UtilItem.doesHaveGUI(loc.getBlock().getType())))) From f7e0bc7d1613acc60ff2ea0a294865de19ac7769 Mon Sep 17 00:00:00 2001 From: samczsun Date: Thu, 26 May 2016 14:47:09 -0400 Subject: [PATCH 6/9] Don't log if culled is 0 --- .../src/mineplex/game/clans/world/WorldManager.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/world/WorldManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/world/WorldManager.java index e6b7bf983..e302d1a26 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/world/WorldManager.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/world/WorldManager.java @@ -146,6 +146,9 @@ public class WorldManager extends MiniPlugin iterator.remove(); culled++; } - log("Culled " + culled + " " + type); + if (culled != 0) + { + log("Culled " + culled + " " + type); + } } } From 84276f68a0447fc8c6ec592f8afab390a4c91a16 Mon Sep 17 00:00:00 2001 From: samczsun Date: Thu, 26 May 2016 14:52:05 -0400 Subject: [PATCH 7/9] Change help message rank --- .../game/clans/clans/invsee/commands/InvseeCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/invsee/commands/InvseeCommand.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/invsee/commands/InvseeCommand.java index 1b76c130e..36b0466a8 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/invsee/commands/InvseeCommand.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/invsee/commands/InvseeCommand.java @@ -27,7 +27,7 @@ public class InvseeCommand extends CommandBase { if (args.length == 0) { - UtilPlayer.message(caller, F.help("/invsee ", "View a player's inventory", Rank.ADMIN)); + UtilPlayer.message(caller, F.help("/invsee ", "View a player's inventory", Rank.CMOD)); return; } UUID uuid = null; From 59c26bdcd7f3c8e6b9c09040a48c7108edbdb860 Mon Sep 17 00:00:00 2001 From: Sam Sun Date: Fri, 27 May 2016 13:41:49 -0400 Subject: [PATCH 8/9] Undo leap change --- .../minecraft/game/classcombat/Skill/Assassin/Leap.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Leap.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Leap.java index f1dcbb780..06bdda17a 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Leap.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Leap.java @@ -78,7 +78,7 @@ public class Leap extends SkillActive { //Action if (!wallkick) - UtilAction.velocity(player, 1 + 0.15 * level, 0.2, 1, true); + UtilAction.velocity(player, 1.2, 0.2, 1, true); else { Vector vec = player.getLocation().getDirection(); From dfbb4dca113c2a0c623d4c7b309373c7b5a75d86 Mon Sep 17 00:00:00 2001 From: cnr Date: Fri, 27 May 2016 12:50:09 -0500 Subject: [PATCH 9/9] Update chat-spam message with coupon link --- Plugins/Mineplex.Core/src/mineplex/core/chat/Chat.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/chat/Chat.java b/Plugins/Mineplex.Core/src/mineplex/core/chat/Chat.java index fcdb2aafa..ffbafc0b6 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/chat/Chat.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/chat/Chat.java @@ -337,7 +337,7 @@ public class Chat extends MiniPlugin !Recharge.Instance.use(sender, "All Chat Message", 3000, false, false)) { UtilPlayer.message(sender, C.cYellow + "You can only chat once every 3 seconds to prevent spam."); - UtilPlayer.message(sender, C.cYellow + "Buy a Rank at " + C.cGreen + "www.mineplex.com/shop" + C.cYellow + " to remove this limit!"); + UtilPlayer.message(sender, C.cYellow + "FREE $5 Gift Card with code " + C.cGreen + "Mineplex5 " + C.cYellow + "on any rank " + C.cGreen + "http://goo.gl/z7bOh2 !"); event.setCancelled(true); } else if (!_clientManager.Get(sender).GetRank().has(Rank.MODERATOR) &&