public IProcess getProcess() { return this.machine.getInterface(IProcess.class); }
public MachineUtil getUtil() { return this.getMachine().getMachineUtil(); }
public void refreshBlock() { BlockPos pos = machine.getTileEntity().getPos(); World world = machine.getWorld(); IBlockState blockState = world.getBlockState(pos); machine.getWorld().notifyBlockUpdate(pos, blockState, blockState, 0); }
@Override public void initialiseClient() { this.setTitle(Machine.getMachine(this.getInventory()).getPackage().getDisplayName()); ControlPlayerInventory playerInventory = new ControlPlayerInventory(this); final ControlSlotArray.Builder slot = new ControlSlotArray.Builder(this, 43, 30, 5, 1); slot.create(AlvearyHatchery.SLOT_LARVAE); }
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;
IInventory inventory = this.getInventory(); IMachine machine = Machine.getMachine(inventory); MachinePackage machinePackage = machine.getPackage(); this.setTitle(machinePackage.getDisplayName()); int x = 16; final int y = 32; final ComponentCompartmentInventory inv = machine.getInterface(ComponentCompartmentInventory.class); Integer[] tabs1 = new Integer[0]; Integer[] tabs2 = new Integer[0];
public World getWorld() { return this.machine.getWorld(); } }
@Override protected void onFinishTask() { super.onFinishTask(); ItemStack itemStack = this.getUtil().getStack(Analyser.SLOT_TARGET); itemStack = ManagerGenetics.analyse(itemStack, getMachine().getWorld(), getMachine().getOwner()); this.getInventory().setInventorySlotContents(Analyser.SLOT_TARGET, itemStack); }
@Override public void receiveGuiNBTOnServer(final EntityPlayer player, final String name, final NBTTagCompound nbt) { if (name.equals("comp-change-tab")) { final CompartmentTab tab2 = new CompartmentTab(nbt); this.tabs.put(tab2.getId(), tab2); this.getMachine().getTileEntity().markDirty(); } }
@Override public ErrorState canProgress() { if (getMachine().getOwner() == null) { return new ErrorState(GeneticsErrorCode.NO_OWNER, Analyser.SLOT_TARGET); } if (this.getUtil().getSlotCharge(Analyser.SLOT_DYE) == 0.0f) { return new ErrorState(GeneticsErrorCode.ANALYSER_INSUFFICIENT_DYE, new int[]{Analyser.SLOT_DYE}); } return super.canProgress(); }
public MachineComponent(final IMachine machine) { this.machine = machine; machine.addComponent(this); }
@Override @SideOnly(Side.CLIENT) public void initialiseClient() { this.setTitle(Machine.getMachine(this.getInventory()).getPackage().getDisplayName()); for (int i = 0; i < 36; ++i) { final int x = i % 12; final int y = i / 12; new ControlTankSlot(this, 16 + x * 18, 32 + y * 18, i); } new ControlPlayerInventory(this); } }
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;
public boolean isServer() { return !this.machine.getWorld().isRemote; }
@Override protected void onFinishTask() { super.onFinishTask(); this.updateSequence(); ItemStack stack = this.getUtil().getStack(Sequencer.SLOT_TARGET); Preconditions.checkState(!stack.isEmpty()); final SequencerItem seqItem = SequencerItem.create(stack); Preconditions.checkState(seqItem != null); GeneTracker.getTracker(this.getMachine().getWorld(), this.getMachine().getOwner()).registerGene(seqItem.getGene()); this.getUtil().decreaseStack(Sequencer.SLOT_TARGET, 1); if (this.getUtil().getStack(Sequencer.SLOT_DONE).isEmpty()) { this.getUtil().setStack(Sequencer.SLOT_DONE, GeneticsItems.EmptySequencer.get(1)); } else { this.getUtil().decreaseStack(Sequencer.SLOT_DONE, -1); } }
@Override public void onUpdate() { if (!this.registeredToIC2EnergyNet && !this.getMachine().getTileEntity().isInvalid()) { this.addToEnergyNet(); } }
public ContainerCraftGUI(final Window window) { this.syncedNBT = new HashMap<>(); this.sentNBT = new HashMap<>(); this.syncedTanks = new HashMap<>(); this.syncedPower = new PowerInfo(); this.syncedProcess = new ProcessInfo(); this.errorType = 0; this.error = null; this.mousedOverSlotNumber = -1; this.window = window; final IMachine machine = Machine.getMachine(window.getInventory()); if (this.getSide() == Side.SERVER && machine != null) { final GameProfile user = machine.getOwner(); if (user != null) { final NBTTagCompound nbt = new NBTTagCompound(); nbt.setString("username", user.getName()); this.sendNBTToClient("username", nbt); } } detectAndSendChanges(); }
@Override public void initialiseClient() { this.setTitle(Machine.getMachine(this.getInventory()).getPackage().getDisplayName()); new ControlPlayerInventory(this); new ControlSlot.Builder(this, 79, 30).assign(0); }
public IInventory getInventory() { return this.machine.getInterface(IInventory.class); }
private void addToEnergyNet() { World world = this.getMachine().getWorld(); if (world == null || world.isRemote) { return; } if (Mods.IC2.active()) { this.do_addToEnergyNet(); } }