Fix Slot Registration Crash (#73)

This commit is contained in:
Julia authored and GitHub committed 2025-09-25 15:46:12 +02:00
1 parent d24088ea4b
commit e6c67df077
22 files changed
+115 -81

No files matched your search

@@ -115,12 +115,14 @@ public class WindowFieldKit extends Window {
@Override
public void initialiseClient() {
final NBTTagList actions = new NBTTagList();
setTitle(getName());
CraftGUI.render.stylesheet(new StyleSheetPunnett());
getWindowInventory().createSlot(0);
getWindowInventory().createSlot(1);
setupValidators();
new ControlPlayerInventory(this);
new ControlPlayerInventory(this).create(actions);
IPoint handGlass = new IPoint(16.0f, 32.0f);
GlassControl = new ControlImage(
this,
@@ -128,8 +130,6 @@ public class WindowFieldKit extends Window {
handGlass.y(),
new StandardTexture(0, 160, 96, 96, ExtraBeeTexture.GUIPunnett));
final NBTTagList actions = new NBTTagList();
new ControlSlot(this, handGlass.x() + 54.0f, handGlass.y() + 26.0f).assign(actions, InventoryType.Window, 0);
new ControlSlot(this, 208.0f, 8.0f).assign(actions, InventoryType.Window, 1);
@@ -63,7 +63,7 @@ public class WindowGenesis extends Window {
@Override
public void initialiseClient() {
new ControlPlayerInventory(this);
new ControlPlayerInventory(this).createAndRegister();
setTitle(getName());
ControlTabBar<BreedingSystem> tabSystems = new BreedingSystemControlTabBar();
@@ -40,7 +40,6 @@ public class ControlPlayerInventory extends Control {
slots.add(slot2);
}
}
create();
}
public ControlPlayerInventory(IWidget parent) {
@@ -56,12 +55,9 @@ public class ControlPlayerInventory extends Control {
slots.add(slot);
}
}
create();
}
public void create() {
final NBTTagList actions = new NBTTagList();
public ControlPlayerInventory create(NBTTagList actions) {
for (int row = 0; row < 3; ++row) {
for (int column = 0; column < 9; ++column) {
ControlSlot slot = slots.get(column + row * 9);
@@ -74,14 +70,13 @@ public class ControlPlayerInventory extends Control {
slot2.assign(actions, InventoryType.Player, i1);
}
return this;
}
public ControlPlayerInventory createAndRegister() {
final NBTTagList actions = new NBTTagList();
create(actions);
MessageCraftGUI.sendToServer(actions);
return this;
}
public ControlSlot getSlot(int i) {
if (i < 0 || i >= slots.size()) {
return null;
}
return slots.get(i);
}
}
@@ -9,7 +9,6 @@ import net.minecraft.nbt.NBTTagList;
import binnie.core.craftgui.IWidget;
import binnie.core.craftgui.controls.core.Control;
import binnie.core.craftgui.minecraft.InventoryType;
import binnie.core.network.packet.MessageCraftGUI;
public class ControlSlotArray extends Control implements Iterable<ControlSlot> {
@@ -29,13 +28,7 @@ public class ControlSlotArray extends Control implements Iterable<ControlSlot> {
return new ControlSlot(this, x, y);
}
public ControlSlotArray create(int[] index) {
return create(InventoryType.Machine, index);
}
public ControlSlotArray create(InventoryType inventoryType, int[] index) {
final NBTTagList actions = new NBTTagList();
public ControlSlotArray create(NBTTagList actions, InventoryType inventoryType, int[] index) {
int i = 0;
for (ControlSlot controlSlot : slots) {
final int slotIndex = index[i];
@@ -43,7 +36,6 @@ public class ControlSlotArray extends Control implements Iterable<ControlSlot> {
i++;
}
MessageCraftGUI.sendToServer(actions);
return this;
}
@@ -190,7 +190,11 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
for (int k = 0; k < inv.getPageSize(); ++k) {
slotsIDs[k] = i++;
}
new ControlSlotArray(thisPage, 8, 8, inv.getPageSize() / 5, 5).create(slotsIDs);
final NBTTagList actions = new NBTTagList();
new ControlSlotArray(thisPage, 8, 8, inv.getPageSize() / 5, 5)
.create(actions, InventoryType.Machine, slotsIDs);
MessageCraftGUI.sendToServer(actions);
}
x += compartmentPageWidth;
if (tabs2.length > 0) {
@@ -248,7 +252,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
setSize(new IPoint(Math.max(32 + compartmentWidth, 252), h()));
controlCompartment.setPosition(new IPoint((w() - controlCompartment.w()) / 2.0f, controlCompartment.y()));
new ControlPlayerInventory(this, true);
new ControlPlayerInventory(this, true).createAndRegister();
ControlSlide slide = new ControlSlide(this, 0.0f, 134.0f, 136.0f, 92.0f, Position.LEFT);
slide.setLabel(I18N.localise("binniecore.machine.storage.tab.properties"));
slide.setSlide(false);
@@ -370,7 +374,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
};
slotGrid = new Control(scroll, 1.0f, 1.0f, 108.0f, 18.0f);
scroll.setScrollableContent(slotGrid);
new ControlPlayerInventory(this, true);
new ControlPlayerInventory(this, true).createAndRegister();
new ControlTextEdit(this, 16.0f, 16.0f, 100.0f, 14.0f).addEventHandler(new EventTextEdit.Handler() {
@Override
@@ -2,6 +2,7 @@ package binnie.extrabees.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.nbt.NBTTagList;
import binnie.core.AbstractMod;
import binnie.core.craftgui.minecraft.InventoryType;
@@ -10,6 +11,7 @@ import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
import binnie.core.craftgui.minecraft.control.ControlSlot;
import binnie.core.machines.Machine;
import binnie.core.machines.TileEntityMachine;
import binnie.core.network.packet.MessageCraftGUI;
import binnie.core.util.I18N;
import binnie.extrabees.ExtraBees;
import cpw.mods.fml.relauncher.Side;
@@ -34,9 +36,10 @@ public class WindowAlvearyFrame extends Window {
@Override
public void initialiseClient() {
setTitle(I18N.localise("extrabees.machine.alveay.frame"));
playerInventory = new ControlPlayerInventory(this);
ControlSlot slot = new ControlSlot(this, 79.0f, 30.0f);
slot.assignAndRegister(InventoryType.Machine, 0);
final NBTTagList actions = new NBTTagList();
playerInventory = new ControlPlayerInventory(this).create(actions);
new ControlSlot(this, 79.0f, 30.0f).assign(actions, InventoryType.Machine, 0);
MessageCraftGUI.sendToServer(actions);
}
@Override
@@ -2,13 +2,16 @@ package binnie.extrabees.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.nbt.NBTTagList;
import binnie.core.AbstractMod;
import binnie.core.craftgui.minecraft.InventoryType;
import binnie.core.craftgui.minecraft.Window;
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
import binnie.core.craftgui.minecraft.control.ControlSlotArray;
import binnie.core.machines.Machine;
import binnie.core.machines.TileEntityMachine;
import binnie.core.network.packet.MessageCraftGUI;
import binnie.core.util.I18N;
import binnie.extrabees.ExtraBees;
import binnie.extrabees.apiary.machine.hatchery.AlvearyHatchery;
@@ -33,10 +36,11 @@ public class WindowAlvearyHatchery extends Window {
@Override
public void initialiseClient() {
final NBTTagList actions = new NBTTagList();
setTitle(I18N.localise("extrabees.machine.alveay.hatchery"));
playerInventory = new ControlPlayerInventory(this);
ControlSlotArray slot = new ControlSlotArray(this, 43, 30, 5, 1);
slot.create(AlvearyHatchery.SLOT_LARVAE);
playerInventory = new ControlPlayerInventory(this).create(actions);
new ControlSlotArray(this, 43, 30, 5, 1).create(actions, InventoryType.Machine, AlvearyHatchery.SLOT_LARVAE);
MessageCraftGUI.sendToServer(actions);
}
@Override
@@ -3,6 +3,7 @@ package binnie.extrabees.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagList;
import binnie.core.AbstractMod;
import binnie.core.craftgui.controls.ControlText;
@@ -16,6 +17,7 @@ import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
import binnie.core.craftgui.minecraft.control.ControlSlot;
import binnie.core.machines.Machine;
import binnie.core.machines.TileEntityMachine;
import binnie.core.network.packet.MessageCraftGUI;
import binnie.core.util.I18N;
import binnie.extrabees.ExtraBees;
import binnie.extrabees.apiary.machine.mutator.AlvearyMutator;
@@ -40,10 +42,11 @@ public class WindowAlvearyMutator extends Window {
@Override
public void initialiseClient() {
final NBTTagList actions = new NBTTagList();
setTitle(I18N.localise("extrabees.machine.alveay.mutator"));
playerInventory = new ControlPlayerInventory(this);
ControlSlot slot = new ControlSlot(this, 79.0f, 30.0f);
slot.assignAndRegister(InventoryType.Machine, AlvearyMutator.SLOT_MUTATOR);
playerInventory = new ControlPlayerInventory(this).create(actions);
new ControlSlot(this, 79.0f, 30.0f).assign(actions, InventoryType.Machine, AlvearyMutator.SLOT_MUTATOR);
new ControlText(
this,
new IArea(0.0f, 52.0f, w(), 16.0f),
@@ -64,6 +67,8 @@ public class WindowAlvearyMutator extends Window {
display.hastooltip = true;
x += 17.0f;
}
MessageCraftGUI.sendToServer(actions);
}
@Override
@@ -2,6 +2,7 @@ package binnie.extrabees.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.nbt.NBTTagList;
import binnie.core.AbstractMod;
import binnie.core.craftgui.geometry.Position;
@@ -12,6 +13,7 @@ import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
import binnie.core.craftgui.minecraft.control.ControlSlot;
import binnie.core.machines.Machine;
import binnie.core.machines.TileEntityMachine;
import binnie.core.network.packet.MessageCraftGUI;
import binnie.core.util.I18N;
import binnie.extrabees.ExtraBees;
import binnie.extrabees.apiary.machine.stimulator.AlvearyStimulator;
@@ -36,11 +38,12 @@ public class WindowAlvearyStimulator extends Window {
@Override
public void initialiseClient() {
final NBTTagList actions = new NBTTagList();
setTitle(I18N.localise("extrabees.machine.alveay.stimulator"));
playerInventory = new ControlPlayerInventory(this).create(actions);
new ControlSlot(this, 41.0f, 28.0f).assign(actions, InventoryType.Machine, AlvearyStimulator.SLOT_CIRCUIT);
new ControlEnergyBar(this, 75, 29, 60, 16, Position.LEFT);
ControlSlot slot = new ControlSlot(this, 41.0f, 28.0f);
slot.assignAndRegister(InventoryType.Machine, AlvearyStimulator.SLOT_CIRCUIT);
playerInventory = new ControlPlayerInventory(this);
MessageCraftGUI.sendToServer(actions);
}
@Override
@@ -48,10 +48,11 @@ public class WindowLumbermill extends Window {
new ControlSlot(this, 148.0f, 43.0f).assign(actions, InventoryType.Machine, Lumbermill.SLOT_PLANKS);
new ControlSlot(this, 172.0f, 28.0f).assign(actions, InventoryType.Machine, Lumbermill.SLOT_BARK);
new ControlSlot(this, 172.0f, 58.0f).assign(actions, InventoryType.Machine, Lumbermill.SLOT_SAWDUST);
new ControlLumbermillProgress(this, 70.0f, 43.0f);
new ControlLiquidTank(this, 16, 32);
new ControlEnergyBar(this, 8, 112, 16, 60, Position.BOTTOM);
new ControlPlayerInventory(this);
new ControlPlayerInventory(this).create(actions);
new ControlErrorState(this, 95.0f, 73.0f);
MessageCraftGUI.sendToServer(actions);
@@ -51,6 +51,8 @@ public class WindowWoodworker extends Window {
@Override
public void initialiseClient() {
final NBTTagList actions = new NBTTagList();
setTitle(Machine.getMachine(getInventory()).getPackage().getDisplayName());
new ControlText(
this,
@@ -61,11 +63,14 @@ public class WindowWoodworker extends Window {
textEdit = new ControlTextEdit(this, 188.0f, 178.0f, 118.0f, 12.0f);
ControlScrollableContent scroll = new ControlScrollableContent(this, 190.0f, 50.0f, 114.0f, 122.0f, 12.0f);
scroll.setScrollableContent(tileSelect = new ControlTileSelect(scroll, 0.0f, 0.0f));
new ControlPlayerInventory(this).setPosition(new IPoint(14.0f, 96.0f));
ControlPlayerInventory controlPlayerInventory = new ControlPlayerInventory(this);
controlPlayerInventory.setPosition(new IPoint(14.0f, 96.0f));
controlPlayerInventory.create(actions);
new ControlErrorState(this, 76.0f, 65.0f);
if (getInventory() != null) {
final NBTTagList actions = new NBTTagList();
ControlSlot slotWood1 = new ControlSlot(this, 22.0f, 34.0f);
slotWood1.assign(actions, InventoryType.Machine, Designer.DESIGN_1_SLOT);
@@ -74,9 +79,9 @@ public class WindowWoodworker extends Window {
ControlSlot slotBeeswax = new ControlSlot(this, 42.0f, 64.0f);
slotBeeswax.assign(actions, InventoryType.Machine, Designer.GLUE_SLOT);
new ControlRecipeSlot(this, 112, 34);
MessageCraftGUI.sendToServer(actions);
}
MessageCraftGUI.sendToServer(actions);
}
@Override
@@ -2,6 +2,7 @@ package binnie.genetics.craftgui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.nbt.NBTTagList;
import binnie.core.AbstractMod;
import binnie.core.craftgui.geometry.Position;
@@ -14,6 +15,7 @@ import binnie.core.craftgui.minecraft.control.ControlSlot;
import binnie.core.craftgui.minecraft.control.ControlSlotArray;
import binnie.core.craftgui.resource.Texture;
import binnie.core.craftgui.resource.minecraft.StandardTexture;
import binnie.core.network.packet.MessageCraftGUI;
import binnie.core.util.I18N;
import binnie.extrabees.core.ExtraBeeTexture;
import binnie.genetics.Genetics;
@@ -41,17 +43,23 @@ public class WindowAcclimatiser extends WindowMachine {
@Override
public void initialiseClient() {
super.initialiseClient();
final NBTTagList actions = new NBTTagList();
int x = 59;
int y = 32;
new ControlSlotArray(this, x, y, 2, 2).create(Acclimatiser.SLOT_RESERVE);
new ControlSlotArray(this, x, y, 2, 2).create(actions, InventoryType.Machine, Acclimatiser.SLOT_RESERVE);
x += 54;
new ControlSlot(this, x + 18, y).assignAndRegister(InventoryType.Machine, Acclimatiser.SLOT_TARGET);
new ControlSlotArray(this, x, y + 18 + 18, 3, 1).create(Acclimatiser.SLOT_ACCLIMATISER);
new ControlSlot(this, x + 18, y).assign(actions, InventoryType.Machine, Acclimatiser.SLOT_TARGET);
new ControlSlotArray(this, x, y + 18 + 18, 3, 1)
.create(actions, InventoryType.Machine, Acclimatiser.SLOT_ACCLIMATISER);
x += 72;
new ControlSlotArray(this, x, y, 2, 2).create(Acclimatiser.SLOT_DONE);
new ControlSlotArray(this, x, y, 2, 2).create(actions, InventoryType.Machine, Acclimatiser.SLOT_DONE);
new ControlEnergyBar(this, 21, 115, 16, 60, Position.BOTTOM);
new ControlErrorState(this, 181.0f, 83.0f);
new ControlPlayerInventory(this);
new ControlPlayerInventory(this).create(actions);
MessageCraftGUI.sendToServer(actions);
}
@Override
@@ -57,7 +57,7 @@ public class WindowAnalyser extends WindowMachine {
WindowAnalyser.progress = new StandardTexture(66, 51, 66, 40, GeneticsTexture.GUIProcess.getTexture());
int x = 16;
int y = 32;
new ControlSlotArray(this, x, y, 2, 3).create(Analyser.SLOT_RESERVE);
new ControlSlotArray(this, x, y, 2, 3).create(actions, InventoryType.Machine, Analyser.SLOT_RESERVE);
x += 28;
new ControlSlot(this, x, y + 54 + 8).assign(actions, InventoryType.Machine, 13);
new ControlSlotCharge(this, x + 20, y + 54 + 8, 13).setColor(10040319);
@@ -71,8 +71,8 @@ public class WindowAnalyser extends WindowMachine {
new ControlSlot(this, x + 38 - 9, y + 25 - 9).assign(actions, InventoryType.Machine, Analyser.SLOT_TARGET);
new ControlIconDisplay(this, x + 76 + 2, y + 18, GUIIcon.ArrowRight.getIcon());
x += 96;
new ControlSlotArray(this, x, y, 2, 3).create(Analyser.SLOT_FINISHED);
new ControlPlayerInventory(this);
new ControlSlotArray(this, x, y, 2, 3).create(actions, InventoryType.Machine, Analyser.SLOT_FINISHED);
new ControlPlayerInventory(this).create(actions);
MessageCraftGUI.sendToServer(actions);
}
@@ -97,7 +97,7 @@ public class WindowGeneBank extends WindowMachine {
int boxX;
int x = 16;
int y = 32;
new ControlPlayerInventory(this, x, y);
new ControlPlayerInventory(this, x, y).createAndRegister();
x += 124;
boxX = x;
int geneBoxWidth = 200;
@@ -51,7 +51,7 @@ public class WindowGenepool extends WindowMachine {
new ControlLiquidTank(this, x, y).setTankID(Genepool.TANK_ETHANOL);
x += 26;
new ControlSlotArray(this, x, y + 3, 2, 3).create(Genepool.SLOT_RESERVE);
new ControlSlotArray(this, x, y + 3, 2, 3).create(actions, InventoryType.Machine, Genepool.SLOT_RESERVE);
x += 38;
new ControlIconDisplay(this, x, y + 22, GUIIcon.ArrowRight.getIcon());
@@ -68,7 +68,7 @@ public class WindowGenepool extends WindowMachine {
new ControlSlot(this, 121.0f, 82.0f).assign(actions, InventoryType.Machine, Genepool.SLOT_ENZYME);
new ControlSlotCharge(this, 143, 82, 7).setColor(0xefe8af);
new ControlErrorState(this, 181.0f, 83.0f);
new ControlPlayerInventory(this);
new ControlPlayerInventory(this).create(actions);
MessageCraftGUI.sendToServer(actions);
}
@@ -2,6 +2,7 @@ package binnie.genetics.craftgui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.nbt.NBTTagList;
import binnie.core.AbstractMod;
import binnie.core.craftgui.geometry.Position;
@@ -18,6 +19,7 @@ import binnie.core.craftgui.minecraft.control.ControlSlot;
import binnie.core.craftgui.minecraft.control.ControlSlotArray;
import binnie.core.craftgui.resource.Texture;
import binnie.core.craftgui.resource.minecraft.StandardTexture;
import binnie.core.network.packet.MessageCraftGUI;
import binnie.core.util.I18N;
import binnie.genetics.Genetics;
import binnie.genetics.core.GeneticsTexture;
@@ -40,11 +42,14 @@ public class WindowIncubator extends WindowMachine {
@Override
public void initialiseClient() {
super.initialiseClient();
final NBTTagList actions = new NBTTagList();
int x = 16;
int y = 32;
new ControlLiquidTank(this, x, y).setTankID(Incubator.TANK_INPUT);
x += 26;
new ControlSlotArray(this, x, y + 3, 1, 3).create(Incubator.SLOT_QUEUE);
new ControlSlotArray(this, x, y + 3, 1, 3).create(actions, InventoryType.Machine, Incubator.SLOT_QUEUE);
x += 20;
new ControlIconDisplay(this, x, y + 3 + 10, GUIIcon.ArrowRight.getIcon());
x += 18;
@@ -55,17 +60,19 @@ public class WindowIncubator extends WindowMachine {
WindowIncubator.progressBase,
WindowIncubator.progress,
Position.LEFT);
new ControlSlot(this, x + 10, y + 3 + 10).assignAndRegister(InventoryType.Machine, Incubator.SLOT_INCUBATOR);
new ControlSlot(this, x + 10, y + 3 + 10).assign(actions, InventoryType.Machine, Incubator.SLOT_INCUBATOR);
x += 40;
new ControlIconDisplay(this, x, y + 3 + 10, GUIIcon.ArrowRight.getIcon());
x += 18;
new ControlSlotArray(this, x, y + 3, 1, 3).create(Incubator.SLOT_OUTPUT);
new ControlSlotArray(this, x, y + 3, 1, 3).create(actions, InventoryType.Machine, Incubator.SLOT_OUTPUT);
x += 26;
new ControlLiquidTank(this, x, y).setTankID(Incubator.TANK_OUTPUT);
x += 34;
new ControlEnergyBar(this, x, y + 3, 16, 54, Position.BOTTOM);
new ControlErrorState(this, 91.0f, 82.0f);
new ControlPlayerInventory(this);
new ControlPlayerInventory(this).create(actions);
MessageCraftGUI.sendToServer(actions);
}
@Override
@@ -53,11 +53,13 @@ public class WindowInoculator extends WindowMachine {
CraftGUIUtil.horizontalGrid(
x,
y,
new ControlSlotArray(this, 0, 0, 2, 1).create(Inoculator.SLOT_SERUM_RESERVE),
new ControlSlotArray(this, 0, 0, 2, 1)
.create(actions, InventoryType.Machine, Inoculator.SLOT_SERUM_RESERVE),
new ControlIconDisplay(this, 0.0f, 0.0f, GUIIcon.ArrowRight.getIcon()),
new ControlSlot(this, 0.0f, 0.0f).assign(actions, InventoryType.Machine, 0),
new ControlIconDisplay(this, 0.0f, 0.0f, GUIIcon.ArrowRight.getIcon()),
new ControlSlotArray(this, 0, 0, 2, 1).create(Inoculator.SLOT_SERUM_EXPENDED));
new ControlSlotArray(this, 0, 0, 2, 1)
.create(actions, InventoryType.Machine, Inoculator.SLOT_SERUM_EXPENDED));
x += 18;
new ControlMachineProgress(
this,
@@ -74,12 +76,13 @@ public class WindowInoculator extends WindowMachine {
y,
TextJustification.MIDDLE_LEFT,
8.0f,
new ControlSlotArray(this, x, y, 4, 1).create(Inoculator.SLOT_RESERVE),
new ControlSlotArray(this, x, y, 4, 1).create(actions, InventoryType.Machine, Inoculator.SLOT_RESERVE),
new ControlSlot(this, x, y + 18 + 8).assign(actions, InventoryType.Machine, 9),
new ControlSlotArray(this, x, y + 18 + 8 + 18 + 8, 4, 1).create(Inoculator.SLOT_FINISHED));
new ControlSlotArray(this, x, y + 18 + 8 + 18 + 8, 4, 1)
.create(actions, InventoryType.Machine, Inoculator.SLOT_FINISHED));
new ControlIconDisplay(this, x + 18, y + 18 + 2, GUIIcon.ArrowUpLeft.getIcon());
new ControlIconDisplay(this, x + 18, y + 18 + 18, GUIIcon.ArrowLeftDown.getIcon());
new ControlPlayerInventory(this);
new ControlPlayerInventory(this).create(actions);
MessageCraftGUI.sendToServer(actions);
}
@@ -50,7 +50,7 @@ public class WindowIsolator extends WindowMachine {
int y = 32;
new ControlLiquidTank(this, x, y).setTankID(Isolator.TANK_ETHANOL);
x += 26;
new ControlSlotArray(this, x, y + 3, 1, 3).create(Isolator.SLOT_RESERVE);
new ControlSlotArray(this, x, y + 3, 1, 3).create(actions, InventoryType.Machine, Isolator.SLOT_RESERVE);
x += 20;
new ControlIconDisplay(this, x, y + 3 + 1, GUIIcon.ArrowRight.getIcon());
x += 18;
@@ -66,10 +66,10 @@ public class WindowIsolator extends WindowMachine {
x += 20;
new ControlIconDisplay(this, x, y + 3 + 1, GUIIcon.ArrowRight.getIcon());
x += 18;
new ControlSlotArray(this, x, y + 3, 2, 3).create(Isolator.SLOT_FINISHED);
new ControlSlotArray(this, x, y + 3, 2, 3).create(actions, InventoryType.Machine, Isolator.SLOT_FINISHED);
new ControlEnergyBar(this, 260, 130, 16, 60, Position.BOTTOM);
new ControlErrorState(this, 153.0f, 81.0f);
new ControlPlayerInventory(this);
new ControlPlayerInventory(this).create(actions);
MessageCraftGUI.sendToServer(actions);
}
@@ -53,7 +53,7 @@ public class WindowPolymeriser extends WindowMachine {
int x = 16;
int y = 38;
new ControlSlotArray(this, x, y, 1, 4).create(Polymeriser.SLOT_SERUM_RESERVE);
new ControlSlotArray(this, x, y, 1, 4).create(actions, InventoryType.Machine, Polymeriser.SLOT_SERUM_RESERVE);
new ControlIconDisplay(this, x + 18, y + 1, GUIIcon.ArrowRight.getIcon());
x += 34;
new ControlMachineProgress(this, x + 18, y - 6, progressBase, progress, Position.LEFT);
@@ -65,9 +65,10 @@ public class WindowPolymeriser extends WindowMachine {
new ControlSlot(this, x + 30, y + 18 + 8).assign(actions, InventoryType.Machine, Polymeriser.SLOT_GOLD);
new ControlSlotCharge(this, x + 30 + 20, y + 18 + 8, 1).setColor(0xffd800);
x += 138;
new ControlSlotArray(this, x, y + 9, 2, 2).create(Polymeriser.SLOT_SERUM_FINISHED);
new ControlSlotArray(this, x, y + 9, 2, 2)
.create(actions, InventoryType.Machine, Polymeriser.SLOT_SERUM_FINISHED);
new ControlErrorState(this, 244.0f, 97.0f);
new ControlPlayerInventory(this);
new ControlPlayerInventory(this).create(actions);
MessageCraftGUI.sendToServer(actions);
}
@@ -74,7 +74,7 @@ public class WindowSequencer extends WindowMachine {
y,
TextJustification.MIDDLE_CENTER,
2.0f,
new ControlSlotArray(this, 0, 0, 2, 2).create(Sequencer.SLOT_RESERVE),
new ControlSlotArray(this, 0, 0, 2, 2).create(actions, InventoryType.Machine, Sequencer.SLOT_RESERVE),
new ControlIconDisplay(this, 0.0f, 0.0f, GUIIcon.ArrowRight.getIcon()),
new ControlSequencerProgress(this, 0, 0),
new ControlIconDisplay(this, 0.0f, 0.0f, GUIIcon.ArrowRight.getIcon()),
@@ -97,7 +97,7 @@ public class WindowSequencer extends WindowMachine {
new ControlEnergyBar(this, x, y, 60, 16, Position.LEFT);
x += 92;
new ControlErrorState(this, x, y + 1);
new ControlPlayerInventory(this);
new ControlPlayerInventory(this).create(actions);
MessageCraftGUI.sendToServer(actions);
}
@@ -56,10 +56,12 @@ public class WindowSplicer extends WindowMachine {
CraftGUIUtil.horizontalGrid(
x,
62.0f,
new ControlSlotArray(this, 0, 0, 2, 1).create(Splicer.SLOT_SERUM_RESERVE),
new ControlSlotArray(this, 0, 0, 2, 1)
.create(actions, InventoryType.Machine, Splicer.SLOT_SERUM_RESERVE),
new ControlIconDisplay(this, 0.0f, 0.0f, GUIIcon.ArrowRight.getIcon()),
new ControlSlot(this, 0.0f, 0.0f).assign(actions, InventoryType.Machine, Splicer.SLOT_SERUM_VIAL));
new ControlSlotArray(this, x + 12, 84, 2, 1).create(Splicer.SLOT_SERUM_EXPENDED);
new ControlSlotArray(this, x + 12, 84, 2, 1)
.create(actions, InventoryType.Machine, Splicer.SLOT_SERUM_EXPENDED);
new ControlIconDisplay(this, x + 12 + 36 + 4, 86.0f, GUIIcon.ArrowUpLeft.getIcon());
new ControlEnergyBar(this, 196, 64, 60, 16, Position.LEFT);
new ControlErrorState(this, 218.0f, 86.0f);
@@ -68,12 +70,13 @@ public class WindowSplicer extends WindowMachine {
32.0f,
TextJustification.MIDDLE_CENTER,
4.0f,
new ControlSlotArray(this, 0, 0, 4, 1).create(Inoculator.SLOT_RESERVE),
new ControlSlotArray(this, 0, 0, 4, 1).create(actions, InventoryType.Machine, Inoculator.SLOT_RESERVE),
new ControlIconDisplay(this, 0.0f, 0.0f, GUIIcon.ArrowDown.getIcon()),
new ControlSlot(this, 0.0f, 0.0f).assign(actions, InventoryType.Machine, Splicer.SLOT_TARGET),
new ControlIconDisplay(this, 0.0f, 0.0f, GUIIcon.ArrowDown.getIcon()),
new ControlSlotArray(this, 0, 0, 4, 1).create(Inoculator.SLOT_FINISHED));
new ControlPlayerInventory(this);
new ControlSlotArray(this, 0, 0, 4, 1)
.create(actions, InventoryType.Machine, Inoculator.SLOT_FINISHED));
new ControlPlayerInventory(this).create(actions);
MessageCraftGUI.sendToServer(actions);
}
@@ -279,7 +279,7 @@ public class WindowAnalyst extends Window {
244.0f,
80.0f,
Position.BOTTOM);
new ControlPlayerInventory(slideUpInv, true);
new ControlPlayerInventory(slideUpInv, true).createAndRegister();
slideUpInv.setSlide(false);
}
addEventHandler(new EventKey.Down.Handler() {
@@ -301,7 +301,7 @@ public class WindowAnalyst extends Window {
@Override
public void initialise() {
new ControlTextCentered(this, 20.0f, I18N.localise("genetics.gui.analyst.info")).setColor(0x444444);
new ControlPlayerInventory(this);
new ControlPlayerInventory(this).createAndRegister();
}
};
}