Only care if it was unarmed.

This commit is contained in:
GJ 2013-04-09 16:51:33 -04:00
parent 7fe8122499
commit 78d2fa7520
3 changed files with 5 additions and 10 deletions

View File

@ -85,7 +85,7 @@ public class McMMOPlayer {
private int recentlyHurt; private int recentlyHurt;
private int respawnATS; private int respawnATS;
private SkillType lastGained; private boolean isUsingUnarmed;
public McMMOPlayer(Player player) { public McMMOPlayer(Player player) {
String playerName = player.getName(); String playerName = player.getName();
@ -493,7 +493,7 @@ public class McMMOPlayer {
spoutHud.setLastGained(skillType); spoutHud.setLastGained(skillType);
} }
lastGained = skillType; isUsingUnarmed = skillType == SkillType.UNARMED;
SkillUtils.xpCheckSkill(skillType, player, profile); SkillUtils.xpCheckSkill(skillType, player, profile);
} }
@ -645,12 +645,8 @@ public class McMMOPlayer {
partyChatMode = !partyChatMode; partyChatMode = !partyChatMode;
} }
public SkillType getLastGained() { public boolean isUsingUnarmed() {
return lastGained; return isUsingUnarmed;
}
public void setLastGained(SkillType type) {
this.lastGained = type;
} }
/** /**

View File

@ -223,7 +223,7 @@ public class PlayerListener implements Listener {
PlayerInventory inventory = player.getInventory(); PlayerInventory inventory = player.getInventory();
int firstEmpty = inventory.firstEmpty(); 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; int nextSlot = firstEmpty + 1;
for (Iterator<ItemStack> iterator = inventory.iterator(nextSlot); iterator.hasNext();) { for (Iterator<ItemStack> iterator = inventory.iterator(nextSlot); iterator.hasNext();) {

View File

@ -4,7 +4,6 @@ import java.util.List;
import org.bukkit.entity.Item; import org.bukkit.entity.Item;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.Config;