aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/api
diff options
context:
space:
mode:
authorAlkalus <Draknyte1@hotmail.com>2020-05-29 21:23:28 +0100
committerAlkalus <Draknyte1@hotmail.com>2020-05-29 21:23:28 +0100
commit132faf38b856454007e97f4a8837133f496c64e3 (patch)
tree73b809f84a4b0cbec00459027f93aa51a28057a0 /src/Java/gtPlusPlus/xmod/gregtech/api
parent85f9a37942da9156436c23beae947a402544bcc9 (diff)
downloadGT5-Unofficial-132faf38b856454007e97f4a8837133f496c64e3.tar.gz
GT5-Unofficial-132faf38b856454007e97f4a8837133f496c64e3.tar.bz2
GT5-Unofficial-132faf38b856454007e97f4a8837133f496c64e3.zip
+ Added low tier basic turbines for Pollution Scrubbers.
+ Added capability for Scrubbers to be automated.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/basic/CONTAINER_PollutionCleaner.java207
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/basic/GUI_PollutionCleaner.java16
2 files changed, 81 insertions, 142 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/basic/CONTAINER_PollutionCleaner.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/basic/CONTAINER_PollutionCleaner.java
index e3365935aa..79d1033bd0 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/basic/CONTAINER_PollutionCleaner.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/basic/CONTAINER_PollutionCleaner.java
@@ -14,6 +14,8 @@ import net.minecraft.item.ItemStack;
import gregtech.api.gui.*;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.slots.SlotPollutionScrubber;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaAtmosphericReconditioner;
/**
@@ -23,132 +25,81 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaA
*/
public class CONTAINER_PollutionCleaner extends GT_Container_BasicTank {
- public boolean mFluidTransfer = false, mItemTransfer = false, mStuttering = false;
- public int mReduction = 0;
-
- public CONTAINER_PollutionCleaner(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
-
- @Override
- public void addSlots(InventoryPlayer aInventoryPlayer) {
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 8, 63, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 26, 63, false, true, 1));
- addSlotToContainer(new GT_Slot_Render(mTileEntity, 2, 107, 63));
-
- int tStartIndex = ((GT_MetaTileEntity_BasicMachine) mTileEntity.getMetaTileEntity()).getInputSlot();
-
- switch (((GT_MetaTileEntity_BasicMachine) mTileEntity.getMetaTileEntity()).mInputSlotCount) {
- case 2: //Pollution Scrubber
- //Add 2 Item Slots
- addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 53, 25));
- addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 107, 25));
- break;
- default:
- addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 17, 7));
- addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 35, 7));
- addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 53, 7));
- addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 17, 25));
- addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 35, 25));
- addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 53, 25));
- addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 17, 43));
- addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 35, 43));
- addSlotToContainer(new Slot(mTileEntity, tStartIndex++, 53, 43));
- break;
- }
-
- tStartIndex = ((GT_MetaTileEntity_BasicMachine) mTileEntity.getMetaTileEntity()).getOutputSlot();
-
- switch (((GT_MetaTileEntity_BasicMachine) mTileEntity.getMetaTileEntity()).mOutputItems.length) {
- case 0:
- break;
- default:
- break;
- }
-
- addSlotToContainer(new Slot(mTileEntity, 1, 80, 63));
- addSlotToContainer(new Slot(mTileEntity, 3, 125, 63));
- //addSlotToContainer(new GT_Slot_Render(mTileEntity, tStartIndex++, 53, 63));
- }
-
- @Override
- public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
- switch (aSlotIndex) {
- case 0:
- if (mTileEntity.getMetaTileEntity() == null) return null;
- ((GT_MetaTileEntity_BasicMachine) mTileEntity.getMetaTileEntity()).mFluidTransfer = !((GT_MetaTileEntity_BasicMachine) mTileEntity.getMetaTileEntity()).mFluidTransfer;
- return null;
- case 1:
- if (mTileEntity.getMetaTileEntity() == null) return null;
- ((GT_MetaTileEntity_BasicMachine) mTileEntity.getMetaTileEntity()).mItemTransfer = !((GT_MetaTileEntity_BasicMachine) mTileEntity.getMetaTileEntity()).mItemTransfer;
- return null;
- default:
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
- }
-
- @Override
- public void detectAndSendChanges() {
- super.detectAndSendChanges();
- if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) return;
-
- mFluidTransfer = ((GT_MetaTileEntity_BasicMachine) mTileEntity.getMetaTileEntity()).mFluidTransfer;
- mItemTransfer = ((GT_MetaTileEntity_BasicMachine) mTileEntity.getMetaTileEntity()).mItemTransfer;
- mStuttering = ((GT_MetaTileEntity_BasicMachine) mTileEntity.getMetaTileEntity()).mStuttering;
- mReduction = ((GregtechMetaAtmosphericReconditioner) mTileEntity.getMetaTileEntity()).mPollutionReduction;
-
- Iterator var2 = this.crafters.iterator();
- while (var2.hasNext()) {
- ICrafting var1 = (ICrafting) var2.next();
- var1.sendProgressBarUpdate(this, 102, mFluidTransfer ? 1 : 0);
- var1.sendProgressBarUpdate(this, 103, mItemTransfer ? 1 : 0);
- var1.sendProgressBarUpdate(this, 104, mStuttering ? 1 : 0);
- var1.sendProgressBarUpdate(this, 105, mReduction);
- }
- }
-
- @Override
- public void addCraftingToCrafters(ICrafting par1ICrafting) {
- super.addCraftingToCrafters(par1ICrafting);
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void updateProgressBar(int par1, int par2) {
- super.updateProgressBar(par1, par2);
- switch (par1) {
- case 102:
- mFluidTransfer = (par2 != 0);
- break;
- case 103:
- mItemTransfer = (par2 != 0);
- break;
- case 104:
- mStuttering = (par2 != 0);
- break;
- case 105:
- mReduction = (par2);
- break;
- }
- }
-
- @Override
- public int getSlotStartIndex() {
- return 3;
- }
-
- @Override
- public int getShiftClickStartIndex() {
- return 3;
- }
-
- @Override
- public int getSlotCount() {
- return getShiftClickSlotCount() + ((GT_MetaTileEntity_BasicMachine) mTileEntity.getMetaTileEntity()).mOutputItems.length + 2;
- }
-
- @Override
- public int getShiftClickSlotCount() {
- return ((GT_MetaTileEntity_BasicMachine) mTileEntity.getMetaTileEntity()).mInputSlotCount;
- }
+ public boolean mFluidTransfer = false, mItemTransfer = false, mStuttering = false;
+ public int mReduction = 0;
+
+ public CONTAINER_PollutionCleaner(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ @Override
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+
+ int tStartIndex = ((GT_MetaTileEntity_BasicMachine) mTileEntity.getMetaTileEntity()).getInputSlot();
+ int aTier = ((GT_MetaTileEntity_BasicMachine) mTileEntity.getMetaTileEntity()).mTier;
+
+
+ //Add 2 Item Slots
+ addSlotToContainer(new SlotPollutionScrubber(0, aTier, mTileEntity, tStartIndex++, 53, 25));
+ addSlotToContainer(new SlotPollutionScrubber(1, aTier, mTileEntity, tStartIndex++, 107, 25));
+ // Upgrade Slot
+ addSlotToContainer(new SlotPollutionScrubber(2, aTier, mTileEntity, tStartIndex++, 125, 63));
+
+ }
+
+ @Override
+ public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
+ Logger.INFO("Clicked on slot "+aSlotIndex);
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+
+ @Override
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) return;
+
+ mReduction = ((GregtechMetaAtmosphericReconditioner) mTileEntity.getMetaTileEntity()).mPollutionReduction;
+
+ Iterator var2 = this.crafters.iterator();
+ while (var2.hasNext()) {
+ ICrafting var1 = (ICrafting) var2.next();
+ var1.sendProgressBarUpdate(this, 105, mReduction);
+ }
+ }
+
+ @Override
+ public void addCraftingToCrafters(ICrafting par1ICrafting) {
+ super.addCraftingToCrafters(par1ICrafting);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void updateProgressBar(int par1, int par2) {
+ super.updateProgressBar(par1, par2);
+ switch (par1) {
+ case 105:
+ mReduction = (par2);
+ break;
+ }
+ }
+
+ @Override
+ public int getSlotStartIndex() {
+ return 0;
+ }
+
+ @Override
+ public int getShiftClickStartIndex() {
+ return 0;
+ }
+
+ @Override
+ public int getSlotCount() {
+ return getShiftClickSlotCount();
+ }
+
+ @Override
+ public int getShiftClickSlotCount() {
+ return 3;
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/basic/GUI_PollutionCleaner.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/basic/GUI_PollutionCleaner.java
index 2c1601cee2..7a9417eeb6 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/basic/GUI_PollutionCleaner.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/basic/GUI_PollutionCleaner.java
@@ -3,16 +3,10 @@ package gtPlusPlus.xmod.gregtech.api.gui.basic;
import java.util.ArrayList;
import java.util.List;
-import net.minecraft.entity.player.InventoryPlayer;
-
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_ControlCore;
-import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaAtmosphericReconditioner;
+import net.minecraft.entity.player.InventoryPlayer;
public class GUI_PollutionCleaner extends GT_GUIContainerMetaTile_Machine {
public final String mName;
@@ -48,13 +42,7 @@ public class GUI_PollutionCleaner extends GT_GUIContainerMetaTile_Machine {
final int x3 = x2 - xStart;
final int y3 = y2 - yStart + 5;
final List<String> list = new ArrayList<String>();
- if (y3 >= 67 && y3 <= 84) {
- if (x3 >= 7 && x3 <= 24) {
- list.add("Fluid Auto-Output");
- }
- if (x3 >= 25 && x3 <= 42) {
- list.add("Item Auto-Output");
- }
+ if (y3 >= 67 && y3 <= 84) {
if (x3 >= 77 && x3 <= 95) {
//Do Dumb shit
CONTAINER_PollutionCleaner aContainerCast = (CONTAINER_PollutionCleaner) this.mContainer;