mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 16:46:46 +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 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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();) {
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user