AFKGuard allows you to detect even the most tricky AFK machines and cheats, by being fully configurable and accessible!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
751 B

package com.entryrise.afkguard.gui;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.inventory.Inventory;
public class GUIInventory {
public Inventory inv;
public List<GUIItem> items = new ArrayList<GUIItem>();
public GUIItem getGUIItem(int slot) {
for (GUIItem itm : items) {
if (itm.getSlot() == slot) {
return itm;
}
}
return null;
}
public void addGUIItem(GUIItem itm) {
items.add(itm);
inv.setItem(itm.getSlot(), itm.getItm().clone());
}
public void reset() {
items.clear();
}
public GUIInventory(Inventory inv) {
this.inv = inv;
}
public GUIInventory(Inventory inv, List<GUIItem> items) {
this.inv = inv;
for (GUIItem itm : items) {
addGUIItem(itm);
}
}
}