public MachineUtil getUtil() { return this.getMachine().getMachineUtil(); }
@Override public void onUpdateClient() { super.onUpdateClient(); IMachine machine = Machine.getMachine(Window.get(this).getInventory()); MachineUtil machineUtil = machine.getMachineUtil(); ItemStack stackTarget = machineUtil.getStack(Sequencer.SLOT_TARGET); if (stackTarget.isEmpty()) { this.textControl.setValue(""); } else { Random rand = new Random(stackTarget.getDisplayName().length()); StringBuilder text = new StringBuilder(); for (int i = 0; i < 65; ++i) { int k = rand.nextInt(4); String code = CODES[k]; if (rand.nextFloat() < this.progress) { text.append(TextFormatting.RESET).append(COLORS[k]).append(TextFormatting.BOLD).append(code); } else { text.append(TextFormatting.RESET).append(TextFormatting.GRAY).append(TextFormatting.OBFUSCATED).append(TextFormatting.BOLD).append(code); } } this.textControl.setValue(text.toString()); } } }
private void setStack(ItemStack itemStack) { IInventory inventory = getMachine().getMachineUtil().getInventory(); inventory.setInventorySlotContents(0, itemStack); }
public ItemStack getStack() { IInventory inventory = getMachine().getMachineUtil().getInventory(); return inventory.getStackInSlot(0); }
if (!stack.isEmpty()) { IMachine machine1 = transfer.getMachine(); MachineUtil machineUtil = machine1.getMachineUtil(); return !machineUtil.getStack(Splicer.SLOT_SERUM_VIAL).isEmpty() && machine1.getInterface(SplicerLogic.class).isValidSerum() != null;
if (!stack.isEmpty()) { IMachine machine1 = transfer.getMachine(); MachineUtil machineUtil = machine1.getMachineUtil(); return !machineUtil.getStack(Inoculator.SLOT_SERUM_VIAL).isEmpty() && machine1.getInterface(InoculatorLogic.class).isValidSerum() != null;