From 474c2e78f2b710de7cf3caf172e642954da27d26 Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 20 May 2017 17:32:44 +0100 Subject: [PATCH 1/2] Check to make user the player has the itemstack when cashing out --- .../src/mineplex/gemhunters/loot/LootModule.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/mineplex-game-gemhunters/src/mineplex/gemhunters/loot/LootModule.java b/Plugins/mineplex-game-gemhunters/src/mineplex/gemhunters/loot/LootModule.java index ea7dc1d4d..dbff05dc6 100644 --- a/Plugins/mineplex-game-gemhunters/src/mineplex/gemhunters/loot/LootModule.java +++ b/Plugins/mineplex-game-gemhunters/src/mineplex/gemhunters/loot/LootModule.java @@ -622,7 +622,7 @@ public class LootModule extends MiniPlugin { LootItemReward reward = iterator.next(); - if (player.equals(reward.getPlayer())) + if (player.equals(reward.getPlayer()) && player.getInventory().contains(reward.getItemStack())) { reward.success(); iterator.remove(); From 670e9db9d2e2c306f17762e8bd0007c0631f96d0 Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 20 May 2017 17:33:00 +0100 Subject: [PATCH 2/2] Add Region to the slack logging --- .../src/mineplex/gemhunters/util/SlackRewardBot.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Plugins/mineplex-game-gemhunters/src/mineplex/gemhunters/util/SlackRewardBot.java b/Plugins/mineplex-game-gemhunters/src/mineplex/gemhunters/util/SlackRewardBot.java index 9ae99966a..923bae01e 100644 --- a/Plugins/mineplex-game-gemhunters/src/mineplex/gemhunters/util/SlackRewardBot.java +++ b/Plugins/mineplex-game-gemhunters/src/mineplex/gemhunters/util/SlackRewardBot.java @@ -7,6 +7,7 @@ import mineplex.core.slack.SlackAPI; import mineplex.core.slack.SlackMessage; import mineplex.core.slack.SlackTeam; import mineplex.gemhunters.loot.rewards.LootItemReward; +import org.bukkit.ChatColor; import org.bukkit.entity.Player; import java.net.MalformedURLException; @@ -34,10 +35,10 @@ public class SlackRewardBot { SlackAPI.getInstance().sendMessage(SlackTeam.DEVELOPER, SLACK_CHANNEL_NAME, new SlackMessage(SLACK_USERNAME, new URL(SLACK_ICON), "Rewarding a " + reward.getClass().getSimpleName() + - "\nName: " + reward.getItemStack().getItemMeta().getDisplayName() + + "\nName: " + ChatColor.stripColor(reward.getItemStack().getItemMeta().getDisplayName()) + "\nPlayer: " + player.getName() + "\nStatus: *" + status + "*" + - "\nServer: " + UtilServer.getServerName() + + "\nServer: " + UtilServer.getServerName() + " " + UtilServer.getRegion().toString() + "\nTPS: " + FORMAT.format(_lag.getTicksPerSecond())), true); }