use of binnie.core.gui.minecraft.WindowInventory in project Binnie by ForestryMC.
the class WindowFieldKit method receiveGuiNBTOnServer.
@Override
public void receiveGuiNBTOnServer(final EntityPlayer player, final String name, final NBTTagCompound nbt) {
super.receiveGuiNBTOnServer(player, name, nbt);
if (name.equals("analyse")) {
WindowInventory inventory = getWindowInventory();
ItemStack individualStack = inventory.getStackInSlot(INDIVIDUAL_SLOT);
inventory.setInventorySlotContents(INDIVIDUAL_SLOT, ManagerGenetics.analyse(individualStack, this.getWorld(), this.getUsername()));
inventory.decrStackSize(PAPER_SLOT, 1);
}
}
use of binnie.core.gui.minecraft.WindowInventory in project Binnie by ForestryMC.
the class WindowAnalyst method onWindowInventoryChanged.
@Override
public void onWindowInventoryChanged() {
super.onWindowInventoryChanged();
WindowInventory inv = getWindowInventory();
ItemStack stack = inv.getStackInSlot(0);
if (!stack.isEmpty() && !ManagerGenetics.isAnalysed(stack)) {
inv.setInventorySlotContents(0, ManagerGenetics.analyse(stack, getWorld(), getUsername()));
inv.decrStackSize(1, 1);
}
if (isClient()) {
// noinspection MethodCallSideOnly
setStack(stack);
}
}
Aggregations