Update ItemChange.java
This commit is contained in:
parent
9059790a65
commit
754f486d1b
@ -9,12 +9,14 @@ import org.bukkit.scheduler.BukkitRunnable;
|
|||||||
|
|
||||||
public class ItemChange {
|
public class ItemChange {
|
||||||
public static void itemChange(Player player, Boolean setCursor) {
|
public static void itemChange(Player player, Boolean setCursor) {
|
||||||
|
T2Csend.debug(Main.getPlugin(), "Join: " + player.getName());
|
||||||
Integer slot;
|
Integer slot;
|
||||||
if ((Boolean) Config.useItemInventorySlotEnforce.value) {
|
if ((Boolean) Config.useItemInventorySlotEnforce.value) {
|
||||||
slot =(Integer) Config.useItemInventorySlot.value;
|
slot =(Integer) Config.useItemInventorySlot.value;
|
||||||
} else {
|
} else {
|
||||||
slot = Events.useItemSlotHashMap.get(player.getName());
|
slot = Events.useItemSlotHashMap.get(player.getName());
|
||||||
}
|
}
|
||||||
|
T2Csend.debug(Main.getPlugin(), "Slot " + slot + " for player: " + player.getName());
|
||||||
|
|
||||||
if (!(Boolean)Config.useItemEnable.value) {
|
if (!(Boolean)Config.useItemEnable.value) {
|
||||||
return;
|
return;
|
||||||
@ -22,6 +24,7 @@ public class ItemChange {
|
|||||||
UseItem.removeItem(player);
|
UseItem.removeItem(player);
|
||||||
if (UseItem.protection(player, false)) return;
|
if (UseItem.protection(player, false)) return;
|
||||||
if ((Boolean)Config.useItemGiveOnlyOnFirstJoin.value) {
|
if ((Boolean)Config.useItemGiveOnlyOnFirstJoin.value) {
|
||||||
|
T2Csend.debug(Main.getPlugin(), "OnlyOnFirstJoin: " + player.getName());
|
||||||
if (!(Boolean)Config.useItemAllowToggle.value || Events.useItemHashMap.get(player.getName())) {
|
if (!(Boolean)Config.useItemAllowToggle.value || Events.useItemHashMap.get(player.getName())) {
|
||||||
if (!player.hasPlayedBefore()) {
|
if (!player.hasPlayedBefore()) {
|
||||||
new BukkitRunnable() {
|
new BukkitRunnable() {
|
||||||
@ -68,8 +71,8 @@ public class ItemChange {
|
|||||||
if (empty) {
|
if (empty) {
|
||||||
UseItem.addUseItem(player);
|
UseItem.addUseItem(player);
|
||||||
}
|
}
|
||||||
}
|
}else T2Csend.debug(Main.getPlugin(), "give skip [1]: " + player.getName());
|
||||||
}
|
} else T2Csend.debug(Main.getPlugin(), "give skip [2]: " + player.getName());
|
||||||
}
|
}
|
||||||
}.runTaskLater(Main.getPlugin(), 1L * 1);
|
}.runTaskLater(Main.getPlugin(), 1L * 1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user