aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/github/technus/tectech/thing/gui/TecTechUITextures.java23
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java79
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java96
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Holder.java80
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Rack.java112
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Holder.java35
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Rack.java38
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_BuckConverter.java16
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java16
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java15
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java16
11 files changed, 189 insertions, 337 deletions
diff --git a/src/main/java/com/github/technus/tectech/thing/gui/TecTechUITextures.java b/src/main/java/com/github/technus/tectech/thing/gui/TecTechUITextures.java
new file mode 100644
index 0000000000..5f195bae64
--- /dev/null
+++ b/src/main/java/com/github/technus/tectech/thing/gui/TecTechUITextures.java
@@ -0,0 +1,23 @@
+package com.github.technus.tectech.thing.gui;
+
+import static com.github.technus.tectech.Reference.MODID;
+
+import com.gtnewhorizons.modularui.api.drawable.UITexture;
+
+public class TecTechUITextures {
+
+ public static final UITexture BUTTON_STANDARD_16x16 = UITexture.fullImage(MODID, "gui/button/standard_16x16");
+
+ public static final UITexture OVERLAY_BUTTON_POWER_SWITCH_OFF =
+ UITexture.fullImage(MODID, "gui/overlay_button/power_switch_off");
+ public static final UITexture OVERLAY_BUTTON_POWER_SWITCH_ON =
+ UITexture.fullImage(MODID, "gui/overlay_button/power_switch_on");
+ public static final UITexture OVERLAY_BUTTON_HEAT_OFF = UITexture.fullImage(MODID, "gui/overlay_button/heat_off");
+ public static final UITexture OVERLAY_BUTTON_HEAT_ON = UITexture.fullImage(MODID, "gui/overlay_button/heat_on");
+
+ public static final UITexture OVERLAY_SLOT_RACK = UITexture.fullImage(MODID, "gui/overlay_slot/rack");
+
+ public static final UITexture PICTURE_TECTECH_LOGO = UITexture.fullImage(MODID, "gui/picture/tectech_logo");
+ public static final UITexture PICTURE_RACK_LARGE = UITexture.fullImage(MODID, "gui/picture/rack_large");
+ public static final UITexture PICTURE_HEAT_SINK = UITexture.fullImage(MODID, "gui/picture/heat_sink");
+}
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java
index de173f2a16..9381f432f3 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Holder.java
@@ -2,28 +2,34 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch;
import static net.minecraft.util.StatCollector.translateToLocal;
-import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_Holder;
-import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_Holder;
+import com.github.technus.tectech.thing.gui.TecTechUITextures;
import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.util.TT_Utility;
+import com.gtnewhorizons.modularui.api.screen.ModularWindow;
+import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
+import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot;
+import com.gtnewhorizons.modularui.common.widget.DrawableWidget;
+import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget;
+import com.gtnewhorizons.modularui.common.widget.SlotWidget;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
+import gregtech.api.gui.modularui.GT_UIInfos;
import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.modularui.IAddGregtechLogo;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
import gregtech.api.objects.GT_RenderedTexture;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
/**
* Created by Tec on 03.04.2017.
*/
-public class GT_MetaTileEntity_Hatch_Holder extends GT_MetaTileEntity_Hatch {
+public class GT_MetaTileEntity_Hatch_Holder extends GT_MetaTileEntity_Hatch implements IAddGregtechLogo {
private static Textures.BlockIcons.CustomIcon EM_H;
private static Textures.BlockIcons.CustomIcon EM_H_ACTIVE;
@@ -90,19 +96,6 @@ public class GT_MetaTileEntity_Hatch_Holder extends GT_MetaTileEntity_Hatch {
}
@Override
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_Holder(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_Holder(
- aPlayerInventory,
- aBaseMetaTileEntity,
- translateToLocal("gt.blockmachines.hatch.holder.tier.09.name")); // Object Holder
- }
-
- @Override
public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
if (aBaseMetaTileEntity.isClientSide()) {
return true;
@@ -112,7 +105,7 @@ public class GT_MetaTileEntity_Hatch_Holder extends GT_MetaTileEntity_Hatch {
// else if(heat>0)
// aPlayer.addChatComponentMessage(new ChatComponentText("It is still warm..."));
// else
- aBaseMetaTileEntity.openGUI(aPlayer);
+ GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer);
return true;
}
@@ -130,4 +123,54 @@ public class GT_MetaTileEntity_Hatch_Holder extends GT_MetaTileEntity_Hatch {
+ translateToLocal("gt.blockmachines.hatch.holder.desc.1") // Advanced Holding Mechanism!
};
}
+
+ @Override
+ public boolean useModularUI() {
+ return true;
+ }
+
+ @Override
+ public void addGregTechLogo(ModularWindow.Builder builder) {
+ builder.widget(new DrawableWidget()
+ .setDrawable(TecTechUITextures.PICTURE_TECTECH_LOGO)
+ .setSize(18, 18)
+ .setPos(151, 63));
+ }
+
+ @Override
+ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
+ builder.widget(new DrawableWidget()
+ .setDrawable(TecTechUITextures.PICTURE_HEAT_SINK)
+ .setPos(46, 17)
+ .setSize(84, 60))
+ .widget(new DrawableWidget()
+ .setDrawable(TecTechUITextures.PICTURE_RACK_LARGE)
+ .setPos(68, 27)
+ .setSize(40, 40))
+ .widget(new SlotWidget(new BaseSlot(inventoryHandler, 0) {
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
+
+ @Override
+ public boolean isEnabled() {
+ return !getBaseMetaTileEntity().isActive();
+ }
+ })
+ .setPos(79, 38))
+ .widget(new DrawableWidget()
+ .setDrawable(TecTechUITextures.BUTTON_STANDARD_16x16)
+ .setPos(152, 24)
+ .setSize(16, 16))
+ .widget(new DrawableWidget()
+ .setDrawable(() -> getBaseMetaTileEntity().isActive()
+ ? TecTechUITextures.OVERLAY_BUTTON_POWER_SWITCH_ON
+ : TecTechUITextures.OVERLAY_BUTTON_POWER_SWITCH_OFF)
+ .setPos(152, 24)
+ .setSize(16, 16))
+ .widget(new FakeSyncWidget.BooleanSyncer(
+ () -> getBaseMetaTileEntity().isActive(),
+ val -> getBaseMetaTileEntity().setActive(val)));
+ }
}
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java
index 5e3986ec41..cede4a33b1 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java
@@ -8,16 +8,25 @@ import static net.minecraft.util.StatCollector.translateToLocalFormatted;
import com.github.technus.tectech.Reference;
import com.github.technus.tectech.TecTech;
-import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_Container_Rack;
-import com.github.technus.tectech.thing.metaTileEntity.hatch.gui.GT_GUIContainer_Rack;
+import com.github.technus.tectech.thing.gui.TecTechUITextures;
import com.github.technus.tectech.util.CommonValues;
import com.github.technus.tectech.util.TT_Utility;
+import com.gtnewhorizons.modularui.api.math.Pos2d;
+import com.gtnewhorizons.modularui.api.screen.ModularWindow;
+import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
+import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot;
+import com.gtnewhorizons.modularui.common.widget.DrawableWidget;
+import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget;
+import com.gtnewhorizons.modularui.common.widget.SlotWidget;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Textures;
+import gregtech.api.gui.modularui.GT_UIInfos;
import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.modularui.IAddGregtechLogo;
+import gregtech.api.interfaces.modularui.IAddUIWidgets;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
@@ -27,7 +36,6 @@ import java.util.Map;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
@@ -36,7 +44,7 @@ import org.apache.commons.lang3.reflect.FieldUtils;
/**
* Created by Tec on 03.04.2017.
*/
-public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch {
+public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch implements IAddGregtechLogo, IAddUIWidgets {
private static Textures.BlockIcons.CustomIcon EM_R;
private static Textures.BlockIcons.CustomIcon EM_R_ACTIVE;
public int heat = 0;
@@ -130,19 +138,6 @@ public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch {
}
@Override
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_Rack(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_Rack(
- aPlayerInventory,
- aBaseMetaTileEntity,
- translateToLocal("gt.blockmachines.hatch.rack.tier.08.name")); // Computer Rack
- }
-
- @Override
public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
if (aBaseMetaTileEntity.isClientSide()) {
return true;
@@ -158,7 +153,7 @@ public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch {
// else if(heat>0)
// aPlayer.addChatComponentMessage(new ChatComponentText("It is still warm..."));
// else
- aBaseMetaTileEntity.openGUI(aPlayer);
+ GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer);
return true;
}
@@ -294,6 +289,71 @@ public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch {
// Heat==1-10? --> 1
}
+ @Override
+ public boolean useModularUI() {
+ return true;
+ }
+
+ @Override
+ public void addGregTechLogo(ModularWindow.Builder builder) {
+ builder.widget(new DrawableWidget()
+ .setDrawable(TecTechUITextures.PICTURE_TECTECH_LOGO)
+ .setSize(18, 18)
+ .setPos(151, 63));
+ }
+
+ @Override
+ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
+ builder.widget(new DrawableWidget()
+ .setDrawable(TecTechUITextures.PICTURE_HEAT_SINK)
+ .setPos(46, 17)
+ .setSize(84, 60));
+
+ Pos2d[] positions = new Pos2d[] {
+ new Pos2d(68, 27), new Pos2d(90, 27), new Pos2d(68, 49), new Pos2d(90, 49),
+ };
+ for (int i = 0; i < positions.length; i++) {
+ builder.widget(new SlotWidget(new BaseSlot(inventoryHandler, i) {
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
+
+ @Override
+ public boolean isEnabled() {
+ return !getBaseMetaTileEntity().isActive() && heat <= 0;
+ }
+ })
+ .setBackground(getGUITextureSet().getItemSlot(), TecTechUITextures.OVERLAY_SLOT_RACK)
+ .setPos(positions[i]));
+
+ builder.widget(new DrawableWidget()
+ .setDrawable(TecTechUITextures.BUTTON_STANDARD_16x16)
+ .setPos(152, 24)
+ .setSize(16, 16))
+ .widget(new DrawableWidget()
+ .setDrawable(() -> getBaseMetaTileEntity().isActive()
+ ? TecTechUITextures.OVERLAY_BUTTON_POWER_SWITCH_ON
+ : TecTechUITextures.OVERLAY_BUTTON_POWER_SWITCH_OFF)
+ .setPos(152, 24)
+ .setSize(16, 16))
+ .widget(new FakeSyncWidget.BooleanSyncer(
+ () -> getBaseMetaTileEntity().isActive(),
+ val -> getBaseMetaTileEntity().setActive(val)));
+ builder.widget(new DrawableWidget()
+ .setDrawable(TecTechUITextures.BUTTON_STANDARD_16x16)
+ .setPos(152, 41)
+ .setSize(16, 16))
+ .widget(new DrawableWidget()
+ .setDrawable(() -> heat > 0
+ ? TecTechUITextures.OVERLAY_BUTTON_HEAT_ON
+ : TecTechUITextures.OVERLAY_BUTTON_HEAT_OFF)
+ .setPos(152, 41)
+ .setSize(16, 16))
+ .widget(new FakeSyncWidget.IntegerSyncer(() -> heat, val -> heat = val));
+ }
+ }
+
public static void run() { // 20k heat cap max!
new RackComponent(ItemList.Circuit_Primitive.get(1), 1, 4, 0, 500, true); // Primitive Circuit
new RackComponent(ItemList.Circuit_Basic.get(1), 4, 8, 0, 1000, true); // Basic Circuit
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Holder.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Holder.java
deleted file mode 100644
index e8377ba7bb..0000000000
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Holder.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package com.github.technus.tectech.thing.metaTileEntity.hatch.gui;
-
-import gregtech.api.gui.GT_ContainerMetaTile_Machine;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-
-/**
- * Created by Tec on 09.04.2017.
- */
-public class GT_Container_Holder extends GT_ContainerMetaTile_Machine {
- public GT_Container_Holder(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
-
- @Override
- public void addSlots(InventoryPlayer aInventoryPlayer) {
- addSlotToContainer(new Slot(mTileEntity, 0, 80, 39));
- }
-
- @Override
- public int getSlotCount() {
- return 1;
- }
-
- @Override
- public int getShiftClickSlotCount() {
- return 1;
- }
-
- @Override
- public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
- if (mActive != 0) {
- return null;
- }
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
-
- @Override
- public ItemStack transferStackInSlot(EntityPlayer aPlayer, int aSlotIndex) {
- if (mActive != 0) {
- return null;
- }
- return super.transferStackInSlot(aPlayer, aSlotIndex);
- }
-
- @Override
- public boolean canDragIntoSlot(Slot par1Slot) {
- if (mActive != 0) {
- return false;
- }
- return super.canDragIntoSlot(par1Slot);
- }
-
- @Override
- public void putStacksInSlots(ItemStack[] par1ArrayOfItemStack) {
- if (mActive != 0) {
- return;
- }
- super.putStacksInSlots(par1ArrayOfItemStack);
- }
-
- @Override
- protected boolean mergeItemStack(ItemStack aStack, int aStartIndex, int aSlotCount, boolean par4) {
- if (mActive != 0) {
- return false;
- }
- return super.mergeItemStack(aStack, aStartIndex, aSlotCount, par4);
- }
-
- @Override
- public void putStackInSlot(int par1, ItemStack par2ItemStack) {
- if (mActive != 0) {
- return;
- }
- super.putStackInSlot(par1, par2ItemStack);
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Rack.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Rack.java
deleted file mode 100644
index 16b38e254f..0000000000
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Rack.java
+++ /dev/null
@@ -1,112 +0,0 @@
-package com.github.technus.tectech.thing.metaTileEntity.hatch.gui;
-
-import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Rack;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.gui.GT_ContainerMetaTile_Machine;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.ICrafting;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-
-/**
- * Created by Tec on 09.04.2017.
- */
-public class GT_Container_Rack extends GT_ContainerMetaTile_Machine {
- public boolean heat = false;
-
- public GT_Container_Rack(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
-
- @Override
- public void addSlots(InventoryPlayer aInventoryPlayer) {
- addSlotToContainer(new Slot(mTileEntity, 0, 69, 28));
- addSlotToContainer(new Slot(mTileEntity, 1, 91, 28));
- addSlotToContainer(new Slot(mTileEntity, 2, 69, 50));
- addSlotToContainer(new Slot(mTileEntity, 3, 91, 50));
- }
-
- @Override
- public int getSlotCount() {
- return 4;
- }
-
- @Override
- public int getShiftClickSlotCount() {
- return 4;
- }
-
- @Override
- public void detectAndSendChanges() {
- super.detectAndSendChanges();
- if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) {
- return;
- }
- heat = ((GT_MetaTileEntity_Hatch_Rack) mTileEntity.getMetaTileEntity()).heat > 0;
-
- for (Object crafter : crafters) {
- ICrafting var1 = (ICrafting) crafter;
- var1.sendProgressBarUpdate(this, 100, heat ? 1 : 0);
- }
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void updateProgressBar(int par1, int par2) {
- super.updateProgressBar(par1, par2);
- if (par1 == 100) {
- heat = par2 != 0;
- }
- }
-
- @Override
- public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
- if (heat || mActive != 0) {
- return null;
- }
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
-
- @Override
- public ItemStack transferStackInSlot(EntityPlayer aPlayer, int aSlotIndex) {
- if (heat || mActive != 0) {
- return null;
- }
- return super.transferStackInSlot(aPlayer, aSlotIndex);
- }
-
- @Override
- public boolean canDragIntoSlot(Slot par1Slot) {
- if (heat || mActive != 0) {
- return false;
- }
- return super.canDragIntoSlot(par1Slot);
- }
-
- @Override
- public void putStacksInSlots(ItemStack[] par1ArrayOfItemStack) {
- if (heat || mActive != 0) {
- return;
- }
- super.putStacksInSlots(par1ArrayOfItemStack);
- }
-
- @Override
- protected boolean mergeItemStack(ItemStack aStack, int aStartIndex, int aSlotCount, boolean par4) {
- if (heat || mActive != 0) {
- return false;
- }
- return super.mergeItemStack(aStack, aStartIndex, aSlotCount, par4);
- }
-
- @Override
- public void putStackInSlot(int par1, ItemStack par2ItemStack) {
- if (heat || mActive != 0) {
- return;
- }
- super.putStackInSlot(par1, par2ItemStack);
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Holder.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Holder.java
deleted file mode 100644
index 7019a6128e..0000000000
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Holder.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.github.technus.tectech.thing.metaTileEntity.hatch.gui;
-
-import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.entity.player.InventoryPlayer;
-
-/**
- * Created by Tec on 09.04.2017.
- */
-public class GT_GUIContainer_Holder extends GT_GUIContainerMetaTile_Machine {
- private final String mName;
-
- public GT_GUIContainer_Holder(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) {
- super(new GT_Container_Holder(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/holder.png");
- mName = aName;
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- fontRendererObj.drawString(mName, 8, 4, 4210752);
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
- super.drawGuiContainerBackgroundLayer(par1, par2, par3);
- int x = (width - xSize) / 2;
- int y = (height - ySize) / 2;
- drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
- if (mContainer != null) {
- if (((GT_Container_Holder) mContainer).mActive == 1) {
- drawTexturedModalRect(x + 151, y + 23, 183, 23, 18, 18);
- }
- }
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Rack.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Rack.java
deleted file mode 100644
index 396a690a8f..0000000000
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_GUIContainer_Rack.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.github.technus.tectech.thing.metaTileEntity.hatch.gui;
-
-import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.entity.player.InventoryPlayer;
-
-/**
- * Created by Tec on 09.04.2017.
- */
-public class GT_GUIContainer_Rack extends GT_GUIContainerMetaTile_Machine {
- private final String mName;
-
- public GT_GUIContainer_Rack(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) {
- super(new GT_Container_Rack(aInventoryPlayer, aTileEntity), "gregtech:textures/gui/rack.png");
- mName = aName;
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(int par1, int par2) {
- fontRendererObj.drawString(mName, 8, 4, 4210752);
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
- super.drawGuiContainerBackgroundLayer(par1, par2, par3);
- int x = (width - xSize) / 2;
- int y = (height - ySize) / 2;
- drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
- if (mContainer != null) {
- if (((GT_Container_Rack) mContainer).mActive == 1) {
- drawTexturedModalRect(x + 151, y + 23, 183, 23, 18, 18);
- }
- if (((GT_Container_Rack) mContainer).heat) {
- drawTexturedModalRect(x + 151, y + 41, 183, 41, 18, 18);
- }
- }
- }
-}
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_BuckConverter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_BuckConverter.java
index e03edcd77c..63c5e142e0 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_BuckConverter.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_BuckConverter.java
@@ -18,6 +18,8 @@ import gregtech.api.enums.Textures;
import gregtech.api.gui.modularui.GT_UIInfos;
import gregtech.api.gui.modularui.GT_UITextures;
import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.modularui.IAddGregtechLogo;
+import gregtech.api.interfaces.modularui.IAddUIWidgets;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
@@ -30,7 +32,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
-public class GT_MetaTileEntity_BuckConverter extends GT_MetaTileEntity_TieredMachineBlock {
+public class GT_MetaTileEntity_BuckConverter extends GT_MetaTileEntity_TieredMachineBlock
+ implements IAddUIWidgets, IAddGregtechLogo {
private static GT_RenderedTexture BUCK, BUCK_ACTIVE;
public int EUT = 0, AMP = 0;
@@ -209,20 +212,15 @@ public class GT_MetaTileEntity_BuckConverter extends GT_MetaTileEntity_TieredMac
}
@Override
- protected void addGregTechLogo(ModularWindow.Builder builder) {
+ public void addGregTechLogo(ModularWindow.Builder builder) {
builder.widget(new DrawableWidget()
- .setDrawable(getGregTechLogo())
+ .setDrawable(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_GRAY)
.setSize(17, 17)
.setPos(113, 56));
}
@Override
- protected IDrawable getGregTechLogo() {
- return GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_GRAY;
- }
-
- @Override
- protected void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
+ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
builder.widget(new DrawableWidget()
.setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK)
.setSize(90, 72)
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java
index 3af07f7590..6a48095d55 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPollutor.java
@@ -19,6 +19,8 @@ import gregtech.api.enums.Textures;
import gregtech.api.gui.modularui.GT_UIInfos;
import gregtech.api.gui.modularui.GT_UITextures;
import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.modularui.IAddGregtechLogo;
+import gregtech.api.interfaces.modularui.IAddUIWidgets;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
@@ -34,7 +36,8 @@ import net.minecraft.util.EnumChatFormatting;
/**
* Created by Tec on 23.03.2017.
*/
-public class GT_MetaTileEntity_DebugPollutor extends GT_MetaTileEntity_TieredMachineBlock {
+public class GT_MetaTileEntity_DebugPollutor extends GT_MetaTileEntity_TieredMachineBlock
+ implements IAddUIWidgets, IAddGregtechLogo {
private static GT_RenderedTexture POLLUTOR;
public int pollution = 0;
public float anomaly = 0;
@@ -171,20 +174,15 @@ public class GT_MetaTileEntity_DebugPollutor extends GT_MetaTileEntity_TieredMac
}
@Override
- protected void addGregTechLogo(ModularWindow.Builder builder) {
+ public void addGregTechLogo(ModularWindow.Builder builder) {
builder.widget(new DrawableWidget()
- .setDrawable(getGregTechLogo())
+ .setDrawable(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_GRAY)
.setSize(17, 17)
.setPos(113, 56));
}
@Override
- protected IDrawable getGregTechLogo() {
- return GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_GRAY;
- }
-
- @Override
- protected void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
+ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
builder.widget(new DrawableWidget()
.setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK)
.setSize(90, 72)
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java
index cf21617ca8..dc5398a254 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugPowerGenerator.java
@@ -23,6 +23,8 @@ import gregtech.api.gui.modularui.GT_UIInfos;
import gregtech.api.gui.modularui.GT_UITextures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.modularui.IAddGregtechLogo;
+import gregtech.api.interfaces.modularui.IAddUIWidgets;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
@@ -40,7 +42,7 @@ import net.minecraft.util.StatCollector;
* Created by Tec on 23.03.2017.
*/
public class GT_MetaTileEntity_DebugPowerGenerator extends GT_MetaTileEntity_TieredMachineBlock
- implements IConnectsToEnergyTunnel {
+ implements IConnectsToEnergyTunnel, IAddUIWidgets, IAddGregtechLogo {
private static GT_RenderedTexture GENNY;
private boolean LASER = false;
public int EUT = 0, AMP = 0;
@@ -299,20 +301,15 @@ public class GT_MetaTileEntity_DebugPowerGenerator extends GT_MetaTileEntity_Tie
}
@Override
- protected void addGregTechLogo(ModularWindow.Builder builder) {
+ public void addGregTechLogo(ModularWindow.Builder builder) {
builder.widget(new DrawableWidget()
- .setDrawable(getGregTechLogo())
+ .setDrawable(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_GRAY)
.setSize(17, 17)
.setPos(113, 56));
}
@Override
- protected IDrawable getGregTechLogo() {
- return GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_GRAY;
- }
-
- @Override
- protected void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
+ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
builder.widget(new DrawableWidget()
.setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK)
.setSize(90, 72)
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java
index a536e39b12..f7b4db02fd 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/single/GT_MetaTileEntity_DebugStructureWriter.java
@@ -20,6 +20,8 @@ import gregtech.api.enums.Textures;
import gregtech.api.gui.modularui.GT_UIInfos;
import gregtech.api.gui.modularui.GT_UITextures;
import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.modularui.IAddGregtechLogo;
+import gregtech.api.interfaces.modularui.IAddUIWidgets;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
@@ -35,7 +37,8 @@ import net.minecraftforge.common.util.ForgeDirection;
/**
* Created by Tec on 23.03.2017.
*/
-public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_TieredMachineBlock {
+public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_TieredMachineBlock
+ implements IAddUIWidgets, IAddGregtechLogo {
private static GT_RenderedTexture MARK;
public short[] numbers = new short[6];
public boolean size = false;
@@ -226,20 +229,15 @@ public class GT_MetaTileEntity_DebugStructureWriter extends GT_MetaTileEntity_Ti
}
@Override
- protected void addGregTechLogo(ModularWindow.Builder builder) {
+ public void addGregTechLogo(ModularWindow.Builder builder) {
builder.widget(new DrawableWidget()
- .setDrawable(getGregTechLogo())
+ .setDrawable(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_GRAY)
.setSize(17, 17)
.setPos(113, 56));
}
@Override
- protected IDrawable getGregTechLogo() {
- return GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT_GRAY;
- }
-
- @Override
- protected void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
+ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
builder.widget(new DrawableWidget()
.setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK)
.setSize(90, 72)