Fixing inventory item handling
Dieser Commit ist enthalten in:
Ursprung
d430311693
Commit
e61ef0ba66
@ -2,6 +2,7 @@ package me.yaruma.fightsystem.listener;
|
||||
|
||||
import me.yaruma.fightsystem.FightSystem;
|
||||
import me.yaruma.fightsystem.fight.FightState;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
@ -26,14 +27,15 @@ public class InventoryListener implements Listener {
|
||||
if (clickedOn != null && event.getView().getTopInventory().getType() != InventoryType.CRAFTING && clicked == event.getWhoClicked().getInventory()) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}else if (clicked != event.getWhoClicked().getInventory()) {
|
||||
ItemStack onCursor = event.getCurrentItem();
|
||||
|
||||
if (onCursor != null && event.getClickedInventory().getType() != InventoryType.PLAYER){
|
||||
}else if (
|
||||
clicked != event.getWhoClicked().getInventory() &&
|
||||
clicked != null &&
|
||||
clicked.getType() != InventoryType.PLAYER &&
|
||||
event.getCursor() != null &&
|
||||
event.getCursor().getType() != Material.AIR){
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onInventoryDrag(InventoryDragEvent event) {
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren