diff --git a/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java b/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java index e54f367dd..6b5a6bdde 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java +++ b/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java @@ -85,7 +85,7 @@ public class McMMOPlayer { private int recentlyHurt; private int respawnATS; - private SkillType lastGained; + private boolean isUsingUnarmed; public McMMOPlayer(Player player) { String playerName = player.getName(); @@ -493,7 +493,7 @@ public class McMMOPlayer { spoutHud.setLastGained(skillType); } - lastGained = skillType; + isUsingUnarmed = skillType == SkillType.UNARMED; SkillUtils.xpCheckSkill(skillType, player, profile); } @@ -645,12 +645,8 @@ public class McMMOPlayer { partyChatMode = !partyChatMode; } - public SkillType getLastGained() { - return lastGained; - } - - public void setLastGained(SkillType type) { - this.lastGained = type; + public boolean isUsingUnarmed() { + return isUsingUnarmed; } /** diff --git a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index e6a7b2444..15fe49dde 100644 --- a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -223,7 +223,7 @@ public class PlayerListener implements Listener { PlayerInventory inventory = player.getInventory(); int firstEmpty = inventory.firstEmpty(); - if (mcMMOPlayer.getLastGained() == SkillType.UNARMED && ItemUtils.isShareable(dropStack) && firstEmpty == inventory.getHeldItemSlot()) { + if (mcMMOPlayer.isUsingUnarmed() && ItemUtils.isShareable(dropStack) && firstEmpty == inventory.getHeldItemSlot()) { int nextSlot = firstEmpty + 1; for (Iterator iterator = inventory.iterator(nextSlot); iterator.hasNext();) { diff --git a/src/main/java/com/gmail/nossr50/party/ShareHandler.java b/src/main/java/com/gmail/nossr50/party/ShareHandler.java index 74c3cfe65..d67242c8a 100644 --- a/src/main/java/com/gmail/nossr50/party/ShareHandler.java +++ b/src/main/java/com/gmail/nossr50/party/ShareHandler.java @@ -4,7 +4,6 @@ import java.util.List; import org.bukkit.entity.Item; import org.bukkit.entity.Player; -import org.bukkit.event.player.PlayerPickupItemEvent; import org.bukkit.inventory.ItemStack; import com.gmail.nossr50.config.Config;