mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Only care if it was unarmed.
This commit is contained in:
parent
7fe8122499
commit
78d2fa7520
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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<ItemStack> iterator = inventory.iterator(nextSlot); iterator.hasNext();) {
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user