aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/tileentities
diff options
context:
space:
mode:
authorShawn Buckley <shawntbuckley@gmail.com>2015-10-21 22:06:25 -0400
committerShawn Buckley <shawntbuckley@gmail.com>2015-10-21 22:06:25 -0400
commit9353aa711b1d750ff945acdfed2d3b956291b615 (patch)
treed6ca62ab093dede52afef0d82ac29d32c56fb29b /src/main/java/gregtech/common/tileentities
parent445e6c3f25714ecf15c07dcd3462375d65b6dc92 (diff)
downloadGT5-Unofficial-9353aa711b1d750ff945acdfed2d3b956291b615.tar.gz
GT5-Unofficial-9353aa711b1d750ff945acdfed2d3b956291b615.tar.bz2
GT5-Unofficial-9353aa711b1d750ff945acdfed2d3b956291b615.zip
Reformat code
Diffstat (limited to 'src/main/java/gregtech/common/tileentities')
-rw-r--r--src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java104
-rw-r--r--src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java123
-rw-r--r--src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java162
-rw-r--r--src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java56
-rw-r--r--src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java244
-rw-r--r--src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java532
-rw-r--r--src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java266
-rw-r--r--src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java237
-rw-r--r--src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java227
-rw-r--r--src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java275
-rw-r--r--src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java193
-rw-r--r--src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_FluidNaquadahReactor.java170
-rw-r--r--src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java174
-rw-r--r--src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java176
-rw-r--r--src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java487
-rw-r--r--src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java176
-rw-r--r--src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SolidNaquadahReactor.java170
-rw-r--r--src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java182
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java49
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java57
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java54
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java54
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java163
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Charger.java121
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java85
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java125
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java595
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MonsterRepellent.java185
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java242
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java82
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java752
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java172
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java110
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java358
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java168
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java761
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AdvMiner2.java494
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java665
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java406
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java330
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java398
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java832
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java100
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java99
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java99
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java557
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java275
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java407
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java126
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java128
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java128
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java130
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java355
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java126
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java120
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java130
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java142
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java306
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java448
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill.java396
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java581
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java310
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java267
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java171
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java171
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java170
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java170
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java170
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java170
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java171
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java171
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java170
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java170
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java208
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java207
-rw-r--r--src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_Locker.java323
-rw-r--r--src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumChest.java359
-rw-r--r--src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java243
78 files changed, 9355 insertions, 10131 deletions
diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java
index f8bf845ea8..b078f558f7 100644
--- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java
+++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java
@@ -1,7 +1,6 @@
package gregtech.common.tileentities.automation;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -13,63 +12,52 @@ import gregtech.common.gui.GT_GUIContainer_ChestBuffer;
import net.minecraft.entity.player.InventoryPlayer;
public class GT_MetaTileEntity_ChestBuffer
- extends GT_MetaTileEntity_Buffer
-{
- public GT_MetaTileEntity_ChestBuffer(int aID, String aName, String aNameRegional, int aTier)
- {
- super(aID, aName, aNameRegional, aTier, 28, "Buffering lots of incoming Items");
- }
-
- public GT_MetaTileEntity_ChestBuffer(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription)
- {
- super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription);
- }
-
- public GT_MetaTileEntity_ChestBuffer(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aTier, aInvSlotCount, aDescription, aTextures);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_ChestBuffer(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures);
- }
-
- public ITexture getOverlayIcon()
- {
- return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_CHESTBUFFER);
- }
-
- public boolean isValidSlot(int aIndex)
- {
- return aIndex < this.mInventory.length - 1;
- }
-
- protected void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer)
- {
- fillStacksIntoFirstSlots();
- super.moveItems(aBaseMetaTileEntity, aTimer);
- fillStacksIntoFirstSlots();
- }
-
- protected void fillStacksIntoFirstSlots()
- {
- for (int i = 0; i < this.mInventory.length - 1; i++) {
- for (int j = i + 1; j < this.mInventory.length - 1; j++) {
- if ((this.mInventory[j] != null) && ((this.mInventory[i] == null) || (GT_Utility.areStacksEqual(this.mInventory[i], this.mInventory[j])))) {
- GT_Utility.moveStackFromSlotAToSlotB(getBaseMetaTileEntity(), getBaseMetaTileEntity(), j, i, (byte)64, (byte)1, (byte)64, (byte)1);
+ extends GT_MetaTileEntity_Buffer {
+ public GT_MetaTileEntity_ChestBuffer(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 28, "Buffering lots of incoming Items");
+ }
+
+ public GT_MetaTileEntity_ChestBuffer(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription) {
+ super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription);
+ }
+
+ public GT_MetaTileEntity_ChestBuffer(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aInvSlotCount, aDescription, aTextures);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_ChestBuffer(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures);
+ }
+
+ public ITexture getOverlayIcon() {
+ return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_CHESTBUFFER);
+ }
+
+ public boolean isValidSlot(int aIndex) {
+ return aIndex < this.mInventory.length - 1;
+ }
+
+ protected void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
+ fillStacksIntoFirstSlots();
+ super.moveItems(aBaseMetaTileEntity, aTimer);
+ fillStacksIntoFirstSlots();
+ }
+
+ protected void fillStacksIntoFirstSlots() {
+ for (int i = 0; i < this.mInventory.length - 1; i++) {
+ for (int j = i + 1; j < this.mInventory.length - 1; j++) {
+ if ((this.mInventory[j] != null) && ((this.mInventory[i] == null) || (GT_Utility.areStacksEqual(this.mInventory[i], this.mInventory[j])))) {
+ GT_Utility.moveStackFromSlotAToSlotB(getBaseMetaTileEntity(), getBaseMetaTileEntity(), j, i, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
+ }
+ }
}
- }
}
- }
-
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_Container_ChestBuffer(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_ChestBuffer(aPlayerInventory, aBaseMetaTileEntity);
- }
+
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_ChestBuffer(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_ChestBuffer(aPlayerInventory, aBaseMetaTileEntity);
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java
index 09aac62b2e..4180484ad5 100644
--- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java
+++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java
@@ -1,7 +1,6 @@
package gregtech.common.tileentities.automation;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -15,74 +14,62 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
public class GT_MetaTileEntity_Filter
- extends GT_MetaTileEntity_Buffer
-{
- public boolean bIgnoreNBT = false;
- public boolean bInvertFilter = false;
-
- public GT_MetaTileEntity_Filter(int aID, String aName, String aNameRegional, int aTier)
- {
- super(aID, aName, aNameRegional, aTier, 19, "Filtering incoming Items");
- }
-
- public GT_MetaTileEntity_Filter(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aTier, aInvSlotCount, aDescription, aTextures);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_Filter(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures);
- }
-
- public ITexture getOverlayIcon()
- {
- return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_FILTER);
- }
-
- public boolean isValidSlot(int aIndex)
- {
- return aIndex < 9;
- }
-
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_Container_Filter(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_Filter(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- public void saveNBTData(NBTTagCompound aNBT)
- {
- super.saveNBTData(aNBT);
- aNBT.setBoolean("bInvertFilter", this.bInvertFilter);
- aNBT.setBoolean("bIgnoreNBT", this.bIgnoreNBT);
- }
-
- public void loadNBTData(NBTTagCompound aNBT)
- {
- super.loadNBTData(aNBT);
- this.bInvertFilter = aNBT.getBoolean("bInvertFilter");
- this.bIgnoreNBT = aNBT.getBoolean("bIgnoreNBT");
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
- {
- if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {
- return false;
+ extends GT_MetaTileEntity_Buffer {
+ public boolean bIgnoreNBT = false;
+ public boolean bInvertFilter = false;
+
+ public GT_MetaTileEntity_Filter(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 19, "Filtering incoming Items");
+ }
+
+ public GT_MetaTileEntity_Filter(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aInvSlotCount, aDescription, aTextures);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Filter(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures);
}
- if (this.bInvertFilter)
- {
- for (byte i = 9; i < 18; i = (byte)(i + 1)) {
- if (GT_Utility.areStacksEqual(this.mInventory[i], aStack, this.bIgnoreNBT)) {
- return false;
+
+ public ITexture getOverlayIcon() {
+ return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_FILTER);
+ }
+
+ public boolean isValidSlot(int aIndex) {
+ return aIndex < 9;
+ }
+
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_Filter(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_Filter(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setBoolean("bInvertFilter", this.bInvertFilter);
+ aNBT.setBoolean("bIgnoreNBT", this.bIgnoreNBT);
+ }
+
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ this.bInvertFilter = aNBT.getBoolean("bInvertFilter");
+ this.bIgnoreNBT = aNBT.getBoolean("bIgnoreNBT");
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {
+ return false;
+ }
+ if (this.bInvertFilter) {
+ for (byte i = 9; i < 18; i = (byte) (i + 1)) {
+ if (GT_Utility.areStacksEqual(this.mInventory[i], aStack, this.bIgnoreNBT)) {
+ return false;
+ }
+ }
+ return true;
}
- }
- return true;
+ return GT_Utility.areStacksEqual(this.mInventory[(aIndex + 9)], aStack, this.bIgnoreNBT);
}
- return GT_Utility.areStacksEqual(this.mInventory[(aIndex + 9)], aStack, this.bIgnoreNBT);
- }
}
diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java
index 6790d1d717..3a89b8c82e 100644
--- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java
+++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java
@@ -1,7 +1,6 @@
package gregtech.common.tileentities.automation;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -10,98 +9,85 @@ import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Utility;
import gregtech.common.gui.GT_Container_Regulator;
import gregtech.common.gui.GT_GUIContainer_Regulator;
-
-import java.util.Arrays;
-
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
+import java.util.Arrays;
+
public class GT_MetaTileEntity_Regulator
- extends GT_MetaTileEntity_Buffer
-{
- public int[] mTargetSlots = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-
- public GT_MetaTileEntity_Regulator(int aID, String aName, String aNameRegional, int aTier)
- {
- super(aID, aName, aNameRegional, aTier, 19, "Regulating incoming Items");
- }
-
- public GT_MetaTileEntity_Regulator(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aTier, aInvSlotCount, aDescription, aTextures);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_Regulator(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures);
- }
-
- public ITexture getOverlayIcon()
- {
- return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_REGULATOR);
- }
-
- public boolean isValidSlot(int aIndex)
- {
- return aIndex < 9;
- }
-
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_Container_Regulator(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_Regulator(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- public void saveNBTData(NBTTagCompound aNBT)
- {
- super.saveNBTData(aNBT);
- aNBT.setInteger("mTargetSlot1", this.mTargetSlots[0]);
- aNBT.setInteger("mTargetSlot2", this.mTargetSlots[1]);
- aNBT.setInteger("mTargetSlot3", this.mTargetSlots[2]);
- aNBT.setInteger("mTargetSlot4", this.mTargetSlots[3]);
- aNBT.setInteger("mTargetSlot5", this.mTargetSlots[4]);
- aNBT.setInteger("mTargetSlot6", this.mTargetSlots[5]);
- aNBT.setInteger("mTargetSlot7", this.mTargetSlots[6]);
- aNBT.setInteger("mTargetSlot8", this.mTargetSlots[7]);
- aNBT.setInteger("mTargetSlot9", this.mTargetSlots[8]);
- }
-
- public void loadNBTData(NBTTagCompound aNBT)
- {
- super.loadNBTData(aNBT);
- this.mTargetSlots[0] = aNBT.getInteger("mTargetSlot1");
- this.mTargetSlots[1] = aNBT.getInteger("mTargetSlot2");
- this.mTargetSlots[2] = aNBT.getInteger("mTargetSlot3");
- this.mTargetSlots[3] = aNBT.getInteger("mTargetSlot4");
- this.mTargetSlots[4] = aNBT.getInteger("mTargetSlot5");
- this.mTargetSlots[5] = aNBT.getInteger("mTargetSlot6");
- this.mTargetSlots[6] = aNBT.getInteger("mTargetSlot7");
- this.mTargetSlots[7] = aNBT.getInteger("mTargetSlot8");
- this.mTargetSlots[8] = aNBT.getInteger("mTargetSlot9");
- }
-
- public void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer)
- {
- int i = 0;
- for (int tCosts = 0; i < 9; i++) {
- if (this.mInventory[(i + 9)] != null)
- {
- tCosts = GT_Utility.moveOneItemStackIntoSlot(getBaseMetaTileEntity(), getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing()), getBaseMetaTileEntity().getBackFacing(), this.mTargetSlots[i], Arrays.asList(new ItemStack[] { this.mInventory[(i + 9)] }), false, (byte)this.mInventory[(i + 9)].stackSize, (byte)this.mInventory[(i + 9)].stackSize, (byte)64, (byte)1) * 3;
- if (tCosts > 0)
- {
- this.mSuccess = 50;getBaseMetaTileEntity().decreaseStoredEnergyUnits(tCosts, true); break;
+ extends GT_MetaTileEntity_Buffer {
+ public int[] mTargetSlots = {0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+ public GT_MetaTileEntity_Regulator(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 19, "Regulating incoming Items");
+ }
+
+ public GT_MetaTileEntity_Regulator(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aInvSlotCount, aDescription, aTextures);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Regulator(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures);
+ }
+
+ public ITexture getOverlayIcon() {
+ return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_REGULATOR);
+ }
+
+ public boolean isValidSlot(int aIndex) {
+ return aIndex < 9;
+ }
+
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_Regulator(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_Regulator(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setInteger("mTargetSlot1", this.mTargetSlots[0]);
+ aNBT.setInteger("mTargetSlot2", this.mTargetSlots[1]);
+ aNBT.setInteger("mTargetSlot3", this.mTargetSlots[2]);
+ aNBT.setInteger("mTargetSlot4", this.mTargetSlots[3]);
+ aNBT.setInteger("mTargetSlot5", this.mTargetSlots[4]);
+ aNBT.setInteger("mTargetSlot6", this.mTargetSlots[5]);
+ aNBT.setInteger("mTargetSlot7", this.mTargetSlots[6]);
+ aNBT.setInteger("mTargetSlot8", this.mTargetSlots[7]);
+ aNBT.setInteger("mTargetSlot9", this.mTargetSlots[8]);
+ }
+
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ this.mTargetSlots[0] = aNBT.getInteger("mTargetSlot1");
+ this.mTargetSlots[1] = aNBT.getInteger("mTargetSlot2");
+ this.mTargetSlots[2] = aNBT.getInteger("mTargetSlot3");
+ this.mTargetSlots[3] = aNBT.getInteger("mTargetSlot4");
+ this.mTargetSlots[4] = aNBT.getInteger("mTargetSlot5");
+ this.mTargetSlots[5] = aNBT.getInteger("mTargetSlot6");
+ this.mTargetSlots[6] = aNBT.getInteger("mTargetSlot7");
+ this.mTargetSlots[7] = aNBT.getInteger("mTargetSlot8");
+ this.mTargetSlots[8] = aNBT.getInteger("mTargetSlot9");
+ }
+
+ public void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
+ int i = 0;
+ for (int tCosts = 0; i < 9; i++) {
+ if (this.mInventory[(i + 9)] != null) {
+ tCosts = GT_Utility.moveOneItemStackIntoSlot(getBaseMetaTileEntity(), getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing()), getBaseMetaTileEntity().getBackFacing(), this.mTargetSlots[i], Arrays.asList(new ItemStack[]{this.mInventory[(i + 9)]}), false, (byte) this.mInventory[(i + 9)].stackSize, (byte) this.mInventory[(i + 9)].stackSize, (byte) 64, (byte) 1) * 3;
+ if (tCosts > 0) {
+ this.mSuccess = 50;
+ getBaseMetaTileEntity().decreaseStoredEnergyUnits(tCosts, true);
+ break;
+ }
+ }
}
- }
}
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
- {
- return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (GT_Utility.areStacksEqual(aStack, this.mInventory[(aIndex + 9)]));
- }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (GT_Utility.areStacksEqual(aStack, this.mInventory[(aIndex + 9)]));
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java
index 46c0fde6f5..212c354fba 100644
--- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java
+++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java
@@ -1,7 +1,6 @@
package gregtech.common.tileentities.automation;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -11,35 +10,28 @@ import gregtech.common.gui.GT_GUIContainer_SuperBuffer;
import net.minecraft.entity.player.InventoryPlayer;
public class GT_MetaTileEntity_SuperBuffer
- extends GT_MetaTileEntity_ChestBuffer
-{
- public GT_MetaTileEntity_SuperBuffer(int aID, String aName, String aNameRegional, int aTier)
- {
- super(aID, aName, aNameRegional, aTier, 257, "Buffering up to 256 Stacks");
- }
-
- public GT_MetaTileEntity_SuperBuffer(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aTier, aInvSlotCount, aDescription, aTextures);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_SuperBuffer(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures);
- }
-
- public ITexture getOverlayIcon()
- {
- return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_SUPERBUFFER);
- }
-
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_Container_SuperBuffer(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_SuperBuffer(aPlayerInventory, aBaseMetaTileEntity);
- }
+ extends GT_MetaTileEntity_ChestBuffer {
+ public GT_MetaTileEntity_SuperBuffer(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 257, "Buffering up to 256 Stacks");
+ }
+
+ public GT_MetaTileEntity_SuperBuffer(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aInvSlotCount, aDescription, aTextures);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_SuperBuffer(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures);
+ }
+
+ public ITexture getOverlayIcon() {
+ return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_SUPERBUFFER);
+ }
+
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_SuperBuffer(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_SuperBuffer(aPlayerInventory, aBaseMetaTileEntity);
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java
index 520f6f6d1f..596ee77bcb 100644
--- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java
+++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java
@@ -2,156 +2,132 @@ package gregtech.common.tileentities.automation;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Buffer;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.objects.ItemData;
+import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
import gregtech.common.gui.GT_Container_TypeFilter;
import gregtech.common.gui.GT_GUIContainer_TypeFilter;
-import gregtech.api.util.GT_OreDictUnificator;
-
-import java.util.ArrayList;
-
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
public class GT_MetaTileEntity_TypeFilter
- extends GT_MetaTileEntity_Buffer
-{
- public boolean bNBTAllowed = false;
- public boolean bInvertFilter = false;
- public int mRotationIndex = 0;
- public OrePrefixes mPrefix = OrePrefixes.ore;
-
- public GT_MetaTileEntity_TypeFilter(int aID, String aName, String aNameRegional, int aTier)
- {
- super(aID, aName, aNameRegional, aTier, 11, "Filtering incoming Items by Type");
- }
-
- public GT_MetaTileEntity_TypeFilter(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aTier, aInvSlotCount, aDescription, aTextures);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_TypeFilter(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures);
- }
-
- public ITexture getOverlayIcon()
- {
- return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_TYPEFILTER);
- }
-
- public boolean isValidSlot(int aIndex)
- {
- return aIndex < 9;
- }
-
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_Container_TypeFilter(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_TypeFilter(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- public void clickTypeIcon(boolean aRightClick)
- {
- if (getBaseMetaTileEntity().isServerSide())
- {
- for (int i = 0; i < OrePrefixes.values().length; i++) {
- if (this.mPrefix == OrePrefixes.values()[i]) {
- for (this.mPrefix = null; this.mPrefix == null; this.mPrefix = OrePrefixes.values()[i])
- {
- if (aRightClick)
- {
- do{
- i--;
- if (i < 0) {
- i = OrePrefixes.values().length - 1;
- }
- }while(OrePrefixes.values()[i].mPrefixedItems.isEmpty());
+ extends GT_MetaTileEntity_Buffer {
+ public boolean bNBTAllowed = false;
+ public boolean bInvertFilter = false;
+ public int mRotationIndex = 0;
+ public OrePrefixes mPrefix = OrePrefixes.ore;
+
+ public GT_MetaTileEntity_TypeFilter(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 11, "Filtering incoming Items by Type");
+ }
+
+ public GT_MetaTileEntity_TypeFilter(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aInvSlotCount, aDescription, aTextures);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_TypeFilter(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures);
+ }
+
+ public ITexture getOverlayIcon() {
+ return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_TYPEFILTER);
+ }
+
+ public boolean isValidSlot(int aIndex) {
+ return aIndex < 9;
+ }
+
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_TypeFilter(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_TypeFilter(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ public void clickTypeIcon(boolean aRightClick) {
+ if (getBaseMetaTileEntity().isServerSide()) {
+ for (int i = 0; i < OrePrefixes.values().length; i++) {
+ if (this.mPrefix == OrePrefixes.values()[i]) {
+ for (this.mPrefix = null; this.mPrefix == null; this.mPrefix = OrePrefixes.values()[i]) {
+ if (aRightClick) {
+ do {
+ i--;
+ if (i < 0) {
+ i = OrePrefixes.values().length - 1;
+ }
+ } while (OrePrefixes.values()[i].mPrefixedItems.isEmpty());
+ } else {
+ do {
+ i++;
+ if (i >= OrePrefixes.values().length) {
+ i = 0;
+ }
+ } while (OrePrefixes.values()[i].mPrefixedItems.isEmpty());
+ }
+ if (!OrePrefixes.values()[i].mPrefixedItems.isEmpty() && OrePrefixes.values()[i].mPrefixInto == OrePrefixes.values()[i])
+ mPrefix = OrePrefixes.values()[i];
+ }
+ }
+ }
+ this.mRotationIndex = 0;
+ }
+ }
+
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ if ((getBaseMetaTileEntity().isServerSide()) && (aTick % 8L == 0L)) {
+ if (this.mPrefix.mPrefixedItems.isEmpty()) {
+ this.mInventory[9] = null;
+ } else {
+ this.mInventory[9] = GT_Utility.copyAmount(1L, new Object[]{this.mPrefix.mPrefixedItems.get(this.mRotationIndex = (this.mRotationIndex + 1) % this.mPrefix.mPrefixedItems.size())});
+ if (this.mInventory[9].getItemDamage() == 32767) {
+ this.mInventory[9].setItemDamage(0);
+ }
+ this.mInventory[9].setStackDisplayName(this.mPrefix.toString());
}
- else
- {
- do{
- i++;
- if (i >= OrePrefixes.values().length) {
- i = 0;
- }
- }while(OrePrefixes.values()[i].mPrefixedItems.isEmpty());
+ }
+ }
+
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setString("mPrefix", this.mPrefix.toString());
+ aNBT.setBoolean("bInvertFilter", this.bInvertFilter);
+ aNBT.setBoolean("bNBTAllowed", this.bNBTAllowed);
+ }
+
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ this.mPrefix = OrePrefixes.getPrefix(aNBT.getString("mPrefix"), this.mPrefix);
+ this.bInvertFilter = aNBT.getBoolean("bInvertFilter");
+ this.bNBTAllowed = aNBT.getBoolean("bNBTAllowed");
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ boolean tAllowPrefix = this.mPrefix.contains(aStack);
+ if (this.mPrefix == OrePrefixes.ore) {
+ ItemData tData = GT_OreDictUnificator.getItemData(aStack);
+ if (tData != null && tData.mPrefix != null) {
+ OrePrefixes tFix = tData.mPrefix;
+ if (tFix == OrePrefixes.oreBlackgranite ||
+ tFix == OrePrefixes.oreDense ||
+ tFix == OrePrefixes.oreEnd ||
+ tFix == OrePrefixes.oreEndstone ||
+ tFix == OrePrefixes.oreNether ||
+ tFix == OrePrefixes.oreNetherrack ||
+ tFix == OrePrefixes.oreNormal ||
+ tFix == OrePrefixes.orePoor ||
+ tFix == OrePrefixes.oreRedgranite ||
+ tFix == OrePrefixes.oreRich ||
+ tFix == OrePrefixes.oreSmall) tAllowPrefix = true;
}
- if(!OrePrefixes.values()[i].mPrefixedItems.isEmpty() && OrePrefixes.values()[i].mPrefixInto == OrePrefixes.values()[i])
- mPrefix = OrePrefixes.values()[i];
- }
}
- }
- this.mRotationIndex = 0;
+ return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && ((this.bNBTAllowed) || (!aStack.hasTagCompound())) && (tAllowPrefix != this.bInvertFilter);
}
- }
-
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick)
- {
- super.onPreTick(aBaseMetaTileEntity, aTick);
- if ((getBaseMetaTileEntity().isServerSide()) && (aTick % 8L == 0L)) {
- if (this.mPrefix.mPrefixedItems.isEmpty())
- {
- this.mInventory[9] = null;
- }
- else
- {
- this.mInventory[9] = GT_Utility.copyAmount(1L, new Object[] { this.mPrefix.mPrefixedItems.get(this.mRotationIndex = (this.mRotationIndex + 1) % this.mPrefix.mPrefixedItems.size()) });
- if (this.mInventory[9].getItemDamage() == 32767) {
- this.mInventory[9].setItemDamage(0);
- }
- this.mInventory[9].setStackDisplayName(this.mPrefix.toString());
- }
- }
- }
-
- public void saveNBTData(NBTTagCompound aNBT)
- {
- super.saveNBTData(aNBT);
- aNBT.setString("mPrefix", this.mPrefix.toString());
- aNBT.setBoolean("bInvertFilter", this.bInvertFilter);
- aNBT.setBoolean("bNBTAllowed", this.bNBTAllowed);
- }
-
- public void loadNBTData(NBTTagCompound aNBT)
- {
- super.loadNBTData(aNBT);
- this.mPrefix = OrePrefixes.getPrefix(aNBT.getString("mPrefix"), this.mPrefix);
- this.bInvertFilter = aNBT.getBoolean("bInvertFilter");
- this.bNBTAllowed = aNBT.getBoolean("bNBTAllowed");
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
- {
- boolean tAllowPrefix = this.mPrefix.contains(aStack);
- if(this.mPrefix==OrePrefixes.ore){
- ItemData tData = GT_OreDictUnificator.getItemData(aStack);
- if(tData!=null&&tData.mPrefix!=null){
- OrePrefixes tFix = tData.mPrefix;
- if(tFix==OrePrefixes.oreBlackgranite||
- tFix==OrePrefixes.oreDense||
- tFix==OrePrefixes.oreEnd||
- tFix==OrePrefixes.oreEndstone||
- tFix==OrePrefixes.oreNether||
- tFix==OrePrefixes.oreNetherrack||
- tFix==OrePrefixes.oreNormal||
- tFix==OrePrefixes.orePoor||
- tFix==OrePrefixes.oreRedgranite||
- tFix==OrePrefixes.oreRich||
- tFix==OrePrefixes.oreSmall)tAllowPrefix=true;
- } }
- return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && ((this.bNBTAllowed) || (!aStack.hasTagCompound())) && (tAllowPrefix != this.bInvertFilter);
- }
}
diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java
index 340d1eb1e7..23a6f83c14 100644
--- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java
+++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java
@@ -7,324 +7,264 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.util.GT_CoverBehavior;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
-import java.util.Map;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidHandler;
public abstract class GT_MetaTileEntity_Boiler
- extends GT_MetaTileEntity_BasicTank
-{
- public int mTemperature = 20;
- public int mProcessingEnergy = 0;
- public int mLossTimer = 0;
- public FluidStack mSteam = null;
- public boolean mHadNoWater = false;
-
- public GT_MetaTileEntity_Boiler(int aID, String aName, String aNameRegional, String aDescription, ITexture... aTextures)
- {
- super(aID, aName, aNameRegional, 0, 4, aDescription, aTextures);
- }
-
- public GT_MetaTileEntity_Boiler(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aTier, 4, aDescription, aTextures);
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
- {
- ITexture[] tmp = mTextures[aSide >= 2 ? aSide != aFacing ? 2 : ((byte)(aActive ? 4 : 3)) : aSide][aColorIndex + 1];
- //mTextures[(aSide==aFacing?(aActive?4:3):aSide==GT_Utility.getOppositeSide(aFacing)?2:aSide==0?0:aSide==1?1:2)][aColorIndex+1];
- if(aSide!=aFacing&&tmp.length==2){
- tmp = new ITexture[]{tmp[0]};
- }
- return tmp;
- }
-
- public boolean isElectric()
- {
- return false;
- }
-
- public boolean isPneumatic()
- {
- return false;
- }
-
- public boolean isSteampowered()
- {
- return false;
- }
-
- public boolean isSimpleMachine()
- {
- return false;
- }
-
- public boolean isFacingValid(byte aFacing)
- {
- return aFacing > 1;
- }
-
- public boolean isAccessAllowed(EntityPlayer aPlayer)
- {
- return true;
- }
-
- public boolean isValidSlot(int aIndex)
- {
- return true;
- }
-
- public int getProgresstime()
- {
- return this.mTemperature;
- }
-
- public int maxProgresstime()
- {
- return 500;
- }
-
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer)
- {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
+ extends GT_MetaTileEntity_BasicTank {
+ public int mTemperature = 20;
+ public int mProcessingEnergy = 0;
+ public int mLossTimer = 0;
+ public FluidStack mSteam = null;
+ public boolean mHadNoWater = false;
+
+ public GT_MetaTileEntity_Boiler(int aID, String aName, String aNameRegional, String aDescription, ITexture... aTextures) {
+ super(aID, aName, aNameRegional, 0, 4, aDescription, aTextures);
}
- if (aPlayer != null) {
- if (GT_Utility.areStacksEqual(aPlayer.getCurrentEquippedItem(), new ItemStack(Items.water_bucket, 1)))
- {
- fill(Materials.Water.getFluid(1000 * aPlayer.getCurrentEquippedItem().stackSize), true);
- aPlayer.getCurrentEquippedItem().func_150996_a(Items.bucket);
- }
- else
- {
- aBaseMetaTileEntity.openGUI(aPlayer);
- }
+
+ public GT_MetaTileEntity_Boiler(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 4, aDescription, aTextures);
}
- return true;
- }
-
- public boolean doesFillContainers()
- {
- return true;
- }
-
- public boolean doesEmptyContainers()
- {
- return true;
- }
-
- public boolean canTankBeFilled()
- {
- return true;
- }
-
- public boolean canTankBeEmptied()
- {
- return true;
- }
-
- public boolean displaysItemStack()
- {
- return false;
- }
-
- public boolean displaysStackSize()
- {
- return false;
- }
-
- public boolean isFluidInputAllowed(FluidStack aFluid)
- {
- return GT_ModHandler.isWater(aFluid);
- }
-
- public FluidStack getDrainableStack()
- {
- return this.mSteam;
- }
-
- public FluidStack setDrainableStack(FluidStack aFluid)
- {
- this.mSteam = aFluid;return this.mSteam;
- }
-
- public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCover)
- {
- return GregTech_API.getCoverBehavior(aCover.toStack()).isSimpleCover();
- }
-
- public void saveNBTData(NBTTagCompound aNBT)
- {
- super.saveNBTData(aNBT);
- aNBT.setInteger("mLossTimer", this.mLossTimer);
- aNBT.setInteger("mTemperature", this.mTemperature);
- aNBT.setInteger("mProcessingEnergy", this.mProcessingEnergy);
- if (this.mSteam != null) {
- try
- {
- aNBT.setTag("mSteam", this.mSteam.writeToNBT(new NBTTagCompound()));
- }
- catch (Throwable e) {}
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ ITexture[] tmp = mTextures[aSide >= 2 ? aSide != aFacing ? 2 : ((byte) (aActive ? 4 : 3)) : aSide][aColorIndex + 1];
+ //mTextures[(aSide==aFacing?(aActive?4:3):aSide==GT_Utility.getOppositeSide(aFacing)?2:aSide==0?0:aSide==1?1:2)][aColorIndex+1];
+ if (aSide != aFacing && tmp.length == 2) {
+ tmp = new ITexture[]{tmp[0]};
+ }
+ return tmp;
}
- }
-
- public void loadNBTData(NBTTagCompound aNBT)
- {
- super.loadNBTData(aNBT);
- this.mLossTimer = aNBT.getInteger("mLossTimer");
- this.mTemperature = aNBT.getInteger("mTemperature");
- this.mProcessingEnergy = aNBT.getInteger("mProcessingEnergy");
- this.mSteam = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mSteam"));
- }
-
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick)
- {
- if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L))
- {
- if (this.mTemperature <= 20)
- {
- this.mTemperature = 20;
- this.mLossTimer = 0;
- }
- if (++this.mLossTimer > 40)
- {
- this.mTemperature -= 1;
- this.mLossTimer = 0;
- }
- for (byte i = 1; (this.mSteam != null) && (i < 6); i = (byte)(i + 1)) {
- if (i != aBaseMetaTileEntity.getFrontFacing())
- {
- IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i);
- if (tTileEntity != null)
- {
- FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false);
- if (tDrained != null)
- {
- int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false);
- if (tFilledAmount > 0) {
- tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true);
- }
- }
- }
+
+ public boolean isElectric() {
+ return false;
+ }
+
+ public boolean isPneumatic() {
+ return false;
+ }
+
+ public boolean isSteampowered() {
+ return false;
+ }
+
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ public boolean isValidSlot(int aIndex) {
+ return true;
+ }
+
+ public int getProgresstime() {
+ return this.mTemperature;
+ }
+
+ public int maxProgresstime() {
+ return 500;
+ }
+
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
}
- }
- if (aTick % 10L == 0L) {
- if (this.mTemperature > 100)
- {
- if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0))
- {
- this.mHadNoWater = true;
- }
- else
- {
- if (this.mHadNoWater)
- {
- aBaseMetaTileEntity.doExplosion(2048L);
- return;
- }
- this.mFluid.amount -= 1;
- if (this.mSteam == null) {
- this.mSteam = GT_ModHandler.getSteam(150L);
- } else if (GT_ModHandler.isSteam(this.mSteam)) {
- this.mSteam.amount += 150;
+ if (aPlayer != null) {
+ if (GT_Utility.areStacksEqual(aPlayer.getCurrentEquippedItem(), new ItemStack(Items.water_bucket, 1))) {
+ fill(Materials.Water.getFluid(1000 * aPlayer.getCurrentEquippedItem().stackSize), true);
+ aPlayer.getCurrentEquippedItem().func_150996_a(Items.bucket);
} else {
- this.mSteam = GT_ModHandler.getSteam(150L);
+ aBaseMetaTileEntity.openGUI(aPlayer);
}
- }
- }
- else {
- this.mHadNoWater = false;
- }
- }
- if ((this.mSteam != null) &&
- (this.mSteam.amount > 32000))
- {
- sendSound((byte)1);
- this.mSteam.amount = 24000;
- }
- if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) &&
- (this.mInventory[2] != null)) {
- if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Coal))))
- {
- this.mProcessingEnergy += 160;
- aBaseMetaTileEntity.decrStackSize(2, 1);
- if (aBaseMetaTileEntity.getRandomNumber(3) == 0) {
- aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L));
- }
}
- else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Charcoal)))
- {
- this.mProcessingEnergy += 160;
- aBaseMetaTileEntity.decrStackSize(2, 1);
- if (aBaseMetaTileEntity.getRandomNumber(3) == 0) {
- aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L));
- }
+ return true;
+ }
+
+ public boolean doesFillContainers() {
+ return true;
+ }
+
+ public boolean doesEmptyContainers() {
+ return true;
+ }
+
+ public boolean canTankBeFilled() {
+ return true;
+ }
+
+ public boolean canTankBeEmptied() {
+ return true;
+ }
+
+ public boolean displaysItemStack() {
+ return false;
+ }
+
+ public boolean displaysStackSize() {
+ return false;
+ }
+
+ public boolean isFluidInputAllowed(FluidStack aFluid) {
+ return GT_ModHandler.isWater(aFluid);
+ }
+
+ public FluidStack getDrainableStack() {
+ return this.mSteam;
+ }
+
+ public FluidStack setDrainableStack(FluidStack aFluid) {
+ this.mSteam = aFluid;
+ return this.mSteam;
+ }
+
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCover) {
+ return GregTech_API.getCoverBehavior(aCover.toStack()).isSimpleCover();
+ }
+
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setInteger("mLossTimer", this.mLossTimer);
+ aNBT.setInteger("mTemperature", this.mTemperature);
+ aNBT.setInteger("mProcessingEnergy", this.mProcessingEnergy);
+ if (this.mSteam != null) {
+ try {
+ aNBT.setTag("mSteam", this.mSteam.writeToNBT(new NBTTagCompound()));
+ } catch (Throwable e) {
+ }
}
- else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCoke"))
- {
- this.mProcessingEnergy += 640;
- aBaseMetaTileEntity.decrStackSize(2, 1);
- if (aBaseMetaTileEntity.getRandomNumber(2) == 0) {
- aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L));
- }
+ }
+
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ this.mLossTimer = aNBT.getInteger("mLossTimer");
+ this.mTemperature = aNBT.getInteger("mTemperature");
+ this.mProcessingEnergy = aNBT.getInteger("mProcessingEnergy");
+ this.mSteam = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mSteam"));
+ }
+
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)) {
+ if (this.mTemperature <= 20) {
+ this.mTemperature = 20;
+ this.mLossTimer = 0;
+ }
+ if (++this.mLossTimer > 40) {
+ this.mTemperature -= 1;
+ this.mLossTimer = 0;
+ }
+ for (byte i = 1; (this.mSteam != null) && (i < 6); i = (byte) (i + 1)) {
+ if (i != aBaseMetaTileEntity.getFrontFacing()) {
+ IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i);
+ if (tTileEntity != null) {
+ FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false);
+ if (tDrained != null) {
+ int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false);
+ if (tFilledAmount > 0) {
+ tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true);
+ }
+ }
+ }
+ }
+ }
+ if (aTick % 10L == 0L) {
+ if (this.mTemperature > 100) {
+ if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0)) {
+ this.mHadNoWater = true;
+ } else {
+ if (this.mHadNoWater) {
+ aBaseMetaTileEntity.doExplosion(2048L);
+ return;
+ }
+ this.mFluid.amount -= 1;
+ if (this.mSteam == null) {
+ this.mSteam = GT_ModHandler.getSteam(150L);
+ } else if (GT_ModHandler.isSteam(this.mSteam)) {
+ this.mSteam.amount += 150;
+ } else {
+ this.mSteam = GT_ModHandler.getSteam(150L);
+ }
+ }
+ } else {
+ this.mHadNoWater = false;
+ }
+ }
+ if ((this.mSteam != null) &&
+ (this.mSteam.amount > 32000)) {
+ sendSound((byte) 1);
+ this.mSteam.amount = 24000;
+ }
+ if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) &&
+ (this.mInventory[2] != null)) {
+ if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Coal)))) {
+ this.mProcessingEnergy += 160;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ if (aBaseMetaTileEntity.getRandomNumber(3) == 0) {
+ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L));
+ }
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Charcoal))) {
+ this.mProcessingEnergy += 160;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ if (aBaseMetaTileEntity.getRandomNumber(3) == 0) {
+ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L));
+ }
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCoke")) {
+ this.mProcessingEnergy += 640;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ if (aBaseMetaTileEntity.getRandomNumber(2) == 0) {
+ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L));
+ }
+ } else if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Lignite)))) {
+ this.mProcessingEnergy += 120;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ if (aBaseMetaTileEntity.getRandomNumber(8) == 0) {
+ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L));
+ }
+ }
+ }
+ if ((this.mTemperature < 1000) && (this.mProcessingEnergy > 0) && (aTick % 12L == 0L)) {
+ this.mProcessingEnergy -= 2;
+ this.mTemperature += 1;
+ }
+ aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
}
- else if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Lignite))))
- {
- this.mProcessingEnergy += 120;
- aBaseMetaTileEntity.decrStackSize(2, 1);
- if (aBaseMetaTileEntity.getRandomNumber(8) == 0) {
- aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L));
- }
+ }
+
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return (aIndex == 1) || (aIndex == 3);
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return aIndex == 2;
+ }
+
+ public void doSound(byte aIndex, double aX, double aY, double aZ) {
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(4)), 2, 1.0F, aX, aY, aZ);
+ for (int l = 0; l < 8; l++) {
+ getBaseMetaTileEntity().getWorld().spawnParticle("largesmoke", aX - 0.5D + Math.random(), aY, aZ - 0.5D + Math.random(), 0.0D, 0.0D, 0.0D);
+ }
}
- }
- if ((this.mTemperature < 1000) && (this.mProcessingEnergy > 0) && (aTick % 12L == 0L))
- {
- this.mProcessingEnergy -= 2;
- this.mTemperature += 1;
- }
- aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
}
- }
-
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
- {
- return (aIndex == 1) || (aIndex == 3);
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
- {
- return aIndex == 2;
- }
-
- public void doSound(byte aIndex, double aX, double aY, double aZ)
- {
- if (aIndex == 1)
- {
- GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(4)), 2, 1.0F, aX, aY, aZ);
- for (int l = 0; l < 8; l++) {
- getBaseMetaTileEntity().getWorld().spawnParticle("largesmoke", aX - 0.5D + Math.random(), aY, aZ - 0.5D + Math.random(), 0.0D, 0.0D, 0.0D);
- }
+
+ public int getCapacity() {
+ return 16000;
+ }
+
+ public int getTankPressure() {
+ return 100;
}
- }
-
- public int getCapacity()
- {
- return 16000;
- }
-
- public int getTankPressure()
- {
- return 100;
- }
}
diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java
index b8c4ed5356..dfe74e34fe 100644
--- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java
+++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java
@@ -4,7 +4,6 @@ import gregtech.api.enums.Dyes;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
@@ -19,158 +18,127 @@ import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidHandler;
public class GT_MetaTileEntity_Boiler_Bronze
- extends GT_MetaTileEntity_Boiler
-{
- public GT_MetaTileEntity_Boiler_Bronze(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional, "An early way to get Steam Power", new ITexture[0]);
- }
-
- public GT_MetaTileEntity_Boiler_Bronze(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aTier, aDescription, aTextures);
- }
-
- public ITexture[][][] getTextureSet(ITexture[] aTextures)
- {
- ITexture[][][] rTextures = new ITexture[5][17][];
- for (byte i = -1; i < 16; i++)
- {
- rTextures[0][(i + 1)] = new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
- rTextures[1][(i + 1)] = new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) };
- rTextures[2][(i + 1)] = new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) };
- rTextures[3][(i + 1)] = new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT) };
- rTextures[4][(i + 1)] = new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE) };
+ extends GT_MetaTileEntity_Boiler {
+ public GT_MetaTileEntity_Boiler_Bronze(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, "An early way to get Steam Power", new ITexture[0]);
}
- return rTextures;
- }
-
- public int maxProgresstime()
- {
- return 500;
- }
-
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 16000);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "BronzeBoiler.png", 16000);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_Boiler_Bronze(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick)
- {
- if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L))
- {
- if (this.mTemperature <= 20)
- {
- this.mTemperature = 20;
- this.mLossTimer = 0;
- }
- if (++this.mLossTimer > 45)
- {
- this.mTemperature -= 1;
- this.mLossTimer = 0;
- }
- for (byte i = 1; (this.mSteam != null) && (i < 6); i = (byte)(i + 1)) {
- if (i != aBaseMetaTileEntity.getFrontFacing())
- {
- IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i);
- if (tTileEntity != null)
- {
- FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false);
- if (tDrained != null)
- {
- int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false);
- if (tFilledAmount > 0) {
- tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true);
- }
- }
- }
+
+ public GT_MetaTileEntity_Boiler_Bronze(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[5][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))};
+ rTextures[1][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)};
+ rTextures[2][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)};
+ rTextures[3][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT)};
+ rTextures[4][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE)};
}
- }
- if (aTick % 25L == 0L) {
- if (this.mTemperature > 100)
- {
- if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0))
- {
- this.mHadNoWater = true;
- }
- else
- {
- if (this.mHadNoWater)
- {
- aBaseMetaTileEntity.doExplosion(2048L);
- return;
+ return rTextures;
+ }
+
+ public int maxProgresstime() {
+ return 500;
+ }
+
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 16000);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "BronzeBoiler.png", 16000);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Boiler_Bronze(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)) {
+ if (this.mTemperature <= 20) {
+ this.mTemperature = 20;
+ this.mLossTimer = 0;
}
- this.mFluid.amount -= 1;
- if (this.mSteam == null) {
- this.mSteam = GT_ModHandler.getSteam(150L);
- } else if (GT_ModHandler.isSteam(this.mSteam)) {
- this.mSteam.amount += 150;
- } else {
- this.mSteam = GT_ModHandler.getSteam(150L);
+ if (++this.mLossTimer > 45) {
+ this.mTemperature -= 1;
+ this.mLossTimer = 0;
}
- }
- }
- else {
- this.mHadNoWater = false;
- }
- }
- if ((this.mSteam != null) &&
- (this.mSteam.amount > 16000))
- {
- sendSound((byte)1);
- this.mSteam.amount = 12000;
- }
- if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) &&
- (this.mInventory[2] != null)) {
- if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Coal))))
- {
- this.mProcessingEnergy += 160;
- aBaseMetaTileEntity.decrStackSize(2, 1);
- if (aBaseMetaTileEntity.getRandomNumber(3) == 0) {
- aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L));
- }
- }
- else if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Charcoal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Charcoal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Charcoal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Charcoal))))
- {
- this.mProcessingEnergy += 160;
- aBaseMetaTileEntity.decrStackSize(2, 1);
- if (aBaseMetaTileEntity.getRandomNumber(3) == 0) {
- aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L));
- }
- }
- else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCoke"))
- {
- this.mProcessingEnergy += 640;
- aBaseMetaTileEntity.decrStackSize(2, 1);
- if (aBaseMetaTileEntity.getRandomNumber(2) == 0) {
- aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L));
- }
- }
- else if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Lignite))))
- {
- this.mProcessingEnergy += 120;
- aBaseMetaTileEntity.decrStackSize(2, 1);
- if (aBaseMetaTileEntity.getRandomNumber(8) == 0) {
- aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L));
- }
+ for (byte i = 1; (this.mSteam != null) && (i < 6); i = (byte) (i + 1)) {
+ if (i != aBaseMetaTileEntity.getFrontFacing()) {
+ IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i);
+ if (tTileEntity != null) {
+ FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false);
+ if (tDrained != null) {
+ int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false);
+ if (tFilledAmount > 0) {
+ tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true);
+ }
+ }
+ }
+ }
+ }
+ if (aTick % 25L == 0L) {
+ if (this.mTemperature > 100) {
+ if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0)) {
+ this.mHadNoWater = true;
+ } else {
+ if (this.mHadNoWater) {
+ aBaseMetaTileEntity.doExplosion(2048L);
+ return;
+ }
+ this.mFluid.amount -= 1;
+ if (this.mSteam == null) {
+ this.mSteam = GT_ModHandler.getSteam(150L);
+ } else if (GT_ModHandler.isSteam(this.mSteam)) {
+ this.mSteam.amount += 150;
+ } else {
+ this.mSteam = GT_ModHandler.getSteam(150L);
+ }
+ }
+ } else {
+ this.mHadNoWater = false;
+ }
+ }
+ if ((this.mSteam != null) &&
+ (this.mSteam.amount > 16000)) {
+ sendSound((byte) 1);
+ this.mSteam.amount = 12000;
+ }
+ if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) &&
+ (this.mInventory[2] != null)) {
+ if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Coal)))) {
+ this.mProcessingEnergy += 160;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ if (aBaseMetaTileEntity.getRandomNumber(3) == 0) {
+ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L));
+ }
+ } else if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Charcoal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Charcoal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Charcoal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Charcoal)))) {
+ this.mProcessingEnergy += 160;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ if (aBaseMetaTileEntity.getRandomNumber(3) == 0) {
+ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L));
+ }
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCoke")) {
+ this.mProcessingEnergy += 640;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ if (aBaseMetaTileEntity.getRandomNumber(2) == 0) {
+ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L));
+ }
+ } else if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Lignite)))) {
+ this.mProcessingEnergy += 120;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ if (aBaseMetaTileEntity.getRandomNumber(8) == 0) {
+ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L));
+ }
+ }
+ }
+ if ((this.mTemperature < 500) && (this.mProcessingEnergy > 0) && (aTick % 12L == 0L)) {
+ this.mProcessingEnergy -= 1;
+ this.mTemperature += 1;
+ }
+ aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
}
- }
- if ((this.mTemperature < 500) && (this.mProcessingEnergy > 0) && (aTick % 12L == 0L))
- {
- this.mProcessingEnergy -= 1;
- this.mTemperature += 1;
- }
- aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
}
- }
}
diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java
index be715de602..0adff0b9ed 100644
--- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java
+++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java
@@ -4,7 +4,6 @@ import gregtech.api.enums.Dyes;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
@@ -19,142 +18,116 @@ import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidHandler;
public class GT_MetaTileEntity_Boiler_Lava
- extends GT_MetaTileEntity_Boiler
-{
- public GT_MetaTileEntity_Boiler_Lava(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional, "A Boiler running off Lava", new ITexture[0]);
- }
-
- public GT_MetaTileEntity_Boiler_Lava(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aTier, aDescription, aTextures);
- }
-
- public ITexture[][][] getTextureSet(ITexture[] aTextures)
- {
- ITexture[][][] rTextures = new ITexture[5][17][];
- for (byte i = -1; i < 16; i++){
- rTextures[0][(i + 1)] = new ITexture [] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
- rTextures[1][(i + 1)] = new ITexture [] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) };
- rTextures[2][(i + 1)] = new ITexture [] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) };
- rTextures[3][(i + 1)] = new ITexture [] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_LAVA_FRONT) };
- rTextures[4][(i + 1)] = new ITexture [] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_LAVA_FRONT_ACTIVE) };
+ extends GT_MetaTileEntity_Boiler {
+ public GT_MetaTileEntity_Boiler_Lava(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, "A Boiler running off Lava", new ITexture[0]);
}
- return rTextures;
- }
-
- public int maxProgresstime()
- {
- return 1000;
- }
-
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 32000);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SteelBoiler.png", 32000);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_Boiler_Lava(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick)
- {
- if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L))
- {
- if (this.mTemperature <= 20)
- {
- this.mTemperature = 20;
- this.mLossTimer = 0;
- }
- if (++this.mLossTimer > 20)
- {
- this.mTemperature -= 1;
- this.mLossTimer = 0;
- }
- for (byte i = 1; (this.mSteam != null) && (i < 6); i = (byte)(i + 1)) {
- if (i != aBaseMetaTileEntity.getFrontFacing())
- {
- IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i);
- if (tTileEntity != null)
- {
- FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false);
- if (tDrained != null)
- {
- int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false);
- if (tFilledAmount > 0) {
- tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true);
- }
- }
- }
+
+ public GT_MetaTileEntity_Boiler_Lava(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[5][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))};
+ rTextures[1][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)};
+ rTextures[2][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)};
+ rTextures[3][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_LAVA_FRONT)};
+ rTextures[4][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_LAVA_FRONT_ACTIVE)};
}
- }
- if (aTick % 10L == 0L) {
- if (this.mTemperature > 100)
- {
- if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0))
- {
- this.mHadNoWater = true;
- }
- else
- {
- if (this.mHadNoWater)
- {
- aBaseMetaTileEntity.doExplosion(2048L);
- return;
+ return rTextures;
+ }
+
+ public int maxProgresstime() {
+ return 1000;
+ }
+
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 32000);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SteelBoiler.png", 32000);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Boiler_Lava(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)) {
+ if (this.mTemperature <= 20) {
+ this.mTemperature = 20;
+ this.mLossTimer = 0;
}
- this.mFluid.amount -= 1;
- if (this.mSteam == null) {
- this.mSteam = GT_ModHandler.getSteam(300L);
- } else if (GT_ModHandler.isSteam(this.mSteam)) {
- this.mSteam.amount += 300;
- } else {
- this.mSteam = GT_ModHandler.getSteam(300L);
+ if (++this.mLossTimer > 20) {
+ this.mTemperature -= 1;
+ this.mLossTimer = 0;
}
- }
- }
- else {
- this.mHadNoWater = false;
+ for (byte i = 1; (this.mSteam != null) && (i < 6); i = (byte) (i + 1)) {
+ if (i != aBaseMetaTileEntity.getFrontFacing()) {
+ IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i);
+ if (tTileEntity != null) {
+ FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false);
+ if (tDrained != null) {
+ int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false);
+ if (tFilledAmount > 0) {
+ tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true);
+ }
+ }
+ }
+ }
+ }
+ if (aTick % 10L == 0L) {
+ if (this.mTemperature > 100) {
+ if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0)) {
+ this.mHadNoWater = true;
+ } else {
+ if (this.mHadNoWater) {
+ aBaseMetaTileEntity.doExplosion(2048L);
+ return;
+ }
+ this.mFluid.amount -= 1;
+ if (this.mSteam == null) {
+ this.mSteam = GT_ModHandler.getSteam(300L);
+ } else if (GT_ModHandler.isSteam(this.mSteam)) {
+ this.mSteam.amount += 300;
+ } else {
+ this.mSteam = GT_ModHandler.getSteam(300L);
+ }
+ }
+ } else {
+ this.mHadNoWater = false;
+ }
+ }
+ if ((this.mSteam != null) &&
+ (this.mSteam.amount > 32000)) {
+ sendSound((byte) 1);
+ this.mSteam.amount = 24000;
+ }
+ if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) &&
+ (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.bucket.get(Materials.Lava)))) {
+ this.mProcessingEnergy += 1000;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.bucket, Materials.Empty, 1L));
+ }
+ if ((this.mTemperature < 1000) && (this.mProcessingEnergy > 0) && (aTick % 8L == 0L)) {
+ this.mProcessingEnergy -= 3;
+ this.mTemperature += 1;
+ }
+ aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
}
- }
- if ((this.mSteam != null) &&
- (this.mSteam.amount > 32000))
- {
- sendSound((byte)1);
- this.mSteam.amount = 24000;
- }
- if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) &&
- (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.bucket.get(Materials.Lava))))
- {
- this.mProcessingEnergy += 1000;
- aBaseMetaTileEntity.decrStackSize(2, 1);
- aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.bucket, Materials.Empty, 1L));
- }
- if ((this.mTemperature < 1000) && (this.mProcessingEnergy > 0) && (aTick % 8L == 0L))
- {
- this.mProcessingEnergy -= 3;
- this.mTemperature += 1;
- }
- aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
}
- }
-
- public final int fill(FluidStack aFluid, boolean doFill)
- {
- if ((GT_ModHandler.isLava(aFluid)) && (this.mProcessingEnergy < 50))
- {
- int tFilledAmount = Math.min(50, aFluid.amount);
- if (doFill) {
- this.mProcessingEnergy += tFilledAmount;
- }
- return tFilledAmount;
+
+ public final int fill(FluidStack aFluid, boolean doFill) {
+ if ((GT_ModHandler.isLava(aFluid)) && (this.mProcessingEnergy < 50)) {
+ int tFilledAmount = Math.min(50, aFluid.amount);
+ if (doFill) {
+ this.mProcessingEnergy += tFilledAmount;
+ }
+ return tFilledAmount;
+ }
+ return super.fill(aFluid, doFill);
}
- return super.fill(aFluid, doFill);
- }
}
diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java
index 346b451147..c013f87a36 100644
--- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java
+++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java
@@ -2,151 +2,122 @@ package gregtech.common.tileentities.boilers;
import gregtech.api.enums.Dyes;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_Utility;
import gregtech.common.gui.GT_Container_Boiler;
import gregtech.common.gui.GT_GUIContainer_Boiler;
import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.world.World;
-import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidHandler;
public class GT_MetaTileEntity_Boiler_Solar
- extends GT_MetaTileEntity_Boiler
-{
- public GT_MetaTileEntity_Boiler_Solar(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional, "Steam Power by the Sun", new ITexture[0]);
- }
-
- public GT_MetaTileEntity_Boiler_Solar(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aTier, aDescription, aTextures);
- }
-
- public ITexture[][][] getTextureSet(ITexture[] aTextures)
- {
- ITexture[][][] rTextures = new ITexture[4][17][];
- for (byte i = -1; i < 16; i = (byte)(i + 1))
- {ITexture[] tmp0 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
- rTextures[0][(i + 1)] = tmp0;
- ITexture[] tmp1 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_SOLAR) };
- rTextures[1][(i + 1)] = tmp1;
- ITexture[] tmp2 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
- rTextures[2][(i + 1)] = tmp2;
- ITexture[] tmp3 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) };
- rTextures[3][(i + 1)] = tmp3;
+ extends GT_MetaTileEntity_Boiler {
+ public GT_MetaTileEntity_Boiler_Solar(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, "Steam Power by the Sun", new ITexture[0]);
}
- return rTextures;
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
- {
- return mTextures[aSide >= 2 ? ((byte)(aSide != aFacing ? 2 : 3)) : aSide][aColorIndex + 1];
- }
-
- public int maxProgresstime()
- {
- return 500;
- }
-
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 16000);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SolarBoiler.png", 16000);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_Boiler_Solar(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick)
- {
- if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L))
- {
- if (this.mTemperature <= 20)
- {
- this.mTemperature = 20;
- this.mLossTimer = 0;
- }
- if (++this.mLossTimer > 45)
- {
- this.mTemperature -= 1;
- this.mLossTimer = 0;
- }
- if (this.mSteam != null)
- {
- byte i = aBaseMetaTileEntity.getFrontFacing();
- IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i);
- if (tTileEntity != null)
- {
- FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false);
- if (tDrained != null)
- {
- int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false);
- if (tFilledAmount > 0) {
- tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true);
- }
- }
+
+ public GT_MetaTileEntity_Boiler_Solar(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[4][17][];
+ for (byte i = -1; i < 16; i = (byte) (i + 1)) {
+ ITexture[] tmp0 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))};
+ rTextures[0][(i + 1)] = tmp0;
+ ITexture[] tmp1 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_SOLAR)};
+ rTextures[1][(i + 1)] = tmp1;
+ ITexture[] tmp2 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa))};
+ rTextures[2][(i + 1)] = tmp2;
+ ITexture[] tmp3 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)};
+ rTextures[3][(i + 1)] = tmp3;
}
- }
- if (aTick % 25L == 0L) {
- if (this.mTemperature > 100)
- {
- if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0))
- {
- this.mHadNoWater = true;
- }
- else
- {
- if (this.mHadNoWater)
- {
- aBaseMetaTileEntity.doExplosion(2048L);
- return;
+ return rTextures;
+ }
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return mTextures[aSide >= 2 ? ((byte) (aSide != aFacing ? 2 : 3)) : aSide][aColorIndex + 1];
+ }
+
+ public int maxProgresstime() {
+ return 500;
+ }
+
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 16000);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SolarBoiler.png", 16000);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Boiler_Solar(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)) {
+ if (this.mTemperature <= 20) {
+ this.mTemperature = 20;
+ this.mLossTimer = 0;
}
- this.mFluid.amount -= 1;
- if (this.mSteam == null) {
- this.mSteam = GT_ModHandler.getSteam(150L);
- } else if (GT_ModHandler.isSteam(this.mSteam)) {
- this.mSteam.amount += 150;
- } else {
- this.mSteam = GT_ModHandler.getSteam(150L);
+ if (++this.mLossTimer > 45) {
+ this.mTemperature -= 1;
+ this.mLossTimer = 0;
}
- }
- }
- else {
- this.mHadNoWater = false;
+ if (this.mSteam != null) {
+ byte i = aBaseMetaTileEntity.getFrontFacing();
+ IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i);
+ if (tTileEntity != null) {
+ FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false);
+ if (tDrained != null) {
+ int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false);
+ if (tFilledAmount > 0) {
+ tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true);
+ }
+ }
+ }
+ }
+ if (aTick % 25L == 0L) {
+ if (this.mTemperature > 100) {
+ if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0)) {
+ this.mHadNoWater = true;
+ } else {
+ if (this.mHadNoWater) {
+ aBaseMetaTileEntity.doExplosion(2048L);
+ return;
+ }
+ this.mFluid.amount -= 1;
+ if (this.mSteam == null) {
+ this.mSteam = GT_ModHandler.getSteam(150L);
+ } else if (GT_ModHandler.isSteam(this.mSteam)) {
+ this.mSteam.amount += 150;
+ } else {
+ this.mSteam = GT_ModHandler.getSteam(150L);
+ }
+ }
+ } else {
+ this.mHadNoWater = false;
+ }
+ }
+ if ((this.mSteam != null) &&
+ (this.mSteam.amount > 16000)) {
+ sendSound((byte) 1);
+ this.mSteam.amount = 12000;
+ }
+ if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && (aTick % 256L == 0L) && (!aBaseMetaTileEntity.getWorld().isThundering())) {
+ boolean bRain = aBaseMetaTileEntity.getWorld().isRaining() && aBaseMetaTileEntity.getBiome().rainfall > 0.0F;
+ mProcessingEnergy += bRain && aBaseMetaTileEntity.getWorld().skylightSubtracted >= 4 || !aBaseMetaTileEntity.getSkyAtSide((byte) 1) ? 0 : !bRain && aBaseMetaTileEntity.getWorld().isDaytime() ? 8 : 1;
+ }
+ if ((this.mTemperature < 500) && (this.mProcessingEnergy > 0) && (aTick % 12L == 0L)) {
+ this.mProcessingEnergy -= 1;
+ this.mTemperature += 1;
+ }
+ aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
}
- }
- if ((this.mSteam != null) &&
- (this.mSteam.amount > 16000))
- {
- sendSound((byte)1);
- this.mSteam.amount = 12000;
- }
- if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && (aTick % 256L == 0L) && (!aBaseMetaTileEntity.getWorld().isThundering()))
- {
- boolean bRain = aBaseMetaTileEntity.getWorld().isRaining() && aBaseMetaTileEntity.getBiome().rainfall > 0.0F;
- mProcessingEnergy += bRain && aBaseMetaTileEntity.getWorld().skylightSubtracted >= 4 || !aBaseMetaTileEntity.getSkyAtSide((byte)1) ? 0 : !bRain && aBaseMetaTileEntity.getWorld().isDaytime() ? 8 : 1;
- }
- if ((this.mTemperature < 500) && (this.mProcessingEnergy > 0) && (aTick % 12L == 0L))
- {
- this.mProcessingEnergy -= 1;
- this.mTemperature += 1;
- }
- aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
}
- }
}
diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java
index a0dee53ca1..5ce3089466 100644
--- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java
+++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java
@@ -4,7 +4,6 @@ import gregtech.api.enums.Dyes;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
@@ -19,162 +18,132 @@ import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidHandler;
public class GT_MetaTileEntity_Boiler_Steel
- extends GT_MetaTileEntity_Boiler
-{
- public GT_MetaTileEntity_Boiler_Steel(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional, "Faster than the Bronze Boiler", new ITexture[0]);
- }
-
- public GT_MetaTileEntity_Boiler_Steel(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aTier, aDescription, aTextures);
- }
-
- public ITexture[][][] getTextureSet(ITexture[] aTextures)
- {
- ITexture[][][] rTextures = new ITexture[5][17][];
- for (byte i = -1; i < 16; i = (byte)(i + 1))
- {ITexture[] tmp0 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
- rTextures[0][(i + 1)] = tmp0;
- ITexture[] tmp1 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) };
-rTextures[1][(i + 1)] = tmp1;
- ITexture[] tmp2 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) };
-rTextures[2][(i + 1)] = tmp2;
- ITexture[] tmp4 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT) };
-rTextures[3][(i + 1)] = tmp4;
- ITexture[] tmp5 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE) };
-rTextures[4][(i + 1)] = tmp5;
+ extends GT_MetaTileEntity_Boiler {
+ public GT_MetaTileEntity_Boiler_Steel(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, "Faster than the Bronze Boiler", new ITexture[0]);
}
- return rTextures;
- }
-
- public int maxProgresstime()
- {
- return 1000;
- }
-
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 32000);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SteelBoiler.png", 32000);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_Boiler_Steel(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick)
- {
- if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L))
- {
- if (this.mTemperature <= 20)
- {
- this.mTemperature = 20;
- this.mLossTimer = 0;
- }
- if (++this.mLossTimer > 40)
- {
- this.mTemperature -= 1;
- this.mLossTimer = 0;
- }
- for (byte i = 1; (this.mSteam != null) && (i < 6); i = (byte)(i + 1)) {
- if (i != aBaseMetaTileEntity.getFrontFacing())
- {
- IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i);
- if (tTileEntity != null)
- {
- FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false);
- if (tDrained != null)
- {
- int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false);
- if (tFilledAmount > 0) {
- tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true);
- }
- }
- }
+
+ public GT_MetaTileEntity_Boiler_Steel(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[5][17][];
+ for (byte i = -1; i < 16; i = (byte) (i + 1)) {
+ ITexture[] tmp0 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))};
+ rTextures[0][(i + 1)] = tmp0;
+ ITexture[] tmp1 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)};
+ rTextures[1][(i + 1)] = tmp1;
+ ITexture[] tmp2 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)};
+ rTextures[2][(i + 1)] = tmp2;
+ ITexture[] tmp4 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT)};
+ rTextures[3][(i + 1)] = tmp4;
+ ITexture[] tmp5 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE)};
+ rTextures[4][(i + 1)] = tmp5;
}
- }
- if (aTick % 10L == 0L) {
- if (this.mTemperature > 100)
- {
- if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0))
- {
- this.mHadNoWater = true;
- }
- else
- {
- if (this.mHadNoWater)
- {
- aBaseMetaTileEntity.doExplosion(2048L);
- return;
+ return rTextures;
+ }
+
+ public int maxProgresstime() {
+ return 1000;
+ }
+
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 32000);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SteelBoiler.png", 32000);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Boiler_Steel(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)) {
+ if (this.mTemperature <= 20) {
+ this.mTemperature = 20;
+ this.mLossTimer = 0;
}
- this.mFluid.amount -= 1;
- if (this.mSteam == null) {
- this.mSteam = GT_ModHandler.getSteam(150L);
- } else if (GT_ModHandler.isSteam(this.mSteam)) {
- this.mSteam.amount += 150;
- } else {
- this.mSteam = GT_ModHandler.getSteam(150L);
+ if (++this.mLossTimer > 40) {
+ this.mTemperature -= 1;
+ this.mLossTimer = 0;
}
- }
- }
- else {
- this.mHadNoWater = false;
- }
- }
- if ((this.mSteam != null) &&
- (this.mSteam.amount > 32000))
- {
- sendSound((byte)1);
- this.mSteam.amount = 24000;
- }
- if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) &&
- (this.mInventory[2] != null)) {
- if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Coal))))
- {
- this.mProcessingEnergy += 160;
- aBaseMetaTileEntity.decrStackSize(2, 1);
- if (aBaseMetaTileEntity.getRandomNumber(3) == 0) {
- aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L));
- }
- }
- else if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Charcoal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Charcoal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Charcoal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Charcoal))))
- {
- this.mProcessingEnergy += 160;
- aBaseMetaTileEntity.decrStackSize(2, 1);
- if (aBaseMetaTileEntity.getRandomNumber(3) == 0) {
- aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L));
- }
- }
- else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCoke"))
- {
- this.mProcessingEnergy += 640;
- aBaseMetaTileEntity.decrStackSize(2, 1);
- if (aBaseMetaTileEntity.getRandomNumber(2) == 0) {
- aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L));
- }
- }
- else if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Lignite))))
- {
- this.mProcessingEnergy += 120;
- aBaseMetaTileEntity.decrStackSize(2, 1);
- if (aBaseMetaTileEntity.getRandomNumber(8) == 0) {
- aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L));
- }
+ for (byte i = 1; (this.mSteam != null) && (i < 6); i = (byte) (i + 1)) {
+ if (i != aBaseMetaTileEntity.getFrontFacing()) {
+ IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i);
+ if (tTileEntity != null) {
+ FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false);
+ if (tDrained != null) {
+ int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false);
+ if (tFilledAmount > 0) {
+ tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true);
+ }
+ }
+ }
+ }
+ }
+ if (aTick % 10L == 0L) {
+ if (this.mTemperature > 100) {
+ if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0)) {
+ this.mHadNoWater = true;
+ } else {
+ if (this.mHadNoWater) {
+ aBaseMetaTileEntity.doExplosion(2048L);
+ return;
+ }
+ this.mFluid.amount -= 1;
+ if (this.mSteam == null) {
+ this.mSteam = GT_ModHandler.getSteam(150L);
+ } else if (GT_ModHandler.isSteam(this.mSteam)) {
+ this.mSteam.amount += 150;
+ } else {
+ this.mSteam = GT_ModHandler.getSteam(150L);
+ }
+ }
+ } else {
+ this.mHadNoWater = false;
+ }
+ }
+ if ((this.mSteam != null) &&
+ (this.mSteam.amount > 32000)) {
+ sendSound((byte) 1);
+ this.mSteam.amount = 24000;
+ }
+ if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) &&
+ (this.mInventory[2] != null)) {
+ if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Coal)))) {
+ this.mProcessingEnergy += 160;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ if (aBaseMetaTileEntity.getRandomNumber(3) == 0) {
+ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L));
+ }
+ } else if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Charcoal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Charcoal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Charcoal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Charcoal)))) {
+ this.mProcessingEnergy += 160;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ if (aBaseMetaTileEntity.getRandomNumber(3) == 0) {
+ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L));
+ }
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCoke")) {
+ this.mProcessingEnergy += 640;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ if (aBaseMetaTileEntity.getRandomNumber(2) == 0) {
+ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L));
+ }
+ } else if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Lignite)))) {
+ this.mProcessingEnergy += 120;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ if (aBaseMetaTileEntity.getRandomNumber(8) == 0) {
+ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L));
+ }
+ }
+ }
+ if ((this.mTemperature < 1000) && (this.mProcessingEnergy > 0) && (aTick % 12L == 0L)) {
+ this.mProcessingEnergy -= 2;
+ this.mTemperature += 1;
+ }
+ aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
}
- }
- if ((this.mTemperature < 1000) && (this.mProcessingEnergy > 0) && (aTick % 12L == 0L))
- {
- this.mProcessingEnergy -= 2;
- this.mTemperature += 1;
- }
- aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
}
- }
}
diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java
index 09c145d79e..ebc670f5e6 100644
--- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java
+++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java
@@ -5,122 +5,99 @@ import gregtech.api.GregTech_API;
import gregtech.api.enums.ConfigCategories;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.metatileentity.implementations.*;
-import gregtech.api.objects.GT_ArrayList;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator;
import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_Config;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_DieselGenerator
- extends GT_MetaTileEntity_BasicGenerator
-{
-
- public int mEfficiency;
- public boolean isOutputFacing(byte aSide)
- {
- return aSide == getBaseMetaTileEntity().getFrontFacing();
- }
-
- public GT_MetaTileEntity_DieselGenerator(int aID, String aName, String aNameRegional, int aTier)
- {
- super(aID, aName, aNameRegional, aTier, "Requires liquid Fuel", new ITexture[0]);
- onConfigLoad();
- }
-
- public GT_MetaTileEntity_DieselGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aTier, aDescription, aTextures);
- onConfigLoad();
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_DieselGenerator(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipes()
- {
- return GT_Recipe.GT_Recipe_Map.sDieselFuels;
- }
-
- public int getCapacity()
- {
- return 16000;
- }
-
- public void onConfigLoad()
- {
- this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "DieselGenerator.efficiency.tier."+this.mTier, (100 - this.mTier * 5));
-}
+ extends GT_MetaTileEntity_BasicGenerator {
+
+ public int mEfficiency;
+
+ public GT_MetaTileEntity_DieselGenerator(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, "Requires liquid Fuel", new ITexture[0]);
+ onConfigLoad();
+ }
+
+ public GT_MetaTileEntity_DieselGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ onConfigLoad();
+ }
+
+ public boolean isOutputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_DieselGenerator(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipes() {
+ return GT_Recipe.GT_Recipe_Map.sDieselFuels;
+ }
+
+ public int getCapacity() {
+ return 16000;
+ }
+
+ public void onConfigLoad() {
+ this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "DieselGenerator.efficiency.tier." + this.mTier, (100 - this.mTier * 5));
+ }
+
+ public int getEfficiency() {
+ return this.mEfficiency;
+ }
+
+ public int getFuelValue(ItemStack aStack) {
+ int rValue = Math.max(GT_ModHandler.getFuelCanValue(aStack) * 6 / 5, super.getFuelValue(aStack));
+ if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) {
+ rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3);
+ }
+ return rValue;
+ }
- public int getEfficiency()
- {
- return this.mEfficiency;
- }
-
- public int getFuelValue(ItemStack aStack)
- {
- int rValue = Math.max(GT_ModHandler.getFuelCanValue(aStack) * 6 / 5, super.getFuelValue(aStack));
- if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) {
- rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3);
- }
- return rValue;
- }
-
- public ITexture[] getFront(byte aColor)
- {
- return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] };
- }
-
- public ITexture[] getBack(byte aColor)
- {
- return new ITexture[] { super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK) };
- }
-
- public ITexture[] getBottom(byte aColor)
- {
- return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM) };
- }
-
- public ITexture[] getTop(byte aColor)
- {
- return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP) };
- }
-
- public ITexture[] getSides(byte aColor)
- {
- return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE) };
- }
-
- public ITexture[] getFrontActive(byte aColor)
- {
- return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] };
- }
-
- public ITexture[] getBackActive(byte aColor)
- {
- return new ITexture[] { super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK_ACTIVE) };
- }
-
- public ITexture[] getBottomActive(byte aColor)
- {
- return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM_ACTIVE) };
- }
-
- public ITexture[] getTopActive(byte aColor)
- {
- return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP_ACTIVE) };
- }
-
- public ITexture[] getSidesActive(byte aColor)
- {
- return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE) };
- }
+ public ITexture[] getFront(byte aColor) {
+ return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
+ }
+
+ public ITexture[] getBack(byte aColor) {
+ return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK)};
+ }
+
+ public ITexture[] getBottom(byte aColor) {
+ return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM)};
+ }
+
+ public ITexture[] getTop(byte aColor) {
+ return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP)};
+ }
+
+ public ITexture[] getSides(byte aColor) {
+ return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE)};
+ }
+
+ public ITexture[] getFrontActive(byte aColor) {
+ return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
+ }
+
+ public ITexture[] getBackActive(byte aColor) {
+ return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK_ACTIVE)};
+ }
+
+ public ITexture[] getBottomActive(byte aColor) {
+ return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM_ACTIVE)};
+ }
+
+ public ITexture[] getTopActive(byte aColor) {
+ return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP_ACTIVE)};
+ }
+
+ public ITexture[] getSidesActive(byte aColor) {
+ return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE)};
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_FluidNaquadahReactor.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_FluidNaquadahReactor.java
index fef02461b1..928c7261f7 100644
--- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_FluidNaquadahReactor.java
+++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_FluidNaquadahReactor.java
@@ -3,106 +3,88 @@ package gregtech.common.tileentities.generators;
import gregtech.api.GregTech_API;
import gregtech.api.enums.ConfigCategories;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
public class GT_MetaTileEntity_FluidNaquadahReactor
- extends GT_MetaTileEntity_BasicGenerator
-{
- public int mEfficiency;
- public boolean isOutputFacing(byte aSide)
- {
- return (aSide > 1) && (aSide != getBaseMetaTileEntity().getFrontFacing()) && (aSide != getBaseMetaTileEntity().getBackFacing());
- }
-
- public GT_MetaTileEntity_FluidNaquadahReactor(int aID, String aName, String aNameRegional, int aTier)
- {
- super(aID, aName, aNameRegional, aTier, "Requires Enriched Naquadah Cells", new ITexture[0]);onConfigLoad();
- }
-
- public GT_MetaTileEntity_FluidNaquadahReactor(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aTier, aDescription, aTextures);onConfigLoad();
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_FluidNaquadahReactor(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipes()
- {
- return GT_Recipe.GT_Recipe_Map.sFluidNaquadahReactorFuels;
- }
-
- public int getCapacity()
- {
- return 16000;
- }
-
- public int getEfficiency()
- {
- return mEfficiency;
- }
-
- public void onConfigLoad()
- {
- this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "FluidNaquadah.efficiency.tier."+this.mTier, 100);
-}
-
- public ITexture[] getFront(byte aColor)
- {
- return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_FRONT) };
- }
-
- public ITexture[] getBack(byte aColor)
- {
- return new ITexture[] { super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_BACK) };
- }
-
- public ITexture[] getBottom(byte aColor)
- {
- return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_BOTTOM) };
- }
-
- public ITexture[] getTop(byte aColor)
- {
- return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_TOP) };
- }
-
- public ITexture[] getSides(byte aColor)
- {
- return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE) };
- }
-
- public ITexture[] getFrontActive(byte aColor)
- {
- return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_FRONT_ACTIVE) };
- }
-
- public ITexture[] getBackActive(byte aColor)
- {
- return new ITexture[] { super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_BACK_ACTIVE) };
- }
-
- public ITexture[] getBottomActive(byte aColor)
- {
- return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_BOTTOM_ACTIVE) };
- }
-
- public ITexture[] getTopActive(byte aColor)
- {
- return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_TOP_ACTIVE) };
- }
-
- public ITexture[] getSidesActive(byte aColor)
- {
- return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE_ACTIVE) };
- }
+ extends GT_MetaTileEntity_BasicGenerator {
+ public int mEfficiency;
+
+ public GT_MetaTileEntity_FluidNaquadahReactor(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, "Requires Enriched Naquadah Cells", new ITexture[0]);
+ onConfigLoad();
+ }
+
+ public GT_MetaTileEntity_FluidNaquadahReactor(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ onConfigLoad();
+ }
+
+ public boolean isOutputFacing(byte aSide) {
+ return (aSide > 1) && (aSide != getBaseMetaTileEntity().getFrontFacing()) && (aSide != getBaseMetaTileEntity().getBackFacing());
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_FluidNaquadahReactor(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipes() {
+ return GT_Recipe.GT_Recipe_Map.sFluidNaquadahReactorFuels;
+ }
+
+ public int getCapacity() {
+ return 16000;
+ }
+
+ public int getEfficiency() {
+ return mEfficiency;
+ }
+
+ public void onConfigLoad() {
+ this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "FluidNaquadah.efficiency.tier." + this.mTier, 100);
+ }
+
+ public ITexture[] getFront(byte aColor) {
+ return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_FRONT)};
+ }
+
+ public ITexture[] getBack(byte aColor) {
+ return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_BACK)};
+ }
+
+ public ITexture[] getBottom(byte aColor) {
+ return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_BOTTOM)};
+ }
+
+ public ITexture[] getTop(byte aColor) {
+ return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_TOP)};
+ }
+
+ public ITexture[] getSides(byte aColor) {
+ return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE)};
+ }
+
+ public ITexture[] getFrontActive(byte aColor) {
+ return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_FRONT_ACTIVE)};
+ }
+
+ public ITexture[] getBackActive(byte aColor) {
+ return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_BACK_ACTIVE)};
+ }
+
+ public ITexture[] getBottomActive(byte aColor) {
+ return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_BOTTOM_ACTIVE)};
+ }
+
+ public ITexture[] getTopActive(byte aColor) {
+ return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_TOP_ACTIVE)};
+ }
+
+ public ITexture[] getSidesActive(byte aColor) {
+ return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE_ACTIVE)};
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java
index 6dc5a89b78..7002e56cee 100644
--- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java
+++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java
@@ -3,110 +3,90 @@ package gregtech.common.tileentities.generators;
import gregtech.api.GregTech_API;
import gregtech.api.enums.ConfigCategories;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
public class GT_MetaTileEntity_GasTurbine
- extends GT_MetaTileEntity_BasicGenerator
-{
-
- public int mEfficiency;
- public boolean isOutputFacing(byte aSide)
- {
- return aSide == getBaseMetaTileEntity().getFrontFacing();
- }
-
- public GT_MetaTileEntity_GasTurbine(int aID, String aName, String aNameRegional, int aTier)
- {
- super(aID, aName, aNameRegional, aTier, "Requires flammable Gasses", new ITexture[0]);
-onConfigLoad();
- }
-
- public GT_MetaTileEntity_GasTurbine(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aTier, aDescription, aTextures);
-onConfigLoad();
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_GasTurbine(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipes()
- {
- return GT_Recipe.GT_Recipe_Map.sTurbineFuels;
- }
-
- public int getCapacity()
- {
- return 16000;
- }
-
-public void onConfigLoad()
- {
- this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "GasTurbine.efficiency.tier."+this.mTier, (100 - this.mTier * 5));
-}
+ extends GT_MetaTileEntity_BasicGenerator {
+
+ public int mEfficiency;
+
+ public GT_MetaTileEntity_GasTurbine(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, "Requires flammable Gasses", new ITexture[0]);
+ onConfigLoad();
+ }
+
+ public GT_MetaTileEntity_GasTurbine(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ onConfigLoad();
+ }
+
+ public boolean isOutputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_GasTurbine(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipes() {
+ return GT_Recipe.GT_Recipe_Map.sTurbineFuels;
+ }
+
+ public int getCapacity() {
+ return 16000;
+ }
+
+ public void onConfigLoad() {
+ this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "GasTurbine.efficiency.tier." + this.mTier, (100 - this.mTier * 5));
+ }
+
+
+ public int getEfficiency() {
+ return this.mEfficiency;
+ }
+
+ public ITexture[] getFront(byte aColor) {
+ return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_FRONT), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
+ }
+
+ public ITexture[] getBack(byte aColor) {
+ return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_BACK)};
+ }
+
+ public ITexture[] getBottom(byte aColor) {
+ return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_BOTTOM)};
+ }
+
+ public ITexture[] getTop(byte aColor) {
+ return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_TOP)};
+ }
+
+ public ITexture[] getSides(byte aColor) {
+ return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_SIDE)};
+ }
+
+ public ITexture[] getFrontActive(byte aColor) {
+ return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_FRONT_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
+ }
+
+ public ITexture[] getBackActive(byte aColor) {
+ return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_BACK_ACTIVE)};
+ }
+
+ public ITexture[] getBottomActive(byte aColor) {
+ return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_BOTTOM_ACTIVE)};
+ }
+
+ public ITexture[] getTopActive(byte aColor) {
+ return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_TOP_ACTIVE)};
+ }
-
- public int getEfficiency()
- {
- return this.mEfficiency;
- }
-
- public ITexture[] getFront(byte aColor)
- {
- return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_FRONT), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] };
- }
-
- public ITexture[] getBack(byte aColor)
- {
- return new ITexture[] { super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_BACK) };
- }
-
- public ITexture[] getBottom(byte aColor)
- {
- return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_BOTTOM) };
- }
-
- public ITexture[] getTop(byte aColor)
- {
- return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_TOP) };
- }
-
- public ITexture[] getSides(byte aColor)
- {
- return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_SIDE) };
- }
-
- public ITexture[] getFrontActive(byte aColor)
- {
- return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_FRONT_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] };
- }
-
- public ITexture[] getBackActive(byte aColor)
- {
- return new ITexture[] { super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_BACK_ACTIVE) };
- }
-
- public ITexture[] getBottomActive(byte aColor)
- {
- return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_BOTTOM_ACTIVE) };
- }
-
- public ITexture[] getTopActive(byte aColor)
- {
- return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_TOP_ACTIVE) };
- }
-
- public ITexture[] getSidesActive(byte aColor)
- {
- return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_SIDE_ACTIVE) };
- }
+ public ITexture[] getSidesActive(byte aColor) {
+ return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_SIDE_ACTIVE)};
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java
index acfd218ab4..5007c9a907 100644
--- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java
+++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java
@@ -3,110 +3,90 @@ package gregtech.common.tileentities.generators;
import gregtech.api.GregTech_API;
import gregtech.api.enums.ConfigCategories;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
public class GT_MetaTileEntity_MagicEnergyConverter
- extends GT_MetaTileEntity_BasicGenerator
-{
-
- public int mEfficiency;
- public boolean isOutputFacing(byte aSide)
- {
- return aSide == getBaseMetaTileEntity().getFrontFacing();
- }
-
- public GT_MetaTileEntity_MagicEnergyConverter(int aID, String aName, String aNameRegional, int aTier)
- {
- super(aID, aName, aNameRegional, aTier, "Put your strange stuff in here", new ITexture[0]);
-onConfigLoad();
- }
-
- public GT_MetaTileEntity_MagicEnergyConverter(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aTier, aDescription, aTextures);
-onConfigLoad();
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_MagicEnergyConverter(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipes()
- {
- return GT_Recipe.GT_Recipe_Map.sMagicFuels;
- }
-
- public int getCapacity()
- {
- return 16000;
- }
-
-public void onConfigLoad()
- {
- this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyConverter.efficiency.tier."+this.mTier, 100-this.mTier*5);
-}
-
-
- public int getEfficiency()
- {
- return this.mEfficiency;
- }
-
- public ITexture[] getFront(byte aColor)
- {
- return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] };
- }
-
- public ITexture[] getBack(byte aColor)
- {
- return new ITexture[] { super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT) };
- }
-
- public ITexture[] getBottom(byte aColor)
- {
- return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) };
- }
-
- public ITexture[] getTop(byte aColor)
- {
- return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) };
- }
-
- public ITexture[] getSides(byte aColor)
- {
- return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) };
- }
-
- public ITexture[] getFrontActive(byte aColor)
- {
- return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] };
- }
-
- public ITexture[] getBackActive(byte aColor)
- {
- return new ITexture[] { super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT_ACTIVE) };
- }
-
- public ITexture[] getBottomActive(byte aColor)
- {
- return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) };
- }
-
- public ITexture[] getTopActive(byte aColor)
- {
- return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) };
- }
-
- public ITexture[] getSidesActive(byte aColor)
- {
- return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) };
- }
+ extends GT_MetaTileEntity_BasicGenerator {
+
+ public int mEfficiency;
+
+ public GT_MetaTileEntity_MagicEnergyConverter(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, "Put your strange stuff in here", new ITexture[0]);
+ onConfigLoad();
+ }
+
+ public GT_MetaTileEntity_MagicEnergyConverter(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ onConfigLoad();
+ }
+
+ public boolean isOutputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_MagicEnergyConverter(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipes() {
+ return GT_Recipe.GT_Recipe_Map.sMagicFuels;
+ }
+
+ public int getCapacity() {
+ return 16000;
+ }
+
+ public void onConfigLoad() {
+ this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyConverter.efficiency.tier." + this.mTier, 100 - this.mTier * 5);
+ }
+
+
+ public int getEfficiency() {
+ return this.mEfficiency;
+ }
+
+ public ITexture[] getFront(byte aColor) {
+ return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
+ }
+
+ public ITexture[] getBack(byte aColor) {
+ return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT)};
+ }
+
+ public ITexture[] getBottom(byte aColor) {
+ return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC)};
+ }
+
+ public ITexture[] getTop(byte aColor) {
+ return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC)};
+ }
+
+ public ITexture[] getSides(byte aColor) {
+ return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC)};
+ }
+
+ public ITexture[] getFrontActive(byte aColor) {
+ return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
+ }
+
+ public ITexture[] getBackActive(byte aColor) {
+ return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT_ACTIVE)};
+ }
+
+ public ITexture[] getBottomActive(byte aColor) {
+ return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE)};
+ }
+
+ public ITexture[] getTopActive(byte aColor) {
+ return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE)};
+ }
+
+ public ITexture[] getSidesActive(byte aColor) {
+ return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE)};
+ }
} \ No newline at end of file
diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java
index 2374ade4a3..5f452c6e00 100644
--- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java
+++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java
@@ -1,285 +1,286 @@
package gregtech.common.tileentities.generators;
-import java.util.ArrayList;
-
-import thaumcraft.api.aspects.Aspect;
-import thaumcraft.api.aspects.AspectList;
-import thaumcraft.api.aspects.IEssentiaContainerItem;
-import thaumcraft.api.visnet.VisNetHandler;
import cpw.mods.fml.common.Loader;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.enums.TC_Aspects;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Recipe;
import net.minecraft.block.Block;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.item.EntityEnderCrystal;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
-import net.minecraft.item.Item;
import net.minecraft.item.ItemEnchantedBook;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
+import thaumcraft.api.aspects.Aspect;
+import thaumcraft.api.aspects.AspectList;
+import thaumcraft.api.aspects.IEssentiaContainerItem;
+import thaumcraft.api.visnet.VisNetHandler;
+
+import java.util.ArrayList;
+
import static gregtech.api.enums.GT_Values.V;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.ConfigCategories;
-import gregtech.api.enums.TC_Aspects;
-import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_BasicGenerator {
- public int mEfficiency;
- public static boolean sAllowMultipleEggs = true;
- public static GT_MetaTileEntity_MagicalEnergyAbsorber mActiveSiphon = null;
- public static int sEnergyPerEnderCrystal = 32;
- public static int sEnergyFromVis = 12800;
- public static final ArrayList<EntityEnderCrystal> sUsedDragonCrystalList = new ArrayList();
- public EntityEnderCrystal mTargetedCrystal;
- public static int sDragonEggEnergyPerTick = 128;
- public static boolean isThaumcraftLoaded;
+ public static final ArrayList<EntityEnderCrystal> sUsedDragonCrystalList = new ArrayList();
+ public static boolean sAllowMultipleEggs = true;
+ public static GT_MetaTileEntity_MagicalEnergyAbsorber mActiveSiphon = null;
+ public static int sEnergyPerEnderCrystal = 32;
+ public static int sEnergyFromVis = 12800;
+ public static int sDragonEggEnergyPerTick = 128;
+ public static boolean isThaumcraftLoaded;
+ public int mEfficiency;
+ public EntityEnderCrystal mTargetedCrystal;
+
+ public GT_MetaTileEntity_MagicalEnergyAbsorber(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, "Feasts on magic close to it", new ITexture[0]);
+ onConfigLoad();
+ }
- public boolean isOutputFacing(byte aSide) {
- return aSide == getBaseMetaTileEntity().getFrontFacing();
- }
+ public GT_MetaTileEntity_MagicalEnergyAbsorber(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ onConfigLoad();
+ }
- public GT_MetaTileEntity_MagicalEnergyAbsorber(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, "Feasts on magic close to it", new ITexture[0]);
- onConfigLoad();
- }
+ public boolean isOutputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getFrontFacing();
+ }
- public GT_MetaTileEntity_MagicalEnergyAbsorber(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- onConfigLoad();
- }
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_MagicalEnergyAbsorber(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_MagicalEnergyAbsorber(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
+ public GT_Recipe.GT_Recipe_Map getRecipes() {
+ return GT_Recipe.GT_Recipe_Map.sMagicFuels;
+ }
- public GT_Recipe.GT_Recipe_Map getRecipes() {
- return GT_Recipe.GT_Recipe_Map.sMagicFuels;
- }
+ public int getCapacity() {
+ return 16000;
+ }
- public int getCapacity() {
- return 16000;
- }
+ public void onConfigLoad() {
+ this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.efficiency.tier." + this.mTier,
+ 100 - this.mTier * 10);
+ this.sAllowMultipleEggs = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.AllowMultipleEggs", false);
+ this.sEnergyPerEnderCrystal = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.EnergyPerTick.EnderCrystal", 32);
+ this.sEnergyFromVis = (GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.EnergyPerVisDivisor", 2500) * 10);
+ this.sDragonEggEnergyPerTick = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.EnergyPerTick", 2048);
+ this.isThaumcraftLoaded = Loader.isModLoaded("Thaumcraft");
+ }
- public void onConfigLoad() {
- this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.efficiency.tier." + this.mTier,
- 100 - this.mTier * 10);
- this.sAllowMultipleEggs = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.AllowMultipleEggs", false);
- this.sEnergyPerEnderCrystal = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.EnergyPerTick.EnderCrystal", 32);
- this.sEnergyFromVis = (GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.EnergyPerVisDivisor", 2500) * 10);
- this.sDragonEggEnergyPerTick = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.EnergyPerTick", 2048);
- this.isThaumcraftLoaded = Loader.isModLoaded("Thaumcraft");
- }
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork()
+ && aBaseMetaTileEntity.getUniversalEnergyStored() < maxEUOutput() + aBaseMetaTileEntity.getEUCapacity()) {
+ // Dragon Egg
+ if (hasEgg() && aTick % 10 == 0) {
+ getBaseMetaTileEntity().increaseStoredEnergyUnits(sDragonEggEnergyPerTick * getEfficiency() * 10, false);
+ if ((mActiveSiphon != this) && (!sAllowMultipleEggs)) {
+ if ((mActiveSiphon == null) || (mActiveSiphon.getBaseMetaTileEntity() == null)
+ || (mActiveSiphon.getBaseMetaTileEntity().isInvalidTileEntity()) || (!mActiveSiphon.hasEgg())) {
+ mActiveSiphon = this;
+ } else {
+ Block tEgg = mActiveSiphon.getBaseMetaTileEntity().getBlockOffset(0, 1, 0);
+ if (!getBaseMetaTileEntity().getWorld().getChunkFromBlockCoords(mActiveSiphon.getBaseMetaTileEntity().getXCoord(), mActiveSiphon.getBaseMetaTileEntity().getZCoord()).isChunkLoaded && (tEgg == Blocks.dragon_egg || tEgg.getUnlocalizedName().equals("tile.dragonEgg"))) {
+ getBaseMetaTileEntity().doExplosion(Integer.MAX_VALUE);
+ } else {
+ mActiveSiphon = this;
+ }
+ }
+ }
+ }
+ // Energyzed node
+ if (isThaumcraftLoaded) {
+ try {
+ World tmpWorld = this.getBaseMetaTileEntity().getWorld();
+ int tmpX = this.getBaseMetaTileEntity().getXCoord();
+ int tmpY = this.getBaseMetaTileEntity().getYCoord();
+ int tmpZ = this.getBaseMetaTileEntity().getZCoord();
+ int fire = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.FIRE, 1000);
+ int earth = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.EARTH, 1000);
+ int air = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.AIR, 1000);
+ int destruction = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.ENTROPY, 1000);
+ int order = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.ORDER, 1000);
+ int water = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.WATER, 1000);
+ int visEU = (int) (Math.pow(fire, 4) + Math.pow(earth, 4) + Math.pow(air, 4) + Math.pow(destruction, 4) + Math.pow(order, 4) + Math.pow(
+ water, 4));
+ int mult = 85;
+ if (fire > 4)
+ mult += 15;
+ if (earth > 4)
+ mult += 15;
+ if (air > 4)
+ mult += 15;
+ if (destruction > 4)
+ mult += 15;
+ if (order > 4)
+ mult += 15;
+ if (water > 4)
+ mult += 15;
+ visEU = (visEU * mult) / 100;
+ getBaseMetaTileEntity().increaseStoredEnergyUnits(Math.min(maxEUOutput(), visEU * getEfficiency() / this.sEnergyFromVis), false);
+ } catch (Throwable e) {
+ }
+ }
+ // EnderCrystal
+ if (sEnergyPerEnderCrystal > 0) {
+ if (this.mTargetedCrystal == null) {
+ ArrayList<EntityEnderCrystal> tList = (ArrayList) getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(
+ EntityEnderCrystal.class,
+ AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getXCoord() - 64, getBaseMetaTileEntity().getYCoord() - 64,
+ getBaseMetaTileEntity().getZCoord() - 64, getBaseMetaTileEntity().getXCoord() + 64,
+ getBaseMetaTileEntity().getYCoord() + 64, getBaseMetaTileEntity().getZCoord() + 64));
+ if ((tList != null) && (!tList.isEmpty())) {
+ tList.removeAll(sUsedDragonCrystalList);
+ if (tList.size() > 0) {
+ this.mTargetedCrystal = ((EntityEnderCrystal) tList.get(0));
+ if (this.mTargetedCrystal != null) {
+ sUsedDragonCrystalList.add(this.mTargetedCrystal);
+ }
+ }
+ }
+ } else if (this.mTargetedCrystal.isEntityAlive()) {
+ getBaseMetaTileEntity().increaseStoredEnergyUnits(sEnergyPerEnderCrystal * 10, false);
+ } else {
+ sUsedDragonCrystalList.remove(this.mTargetedCrystal);
+ this.mTargetedCrystal = null;
+ }
+ }
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork()
- && aBaseMetaTileEntity.getUniversalEnergyStored() < maxEUOutput() + aBaseMetaTileEntity.getEUCapacity()) {
- // Dragon Egg
- if (hasEgg() && aTick % 10 == 0) {
- getBaseMetaTileEntity().increaseStoredEnergyUnits(sDragonEggEnergyPerTick * getEfficiency() * 10, false);
- if ((mActiveSiphon != this) && (!sAllowMultipleEggs)) {
- if ((mActiveSiphon == null) || (mActiveSiphon.getBaseMetaTileEntity() == null)
- || (mActiveSiphon.getBaseMetaTileEntity().isInvalidTileEntity()) || (!mActiveSiphon.hasEgg())) {
- mActiveSiphon = this;
- } else {
- Block tEgg = mActiveSiphon.getBaseMetaTileEntity().getBlockOffset(0, 1, 0);
- if(!getBaseMetaTileEntity().getWorld().getChunkFromBlockCoords(mActiveSiphon.getBaseMetaTileEntity().getXCoord(), mActiveSiphon.getBaseMetaTileEntity().getZCoord()).isChunkLoaded&&(tEgg==Blocks.dragon_egg||tEgg.getUnlocalizedName().equals("tile.dragonEgg")))
- {getBaseMetaTileEntity().doExplosion(Integer.MAX_VALUE);}else{
- mActiveSiphon=this;
- }
- }
- }
- }
- // Energyzed node
- if (isThaumcraftLoaded) {
- try {
- World tmpWorld = this.getBaseMetaTileEntity().getWorld();
- int tmpX = this.getBaseMetaTileEntity().getXCoord();
- int tmpY = this.getBaseMetaTileEntity().getYCoord();
- int tmpZ = this.getBaseMetaTileEntity().getZCoord();
- int fire = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.FIRE, 1000);
- int earth = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.EARTH, 1000);
- int air = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.AIR, 1000);
- int destruction = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.ENTROPY, 1000);
- int order = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.ORDER, 1000);
- int water = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.WATER, 1000);
- int visEU = (int) (Math.pow(fire, 4) + Math.pow(earth, 4) + Math.pow(air, 4) + Math.pow(destruction, 4) + Math.pow(order, 4) + Math.pow(
- water, 4));
- int mult = 85;
- if (fire > 4)
- mult += 15;
- if (earth > 4)
- mult += 15;
- if (air > 4)
- mult += 15;
- if (destruction > 4)
- mult += 15;
- if (order > 4)
- mult += 15;
- if (water > 4)
- mult += 15;
- visEU = (visEU * mult) / 100;
- getBaseMetaTileEntity().increaseStoredEnergyUnits(Math.min(maxEUOutput(), visEU * getEfficiency() / this.sEnergyFromVis), false);
- } catch (Throwable e) {
- }
- }
- // EnderCrystal
- if (sEnergyPerEnderCrystal > 0) {
- if (this.mTargetedCrystal == null) {
- ArrayList<EntityEnderCrystal> tList = (ArrayList) getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(
- EntityEnderCrystal.class,
- AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getXCoord() - 64, getBaseMetaTileEntity().getYCoord() - 64,
- getBaseMetaTileEntity().getZCoord() - 64, getBaseMetaTileEntity().getXCoord() + 64,
- getBaseMetaTileEntity().getYCoord() + 64, getBaseMetaTileEntity().getZCoord() + 64));
- if ((tList != null) && (!tList.isEmpty())) {
- tList.removeAll(sUsedDragonCrystalList);
- if (tList.size() > 0) {
- this.mTargetedCrystal = ((EntityEnderCrystal) tList.get(0));
- if (this.mTargetedCrystal != null) {
- sUsedDragonCrystalList.add(this.mTargetedCrystal);
- }
- }
- }
- } else if (this.mTargetedCrystal.isEntityAlive()) {
- getBaseMetaTileEntity().increaseStoredEnergyUnits(sEnergyPerEnderCrystal * 10, false);
- } else {
- sUsedDragonCrystalList.remove(this.mTargetedCrystal);
- this.mTargetedCrystal = null;
- }
- }
+ // Absorb entchantments and TC essentia
+ try {
+ if ((this.mInventory[0] != null) && (this.mInventory[1] == null)) {
+ if (isThaumcraftLoaded && this.mInventory[0].getItem() instanceof IEssentiaContainerItem) {
+ AspectList tAspect = ((IEssentiaContainerItem) this.mInventory[0].getItem()).getAspects(this.mInventory[0]);
+ TC_Aspects tValue = TC_Aspects.valueOf(tAspect.getAspects()[0].getTag().toUpperCase());
+ int tEU = (tValue.mValue * tAspect.getAmount((Aspect) tValue.mAspect) * 100);
+ getBaseMetaTileEntity().increaseStoredEnergyUnits(tEU, true);
+ ItemStack tStack = this.mInventory[0].copy();
+ tStack.setTagCompound(null);
+ tStack.setItemDamage(0);
+ tStack.stackSize = 1;
+ this.mInventory[1] = tStack;
+ this.mInventory[0].stackSize--;
+ if (this.mInventory[0].stackSize < 1) {
+ this.mInventory[0] = null;
+ }
- // Absorb entchantments and TC essentia
- try {
- if ((this.mInventory[0] != null) && (this.mInventory[1] == null)) {
- if (isThaumcraftLoaded && this.mInventory[0].getItem() instanceof IEssentiaContainerItem) {
- AspectList tAspect = ((IEssentiaContainerItem) this.mInventory[0].getItem()).getAspects(this.mInventory[0]);
- TC_Aspects tValue = TC_Aspects.valueOf(tAspect.getAspects()[0].getTag().toUpperCase());
- int tEU = (tValue.mValue * tAspect.getAmount((Aspect) tValue.mAspect) * 100);
- getBaseMetaTileEntity().increaseStoredEnergyUnits(tEU, true);
- ItemStack tStack = this.mInventory[0].copy();
- tStack.setTagCompound(null);
- tStack.setItemDamage(0);
- tStack.stackSize = 1;
- this.mInventory[1] = tStack;
- this.mInventory[0].stackSize--;
- if (this.mInventory[0].stackSize < 1) {
- this.mInventory[0] = null;
- }
+ } else {
+ if ((this.mInventory[0].isItemEnchanted()) && (this.mInventory[0].getItem().getItemEnchantability() > 0)) {
+ NBTTagList tEnchantments = this.mInventory[0].getEnchantmentTagList();
+ if (tEnchantments != null) {
+ for (int i = 0; i < tEnchantments.tagCount(); i++) {
+ short tID = ((NBTTagCompound) tEnchantments.getCompoundTagAt(i)).getShort("id");
+ short tLevel = ((NBTTagCompound) tEnchantments.getCompoundTagAt(i)).getShort("lvl");
+ if ((tID > -1) && (tID < Enchantment.enchantmentsList.length)) {
+ Enchantment tEnchantment = Enchantment.enchantmentsList[tID];
+ if (tEnchantment != null) {
+ getBaseMetaTileEntity().increaseStoredEnergyUnits(
+ 1000000 * tLevel / (tEnchantment.getMaxLevel() * tEnchantment.getWeight()), true);
+ }
+ }
+ }
+ this.mInventory[0].stackTagCompound.removeTag("ench");
+ }
+ } else if ((this.mInventory[0].getItem() instanceof ItemEnchantedBook)) {
+ NBTTagList tEnchantments = ((ItemEnchantedBook) this.mInventory[0].getItem()).func_92110_g(this.mInventory[0]);
+ if (tEnchantments != null) {
+ for (int i = 0; i < tEnchantments.tagCount(); i++) {
+ short tID = ((NBTTagCompound) tEnchantments.getCompoundTagAt(i)).getShort("id");
+ short tLevel = ((NBTTagCompound) tEnchantments.getCompoundTagAt(i)).getShort("lvl");
+ if ((tID > -1) && (tID < Enchantment.enchantmentsBookList.length)) {
+ Enchantment tEnchantment = Enchantment.enchantmentsBookList[tID];
+ if (tEnchantment != null) {
+ getBaseMetaTileEntity().increaseStoredEnergyUnits(
+ 1000000 * tLevel / (tEnchantment.getMaxLevel() * tEnchantment.getWeight()), true);
+ }
+ }
+ }
+ this.mInventory[0] = new ItemStack(Items.book, 1);
+ }
+ }
+ this.mInventory[1] = this.mInventory[0];
+ this.mInventory[0] = null;
+ }
+ }
+ } catch (Throwable e) {
+ }
+ }
+ }
- } else {
- if ((this.mInventory[0].isItemEnchanted()) && (this.mInventory[0].getItem().getItemEnchantability() > 0)) {
- NBTTagList tEnchantments = this.mInventory[0].getEnchantmentTagList();
- if (tEnchantments != null) {
- for (int i = 0; i < tEnchantments.tagCount(); i++) {
- short tID = ((NBTTagCompound) tEnchantments.getCompoundTagAt(i)).getShort("id");
- short tLevel = ((NBTTagCompound) tEnchantments.getCompoundTagAt(i)).getShort("lvl");
- if ((tID > -1) && (tID < Enchantment.enchantmentsList.length)) {
- Enchantment tEnchantment = Enchantment.enchantmentsList[tID];
- if (tEnchantment != null) {
- getBaseMetaTileEntity().increaseStoredEnergyUnits(
- 1000000 * tLevel / (tEnchantment.getMaxLevel() * tEnchantment.getWeight()), true);
- }
- }
- }
- this.mInventory[0].stackTagCompound.removeTag("ench");
- }
- } else if ((this.mInventory[0].getItem() instanceof ItemEnchantedBook)) {
- NBTTagList tEnchantments = ((ItemEnchantedBook) this.mInventory[0].getItem()).func_92110_g(this.mInventory[0]);
- if (tEnchantments != null) {
- for (int i = 0; i < tEnchantments.tagCount(); i++) {
- short tID = ((NBTTagCompound) tEnchantments.getCompoundTagAt(i)).getShort("id");
- short tLevel = ((NBTTagCompound) tEnchantments.getCompoundTagAt(i)).getShort("lvl");
- if ((tID > -1) && (tID < Enchantment.enchantmentsBookList.length)) {
- Enchantment tEnchantment = Enchantment.enchantmentsBookList[tID];
- if (tEnchantment != null) {
- getBaseMetaTileEntity().increaseStoredEnergyUnits(
- 1000000 * tLevel / (tEnchantment.getMaxLevel() * tEnchantment.getWeight()), true);
- }
- }
- }
- this.mInventory[0] = new ItemStack(Items.book, 1);
- }
- }
- this.mInventory[1] = this.mInventory[0];
- this.mInventory[0] = null;
- }
- }
- } catch (Throwable e) {
- }
- }
- }
+ public void inValidate() {
+ if (mActiveSiphon == this) {
+ mActiveSiphon = null;
+ }
+ }
- public void inValidate() {
- if (mActiveSiphon == this) {
- mActiveSiphon = null;
- }
- }
+ public boolean hasEgg() {
+ Block above = getBaseMetaTileEntity().getBlockOffset(0, 1, 0);
+ if (above == null || Blocks.air == above) {
+ return false;
+ }
+ return Blocks.dragon_egg == above || above.getUnlocalizedName().equals("tile.dragonEgg");
+ }
- public boolean hasEgg() {
- Block above = getBaseMetaTileEntity().getBlockOffset(0, 1, 0);
- if (above == null || Blocks.air == above) {
- return false;
- }
- return Blocks.dragon_egg == above || above.getUnlocalizedName().equals("tile.dragonEgg");
- }
+ public int getEfficiency() {
+ return this.mEfficiency;
+ }
- public int getEfficiency() {
- return this.mEfficiency;
- }
-
- @Override public long maxEUStore(){return Math.max(getEUVar(), V[mTier] * 16000 + getMinimumStoredEU());}
+ @Override
+ public long maxEUStore() {
+ return Math.max(getEUVar(), V[mTier] * 16000 + getMinimumStoredEU());
+ }
- public ITexture[] getFront(byte aColor) {
- return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC),
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] };
- }
+ public ITexture[] getFront(byte aColor) {
+ return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC),
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
+ }
- public ITexture[] getBack(byte aColor) {
- return new ITexture[] { super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT) };
- }
+ public ITexture[] getBack(byte aColor) {
+ return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT)};
+ }
- public ITexture[] getBottom(byte aColor) {
- return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) };
- }
+ public ITexture[] getBottom(byte aColor) {
+ return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC)};
+ }
- public ITexture[] getTop(byte aColor) {
- return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_DRAGONEGG) };
- }
+ public ITexture[] getTop(byte aColor) {
+ return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_DRAGONEGG)};
+ }
- public ITexture[] getSides(byte aColor) {
- return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) };
- }
+ public ITexture[] getSides(byte aColor) {
+ return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC)};
+ }
- public ITexture[] getFrontActive(byte aColor) {
- return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE),
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] };
- }
+ public ITexture[] getFrontActive(byte aColor) {
+ return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE),
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
+ }
- public ITexture[] getBackActive(byte aColor) {
- return new ITexture[] { super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT_ACTIVE) };
- }
+ public ITexture[] getBackActive(byte aColor) {
+ return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT_ACTIVE)};
+ }
- public ITexture[] getBottomActive(byte aColor) {
- return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) };
- }
+ public ITexture[] getBottomActive(byte aColor) {
+ return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE)};
+ }
- public ITexture[] getTopActive(byte aColor) {
- return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_DRAGONEGG) };
- }
+ public ITexture[] getTopActive(byte aColor) {
+ return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_DRAGONEGG)};
+ }
- public ITexture[] getSidesActive(byte aColor) {
- return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) };
- }
+ public ITexture[] getSidesActive(byte aColor) {
+ return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE)};
+ }
} \ No newline at end of file
diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java
index c547432901..020369e3f2 100644
--- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java
+++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java
@@ -3,110 +3,90 @@ package gregtech.common.tileentities.generators;
import gregtech.api.GregTech_API;
import gregtech.api.enums.ConfigCategories;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
public class GT_MetaTileEntity_PlasmaGenerator
- extends GT_MetaTileEntity_BasicGenerator
-{
-
- public int mEfficiency;
- public boolean isOutputFacing(byte aSide)
- {
- return aSide == getBaseMetaTileEntity().getFrontFacing();
- }
-
- public GT_MetaTileEntity_PlasmaGenerator(int aID, String aName, String aNameRegional, int aTier)
- {
- super(aID, aName, aNameRegional, aTier, "Plasma into energy", new ITexture[0]);
-onConfigLoad();
- }
-
- public GT_MetaTileEntity_PlasmaGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aTier, aDescription, aTextures);
-onConfigLoad();
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_PlasmaGenerator(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipes()
- {
- return GT_Recipe.GT_Recipe_Map.sPlasmaFuels;
- }
-
- public int getCapacity()
- {
- return 16000;
- }
-
-public void onConfigLoad()
- {
- this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "PlasmaGenerator.efficiency.tier."+this.mTier, (10 + (this.mTier * 10)));
-}
-
-
- public int getEfficiency()
- {
- return this.mEfficiency;
- }
-
- public ITexture[] getFront(byte aColor)
- {
- return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] };
- }
-
- public ITexture[] getBack(byte aColor)
- {
- return new ITexture[] { super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS) };
- }
-
- public ITexture[] getBottom(byte aColor)
- {
- return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS) };
- }
-
- public ITexture[] getTop(byte aColor)
- {
- return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS) };
- }
-
- public ITexture[] getSides(byte aColor)
- {
- return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS) };
- }
-
- public ITexture[] getFrontActive(byte aColor)
- {
- return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] };
- }
-
- public ITexture[] getBackActive(byte aColor)
- {
- return new ITexture[] { super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) };
- }
-
- public ITexture[] getBottomActive(byte aColor)
- {
- return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) };
- }
-
- public ITexture[] getTopActive(byte aColor)
- {
- return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) };
- }
-
- public ITexture[] getSidesActive(byte aColor)
- {
- return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) };
- }
+ extends GT_MetaTileEntity_BasicGenerator {
+
+ public int mEfficiency;
+
+ public GT_MetaTileEntity_PlasmaGenerator(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, "Plasma into energy", new ITexture[0]);
+ onConfigLoad();
+ }
+
+ public GT_MetaTileEntity_PlasmaGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ onConfigLoad();
+ }
+
+ public boolean isOutputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_PlasmaGenerator(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipes() {
+ return GT_Recipe.GT_Recipe_Map.sPlasmaFuels;
+ }
+
+ public int getCapacity() {
+ return 16000;
+ }
+
+ public void onConfigLoad() {
+ this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "PlasmaGenerator.efficiency.tier." + this.mTier, (10 + (this.mTier * 10)));
+ }
+
+
+ public int getEfficiency() {
+ return this.mEfficiency;
+ }
+
+ public ITexture[] getFront(byte aColor) {
+ return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
+ }
+
+ public ITexture[] getBack(byte aColor) {
+ return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)};
+ }
+
+ public ITexture[] getBottom(byte aColor) {
+ return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)};
+ }
+
+ public ITexture[] getTop(byte aColor) {
+ return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)};
+ }
+
+ public ITexture[] getSides(byte aColor) {
+ return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)};
+ }
+
+ public ITexture[] getFrontActive(byte aColor) {
+ return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
+ }
+
+ public ITexture[] getBackActive(byte aColor) {
+ return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW)};
+ }
+
+ public ITexture[] getBottomActive(byte aColor) {
+ return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW)};
+ }
+
+ public ITexture[] getTopActive(byte aColor) {
+ return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW)};
+ }
+
+ public ITexture[] getSidesActive(byte aColor) {
+ return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW)};
+ }
} \ No newline at end of file
diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SolidNaquadahReactor.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SolidNaquadahReactor.java
index ef569485d5..faf47c1937 100644
--- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SolidNaquadahReactor.java
+++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SolidNaquadahReactor.java
@@ -3,106 +3,88 @@ package gregtech.common.tileentities.generators;
import gregtech.api.GregTech_API;
import gregtech.api.enums.ConfigCategories;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
public class GT_MetaTileEntity_SolidNaquadahReactor
- extends GT_MetaTileEntity_BasicGenerator
-{
- public int mEfficiency;
- public boolean isOutputFacing(byte aSide)
- {
- return (aSide > 1) && (aSide != getBaseMetaTileEntity().getFrontFacing()) && (aSide != getBaseMetaTileEntity().getBackFacing());
- }
-
- public GT_MetaTileEntity_SolidNaquadahReactor(int aID, String aName, String aNameRegional, int aTier)
- {
- super(aID, aName, aNameRegional, aTier, "Requires Enriched Naquadah Bolts", new ITexture[0]);onConfigLoad();
- }
-
- public GT_MetaTileEntity_SolidNaquadahReactor(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aTier, aDescription, aTextures);onConfigLoad();
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_SolidNaquadahReactor(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipes()
- {
- return GT_Recipe.GT_Recipe_Map.sSmallNaquadahReactorFuels;
- }
-
- public int getCapacity()
- {
- return 0;
- }
-
- public int getEfficiency()
- {
- return mEfficiency;
- }
-
- public void onConfigLoad()
- {
- this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "SolidNaquadah.efficiency.tier."+this.mTier, 80);
-}
-
- public ITexture[] getFront(byte aColor)
- {
- return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT) };
- }
-
- public ITexture[] getBack(byte aColor)
- {
- return new ITexture[] { super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_BACK) };
- }
-
- public ITexture[] getBottom(byte aColor)
- {
- return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_BOTTOM) };
- }
-
- public ITexture[] getTop(byte aColor)
- {
- return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP) };
- }
-
- public ITexture[] getSides(byte aColor)
- {
- return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_SIDE) };
- }
-
- public ITexture[] getFrontActive(byte aColor)
- {
- return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE) };
- }
-
- public ITexture[] getBackActive(byte aColor)
- {
- return new ITexture[] { super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_BACK_ACTIVE) };
- }
-
- public ITexture[] getBottomActive(byte aColor)
- {
- return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_BOTTOM_ACTIVE) };
- }
-
- public ITexture[] getTopActive(byte aColor)
- {
- return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE) };
- }
-
- public ITexture[] getSidesActive(byte aColor)
- {
- return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_SIDE_ACTIVE) };
- }
+ extends GT_MetaTileEntity_BasicGenerator {
+ public int mEfficiency;
+
+ public GT_MetaTileEntity_SolidNaquadahReactor(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, "Requires Enriched Naquadah Bolts", new ITexture[0]);
+ onConfigLoad();
+ }
+
+ public GT_MetaTileEntity_SolidNaquadahReactor(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ onConfigLoad();
+ }
+
+ public boolean isOutputFacing(byte aSide) {
+ return (aSide > 1) && (aSide != getBaseMetaTileEntity().getFrontFacing()) && (aSide != getBaseMetaTileEntity().getBackFacing());
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_SolidNaquadahReactor(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipes() {
+ return GT_Recipe.GT_Recipe_Map.sSmallNaquadahReactorFuels;
+ }
+
+ public int getCapacity() {
+ return 0;
+ }
+
+ public int getEfficiency() {
+ return mEfficiency;
+ }
+
+ public void onConfigLoad() {
+ this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "SolidNaquadah.efficiency.tier." + this.mTier, 80);
+ }
+
+ public ITexture[] getFront(byte aColor) {
+ return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT)};
+ }
+
+ public ITexture[] getBack(byte aColor) {
+ return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_BACK)};
+ }
+
+ public ITexture[] getBottom(byte aColor) {
+ return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_BOTTOM)};
+ }
+
+ public ITexture[] getTop(byte aColor) {
+ return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP)};
+ }
+
+ public ITexture[] getSides(byte aColor) {
+ return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_SIDE)};
+ }
+
+ public ITexture[] getFrontActive(byte aColor) {
+ return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE)};
+ }
+
+ public ITexture[] getBackActive(byte aColor) {
+ return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_BACK_ACTIVE)};
+ }
+
+ public ITexture[] getBottomActive(byte aColor) {
+ return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_BOTTOM_ACTIVE)};
+ }
+
+ public ITexture[] getTopActive(byte aColor) {
+ return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE)};
+ }
+
+ public ITexture[] getSidesActive(byte aColor) {
+ return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_SIDE_ACTIVE)};
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java
index d0f3890237..0ee3bdc726 100644
--- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java
+++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java
@@ -3,7 +3,6 @@ package gregtech.common.tileentities.generators;
import gregtech.api.GregTech_API;
import gregtech.api.enums.ConfigCategories;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
@@ -11,99 +10,98 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenera
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_SteamTurbine extends GT_MetaTileEntity_BasicGenerator {
- public int mEfficiency;
-
- public boolean isOutputFacing(byte aSide) {
- return aSide == getBaseMetaTileEntity().getFrontFacing();
- }
-
- public GT_MetaTileEntity_SteamTurbine(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, "Requires Steam to run", new ITexture[0]);
- onConfigLoad();
- }
-
- public GT_MetaTileEntity_SteamTurbine(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- onConfigLoad();
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_SteamTurbine(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipes() {
- return null;
- }
-
- @Override
- public String[] getDescription() {
- return new String[] {mDescription, "Fuel Efficiency: " + (600/getEfficiency()) + "%"};
- }
-
- public int getCapacity() {
- return 24000 * this.mTier;
- }
-
- public void onConfigLoad() {
- this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "SteamTurbine.efficiency.tier." + this.mTier,6+this.mTier);
- }
-
- public int getEfficiency() {
- return this.mEfficiency;
- }
-
- public int getFuelValue(FluidStack aLiquid) {
- return GT_ModHandler.isSteam(aLiquid) ? 3 : 0;
- }
-
- public int consumedFluidPerOperation(FluidStack aLiquid) {
- return this.mEfficiency;
- }
-
- public ITexture[] getFront(byte aColor) {
- return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_FRONT),
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] };
- }
-
- public ITexture[] getBack(byte aColor) {
- return new ITexture[] { super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BACK) };
- }
-
- public ITexture[] getBottom(byte aColor) {
- return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BOTTOM) };
- }
-
- public ITexture[] getTop(byte aColor) {
- return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_TOP) };
- }
-
- public ITexture[] getSides(byte aColor) {
- return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_SIDE) };
- }
-
- public ITexture[] getFrontActive(byte aColor) {
- return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_FRONT_ACTIVE),
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] };
- }
-
- public ITexture[] getBackActive(byte aColor) {
- return new ITexture[] { super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BACK_ACTIVE) };
- }
-
- public ITexture[] getBottomActive(byte aColor) {
- return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BOTTOM_ACTIVE) };
- }
-
- public ITexture[] getTopActive(byte aColor) {
- return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_TOP_ACTIVE) };
- }
-
- public ITexture[] getSidesActive(byte aColor) {
- return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_SIDE_ACTIVE) };
- }
+ public int mEfficiency;
+
+ public GT_MetaTileEntity_SteamTurbine(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, "Requires Steam to run", new ITexture[0]);
+ onConfigLoad();
+ }
+
+ public GT_MetaTileEntity_SteamTurbine(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ onConfigLoad();
+ }
+
+ public boolean isOutputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_SteamTurbine(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipes() {
+ return null;
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[]{mDescription, "Fuel Efficiency: " + (600 / getEfficiency()) + "%"};
+ }
+
+ public int getCapacity() {
+ return 24000 * this.mTier;
+ }
+
+ public void onConfigLoad() {
+ this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "SteamTurbine.efficiency.tier." + this.mTier, 6 + this.mTier);
+ }
+
+ public int getEfficiency() {
+ return this.mEfficiency;
+ }
+
+ public int getFuelValue(FluidStack aLiquid) {
+ return GT_ModHandler.isSteam(aLiquid) ? 3 : 0;
+ }
+
+ public int consumedFluidPerOperation(FluidStack aLiquid) {
+ return this.mEfficiency;
+ }
+
+ public ITexture[] getFront(byte aColor) {
+ return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_FRONT),
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
+ }
+
+ public ITexture[] getBack(byte aColor) {
+ return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BACK)};
+ }
+
+ public ITexture[] getBottom(byte aColor) {
+ return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BOTTOM)};
+ }
+
+ public ITexture[] getTop(byte aColor) {
+ return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_TOP)};
+ }
+
+ public ITexture[] getSides(byte aColor) {
+ return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_SIDE)};
+ }
+
+ public ITexture[] getFrontActive(byte aColor) {
+ return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_FRONT_ACTIVE),
+ Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
+ }
+
+ public ITexture[] getBackActive(byte aColor) {
+ return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BACK_ACTIVE)};
+ }
+
+ public ITexture[] getBottomActive(byte aColor) {
+ return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BOTTOM_ACTIVE)};
+ }
+
+ public ITexture[] getTopActive(byte aColor) {
+ return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_TOP_ACTIVE)};
+ }
+
+ public ITexture[] getSidesActive(byte aColor) {
+ return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_SIDE_ACTIVE)};
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java
index 9ee2253cf9..74f49df8a9 100644
--- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java
+++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java
@@ -2,7 +2,6 @@ package gregtech.common.tileentities.machines;
import gregtech.api.enums.Dyes;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -10,32 +9,26 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_N
import gregtech.api.objects.GT_RenderedTexture;
public class GT_MetaTileEntity_BasicHull_Bronze
- extends GT_MetaTileEntity_BasicHull_NonElectric
-{
- public GT_MetaTileEntity_BasicHull_Bronze(int aID, String aName, String aNameRegional, int aTier, String aDescription)
- {
- super(aID, aName, aNameRegional, aTier, aDescription);
- }
-
- public GT_MetaTileEntity_BasicHull_Bronze(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aTier, aDescription, aTextures);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_BasicHull_Bronze(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- public ITexture[][][] getTextureSet(ITexture[] aTextures)
- {
- ITexture[][][] rTextures = new ITexture[3][17][];
- for (byte i = -1; i < 16; i = (byte)(i + 1))
- {
- rTextures[0][(i + 1)] = new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZE_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
- rTextures[1][(i + 1)] = new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZE_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
- rTextures[2][(i + 1)] = new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZE_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
+ extends GT_MetaTileEntity_BasicHull_NonElectric {
+ public GT_MetaTileEntity_BasicHull_Bronze(int aID, String aName, String aNameRegional, int aTier, String aDescription) {
+ super(aID, aName, aNameRegional, aTier, aDescription);
+ }
+
+ public GT_MetaTileEntity_BasicHull_Bronze(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_BasicHull_Bronze(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[3][17][];
+ for (byte i = -1; i < 16; i = (byte) (i + 1)) {
+ rTextures[0][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZE_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))};
+ rTextures[1][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZE_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa))};
+ rTextures[2][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZE_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa))};
+ }
+ return rTextures;
}
- return rTextures;
- }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java
index 3d8812661b..2382a41ecb 100644
--- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java
+++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java
@@ -1,7 +1,7 @@
package gregtech.common.tileentities.machines;
-import gregtech.api.enums.*;
-import gregtech.api.enums.Textures.BlockIcons;
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -9,34 +9,29 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_N
import gregtech.api.objects.GT_RenderedTexture;
public class GT_MetaTileEntity_BasicHull_BronzeBricks
- extends GT_MetaTileEntity_BasicHull_NonElectric
-{
- public GT_MetaTileEntity_BasicHull_BronzeBricks(int aID, String aName, String aNameRegional, int aTier, String aDescription)
- {
- super(aID, aName, aNameRegional, aTier, aDescription);
- }
-
- public GT_MetaTileEntity_BasicHull_BronzeBricks(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aTier, aDescription, aTextures);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_BasicHull_BronzeBricks(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- public ITexture[][][] getTextureSet(ITexture[] aTextures)
- {
- ITexture[][][] rTextures = new ITexture[3][17][];
- for (byte i = -1; i < 16; i = (byte)(i + 1))
- {ITexture[] tmp0 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
- rTextures[0][(i + 1)] = tmp0;
- ITexture[] tmp1 = { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
-rTextures[1][(i + 1)] =tmp1;
- ITexture[] tmp2 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
-rTextures[2][(i + 1)] = tmp2;
+ extends GT_MetaTileEntity_BasicHull_NonElectric {
+ public GT_MetaTileEntity_BasicHull_BronzeBricks(int aID, String aName, String aNameRegional, int aTier, String aDescription) {
+ super(aID, aName, aNameRegional, aTier, aDescription);
+ }
+
+ public GT_MetaTileEntity_BasicHull_BronzeBricks(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_BasicHull_BronzeBricks(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[3][17][];
+ for (byte i = -1; i < 16; i = (byte) (i + 1)) {
+ ITexture[] tmp0 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))};
+ rTextures[0][(i + 1)] = tmp0;
+ ITexture[] tmp1 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa))};
+ rTextures[1][(i + 1)] = tmp1;
+ ITexture[] tmp2 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa))};
+ rTextures[2][(i + 1)] = tmp2;
+ }
+ return rTextures;
}
- return rTextures;
- }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java
index 00e4481d9d..e1395d59d7 100644
--- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java
+++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java
@@ -2,7 +2,6 @@ package gregtech.common.tileentities.machines;
import gregtech.api.enums.Dyes;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -10,34 +9,29 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_N
import gregtech.api.objects.GT_RenderedTexture;
public class GT_MetaTileEntity_BasicHull_Steel
- extends GT_MetaTileEntity_BasicHull_NonElectric
-{
- public GT_MetaTileEntity_BasicHull_Steel(int aID, String aName, String aNameRegional, int aTier, String aDescription)
- {
- super(aID, aName, aNameRegional, aTier, aDescription);
- }
-
- public GT_MetaTileEntity_BasicHull_Steel(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aTier, aDescription, aTextures);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_BasicHull_Steel(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- public ITexture[][][] getTextureSet(ITexture[] aTextures)
- {
- ITexture[][][] rTextures = new ITexture[3][17][];
- for (byte i = -1; i < 16; i = (byte)(i + 1))
- {ITexture[] tmp0 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
- rTextures[0][(i + 1)] = tmp0;
- ITexture[] tmp1 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
-rTextures[1][(i + 1)] = tmp1;
- ITexture[] tmp2 = { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
-rTextures[2][(i + 1)] =tmp2;
+ extends GT_MetaTileEntity_BasicHull_NonElectric {
+ public GT_MetaTileEntity_BasicHull_Steel(int aID, String aName, String aNameRegional, int aTier, String aDescription) {
+ super(aID, aName, aNameRegional, aTier, aDescription);
+ }
+
+ public GT_MetaTileEntity_BasicHull_Steel(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_BasicHull_Steel(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[3][17][];
+ for (byte i = -1; i < 16; i = (byte) (i + 1)) {
+ ITexture[] tmp0 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))};
+ rTextures[0][(i + 1)] = tmp0;
+ ITexture[] tmp1 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa))};
+ rTextures[1][(i + 1)] = tmp1;
+ ITexture[] tmp2 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa))};
+ rTextures[2][(i + 1)] = tmp2;
+ }
+ return rTextures;
}
- return rTextures;
- }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java
index 8107961725..f8e35fdc55 100644
--- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java
+++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java
@@ -2,7 +2,6 @@ package gregtech.common.tileentities.machines;
import gregtech.api.enums.Dyes;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -10,34 +9,29 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_N
import gregtech.api.objects.GT_RenderedTexture;
public class GT_MetaTileEntity_BasicHull_SteelBricks
- extends GT_MetaTileEntity_BasicHull_NonElectric
-{
- public GT_MetaTileEntity_BasicHull_SteelBricks(int aID, String aName, String aNameRegional, int aTier, String aDescription)
- {
- super(aID, aName, aNameRegional, aTier, aDescription);
- }
-
- public GT_MetaTileEntity_BasicHull_SteelBricks(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aTier, aDescription, aTextures);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_BasicHull_SteelBricks(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- public ITexture[][][] getTextureSet(ITexture[] aTextures)
- {
- ITexture[][][] rTextures = new ITexture[3][17][];
- for (byte i = -1; i < 16; i = (byte)(i + 1))
- {ITexture[] tmp0 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
- rTextures[0][(i + 1)] = tmp0;
- ITexture[] tmp1 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
-rTextures[1][(i + 1)] = tmp1;
- ITexture[] tmp2 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
-rTextures[2][(i + 1)] = tmp2;
+ extends GT_MetaTileEntity_BasicHull_NonElectric {
+ public GT_MetaTileEntity_BasicHull_SteelBricks(int aID, String aName, String aNameRegional, int aTier, String aDescription) {
+ super(aID, aName, aNameRegional, aTier, aDescription);
+ }
+
+ public GT_MetaTileEntity_BasicHull_SteelBricks(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_BasicHull_SteelBricks(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[3][17][];
+ for (byte i = -1; i < 16; i = (byte) (i + 1)) {
+ ITexture[] tmp0 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))};
+ rTextures[0][(i + 1)] = tmp0;
+ ITexture[] tmp1 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa))};
+ rTextures[1][(i + 1)] = tmp1;
+ ITexture[] tmp2 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa))};
+ rTextures[2][(i + 1)] = tmp2;
+ }
+ return rTextures;
}
- return rTextures;
- }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java
index b7a1f3cc02..a869ad8d3a 100644
--- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java
+++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java
@@ -1,9 +1,7 @@
package gregtech.common.tileentities.machines.basic;
-import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
@@ -11,98 +9,91 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachin
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_Boxinator
- extends GT_MetaTileEntity_BasicMachine
-{
- public GT_MetaTileEntity_Boxinator(int aID, String aName, String aNameRegional, int aTier)
- {
- super(aID, aName, aNameRegional, aTier, 1, "Puts things into Boxes", 2, 1, "Packager.png", "", new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_BOXINATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_BOXINATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_BOXINATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_BOXINATOR) });
- }
-
- public GT_MetaTileEntity_Boxinator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName)
- {
- super(aName, aTier, 1, aDescription, aTextures, 2, 1, aGUIName, aNEIName);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_Boxinator(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipeList()
- {
- return GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes;
- }
-
- public int checkRecipe()
- {
- int tCheck = super.checkRecipe();
- if (tCheck != 0) {
- return tCheck;
+ extends GT_MetaTileEntity_BasicMachine {
+ public GT_MetaTileEntity_Boxinator(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 1, "Puts things into Boxes", 2, 1, "Packager.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_BOXINATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_BOXINATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_BOXINATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_BOXINATOR)});
}
- if ((GT_Utility.isStackValid(getInputAt(0))) && (GT_Utility.isStackValid(getInputAt(1))) && (GT_Utility.getContainerItem(getInputAt(0), true) == null))
- {
- if ((ItemList.Schematic_1by1.isStackEqual(getInputAt(1))) && (getInputAt(0).stackSize >= 1))
- {
- this.mOutputItems[0] = GT_ModHandler.getRecipeOutput(new ItemStack[] { getInputAt(0) });
- if (this.mOutputItems[0] != null) {
- if (canOutput(new ItemStack[] { this.mOutputItems[0] }))
- {
- getInputAt(0).stackSize -= 1;
- this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
- this.mMaxProgresstime = (16 / (1 << this.mTier - 1));
- return 2;
- }
- }
- return 0;
- }
- if ((ItemList.Schematic_2by2.isStackEqual(getInputAt(1))) && (getInputAt(0).stackSize >= 4))
- {
- this.mOutputItems[0] = GT_ModHandler.getRecipeOutput(new ItemStack[] { getInputAt(0), getInputAt(0), null, getInputAt(0), getInputAt(0) });
- if (this.mOutputItems[0] != null) {
- if (canOutput(new ItemStack[] { this.mOutputItems[0] }))
- {
- getInputAt(0).stackSize -= 4;
- this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
- this.mMaxProgresstime = (32 / (1 << this.mTier - 1));
- return 2;
- }
+
+ public GT_MetaTileEntity_Boxinator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
+ super(aName, aTier, 1, aDescription, aTextures, 2, 1, aGUIName, aNEIName);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Boxinator(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeList() {
+ return GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes;
+ }
+
+ public int checkRecipe() {
+ int tCheck = super.checkRecipe();
+ if (tCheck != 0) {
+ return tCheck;
}
- return 0;
- }
- if ((ItemList.Schematic_3by3.isStackEqual(getInputAt(1))) && (getInputAt(0).stackSize >= 9))
- {
- this.mOutputItems[0] = GT_ModHandler.getRecipeOutput(new ItemStack[] { getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0) });
- if (this.mOutputItems[0] != null) {
- if (canOutput(new ItemStack[] { this.mOutputItems[0] }))
- {
- getInputAt(0).stackSize -= 9;
- this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
- this.mMaxProgresstime = (64 / (1 << this.mTier - 1));
- return 2;
- }
+ if ((GT_Utility.isStackValid(getInputAt(0))) && (GT_Utility.isStackValid(getInputAt(1))) && (GT_Utility.getContainerItem(getInputAt(0), true) == null)) {
+ if ((ItemList.Schematic_1by1.isStackEqual(getInputAt(1))) && (getInputAt(0).stackSize >= 1)) {
+ this.mOutputItems[0] = GT_ModHandler.getRecipeOutput(new ItemStack[]{getInputAt(0)});
+ if (this.mOutputItems[0] != null) {
+ if (canOutput(new ItemStack[]{this.mOutputItems[0]})) {
+ getInputAt(0).stackSize -= 1;
+ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ this.mMaxProgresstime = (16 / (1 << this.mTier - 1));
+ return 2;
+ }
+ }
+ return 0;
+ }
+ if ((ItemList.Schematic_2by2.isStackEqual(getInputAt(1))) && (getInputAt(0).stackSize >= 4)) {
+ this.mOutputItems[0] = GT_ModHandler.getRecipeOutput(new ItemStack[]{getInputAt(0), getInputAt(0), null, getInputAt(0), getInputAt(0)});
+ if (this.mOutputItems[0] != null) {
+ if (canOutput(new ItemStack[]{this.mOutputItems[0]})) {
+ getInputAt(0).stackSize -= 4;
+ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ this.mMaxProgresstime = (32 / (1 << this.mTier - 1));
+ return 2;
+ }
+ }
+ return 0;
+ }
+ if ((ItemList.Schematic_3by3.isStackEqual(getInputAt(1))) && (getInputAt(0).stackSize >= 9)) {
+ this.mOutputItems[0] = GT_ModHandler.getRecipeOutput(new ItemStack[]{getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0)});
+ if (this.mOutputItems[0] != null) {
+ if (canOutput(new ItemStack[]{this.mOutputItems[0]})) {
+ getInputAt(0).stackSize -= 9;
+ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ this.mMaxProgresstime = (64 / (1 << this.mTier - 1));
+ return 2;
+ }
+ }
+ return 0;
+ }
}
return 0;
- }
}
- return 0;
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
- {
- if (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack))
- {
- if ((ItemList.Schematic_1by1.isStackEqual(getInputAt(1))) || (ItemList.Schematic_2by2.isStackEqual(getInputAt(1))) || (ItemList.Schematic_3by3.isStackEqual(getInputAt(1)))) {
- if(GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.findRecipe(getBaseMetaTileEntity(), true, gregtech.api.enums.GT_Values.V[this.mTier], null, new ItemStack[] { GT_Utility.copyAmount(64L, new Object[] { aStack }), getInputAt(1) }) != null){return true;}
- if(ItemList.Schematic_1by1.isStackEqual(getInputAt(1))&&GT_ModHandler.getRecipeOutput(new ItemStack[] { aStack })!=null)return true;
- if(ItemList.Schematic_2by2.isStackEqual(getInputAt(1))&&GT_ModHandler.getRecipeOutput(new ItemStack[] { aStack, aStack, null, aStack, aStack })!=null){return true;}
- if(ItemList.Schematic_3by3.isStackEqual(getInputAt(1))&&(GT_ModHandler.getRecipeOutput(new ItemStack[] { aStack,aStack,aStack,aStack,aStack,aStack,aStack,aStack,aStack })!=null)){return true;}
- }else{return GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.containsInput(aStack);}
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ if (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {
+ if ((ItemList.Schematic_1by1.isStackEqual(getInputAt(1))) || (ItemList.Schematic_2by2.isStackEqual(getInputAt(1))) || (ItemList.Schematic_3by3.isStackEqual(getInputAt(1)))) {
+ if (GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.findRecipe(getBaseMetaTileEntity(), true, gregtech.api.enums.GT_Values.V[this.mTier], null, new ItemStack[]{GT_Utility.copyAmount(64L, new Object[]{aStack}), getInputAt(1)}) != null) {
+ return true;
+ }
+ if (ItemList.Schematic_1by1.isStackEqual(getInputAt(1)) && GT_ModHandler.getRecipeOutput(new ItemStack[]{aStack}) != null)
+ return true;
+ if (ItemList.Schematic_2by2.isStackEqual(getInputAt(1)) && GT_ModHandler.getRecipeOutput(new ItemStack[]{aStack, aStack, null, aStack, aStack}) != null) {
+ return true;
+ }
+ if (ItemList.Schematic_3by3.isStackEqual(getInputAt(1)) && (GT_ModHandler.getRecipeOutput(new ItemStack[]{aStack, aStack, aStack, aStack, aStack, aStack, aStack, aStack, aStack}) != null)) {
+ return true;
+ }
+ } else {
+ return GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.containsInput(aStack);
+ }
+ }
+ return false;
}
- return false;
- }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Charger.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Charger.java
index 8504cf3197..8937dfbcf5 100644
--- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Charger.java
+++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Charger.java
@@ -1,6 +1,5 @@
package gregtech.common.tileentities.machines.basic;
-import static gregtech.api.enums.GT_Values.V;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -9,71 +8,73 @@ import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicBatteryBuffer;
import gregtech.api.util.GT_ModHandler;
+import static gregtech.api.enums.GT_Values.V;
+
public class GT_MetaTileEntity_Charger extends GT_MetaTileEntity_BasicBatteryBuffer {
- public GT_MetaTileEntity_Charger(int aID, String aName, String aNameRegional, int aTier, String aDescription, int aSlotCount) {
- super(aID, aName, aNameRegional, aTier, aDescription, aSlotCount);
- }
+ public GT_MetaTileEntity_Charger(int aID, String aName, String aNameRegional, int aTier, String aDescription, int aSlotCount) {
+ super(aID, aName, aNameRegional, aTier, aDescription, aSlotCount);
+ }
+
+ public GT_MetaTileEntity_Charger(String aName, int aTier, String aDescription, ITexture[][][] aTextures, int aSlotCount) {
+ super(aName, aTier, aDescription, aTextures, aSlotCount);
+ }
- public GT_MetaTileEntity_Charger(String aName, int aTier, String aDescription, ITexture[][][] aTextures, int aSlotCount) {
- super(aName, aTier, aDescription, aTextures, aSlotCount);
- }
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Charger(mName, mTier, mDescription, mTextures, mInventory.length);
+ }
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Charger(mName, mTier, mDescription, mTextures, mInventory.length);
- }
-
- @Override
- public long getMinimumStoredEU() {
- return V[mTier] * 64 * mInventory.length;
- }
+ @Override
+ public long getMinimumStoredEU() {
+ return V[mTier] * 64 * mInventory.length;
+ }
- @Override
- public long maxEUStore() {
- return V[mTier] * 256 * mInventory.length;
- }
+ @Override
+ public long maxEUStore() {
+ return V[mTier] * 256 * mInventory.length;
+ }
- @Override
- public long maxAmperesIn() {
- return mChargeableCount * 8;
- }
+ @Override
+ public long maxAmperesIn() {
+ return mChargeableCount * 8;
+ }
- @Override
- public long maxAmperesOut() {
- return mBatteryCount * 4;
- }
+ @Override
+ public long maxAmperesOut() {
+ return mBatteryCount * 4;
+ }
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (aBaseMetaTileEntity.isServerSide()) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
- if (this.getBaseMetaTileEntity() instanceof BaseMetaTileEntity) {
- BaseMetaTileEntity mBaseMetaTileEntity = (BaseMetaTileEntity) getBaseMetaTileEntity();
- if (mBaseMetaTileEntity.getMetaTileEntity() instanceof MetaTileEntity) {
- MetaTileEntity mMetaTileEntity = (MetaTileEntity) mBaseMetaTileEntity.getMetaTileEntity();
- //for (int t = 0; t < 6; t++) {
- if (mMetaTileEntity.dechargerSlotCount() > 0 && mBaseMetaTileEntity.getStoredEU() < mBaseMetaTileEntity.getEUCapacity()) {
- for (int i = mMetaTileEntity.dechargerSlotStartIndex(), k = mMetaTileEntity.dechargerSlotCount() + i; i < k; i++) {
- if (mMetaTileEntity.mInventory[i] != null && mBaseMetaTileEntity.getStoredEU() < mBaseMetaTileEntity.getEUCapacity()) {
- mBaseMetaTileEntity.increaseStoredEnergyUnits(GT_ModHandler.dischargeElectricItem(mMetaTileEntity.mInventory[i], (int)Math.min(V[mTier]*15, mBaseMetaTileEntity.getEUCapacity() - mBaseMetaTileEntity.getStoredEU()), (int)Math.min(Integer.MAX_VALUE, mMetaTileEntity.getInputTier()), true, false, false), true);
- if (mMetaTileEntity.mInventory[i].stackSize <= 0)
- mMetaTileEntity.mInventory[i] = null;
- }
- }
- }
- if (mMetaTileEntity.rechargerSlotCount() > 0 && mBaseMetaTileEntity.getStoredEU() > 0) {
- for (int i = mMetaTileEntity.rechargerSlotStartIndex(), k = mMetaTileEntity.rechargerSlotCount() + i; i < k; i++) {
- if (mBaseMetaTileEntity.getStoredEU() > 0 && mMetaTileEntity.mInventory[i] != null) {
- mBaseMetaTileEntity.decreaseStoredEU(GT_ModHandler.chargeElectricItem(mMetaTileEntity.mInventory[i], (int)Math.min(V[this.mTier]*15, mBaseMetaTileEntity.getStoredEU()), (int)Math.min(Integer.MAX_VALUE, mMetaTileEntity.getOutputTier()), true, false), true);
- if (mMetaTileEntity.mInventory[i].stackSize <= 0)
- mMetaTileEntity.mInventory[i] = null;
- }
- }
- //}
- }
- }
- }
- }
- }
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ if (this.getBaseMetaTileEntity() instanceof BaseMetaTileEntity) {
+ BaseMetaTileEntity mBaseMetaTileEntity = (BaseMetaTileEntity) getBaseMetaTileEntity();
+ if (mBaseMetaTileEntity.getMetaTileEntity() instanceof MetaTileEntity) {
+ MetaTileEntity mMetaTileEntity = (MetaTileEntity) mBaseMetaTileEntity.getMetaTileEntity();
+ //for (int t = 0; t < 6; t++) {
+ if (mMetaTileEntity.dechargerSlotCount() > 0 && mBaseMetaTileEntity.getStoredEU() < mBaseMetaTileEntity.getEUCapacity()) {
+ for (int i = mMetaTileEntity.dechargerSlotStartIndex(), k = mMetaTileEntity.dechargerSlotCount() + i; i < k; i++) {
+ if (mMetaTileEntity.mInventory[i] != null && mBaseMetaTileEntity.getStoredEU() < mBaseMetaTileEntity.getEUCapacity()) {
+ mBaseMetaTileEntity.increaseStoredEnergyUnits(GT_ModHandler.dischargeElectricItem(mMetaTileEntity.mInventory[i], (int) Math.min(V[mTier] * 15, mBaseMetaTileEntity.getEUCapacity() - mBaseMetaTileEntity.getStoredEU()), (int) Math.min(Integer.MAX_VALUE, mMetaTileEntity.getInputTier()), true, false, false), true);
+ if (mMetaTileEntity.mInventory[i].stackSize <= 0)
+ mMetaTileEntity.mInventory[i] = null;
+ }
+ }
+ }
+ if (mMetaTileEntity.rechargerSlotCount() > 0 && mBaseMetaTileEntity.getStoredEU() > 0) {
+ for (int i = mMetaTileEntity.rechargerSlotStartIndex(), k = mMetaTileEntity.rechargerSlotCount() + i; i < k; i++) {
+ if (mBaseMetaTileEntity.getStoredEU() > 0 && mMetaTileEntity.mInventory[i] != null) {
+ mBaseMetaTileEntity.decreaseStoredEU(GT_ModHandler.chargeElectricItem(mMetaTileEntity.mInventory[i], (int) Math.min(V[this.mTier] * 15, mBaseMetaTileEntity.getStoredEU()), (int) Math.min(Integer.MAX_VALUE, mMetaTileEntity.getOutputTier()), true, false), true);
+ if (mMetaTileEntity.mInventory[i].stackSize <= 0)
+ mMetaTileEntity.mInventory[i] = null;
+ }
+ }
+ //}
+ }
+ }
+ }
+ }
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java
index 8be43c1b94..a9c4299edd 100644
--- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java
+++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java
@@ -1,7 +1,6 @@
package gregtech.common.tileentities.machines.basic;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
@@ -12,54 +11,44 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
public class GT_MetaTileEntity_Disassembler
- extends GT_MetaTileEntity_BasicMachine
-{
- public GT_MetaTileEntity_Disassembler(int aID, String aName, String aNameRegional, int aTier)
- {
- super(aID, aName, aNameRegional, aTier, 1, "Disassembles Machines at " + (50 + 10 * aTier) + "% Efficiency", 1, 9, "Disassembler.png", "", new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_DISASSEMBLER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_DISASSEMBLER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_DISASSEMBLER) });
- }
-
- public GT_MetaTileEntity_Disassembler(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName)
- {
- super(aName, aTier, 1, aDescription, aTextures, 1, 9, aGUIName, aNEIName);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_Disassembler(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
- }
-
- public int checkRecipe()
- {
- if ((getInputAt(0) != null) && (isOutputEmpty()))
- {
- NBTTagCompound tNBT = getInputAt(0).getTagCompound();
- if (tNBT != null)
- {
- tNBT = tNBT.getCompoundTag("GT.CraftingComponents");
- if (tNBT != null)
- {
- getInputAt(0).stackSize -= 1;
- this.mEUt = (16 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
- this.mMaxProgresstime = 80;
- for (int i = 0; i < this.mOutputItems.length; i++) {
- if (getBaseMetaTileEntity().getRandomNumber(100) < 50 + 10 * this.mTier)
- {
- this.mOutputItems[i] = GT_Utility.loadItem(tNBT, "Ingredient." + i);
- if (this.mOutputItems[i] != null) {
- this.mMaxProgresstime *= 1.7;
- }
+ extends GT_MetaTileEntity_BasicMachine {
+ public GT_MetaTileEntity_Disassembler(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 1, "Disassembles Machines at " + (50 + 10 * aTier) + "% Efficiency", 1, 9, "Disassembler.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_DISASSEMBLER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_DISASSEMBLER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_DISASSEMBLER)});
+ }
+
+ public GT_MetaTileEntity_Disassembler(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
+ super(aName, aTier, 1, aDescription, aTextures, 1, 9, aGUIName, aNEIName);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Disassembler(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
+ }
+
+ public int checkRecipe() {
+ if ((getInputAt(0) != null) && (isOutputEmpty())) {
+ NBTTagCompound tNBT = getInputAt(0).getTagCompound();
+ if (tNBT != null) {
+ tNBT = tNBT.getCompoundTag("GT.CraftingComponents");
+ if (tNBT != null) {
+ getInputAt(0).stackSize -= 1;
+ this.mEUt = (16 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ this.mMaxProgresstime = 80;
+ for (int i = 0; i < this.mOutputItems.length; i++) {
+ if (getBaseMetaTileEntity().getRandomNumber(100) < 50 + 10 * this.mTier) {
+ this.mOutputItems[i] = GT_Utility.loadItem(tNBT, "Ingredient." + i);
+ if (this.mOutputItems[i] != null) {
+ this.mMaxProgresstime *= 1.7;
+ }
+ }
+ }
+ return 2;
+ }
}
- }
- return 2;
}
- }
+ return 0;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (aStack.getTagCompound() != null) && (aStack.getTagCompound().getCompoundTag("GT.CraftingComponents") != null);
}
- return 0;
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
- {
- return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (aStack.getTagCompound() != null) && (aStack.getTagCompound().getCompoundTag("GT.CraftingComponents") != null);
- }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java
index 292014245b..030eca8984 100644
--- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java
+++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java
@@ -1,11 +1,9 @@
package gregtech.common.tileentities.machines.basic;
-import static gregtech.api.enums.GT_Values.V;
import gregtech.api.enums.ConfigCategories;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
@@ -14,68 +12,67 @@ import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Config;
import net.minecraftforge.fluids.FluidStack;
+import static gregtech.api.enums.GT_Values.V;
+
public class GT_MetaTileEntity_Massfabricator
- extends GT_MetaTileEntity_BasicMachine
-{
- public static int sUUAperUUM = 1;
- public static int sUUASpeedBonus = 4;
- public static int sDurationMultiplier = 3215;
- public static boolean sRequiresUUA = false;
-
- public GT_MetaTileEntity_Massfabricator(int aID, String aName, String aNameRegional, int aTier)
- {
- super(aID, aName, aNameRegional, aTier, 1, "UUM = Matter * Fabrication Squared", 1, 1, "Massfabricator.png", "", new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_MASSFAB), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB) });
- }
-
- public GT_MetaTileEntity_Massfabricator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName)
- {
- super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_Massfabricator(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
- }
-
- public void onConfigLoad(GT_Config aConfig)
- {
- super.onConfigLoad(aConfig);
- sDurationMultiplier = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUM_Duration_Multiplier", sDurationMultiplier);
- sUUAperUUM = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_per_UUM", sUUAperUUM);
- sUUASpeedBonus = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Speed_Bonus", sUUASpeedBonus);
- sRequiresUUA = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Requirement", sRequiresUUA);
- Materials.UUAmplifier.mChemicalFormula = ("Mass Fabricator Eff/Speed Bonus: x" + sUUASpeedBonus);
- }
-
-@Override public long maxAmperesIn(){return 10;}
-@Override public long maxEUStore() {return V[mTier]*512;}
-
- public int checkRecipe()
- {
- FluidStack tFluid = getDrainableStack();
- if ((tFluid == null) || (tFluid.amount < getCapacity()))
- {
- this.mOutputFluid = Materials.UUMatter.getFluid(1L);
- this.mEUt = ((int)gregtech.api.enums.GT_Values.V[this.mTier])*8;
- this.mMaxProgresstime = (sDurationMultiplier / (1 << (this.mTier*2) - 2));
- if (((tFluid = getFillableStack()) != null) && (tFluid.amount >= sUUAperUUM) && (tFluid.isFluidEqual(Materials.UUAmplifier.getFluid(1L))))
- {
- tFluid.amount -= sUUAperUUM;
- this.mMaxProgresstime /= sUUASpeedBonus;
- return 2;
- }
- return (sRequiresUUA) || (ItemList.Circuit_Integrated.isStackEqual(getInputAt(0), true, true)) ? 1 : 2;
+ extends GT_MetaTileEntity_BasicMachine {
+ public static int sUUAperUUM = 1;
+ public static int sUUASpeedBonus = 4;
+ public static int sDurationMultiplier = 3215;
+ public static boolean sRequiresUUA = false;
+
+ public GT_MetaTileEntity_Massfabricator(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 1, "UUM = Matter * Fabrication Squared", 1, 1, "Massfabricator.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_MASSFAB), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB)});
+ }
+
+ public GT_MetaTileEntity_Massfabricator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
+ super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Massfabricator(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
+ }
+
+ public void onConfigLoad(GT_Config aConfig) {
+ super.onConfigLoad(aConfig);
+ sDurationMultiplier = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUM_Duration_Multiplier", sDurationMultiplier);
+ sUUAperUUM = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_per_UUM", sUUAperUUM);
+ sUUASpeedBonus = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Speed_Bonus", sUUASpeedBonus);
+ sRequiresUUA = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Requirement", sRequiresUUA);
+ Materials.UUAmplifier.mChemicalFormula = ("Mass Fabricator Eff/Speed Bonus: x" + sUUASpeedBonus);
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return 10;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return V[mTier] * 512;
+ }
+
+ public int checkRecipe() {
+ FluidStack tFluid = getDrainableStack();
+ if ((tFluid == null) || (tFluid.amount < getCapacity())) {
+ this.mOutputFluid = Materials.UUMatter.getFluid(1L);
+ this.mEUt = ((int) gregtech.api.enums.GT_Values.V[this.mTier]) * 8;
+ this.mMaxProgresstime = (sDurationMultiplier / (1 << (this.mTier * 2) - 2));
+ if (((tFluid = getFillableStack()) != null) && (tFluid.amount >= sUUAperUUM) && (tFluid.isFluidEqual(Materials.UUAmplifier.getFluid(1L)))) {
+ tFluid.amount -= sUUAperUUM;
+ this.mMaxProgresstime /= sUUASpeedBonus;
+ return 2;
+ }
+ return (sRequiresUUA) || (ItemList.Circuit_Integrated.isStackEqual(getInputAt(0), true, true)) ? 1 : 2;
+ }
+ return 0;
+ }
+
+ public boolean isFluidInputAllowed(FluidStack aFluid) {
+ return aFluid.isFluidEqual(Materials.UUAmplifier.getFluid(1L));
+ }
+
+ public int getCapacity() {
+ return Math.max(sUUAperUUM, 1000);
}
- return 0;
- }
-
- public boolean isFluidInputAllowed(FluidStack aFluid)
- {
- return aFluid.isFluidEqual(Materials.UUAmplifier.getFluid(1L));
- }
-
- public int getCapacity()
- {
- return Math.max(sUUAperUUM, 1000);
- }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java
index 11489dfa56..de0a468582 100644
--- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java
+++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java
@@ -1,296 +1,331 @@
-
package gregtech.common.tileentities.machines.basic;
-import static gregtech.api.enums.GT_Values.V;
-import net.minecraft.client.particle.EntityFX;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityHanging;
-import net.minecraft.entity.EntityLiving;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.boss.EntityDragonPart;
-import net.minecraft.entity.effect.EntityWeatherEffect;
-import net.minecraft.entity.item.EntityBoat;
-import net.minecraft.entity.item.EntityEnderCrystal;
-import net.minecraft.entity.item.EntityEnderEye;
-import net.minecraft.entity.item.EntityFireworkRocket;
-import net.minecraft.entity.item.EntityItem;
-import net.minecraft.entity.item.EntityMinecart;
-import net.minecraft.entity.item.EntityTNTPrimed;
-import net.minecraft.entity.item.EntityXPOrb;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.entity.projectile.EntityArrow;
-import net.minecraft.entity.projectile.EntityFireball;
-import net.minecraft.entity.projectile.EntityFishHook;
-import net.minecraft.entity.projectile.EntityThrowable;
-import net.minecraft.init.Blocks;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.AxisAlignedBB;
-import net.minecraft.world.World;
-import net.minecraftforge.common.DimensionManager;
-import net.minecraftforge.fluids.FluidStack;
import gregtech.api.enums.ConfigCategories;
import gregtech.api.enums.Materials;
import gregtech.api.enums.Textures;
-import gregtech.api.gui.GT_Container_MultiMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IEnergyConnected;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Config;
import gregtech.api.util.GT_Utility;
import gregtech.common.gui.GT_Container_MicrowaveEnergyTransmitter;
-import gregtech.common.gui.GT_Container_Teleporter;
-import gregtech.common.gui.GT_GUIContainer_FusionReactor;
import gregtech.common.gui.GT_GUIContainer_MicrowaveEnergyTransmitter;
-import gregtech.common.gui.GT_GUIContainer_Teleporter;
-
-public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEntity_BasicTank{
-
- public int mTargetX = 0;
- public int mTargetY = 0;
- public int mTargetZ = 0;
- public int mTargetD = 0;
- public boolean mDebug = false;
- public boolean hasEgg = false;
- public static boolean sInterDimensionalTeleportAllowed = true;
- public int mMaxLoss = 50;
- public int mMaxLossDistance = 10000;
- public boolean mPassiveEnergyUse = true;
-
- public GT_MetaTileEntity_MicrowaveEnergyTransmitter(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 3, "Transmits Energy wireless");
- }
-
- public GT_MetaTileEntity_MicrowaveEnergyTransmitter(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, 3, aDescription, aTextures);
- }
-
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) return true;
- this.hasEgg = checkForEgg();
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
-
- @Override
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_MicrowaveEnergyTransmitter(aPlayerInventory, aBaseMetaTileEntity);
- }
-
-
- @Override
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_MicrowaveEnergyTransmitter(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_MicrowaveEnergyTransmitter(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- public String[] getInfoData()
- {
- return new String[] { "Coordinates:", "X: " + this.mTargetX, "Y: " + this.mTargetY, "Z: " + this.mTargetZ, "Dimension: " + this.mTargetD };
- }
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1], (aSide == 0) ? null : aActive ? new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE) : new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER) };
- }
-
-
- public void saveNBTData(NBTTagCompound aNBT)
- {
- if (mFluid != null) aNBT.setTag("mFluid", mFluid.writeToNBT(new NBTTagCompound()));
- aNBT.setInteger("mTargetX", this.mTargetX);
- aNBT.setInteger("mTargetY", this.mTargetY);
- aNBT.setInteger("mTargetZ", this.mTargetZ);
- aNBT.setInteger("mTargetD", this.mTargetD);
- aNBT.setBoolean("mDebug", this.mDebug);
- }
-
- public void loadNBTData(NBTTagCompound aNBT)
- {
- mFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid"));
- this.mTargetX = aNBT.getInteger("mTargetX");
- this.mTargetY = aNBT.getInteger("mTargetY");
- this.mTargetZ = aNBT.getInteger("mTargetZ");
- this.mTargetD = aNBT.getInteger("mTargetD");
- this.mDebug = aNBT.getBoolean("mDebug");
- }
-
- public void onConfigLoad(GT_Config aConfig)
- {
- sInterDimensionalTeleportAllowed = aConfig.get(ConfigCategories.machineconfig, "Teleporter.Interdimensional", true);
- mMaxLoss = Math.max(aConfig.get(ConfigCategories.machineconfig, "MicrowaveTransmitter.MaxLoss",50),11);
- mMaxLossDistance = aConfig.get(ConfigCategories.machineconfig, "MicrowaveTransmitter.MaxLossDistance",10000);
- mPassiveEnergyUse = aConfig.get(ConfigCategories.machineconfig, "MicrowaveTransmitter.PassiveEnergy",true);
- }
-
- public void onFirstTick()
- {
- if (getBaseMetaTileEntity().isServerSide())
- {
- if ((this.mTargetX == 0) && (this.mTargetY == 0) && (this.mTargetZ == 0) && (this.mTargetD == 0))
- {
- this.mTargetX = getBaseMetaTileEntity().getXCoord();
- this.mTargetY = getBaseMetaTileEntity().getYCoord();
- this.mTargetZ = getBaseMetaTileEntity().getZCoord();
- this.mTargetD = getBaseMetaTileEntity().getWorld().provider.dimensionId;
- }
- this.hasEgg = checkForEgg();
- }
- }
-
- public boolean checkForEgg()
- {
- for (byte i = -5; i <= 5; i = (byte)(i + 1)) {
- for (byte j = -5; j <= 5; j = (byte)(j + 1)) {
- for (byte k = -5; k <= 5; k = (byte)(k + 1)) {
- if (getBaseMetaTileEntity().getBlockOffset(i, j, k) == Blocks.dragon_egg) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- public boolean hasDimensionalTeleportCapability()
- {
- return (this.mDebug) || (this.hasEgg) || (mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1))&&mFluid.amount>=1000);
- }
-
- public boolean isDimensionalTeleportAvailable()
- {
- return (this.mDebug) || ((hasDimensionalTeleportCapability()) && (GT_Utility.isRealDimension(this.mTargetD)) && (GT_Utility.isRealDimension(getBaseMetaTileEntity().getWorld().provider.dimensionId)));
- }
-
- public int tTargetX = 0;
- public int tTargetY = 0;
- public int tTargetZ = 0;
- public int tTargetD = 0;
- public TileEntity tTile = null;
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if(mFluid==null){
- mFluid=Materials.Nitrogen.getPlasma(0);
- }
- super.onPostTick(aBaseMetaTileEntity, aTick);
- if (getBaseMetaTileEntity().isServerSide())
- {
- if (getBaseMetaTileEntity().getTimer() % 100L == 50L) {
- this.hasEgg = checkForEgg();
- }
- if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().getRedstone()))
- {
- if(getBaseMetaTileEntity().getStoredEU()>(V[mTier]*16)){
- if(mPassiveEnergyUse){getBaseMetaTileEntity().decreaseStoredEnergyUnits((long) Math.pow(2, mTier), false);}
- if(hasDimensionalTeleportCapability()&&this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId&&mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1))){
- mFluid.amount--;
- if(mFluid.amount<1){mFluid=null;}
- }
- if(tTargetD!=mTargetD||tTargetX!=mTargetX||tTargetY!=mTargetY||tTargetZ!=mTargetZ){
- tTargetD=mTargetD;
- tTargetX=mTargetX;
- tTargetY=mTargetY;
- tTargetZ=mTargetZ;
- if(this.mTargetD == getBaseMetaTileEntity().getWorld().provider.dimensionId){
- tTile = getBaseMetaTileEntity().getTileEntity(this.mTargetX, this.mTargetY, this.mTargetZ);}else{
- World tWorld = DimensionManager.getWorld(this.mTargetD);
- if(tWorld!=null){
- tTile = tWorld.getTileEntity(this.mTargetX, this.mTargetY, this.mTargetZ);
- }
- }
- }
- int tDistance = distanceCalculation();
- long tEnergyTrans = Math.min(V[mTier], getBaseMetaTileEntity().getStoredEU());
- if(tTile!=null&&tTile instanceof IEnergyConnected){
- if(((IEnergyConnected)tTile).injectEnergyUnits((byte) 6, V[mTier], 1)>0){
- int tLoss=1;
- if(mMaxLossDistance!=0){
- tLoss = 10 + tDistance*(mMaxLoss-10)/mMaxLossDistance;}
- getBaseMetaTileEntity().decreaseStoredEnergyUnits(V[mTier]+((V[mTier]*tLoss)/100), false);
- }
- }
- }
- getBaseMetaTileEntity().setActive(true);
- }
- else
- {
- getBaseMetaTileEntity().setActive(false);
- }
- }
- }
-
- private int distanceCalculation()
- {
- return Math.abs(((this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId) && (isDimensionalTeleportAvailable()) ? 100 : 1) * (int)Math.sqrt(Math.pow(getBaseMetaTileEntity().getXCoord() - this.mTargetX, 2.0D) + Math.pow(getBaseMetaTileEntity().getYCoord() - this.mTargetY, 2.0D) + Math.pow(getBaseMetaTileEntity().getZCoord() - this.mTargetZ, 2.0D)));
- }
-
- @Override public boolean isSimpleMachine() {return false;}
- @Override public boolean isOverclockerUpgradable() {return false;}
- @Override public boolean isTransformerUpgradable() {return false;}
- @Override public boolean isElectric() {return true;}
- @Override public boolean isFacingValid(byte aFacing) {return true;}
- @Override public boolean isEnetInput() {return true;}
- @Override public boolean isInputFacing(byte aSide) {return true;}
- @Override public boolean isOutputFacing(byte aSide) {return false;}
- @Override public boolean isTeleporterCompatible() {return false;}
- @Override public long getMinimumStoredEU() {return V[mTier]*16;}
- @Override public long maxEUStore() {return V[mTier]*256;}
- @Override public long maxEUInput() {return V[mTier];}
- @Override public long maxSteamStore() {return maxEUStore();}
- @Override public long maxAmperesIn() {return 3;}
- @Override public int getStackDisplaySlot() {return 2;}
- @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;}
- @Override public int getInputSlot() {return 0;}
- @Override public int getOutputSlot() {return 0;}
-
- @Override
- public int getCapacity() {return 64000;}
-
- @Override
- public boolean doesFillContainers() {
- return false;
- }
-
- @Override
- public boolean doesEmptyContainers() {
- return false;
- }
-
- @Override
- public boolean canTankBeFilled() {
- return true;
- }
-
- @Override
- public boolean canTankBeEmptied() {
- return true;
- }
-
- @Override
- public boolean displaysItemStack() {
- return false;
- }
-
- @Override
- public boolean displaysStackSize() {
- return false;
- }
-
- @Override
- public ITexture[][][] getTextureSet(ITexture[] aTextures) {
- return null;
- }
-
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.World;
+import net.minecraftforge.common.DimensionManager;
+import net.minecraftforge.fluids.FluidStack;
+
+import static gregtech.api.enums.GT_Values.V;
+
+public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEntity_BasicTank {
+
+ public static boolean sInterDimensionalTeleportAllowed = true;
+ public int mTargetX = 0;
+ public int mTargetY = 0;
+ public int mTargetZ = 0;
+ public int mTargetD = 0;
+ public boolean mDebug = false;
+ public boolean hasEgg = false;
+ public int mMaxLoss = 50;
+ public int mMaxLossDistance = 10000;
+ public boolean mPassiveEnergyUse = true;
+ public int tTargetX = 0;
+ public int tTargetY = 0;
+ public int tTargetZ = 0;
+ public int tTargetD = 0;
+ public TileEntity tTile = null;
+
+ public GT_MetaTileEntity_MicrowaveEnergyTransmitter(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 3, "Transmits Energy wireless");
+ }
+
+ public GT_MetaTileEntity_MicrowaveEnergyTransmitter(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 3, aDescription, aTextures);
+ }
+
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) return true;
+ this.hasEgg = checkForEgg();
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_MicrowaveEnergyTransmitter(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MicrowaveEnergyTransmitter(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_MicrowaveEnergyTransmitter(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public String[] getInfoData() {
+ return new String[]{"Coordinates:", "X: " + this.mTargetX, "Y: " + this.mTargetY, "Z: " + this.mTargetZ, "Dimension: " + this.mTargetD};
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], (aSide == 0) ? null : aActive ? new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE) : new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER)};
+ }
+
+ public void saveNBTData(NBTTagCompound aNBT) {
+ if (mFluid != null) aNBT.setTag("mFluid", mFluid.writeToNBT(new NBTTagCompound()));
+ aNBT.setInteger("mTargetX", this.mTargetX);
+ aNBT.setInteger("mTargetY", this.mTargetY);
+ aNBT.setInteger("mTargetZ", this.mTargetZ);
+ aNBT.setInteger("mTargetD", this.mTargetD);
+ aNBT.setBoolean("mDebug", this.mDebug);
+ }
+
+ public void loadNBTData(NBTTagCompound aNBT) {
+ mFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid"));
+ this.mTargetX = aNBT.getInteger("mTargetX");
+ this.mTargetY = aNBT.getInteger("mTargetY");
+ this.mTargetZ = aNBT.getInteger("mTargetZ");
+ this.mTargetD = aNBT.getInteger("mTargetD");
+ this.mDebug = aNBT.getBoolean("mDebug");
+ }
+
+ public void onConfigLoad(GT_Config aConfig) {
+ sInterDimensionalTeleportAllowed = aConfig.get(ConfigCategories.machineconfig, "Teleporter.Interdimensional", true);
+ mMaxLoss = Math.max(aConfig.get(ConfigCategories.machineconfig, "MicrowaveTransmitter.MaxLoss", 50), 11);
+ mMaxLossDistance = aConfig.get(ConfigCategories.machineconfig, "MicrowaveTransmitter.MaxLossDistance", 10000);
+ mPassiveEnergyUse = aConfig.get(ConfigCategories.machineconfig, "MicrowaveTransmitter.PassiveEnergy", true);
+ }
+
+ public void onFirstTick() {
+ if (getBaseMetaTileEntity().isServerSide()) {
+ if ((this.mTargetX == 0) && (this.mTargetY == 0) && (this.mTargetZ == 0) && (this.mTargetD == 0)) {
+ this.mTargetX = getBaseMetaTileEntity().getXCoord();
+ this.mTargetY = getBaseMetaTileEntity().getYCoord();
+ this.mTargetZ = getBaseMetaTileEntity().getZCoord();
+ this.mTargetD = getBaseMetaTileEntity().getWorld().provider.dimensionId;
+ }
+ this.hasEgg = checkForEgg();
+ }
+ }
+
+ public boolean checkForEgg() {
+ for (byte i = -5; i <= 5; i = (byte) (i + 1)) {
+ for (byte j = -5; j <= 5; j = (byte) (j + 1)) {
+ for (byte k = -5; k <= 5; k = (byte) (k + 1)) {
+ if (getBaseMetaTileEntity().getBlockOffset(i, j, k) == Blocks.dragon_egg) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ public boolean hasDimensionalTeleportCapability() {
+ return (this.mDebug) || (this.hasEgg) || (mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)) && mFluid.amount >= 1000);
+ }
+
+ public boolean isDimensionalTeleportAvailable() {
+ return (this.mDebug) || ((hasDimensionalTeleportCapability()) && (GT_Utility.isRealDimension(this.mTargetD)) && (GT_Utility.isRealDimension(getBaseMetaTileEntity().getWorld().provider.dimensionId)));
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (mFluid == null) {
+ mFluid = Materials.Nitrogen.getPlasma(0);
+ }
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ if (getBaseMetaTileEntity().isServerSide()) {
+ if (getBaseMetaTileEntity().getTimer() % 100L == 50L) {
+ this.hasEgg = checkForEgg();
+ }
+ if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().getRedstone())) {
+ if (getBaseMetaTileEntity().getStoredEU() > (V[mTier] * 16)) {
+ if (mPassiveEnergyUse) {
+ getBaseMetaTileEntity().decreaseStoredEnergyUnits((long) Math.pow(2, mTier), false);
+ }
+ if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1))) {
+ mFluid.amount--;
+ if (mFluid.amount < 1) {
+ mFluid = null;
+ }
+ }
+ if (tTargetD != mTargetD || tTargetX != mTargetX || tTargetY != mTargetY || tTargetZ != mTargetZ) {
+ tTargetD = mTargetD;
+ tTargetX = mTargetX;
+ tTargetY = mTargetY;
+ tTargetZ = mTargetZ;
+ if (this.mTargetD == getBaseMetaTileEntity().getWorld().provider.dimensionId) {
+ tTile = getBaseMetaTileEntity().getTileEntity(this.mTargetX, this.mTargetY, this.mTargetZ);
+ } else {
+ World tWorld = DimensionManager.getWorld(this.mTargetD);
+ if (tWorld != null) {
+ tTile = tWorld.getTileEntity(this.mTargetX, this.mTargetY, this.mTargetZ);
+ }
+ }
+ }
+ int tDistance = distanceCalculation();
+ long tEnergyTrans = Math.min(V[mTier], getBaseMetaTileEntity().getStoredEU());
+ if (tTile != null && tTile instanceof IEnergyConnected) {
+ if (((IEnergyConnected) tTile).injectEnergyUnits((byte) 6, V[mTier], 1) > 0) {
+ int tLoss = 1;
+ if (mMaxLossDistance != 0) {
+ tLoss = 10 + tDistance * (mMaxLoss - 10) / mMaxLossDistance;
+ }
+ getBaseMetaTileEntity().decreaseStoredEnergyUnits(V[mTier] + ((V[mTier] * tLoss) / 100), false);
+ }
+ }
+ }
+ getBaseMetaTileEntity().setActive(true);
+ } else {
+ getBaseMetaTileEntity().setActive(false);
+ }
+ }
+ }
+
+ private int distanceCalculation() {
+ return Math.abs(((this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId) && (isDimensionalTeleportAvailable()) ? 100 : 1) * (int) Math.sqrt(Math.pow(getBaseMetaTileEntity().getXCoord() - this.mTargetX, 2.0D) + Math.pow(getBaseMetaTileEntity().getYCoord() - this.mTargetY, 2.0D) + Math.pow(getBaseMetaTileEntity().getZCoord() - this.mTargetZ, 2.0D)));
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isOverclockerUpgradable() {
+ return false;
+ }
+
+ @Override
+ public boolean isTransformerUpgradable() {
+ return false;
+ }
+
+ @Override
+ public boolean isElectric() {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return true;
+ }
+
+ @Override
+ public boolean isInputFacing(byte aSide) {
+ return true;
+ }
+
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public boolean isTeleporterCompatible() {
+ return false;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return V[mTier] * 16;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return V[mTier] * 256;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return V[mTier];
+ }
+
+ @Override
+ public long maxSteamStore() {
+ return maxEUStore();
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return 3;
+ }
+
+ @Override
+ public int getStackDisplaySlot() {
+ return 2;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public int getInputSlot() {
+ return 0;
+ }
+
+ @Override
+ public int getOutputSlot() {
+ return 0;
+ }
+
+ @Override
+ public int getCapacity() {
+ return 64000;
+ }
+
+ @Override
+ public boolean doesFillContainers() {
+ return false;
+ }
+
+ @Override
+ public boolean doesEmptyContainers() {
+ return false;
+ }
+
+ @Override
+ public boolean canTankBeFilled() {
+ return true;
+ }
+
+ @Override
+ public boolean canTankBeEmptied() {
+ return true;
+ }
+
+ @Override
+ public boolean displaysItemStack() {
+ return false;
+ }
+
+ @Override
+ public boolean displaysStackSize() {
+ return false;
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ return null;
+ }
+
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MonsterRepellent.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MonsterRepellent.java
index 871835020d..88434e315f 100644
--- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MonsterRepellent.java
+++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MonsterRepellent.java
@@ -1,13 +1,5 @@
package gregtech.common.tileentities.machines.basic;
-import static gregtech.api.enums.GT_Values.V;
-import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-import cpw.mods.fml.common.eventhandler.Event;
-import net.minecraft.entity.EnumCreatureType;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraftforge.common.MinecraftForge;
-import net.minecraftforge.event.entity.living.LivingSpawnEvent;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -15,65 +7,124 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_SpawnEventHandler;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+
+import static gregtech.api.enums.GT_Values.V;
public class GT_MetaTileEntity_MonsterRepellent extends GT_MetaTileEntity_TieredMachineBlock {
- public int mRange = 16;
-
- public GT_MetaTileEntity_MonsterRepellent(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 0, "Reprells nasty Creatures. Range: "+(4 + (12*aTier))+" unpowered / "+(16 + (48*aTier))+" powered");
- }
-
- public GT_MetaTileEntity_MonsterRepellent(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aInvSlotCount, aDescription, aTextures);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_MonsterRepellent(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures);
- }
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1], (aSide != 1) ? null : aActive ? new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE) : new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER) };
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
- if (aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.isServerSide()) {
- int[] tCoords = new int[]{aBaseMetaTileEntity.getXCoord(),aBaseMetaTileEntity.getYCoord(),aBaseMetaTileEntity.getZCoord(),aBaseMetaTileEntity.getWorld().provider.dimensionId};
- if((aTimer%600 == 0)&&!GT_SpawnEventHandler.mobReps.contains(tCoords)){
- GT_SpawnEventHandler.mobReps.add(tCoords);
- }
- if(aBaseMetaTileEntity.isUniversalEnergyStored(getMinimumStoredEU()) && aBaseMetaTileEntity.decreaseStoredEnergyUnits(1 << (this.mTier*2), false)){
- mRange = 16 + (48*mTier);
- }else{
- mRange = 4 + (12*mTier);
- }}
- }
-
- @Override
- public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {
- int[] tCoords = new int[]{aBaseMetaTileEntity.getXCoord(),aBaseMetaTileEntity.getYCoord(),aBaseMetaTileEntity.getZCoord(),aBaseMetaTileEntity.getWorld().provider.dimensionId};
- GT_SpawnEventHandler.mobReps.add(tCoords);
- }
-
- @Override
- public void onRemoval() {
- int[] tCoords = new int[]{this.getBaseMetaTileEntity().getXCoord(),this.getBaseMetaTileEntity().getYCoord(),this.getBaseMetaTileEntity().getZCoord(),this.getBaseMetaTileEntity().getWorld().provider.dimensionId};
- GT_SpawnEventHandler.mobReps.remove(tCoords);
- }
- @Override public boolean isSimpleMachine() {return false;}
- @Override public boolean isFacingValid(byte aFacing) {return true;}
- @Override public boolean isEnetInput() {return true;}
- @Override public boolean isInputFacing(byte aSide) {return true;}
- @Override public boolean isTeleporterCompatible() {return false;}
- @Override public long getMinimumStoredEU() {return 512;}
- @Override public long maxEUStore() {return 512+V[mTier]*50;}
- @Override public long maxEUInput() {return V[mTier];}
- @Override public long maxAmperesIn() {return 2;}
- @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {return false;}
- @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {return false;}
- @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) {return null;}
- @Override public void saveNBTData(NBTTagCompound aNBT) {}
- @Override public void loadNBTData(NBTTagCompound aNBT) {}
- }
+ public int mRange = 16;
+
+ public GT_MetaTileEntity_MonsterRepellent(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 0, "Reprells nasty Creatures. Range: " + (4 + (12 * aTier)) + " unpowered / " + (16 + (48 * aTier)) + " powered");
+ }
+
+ public GT_MetaTileEntity_MonsterRepellent(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aInvSlotCount, aDescription, aTextures);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_MonsterRepellent(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], (aSide != 1) ? null : aActive ? new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE) : new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER)};
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
+ if (aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.isServerSide()) {
+ int[] tCoords = new int[]{aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(), aBaseMetaTileEntity.getWorld().provider.dimensionId};
+ if ((aTimer % 600 == 0) && !GT_SpawnEventHandler.mobReps.contains(tCoords)) {
+ GT_SpawnEventHandler.mobReps.add(tCoords);
+ }
+ if (aBaseMetaTileEntity.isUniversalEnergyStored(getMinimumStoredEU()) && aBaseMetaTileEntity.decreaseStoredEnergyUnits(1 << (this.mTier * 2), false)) {
+ mRange = 16 + (48 * mTier);
+ } else {
+ mRange = 4 + (12 * mTier);
+ }
+ }
+ }
+
+ @Override
+ public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {
+ int[] tCoords = new int[]{aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(), aBaseMetaTileEntity.getWorld().provider.dimensionId};
+ GT_SpawnEventHandler.mobReps.add(tCoords);
+ }
+
+ @Override
+ public void onRemoval() {
+ int[] tCoords = new int[]{this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId};
+ GT_SpawnEventHandler.mobReps.remove(tCoords);
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return true;
+ }
+
+ @Override
+ public boolean isInputFacing(byte aSide) {
+ return true;
+ }
+
+ @Override
+ public boolean isTeleporterCompatible() {
+ return false;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return 512;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return 512 + V[mTier] * 50;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return V[mTier];
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return 2;
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ return null;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ }
+}
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java
index 35110b6adf..2dcde9c082 100644
--- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java
+++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java
@@ -3,7 +3,6 @@ package gregtech.common.tileentities.machines.basic;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
@@ -11,149 +10,130 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachin
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_PotionBrewer
- extends GT_MetaTileEntity_BasicMachine
-{
- public GT_MetaTileEntity_PotionBrewer(int aID, String aName, String aNameRegional, int aTier)
- {
- super(aID, aName, aNameRegional, aTier, 1, "Brewing your Drinks", 1, 0, "PotionBrewer.png", "", new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_POTIONBREWER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_POTIONBREWER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_POTIONBREWER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_POTIONBREWER) });
- }
-
- public GT_MetaTileEntity_PotionBrewer(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName)
- {
- super(aName, aTier, 1, aDescription, aTextures, 1, 0, aGUIName, aNEIName);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_PotionBrewer(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipeList()
- {
- return GT_Recipe.GT_Recipe_Map.sBrewingRecipes;
- }
-
- public int checkRecipe()
- {
- int tCheck = super.checkRecipe();
- if (tCheck != 0) {
- return tCheck;
+ extends GT_MetaTileEntity_BasicMachine {
+ public GT_MetaTileEntity_PotionBrewer(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 1, "Brewing your Drinks", 1, 0, "PotionBrewer.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_POTIONBREWER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_POTIONBREWER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_POTIONBREWER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_POTIONBREWER)});
}
- FluidStack aFluid = getFillableStack();
- if ((getDrainableStack() == null) && (aFluid != null) && (getInputAt(0) != null))
- {
- String tInputName = aFluid.getFluid().getName();
- if (tInputName.startsWith("potion."))
- {
- tInputName = tInputName.replaceFirst("potion.", "");
- int tFirstDot = tInputName.indexOf('.') + 1;
- String tModifier = tFirstDot <= 0 ? "" : tInputName.substring(tFirstDot);
- if (!tModifier.isEmpty()) {
- tInputName = tInputName.replaceFirst("." + tModifier, "");
- }
- if (GT_Utility.areStacksEqual(new ItemStack(Items.fermented_spider_eye, 1, 0), getInputAt(0)))
- {
- if (tInputName.equals("poison")) {
- return setOutput("potion.damage" + tModifier);
- }
- if (tInputName.equals("health")) {
- return setOutput("potion.damage" + tModifier);
- }
- if (tInputName.equals("waterbreathing")) {
- return setOutput("potion.damage" + tModifier);
- }
- if (tInputName.equals("nightvision")) {
- return setOutput("potion.invisibility" + tModifier);
- }
- if (tInputName.equals("fireresistance")) {
- return setOutput("potion.slowness" + tModifier);
- }
- if (tInputName.equals("speed")) {
- return setOutput("potion.slowness" + tModifier);
- }
- if (tInputName.equals("strength")) {
- return setOutput("potion.weakness" + tModifier);
- }
- if (tInputName.equals("regen")) {
- return setOutput("potion.poison" + tModifier);
- }
- return setOutput("potion.weakness");
+
+ public GT_MetaTileEntity_PotionBrewer(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
+ super(aName, aTier, 1, aDescription, aTextures, 1, 0, aGUIName, aNEIName);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_PotionBrewer(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeList() {
+ return GT_Recipe.GT_Recipe_Map.sBrewingRecipes;
+ }
+
+ public int checkRecipe() {
+ int tCheck = super.checkRecipe();
+ if (tCheck != 0) {
+ return tCheck;
}
- if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glowstone, 1L), getInputAt(0)))
- {
- if (!tModifier.startsWith("strong")) {
- return setOutput("potion." + tInputName + ".strong" + (tModifier.isEmpty() ? "" : new StringBuilder().append(".").append(tModifier).toString()));
- }
- if (tModifier.startsWith("long")) {
- return setOutput("potion." + tInputName + tModifier.replaceFirst("long", ""));
- }
- return setOutput("potion.thick");
+ FluidStack aFluid = getFillableStack();
+ if ((getDrainableStack() == null) && (aFluid != null) && (getInputAt(0) != null)) {
+ String tInputName = aFluid.getFluid().getName();
+ if (tInputName.startsWith("potion.")) {
+ tInputName = tInputName.replaceFirst("potion.", "");
+ int tFirstDot = tInputName.indexOf('.') + 1;
+ String tModifier = tFirstDot <= 0 ? "" : tInputName.substring(tFirstDot);
+ if (!tModifier.isEmpty()) {
+ tInputName = tInputName.replaceFirst("." + tModifier, "");
+ }
+ if (GT_Utility.areStacksEqual(new ItemStack(Items.fermented_spider_eye, 1, 0), getInputAt(0))) {
+ if (tInputName.equals("poison")) {
+ return setOutput("potion.damage" + tModifier);
+ }
+ if (tInputName.equals("health")) {
+ return setOutput("potion.damage" + tModifier);
+ }
+ if (tInputName.equals("waterbreathing")) {
+ return setOutput("potion.damage" + tModifier);
+ }
+ if (tInputName.equals("nightvision")) {
+ return setOutput("potion.invisibility" + tModifier);
+ }
+ if (tInputName.equals("fireresistance")) {
+ return setOutput("potion.slowness" + tModifier);
+ }
+ if (tInputName.equals("speed")) {
+ return setOutput("potion.slowness" + tModifier);
+ }
+ if (tInputName.equals("strength")) {
+ return setOutput("potion.weakness" + tModifier);
+ }
+ if (tInputName.equals("regen")) {
+ return setOutput("potion.poison" + tModifier);
+ }
+ return setOutput("potion.weakness");
+ }
+ if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glowstone, 1L), getInputAt(0))) {
+ if (!tModifier.startsWith("strong")) {
+ return setOutput("potion." + tInputName + ".strong" + (tModifier.isEmpty() ? "" : new StringBuilder().append(".").append(tModifier).toString()));
+ }
+ if (tModifier.startsWith("long")) {
+ return setOutput("potion." + tInputName + tModifier.replaceFirst("long", ""));
+ }
+ return setOutput("potion.thick");
+ }
+ if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L), getInputAt(0))) {
+ if (!tModifier.startsWith("long")) {
+ return setOutput("potion." + tInputName + ".long" + (tModifier.isEmpty() ? "" : new StringBuilder().append(".").append(tModifier).toString()));
+ }
+ if (tModifier.startsWith("strong")) {
+ return setOutput("potion." + tInputName + tModifier.replaceFirst("strong", ""));
+ }
+ return setOutput("potion.mundane");
+ }
+ if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Gunpowder, 1L), getInputAt(0))) {
+ if (!tInputName.endsWith(".splash")) {
+ return setOutput("potion." + tInputName + ".splash");
+ }
+ return setOutput("potion.mundane");
+ }
+ }
}
- if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L), getInputAt(0)))
- {
- if (!tModifier.startsWith("long")) {
- return setOutput("potion." + tInputName + ".long" + (tModifier.isEmpty() ? "" : new StringBuilder().append(".").append(tModifier).toString()));
- }
- if (tModifier.startsWith("strong")) {
- return setOutput("potion." + tInputName + tModifier.replaceFirst("strong", ""));
- }
- return setOutput("potion.mundane");
+ return 0;
+ }
+
+ private final int setOutput(String aFluidName) {
+ this.mOutputFluid = FluidRegistry.getFluidStack(aFluidName, 750);
+ if (this.mOutputFluid == null) {
+ this.mOutputFluid = FluidRegistry.getFluidStack("potion.mundane", getFillableStack().amount);
+ getInputAt(0).stackSize -= 1;
+ getFillableStack().amount = 0;
+ this.mEUt = (4 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ this.mMaxProgresstime = (128 / (1 << this.mTier - 1));
+ return 2;
}
- if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Gunpowder, 1L), getInputAt(0)))
- {
- if (!tInputName.endsWith(".splash")) {
- return setOutput("potion." + tInputName + ".splash");
- }
- return setOutput("potion.mundane");
+ if (getFillableStack().amount < 750) {
+ return 0;
}
- }
+ getInputAt(0).stackSize -= 1;
+ getFillableStack().amount -= 750;
+ this.mEUt = (4 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ this.mMaxProgresstime = (128 / (1 << this.mTier - 1));
+ return 2;
}
- return 0;
- }
-
- private final int setOutput(String aFluidName)
- {
- this.mOutputFluid = FluidRegistry.getFluidStack(aFluidName, 750);
- if (this.mOutputFluid == null)
- {
- this.mOutputFluid = FluidRegistry.getFluidStack("potion.mundane", getFillableStack().amount);
- getInputAt(0).stackSize -= 1;
- getFillableStack().amount = 0;
- this.mEUt = (4 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
- this.mMaxProgresstime = (128 / (1 << this.mTier - 1));
- return 2;
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack));
}
- if (getFillableStack().amount < 750) {
- return 0;
+
+ public boolean isFluidInputAllowed(FluidStack aFluid) {
+ return (aFluid.getFluid().getName().startsWith("potion.")) || (super.isFluidInputAllowed(aFluid));
+ }
+
+ public int getCapacity() {
+ return 750;
}
- getInputAt(0).stackSize -= 1;
- getFillableStack().amount -= 750;
- this.mEUt = (4 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
- this.mMaxProgresstime = (128 / (1 << this.mTier - 1));
- return 2;
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
- {
- return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack));
- }
-
- public boolean isFluidInputAllowed(FluidStack aFluid)
- {
- return (aFluid.getFluid().getName().startsWith("potion.")) || (super.isFluidInputAllowed(aFluid));
- }
-
- public int getCapacity()
- {
- return 750;
- }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java
index b4058f8830..2f1eecdd91 100644
--- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java
+++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java
@@ -7,59 +7,47 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
+import net.minecraft.item.ItemStack;
import java.util.ArrayList;
-import net.minecraft.item.ItemStack;
-
public class GT_MetaTileEntity_Printer
- extends GT_MetaTileEntity_BasicMachine
-{
- public GT_MetaTileEntity_Printer(int aID, String aName, String aNameRegional, int aTier)
- {
- super(aID, aName, aNameRegional, aTier, 1, "It can copy Books and paint Stuff", 1, 1, "Printer.png", GT_Recipe.GT_Recipe_Map.sPrinterRecipes.mNEIName, new ITexture[0]);
- }
-
- public GT_MetaTileEntity_Printer(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName)
- {
- super(aName, aTier, 1, aDescription, aTextures, 2, 2, aGUIName, aNEIName);
- }
-
- public int checkRecipe()
- {
- if (getOutputAt(0) != null)
- {
- this.mOutputBlocked += 1;
+ extends GT_MetaTileEntity_BasicMachine {
+ public GT_MetaTileEntity_Printer(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 1, "It can copy Books and paint Stuff", 1, 1, "Printer.png", GT_Recipe.GT_Recipe_Map.sPrinterRecipes.mNEIName, new ITexture[0]);
+ }
+
+ public GT_MetaTileEntity_Printer(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
+ super(aName, aTier, 1, aDescription, aTextures, 2, 2, aGUIName, aNEIName);
}
- else if ((GT_Utility.isStackValid(getInputAt(0))) && (getInputAt(0).stackSize > 0) &&
- (GT_Utility.isStackInvalid(getSpecialSlot())) &&
- (OrePrefixes.block.contains(getInputAt(0))))
- {
- ArrayList<ItemStack> tList = GT_OreDictUnificator.getOres(GT_OreDictUnificator.getAssociation(getInputAt(0)));
- if (tList.size() > 1)
- {
- tList.add(tList.get(0));
- int i = 0;
- for (int j = tList.size() - 1; i < j; i++) {
- if (GT_Utility.areStacksEqual(getInputAt(0), (ItemStack)tList.get(i)))
- {
- this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[] { tList.get(i + 1) });
- this.mEUt = (1 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
- this.mMaxProgresstime = (32 / (1 << this.mTier - 1));
- getInputAt(0).stackSize -= 1;
- return 2;
- }
+
+ public int checkRecipe() {
+ if (getOutputAt(0) != null) {
+ this.mOutputBlocked += 1;
+ } else if ((GT_Utility.isStackValid(getInputAt(0))) && (getInputAt(0).stackSize > 0) &&
+ (GT_Utility.isStackInvalid(getSpecialSlot())) &&
+ (OrePrefixes.block.contains(getInputAt(0)))) {
+ ArrayList<ItemStack> tList = GT_OreDictUnificator.getOres(GT_OreDictUnificator.getAssociation(getInputAt(0)));
+ if (tList.size() > 1) {
+ tList.add(tList.get(0));
+ int i = 0;
+ for (int j = tList.size() - 1; i < j; i++) {
+ if (GT_Utility.areStacksEqual(getInputAt(0), (ItemStack) tList.get(i))) {
+ this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{tList.get(i + 1)});
+ this.mEUt = (1 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ this.mMaxProgresstime = (32 / (1 << this.mTier - 1));
+ getInputAt(0).stackSize -= 1;
+ return 2;
+ }
+ }
+ }
}
- }
+ this.mMaxProgresstime = 0;
+ return 0;
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return null;
}
- this.mMaxProgresstime = 0;
- return 0;
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return null;
- }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java
index 92248da910..6aabea8286 100644
--- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java
+++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java
@@ -1,19 +1,5 @@
package gregtech.common.tileentities.machines.basic;
-import static gregtech.api.enums.GT_Values.V;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.world.ChunkPosition;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.IFluidBlock;
import gregtech.api.enums.Textures;
import gregtech.api.gui.GT_Container_BasicTank;
import gregtech.api.gui.GT_GUIContainer_BasicTank;
@@ -21,359 +7,439 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.BaseTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.world.ChunkPosition;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.IFluidBlock;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import static gregtech.api.enums.GT_Values.V;
public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
- public ArrayList<ChunkPosition> mPumpList = new ArrayList();
- public int mPumpTimer = 0;
- public int mPumpCountBelow = 0;
- public Block mPumpedBlock1 = null;
- public Block mPumpedBlock2 = null;
-
- public GT_MetaTileEntity_Pump(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 3, "The best way of emptying Oceans!");
- }
-
- public GT_MetaTileEntity_Pump(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, 3, aDescription,aTextures);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Pump(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- aNBT.setString("mPumpedBlock1", this.mPumpedBlock1 == null ? "" : this.mPumpedBlock1.getUnlocalizedName());
- aNBT.setString("mPumpedBlock2", this.mPumpedBlock2 == null ? "" : this.mPumpedBlock2.getUnlocalizedName());
- }
-
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- this.mPumpedBlock1 = Block.getBlockFromName(aNBT.getString("mPumpedBlock1"));
- this.mPumpedBlock2 = Block.getBlockFromName(aNBT.getString("mPumpedBlock2"));
- }
-
- @Override
+ public ArrayList<ChunkPosition> mPumpList = new ArrayList();
+ public int mPumpTimer = 0;
+ public int mPumpCountBelow = 0;
+ public Block mPumpedBlock1 = null;
+ public Block mPumpedBlock2 = null;
+
+ public GT_MetaTileEntity_Pump(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 3, "The best way of emptying Oceans!");
+ }
+
+ public GT_MetaTileEntity_Pump(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 3, aDescription, aTextures);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Pump(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setString("mPumpedBlock1", this.mPumpedBlock1 == null ? "" : this.mPumpedBlock1.getUnlocalizedName());
+ aNBT.setString("mPumpedBlock2", this.mPumpedBlock2 == null ? "" : this.mPumpedBlock2.getUnlocalizedName());
+ }
+
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ this.mPumpedBlock1 = Block.getBlockFromName(aNBT.getString("mPumpedBlock1"));
+ this.mPumpedBlock2 = Block.getBlockFromName(aNBT.getString("mPumpedBlock2"));
+ }
+
+ @Override
public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_BasicTank(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
+ return new GT_Container_BasicTank(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_BasicTank(aPlayerInventory, aBaseMetaTileEntity, getLocalName());
- }
- @Override
- public boolean doesFillContainers() {
- return true;
- }
- @Override
- public boolean doesEmptyContainers() {
- return false;
- }
- @Override
- public boolean canTankBeFilled() {
- return false;
- }
- @Override
- public boolean canTankBeEmptied() {
- return true;
- }
- @Override
- public boolean displaysItemStack() {
- return true;
- }
- @Override
- public boolean displaysStackSize() {
- return false;
- }
-
- @Override
- public boolean isFluidInputAllowed(FluidStack aFluid) {
- return false;
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
- if (getBaseMetaTileEntity().isServerSide()) {
- this.mPumpTimer -= 1;
- if ((getBaseMetaTileEntity() instanceof BaseTileEntity)) {
- ((BaseTileEntity) getBaseMetaTileEntity()).ignoreUnloadedChunks = false;
- }
- this.doTickProfilingInThisTick = true;
- this.mPumpCountBelow = 0;
- IGregTechTileEntity tTileEntity;
- for (int i = 1; (i < 21) && ((tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance((byte) 0, i)) != null)
- && (tTileEntity.getMetaTileEntity() != null) && ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Pump)); i++) {
- getBaseMetaTileEntity().setActive(tTileEntity.isActive());
- this.mPumpCountBelow += 1;
- ((GT_MetaTileEntity_Pump) tTileEntity.getMetaTileEntity()).mPumpTimer -= 1;
- }
- if (this.mPumpCountBelow <= 0) {
- if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().isUniversalEnergyStored(16*((int)Math.pow(4, this.mTier))))
- && ((this.mFluid == null) || (this.mFluid.amount + 1000 <= getCapacity()))) {
- boolean tMovedOneDown = false;
- if ((this.mPumpList.isEmpty()) && (getBaseMetaTileEntity().getTimer() % 100L == 0L)) {
- tMovedOneDown = moveOneDown();
- }
- if ((GT_Utility.isBlockInvalid(this.mPumpedBlock1)) || (GT_Utility.isBlockInvalid(this.mPumpedBlock2))) {
- getFluidAt(getBaseMetaTileEntity().getXCoord(), getYOfPumpHead() - 1, getBaseMetaTileEntity().getZCoord());
- if ((GT_Utility.isBlockInvalid(this.mPumpedBlock1)) || (GT_Utility.isBlockInvalid(this.mPumpedBlock2))) {
- getFluidAt(getBaseMetaTileEntity().getXCoord(), getYOfPumpHead(), getBaseMetaTileEntity().getZCoord() + 1);
- }
- if ((GT_Utility.isBlockInvalid(this.mPumpedBlock1)) || (GT_Utility.isBlockInvalid(this.mPumpedBlock2))) {
- getFluidAt(getBaseMetaTileEntity().getXCoord(), getYOfPumpHead(), getBaseMetaTileEntity().getZCoord() - 1);
- }
- if ((GT_Utility.isBlockInvalid(this.mPumpedBlock1)) || (GT_Utility.isBlockInvalid(this.mPumpedBlock2))) {
- getFluidAt(getBaseMetaTileEntity().getXCoord() + 1, getYOfPumpHead(), getBaseMetaTileEntity().getZCoord());
- }
- if ((GT_Utility.isBlockInvalid(this.mPumpedBlock1)) || (GT_Utility.isBlockInvalid(this.mPumpedBlock2))) {
- getFluidAt(getBaseMetaTileEntity().getXCoord() - 1, getYOfPumpHead(), getBaseMetaTileEntity().getZCoord());
- }
- } else if (getYOfPumpHead() < getBaseMetaTileEntity().getYCoord()) {
- if ((tMovedOneDown) || ((this.mPumpList.isEmpty()) && (getBaseMetaTileEntity().getTimer() % 200L == 100L)) || (getBaseMetaTileEntity().getTimer() % 72000L == 100L)) {
- this.mPumpList.clear();
- int y = getBaseMetaTileEntity().getYCoord() - 1;
- for (int yHead = getYOfPumpHead(); (this.mPumpList.isEmpty()) && (y >= yHead); y--) {
- scanForFluid(getBaseMetaTileEntity().getXCoord(), y, getBaseMetaTileEntity().getZCoord(), this.mPumpList, getBaseMetaTileEntity().getXCoord(), getBaseMetaTileEntity().getZCoord(), 10*((int)Math.pow(1.6, this.mTier)));
- }
- }
- if ((!tMovedOneDown) && (this.mPumpTimer <= 0)) {
- while ((!this.mPumpList.isEmpty())
- && (!consumeFluid(((ChunkPosition) this.mPumpList.get(this.mPumpList.size() - 1)).chunkPosX,
- ((ChunkPosition) this.mPumpList.get(this.mPumpList.size() - 1)).chunkPosY,
- ((ChunkPosition) this.mPumpList.remove(this.mPumpList.size() - 1)).chunkPosZ))) {
- }
- this.mPumpTimer = 160/((int)Math.pow(2, this.mTier));
- }
- }
- }
- getBaseMetaTileEntity().setActive(!this.mPumpList.isEmpty());
- }
- }
- }
-
- private boolean moveOneDown() {
- if ((this.mInventory[0] == null) || (this.mInventory[0].stackSize < 1)
- || (!GT_Utility.areStacksEqual(this.mInventory[0], GT_ModHandler.getIC2Item("miningPipe", 1L)))) {
- return false;
- }
- int yHead = getYOfPumpHead();
- if (yHead <= 0) {
- return false;
- }
- if ((!consumeFluid(getBaseMetaTileEntity().getXCoord(), yHead - 1, getBaseMetaTileEntity().getZCoord()))&& (!getBaseMetaTileEntity().getAir(getBaseMetaTileEntity().getXCoord(), yHead - 1, getBaseMetaTileEntity().getZCoord()))) {
-
- return false;
- }
- if (!(getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord(), yHead - 1, getBaseMetaTileEntity().getZCoord(),GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))))) {
- return false;
- }
- if (yHead != getBaseMetaTileEntity().getYCoord()) {
- getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord(), yHead, getBaseMetaTileEntity().getZCoord(),GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L)));
- }
- getBaseMetaTileEntity().decrStackSize(0, 1);
- return true;
- }
-
- private int getYOfPumpHead() {
- int y = getBaseMetaTileEntity().getYCoord() - 1;
- while (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord(), y, getBaseMetaTileEntity().getZCoord()) == GT_Utility
- .getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L))) {
- y--;
- }
- if (y == getBaseMetaTileEntity().getYCoord() - 1) {
- if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord(), y, getBaseMetaTileEntity().getZCoord()) != GT_Utility
- .getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))) {
- return y + 1;
- }
- } else if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord(), y, getBaseMetaTileEntity().getZCoord()) != GT_Utility
- .getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))&&this.mInventory[0] != null&&this.mInventory[0].stackSize>0&&GT_Utility.areStacksEqual(this.mInventory[0], GT_ModHandler.getIC2Item("miningPipe", 1L))) {
- getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord(), y, getBaseMetaTileEntity().getZCoord(),
- GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L)));
- getBaseMetaTileEntity().decrStackSize(0, 1);
- }
- return y;
- }
-
- private void scanForFluid(int aX, int aY, int aZ, ArrayList<ChunkPosition> aList, int mX, int mZ, int mDist) {
- doTickProfilingInThisTick = false;
+ return new GT_GUIContainer_BasicTank(aPlayerInventory, aBaseMetaTileEntity, getLocalName());
+ }
+
+ @Override
+ public boolean doesFillContainers() {
+ return true;
+ }
+
+ @Override
+ public boolean doesEmptyContainers() {
+ return false;
+ }
+
+ @Override
+ public boolean canTankBeFilled() {
+ return false;
+ }
+
+ @Override
+ public boolean canTankBeEmptied() {
+ return true;
+ }
+
+ @Override
+ public boolean displaysItemStack() {
+ return true;
+ }
+
+ @Override
+ public boolean displaysStackSize() {
+ return false;
+ }
+
+ @Override
+ public boolean isFluidInputAllowed(FluidStack aFluid) {
+ return false;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ if (getBaseMetaTileEntity().isServerSide()) {
+ this.mPumpTimer -= 1;
+ if ((getBaseMetaTileEntity() instanceof BaseTileEntity)) {
+ ((BaseTileEntity) getBaseMetaTileEntity()).ignoreUnloadedChunks = false;
+ }
+ this.doTickProfilingInThisTick = true;
+ this.mPumpCountBelow = 0;
+ IGregTechTileEntity tTileEntity;
+ for (int i = 1; (i < 21) && ((tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance((byte) 0, i)) != null)
+ && (tTileEntity.getMetaTileEntity() != null) && ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Pump)); i++) {
+ getBaseMetaTileEntity().setActive(tTileEntity.isActive());
+ this.mPumpCountBelow += 1;
+ ((GT_MetaTileEntity_Pump) tTileEntity.getMetaTileEntity()).mPumpTimer -= 1;
+ }
+ if (this.mPumpCountBelow <= 0) {
+ if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().isUniversalEnergyStored(16 * ((int) Math.pow(4, this.mTier))))
+ && ((this.mFluid == null) || (this.mFluid.amount + 1000 <= getCapacity()))) {
+ boolean tMovedOneDown = false;
+ if ((this.mPumpList.isEmpty()) && (getBaseMetaTileEntity().getTimer() % 100L == 0L)) {
+ tMovedOneDown = moveOneDown();
+ }
+ if ((GT_Utility.isBlockInvalid(this.mPumpedBlock1)) || (GT_Utility.isBlockInvalid(this.mPumpedBlock2))) {
+ getFluidAt(getBaseMetaTileEntity().getXCoord(), getYOfPumpHead() - 1, getBaseMetaTileEntity().getZCoord());
+ if ((GT_Utility.isBlockInvalid(this.mPumpedBlock1)) || (GT_Utility.isBlockInvalid(this.mPumpedBlock2))) {
+ getFluidAt(getBaseMetaTileEntity().getXCoord(), getYOfPumpHead(), getBaseMetaTileEntity().getZCoord() + 1);
+ }
+ if ((GT_Utility.isBlockInvalid(this.mPumpedBlock1)) || (GT_Utility.isBlockInvalid(this.mPumpedBlock2))) {
+ getFluidAt(getBaseMetaTileEntity().getXCoord(), getYOfPumpHead(), getBaseMetaTileEntity().getZCoord() - 1);
+ }
+ if ((GT_Utility.isBlockInvalid(this.mPumpedBlock1)) || (GT_Utility.isBlockInvalid(this.mPumpedBlock2))) {
+ getFluidAt(getBaseMetaTileEntity().getXCoord() + 1, getYOfPumpHead(), getBaseMetaTileEntity().getZCoord());
+ }
+ if ((GT_Utility.isBlockInvalid(this.mPumpedBlock1)) || (GT_Utility.isBlockInvalid(this.mPumpedBlock2))) {
+ getFluidAt(getBaseMetaTileEntity().getXCoord() - 1, getYOfPumpHead(), getBaseMetaTileEntity().getZCoord());
+ }
+ } else if (getYOfPumpHead() < getBaseMetaTileEntity().getYCoord()) {
+ if ((tMovedOneDown) || ((this.mPumpList.isEmpty()) && (getBaseMetaTileEntity().getTimer() % 200L == 100L)) || (getBaseMetaTileEntity().getTimer() % 72000L == 100L)) {
+ this.mPumpList.clear();
+ int y = getBaseMetaTileEntity().getYCoord() - 1;
+ for (int yHead = getYOfPumpHead(); (this.mPumpList.isEmpty()) && (y >= yHead); y--) {
+ scanForFluid(getBaseMetaTileEntity().getXCoord(), y, getBaseMetaTileEntity().getZCoord(), this.mPumpList, getBaseMetaTileEntity().getXCoord(), getBaseMetaTileEntity().getZCoord(), 10 * ((int) Math.pow(1.6, this.mTier)));
+ }
+ }
+ if ((!tMovedOneDown) && (this.mPumpTimer <= 0)) {
+ while ((!this.mPumpList.isEmpty())
+ && (!consumeFluid(((ChunkPosition) this.mPumpList.get(this.mPumpList.size() - 1)).chunkPosX,
+ ((ChunkPosition) this.mPumpList.get(this.mPumpList.size() - 1)).chunkPosY,
+ ((ChunkPosition) this.mPumpList.remove(this.mPumpList.size() - 1)).chunkPosZ))) {
+ }
+ this.mPumpTimer = 160 / ((int) Math.pow(2, this.mTier));
+ }
+ }
+ }
+ getBaseMetaTileEntity().setActive(!this.mPumpList.isEmpty());
+ }
+ }
+ }
+
+ private boolean moveOneDown() {
+ if ((this.mInventory[0] == null) || (this.mInventory[0].stackSize < 1)
+ || (!GT_Utility.areStacksEqual(this.mInventory[0], GT_ModHandler.getIC2Item("miningPipe", 1L)))) {
+ return false;
+ }
+ int yHead = getYOfPumpHead();
+ if (yHead <= 0) {
+ return false;
+ }
+ if ((!consumeFluid(getBaseMetaTileEntity().getXCoord(), yHead - 1, getBaseMetaTileEntity().getZCoord())) && (!getBaseMetaTileEntity().getAir(getBaseMetaTileEntity().getXCoord(), yHead - 1, getBaseMetaTileEntity().getZCoord()))) {
+
+ return false;
+ }
+ if (!(getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord(), yHead - 1, getBaseMetaTileEntity().getZCoord(), GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))))) {
+ return false;
+ }
+ if (yHead != getBaseMetaTileEntity().getYCoord()) {
+ getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord(), yHead, getBaseMetaTileEntity().getZCoord(), GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L)));
+ }
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ return true;
+ }
+
+ private int getYOfPumpHead() {
+ int y = getBaseMetaTileEntity().getYCoord() - 1;
+ while (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord(), y, getBaseMetaTileEntity().getZCoord()) == GT_Utility
+ .getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L))) {
+ y--;
+ }
+ if (y == getBaseMetaTileEntity().getYCoord() - 1) {
+ if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord(), y, getBaseMetaTileEntity().getZCoord()) != GT_Utility
+ .getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))) {
+ return y + 1;
+ }
+ } else if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord(), y, getBaseMetaTileEntity().getZCoord()) != GT_Utility
+ .getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L)) && this.mInventory[0] != null && this.mInventory[0].stackSize > 0 && GT_Utility.areStacksEqual(this.mInventory[0], GT_ModHandler.getIC2Item("miningPipe", 1L))) {
+ getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord(), y, getBaseMetaTileEntity().getZCoord(),
+ GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L)));
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ }
+ return y;
+ }
+
+ private void scanForFluid(int aX, int aY, int aZ, ArrayList<ChunkPosition> aList, int mX, int mZ, int mDist) {
+ doTickProfilingInThisTick = false;
ArrayList tList1 = new ArrayList();
ArrayList tList2 = new ArrayList();
tList1.add(new ChunkPosition(aX, aY, aZ));
- while(!tList1.isEmpty())
- {
+ while (!tList1.isEmpty()) {
Iterator i$ = tList1.iterator();
- do
- {
- if(!i$.hasNext())
+ do {
+ if (!i$.hasNext())
break;
- ChunkPosition tPos = (ChunkPosition)i$.next();
- if(tPos.chunkPosX < mX + mDist)
+ ChunkPosition tPos = (ChunkPosition) i$.next();
+ if (tPos.chunkPosX < mX + mDist)
addToFirstListIfFluidAndNotAlreadyAddedToAnyOfTheLists(tPos.chunkPosX + 1, tPos.chunkPosY, tPos.chunkPosZ, tList2, aList);
- if(tPos.chunkPosX > mX - mDist)
+ if (tPos.chunkPosX > mX - mDist)
addToFirstListIfFluidAndNotAlreadyAddedToAnyOfTheLists(tPos.chunkPosX - 1, tPos.chunkPosY, tPos.chunkPosZ, tList2, aList);
- if(tPos.chunkPosZ < mZ + mDist)
+ if (tPos.chunkPosZ < mZ + mDist)
addToFirstListIfFluidAndNotAlreadyAddedToAnyOfTheLists(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ + 1, tList2, aList);
- if(tPos.chunkPosZ > mZ - mDist)
+ if (tPos.chunkPosZ > mZ - mDist)
addToFirstListIfFluidAndNotAlreadyAddedToAnyOfTheLists(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ - 1, tList2, aList);
addToFirstListIfFluidAndNotAlreadyAddedToAnyOfTheLists(tPos.chunkPosX, tPos.chunkPosY + 1, tPos.chunkPosZ, tList2, aList);
ChunkPosition tCoordinate = new ChunkPosition(aX, aY + 1, aZ);
- if(tPos.chunkPosX == mX && tPos.chunkPosZ == mZ && tPos.chunkPosY < getBaseMetaTileEntity().getYCoord() && !aList.contains(tCoordinate) && !tList2.contains(tCoordinate))
+ if (tPos.chunkPosX == mX && tPos.chunkPosZ == mZ && tPos.chunkPosY < getBaseMetaTileEntity().getYCoord() && !aList.contains(tCoordinate) && !tList2.contains(tCoordinate))
tList2.add(tCoordinate);
- } while(true);
+ } while (true);
aList.addAll(tList2);
tList1 = tList2;
tList2 = new ArrayList();
}
- for(int y = getBaseMetaTileEntity().getYCoord(); y >= aY; y--)
+ for (int y = getBaseMetaTileEntity().getYCoord(); y >= aY; y--)
aList.remove(new ChunkPosition(aX, y, aZ));
- }
-
- private boolean addToFirstListIfFluidAndNotAlreadyAddedToAnyOfTheLists(int aX, int aY, int aZ, ArrayList<ChunkPosition> aList1,
- ArrayList<ChunkPosition> aList2) {
- ChunkPosition tCoordinate = new ChunkPosition(aX, aY, aZ);
- if ((!aList1.contains(tCoordinate)) && (!aList2.contains(tCoordinate))) {
- Block aBlock = getBaseMetaTileEntity().getBlock(aX, aY, aZ);
- if ((this.mPumpedBlock1 == aBlock) || (this.mPumpedBlock2 == aBlock)) {
- aList1.add(tCoordinate);
- return true;
- }
- }
- return false;
- }
-
- private void getFluidAt(int aX, int aY, int aZ) {
- Block aBlock = getBaseMetaTileEntity().getBlock(aX, aY, aZ);
- if (GT_Utility.isBlockValid(aBlock)) {
- if ((aBlock == Blocks.water) || (aBlock == Blocks.flowing_water)) {
- this.mPumpedBlock1 = Blocks.water;
- this.mPumpedBlock2 = Blocks.flowing_water;
- return;
- }
- if ((aBlock == Blocks.lava) || (aBlock == Blocks.flowing_lava)) {
- this.mPumpedBlock1 = Blocks.lava;
- this.mPumpedBlock2 = Blocks.flowing_lava;
- return;
- }
- if ((aBlock instanceof IFluidBlock)) {
- this.mPumpedBlock1 = aBlock;
- this.mPumpedBlock2 = aBlock;
- return;
- }
- }
- this.mPumpedBlock1 = null;
- this.mPumpedBlock2 = null;
- }
-
- private boolean consumeFluid(int aX, int aY, int aZ) {
- Block aBlock = getBaseMetaTileEntity().getBlock(aX, aY, aZ);
- int aMeta = getBaseMetaTileEntity().getMetaID(aX, aY, aZ);
- if ((GT_Utility.isBlockValid(aBlock)) && ((this.mPumpedBlock1 == aBlock) || (this.mPumpedBlock2 == aBlock))) {
- if ((aBlock == Blocks.water) || (aBlock == Blocks.flowing_water)) {
- if (aMeta == 0) {
- if (this.mFluid == null) {
- getBaseMetaTileEntity().decreaseStoredEnergyUnits(16*((int)Math.pow(4, this.mTier)), true);
- this.mFluid = GT_ModHandler.getWater(1000L);
- } else if (GT_ModHandler.isWater(this.mFluid)) {
- getBaseMetaTileEntity().decreaseStoredEnergyUnits(16*((int)Math.pow(4, this.mTier)), true);
- this.mFluid.amount += 1000;
- } else {
- return false;
- }
- } else {
- getBaseMetaTileEntity().decreaseStoredEnergyUnits(4*((int)Math.pow(4, this.mTier)), true);
- }
- }
- if ((aBlock == Blocks.lava) || (aBlock == Blocks.flowing_lava)) {
- if (aMeta == 0) {
- if (this.mFluid == null) {
- getBaseMetaTileEntity().decreaseStoredEnergyUnits(16*((int)Math.pow(4, this.mTier)), true);
- this.mFluid = GT_ModHandler.getLava(1000L);
- } else if (GT_ModHandler.isLava(this.mFluid)) {
- getBaseMetaTileEntity().decreaseStoredEnergyUnits(16*((int)Math.pow(4, this.mTier)), true);
- this.mFluid.amount += 1000;
- } else {
- return false;
- }
- } else {
- getBaseMetaTileEntity().decreaseStoredEnergyUnits(4*((int)Math.pow(4, this.mTier)), true);
- }
- }
- if ((aBlock instanceof IFluidBlock)) {
- if (this.mFluid == null) {
- this.mFluid = ((IFluidBlock) aBlock).drain(getBaseMetaTileEntity().getWorld(), aX, aY, aZ, true);
- getBaseMetaTileEntity().decreaseStoredEnergyUnits(this.mFluid == null ? 1000 : this.mFluid.amount, true);
- }else if(this.mFluid.isFluidEqual(((IFluidBlock) aBlock).drain(getBaseMetaTileEntity().getWorld(), aX, aY, aZ, false))){
- this.getBaseMetaTileEntity().getWorld().setBlockToAir( aX, aY, aZ);
- this.mFluid.amount += 1000;
- getBaseMetaTileEntity().decreaseStoredEnergyUnits(16*((int)Math.pow(4, this.mTier)), true);
- }else {
- return false;
- }
- }
- getBaseMetaTileEntity().getWorld().setBlock(aX, aY, aZ,Blocks.air,0,2);
- return true;
- }
- return false;
- }
-
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) return true;
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
-
-
- @Override public boolean isSimpleMachine() {return false;}
- @Override public boolean isOverclockerUpgradable() {return false;}
- @Override public boolean isTransformerUpgradable() {return false;}
- @Override public boolean isElectric() {return true;}
- @Override public boolean isFacingValid(byte aFacing) {return true;}
- @Override public boolean isEnetInput() {return true;}
- @Override public boolean isInputFacing(byte aSide) {return true;}
- @Override public boolean isOutputFacing(byte aSide) {return false;}
- @Override public boolean isTeleporterCompatible() {return false;}
- @Override public long getMinimumStoredEU() {return V[mTier]*16;}
- @Override public long maxEUStore() {return V[mTier]*64;}
- @Override public long maxEUInput() {return V[mTier];}
- @Override public long maxSteamStore() {return maxEUStore();}
- @Override public long maxAmperesIn() {return 2;}
- @Override public int getStackDisplaySlot() {return 2;}
- @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;}
-
-
- @Override
- public int getCapacity() {
- return 16000*this.mTier;
- }
- @Override
- public int getTankPressure() {
- return 100;
- }
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1], (aSide == 0||aSide ==1) ? null : new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ADV_PUMP) };
- }
-
- @Override
- public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return getTexturesInactive(aBaseTexture);
- }
-
- @Override
- public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[] {
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ADV_PUMP),new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ADV_PUMP),
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ADV_PUMP),new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ADV_PUMP),};
- }
+ }
+
+ private boolean addToFirstListIfFluidAndNotAlreadyAddedToAnyOfTheLists(int aX, int aY, int aZ, ArrayList<ChunkPosition> aList1,
+ ArrayList<ChunkPosition> aList2) {
+ ChunkPosition tCoordinate = new ChunkPosition(aX, aY, aZ);
+ if ((!aList1.contains(tCoordinate)) && (!aList2.contains(tCoordinate))) {
+ Block aBlock = getBaseMetaTileEntity().getBlock(aX, aY, aZ);
+ if ((this.mPumpedBlock1 == aBlock) || (this.mPumpedBlock2 == aBlock)) {
+ aList1.add(tCoordinate);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private void getFluidAt(int aX, int aY, int aZ) {
+ Block aBlock = getBaseMetaTileEntity().getBlock(aX, aY, aZ);
+ if (GT_Utility.isBlockValid(aBlock)) {
+ if ((aBlock == Blocks.water) || (aBlock == Blocks.flowing_water)) {
+ this.mPumpedBlock1 = Blocks.water;
+ this.mPumpedBlock2 = Blocks.flowing_water;
+ return;
+ }
+ if ((aBlock == Blocks.lava) || (aBlock == Blocks.flowing_lava)) {
+ this.mPumpedBlock1 = Blocks.lava;
+ this.mPumpedBlock2 = Blocks.flowing_lava;
+ return;
+ }
+ if ((aBlock instanceof IFluidBlock)) {
+ this.mPumpedBlock1 = aBlock;
+ this.mPumpedBlock2 = aBlock;
+ return;
+ }
+ }
+ this.mPumpedBlock1 = null;
+ this.mPumpedBlock2 = null;
+ }
+
+ private boolean consumeFluid(int aX, int aY, int aZ) {
+ Block aBlock = getBaseMetaTileEntity().getBlock(aX, aY, aZ);
+ int aMeta = getBaseMetaTileEntity().getMetaID(aX, aY, aZ);
+ if ((GT_Utility.isBlockValid(aBlock)) && ((this.mPumpedBlock1 == aBlock) || (this.mPumpedBlock2 == aBlock))) {
+ if ((aBlock == Blocks.water) || (aBlock == Blocks.flowing_water)) {
+ if (aMeta == 0) {
+ if (this.mFluid == null) {
+ getBaseMetaTileEntity().decreaseStoredEnergyUnits(16 * ((int) Math.pow(4, this.mTier)), true);
+ this.mFluid = GT_ModHandler.getWater(1000L);
+ } else if (GT_ModHandler.isWater(this.mFluid)) {
+ getBaseMetaTileEntity().decreaseStoredEnergyUnits(16 * ((int) Math.pow(4, this.mTier)), true);
+ this.mFluid.amount += 1000;
+ } else {
+ return false;
+ }
+ } else {
+ getBaseMetaTileEntity().decreaseStoredEnergyUnits(4 * ((int) Math.pow(4, this.mTier)), true);
+ }
+ }
+ if ((aBlock == Blocks.lava) || (aBlock == Blocks.flowing_lava)) {
+ if (aMeta == 0) {
+ if (this.mFluid == null) {
+ getBaseMetaTileEntity().decreaseStoredEnergyUnits(16 * ((int) Math.pow(4, this.mTier)), true);
+ this.mFluid = GT_ModHandler.getLava(1000L);
+ } else if (GT_ModHandler.isLava(this.mFluid)) {
+ getBaseMetaTileEntity().decreaseStoredEnergyUnits(16 * ((int) Math.pow(4, this.mTier)), true);
+ this.mFluid.amount += 1000;
+ } else {
+ return false;
+ }
+ } else {
+ getBaseMetaTileEntity().decreaseStoredEnergyUnits(4 * ((int) Math.pow(4, this.mTier)), true);
+ }
+ }
+ if ((aBlock instanceof IFluidBlock)) {
+ if (this.mFluid == null) {
+ this.mFluid = ((IFluidBlock) aBlock).drain(getBaseMetaTileEntity().getWorld(), aX, aY, aZ, true);
+ getBaseMetaTileEntity().decreaseStoredEnergyUnits(this.mFluid == null ? 1000 : this.mFluid.amount, true);
+ } else if (this.mFluid.isFluidEqual(((IFluidBlock) aBlock).drain(getBaseMetaTileEntity().getWorld(), aX, aY, aZ, false))) {
+ this.getBaseMetaTileEntity().getWorld().setBlockToAir(aX, aY, aZ);
+ this.mFluid.amount += 1000;
+ getBaseMetaTileEntity().decreaseStoredEnergyUnits(16 * ((int) Math.pow(4, this.mTier)), true);
+ } else {
+ return false;
+ }
+ }
+ getBaseMetaTileEntity().getWorld().setBlock(aX, aY, aZ, Blocks.air, 0, 2);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) return true;
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isOverclockerUpgradable() {
+ return false;
+ }
+
+ @Override
+ public boolean isTransformerUpgradable() {
+ return false;
+ }
+
+ @Override
+ public boolean isElectric() {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return true;
+ }
+
+ @Override
+ public boolean isInputFacing(byte aSide) {
+ return true;
+ }
+
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public boolean isTeleporterCompatible() {
+ return false;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return V[mTier] * 16;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return V[mTier] * 64;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return V[mTier];
+ }
+
+ @Override
+ public long maxSteamStore() {
+ return maxEUStore();
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return 2;
+ }
+
+ @Override
+ public int getStackDisplaySlot() {
+ return 2;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+
+ @Override
+ public int getCapacity() {
+ return 16000 * this.mTier;
+ }
+
+ @Override
+ public int getTankPressure() {
+ return 100;
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], (aSide == 0 || aSide == 1) ? null : new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ADV_PUMP)};
+ }
+
+ @Override
+ public ITexture[] getTexturesActive(ITexture aBaseTexture) {
+ return getTexturesInactive(aBaseTexture);
+ }
+
+ @Override
+ public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
+ return new ITexture[]{
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ADV_PUMP), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ADV_PUMP),
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ADV_PUMP), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ADV_PUMP),};
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java
index c5a0ecfc92..6f3818b47e 100644
--- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java
+++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java
@@ -1,12 +1,7 @@
package gregtech.common.tileentities.machines.basic;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.Element;
-import gregtech.api.enums.ItemList;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
-import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
+import gregtech.api.enums.*;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
@@ -15,105 +10,86 @@ import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
import gregtech.common.items.behaviors.Behaviour_DataOrb;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
+import java.util.Iterator;
+
public class GT_MetaTileEntity_Replicator
- extends GT_MetaTileEntity_BasicMachine
-{
- private static int sHeaviestElementMass = 0;
-
- public GT_MetaTileEntity_Replicator(int aID, String aName, String aNameRegional, int aTier)
- {
- super(aID, aName, aNameRegional, aTier, 1, "Producing Elemental Matter", 1, 1, "Replicator.png", "", new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_REPLICATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_REPLICATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_REPLICATOR) });
- }
-
- public GT_MetaTileEntity_Replicator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName)
- {
- super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_Replicator(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
- }
-
- public int checkRecipe()
- {
- FluidStack tFluid = getFillableStack();
- if ((tFluid != null) && (tFluid.isFluidEqual(Materials.UUMatter.getFluid(1L))))
- {
- ItemStack tDataOrb = getSpecialSlot();
- if ((ItemList.Tool_DataOrb.isStackEqual(tDataOrb, false, true)) && (Behaviour_DataOrb.getDataTitle(tDataOrb).equals("Elemental-Scan")))
- {
- Materials tMaterial = (Materials)Element.get(Behaviour_DataOrb.getDataName(tDataOrb)).mLinkedMaterials.get(0);
- long tMass = tMaterial.getMass();
- if ((tFluid.amount >= tMass) && (tMass > 0L))
- {
- this.mEUt = ((int)gregtech.api.enums.GT_Values.V[this.mTier]);
- this.mMaxProgresstime = ((int)(tMass * 512L / (1 << this.mTier - 1)));
- if ((this.mOutputItems[0] = GT_OreDictUnificator.get(OrePrefixes.dust, tMaterial, 1L)) == null)
- {
- if ((this.mOutputItems[0] = GT_OreDictUnificator.get(OrePrefixes.cell, tMaterial, 1L)) != null) {
- if ((this.mOutputFluid = GT_Utility.getFluidForFilledItem(this.mOutputItems[0], true)) == null)
- {
- if (ItemList.Cell_Empty.isStackEqual(getInputAt(0))) {
- if (canOutput(new ItemStack[] { this.mOutputItems[0] }))
- {
- getInputAt(0).stackSize -= 1; FluidStack
- tmp231_230 = tFluid;tmp231_230.amount = ((int)(tmp231_230.amount - tMass));
- return 2;
- }
- }
- }
- else
- {
- this.mOutputItems[0] = null;
- if ((getDrainableStack() == null) || ((getDrainableStack().isFluidEqual(this.mOutputFluid)) && (getDrainableStack().amount < 16000)))
- {
- FluidStack tmp287_286 = tFluid;tmp287_286.amount = ((int)(tmp287_286.amount - tMass));
- return 2;
+ extends GT_MetaTileEntity_BasicMachine {
+ private static int sHeaviestElementMass = 0;
+
+ public GT_MetaTileEntity_Replicator(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 1, "Producing Elemental Matter", 1, 1, "Replicator.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_REPLICATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_REPLICATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_REPLICATOR)});
+ }
+
+ public GT_MetaTileEntity_Replicator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
+ super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Replicator(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
+ }
+
+ public int checkRecipe() {
+ FluidStack tFluid = getFillableStack();
+ if ((tFluid != null) && (tFluid.isFluidEqual(Materials.UUMatter.getFluid(1L)))) {
+ ItemStack tDataOrb = getSpecialSlot();
+ if ((ItemList.Tool_DataOrb.isStackEqual(tDataOrb, false, true)) && (Behaviour_DataOrb.getDataTitle(tDataOrb).equals("Elemental-Scan"))) {
+ Materials tMaterial = (Materials) Element.get(Behaviour_DataOrb.getDataName(tDataOrb)).mLinkedMaterials.get(0);
+ long tMass = tMaterial.getMass();
+ if ((tFluid.amount >= tMass) && (tMass > 0L)) {
+ this.mEUt = ((int) gregtech.api.enums.GT_Values.V[this.mTier]);
+ this.mMaxProgresstime = ((int) (tMass * 512L / (1 << this.mTier - 1)));
+ if ((this.mOutputItems[0] = GT_OreDictUnificator.get(OrePrefixes.dust, tMaterial, 1L)) == null) {
+ if ((this.mOutputItems[0] = GT_OreDictUnificator.get(OrePrefixes.cell, tMaterial, 1L)) != null) {
+ if ((this.mOutputFluid = GT_Utility.getFluidForFilledItem(this.mOutputItems[0], true)) == null) {
+ if (ItemList.Cell_Empty.isStackEqual(getInputAt(0))) {
+ if (canOutput(new ItemStack[]{this.mOutputItems[0]})) {
+ getInputAt(0).stackSize -= 1;
+ FluidStack
+ tmp231_230 = tFluid;
+ tmp231_230.amount = ((int) (tmp231_230.amount - tMass));
+ return 2;
+ }
+ }
+ } else {
+ this.mOutputItems[0] = null;
+ if ((getDrainableStack() == null) || ((getDrainableStack().isFluidEqual(this.mOutputFluid)) && (getDrainableStack().amount < 16000))) {
+ FluidStack tmp287_286 = tFluid;
+ tmp287_286.amount = ((int) (tmp287_286.amount - tMass));
+ return 2;
+ }
+ }
+ }
+ } else if (canOutput(new ItemStack[]{this.mOutputItems[0]})) {
+ FluidStack tmp322_321 = tFluid;
+ tmp322_321.amount = ((int) (tmp322_321.amount - tMass));
+ return 2;
+ }
}
- }
}
- }
- else if (canOutput(new ItemStack[] { this.mOutputItems[0] }))
- {
- FluidStack tmp322_321 = tFluid;tmp322_321.amount = ((int)(tmp322_321.amount - tMass));
- return 2;
- }
}
- }
+ return 0;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (ItemList.Cell_Empty.isStackEqual(aStack));
+ }
+
+ public boolean isFluidInputAllowed(FluidStack aFluid) {
+ return aFluid.isFluidEqual(Materials.UUMatter.getFluid(1L));
}
- return 0;
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
- {
- return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (ItemList.Cell_Empty.isStackEqual(aStack));
- }
-
- public boolean isFluidInputAllowed(FluidStack aFluid)
- {
- return aFluid.isFluidEqual(Materials.UUMatter.getFluid(1L));
- }
-
- public int getCapacity()
- {
- if ((sHeaviestElementMass == 0) && (GregTech_API.sPostloadFinished))
- {
- Materials tMaterial;
- for (Iterator i$ = Materials.VALUES.iterator(); i$.hasNext(); sHeaviestElementMass = Math.max(sHeaviestElementMass, (int)tMaterial.getMass()))
- {
- tMaterial = (Materials)i$.next();
- if ((tMaterial.mElement == null) || (tMaterial.mElement.mIsIsotope)) {}
- }
+
+ public int getCapacity() {
+ if ((sHeaviestElementMass == 0) && (GregTech_API.sPostloadFinished)) {
+ Materials tMaterial;
+ for (Iterator i$ = Materials.VALUES.iterator(); i$.hasNext(); sHeaviestElementMass = Math.max(sHeaviestElementMass, (int) tMaterial.getMass())) {
+ tMaterial = (Materials) i$.next();
+ if ((tMaterial.mElement == null) || (tMaterial.mElement.mIsIsotope)) {
+ }
+ }
+ }
+ return sHeaviestElementMass;
}
- return sHeaviestElementMass;
- }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java
index aab40f712d..171c6a847a 100644
--- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java
+++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java
@@ -3,7 +3,6 @@ package gregtech.common.tileentities.machines.basic;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
@@ -11,72 +10,59 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachin
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_RockBreaker
- extends GT_MetaTileEntity_BasicMachine
-{
- public GT_MetaTileEntity_RockBreaker(int aID, String aName, String aNameRegional, int aTier)
- {
- super(aID, aName, aNameRegional, aTier, 1, "Put Lava and Water adjacent", 1, 1, "RockBreaker.png", "", new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER) });
- }
-
- public GT_MetaTileEntity_RockBreaker(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName)
- {
- super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_RockBreaker(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipeList()
- {
- return GT_Recipe.GT_Recipe_Map.sRockBreakerFakeRecipes;
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
- {
- return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack));
- }
-
- public int checkRecipe()
- {
- IGregTechTileEntity aBaseMetaTileEntity = getBaseMetaTileEntity();
- if ((aBaseMetaTileEntity.getBlockOffset(0, 0, 1) == Blocks.water) || (aBaseMetaTileEntity.getBlockOffset(0, 0, -1) == Blocks.water) || (aBaseMetaTileEntity.getBlockOffset(-1, 0, 0) == Blocks.water) || (aBaseMetaTileEntity.getBlockOffset(1, 0, 0) == Blocks.water))
- {
- ItemStack tOutput = null;
- if (aBaseMetaTileEntity.getBlockOffset(0, 1, 0) == Blocks.lava) {
- tOutput = new ItemStack(Blocks.stone, 1);
- } else if ((aBaseMetaTileEntity.getBlockOffset(0, 0, 1) == Blocks.lava) || (aBaseMetaTileEntity.getBlockOffset(0, 0, -1) == Blocks.lava) || (aBaseMetaTileEntity.getBlockOffset(-1, 0, 0) == Blocks.lava) || (aBaseMetaTileEntity.getBlockOffset(1, 0, 0) == Blocks.lava)) {
- tOutput = new ItemStack(Blocks.cobblestone, 1);
- }
- if (tOutput != null) {
- if (GT_Utility.areStacksEqual(getInputAt(0), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L)))
- {
- tOutput = new ItemStack(Blocks.obsidian, 1);
- if (canOutput(new ItemStack[] { tOutput }))
- {
- getInputAt(0).stackSize -= 1;
- this.mOutputItems[0] = tOutput;
- this.mMaxProgresstime = (128 / (1 << this.mTier - 1));
- this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
- return 2;
- }
- }
- else if (canOutput(new ItemStack[] { tOutput }))
- {
- this.mOutputItems[0] = tOutput;
- this.mMaxProgresstime = (16 / (1 << this.mTier - 1));
- this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
- return 2;
+ extends GT_MetaTileEntity_BasicMachine {
+ public GT_MetaTileEntity_RockBreaker(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 1, "Put Lava and Water adjacent", 1, 1, "RockBreaker.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER)});
+ }
+
+ public GT_MetaTileEntity_RockBreaker(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
+ super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_RockBreaker(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeList() {
+ return GT_Recipe.GT_Recipe_Map.sRockBreakerFakeRecipes;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack));
+ }
+
+ public int checkRecipe() {
+ IGregTechTileEntity aBaseMetaTileEntity = getBaseMetaTileEntity();
+ if ((aBaseMetaTileEntity.getBlockOffset(0, 0, 1) == Blocks.water) || (aBaseMetaTileEntity.getBlockOffset(0, 0, -1) == Blocks.water) || (aBaseMetaTileEntity.getBlockOffset(-1, 0, 0) == Blocks.water) || (aBaseMetaTileEntity.getBlockOffset(1, 0, 0) == Blocks.water)) {
+ ItemStack tOutput = null;
+ if (aBaseMetaTileEntity.getBlockOffset(0, 1, 0) == Blocks.lava) {
+ tOutput = new ItemStack(Blocks.stone, 1);
+ } else if ((aBaseMetaTileEntity.getBlockOffset(0, 0, 1) == Blocks.lava) || (aBaseMetaTileEntity.getBlockOffset(0, 0, -1) == Blocks.lava) || (aBaseMetaTileEntity.getBlockOffset(-1, 0, 0) == Blocks.lava) || (aBaseMetaTileEntity.getBlockOffset(1, 0, 0) == Blocks.lava)) {
+ tOutput = new ItemStack(Blocks.cobblestone, 1);
+ }
+ if (tOutput != null) {
+ if (GT_Utility.areStacksEqual(getInputAt(0), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L))) {
+ tOutput = new ItemStack(Blocks.obsidian, 1);
+ if (canOutput(new ItemStack[]{tOutput})) {
+ getInputAt(0).stackSize -= 1;
+ this.mOutputItems[0] = tOutput;
+ this.mMaxProgresstime = (128 / (1 << this.mTier - 1));
+ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ return 2;
+ }
+ } else if (canOutput(new ItemStack[]{tOutput})) {
+ this.mOutputItems[0] = tOutput;
+ this.mMaxProgresstime = (16 / (1 << this.mTier - 1));
+ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ return 2;
+ }
+ }
}
- }
+ return 0;
}
- return 0;
- }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java
index 76a79c7f9e..95d6ef9364 100644
--- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java
+++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java
@@ -1,229 +1,191 @@
package gregtech.common.tileentities.machines.basic;
import forestry.api.genetics.AlleleManager;
-import forestry.api.genetics.IAlleleRegistry;
import forestry.api.genetics.IIndividual;
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.Element;
-import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.ItemList;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
-import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
+import gregtech.api.enums.*;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.objects.ItemData;
-import gregtech.api.objects.MaterialStack;
import gregtech.api.util.GT_Log;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import gregtech.common.items.behaviors.Behaviour_DataOrb;
-
-import java.util.Map;
-
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
-import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_Scanner
- extends GT_MetaTileEntity_BasicMachine
-{
- public GT_MetaTileEntity_Scanner(int aID, String aName, String aNameRegional, int aTier)
- {
- super(aID, aName, aNameRegional, aTier, 1, "Scans Crops and other things.", 1, 1, "Scanner.png", "", new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_SCANNER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_SCANNER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_SCANNER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_SCANNER) });
- }
-
- public GT_MetaTileEntity_Scanner(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName)
- {
- super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_Scanner(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
- }
-
- public int checkRecipe()
- {
- ItemStack aStack = getInputAt(0);
- if (getOutputAt(0) != null)
- {
- this.mOutputBlocked += 1;
+ extends GT_MetaTileEntity_BasicMachine {
+ public GT_MetaTileEntity_Scanner(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 1, "Scans Crops and other things.", 1, 1, "Scanner.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_SCANNER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_SCANNER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_SCANNER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_SCANNER)});
+ }
+
+ public GT_MetaTileEntity_Scanner(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
+ super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Scanner(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
}
- else if ((GT_Utility.isStackValid(aStack)) && (aStack.stackSize > 0))
- {
- if ((getFillableStack() != null) && (getFillableStack().containsFluid(Materials.Honey.getFluid(100L)))) {
- try
- {
- Object tIndividual = AlleleManager.alleleRegistry.getIndividual(aStack);
- if (tIndividual != null)
- {
- if (((IIndividual)tIndividual).analyze())
- {
- getFillableStack().amount -= 100;
- this.mOutputItems[0] = GT_Utility.copy(new Object[] { aStack });
- aStack.stackSize = 0;
- NBTTagCompound tNBT = new NBTTagCompound();
- ((IIndividual)tIndividual).writeToNBT(tNBT);
- this.mOutputItems[0].setTagCompound(tNBT);
- this.mMaxProgresstime = (500 / (1 << this.mTier - 1));
- this.mEUt = (2 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
- return 2;
+
+ public int checkRecipe() {
+ ItemStack aStack = getInputAt(0);
+ if (getOutputAt(0) != null) {
+ this.mOutputBlocked += 1;
+ } else if ((GT_Utility.isStackValid(aStack)) && (aStack.stackSize > 0)) {
+ if ((getFillableStack() != null) && (getFillableStack().containsFluid(Materials.Honey.getFluid(100L)))) {
+ try {
+ Object tIndividual = AlleleManager.alleleRegistry.getIndividual(aStack);
+ if (tIndividual != null) {
+ if (((IIndividual) tIndividual).analyze()) {
+ getFillableStack().amount -= 100;
+ this.mOutputItems[0] = GT_Utility.copy(new Object[]{aStack});
+ aStack.stackSize = 0;
+ NBTTagCompound tNBT = new NBTTagCompound();
+ ((IIndividual) tIndividual).writeToNBT(tNBT);
+ this.mOutputItems[0].setTagCompound(tNBT);
+ this.mMaxProgresstime = (500 / (1 << this.mTier - 1));
+ this.mEUt = (2 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ return 2;
+ }
+ this.mOutputItems[0] = GT_Utility.copy(new Object[]{aStack});
+ aStack.stackSize = 0;
+ this.mMaxProgresstime = 1;
+ this.mEUt = 1;
+ return 2;
+ }
+ } catch (Throwable e) {
+ if (GT_Values.D1) {
+ e.printStackTrace(GT_Log.err);
+ }
+ }
}
- this.mOutputItems[0] = GT_Utility.copy(new Object[] { aStack });
- aStack.stackSize = 0;
- this.mMaxProgresstime = 1;
- this.mEUt = 1;
- return 2;
- }
- }
- catch (Throwable e)
- {
- if (GT_Values.D1) {
- e.printStackTrace(GT_Log.err);
- }
- }
- }
- if (ItemList.IC2_Crop_Seeds.isStackEqual(aStack, true, true))
- {
- NBTTagCompound tNBT = aStack.getTagCompound();
- if (tNBT == null) {
- tNBT = new NBTTagCompound();
- }
- if (tNBT.getByte("scan") < 4)
- {
- tNBT.setByte("scan", (byte)4);
- this.mMaxProgresstime = (160 / (1 << this.mTier - 1));
- this.mEUt = (8 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
- }
- else
- {
- this.mMaxProgresstime = 1;
- this.mEUt = 1;
- }
- aStack.stackSize -= 1;
- this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[] { aStack });
- this.mOutputItems[0].setTagCompound(tNBT);
- return 2;
- }
- if (ItemList.Tool_DataOrb.isStackEqual(getSpecialSlot(), false, true))
- {
- if (ItemList.Tool_DataOrb.isStackEqual(aStack, false, true))
- {
- aStack.stackSize -= 1;
- this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[] { getSpecialSlot() });
- this.mMaxProgresstime = (512 / (1 << this.mTier - 1));
- this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
- return 2;
- }
- ItemData tData = GT_OreDictUnificator.getAssociation(aStack);
- if ((tData != null) && ((tData.mPrefix == OrePrefixes.dust) || (tData.mPrefix == OrePrefixes.cell)) && (tData.mMaterial.mMaterial.mElement != null) && (!tData.mMaterial.mMaterial.mElement.mIsIsotope) && (tData.mMaterial.mMaterial != Materials.Magic) && (tData.mMaterial.mMaterial.getMass() > 0L))
- {
- getSpecialSlot().stackSize -= 1;
- aStack.stackSize -= 1;
-
- this.mOutputItems[0] = ItemList.Tool_DataOrb.get(1L, new Object[0]);
- Behaviour_DataOrb.setDataTitle(this.mOutputItems[0], "Elemental-Scan");
- Behaviour_DataOrb.setDataName(this.mOutputItems[0], tData.mMaterial.mMaterial.mElement.name());
- this.mMaxProgresstime = ((int)(tData.mMaterial.mMaterial.getMass() * 8192L / (1 << this.mTier - 1)));
- this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
- return 2;
- }
- }
- if (ItemList.Tool_DataStick.isStackEqual(getSpecialSlot(), false, true))
- {
- if (ItemList.Tool_DataStick.isStackEqual(aStack, false, true))
- {
- aStack.stackSize -= 1;
- this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[] { getSpecialSlot() });
- this.mMaxProgresstime = (128 / (1 << this.mTier - 1));
- this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
- return 2;
+ if (ItemList.IC2_Crop_Seeds.isStackEqual(aStack, true, true)) {
+ NBTTagCompound tNBT = aStack.getTagCompound();
+ if (tNBT == null) {
+ tNBT = new NBTTagCompound();
+ }
+ if (tNBT.getByte("scan") < 4) {
+ tNBT.setByte("scan", (byte) 4);
+ this.mMaxProgresstime = (160 / (1 << this.mTier - 1));
+ this.mEUt = (8 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ } else {
+ this.mMaxProgresstime = 1;
+ this.mEUt = 1;
+ }
+ aStack.stackSize -= 1;
+ this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{aStack});
+ this.mOutputItems[0].setTagCompound(tNBT);
+ return 2;
+ }
+ if (ItemList.Tool_DataOrb.isStackEqual(getSpecialSlot(), false, true)) {
+ if (ItemList.Tool_DataOrb.isStackEqual(aStack, false, true)) {
+ aStack.stackSize -= 1;
+ this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()});
+ this.mMaxProgresstime = (512 / (1 << this.mTier - 1));
+ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ return 2;
+ }
+ ItemData tData = GT_OreDictUnificator.getAssociation(aStack);
+ if ((tData != null) && ((tData.mPrefix == OrePrefixes.dust) || (tData.mPrefix == OrePrefixes.cell)) && (tData.mMaterial.mMaterial.mElement != null) && (!tData.mMaterial.mMaterial.mElement.mIsIsotope) && (tData.mMaterial.mMaterial != Materials.Magic) && (tData.mMaterial.mMaterial.getMass() > 0L)) {
+ getSpecialSlot().stackSize -= 1;
+ aStack.stackSize -= 1;
+
+ this.mOutputItems[0] = ItemList.Tool_DataOrb.get(1L, new Object[0]);
+ Behaviour_DataOrb.setDataTitle(this.mOutputItems[0], "Elemental-Scan");
+ Behaviour_DataOrb.setDataName(this.mOutputItems[0], tData.mMaterial.mMaterial.mElement.name());
+ this.mMaxProgresstime = ((int) (tData.mMaterial.mMaterial.getMass() * 8192L / (1 << this.mTier - 1)));
+ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ return 2;
+ }
+ }
+ if (ItemList.Tool_DataStick.isStackEqual(getSpecialSlot(), false, true)) {
+ if (ItemList.Tool_DataStick.isStackEqual(aStack, false, true)) {
+ aStack.stackSize -= 1;
+ this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()});
+ this.mMaxProgresstime = (128 / (1 << this.mTier - 1));
+ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ return 2;
+ }
+ if (aStack.getItem() == Items.written_book) {
+ getSpecialSlot().stackSize -= 1;
+ aStack.stackSize -= 1;
+
+ this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()});
+ this.mOutputItems[0].setTagCompound(aStack.getTagCompound());
+ this.mMaxProgresstime = (128 / (1 << this.mTier - 1));
+ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ return 2;
+ }
+ if (aStack.getItem() == Items.filled_map) {
+ getSpecialSlot().stackSize -= 1;
+ aStack.stackSize -= 1;
+
+ this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()});
+ this.mOutputItems[0].setTagCompound(GT_Utility.getNBTContainingShort(new NBTTagCompound(), "map_id", (short) aStack.getItemDamage()));
+ this.mMaxProgresstime = (128 / (1 << this.mTier - 1));
+ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ return 2;
+ }
+ }
+ if (getSpecialSlot() == null && ItemList.Tool_DataStick.isStackEqual(aStack, false, true)) {
+ if (GT_Utility.ItemNBT.getBookTitle(aStack).equals("Raw Prospection Data")) {
+ GT_Utility.ItemNBT.setBookTitle(aStack, "Analyzed Prospection Data");
+ GT_Utility.ItemNBT.convertProspectionData(aStack);
+ aStack.stackSize -= 1;
+
+ this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{aStack});
+ this.mMaxProgresstime = (1000 / (1 << this.mTier - 1));
+ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ return 2;
+
+ }
+ }
+
}
- if (aStack.getItem() == Items.written_book)
- {
- getSpecialSlot().stackSize -= 1;
- aStack.stackSize -= 1;
-
- this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[] { getSpecialSlot() });
- this.mOutputItems[0].setTagCompound(aStack.getTagCompound());
- this.mMaxProgresstime = (128 / (1 << this.mTier - 1));
- this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
- return 2;
+ return 0;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (mProgresstime >= (mMaxProgresstime - 1)) {
+ try {
+ if (this.mOutputItems[0].getUnlocalizedName().equals("gt.metaitem.01.32707")) {
+ GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "scanning");
+ }
+ } catch (Exception e) {
+ }
}
- if (aStack.getItem() == Items.filled_map)
- {
- getSpecialSlot().stackSize -= 1;
- aStack.stackSize -= 1;
-
- this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[] { getSpecialSlot() });
- this.mOutputItems[0].setTagCompound(GT_Utility.getNBTContainingShort(new NBTTagCompound(), "map_id", (short)aStack.getItemDamage()));
- this.mMaxProgresstime = (128 / (1 << this.mTier - 1));
- this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
- return 2;
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ }
+
+
+ public GT_Recipe.GT_Recipe_Map getRecipeList() {
+ return GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes;
+ }
+
+ public int getCapacity() {
+ return 1000;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack));
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(212)), 10, 1.0F, aX, aY, aZ);
}
- }
- if(getSpecialSlot()==null&&ItemList.Tool_DataStick.isStackEqual(aStack, false, true)){
- if(GT_Utility.ItemNBT.getBookTitle(aStack).equals("Raw Prospection Data")){
- GT_Utility.ItemNBT.setBookTitle(aStack,"Analyzed Prospection Data");
- GT_Utility.ItemNBT.convertProspectionData(aStack);
- aStack.stackSize -= 1;
-
- this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[] { aStack });
- this.mMaxProgresstime = (1000 / (1 << this.mTier - 1));
- this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
- return 2;
-
- }
- }
-
}
- return 0;
- }
-
-@Override
-public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (mProgresstime>=(mMaxProgresstime-1)) {try{
- if(this.mOutputItems[0].getUnlocalizedName().equals("gt.metaitem.01.32707")){
- GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "scanning");}}catch (Exception e){}
- }
- super.onPostTick(aBaseMetaTileEntity, aTick);
-}
-
- public GT_Recipe.GT_Recipe_Map getRecipeList()
- {
- return GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes;
- }
-
- public int getCapacity()
- {
- return 1000;
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
- {
- return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack));
- }
-
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
- {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 1) {
- GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(212)), 10, 1.0F, aX, aY, aZ);
+ public void startProcess() {
+ sendLoopStart((byte) 1);
}
- }
-
- public void startProcess()
- {
- sendLoopStart((byte)1);
- }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java
index 09b06b033e..5af6e69cee 100644
--- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java
+++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java
@@ -1,23 +1,10 @@
package gregtech.common.tileentities.machines.basic;
-import ic2.core.Ic2Items;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraftforge.fluids.FluidStack;
import gregtech.api.GregTech_API;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
@@ -27,83 +14,86 @@ import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
import gregtech.common.blocks.GT_Block_Ores;
import gregtech.common.blocks.GT_TileEntity_Ores;
+import ic2.core.Ic2Items;
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraftforge.fluids.FluidStack;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class GT_MetaTileEntity_SeismicProspector extends GT_MetaTileEntity_BasicMachine {
+
+ boolean ready = false;
+
+ public GT_MetaTileEntity_SeismicProspector(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 1, "Place, activate with explosives, use Data Stick", 1, 1, "Default.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER)});
+ }
+
+ public GT_MetaTileEntity_SeismicProspector(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
+ super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_SeismicProspector(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
+ }
-public class GT_MetaTileEntity_SeismicProspector extends GT_MetaTileEntity_BasicMachine{
-
- boolean ready = false;
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+ ItemStack aStack = aPlayer.getCurrentEquippedItem();
+ if ((aStack != null) && (aStack.getItem() == Item.getItemFromBlock(Blocks.tnt) || aStack.getItem() == Ic2Items.industrialTnt.getItem()) && aStack.stackSize > 7 && !ready) {
+ if ((!aPlayer.capabilities.isCreativeMode) && (aStack.stackSize != 111)) {
+ aStack.stackSize -= 8;
+ }
+ this.ready = true;
+ this.mMaxProgresstime = 200;
+ } else if (ready && mMaxProgresstime == 0 && aStack != null && aStack.stackSize == 1 && aStack.getItem() == ItemList.Tool_DataStick.getItem()) {
+ this.ready = false;
+ GT_Utility.ItemNBT.setBookTitle(aPlayer.getCurrentEquippedItem(), "Raw Prospection Data");
+ List<String> tStringList = new ArrayList<String>();
+ for (int i = this.getBaseMetaTileEntity().getYCoord(); i > 0; i--) {
+ for (int f = -1; f < 2; f++) {
+ for (int g = -1; g < 2; g++) {
+ Block tBlock = this.getBaseMetaTileEntity().getBlockOffset(f, -i, g);
+ if ((tBlock instanceof GT_Block_Ores)) {
+ TileEntity tTileEntity = getBaseMetaTileEntity().getWorld().getTileEntity(getBaseMetaTileEntity().getXCoord() + f, getBaseMetaTileEntity().getYCoord() + (-i), getBaseMetaTileEntity().getZCoord() + g);
+ if ((tTileEntity instanceof GT_TileEntity_Ores)) {
+ Materials tMaterial = GregTech_API.sGeneratedMaterials[(((GT_TileEntity_Ores) tTileEntity).mMetaData % 1000)];
+ if ((tMaterial != null) && (tMaterial != Materials._NULL)) {
+ if (!tStringList.contains(tMaterial.mDefaultLocalName)) {
+ tStringList.add(tMaterial.mDefaultLocalName);
+ }
+ }
+ }
+ } else {
+ int tMetaID = getBaseMetaTileEntity().getWorld().getBlockMetadata(getBaseMetaTileEntity().getXCoord() + f, getBaseMetaTileEntity().getYCoord() + (-i), getBaseMetaTileEntity().getZCoord() + g);
+ ItemData tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID));
+ if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))) {
+ if (!tStringList.contains(tAssotiation.mMaterial.mMaterial.mDefaultLocalName)) {
+ tStringList.add(tAssotiation.mMaterial.mMaterial.mDefaultLocalName);
+ }
+ }
+ }
+ }
+ }
+ }
+ FluidStack tFluid = GT_Utility.getUndergroundOil(getBaseMetaTileEntity().getWorld(), getBaseMetaTileEntity().getXCoord(), getBaseMetaTileEntity().getZCoord());
+ String[] tStringArray = new String[tStringList.size()];
+ {
+ for (int i = 0; i < tStringArray.length; i++) {
+ tStringArray[i] = tStringList.get(i);
+ }
+ }
+ GT_Utility.ItemNBT.setProspectionData(aPlayer.getCurrentEquippedItem(), this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId, tFluid, tStringArray);
+ }
+ }
- public GT_MetaTileEntity_SeismicProspector(int aID, String aName, String aNameRegional, int aTier)
- {
- super(aID, aName, aNameRegional, aTier, 1, "Place, activate with explosives, use Data Stick", 1, 1, "Default.png", "", new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER) });
- }
-
- public GT_MetaTileEntity_SeismicProspector(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName)
- {
- super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_SeismicProspector(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
- }
+ return true;
+ }
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isServerSide()) {
- ItemStack aStack = aPlayer.getCurrentEquippedItem();
- if ((aStack != null) && (aStack.getItem() == Item.getItemFromBlock(Blocks.tnt)||aStack.getItem() == Ic2Items.industrialTnt.getItem()) && aStack.stackSize > 7&&!ready) {
- if ((!aPlayer.capabilities.isCreativeMode) && (aStack.stackSize != 111)) {
- aStack.stackSize -= 8;
- }
- this.ready = true;
- this.mMaxProgresstime = 200;
- } else if (ready&&mMaxProgresstime==0&&aStack!=null&&aStack.stackSize==1&&aStack.getItem()==ItemList.Tool_DataStick.getItem()) {
- this.ready=false;
- GT_Utility.ItemNBT.setBookTitle(aPlayer.getCurrentEquippedItem(),"Raw Prospection Data");
- List<String> tStringList = new ArrayList<String>();
- for(int i = this.getBaseMetaTileEntity().getYCoord();i>0;i--){
- for(int f = -1; f<2;f++){
- for(int g = -1; g<2;g++){
- Block tBlock = this.getBaseMetaTileEntity().getBlockOffset(f, -i, g);
- if ((tBlock instanceof GT_Block_Ores))
- {
- TileEntity tTileEntity = getBaseMetaTileEntity().getWorld().getTileEntity(getBaseMetaTileEntity().getXCoord()+f, getBaseMetaTileEntity().getYCoord()+(-i), getBaseMetaTileEntity().getZCoord()+g);
- if ((tTileEntity instanceof GT_TileEntity_Ores))
- {
- Materials tMaterial = GregTech_API.sGeneratedMaterials[(((GT_TileEntity_Ores)tTileEntity).mMetaData % 1000)];
- if ((tMaterial != null) && (tMaterial != Materials._NULL))
- {
- if(!tStringList.contains(tMaterial.mDefaultLocalName)){
- tStringList.add(tMaterial.mDefaultLocalName);
- }
- }
- }
- }
- else
- {
- int tMetaID = getBaseMetaTileEntity().getWorld().getBlockMetadata(getBaseMetaTileEntity().getXCoord()+f, getBaseMetaTileEntity().getYCoord()+(-i), getBaseMetaTileEntity().getZCoord()+g);
- ItemData tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID));
- if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore")))
- {
- if(!tStringList.contains( tAssotiation.mMaterial.mMaterial.mDefaultLocalName)){
- tStringList.add( tAssotiation.mMaterial.mMaterial.mDefaultLocalName);
- }
- }
- }
- }
- }
- }
- FluidStack tFluid = GT_Utility.getUndergroundOil(getBaseMetaTileEntity().getWorld(), getBaseMetaTileEntity().getXCoord(), getBaseMetaTileEntity().getZCoord());
- String[] tStringArray = new String[tStringList.size()];{
- for(int i = 0;i<tStringArray.length;i++){
- tStringArray[i] = tStringList.get(i);
- }
- }
- GT_Utility.ItemNBT.setProspectionData(aPlayer.getCurrentEquippedItem(), this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId,tFluid, tStringArray);
- }
- }
-
- return true;
- }
-
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java
index 4f6259e7e8..36272e13a7 100644
--- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java
+++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java
@@ -1,6 +1,17 @@
package gregtech.common.tileentities.machines.basic;
-import static gregtech.api.enums.GT_Values.V;
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Config;
+import gregtech.api.util.GT_Utility;
+import gregtech.common.gui.GT_Container_Teleporter;
+import gregtech.common.gui.GT_GUIContainer_Teleporter;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityHanging;
@@ -8,14 +19,7 @@ import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.boss.EntityDragonPart;
import net.minecraft.entity.effect.EntityWeatherEffect;
-import net.minecraft.entity.item.EntityBoat;
-import net.minecraft.entity.item.EntityEnderCrystal;
-import net.minecraft.entity.item.EntityEnderEye;
-import net.minecraft.entity.item.EntityFireworkRocket;
-import net.minecraft.entity.item.EntityItem;
-import net.minecraft.entity.item.EntityMinecart;
-import net.minecraft.entity.item.EntityTNTPrimed;
-import net.minecraft.entity.item.EntityXPOrb;
+import net.minecraft.entity.item.*;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.entity.projectile.EntityArrow;
@@ -30,352 +34,397 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.fluids.FluidStack;
-import gregtech.api.enums.ConfigCategories;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.Textures;
-import gregtech.api.gui.GT_Container_MultiMachine;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_Config;
-import gregtech.api.util.GT_Utility;
-import gregtech.common.gui.GT_Container_Teleporter;
-import gregtech.common.gui.GT_GUIContainer_FusionReactor;
-import gregtech.common.gui.GT_GUIContainer_Teleporter;
-public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank{
-
- public int mTargetX = 0;
- public int mTargetY = 0;
- public int mTargetZ = 0;
- public int mTargetD = 0;
- public boolean mDebug = false;
- public boolean hasEgg = false;
- public static boolean sInterDimensionalTeleportAllowed = true;
-
- public GT_MetaTileEntity_Teleporter(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 3, "Teleport long distances with this little device.");
- }
-
- public GT_MetaTileEntity_Teleporter(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, 3, aDescription, aTextures);
- }
-
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) return true;
- this.hasEgg = checkForEgg();
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
-
- @Override
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_Teleporter(aPlayerInventory, aBaseMetaTileEntity);
- }
-
-
- @Override
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_Teleporter(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Teleporter(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- public String[] getInfoData()
- {
- return new String[] { "Coordinates:", "X: " + this.mTargetX, "Y: " + this.mTargetY, "Z: " + this.mTargetZ, "Dimension: " + this.mTargetD };
- }
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1], (aSide !=this.getBaseMetaTileEntity().getFrontFacing()) ? null : aActive ? new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE) : new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER) };
- }
-
- public void saveNBTData(NBTTagCompound aNBT)
- {
- if (mFluid != null) aNBT.setTag("mFluid", mFluid.writeToNBT(new NBTTagCompound()));
- aNBT.setInteger("mTargetX", this.mTargetX);
- aNBT.setInteger("mTargetY", this.mTargetY);
- aNBT.setInteger("mTargetZ", this.mTargetZ);
- aNBT.setInteger("mTargetD", this.mTargetD);
- aNBT.setBoolean("mDebug", this.mDebug);
- }
-
- public void loadNBTData(NBTTagCompound aNBT)
- {
- mFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid"));
- this.mTargetX = aNBT.getInteger("mTargetX");
- this.mTargetY = aNBT.getInteger("mTargetY");
- this.mTargetZ = aNBT.getInteger("mTargetZ");
- this.mTargetD = aNBT.getInteger("mTargetD");
- this.mDebug = aNBT.getBoolean("mDebug");
- }
-
- public void onConfigLoad(GT_Config aConfig)
- {
- sInterDimensionalTeleportAllowed = aConfig.get(ConfigCategories.machineconfig, "Teleporter.Interdimensional", true);
- }
-
- public void onFirstTick()
- {
- if (getBaseMetaTileEntity().isServerSide())
- {
- if ((this.mTargetX == 0) && (this.mTargetY == 0) && (this.mTargetZ == 0) && (this.mTargetD == 0))
- {
- this.mTargetX = getBaseMetaTileEntity().getXCoord();
- this.mTargetY = getBaseMetaTileEntity().getYCoord();
- this.mTargetZ = getBaseMetaTileEntity().getZCoord();
- this.mTargetD = getBaseMetaTileEntity().getWorld().provider.dimensionId;
- }
- this.hasEgg = checkForEgg();
- }
- }
-
- public boolean checkForEgg()
- {
- for (byte i = -5; i <= 5; i = (byte)(i + 1)) {
- for (byte j = -5; j <= 5; j = (byte)(j + 1)) {
- for (byte k = -5; k <= 5; k = (byte)(k + 1)) {
- if (getBaseMetaTileEntity().getBlockOffset(i, j, k) == Blocks.dragon_egg) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- public boolean hasDimensionalTeleportCapability()
- {
- return (this.mDebug) || (this.hasEgg) || (mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1))&&mFluid.amount>=1000);
- }
-
- public boolean isDimensionalTeleportAvailable()
- {
- return (this.mDebug) || ((hasDimensionalTeleportCapability()) && (GT_Utility.isRealDimension(this.mTargetD)) && (GT_Utility.isRealDimension(getBaseMetaTileEntity().getWorld().provider.dimensionId)));
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if(mFluid==null){
- mFluid=Materials.Nitrogen.getPlasma(0);
- }
- super.onPostTick(aBaseMetaTileEntity, aTick);
- if (getBaseMetaTileEntity().isServerSide())
- {
- if (getBaseMetaTileEntity().getTimer() % 100L == 50L) {
- this.hasEgg = checkForEgg();
- }
- if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().getRedstone()))
- {
- if(getBaseMetaTileEntity().decreaseStoredEnergyUnits(2048, false)){
- if(hasDimensionalTeleportCapability()&&this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId&&mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1))){
- mFluid.amount--;
- if(mFluid.amount<1){mFluid=null;}
- }
- int tDistance = distanceCalculation();
- if(mInventory[0]!=null){
- TileEntity tTile = null;
- if(this.mTargetD == getBaseMetaTileEntity().getWorld().provider.dimensionId){
- tTile = getBaseMetaTileEntity().getTileEntity(this.mTargetX, this.mTargetY, this.mTargetZ);}else{
- World tWorld = DimensionManager.getWorld(this.mTargetD);
- if(tWorld!=null){
- tTile = tWorld.getTileEntity(this.mTargetX, this.mTargetY, this.mTargetZ);
- }
- }
- if(tTile!=null&&tTile instanceof IInventory){
- int tStacksize = mInventory[0].stackSize;
- GT_Utility.moveOneItemStack(this, tTile, (byte)0 ,(byte)0, null, false, (byte)64, (byte)1, (byte)64, (byte)1);
- if(mInventory[0]==null||mInventory[0].stackSize<tStacksize){
- getBaseMetaTileEntity().decreaseStoredEnergyUnits((int)(tDistance * tDistance * (tStacksize - (mInventory[0]==null ? 0 : mInventory[0].stackSize))), false);
- }
- }
-
- }
- for (Object tObject : getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 2) + 2, getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 2) + 2, getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 2) + 2))) {
- if (((tObject instanceof Entity)) && (!((Entity)tObject).isDead))
- {
- Entity tEntity = (Entity)tObject;
- if (getBaseMetaTileEntity().decreaseStoredEnergyUnits((int)(tDistance * tDistance * weightCalculation(tEntity)), false))
- {
- if(hasDimensionalTeleportCapability()&&this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId&&mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1))){
- mFluid.amount = mFluid.amount - ((int)Math.min(1000,(tDistance * tDistance * weightCalculation(tEntity)/8192)));
- if(mFluid.amount<1){mFluid=null;}
- }
- if (tEntity.ridingEntity != null) {
- tEntity.mountEntity(null);
- }
- if (tEntity.riddenByEntity != null) {
- tEntity.riddenByEntity.mountEntity(null);
- }
- if ((this.mTargetD == getBaseMetaTileEntity().getWorld().provider.dimensionId) || (!isDimensionalTeleportAvailable()) || (!GT_Utility.moveEntityToDimensionAtCoords(tEntity, this.mTargetD, this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D))) {
- if ((tEntity instanceof EntityLivingBase)) {
- ((EntityLivingBase)tEntity).setPositionAndUpdate(this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D);
- } else {
- tEntity.setPosition(this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D);
- }
- }
- }
- }
- }}
- getBaseMetaTileEntity().setActive(true);
- }
- else
- {
- getBaseMetaTileEntity().setActive(false);
- }
- }
- }
-
- private int distanceCalculation()
- {
- return Math.abs(((this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId) && (isDimensionalTeleportAvailable()) ? 100 : 1) * (int)Math.sqrt(Math.pow(getBaseMetaTileEntity().getXCoord() - this.mTargetX, 2.0D) + Math.pow(getBaseMetaTileEntity().getYCoord() - this.mTargetY, 2.0D) + Math.pow(getBaseMetaTileEntity().getZCoord() - this.mTargetZ, 2.0D)));
- }
-
- private static float weightCalculation(Entity aEntity)
- {
- try
- {
- if ((aEntity instanceof EntityFX)) {
- return -1.0F;
- }
- }
- catch (Throwable e) {}
- if ((aEntity instanceof EntityFishHook)) {
- return -1.0F;
- }
- if ((aEntity instanceof EntityDragonPart)) {
- return -1.0F;
- }
- if ((aEntity instanceof EntityWeatherEffect)) {
- return -1.0F;
- }
- if ((aEntity instanceof EntityPlayer))
- {
- EntityPlayer tPlayer = (EntityPlayer)aEntity;
- int tCount = 64;
- for (int i = 0; i < 36; i++) {
- if (tPlayer.inventory.getStackInSlot(i) != null) {
- tCount += (tPlayer.inventory.getStackInSlot(i).getMaxStackSize() > 1 ? tPlayer.inventory.getStackInSlot(i).stackSize : 64);
- }
- }
- for (int i = 0; i < 4; i++) {
- if (tPlayer.inventory.armorInventory[i] != null) {
- tCount += 256;
- }
- }
- return Math.min(5.0F, tCount / 666.6F);
- }
- if (GT_Utility.getClassName(aEntity).equals("EntityItnt")) {
- return 5.0F;
- }
- if (GT_Utility.getClassName(aEntity).equals("EntityNuke")) {
- return 50.0F;
- }
- if ((aEntity instanceof EntityArrow)) {
- return 0.001F;
- }
- if ((aEntity instanceof EntityBoat)) {
- return 0.1F;
- }
- if ((aEntity instanceof EntityEnderCrystal)) {
- return 2.0F;
- }
- if ((aEntity instanceof EntityEnderEye)) {
- return 0.001F;
- }
- if ((aEntity instanceof EntityFireball)) {
- return 0.001F;
- }
- if ((aEntity instanceof EntityFireworkRocket)) {
- return 0.001F;
- }
- if ((aEntity instanceof EntityHanging)) {
- return 0.005F;
- }
- if ((aEntity instanceof EntityItem)) {
- return 0.001F;
- }
- if ((aEntity instanceof EntityLiving)) {
- return 0.5F;
- }
- if ((aEntity instanceof EntityMinecart)) {
- return 0.1F;
- }
- if ((aEntity instanceof EntityThrowable)) {
- return 0.001F;
- }
- if ((aEntity instanceof EntityTNTPrimed)) {
- return 5.0F;
- }
- if ((aEntity instanceof EntityXPOrb)) {
- return 0.001F;
- }
- return -1.0F;
- }
-
- @Override public boolean isSimpleMachine() {return false;}
- @Override public boolean isOverclockerUpgradable() {return false;}
- @Override public boolean isTransformerUpgradable() {return false;}
- @Override public boolean isElectric() {return true;}
- @Override public boolean isFacingValid(byte aFacing) {return true;}
- @Override public boolean isEnetInput() {return true;}
- @Override public boolean isInputFacing(byte aSide) {return true;}
- @Override public boolean isOutputFacing(byte aSide) {return false;}
- @Override public boolean isTeleporterCompatible() {return false;}
- @Override public long getMinimumStoredEU() {return V[mTier]*16;}
- @Override public long maxEUStore() {return 100000000;}
- @Override public long maxEUInput() {return V[mTier];}
- @Override public long maxSteamStore() {return maxEUStore();}
- @Override public long maxAmperesIn() {return 2;}
- @Override public int getStackDisplaySlot() {return 2;}
- @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;}
- @Override public int getInputSlot() {return 0;}
- @Override public int getOutputSlot() {return 0;}
-
- @Override
- public int getCapacity() {return 64000;}
-
- @Override
- public boolean doesFillContainers() {
- return false;
- }
-
- @Override
- public boolean doesEmptyContainers() {
- return false;
- }
-
- @Override
- public boolean canTankBeFilled() {
- return true;
- }
-
- @Override
- public boolean canTankBeEmptied() {
- return true;
- }
-
- @Override
- public boolean displaysItemStack() {
- return false;
- }
-
- @Override
- public boolean displaysStackSize() {
- return false;
- }
-
- @Override
- public ITexture[][][] getTextureSet(ITexture[] aTextures) {
- return null;
- }
-
+import static gregtech.api.enums.GT_Values.V;
+
+public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank {
+
+ public static boolean sInterDimensionalTeleportAllowed = true;
+ public int mTargetX = 0;
+ public int mTargetY = 0;
+ public int mTargetZ = 0;
+ public int mTargetD = 0;
+ public boolean mDebug = false;
+ public boolean hasEgg = false;
+
+ public GT_MetaTileEntity_Teleporter(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 3, "Teleport long distances with this little device.");
+ }
+
+ public GT_MetaTileEntity_Teleporter(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 3, aDescription, aTextures);
+ }
+
+ private static float weightCalculation(Entity aEntity) {
+ try {
+ if ((aEntity instanceof EntityFX)) {
+ return -1.0F;
+ }
+ } catch (Throwable e) {
+ }
+ if ((aEntity instanceof EntityFishHook)) {
+ return -1.0F;
+ }
+ if ((aEntity instanceof EntityDragonPart)) {
+ return -1.0F;
+ }
+ if ((aEntity instanceof EntityWeatherEffect)) {
+ return -1.0F;
+ }
+ if ((aEntity instanceof EntityPlayer)) {
+ EntityPlayer tPlayer = (EntityPlayer) aEntity;
+ int tCount = 64;
+ for (int i = 0; i < 36; i++) {
+ if (tPlayer.inventory.getStackInSlot(i) != null) {
+ tCount += (tPlayer.inventory.getStackInSlot(i).getMaxStackSize() > 1 ? tPlayer.inventory.getStackInSlot(i).stackSize : 64);
+ }
+ }
+ for (int i = 0; i < 4; i++) {
+ if (tPlayer.inventory.armorInventory[i] != null) {
+ tCount += 256;
+ }
+ }
+ return Math.min(5.0F, tCount / 666.6F);
+ }
+ if (GT_Utility.getClassName(aEntity).equals("EntityItnt")) {
+ return 5.0F;
+ }
+ if (GT_Utility.getClassName(aEntity).equals("EntityNuke")) {
+ return 50.0F;
+ }
+ if ((aEntity instanceof EntityArrow)) {
+ return 0.001F;
+ }
+ if ((aEntity instanceof EntityBoat)) {
+ return 0.1F;
+ }
+ if ((aEntity instanceof EntityEnderCrystal)) {
+ return 2.0F;
+ }
+ if ((aEntity instanceof EntityEnderEye)) {
+ return 0.001F;
+ }
+ if ((aEntity instanceof EntityFireball)) {
+ return 0.001F;
+ }
+ if ((aEntity instanceof EntityFireworkRocket)) {
+ return 0.001F;
+ }
+ if ((aEntity instanceof EntityHanging)) {
+ return 0.005F;
+ }
+ if ((aEntity instanceof EntityItem)) {
+ return 0.001F;
+ }
+ if ((aEntity instanceof EntityLiving)) {
+ return 0.5F;
+ }
+ if ((aEntity instanceof EntityMinecart)) {
+ return 0.1F;
+ }
+ if ((aEntity instanceof EntityThrowable)) {
+ return 0.001F;
+ }
+ if ((aEntity instanceof EntityTNTPrimed)) {
+ return 5.0F;
+ }
+ if ((aEntity instanceof EntityXPOrb)) {
+ return 0.001F;
+ }
+ return -1.0F;
+ }
+
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) return true;
+ this.hasEgg = checkForEgg();
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_Teleporter(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_Teleporter(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Teleporter(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public String[] getInfoData() {
+ return new String[]{"Coordinates:", "X: " + this.mTargetX, "Y: " + this.mTargetY, "Z: " + this.mTargetZ, "Dimension: " + this.mTargetD};
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], (aSide != this.getBaseMetaTileEntity().getFrontFacing()) ? null : aActive ? new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE) : new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER)};
+ }
+
+ public void saveNBTData(NBTTagCompound aNBT) {
+ if (mFluid != null) aNBT.setTag("mFluid", mFluid.writeToNBT(new NBTTagCompound()));
+ aNBT.setInteger("mTargetX", this.mTargetX);
+ aNBT.setInteger("mTargetY", this.mTargetY);
+ aNBT.setInteger("mTargetZ", this.mTargetZ);
+ aNBT.setInteger("mTargetD", this.mTargetD);
+ aNBT.setBoolean("mDebug", this.mDebug);
+ }
+
+ public void loadNBTData(NBTTagCompound aNBT) {
+ mFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid"));
+ this.mTargetX = aNBT.getInteger("mTargetX");
+ this.mTargetY = aNBT.getInteger("mTargetY");
+ this.mTargetZ = aNBT.getInteger("mTargetZ");
+ this.mTargetD = aNBT.getInteger("mTargetD");
+ this.mDebug = aNBT.getBoolean("mDebug");
+ }
+
+ public void onConfigLoad(GT_Config aConfig) {
+ sInterDimensionalTeleportAllowed = aConfig.get(ConfigCategories.machineconfig, "Teleporter.Interdimensional", true);
+ }
+
+ public void onFirstTick() {
+ if (getBaseMetaTileEntity().isServerSide()) {
+ if ((this.mTargetX == 0) && (this.mTargetY == 0) && (this.mTargetZ == 0) && (this.mTargetD == 0)) {
+ this.mTargetX = getBaseMetaTileEntity().getXCoord();
+ this.mTargetY = getBaseMetaTileEntity().getYCoord();
+ this.mTargetZ = getBaseMetaTileEntity().getZCoord();
+ this.mTargetD = getBaseMetaTileEntity().getWorld().provider.dimensionId;
+ }
+ this.hasEgg = checkForEgg();
+ }
+ }
+
+ public boolean checkForEgg() {
+ for (byte i = -5; i <= 5; i = (byte) (i + 1)) {
+ for (byte j = -5; j <= 5; j = (byte) (j + 1)) {
+ for (byte k = -5; k <= 5; k = (byte) (k + 1)) {
+ if (getBaseMetaTileEntity().getBlockOffset(i, j, k) == Blocks.dragon_egg) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ public boolean hasDimensionalTeleportCapability() {
+ return (this.mDebug) || (this.hasEgg) || (mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)) && mFluid.amount >= 1000);
+ }
+
+ public boolean isDimensionalTeleportAvailable() {
+ return (this.mDebug) || ((hasDimensionalTeleportCapability()) && (GT_Utility.isRealDimension(this.mTargetD)) && (GT_Utility.isRealDimension(getBaseMetaTileEntity().getWorld().provider.dimensionId)));
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (mFluid == null) {
+ mFluid = Materials.Nitrogen.getPlasma(0);
+ }
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ if (getBaseMetaTileEntity().isServerSide()) {
+ if (getBaseMetaTileEntity().getTimer() % 100L == 50L) {
+ this.hasEgg = checkForEgg();
+ }
+ if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().getRedstone())) {
+ if (getBaseMetaTileEntity().decreaseStoredEnergyUnits(2048, false)) {
+ if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1))) {
+ mFluid.amount--;
+ if (mFluid.amount < 1) {
+ mFluid = null;
+ }
+ }
+ int tDistance = distanceCalculation();
+ if (mInventory[0] != null) {
+ TileEntity tTile = null;
+ if (this.mTargetD == getBaseMetaTileEntity().getWorld().provider.dimensionId) {
+ tTile = getBaseMetaTileEntity().getTileEntity(this.mTargetX, this.mTargetY, this.mTargetZ);
+ } else {
+ World tWorld = DimensionManager.getWorld(this.mTargetD);
+ if (tWorld != null) {
+ tTile = tWorld.getTileEntity(this.mTargetX, this.mTargetY, this.mTargetZ);
+ }
+ }
+ if (tTile != null && tTile instanceof IInventory) {
+ int tStacksize = mInventory[0].stackSize;
+ GT_Utility.moveOneItemStack(this, tTile, (byte) 0, (byte) 0, null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
+ if (mInventory[0] == null || mInventory[0].stackSize < tStacksize) {
+ getBaseMetaTileEntity().decreaseStoredEnergyUnits((int) (tDistance * tDistance * (tStacksize - (mInventory[0] == null ? 0 : mInventory[0].stackSize))), false);
+ }
+ }
+
+ }
+ for (Object tObject : getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 2) + 2, getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 2) + 2, getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 2) + 2))) {
+ if (((tObject instanceof Entity)) && (!((Entity) tObject).isDead)) {
+ Entity tEntity = (Entity) tObject;
+ if (getBaseMetaTileEntity().decreaseStoredEnergyUnits((int) (tDistance * tDistance * weightCalculation(tEntity)), false)) {
+ if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1))) {
+ mFluid.amount = mFluid.amount - ((int) Math.min(1000, (tDistance * tDistance * weightCalculation(tEntity) / 8192)));
+ if (mFluid.amount < 1) {
+ mFluid = null;
+ }
+ }
+ if (tEntity.ridingEntity != null) {
+ tEntity.mountEntity(null);
+ }
+ if (tEntity.riddenByEntity != null) {
+ tEntity.riddenByEntity.mountEntity(null);
+ }
+ if ((this.mTargetD == getBaseMetaTileEntity().getWorld().provider.dimensionId) || (!isDimensionalTeleportAvailable()) || (!GT_Utility.moveEntityToDimensionAtCoords(tEntity, this.mTargetD, this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D))) {
+ if ((tEntity instanceof EntityLivingBase)) {
+ ((EntityLivingBase) tEntity).setPositionAndUpdate(this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D);
+ } else {
+ tEntity.setPosition(this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D);
+ }
+ }
+ }
+ }
+ }
+ }
+ getBaseMetaTileEntity().setActive(true);
+ } else {
+ getBaseMetaTileEntity().setActive(false);
+ }
+ }
+ }
+
+ private int distanceCalculation() {
+ return Math.abs(((this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId) && (isDimensionalTeleportAvailable()) ? 100 : 1) * (int) Math.sqrt(Math.pow(getBaseMetaTileEntity().getXCoord() - this.mTargetX, 2.0D) + Math.pow(getBaseMetaTileEntity().getYCoord() - this.mTargetY, 2.0D) + Math.pow(getBaseMetaTileEntity().getZCoord() - this.mTargetZ, 2.0D)));
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isOverclockerUpgradable() {
+ return false;
+ }
+
+ @Override
+ public boolean isTransformerUpgradable() {
+ return false;
+ }
+
+ @Override
+ public boolean isElectric() {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return true;
+ }
+
+ @Override
+ public boolean isInputFacing(byte aSide) {
+ return true;
+ }
+
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public boolean isTeleporterCompatible() {
+ return false;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return V[mTier] * 16;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return 100000000;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return V[mTier];
+ }
+
+ @Override
+ public long maxSteamStore() {
+ return maxEUStore();
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return 2;
+ }
+
+ @Override
+ public int getStackDisplaySlot() {
+ return 2;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public int getInputSlot() {
+ return 0;
+ }
+
+ @Override
+ public int getOutputSlot() {
+ return 0;
+ }
+
+ @Override
+ public int getCapacity() {
+ return 64000;
+ }
+
+ @Override
+ public boolean doesFillContainers() {
+ return false;
+ }
+
+ @Override
+ public boolean doesEmptyContainers() {
+ return false;
+ }
+
+ @Override
+ public boolean canTankBeFilled() {
+ return true;
+ }
+
+ @Override
+ public boolean canTankBeEmptied() {
+ return true;
+ }
+
+ @Override
+ public boolean displaysItemStack() {
+ return false;
+ }
+
+ @Override
+ public boolean displaysStackSize() {
+ return false;
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ return null;
+ }
+
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AdvMiner2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AdvMiner2.java
index 86a7120605..9aa75449d9 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AdvMiner2.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AdvMiner2.java
@@ -1,14 +1,5 @@
package gregtech.common.tileentities.machines.multi;
-import java.util.ArrayList;
-
-import net.minecraft.block.Block;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.ChunkPosition;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
import gregtech.api.GregTech_API;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.OrePrefixes;
@@ -23,239 +14,270 @@ import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.common.blocks.GT_TileEntity_Ores;
+import net.minecraft.block.Block;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.ChunkPosition;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+
+import java.util.ArrayList;
+
+public class GT_MetaTileEntity_AdvMiner2 extends GT_MetaTileEntity_MultiBlockBase {
+
+ public ArrayList<ChunkPosition> mMineList = new ArrayList();
+ private boolean completedCycle = false;
+
+ public GT_MetaTileEntity_AdvMiner2(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_AdvMiner2(String aName) {
+ super(aName);
+ }
+
+ public String[] getDescription() {
+ return new String[]{
+ "Controller Block for the Advanced Miner II",
+ "Size: 3x7x3", "Controller (front middle at bottom)",
+ "3x3 Base of Solid Steel Casings",
+ "Also part of Base: MV+ Energy Input Hatch",
+ "Fluid Input Hatch, Output Bus and Maintainance Hatch",
+ "3x Solid Steel Casings on top the Center of the base",
+ "Steel Frame Boxes on each side and 3 more on top"};
+ }
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[16], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER)};
+ }
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[16]};
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ if (mInventory[1] == null || (mInventory[1].isItemEqual(GT_ModHandler.getIC2Item("miningPipe", 1L)) && mInventory[1].stackSize < mInventory[1].getMaxStackSize())) {
+ ArrayList<ItemStack> tItems = getStoredInputs();
+ for (ItemStack tStack : tItems) {
+ if (tStack.isItemEqual(GT_ModHandler.getIC2Item("miningPipe", 1L))) {
+ if (tStack.stackSize < 2) {
+ tStack = null;
+ } else {
+ tStack.stackSize--;
+ }
+
+ }
+ if (mInventory[1] == null) {
+ mInventory[1] = GT_ModHandler.getIC2Item("miningPipe", 1L);
+ } else {
+ mInventory[1].stackSize++;
+ }
+ }
+ }
+ if (mInputHatches == null || mInputHatches.get(0).mFluid == null || mInputHatches.get(0).mFluid.getFluid().getID() != ItemList.sDrillingFluid.getID()) {
+ return false;
+ }
+ FluidStack tFluid = mInputHatches.get(0).mFluid.copy();
+ if (tFluid == null) {
+ return false;
+ }
+ if (tFluid.amount < 20) {
+ return false;
+ }
+ tFluid.amount = 100;
+ depleteInput(tFluid);
+ long tVoltage = getMaxInputVoltage();
+ if (getBaseMetaTileEntity().getRandomNumber(20) == 0) {
+ if (mMineList.isEmpty()) {
+ int yLevel = getYOfPumpHead();
+ for (int i = -48; i < 49; i++) {
+ for (int f = -48; f < 49; f++) {
+ Block tBlock = getBaseMetaTileEntity().getBlockOffset(i, yLevel - getBaseMetaTileEntity().getYCoord(), f);
+ if (tBlock == GregTech_API.sBlockOres1) {
+ TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityOffset(i, yLevel - getBaseMetaTileEntity().getYCoord(), f);
+ if ((tTileEntity instanceof GT_TileEntity_Ores) && ((GT_TileEntity_Ores) tTileEntity).mNatural == true && !mMineList.contains(new ChunkPosition(i, yLevel - getBaseMetaTileEntity().getYCoord(), f))) {
+ mMineList.add(new ChunkPosition(i, yLevel - getBaseMetaTileEntity().getYCoord(), f));
+ }
+ }
+ }
+ }
+ }
+ if (mMineList.isEmpty() && getBaseMetaTileEntity().getBlockOffset(ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX, getYOfPumpHead() - 1 - getBaseMetaTileEntity().getYCoord(), ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ) != Blocks.bedrock) {
+ if (mEnergyHatches.size() > 0 && mEnergyHatches.get(0).getEUVar() > (512 + getMaxInputVoltage() * 4)) {
+ moveOneDown();
+ }
+ }
+ ArrayList<ItemStack> tDrops = new ArrayList();
+ if (!mMineList.isEmpty()) {
+ Block tMineBlock = getBaseMetaTileEntity().getBlockOffset(mMineList.get(0).chunkPosX, mMineList.get(0).chunkPosY, mMineList.get(0).chunkPosZ);
+ tDrops = tMineBlock.getDrops(getBaseMetaTileEntity().getWorld(), mMineList.get(0).chunkPosX, mMineList.get(0).chunkPosY, mMineList.get(0).chunkPosZ, getBaseMetaTileEntity().getMetaIDOffset(mMineList.get(0).chunkPosX, mMineList.get(0).chunkPosY, mMineList.get(0).chunkPosZ), 1);
+ if (!tDrops.isEmpty()) {
+ if (GT_OreDictUnificator.getItemData(tDrops.get(0)).mPrefix != OrePrefixes.crushed) {
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.findRecipe(getBaseMetaTileEntity(), false, tVoltage, null, tDrops.get(0));
+ if (tRecipe != null) {
+ this.mOutputItems = new ItemStack[tRecipe.mOutputs.length];
+ for (int g = 0; g < mOutputItems.length; g++) {
+ mOutputItems[g] = tRecipe.mOutputs[g].copy();
+ mOutputItems[g].stackSize = mOutputItems[g].stackSize * (getBaseMetaTileEntity().getRandomNumber(4) + 1);
+ }
+ }
+ } else {
+ this.mOutputItems = null;
+ ItemStack[] tStack = new ItemStack[tDrops.size()];
+ for (int j = 0; j < tDrops.size(); j++) {
+ tStack[j] = tDrops.get(j).copy();
+ tStack[j].stackSize = tStack[j].stackSize * (getBaseMetaTileEntity().getRandomNumber(4) + 1);
+ }
+ mOutputItems = tStack;
+ }
+ }
+ getBaseMetaTileEntity().getWorld().setBlockToAir(mMineList.get(0).chunkPosX + getBaseMetaTileEntity().getXCoord(), mMineList.get(0).chunkPosY + getBaseMetaTileEntity().getYCoord(), mMineList.get(0).chunkPosZ + getBaseMetaTileEntity().getZCoord());
+ mMineList.remove(0);
+ }
+ }
+
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ int tEU = 48;
+ int tDuration = 40;
+ if (tEU <= 16) {
+ this.mEUt = (tEU * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (tDuration / (1 << tTier - 1));
+ } else {
+ this.mEUt = tEU;
+ this.mMaxProgresstime = tDuration;
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ return true;
+ }
+
+ private boolean moveOneDown() {
+ if ((this.mInventory[1] == null) || (this.mInventory[1].stackSize < 1)
+ || (!GT_Utility.areStacksEqual(this.mInventory[1], GT_ModHandler.getIC2Item("miningPipe", 1L)))) {
+ return false;
+ }
+ int xDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ;
+ int yHead = getYOfPumpHead();
+ if (yHead <= 0) {
+ return false;
+ }
+ if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord() + xDir, yHead - 1, getBaseMetaTileEntity().getZCoord() + zDir) == Blocks.bedrock) {
+ return false;
+ }
+ if (!(getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord() + xDir, yHead - 1, getBaseMetaTileEntity().getZCoord() + zDir, GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))))) {
+ return false;
+ }
+ if (yHead != getBaseMetaTileEntity().getYCoord()) {
+ getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord() + xDir, yHead, getBaseMetaTileEntity().getZCoord() + zDir, GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L)));
+ }
+ getBaseMetaTileEntity().decrStackSize(1, 1);
+ return true;
+ }
+
+ private int getYOfPumpHead() {
+ int xDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ;
+ int y = getBaseMetaTileEntity().getYCoord() - 1;
+ while (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord() + xDir, y, getBaseMetaTileEntity().getZCoord() + zDir) == GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L))) {
+ y--;
+ }
+ if (y == getBaseMetaTileEntity().getYCoord() - 1) {
+ if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord() + xDir, y, getBaseMetaTileEntity().getZCoord() + zDir) != GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))) {
+ return y + 1;
+ }
+ } else if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord() + xDir, y, getBaseMetaTileEntity().getZCoord() + zDir) != GT_Utility
+ .getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L)) && this.mInventory[1] != null && this.mInventory[1].stackSize > 0 && GT_Utility.areStacksEqual(this.mInventory[1], GT_ModHandler.getIC2Item("miningPipe", 1L))) {
+ getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord() + xDir, y, getBaseMetaTileEntity().getZCoord() + zDir,
+ GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L)));
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ }
+ return y;
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if ((xDir + i != 0) || (zDir + j != 0)) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j);
+ if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16)) && (!addOutputToMachineList(tTileEntity, 16)) && (!addEnergyInputToMachineList(tTileEntity, 16))) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != GregTech_API.sBlockCasings2) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 0) {
+ return false;
+ }
+ }
+ }
+ }
+ }
+ for (int y = 1; y < 4; y++) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir) != GregTech_API.sBlockCasings2) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + 1, y, zDir) != GregTech_API.sBlockMachines) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getBlockOffset(xDir - 1, y, zDir) != GregTech_API.sBlockMachines) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir + 1) != GregTech_API.sBlockMachines) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir - 1) != GregTech_API.sBlockMachines) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getBlockOffset(xDir, y + 3, zDir) != GregTech_API.sBlockMachines) {
+ return false;
+ }
+ }
+ return true;
+ }
-public class GT_MetaTileEntity_AdvMiner2 extends GT_MetaTileEntity_MultiBlockBase{
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
- public GT_MetaTileEntity_AdvMiner2(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_AdvMiner2(String aName)
- {
- super(aName);
- }
-
- public String[] getDescription()
- {
- return new String[] {
- "Controller Block for the Advanced Miner II",
- "Size: 3x7x3", "Controller (front middle at bottom)",
- "3x3 Base of Solid Steel Casings",
- "Also part of Base: MV+ Energy Input Hatch",
- "Fluid Input Hatch, Output Bus and Maintainance Hatch",
- "3x Solid Steel Casings on top the Center of the base",
- "Steel Frame Boxes on each side and 3 more on top"};
- }
+ @Override
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
- {
- if (aSide == aFacing) {
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[16], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER) };
- }
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[16] };
- }
- public ArrayList<ChunkPosition> mMineList = new ArrayList();
- private boolean completedCycle = false;
-
- @Override
- public boolean checkRecipe(ItemStack aStack) {
- if(mInventory[1]==null||(mInventory[1].isItemEqual(GT_ModHandler.getIC2Item("miningPipe", 1L)) && mInventory[1].stackSize<mInventory[1].getMaxStackSize())){
- ArrayList<ItemStack> tItems = getStoredInputs();
- for(ItemStack tStack : tItems){
- if(tStack.isItemEqual(GT_ModHandler.getIC2Item("miningPipe", 1L))){
- if(tStack.stackSize<2){
- tStack = null;
- }else{tStack.stackSize--;}
-
- }
- if(mInventory[1]==null){
- mInventory[1] = GT_ModHandler.getIC2Item("miningPipe", 1L);
- }else{
- mInventory[1].stackSize++;}
- }
- }
- if(mInputHatches==null||mInputHatches.get(0).mFluid==null||mInputHatches.get(0).mFluid.getFluid().getID()!=ItemList.sDrillingFluid.getID()){
- return false;}
- FluidStack tFluid = mInputHatches.get(0).mFluid.copy();
- if(tFluid==null){
- return false;
- }
- if(tFluid.amount<20){
- return false;
- }
- tFluid.amount=100;
- depleteInput(tFluid);
- long tVoltage = getMaxInputVoltage();
- if(getBaseMetaTileEntity().getRandomNumber(20)==0){
- if(mMineList.isEmpty()){
- int yLevel = getYOfPumpHead();
- for(int i=-48;i<49;i++){
- for(int f=-48;f<49;f++){
- Block tBlock = getBaseMetaTileEntity().getBlockOffset(i, yLevel-getBaseMetaTileEntity().getYCoord(), f);
- if(tBlock==GregTech_API.sBlockOres1){
- TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityOffset(i, yLevel-getBaseMetaTileEntity().getYCoord(), f);
- if ((tTileEntity instanceof GT_TileEntity_Ores)&&((GT_TileEntity_Ores)tTileEntity).mNatural == true&&!mMineList.contains(new ChunkPosition(i, yLevel-getBaseMetaTileEntity().getYCoord(), f))){
- mMineList.add(new ChunkPosition(i, yLevel-getBaseMetaTileEntity().getYCoord(), f));
- }
- }
- }
- }
- }
- if(mMineList.isEmpty()&&getBaseMetaTileEntity().getBlockOffset(ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX, getYOfPumpHead()-1-getBaseMetaTileEntity().getYCoord(), ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ)!=Blocks.bedrock){
- if(mEnergyHatches.size()>0&&mEnergyHatches.get(0).getEUVar()>(512+getMaxInputVoltage()*4)){moveOneDown();}
- }
- ArrayList<ItemStack> tDrops = new ArrayList();
- if(!mMineList.isEmpty()){
- Block tMineBlock = getBaseMetaTileEntity().getBlockOffset(mMineList.get(0).chunkPosX,mMineList.get(0).chunkPosY,mMineList.get(0).chunkPosZ);
- tDrops = tMineBlock.getDrops(getBaseMetaTileEntity().getWorld(), mMineList.get(0).chunkPosX,mMineList.get(0).chunkPosY,mMineList.get(0).chunkPosZ, getBaseMetaTileEntity().getMetaIDOffset(mMineList.get(0).chunkPosX,mMineList.get(0).chunkPosY,mMineList.get(0).chunkPosZ), 1);
- if(!tDrops.isEmpty()){
- if(GT_OreDictUnificator.getItemData(tDrops.get(0)).mPrefix != OrePrefixes.crushed){
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.findRecipe(getBaseMetaTileEntity(), false, tVoltage, null , tDrops.get(0));
- if(tRecipe!=null){
- this.mOutputItems=new ItemStack[tRecipe.mOutputs.length];
- for(int g=0;g<mOutputItems.length;g++){
- mOutputItems[g] = tRecipe.mOutputs[g].copy();
- mOutputItems[g].stackSize = mOutputItems[g].stackSize*(getBaseMetaTileEntity().getRandomNumber(4)+1);
- }
- }
- }else{
- this.mOutputItems=null;
- ItemStack[] tStack = new ItemStack[tDrops.size()];
- for(int j=0;j<tDrops.size();j++){
- tStack[j]=tDrops.get(j).copy();
- tStack[j].stackSize = tStack[j].stackSize*(getBaseMetaTileEntity().getRandomNumber(4)+1);
- }
- mOutputItems = tStack;
- }
- }
- getBaseMetaTileEntity().getWorld().setBlockToAir(mMineList.get(0).chunkPosX+getBaseMetaTileEntity().getXCoord(), mMineList.get(0).chunkPosY+getBaseMetaTileEntity().getYCoord(), mMineList.get(0).chunkPosZ+getBaseMetaTileEntity().getZCoord());
- mMineList.remove(0);
- }
- }
-
- byte tTier = (byte)Math.max(1, GT_Utility.getTier(tVoltage));
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
- int tEU = 48;
- int tDuration = 40;
- if (tEU <= 16)
- {
- this.mEUt = (tEU * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (tDuration / (1 << tTier - 1));
- }
- else
- {
- this.mEUt = tEU;
- this.mMaxProgresstime = tDuration;
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)])
- {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
- }
- }
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- return true;
- }
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
- private boolean moveOneDown() {
- if ((this.mInventory[1] == null) || (this.mInventory[1].stackSize < 1)
- || (!GT_Utility.areStacksEqual(this.mInventory[1], GT_ModHandler.getIC2Item("miningPipe", 1L)))) {
- return false;
- }
- int xDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ;
- int yHead = getYOfPumpHead();
- if (yHead <= 0) {
- return false;
- }
- if(getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord()+xDir, yHead-1, getBaseMetaTileEntity().getZCoord()+zDir) == Blocks.bedrock){
- return false;
- }
- if (!(getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord()+xDir, yHead - 1, getBaseMetaTileEntity().getZCoord()+zDir,GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))))) {
- return false;
- }
- if (yHead != getBaseMetaTileEntity().getYCoord()) {
- getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord()+xDir, yHead, getBaseMetaTileEntity().getZCoord()+zDir,GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L)));
- }
- getBaseMetaTileEntity().decrStackSize(1, 1);
- return true;
- }
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
- private int getYOfPumpHead() {
- int xDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ;
- int y = getBaseMetaTileEntity().getYCoord() - 1;
- while (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord()+xDir, y, getBaseMetaTileEntity().getZCoord()+zDir) == GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L))) {
- y--;
- }
- if (y == getBaseMetaTileEntity().getYCoord() - 1) {
- if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord()+xDir, y, getBaseMetaTileEntity().getZCoord()+zDir) != GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))) {
- return y + 1;
- }
- } else if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord()+xDir, y, getBaseMetaTileEntity().getZCoord()+zDir) != GT_Utility
- .getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))&&this.mInventory[1] != null&&this.mInventory[1].stackSize>0&&GT_Utility.areStacksEqual(this.mInventory[1], GT_ModHandler.getIC2Item("miningPipe", 1L))) {
- getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord()+xDir, y, getBaseMetaTileEntity().getZCoord()+zDir,
- GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L)));
- getBaseMetaTileEntity().decrStackSize(0, 1);
- }
- return y;
- }
+ @Override
+ public int getAmountOfOutputs() {
+ return 0;
+ }
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- if ((xDir + i != 0) || (zDir + j != 0))
- {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j);
- if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16)) && (!addOutputToMachineList(tTileEntity, 16)) && (!addEnergyInputToMachineList(tTileEntity, 16)))
- {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != GregTech_API.sBlockCasings2) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 0) {
- return false;
- }
- }
- }
- }
- }
- for(int y=1;y<4;y++){
- if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir) != GregTech_API.sBlockCasings2) {
- return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir+1, y, zDir) != GregTech_API.sBlockMachines) {
- return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir-1, y, zDir) != GregTech_API.sBlockMachines) {
- return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir+1) != GregTech_API.sBlockMachines) {
- return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir-1) != GregTech_API.sBlockMachines) {
- return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir, y+3, zDir) != GregTech_API.sBlockMachines) {
- return false;
- }
- }
- return true;
- }
-
- @Override public boolean isCorrectMachinePart(ItemStack aStack) {return true; }
- @Override public int getMaxEfficiency(ItemStack aStack) {return 10000;}
- @Override public int getPollutionPerTick(ItemStack aStack) {return 0; }
- @Override public int getDamageToComponent(ItemStack aStack) {return 0;}
- @Override public int getAmountOfOutputs() {return 0;}
- @Override public boolean explodesOnComponentBreak(ItemStack aStack) {return false;}
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_AdvMiner2(this.mName);
- }
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_AdvMiner2(this.mName);
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java
index f510d064bb..fd3546f94b 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java
@@ -5,13 +5,11 @@ import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.objects.GT_ItemStack;
import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_CoverBehavior;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
import gregtech.common.gui.GT_Container_BronzeBlastFurnace;
@@ -22,381 +20,322 @@ import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class GT_MetaTileEntity_BronzeBlastFurnace
- extends MetaTileEntity
-{
- public int mMaxProgresstime = 0;
- public int mUpdate = 5;
- public int mProgresstime = 0;
- public boolean mMachine = false;
- private static final ITexture[] FACING_SIDE = { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEPLATEDBRICKS) };
- private static final ITexture[] FACING_FRONT = { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE) };
- private static final ITexture[] FACING_ACTIVE = { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE_ACTIVE) };
- public ItemStack mOutputItem1;
- public ItemStack mOutputItem2;
-
- public GT_MetaTileEntity_BronzeBlastFurnace(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional, 4);
- }
-
- public GT_MetaTileEntity_BronzeBlastFurnace(String aName)
- {
- super(aName, 4);
- }
-
- public String[] getDescription()
- {
- return new String[] { "To get your first Steel", "Multiblock: 3x3x4 hollow with opening on top", "32 Bronze Plated Bricks required" };
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
- {
- if (aSide == aFacing) {
- return aActive ? FACING_ACTIVE : FACING_FRONT;
- }
- return FACING_SIDE;
- }
-
- public boolean isSteampowered()
- {
- return false;
- }
-
- public boolean isElectric()
- {
- return false;
- }
-
- public boolean isPneumatic()
- {
- return false;
- }
-
- public boolean isEnetInput()
- {
- return false;
- }
-
- public boolean isEnetOutput()
- {
- return false;
- }
-
- public boolean isInputFacing(byte aSide)
- {
- return false;
- }
-
- public boolean isOutputFacing(byte aSide)
- {
- return false;
- }
-
- public boolean isTeleporterCompatible()
- {
- return false;
- }
-
- public boolean isFacingValid(byte aFacing)
- {
- return aFacing > 1;
- }
-
- public boolean isAccessAllowed(EntityPlayer aPlayer)
- {
- return true;
- }
-
- public int getProgresstime()
- {
- return this.mProgresstime;
- }
-
- public int maxProgresstime()
- {
- return this.mMaxProgresstime;
- }
-
- public int increaseProgress(int aProgress)
- {
- this.mProgresstime += aProgress;return this.mMaxProgresstime - this.mProgresstime;
- }
-
- public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID)
- {
- return (GregTech_API.getCoverBehavior(aCoverID.toStack()).isSimpleCover()) && (super.allowCoverOnSide(aSide, aCoverID));
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_BronzeBlastFurnace(this.mName);
- }
-
- public void saveNBTData(NBTTagCompound aNBT)
- {
- aNBT.setInteger("mProgresstime", this.mProgresstime);
- aNBT.setInteger("mMaxProgresstime", this.mMaxProgresstime);
- if (this.mOutputItem1 != null)
- {
- NBTTagCompound tNBT = new NBTTagCompound();
- this.mOutputItem1.writeToNBT(tNBT);
- aNBT.setTag("mOutputItem1", tNBT);
- }
- if (this.mOutputItem2 != null)
- {
- NBTTagCompound tNBT = new NBTTagCompound();
- this.mOutputItem2.writeToNBT(tNBT);
- aNBT.setTag("mOutputItem2", tNBT);
- }
- }
-
- public void loadNBTData(NBTTagCompound aNBT)
- {
- this.mUpdate = 5;
- this.mProgresstime = aNBT.getInteger("mProgresstime");
- this.mMaxProgresstime = aNBT.getInteger("mMaxProgresstime");
- this.mOutputItem1 = GT_Utility.loadItem(aNBT, "mOutputItem1");
- this.mOutputItem2 = GT_Utility.loadItem(aNBT, "mOutputItem2");
- }
-
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer)
- {
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- }
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
-
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_Container_BronzeBlastFurnace(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_BronzeBlastFurnace(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- private boolean checkMachine()
- {
- int xDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 3; j++) {
- for (int k = -1; k < 2; k++) {
- if ((xDir + i != 0) || (j != 0) || (zDir + k != 0)) {
- if ((i != 0) || (j == -1) || (k != 0))
- {
- if ((getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k) != GregTech_API.sBlockCasings1) || (getBaseMetaTileEntity().getMetaIDOffset(xDir + i, j, zDir + k) != 10)) {
- return false;
- }
- }
- else if ((!GT_Utility.arrayContains(getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k), new Object[] { Blocks.lava, Blocks.flowing_lava, null })) && (!getBaseMetaTileEntity().getAirOffset(xDir + i, j, zDir + k))) {
- return false;
- }
- }
- }
- }
- }
- return true;
- }
-
- public void onMachineBlockUpdate()
- {
- this.mUpdate = 5;
- }
-
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer)
- {
- if ((aBaseMetaTileEntity.isClientSide()) &&
- (aBaseMetaTileEntity.isActive())) {
- aBaseMetaTileEntity.getWorld().spawnParticle("largesmoke", aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1) + Math.random(), aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1) + Math.random(), 0.0D, 0.3D, 0.0D);
- }
- if (aBaseMetaTileEntity.isServerSide())
- {
- if (this.mUpdate-- == 0) {
- this.mMachine = checkMachine();
- }
- if (this.mMachine) {
- if (this.mMaxProgresstime > 0)
- {
- if (++this.mProgresstime >= this.mMaxProgresstime)
- {
- addOutputProducts();
- this.mOutputItem1 = null;
- this.mOutputItem2 = null;
- this.mProgresstime = 0;
- this.mMaxProgresstime = 0;
- try{GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "steel");}catch(Exception e){}
- }
- }
- else if (aBaseMetaTileEntity.isAllowedToWork()) {
- checkRecipe();
- }
- }
- aBaseMetaTileEntity.setActive((this.mMaxProgresstime > 0) && (this.mMachine));
- if (aBaseMetaTileEntity.isActive())
- {
- if (aBaseMetaTileEntity.getAir(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)))
- {
- aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.lava, 1, 2);
- this.mUpdate = 1;
+ extends MetaTileEntity {
+ private static final ITexture[] FACING_SIDE = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEPLATEDBRICKS)};
+ private static final ITexture[] FACING_FRONT = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE)};
+ private static final ITexture[] FACING_ACTIVE = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE_ACTIVE)};
+ public int mMaxProgresstime = 0;
+ public int mUpdate = 5;
+ public int mProgresstime = 0;
+ public boolean mMachine = false;
+ public ItemStack mOutputItem1;
+ public ItemStack mOutputItem2;
+
+ public GT_MetaTileEntity_BronzeBlastFurnace(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, 4);
+ }
+
+ public GT_MetaTileEntity_BronzeBlastFurnace(String aName) {
+ super(aName, 4);
+ }
+
+ public String[] getDescription() {
+ return new String[]{"To get your first Steel", "Multiblock: 3x3x4 hollow with opening on top", "32 Bronze Plated Bricks required"};
+ }
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return aActive ? FACING_ACTIVE : FACING_FRONT;
}
- if (aBaseMetaTileEntity.getAir(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)))
- {
- aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.lava, 1, 2);
- this.mUpdate = 1;
+ return FACING_SIDE;
+ }
+
+ public boolean isSteampowered() {
+ return false;
+ }
+
+ public boolean isElectric() {
+ return false;
+ }
+
+ public boolean isPneumatic() {
+ return false;
+ }
+
+ public boolean isEnetInput() {
+ return false;
+ }
+
+ public boolean isEnetOutput() {
+ return false;
+ }
+
+ public boolean isInputFacing(byte aSide) {
+ return false;
+ }
+
+ public boolean isOutputFacing(byte aSide) {
+ return false;
+ }
+
+ public boolean isTeleporterCompatible() {
+ return false;
+ }
+
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ public int getProgresstime() {
+ return this.mProgresstime;
+ }
+
+ public int maxProgresstime() {
+ return this.mMaxProgresstime;
+ }
+
+ public int increaseProgress(int aProgress) {
+ this.mProgresstime += aProgress;
+ return this.mMaxProgresstime - this.mProgresstime;
+ }
+
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) {
+ return (GregTech_API.getCoverBehavior(aCoverID.toStack()).isSimpleCover()) && (super.allowCoverOnSide(aSide, aCoverID));
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_BronzeBlastFurnace(this.mName);
+ }
+
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setInteger("mProgresstime", this.mProgresstime);
+ aNBT.setInteger("mMaxProgresstime", this.mMaxProgresstime);
+ if (this.mOutputItem1 != null) {
+ NBTTagCompound tNBT = new NBTTagCompound();
+ this.mOutputItem1.writeToNBT(tNBT);
+ aNBT.setTag("mOutputItem1", tNBT);
}
- }
- else
- {
- if (aBaseMetaTileEntity.getBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)) == Blocks.lava)
- {
- aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.air, 0, 2);
- this.mUpdate = 1;
+ if (this.mOutputItem2 != null) {
+ NBTTagCompound tNBT = new NBTTagCompound();
+ this.mOutputItem2.writeToNBT(tNBT);
+ aNBT.setTag("mOutputItem2", tNBT);
}
- if (aBaseMetaTileEntity.getBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)) == Blocks.lava)
- {
- aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.air, 0, 2);
- this.mUpdate = 1;
+ }
+
+ public void loadNBTData(NBTTagCompound aNBT) {
+ this.mUpdate = 5;
+ this.mProgresstime = aNBT.getInteger("mProgresstime");
+ this.mMaxProgresstime = aNBT.getInteger("mMaxProgresstime");
+ this.mOutputItem1 = GT_Utility.loadItem(aNBT, "mOutputItem1");
+ this.mOutputItem2 = GT_Utility.loadItem(aNBT, "mOutputItem2");
+ }
+
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
}
- }
- }
- }
-
- private void addOutputProducts()
- {
- if (this.mOutputItem1 != null) {
- if (this.mInventory[2] == null) {
- this.mInventory[2] = GT_Utility.copy(new Object[] { this.mOutputItem1 });
- } else if (GT_Utility.areStacksEqual(this.mInventory[2], this.mOutputItem1)) {
- this.mInventory[2].stackSize = Math.min(this.mOutputItem1.getMaxStackSize(), this.mOutputItem1.stackSize + this.mInventory[2].stackSize);
- }
- }
- if (this.mOutputItem2 != null) {
- if (this.mInventory[3] == null) {
- this.mInventory[3] = GT_Utility.copy(new Object[] { this.mOutputItem2 });
- } else if (GT_Utility.areStacksEqual(this.mInventory[3], this.mOutputItem2)) {
- this.mInventory[3].stackSize = Math.min(this.mOutputItem2.getMaxStackSize(), this.mOutputItem2.stackSize + this.mInventory[3].stackSize);
- }
- }
- }
-
- private boolean spaceForOutput(ItemStack aStack1, ItemStack aStack2)
- {
- if (((this.mInventory[2] == null) || (aStack1 == null) || ((this.mInventory[2].stackSize + aStack1.stackSize <= this.mInventory[2].getMaxStackSize()) && (GT_Utility.areStacksEqual(this.mInventory[2], aStack1)))) && (
- (this.mInventory[3] == null) || (aStack2 == null) || ((this.mInventory[3].stackSize + aStack2.stackSize <= this.mInventory[3].getMaxStackSize()) && (GT_Utility.areStacksEqual(this.mInventory[3], aStack2))))) {
- return true;
- }
- return false;
- }
-
- private boolean checkRecipe()
- {
- if (!this.mMachine) {
- return false;
- }
- if ((this.mInventory[0] != null) && (this.mInventory[1] != null) && (this.mInventory[0].stackSize >= 1)) {
- if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "dustIron")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "ingotIron")))
- {
- if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 4) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 4L))))
- {
- getBaseMetaTileEntity().decrStackSize(0, 1);
- getBaseMetaTileEntity().decrStackSize(1, 4);
- this.mMaxProgresstime = 7200;
- return true;
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_BronzeBlastFurnace(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_BronzeBlastFurnace(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ private boolean checkMachine() {
+ int xDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 3; j++) {
+ for (int k = -1; k < 2; k++) {
+ if ((xDir + i != 0) || (j != 0) || (zDir + k != 0)) {
+ if ((i != 0) || (j == -1) || (k != 0)) {
+ if ((getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k) != GregTech_API.sBlockCasings1) || (getBaseMetaTileEntity().getMetaIDOffset(xDir + i, j, zDir + k) != 10)) {
+ return false;
+ }
+ } else if ((!GT_Utility.arrayContains(getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k), new Object[]{Blocks.lava, Blocks.flowing_lava, null})) && (!getBaseMetaTileEntity().getAirOffset(xDir + i, j, zDir + k))) {
+ return false;
+ }
+ }
+ }
+ }
}
- if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 2) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 4L))))
- {
- getBaseMetaTileEntity().decrStackSize(0, 1);
- getBaseMetaTileEntity().decrStackSize(1, 2);
- this.mMaxProgresstime = 4800;
- return true;
+ return true;
+ }
+
+ public void onMachineBlockUpdate() {
+ this.mUpdate = 5;
+ }
+
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
+ if ((aBaseMetaTileEntity.isClientSide()) &&
+ (aBaseMetaTileEntity.isActive())) {
+ aBaseMetaTileEntity.getWorld().spawnParticle("largesmoke", aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1) + Math.random(), aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1) + Math.random(), 0.0D, 0.3D, 0.0D);
}
- if ((this.mInventory[0].stackSize >= 9) && ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 4) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L))))
- {
- getBaseMetaTileEntity().decrStackSize(0, 9);
- getBaseMetaTileEntity().decrStackSize(1, 4);
- this.mMaxProgresstime = 64800;
- return true;
+ if (aBaseMetaTileEntity.isServerSide()) {
+ if (this.mUpdate-- == 0) {
+ this.mMachine = checkMachine();
+ }
+ if (this.mMachine) {
+ if (this.mMaxProgresstime > 0) {
+ if (++this.mProgresstime >= this.mMaxProgresstime) {
+ addOutputProducts();
+ this.mOutputItem1 = null;
+ this.mOutputItem2 = null;
+ this.mProgresstime = 0;
+ this.mMaxProgresstime = 0;
+ try {
+ GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "steel");
+ } catch (Exception e) {
+ }
+ }
+ } else if (aBaseMetaTileEntity.isAllowedToWork()) {
+ checkRecipe();
+ }
+ }
+ aBaseMetaTileEntity.setActive((this.mMaxProgresstime > 0) && (this.mMachine));
+ if (aBaseMetaTileEntity.isActive()) {
+ if (aBaseMetaTileEntity.getAir(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1))) {
+ aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.lava, 1, 2);
+ this.mUpdate = 1;
+ }
+ if (aBaseMetaTileEntity.getAir(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1))) {
+ aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.lava, 1, 2);
+ this.mUpdate = 1;
+ }
+ } else {
+ if (aBaseMetaTileEntity.getBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)) == Blocks.lava) {
+ aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.air, 0, 2);
+ this.mUpdate = 1;
+ }
+ if (aBaseMetaTileEntity.getBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)) == Blocks.lava) {
+ aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.air, 0, 2);
+ this.mUpdate = 1;
+ }
+ }
}
- }
- else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "dustSteel"))
- {
- if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 2) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 2L))))
- {
- getBaseMetaTileEntity().decrStackSize(0, 1);
- getBaseMetaTileEntity().decrStackSize(1, 2);
- this.mMaxProgresstime = 3600;
- return true;
+ }
+
+ private void addOutputProducts() {
+ if (this.mOutputItem1 != null) {
+ if (this.mInventory[2] == null) {
+ this.mInventory[2] = GT_Utility.copy(new Object[]{this.mOutputItem1});
+ } else if (GT_Utility.areStacksEqual(this.mInventory[2], this.mOutputItem1)) {
+ this.mInventory[2].stackSize = Math.min(this.mOutputItem1.getMaxStackSize(), this.mOutputItem1.stackSize + this.mInventory[2].stackSize);
+ }
}
- if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 1) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 2L))))
- {
- getBaseMetaTileEntity().decrStackSize(0, 1);
- getBaseMetaTileEntity().decrStackSize(1, 1);
- this.mMaxProgresstime = 2400;
- return true;
+ if (this.mOutputItem2 != null) {
+ if (this.mInventory[3] == null) {
+ this.mInventory[3] = GT_Utility.copy(new Object[]{this.mOutputItem2});
+ } else if (GT_Utility.areStacksEqual(this.mInventory[3], this.mOutputItem2)) {
+ this.mInventory[3].stackSize = Math.min(this.mOutputItem2.getMaxStackSize(), this.mOutputItem2.stackSize + this.mInventory[3].stackSize);
+ }
}
- if ((this.mInventory[0].stackSize >= 9) && ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 2) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 2L))))
- {
- getBaseMetaTileEntity().decrStackSize(0, 9);
- getBaseMetaTileEntity().decrStackSize(1, 2);
- this.mMaxProgresstime = 32400;
- return true;
+ }
+
+ private boolean spaceForOutput(ItemStack aStack1, ItemStack aStack2) {
+ if (((this.mInventory[2] == null) || (aStack1 == null) || ((this.mInventory[2].stackSize + aStack1.stackSize <= this.mInventory[2].getMaxStackSize()) && (GT_Utility.areStacksEqual(this.mInventory[2], aStack1)))) && (
+ (this.mInventory[3] == null) || (aStack2 == null) || ((this.mInventory[3].stackSize + aStack2.stackSize <= this.mInventory[3].getMaxStackSize()) && (GT_Utility.areStacksEqual(this.mInventory[3], aStack2))))) {
+ return true;
}
- }
- else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "blockIron"))
- {
- if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 36) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L))))
- {
- getBaseMetaTileEntity().decrStackSize(0, 1);
- getBaseMetaTileEntity().decrStackSize(1, 36);
- this.mMaxProgresstime = 64800;
- return true;
+ return false;
+ }
+
+ private boolean checkRecipe() {
+ if (!this.mMachine) {
+ return false;
}
- if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 18) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Ash, 4L))))
- {
- getBaseMetaTileEntity().decrStackSize(0, 1);
- getBaseMetaTileEntity().decrStackSize(1, 18);
- this.mMaxProgresstime = 43200;
- return true;
+ if ((this.mInventory[0] != null) && (this.mInventory[1] != null) && (this.mInventory[0].stackSize >= 1)) {
+ if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "dustIron")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "ingotIron"))) {
+ if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 4) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 4L)))) {
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ getBaseMetaTileEntity().decrStackSize(1, 4);
+ this.mMaxProgresstime = 7200;
+ return true;
+ }
+ if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 2) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 4L)))) {
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ getBaseMetaTileEntity().decrStackSize(1, 2);
+ this.mMaxProgresstime = 4800;
+ return true;
+ }
+ if ((this.mInventory[0].stackSize >= 9) && ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 4) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) {
+ getBaseMetaTileEntity().decrStackSize(0, 9);
+ getBaseMetaTileEntity().decrStackSize(1, 4);
+ this.mMaxProgresstime = 64800;
+ return true;
+ }
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "dustSteel")) {
+ if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 2) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 2L)))) {
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ getBaseMetaTileEntity().decrStackSize(1, 2);
+ this.mMaxProgresstime = 3600;
+ return true;
+ }
+ if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 1) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 2L)))) {
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ getBaseMetaTileEntity().decrStackSize(1, 1);
+ this.mMaxProgresstime = 2400;
+ return true;
+ }
+ if ((this.mInventory[0].stackSize >= 9) && ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 2) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 2L)))) {
+ getBaseMetaTileEntity().decrStackSize(0, 9);
+ getBaseMetaTileEntity().decrStackSize(1, 2);
+ this.mMaxProgresstime = 32400;
+ return true;
+ }
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "blockIron")) {
+ if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 36) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) {
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ getBaseMetaTileEntity().decrStackSize(1, 36);
+ this.mMaxProgresstime = 64800;
+ return true;
+ }
+ if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 18) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Ash, 4L)))) {
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ getBaseMetaTileEntity().decrStackSize(1, 18);
+ this.mMaxProgresstime = 43200;
+ return true;
+ }
+ if (((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 4) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) {
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ getBaseMetaTileEntity().decrStackSize(1, 4);
+ this.mMaxProgresstime = 64800;
+ return true;
+ }
+ }
}
- if (((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 4) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L))))
- {
- getBaseMetaTileEntity().decrStackSize(0, 1);
- getBaseMetaTileEntity().decrStackSize(1, 4);
- this.mMaxProgresstime = 64800;
- return true;
+ this.mOutputItem1 = null;
+ this.mOutputItem2 = null;
+ return false;
+ }
+
+ public boolean isGivingInformation() {
+ return false;
+ }
+
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return aIndex > 1;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ if (aIndex < 2) {
}
- }
- }
- this.mOutputItem1 = null;
- this.mOutputItem2 = null;
- return false;
- }
-
- public boolean isGivingInformation()
- {
- return false;
- }
-
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
- {
- return aIndex > 1;
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
- {
- if (aIndex < 2) {}
- return !GT_Utility.areStacksEqual(aStack, this.mInventory[0]);
- }
-
- public byte getTileEntityBaseType()
- {
- return 0;
- }
+ return !GT_Utility.areStacksEqual(aStack, this.mInventory[0]);
+ }
+
+ public byte getTileEntityBaseType() {
+ return 0;
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java
index fcfdbfc104..ad22536d6e 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java
@@ -1,214 +1,214 @@
package gregtech.common.tileentities.machines.multi;
-import java.util.ArrayList;
-
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.world.ChunkPosition;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
-import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
-import gregtech.api.gui.GT_GUIContainer_MultiMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-import gregtech.common.blocks.GT_Block_Reinforced;
-
-public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlockBase{
-
- private boolean running = false;
- public GT_MetaTileEntity_Charcoal_Pit(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_Charcoal_Pit(String aName)
- {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_Charcoal_Pit(this.mName);
- }
-
- public String[] getDescription()
- {
- return new String[] { "Charcoal pit controller",
- "Place on top of a pile of wood logs",
- "Maximum size of logs below 11x5x11",
- "Each log only can have other logs,",
- "dirt or grass on its sides or above",
- "or only logs or bricks below",
- "Turns logs into Brittle Charcoal blocks"};
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
- {
- if (aSide == 1) {
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[10], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER) };
- }
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[10] };
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipeMap()
- {
- return null;
- }
-
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) return true;
-
- return true;
- }
-
- public boolean isCorrectMachinePart(ItemStack aStack)
- {
- return true;
- }
-
- public boolean isFacingValid(byte aFacing)
- {
- return aFacing > 1;
- }
-
- public boolean checkRecipe(ItemStack aStack)
- {
- if(!checkRecursiveBlocks()){
- return false;
- }
-
- if(mEfficiency==0){
- this.mEfficiency = 10000;
- this.mEfficiencyIncrease = 10000;
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- return true;
- }else{
- this.mEfficiency=0;
- this.mEfficiencyIncrease = 0;
- this.mMaxProgresstime = 0;
- }
- return false;
- }
-
- private boolean checkRecursiveBlocks(){
- ArrayList<ChunkPosition> tList1 = new ArrayList();
- ArrayList<ChunkPosition> tList2 = new ArrayList();
-
- Block tBlock = this.getBaseMetaTileEntity().getBlockOffset(0, -1, 0);
- if(tBlock!=Blocks.log&&tBlock!=Blocks.log2){
- return false;
- }else{
- tList2.add(new ChunkPosition(0,-1,0));//this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord()-1, this.getBaseMetaTileEntity().getZCoord()));
- }
- while(!tList2.isEmpty()){
- ChunkPosition tPos= (ChunkPosition) tList2.get(0);
- tList2.remove(0);
- if(!checkAllBlockSides(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ, tList1, tList2)){
- return false;
- }
- }
- if(running){
- for(ChunkPosition tPos : tList1){
- if(this.getBaseMetaTileEntity().getBlockOffset(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ)==Blocks.log)
- this.getBaseMetaTileEntity().getWorld().setBlock(this.getBaseMetaTileEntity().getXCoord()+tPos.chunkPosX, this.getBaseMetaTileEntity().getYCoord()+tPos.chunkPosY, this.getBaseMetaTileEntity().getZCoord()+tPos.chunkPosZ, GregTech_API.sBlockReinforced, 4, 3);
- }
- running = false;
- return false;
- }else{
- this.mMaxProgresstime = (int) Math.sqrt(tList1.size()* 240000);
- }
- running = true;
- return true;
- }
- private boolean p1,p2,p3,p4,p5,p6;
- private boolean checkAllBlockSides(int aX, int aY, int aZ, ArrayList<ChunkPosition> aList1, ArrayList<ChunkPosition> aList2){
- p1=false;p2=false;p3=false;p4=false;p5=false;p6=false;
- Block tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX +1, aY, aZ);
- if(aX+1<6&&(tBlock==Blocks.log||tBlock==Blocks.log2)){
- if(!aList1.contains(new ChunkPosition(aX +1, aY, aZ))&&(!aList2.contains(new ChunkPosition(aX +1, aY, aZ))))p1=true;
- }else if(!(tBlock==Blocks.dirt||tBlock==Blocks.grass)){return false;}
-
- tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX -1, aY, aZ);
- if(aX-1>-6&&(tBlock==Blocks.log||tBlock==Blocks.log2)){
- if(!aList1.contains(new ChunkPosition(aX -1, aY, aZ))&&(!aList2.contains(new ChunkPosition(aX -1, aY, aZ))))p2=true;
- }else if(!(tBlock==Blocks.dirt||tBlock==Blocks.grass)){return false;}
-
- tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX , aY+1, aZ);
- if(aY+1<1&&(tBlock==Blocks.log||tBlock==Blocks.log2)){
- if(!aList1.contains(new ChunkPosition(aX, aY+1, aZ))&&(!aList2.contains(new ChunkPosition(aX, aY+1, aZ))))p3=true;
- }else if(!(tBlock==Blocks.dirt||tBlock==Blocks.grass||(aX==0&&aY==-1&&aZ==0&&tBlock==GregTech_API.sBlockMachines))){return false;}
-
- tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX, aY-1, aZ);
- if(aY-1>-6&&(tBlock==Blocks.log||tBlock==Blocks.log2)){
- if(!aList1.contains(new ChunkPosition(aX, aY-1, aZ))&&(!aList2.contains(new ChunkPosition(aX, aY-1, aZ))))p4=true;
- }else if(tBlock!=Blocks.brick_block){return false;}
-
- tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX, aY, aZ+1);
- if(aZ+1<6&&(tBlock==Blocks.log||tBlock==Blocks.log2)){
- if(!aList1.contains(new ChunkPosition(aX, aY, aZ+1))&&(!aList2.contains(new ChunkPosition(aX, aY, aZ+1))))p5=true;
- }else if(!(tBlock==Blocks.dirt||tBlock==Blocks.grass)){return false;}
-
- tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX, aY, aZ-1);
- if(aZ-1>-6&&(tBlock==Blocks.log||tBlock==Blocks.log2)){
- if(!aList1.contains(new ChunkPosition(aX, aY, aZ-1))&&(!aList2.contains(new ChunkPosition(aX, aY, aZ-1))))p6=true;
- }else if(!(tBlock==Blocks.dirt||tBlock==Blocks.grass)){return false;}
- aList1.add(new ChunkPosition(aX,aY,aZ));
- if(p1)aList2.add(new ChunkPosition(aX+1,aY,aZ));
- if(p2)aList2.add(new ChunkPosition(aX-1,aY,aZ));
- if(p3)aList2.add(new ChunkPosition(aX,aY+1,aZ));
- if(p4)aList2.add(new ChunkPosition(aX,aY-1,aZ));
- if(p5)aList2.add(new ChunkPosition(aX,aY,aZ+1));
- if(p6)aList2.add(new ChunkPosition(aX,aY,aZ-1));
- return true;
- }
-
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack)
- {
- mWrench = true;
- mScrewdriver = true;
- mSoftHammer = true;
- mHardHammer = true;
- mSolderingTool = true;
- mCrowbar = true;
- return true;
- }
-
- public int getMaxEfficiency(ItemStack aStack)
- {
- return 10000;
- }
-
- public int getPollutionPerTick(ItemStack aStack)
- {
- return 0;
- }
-
- public int getDamageToComponent(ItemStack aStack)
- {
- return 0;
- }
-
- public int getAmountOfOutputs()
- {
- return 1;
- }
-
- public boolean explodesOnComponentBreak(ItemStack aStack)
- {
- return false;
- }
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.ChunkPosition;
+
+import java.util.ArrayList;
+
+public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlockBase {
+
+ private boolean running = false;
+ private boolean p1, p2, p3, p4, p5, p6;
+
+ public GT_MetaTileEntity_Charcoal_Pit(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_Charcoal_Pit(String aName) {
+ super(aName);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Charcoal_Pit(this.mName);
+ }
+
+ public String[] getDescription() {
+ return new String[]{"Charcoal pit controller",
+ "Place on top of a pile of wood logs",
+ "Maximum size of logs below 11x5x11",
+ "Each log only can have other logs,",
+ "dirt or grass on its sides or above",
+ "or only logs or bricks below",
+ "Turns logs into Brittle Charcoal blocks"};
+ }
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == 1) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[10], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER)};
+ }
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[10]};
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return null;
+ }
+
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) return true;
+
+ return true;
+ }
+
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ public boolean checkRecipe(ItemStack aStack) {
+ if (!checkRecursiveBlocks()) {
+ return false;
+ }
+
+ if (mEfficiency == 0) {
+ this.mEfficiency = 10000;
+ this.mEfficiencyIncrease = 10000;
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ return true;
+ } else {
+ this.mEfficiency = 0;
+ this.mEfficiencyIncrease = 0;
+ this.mMaxProgresstime = 0;
+ }
+ return false;
+ }
+
+ private boolean checkRecursiveBlocks() {
+ ArrayList<ChunkPosition> tList1 = new ArrayList();
+ ArrayList<ChunkPosition> tList2 = new ArrayList();
+
+ Block tBlock = this.getBaseMetaTileEntity().getBlockOffset(0, -1, 0);
+ if (tBlock != Blocks.log && tBlock != Blocks.log2) {
+ return false;
+ } else {
+ tList2.add(new ChunkPosition(0, -1, 0));//this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord()-1, this.getBaseMetaTileEntity().getZCoord()));
+ }
+ while (!tList2.isEmpty()) {
+ ChunkPosition tPos = (ChunkPosition) tList2.get(0);
+ tList2.remove(0);
+ if (!checkAllBlockSides(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ, tList1, tList2)) {
+ return false;
+ }
+ }
+ if (running) {
+ for (ChunkPosition tPos : tList1) {
+ if (this.getBaseMetaTileEntity().getBlockOffset(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ) == Blocks.log)
+ this.getBaseMetaTileEntity().getWorld().setBlock(this.getBaseMetaTileEntity().getXCoord() + tPos.chunkPosX, this.getBaseMetaTileEntity().getYCoord() + tPos.chunkPosY, this.getBaseMetaTileEntity().getZCoord() + tPos.chunkPosZ, GregTech_API.sBlockReinforced, 4, 3);
+ }
+ running = false;
+ return false;
+ } else {
+ this.mMaxProgresstime = (int) Math.sqrt(tList1.size() * 240000);
+ }
+ running = true;
+ return true;
+ }
+
+ private boolean checkAllBlockSides(int aX, int aY, int aZ, ArrayList<ChunkPosition> aList1, ArrayList<ChunkPosition> aList2) {
+ p1 = false;
+ p2 = false;
+ p3 = false;
+ p4 = false;
+ p5 = false;
+ p6 = false;
+ Block tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX + 1, aY, aZ);
+ if (aX + 1 < 6 && (tBlock == Blocks.log || tBlock == Blocks.log2)) {
+ if (!aList1.contains(new ChunkPosition(aX + 1, aY, aZ)) && (!aList2.contains(new ChunkPosition(aX + 1, aY, aZ))))
+ p1 = true;
+ } else if (!(tBlock == Blocks.dirt || tBlock == Blocks.grass)) {
+ return false;
+ }
+
+ tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX - 1, aY, aZ);
+ if (aX - 1 > -6 && (tBlock == Blocks.log || tBlock == Blocks.log2)) {
+ if (!aList1.contains(new ChunkPosition(aX - 1, aY, aZ)) && (!aList2.contains(new ChunkPosition(aX - 1, aY, aZ))))
+ p2 = true;
+ } else if (!(tBlock == Blocks.dirt || tBlock == Blocks.grass)) {
+ return false;
+ }
+
+ tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX, aY + 1, aZ);
+ if (aY + 1 < 1 && (tBlock == Blocks.log || tBlock == Blocks.log2)) {
+ if (!aList1.contains(new ChunkPosition(aX, aY + 1, aZ)) && (!aList2.contains(new ChunkPosition(aX, aY + 1, aZ))))
+ p3 = true;
+ } else if (!(tBlock == Blocks.dirt || tBlock == Blocks.grass || (aX == 0 && aY == -1 && aZ == 0 && tBlock == GregTech_API.sBlockMachines))) {
+ return false;
+ }
+
+ tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX, aY - 1, aZ);
+ if (aY - 1 > -6 && (tBlock == Blocks.log || tBlock == Blocks.log2)) {
+ if (!aList1.contains(new ChunkPosition(aX, aY - 1, aZ)) && (!aList2.contains(new ChunkPosition(aX, aY - 1, aZ))))
+ p4 = true;
+ } else if (tBlock != Blocks.brick_block) {
+ return false;
+ }
+
+ tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX, aY, aZ + 1);
+ if (aZ + 1 < 6 && (tBlock == Blocks.log || tBlock == Blocks.log2)) {
+ if (!aList1.contains(new ChunkPosition(aX, aY, aZ + 1)) && (!aList2.contains(new ChunkPosition(aX, aY, aZ + 1))))
+ p5 = true;
+ } else if (!(tBlock == Blocks.dirt || tBlock == Blocks.grass)) {
+ return false;
+ }
+
+ tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX, aY, aZ - 1);
+ if (aZ - 1 > -6 && (tBlock == Blocks.log || tBlock == Blocks.log2)) {
+ if (!aList1.contains(new ChunkPosition(aX, aY, aZ - 1)) && (!aList2.contains(new ChunkPosition(aX, aY, aZ - 1))))
+ p6 = true;
+ } else if (!(tBlock == Blocks.dirt || tBlock == Blocks.grass)) {
+ return false;
+ }
+ aList1.add(new ChunkPosition(aX, aY, aZ));
+ if (p1) aList2.add(new ChunkPosition(aX + 1, aY, aZ));
+ if (p2) aList2.add(new ChunkPosition(aX - 1, aY, aZ));
+ if (p3) aList2.add(new ChunkPosition(aX, aY + 1, aZ));
+ if (p4) aList2.add(new ChunkPosition(aX, aY - 1, aZ));
+ if (p5) aList2.add(new ChunkPosition(aX, aY, aZ + 1));
+ if (p6) aList2.add(new ChunkPosition(aX, aY, aZ - 1));
+ return true;
+ }
+
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ mWrench = true;
+ mScrewdriver = true;
+ mSoftHammer = true;
+ mHardHammer = true;
+ mSolderingTool = true;
+ mCrowbar = true;
+ return true;
+ }
+
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
+
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java
index 7386e74ed8..486c9faf3f 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java
@@ -2,7 +2,6 @@ package gregtech.common.tileentities.machines.multi;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.gui.GT_GUIContainer_MultiMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -11,11 +10,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Outpu
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
-
-import java.util.ArrayList;
-
import net.minecraft.block.Block;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
@@ -23,176 +18,165 @@ import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_DistillationTower
- extends GT_MetaTileEntity_MultiBlockBase
-{
- public GT_MetaTileEntity_DistillationTower(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_DistillationTower(String aName)
- {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_DistillationTower(this.mName);
- }
-
- public String[] getDescription()
- {
- return new String[] {
- "Controller Block for the Distillation Tower",
- "Size: 3x6x3 (Hollow)", "Controller (front bottom)",
- "1x Input Hatch (bottom)",
- "5x Output Hatch (one each height level besides botton)",
- "1x Output Bus (Botton)", "1x Energy Hatch (anywhere)",
- "1x Maintenance Hatch (anywhere)",
- "Clean Stainless Steel Casings for the rest (26 at least!)" };
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
- {
- if (aSide == aFacing) {
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[49], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER) };
- }
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[49] };
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png");
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipeMap()
- {
- return GT_Recipe.GT_Recipe_Map.sDistillationRecipes;
- }
-
- public boolean isCorrectMachinePart(ItemStack aStack)
- {
- return true;
- }
-
- public boolean isFacingValid(byte aFacing)
- {
- return aFacing > 1;
- }
-
- public boolean checkRecipe(ItemStack aStack)
- {
-
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte)Math.max(1, GT_Utility.getTier(tVoltage));
- if(this.mInputHatches.size()>0&&this.mInputHatches.get(0)!=null&&this.mInputHatches.get(0).mFluid!=null&&this.mInputHatches.get(0).mFluid.amount>0){
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[]{this.mInputHatches.get(0).mFluid}, new ItemStack[] {});
- if (tRecipe != null) {
- if (tRecipe.isRecipeInputEqual(true, new FluidStack[]{this.mInputHatches.get(0).mFluid}, new ItemStack[] {}))
- {
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
- if (tRecipe.mEUt <= 16)
- {
- this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
- }
- else
- {
- this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = tRecipe.mDuration;
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)])
- {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
+ extends GT_MetaTileEntity_MultiBlockBase {
+ private static boolean controller;
+
+ public GT_MetaTileEntity_DistillationTower(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_DistillationTower(String aName) {
+ super(aName);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_DistillationTower(this.mName);
+ }
+
+ public String[] getDescription() {
+ return new String[]{
+ "Controller Block for the Distillation Tower",
+ "Size: 3x6x3 (Hollow)", "Controller (front bottom)",
+ "1x Input Hatch (bottom)",
+ "5x Output Hatch (one each height level besides botton)",
+ "1x Output Bus (Botton)", "1x Energy Hatch (anywhere)",
+ "1x Maintenance Hatch (anywhere)",
+ "Clean Stainless Steel Casings for the rest (26 at least!)"};
+ }
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[49], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER)};
+ }
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[49]};
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png");
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sDistillationRecipes;
+ }
+
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ public boolean checkRecipe(ItemStack aStack) {
+
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ if (this.mInputHatches.size() > 0 && this.mInputHatches.get(0) != null && this.mInputHatches.get(0).mFluid != null && this.mInputHatches.get(0).mFluid.amount > 0) {
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[]{this.mInputHatches.get(0).mFluid}, new ItemStack[]{});
+ if (tRecipe != null) {
+ if (tRecipe.isRecipeInputEqual(true, new FluidStack[]{this.mInputHatches.get(0).mFluid}, new ItemStack[]{})) {
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ if (tRecipe.mEUt <= 16) {
+ this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
+ } else {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = tRecipe.mDuration;
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)};
+ this.mOutputFluids = tRecipe.mFluidOutputs;
+ updateSlots();
+ return true;
+ }
}
- }
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- this.mOutputItems = new ItemStack[] { tRecipe.getOutput(0) };
- this.mOutputFluids = tRecipe.mFluidOutputs;
- updateSlots();
- return true;
}
- }}
-
- return false;
- }
- private static boolean controller;
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack)
- {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
- if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) {
- return false;
- }
- int tAmount = 0;
- controller=false;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- for (int h = 0; h < 6; h++) {
- if (!(i==0&&j==0&&(h>0&&h<5)))//((h > 0)&&(h<5)) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))
- {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
- if ((!addMaintenanceToMachineList(tTileEntity, 49)) && (!addInputToMachineList(tTileEntity, 49)) && (!addOutputToMachineList(tTileEntity, 49)) && (!addEnergyInputToMachineList(tTileEntity, 49))&&(!ignoreController(aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j))))
- {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings4) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 1) {
- return false;
- }
- tAmount++;
+
+ return false;
+ }
+
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) {
+ return false;
+ }
+ int tAmount = 0;
+ controller = false;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ for (int h = 0; h < 6; h++) {
+ if (!(i == 0 && j == 0 && (h > 0 && h < 5)))//((h > 0)&&(h<5)) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))
+ {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
+ if ((!addMaintenanceToMachineList(tTileEntity, 49)) && (!addInputToMachineList(tTileEntity, 49)) && (!addOutputToMachineList(tTileEntity, 49)) && (!addEnergyInputToMachineList(tTileEntity, 49)) && (!ignoreController(aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j)))) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings4) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 1) {
+ return false;
+ }
+ tAmount++;
+ }
+ }
+ }
+ }
+ }
+ if (this.mInputHatches.size() != 1 || this.mOutputBusses.size() != 1 || this.mInputBusses.size() != 0 || this.mOutputHatches.size() != 5) {
+ return false;
+ }
+ int height = this.getBaseMetaTileEntity().getYCoord();
+ if (this.mInputHatches.get(0).getBaseMetaTileEntity().getYCoord() != height || this.mOutputBusses.get(0).getBaseMetaTileEntity().getYCoord() != height) {
+ return false;
+ }
+ GT_MetaTileEntity_Hatch_Output[] tmpHatches = new GT_MetaTileEntity_Hatch_Output[5];
+ for (int i = 0; i < this.mOutputHatches.size(); i++) {
+ int hatchNumber = this.mOutputHatches.get(i).getBaseMetaTileEntity().getYCoord() - 1 - height;
+ if (tmpHatches[hatchNumber] == null) {
+ tmpHatches[hatchNumber] = this.mOutputHatches.get(i);
+ } else {
+ return false;
}
- }
}
- }
- }
- if(this.mInputHatches.size()!=1||this.mOutputBusses.size()!=1||this.mInputBusses.size()!=0||this.mOutputHatches.size()!=5){return false;}
- int height = this.getBaseMetaTileEntity().getYCoord();
- if(this.mInputHatches.get(0).getBaseMetaTileEntity().getYCoord()!=height||this.mOutputBusses.get(0).getBaseMetaTileEntity().getYCoord()!=height){return false;}
- GT_MetaTileEntity_Hatch_Output[] tmpHatches = new GT_MetaTileEntity_Hatch_Output[5];
- for(int i=0;i< this.mOutputHatches.size();i++){
- int hatchNumber = this.mOutputHatches.get(i).getBaseMetaTileEntity().getYCoord()-1-height;
- if(tmpHatches[hatchNumber]==null){
- tmpHatches[hatchNumber]=this.mOutputHatches.get(i);
- }else{return false;}
- }
- this.mOutputHatches.clear();
- for(int i=0;i< tmpHatches.length;i++){
- this.mOutputHatches.add(tmpHatches[i]);
- }
- return tAmount >= 26;
- }
-
- public boolean ignoreController(Block tTileEntity){
- if(!controller&&tTileEntity == GregTech_API.sBlockMachines){return true;}
- return false;
- }
-
- public int getMaxEfficiency(ItemStack aStack)
- {
- return 10000;
- }
-
- public int getPollutionPerTick(ItemStack aStack)
- {
- return 0;
- }
-
- public int getDamageToComponent(ItemStack aStack)
- {
- return 0;
- }
-
- public int getAmountOfOutputs()
- {
- return 1;
- }
-
- public boolean explodesOnComponentBreak(ItemStack aStack)
- {
- return false;
- }
+ this.mOutputHatches.clear();
+ for (int i = 0; i < tmpHatches.length; i++) {
+ this.mOutputHatches.add(tmpHatches[i]);
+ }
+ return tAmount >= 26;
+ }
+
+ public boolean ignoreController(Block tTileEntity) {
+ if (!controller && tTileEntity == GregTech_API.sBlockMachines) {
+ return true;
+ }
+ return false;
+ }
+
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
+
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
} \ No newline at end of file
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java
index 8e77293c43..0c6463fcc8 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java
@@ -2,7 +2,6 @@ package gregtech.common.tileentities.machines.multi;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.gui.GT_GUIContainer_MultiMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -10,234 +9,205 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
+import java.util.ArrayList;
+import java.util.Arrays;
+
public class GT_MetaTileEntity_ElectricBlastFurnace
- extends GT_MetaTileEntity_MultiBlockBase
-{
- private int mHeatingCapacity = 0;
-
- public GT_MetaTileEntity_ElectricBlastFurnace(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_ElectricBlastFurnace(String aName)
- {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_ElectricBlastFurnace(this.mName);
- }
-
- public String[] getDescription()
- {
- return new String[] { "Controller Block for the Blast Furnace", "Size: 3x3x4 (Hollow)", "Controller (front middle at bottom)", "16x Heating Coils (two middle Layers, hollow)", "1x Input (one of bottom)", "1x Output (one of bottom)", "1x Energy Hatch (one of bottom)", "1x Maintenance Hatch (one of bottom)", "1x Muffler Hatch (top middle)", "Heat Proof Machine Casings for the rest" };
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
- {
- if (aSide == aFacing) {
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[11], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE) };
- }
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[11] };
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ElectricBlastFurnace.png");
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipeMap()
- {
- return GT_Recipe.GT_Recipe_Map.sBlastRecipes;
- }
-
- public boolean isCorrectMachinePart(ItemStack aStack)
- {
- return true;
- }
-
- public boolean isFacingValid(byte aFacing)
- {
- return aFacing > 1;
- }
-
- public boolean checkRecipe(ItemStack aStack)
- {
- ArrayList<ItemStack> tInputList = getStoredInputs();
- for (int i = 0; i < tInputList.size() - 1; i++) {
- for (int j = i + 1; j < tInputList.size(); j++) {
- if (GT_Utility.areStacksEqual((ItemStack)tInputList.get(i), (ItemStack)tInputList.get(j))) {
- if (((ItemStack)tInputList.get(i)).stackSize >= ((ItemStack)tInputList.get(j)).stackSize)
- {
- tInputList.remove(j--);
- }
- else
- {
- tInputList.remove(i--); break;
- }
- }
- }
- }
- ItemStack[] tInputs = (ItemStack[])Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
-
- ArrayList<FluidStack> tFluidList = getStoredFluids();
- for (int i = 0; i < tFluidList.size() - 1; i++) {
- for (int j = i + 1; j < tFluidList.size(); j++) {
- if (GT_Utility.areFluidsEqual((FluidStack)tFluidList.get(i), (FluidStack)tFluidList.get(j))) {
- if (((FluidStack)tFluidList.get(i)).amount >= ((FluidStack)tFluidList.get(j)).amount)
- {
- tFluidList.remove(j--);
- }
- else
- {
- tFluidList.remove(i--); break;
- }
+ extends GT_MetaTileEntity_MultiBlockBase {
+ private int mHeatingCapacity = 0;
+
+ public GT_MetaTileEntity_ElectricBlastFurnace(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_ElectricBlastFurnace(String aName) {
+ super(aName);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_ElectricBlastFurnace(this.mName);
+ }
+
+ public String[] getDescription() {
+ return new String[]{"Controller Block for the Blast Furnace", "Size: 3x3x4 (Hollow)", "Controller (front middle at bottom)", "16x Heating Coils (two middle Layers, hollow)", "1x Input (one of bottom)", "1x Output (one of bottom)", "1x Energy Hatch (one of bottom)", "1x Maintenance Hatch (one of bottom)", "1x Muffler Hatch (top middle)", "Heat Proof Machine Casings for the rest"};
+ }
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[11], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)};
}
- }
- }
- FluidStack[] tFluids = (FluidStack[])Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1);
- if (tInputList.size() > 0)
- {
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte)Math.max(1, GT_Utility.getTier(tVoltage));
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
- if ((tRecipe != null) && (this.mHeatingCapacity >= tRecipe.mSpecialValue) && (tRecipe.isRecipeInputEqual(true, tFluids, tInputs)))
- {
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
- if (tRecipe.mEUt <= 16)
- {
- this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[11]};
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ElectricBlastFurnace.png");
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sBlastRecipes;
+ }
+
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ public boolean checkRecipe(ItemStack aStack) {
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ for (int i = 0; i < tInputList.size() - 1; i++) {
+ for (int j = i + 1; j < tInputList.size(); j++) {
+ if (GT_Utility.areStacksEqual((ItemStack) tInputList.get(i), (ItemStack) tInputList.get(j))) {
+ if (((ItemStack) tInputList.get(i)).stackSize >= ((ItemStack) tInputList.get(j)).stackSize) {
+ tInputList.remove(j--);
+ } else {
+ tInputList.remove(i--);
+ break;
+ }
+ }
+ }
}
- else
- {
- this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = tRecipe.mDuration;
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)])
- {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
- }
+ ItemStack[] tInputs = (ItemStack[]) Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
+
+ ArrayList<FluidStack> tFluidList = getStoredFluids();
+ for (int i = 0; i < tFluidList.size() - 1; i++) {
+ for (int j = i + 1; j < tFluidList.size(); j++) {
+ if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) {
+ if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) {
+ tFluidList.remove(j--);
+ } else {
+ tFluidList.remove(i--);
+ break;
+ }
+ }
+ }
}
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
+ FluidStack[] tFluids = (FluidStack[]) Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1);
+ if (tInputList.size() > 0) {
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
+ if ((tRecipe != null) && (this.mHeatingCapacity >= tRecipe.mSpecialValue) && (tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) {
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ if (tRecipe.mEUt <= 16) {
+ this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
+ } else {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = tRecipe.mDuration;
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)};
+ updateSlots();
+ return true;
+ }
}
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- this.mOutputItems = new ItemStack[] { tRecipe.getOutput(0), tRecipe.getOutput(1) };
- updateSlots();
- return true;
- }
- }
- return false;
- }
-
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack)
- {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
-
- this.mHeatingCapacity = 0;
- if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) {
- return false;
- }
- if (!aBaseMetaTileEntity.getAirOffset(xDir, 2, zDir)) {
- return false;
- }
- addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 3, zDir), 11);
-
- byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 2, zDir);
- switch (tUsedMeta)
- {
- case 12:
- this.mHeatingCapacity = 1800; break;
- case 13:
- this.mHeatingCapacity = 2700; break;
- case 14:
- this.mHeatingCapacity = 3600; break;
- default:
- return false;
- }
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- if ((i != 0) || (j != 0))
- {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != GregTech_API.sBlockCasings1) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) != tUsedMeta) {
- return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != GregTech_API.sBlockCasings1) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != tUsedMeta) {
- return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 3, zDir + j) != GregTech_API.sBlockCasings1) {
+ return false;
+ }
+
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+
+ this.mHeatingCapacity = 0;
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) {
return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 3, zDir + j) != 11) {
+ }
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 2, zDir)) {
return false;
- }
}
- }
- }
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- if ((xDir + i != 0) || (zDir + j != 0))
- {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j);
- if ((!addMaintenanceToMachineList(tTileEntity, 11)) && (!addInputToMachineList(tTileEntity, 11)) && (!addOutputToMachineList(tTileEntity, 11)) && (!addEnergyInputToMachineList(tTileEntity, 11)))
- {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != GregTech_API.sBlockCasings1) {
- return false;
+ addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 3, zDir), 11);
+
+ byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 2, zDir);
+ switch (tUsedMeta) {
+ case 12:
+ this.mHeatingCapacity = 1800;
+ break;
+ case 13:
+ this.mHeatingCapacity = 2700;
+ break;
+ case 14:
+ this.mHeatingCapacity = 3600;
+ break;
+ default:
+ return false;
+ }
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if ((i != 0) || (j != 0)) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != GregTech_API.sBlockCasings1) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) != tUsedMeta) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != GregTech_API.sBlockCasings1) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != tUsedMeta) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 3, zDir + j) != GregTech_API.sBlockCasings1) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 3, zDir + j) != 11) {
+ return false;
+ }
+ }
}
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 11) {
- return false;
+ }
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if ((xDir + i != 0) || (zDir + j != 0)) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j);
+ if ((!addMaintenanceToMachineList(tTileEntity, 11)) && (!addInputToMachineList(tTileEntity, 11)) && (!addOutputToMachineList(tTileEntity, 11)) && (!addEnergyInputToMachineList(tTileEntity, 11))) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != GregTech_API.sBlockCasings1) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 11) {
+ return false;
+ }
+ }
+ }
}
- }
}
- }
- }
- this.mHeatingCapacity += 100 * (GT_Utility.getTier(getMaxInputVoltage()) - 2);
- return true;
- }
-
- public int getMaxEfficiency(ItemStack aStack)
- {
- return 10000;
- }
-
- public int getPollutionPerTick(ItemStack aStack)
- {
- return 10;
- }
-
- public int getDamageToComponent(ItemStack aStack)
- {
- return 0;
- }
-
- public int getAmountOfOutputs()
- {
- return 2;
- }
-
- public boolean explodesOnComponentBreak(ItemStack aStack)
- {
- return false;
- }
+ this.mHeatingCapacity += 100 * (GT_Utility.getTier(getMaxInputVoltage()) - 2);
+ return true;
+ }
+
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 10;
+ }
+
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ public int getAmountOfOutputs() {
+ return 2;
+ }
+
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java
index e25cfc08f2..b08eea2e3f 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java
@@ -1,445 +1,439 @@
package gregtech.common.tileentities.machines.multi;
-import java.util.ArrayList;
-import java.util.Arrays;
-
import gregtech.GT_Mod;
-import gregtech.api.GregTech_API;
import gregtech.api.enums.Dyes;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Textures;
import gregtech.api.gui.GT_Container_MultiMachine;
-import gregtech.api.gui.GT_GUIContainer_MultiMachine;
import gregtech.api.interfaces.IIconContainer;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+import gregtech.api.metatileentity.implementations.*;
import gregtech.api.objects.GT_ItemStack;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import gregtech.api.metatileentity.implementations.*;
import gregtech.common.gui.GT_GUIContainer_FusionReactor;
import net.minecraft.block.Block;
-import net.minecraft.client.multiplayer.WorldClient;
-import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.server.MinecraftServer;
-import net.minecraft.world.World;
-import net.minecraft.world.WorldType;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
+import java.util.ArrayList;
+
public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity_MultiBlockBase {
- public GT_Recipe mLastRecipe;
- public int mEUStore;
-
- public GT_MetaTileEntity_FusionComputer(int aID, String aName, String aNameRegional, int tier) {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_FusionComputer(String aName) {
- super(aName);
- }
-
- public abstract int tier();
-
- public abstract long maxEUStore();
-
- @Override
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_MultiMachine(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_FusionReactor(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "FusionComputer.png", GT_Recipe.GT_Recipe_Map.sFusionRecipes.mNEIName);
- }
-
- public abstract MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity);
-
- public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) {
-
- return aSide != getBaseMetaTileEntity().getFrontFacing();
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- int xCenter = getBaseMetaTileEntity().getXCoord() + ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()).offsetX * 5;
- int yCenter = getBaseMetaTileEntity().getYCoord();
- int zCenter = getBaseMetaTileEntity().getZCoord() + ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()).offsetZ * 5;
- if (((isAdvancedMachineCasing(xCenter + 5, yCenter, zCenter)) || (xCenter + 5 == getBaseMetaTileEntity().getXCoord()))
- && ((isAdvancedMachineCasing(xCenter - 5, yCenter, zCenter)) || (xCenter - 5 == getBaseMetaTileEntity().getXCoord()))
- && ((isAdvancedMachineCasing(xCenter, yCenter, zCenter + 5)) || (zCenter + 5 == getBaseMetaTileEntity().getZCoord()))
- && ((isAdvancedMachineCasing(xCenter, yCenter, zCenter - 5)) || (zCenter - 5 == getBaseMetaTileEntity().getZCoord())) && (checkCoils(xCenter, yCenter, zCenter))
- && (checkHulls(xCenter, yCenter, zCenter)) && (checkUpperOrLowerHulls(xCenter, yCenter + 1, zCenter)) && (checkUpperOrLowerHulls(xCenter, yCenter - 1, zCenter))
- && (addIfEnergyInjector(xCenter + 4, yCenter, zCenter + 3, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter + 4, yCenter, zCenter - 3, aBaseMetaTileEntity))
- && (addIfEnergyInjector(xCenter + 4, yCenter, zCenter + 5, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter + 4, yCenter, zCenter - 5, aBaseMetaTileEntity))
- && (addIfEnergyInjector(xCenter - 4, yCenter, zCenter + 3, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter - 4, yCenter, zCenter - 3, aBaseMetaTileEntity))
- && (addIfEnergyInjector(xCenter - 4, yCenter, zCenter + 5, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter - 4, yCenter, zCenter - 5, aBaseMetaTileEntity))
- && (addIfEnergyInjector(xCenter + 3, yCenter, zCenter + 4, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter - 3, yCenter, zCenter + 4, aBaseMetaTileEntity))
- && (addIfEnergyInjector(xCenter + 5, yCenter, zCenter + 4, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter - 5, yCenter, zCenter + 4, aBaseMetaTileEntity))
- && (addIfEnergyInjector(xCenter + 3, yCenter, zCenter - 4, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter - 3, yCenter, zCenter - 4, aBaseMetaTileEntity))
- && (addIfEnergyInjector(xCenter + 5, yCenter, zCenter - 4, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter - 5, yCenter, zCenter - 4, aBaseMetaTileEntity))
- && (addIfExtractor(xCenter + 1, yCenter, zCenter - 5, aBaseMetaTileEntity)) && (addIfExtractor(xCenter + 1, yCenter, zCenter + 5, aBaseMetaTileEntity))
- && (addIfExtractor(xCenter - 1, yCenter, zCenter - 5, aBaseMetaTileEntity)) && (addIfExtractor(xCenter - 1, yCenter, zCenter + 5, aBaseMetaTileEntity))
- && (addIfExtractor(xCenter + 1, yCenter, zCenter - 7, aBaseMetaTileEntity)) && (addIfExtractor(xCenter + 1, yCenter, zCenter + 7, aBaseMetaTileEntity))
- && (addIfExtractor(xCenter - 1, yCenter, zCenter - 7, aBaseMetaTileEntity)) && (addIfExtractor(xCenter - 1, yCenter, zCenter + 7, aBaseMetaTileEntity))
- && (addIfExtractor(xCenter + 5, yCenter, zCenter - 1, aBaseMetaTileEntity)) && (addIfExtractor(xCenter + 5, yCenter, zCenter + 1, aBaseMetaTileEntity))
- && (addIfExtractor(xCenter - 5, yCenter, zCenter - 1, aBaseMetaTileEntity)) && (addIfExtractor(xCenter - 5, yCenter, zCenter + 1, aBaseMetaTileEntity))
- && (addIfExtractor(xCenter + 7, yCenter, zCenter - 1, aBaseMetaTileEntity)) && (addIfExtractor(xCenter + 7, yCenter, zCenter + 1, aBaseMetaTileEntity))
- && (addIfExtractor(xCenter - 7, yCenter, zCenter - 1, aBaseMetaTileEntity)) && (addIfExtractor(xCenter - 7, yCenter, zCenter + 1, aBaseMetaTileEntity))
- && (addIfInjector(xCenter + 1, yCenter + 1, zCenter - 6, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 1, yCenter + 1, zCenter + 6, aBaseMetaTileEntity))
- && (addIfInjector(xCenter - 1, yCenter + 1, zCenter - 6, aBaseMetaTileEntity)) && (addIfInjector(xCenter - 1, yCenter + 1, zCenter + 6, aBaseMetaTileEntity))
- && (addIfInjector(xCenter - 6, yCenter + 1, zCenter + 1, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 6, yCenter + 1, zCenter + 1, aBaseMetaTileEntity))
- && (addIfInjector(xCenter - 6, yCenter + 1, zCenter - 1, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 6, yCenter + 1, zCenter - 1, aBaseMetaTileEntity))
- && (addIfInjector(xCenter + 1, yCenter - 1, zCenter - 6, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 1, yCenter - 1, zCenter + 6, aBaseMetaTileEntity))
- && (addIfInjector(xCenter - 1, yCenter - 1, zCenter - 6, aBaseMetaTileEntity)) && (addIfInjector(xCenter - 1, yCenter - 1, zCenter + 6, aBaseMetaTileEntity))
- && (addIfInjector(xCenter - 6, yCenter - 1, zCenter + 1, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 6, yCenter - 1, zCenter + 1, aBaseMetaTileEntity))
- && (addIfInjector(xCenter - 6, yCenter - 1, zCenter - 1, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 6, yCenter - 1, zCenter - 1, aBaseMetaTileEntity))
- && (this.mEnergyHatches.size() >= 1) && (this.mOutputHatches.size() >= 1) && (this.mInputHatches.size() >= 2)) {
- if (this.mEnergyHatches != null) {
- for (int i = 0; i < this.mEnergyHatches.size(); i++) {
- if (this.mEnergyHatches.get(i).mTier < tier())
- return false;
- }
- }
- if (this.mOutputHatches != null) {
- for (int i = 0; i < this.mOutputHatches.size(); i++) {
- if (this.mOutputHatches.get(i).mTier < tier())
- return false;
- }
- }
- if (this.mInputHatches != null) {
- for (int i = 0; i < this.mInputHatches.size(); i++) {
- if (this.mInputHatches.get(i).mTier < tier())
- return false;
- }
- }
- mWrench = true;
- mScrewdriver = true;
- mSoftHammer = true;
- mHardHammer = true;
- mSolderingTool = true;
- mCrowbar = true;
- return true;
- }
- return false;
- }
-
- private boolean checkTier(byte tier, ArrayList<GT_MetaTileEntity_Hatch> list) {
- if (list != null) {
- for (int i = 0; i < list.size(); i++) {
- if (list.get(i).mTier < tier) {
- return false;
- }
- }
- }
- return true;
- }
-
- private boolean checkCoils(int aX, int aY, int aZ) {
- return (isFusionCoil(aX + 6, aY, aZ - 1)) && (isFusionCoil(aX + 6, aY, aZ)) && (isFusionCoil(aX + 6, aY, aZ + 1)) && (isFusionCoil(aX + 5, aY, aZ - 3)) && (isFusionCoil(aX + 5, aY, aZ - 2))
- && (isFusionCoil(aX + 5, aY, aZ + 2)) && (isFusionCoil(aX + 5, aY, aZ + 3)) && (isFusionCoil(aX + 4, aY, aZ - 4)) && (isFusionCoil(aX + 4, aY, aZ + 4))
- && (isFusionCoil(aX + 3, aY, aZ - 5)) && (isFusionCoil(aX + 3, aY, aZ + 5)) && (isFusionCoil(aX + 2, aY, aZ - 5)) && (isFusionCoil(aX + 2, aY, aZ + 5))
- && (isFusionCoil(aX + 1, aY, aZ - 6)) && (isFusionCoil(aX + 1, aY, aZ + 6)) && (isFusionCoil(aX, aY, aZ - 6)) && (isFusionCoil(aX, aY, aZ + 6)) && (isFusionCoil(aX - 1, aY, aZ - 6))
- && (isFusionCoil(aX - 1, aY, aZ + 6)) && (isFusionCoil(aX - 2, aY, aZ - 5)) && (isFusionCoil(aX - 2, aY, aZ + 5)) && (isFusionCoil(aX - 3, aY, aZ - 5))
- && (isFusionCoil(aX - 3, aY, aZ + 5)) && (isFusionCoil(aX - 4, aY, aZ - 4)) && (isFusionCoil(aX - 4, aY, aZ + 4)) && (isFusionCoil(aX - 5, aY, aZ - 3))
- && (isFusionCoil(aX - 5, aY, aZ - 2)) && (isFusionCoil(aX - 5, aY, aZ + 2)) && (isFusionCoil(aX - 5, aY, aZ + 3)) && (isFusionCoil(aX - 6, aY, aZ - 1))
- && (isFusionCoil(aX - 6, aY, aZ)) && (isFusionCoil(aX - 6, aY, aZ + 1));
- }
-
- private boolean checkUpperOrLowerHulls(int aX, int aY, int aZ) {
- return (isAdvancedMachineCasing(aX + 6, aY, aZ)) && (isAdvancedMachineCasing(aX + 5, aY, aZ - 3)) && (isAdvancedMachineCasing(aX + 5, aY, aZ - 2))
- && (isAdvancedMachineCasing(aX + 5, aY, aZ + 2)) && (isAdvancedMachineCasing(aX + 5, aY, aZ + 3)) && (isAdvancedMachineCasing(aX + 4, aY, aZ - 4))
- && (isAdvancedMachineCasing(aX + 4, aY, aZ + 4)) && (isAdvancedMachineCasing(aX + 3, aY, aZ - 5)) && (isAdvancedMachineCasing(aX + 3, aY, aZ + 5))
- && (isAdvancedMachineCasing(aX + 2, aY, aZ - 5)) && (isAdvancedMachineCasing(aX + 2, aY, aZ + 5)) && (isAdvancedMachineCasing(aX, aY, aZ - 6))
- && (isAdvancedMachineCasing(aX, aY, aZ + 6)) && (isAdvancedMachineCasing(aX - 2, aY, aZ - 5)) && (isAdvancedMachineCasing(aX - 2, aY, aZ + 5))
- && (isAdvancedMachineCasing(aX - 3, aY, aZ - 5)) && (isAdvancedMachineCasing(aX - 3, aY, aZ + 5)) && (isAdvancedMachineCasing(aX - 4, aY, aZ - 4))
- && (isAdvancedMachineCasing(aX - 4, aY, aZ + 4)) && (isAdvancedMachineCasing(aX - 5, aY, aZ - 3)) && (isAdvancedMachineCasing(aX - 5, aY, aZ - 2))
- && (isAdvancedMachineCasing(aX - 5, aY, aZ + 2)) && (isAdvancedMachineCasing(aX - 5, aY, aZ + 3)) && (isAdvancedMachineCasing(aX - 6, aY, aZ));
- }
-
- private boolean checkHulls(int aX, int aY, int aZ) {
- return (isAdvancedMachineCasing(aX + 6, aY, aZ - 3)) && (isAdvancedMachineCasing(aX + 6, aY, aZ - 2)) && (isAdvancedMachineCasing(aX + 6, aY, aZ + 2))
- && (isAdvancedMachineCasing(aX + 6, aY, aZ + 3)) && (isAdvancedMachineCasing(aX + 3, aY, aZ - 6)) && (isAdvancedMachineCasing(aX + 3, aY, aZ + 6))
- && (isAdvancedMachineCasing(aX + 2, aY, aZ - 6)) && (isAdvancedMachineCasing(aX + 2, aY, aZ + 6)) && (isAdvancedMachineCasing(aX - 2, aY, aZ - 6))
- && (isAdvancedMachineCasing(aX - 2, aY, aZ + 6)) && (isAdvancedMachineCasing(aX - 3, aY, aZ - 6)) && (isAdvancedMachineCasing(aX - 3, aY, aZ + 6))
- && (isAdvancedMachineCasing(aX - 7, aY, aZ)) && (isAdvancedMachineCasing(aX + 7, aY, aZ)) && (isAdvancedMachineCasing(aX, aY, aZ - 7)) && (isAdvancedMachineCasing(aX, aY, aZ + 7))
- && (isAdvancedMachineCasing(aX - 6, aY, aZ - 3)) && (isAdvancedMachineCasing(aX - 6, aY, aZ - 2)) && (isAdvancedMachineCasing(aX - 6, aY, aZ + 2))
- && (isAdvancedMachineCasing(aX - 6, aY, aZ + 3)) && (isAdvancedMachineCasing(aX - 4, aY, aZ - 2)) && (isAdvancedMachineCasing(aX - 4, aY, aZ + 2))
- && (isAdvancedMachineCasing(aX + 4, aY, aZ - 2)) && (isAdvancedMachineCasing(aX + 4, aY, aZ + 2)) && (isAdvancedMachineCasing(aX - 2, aY, aZ - 4))
- && (isAdvancedMachineCasing(aX - 2, aY, aZ + 4)) && (isAdvancedMachineCasing(aX + 2, aY, aZ - 4)) && (isAdvancedMachineCasing(aX + 2, aY, aZ + 4));
- }
-
- private boolean addIfEnergyInjector(int aX, int aY, int aZ, IGregTechTileEntity aBaseMetaTileEntity) {
- if (addEnergyInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntity(aX, aY, aZ), 53)) {
- return true;
- }
- return isAdvancedMachineCasing(aX, aY, aZ);
- }
-
- private boolean addIfInjector(int aX, int aY, int aZ, IGregTechTileEntity aTileEntity) {
- if (addInputToMachineList(aTileEntity.getIGregTechTileEntity(aX, aY, aZ), 53)) {
- return true;
- }
- return isAdvancedMachineCasing(aX, aY, aZ);
- }
-
- private boolean addIfExtractor(int aX, int aY, int aZ, IGregTechTileEntity aTileEntity) {
- if (addOutputToMachineList(aTileEntity.getIGregTechTileEntity(aX, aY, aZ), 53)) {
- return true;
- }
- return isAdvancedMachineCasing(aX, aY, aZ);
- }
-
- private boolean isAdvancedMachineCasing(int aX, int aY, int aZ) {
- return (getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getCasing()) && (getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getCasingMeta());
- }
-
- public abstract Block getCasing();
-
- public abstract int getCasingMeta();
-
- private boolean isFusionCoil(int aX, int aY, int aZ) {
- return (getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getFusionCoil() && (getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getFusionCoilMeta()));
- }
-
- public abstract Block getFusionCoil();
-
- public abstract int getFusionCoilMeta();
-
- public abstract String[] getDescription();
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- ITexture[] sTexture;
- if (aSide == aFacing) {
- sTexture = new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, Dyes.getModulation(-1, Dyes._NULL.mRGBa)), new GT_RenderedTexture(getIconOverlay()) };
- } else {
- if (!aActive) {
- sTexture = new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, Dyes.getModulation(-1, Dyes._NULL.mRGBa)) };
- } else {
- sTexture = new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW, Dyes.getModulation(-1, Dyes._NULL.mRGBa)) };
- }
- }
- return sTexture;
- }
-
- public abstract IIconContainer getIconOverlay();
-
- @Override
- public boolean isCorrectMachinePart(ItemStack aStack) {
- return true;
- }
-
- public int overclock(int mStartEnergy) {
- if (tierOverclock() == 1) {
- return 1;
- }
- if (tierOverclock() == 2) {
- return mStartEnergy < 160000000 ? 2 : 1;
- }
- return mStartEnergy < 160000000 ? 4 : mStartEnergy > 320000000 ? 2 : 1;
- }
-
- @Override
- public boolean checkRecipe(ItemStack aStack) {
- ArrayList<FluidStack> tFluidList = getStoredFluids();
- for (int i = 0; i < tFluidList.size() - 1; i++) {
- for (int j = i + 1; j < tFluidList.size(); j++) {
- if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) {
- if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) {
- tFluidList.remove(j--);
- } else {
- tFluidList.remove(i--);
- break;
- }
- }
- }
- }
- if (tFluidList.size() > 1) {
- FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]);
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sFusionRecipes.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, GT_Values.V[8], tFluids, new ItemStack[] {});
- if (tRecipe == null&&!mRunningOnLoad) {
- turnCasingActive(false);
- this.mLastRecipe = null;
- return false;
- }
- if (mRunningOnLoad||tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[] {})) {
- this.mLastRecipe = tRecipe;
- this.mEUt = (this.mLastRecipe.mEUt * overclock(this.mLastRecipe.mSpecialValue));
- this.mMaxProgresstime = this.mLastRecipe.mDuration / overclock(this.mLastRecipe.mSpecialValue);
- this.mEfficiencyIncrease = 10000;
- this.mOutputFluids = this.mLastRecipe.mFluidOutputs;
- turnCasingActive(true);
- mRunningOnLoad=false;
- return true;
- }
- }
- return false;
- }
-
- public abstract int tierOverclock();
-
- public boolean turnCasingActive(boolean status) {
- if (this.mEnergyHatches != null) {
- for (GT_MetaTileEntity_Hatch_Energy hatch : this.mEnergyHatches) {
- hatch.mMachineBlock = status ? (byte) 52 : (byte) 53;
- }
- }
- if (this.mOutputHatches != null) {
- for (GT_MetaTileEntity_Hatch_Output hatch : this.mOutputHatches) {
- hatch.mMachineBlock = status ? (byte) 52 : (byte) 53;
- }
- }
- if (this.mInputHatches != null) {
- for (GT_MetaTileEntity_Hatch_Input hatch : this.mInputHatches) {
- hatch.mMachineBlock = status ? (byte) 52 : (byte) 53;
- }
- }
- return true;
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (aBaseMetaTileEntity.isServerSide()) {
- if (mEfficiency < 0)
- mEfficiency = 0;
- if(mRunningOnLoad&&checkMachine(aBaseMetaTileEntity, mInventory[1])){
- this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU();
- checkRecipe(mInventory[1]);}
- if (--mUpdate == 0 || --mStartUpCheck == 0) {
- mInputHatches.clear();
- mInputBusses.clear();
- mOutputHatches.clear();
- mOutputBusses.clear();
- mDynamoHatches.clear();
- mEnergyHatches.clear();
- mMufflerHatches.clear();
- mMaintenanceHatches.clear();
- mMachine = checkMachine(aBaseMetaTileEntity, mInventory[1]);
- }
- if (mStartUpCheck < 0) {
- if (mMachine) {
- if (this.mEnergyHatches != null) {
- for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches)
- if (isValidMetaTileEntity(tHatch)) {
- if (aBaseMetaTileEntity.getStoredEU() + (2048 * tierOverclock()) < maxEUStore()
- && tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(2048 * tierOverclock(), false)) {
- aBaseMetaTileEntity.increaseStoredEnergyUnits(2048 * tierOverclock(), true);
- }
- }
- }
- if (this.mEUStore <= 0 && mMaxProgresstime > 0) {
- stopMachine();
- }
- if (getRepairStatus() > 0) {
- if (mMaxProgresstime > 0 && doRandomMaintenanceDamage()) {
- this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(mEUt, true);
- if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime) {
- if (mOutputItems != null)for (ItemStack tStack : mOutputItems )if (tStack != null)addOutput(tStack);
- if (mOutputFluids != null)for (FluidStack tStack : mOutputFluids)if (tStack != null)addOutput(tStack);
- mEfficiency = Math.max(0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000)));
- mOutputItems = null;
- mProgresstime = 0;
- mMaxProgresstime = 0;
- mEfficiencyIncrease = 0;
- if (mOutputFluids != null && mOutputFluids.length > 0) {
- try{GT_Mod.instance.achievements.issueAchivementHatchFluid(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), mOutputFluids[0]);}catch(Exception e){}
- }
- this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU();
- if (aBaseMetaTileEntity.isAllowedToWork())
- checkRecipe(mInventory[1]);
- }
- } else {
- if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified()) {
- turnCasingActive(mMaxProgresstime > 0);
- if (aBaseMetaTileEntity.isAllowedToWork()) {
- this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU();
- if (checkRecipe(mInventory[1]) && aBaseMetaTileEntity.getStoredEU() >= this.mLastRecipe.mSpecialValue) {
- aBaseMetaTileEntity.decreaseStoredEnergyUnits(this.mLastRecipe.mSpecialValue, true);
- }
- }
- if (mMaxProgresstime <= 0)
- mEfficiency = Math.max(0, mEfficiency - 1000);
- }
- }
- } else {
- this.mLastRecipe = null;
- stopMachine();
- }
- } else {
- turnCasingActive(false);
- this.mLastRecipe = null;
- stopMachine();
- }
- }
- aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mWrench ? 0 : 1) | (mScrewdriver ? 0 : 2) | (mSoftHammer ? 0 : 4) | (mHardHammer ? 0 : 8)
- | (mSolderingTool ? 0 : 16) | (mCrowbar ? 0 : 32) | (mMachine ? 0 : 64));
- aBaseMetaTileEntity.setActive(mMaxProgresstime > 0);
- }
- }
-
- @Override
- public boolean onRunningTick(ItemStack aStack) {
- if (mEUt < 0) {
- if (!drainEnergyInput(((long) -mEUt * 10000) / Math.max(1000, mEfficiency))) {
- this.mLastRecipe = null;
- stopMachine();
- return false;
- }
- }
- if (this.mEUStore <= 0) {
- this.mLastRecipe = null;
- stopMachine();
- return false;
- }
- return true;
- }
-
- public boolean drainEnergyInput(long aEU) {
- return false;
- }
-
- @Override
- public int getMaxEfficiency(ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerTick(ItemStack aStack) {
- return 0;
- }
-
- @Override
- public int getDamageToComponent(ItemStack aStack) {
- return 0;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 0;
- }
-
- @Override
- public boolean explodesOnComponentBreak(ItemStack aStack) {
- return false;
- }
+ public GT_Recipe mLastRecipe;
+ public int mEUStore;
+
+ public GT_MetaTileEntity_FusionComputer(int aID, String aName, String aNameRegional, int tier) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_FusionComputer(String aName) {
+ super(aName);
+ }
+
+ public abstract int tier();
+
+ public abstract long maxEUStore();
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_MultiMachine(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_FusionReactor(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "FusionComputer.png", GT_Recipe.GT_Recipe_Map.sFusionRecipes.mNEIName);
+ }
+
+ public abstract MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity);
+
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) {
+
+ return aSide != getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xCenter = getBaseMetaTileEntity().getXCoord() + ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()).offsetX * 5;
+ int yCenter = getBaseMetaTileEntity().getYCoord();
+ int zCenter = getBaseMetaTileEntity().getZCoord() + ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()).offsetZ * 5;
+ if (((isAdvancedMachineCasing(xCenter + 5, yCenter, zCenter)) || (xCenter + 5 == getBaseMetaTileEntity().getXCoord()))
+ && ((isAdvancedMachineCasing(xCenter - 5, yCenter, zCenter)) || (xCenter - 5 == getBaseMetaTileEntity().getXCoord()))
+ && ((isAdvancedMachineCasing(xCenter, yCenter, zCenter + 5)) || (zCenter + 5 == getBaseMetaTileEntity().getZCoord()))
+ && ((isAdvancedMachineCasing(xCenter, yCenter, zCenter - 5)) || (zCenter - 5 == getBaseMetaTileEntity().getZCoord())) && (checkCoils(xCenter, yCenter, zCenter))
+ && (checkHulls(xCenter, yCenter, zCenter)) && (checkUpperOrLowerHulls(xCenter, yCenter + 1, zCenter)) && (checkUpperOrLowerHulls(xCenter, yCenter - 1, zCenter))
+ && (addIfEnergyInjector(xCenter + 4, yCenter, zCenter + 3, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter + 4, yCenter, zCenter - 3, aBaseMetaTileEntity))
+ && (addIfEnergyInjector(xCenter + 4, yCenter, zCenter + 5, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter + 4, yCenter, zCenter - 5, aBaseMetaTileEntity))
+ && (addIfEnergyInjector(xCenter - 4, yCenter, zCenter + 3, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter - 4, yCenter, zCenter - 3, aBaseMetaTileEntity))
+ && (addIfEnergyInjector(xCenter - 4, yCenter, zCenter + 5, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter - 4, yCenter, zCenter - 5, aBaseMetaTileEntity))
+ && (addIfEnergyInjector(xCenter + 3, yCenter, zCenter + 4, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter - 3, yCenter, zCenter + 4, aBaseMetaTileEntity))
+ && (addIfEnergyInjector(xCenter + 5, yCenter, zCenter + 4, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter - 5, yCenter, zCenter + 4, aBaseMetaTileEntity))
+ && (addIfEnergyInjector(xCenter + 3, yCenter, zCenter - 4, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter - 3, yCenter, zCenter - 4, aBaseMetaTileEntity))
+ && (addIfEnergyInjector(xCenter + 5, yCenter, zCenter - 4, aBaseMetaTileEntity)) && (addIfEnergyInjector(xCenter - 5, yCenter, zCenter - 4, aBaseMetaTileEntity))
+ && (addIfExtractor(xCenter + 1, yCenter, zCenter - 5, aBaseMetaTileEntity)) && (addIfExtractor(xCenter + 1, yCenter, zCenter + 5, aBaseMetaTileEntity))
+ && (addIfExtractor(xCenter - 1, yCenter, zCenter - 5, aBaseMetaTileEntity)) && (addIfExtractor(xCenter - 1, yCenter, zCenter + 5, aBaseMetaTileEntity))
+ && (addIfExtractor(xCenter + 1, yCenter, zCenter - 7, aBaseMetaTileEntity)) && (addIfExtractor(xCenter + 1, yCenter, zCenter + 7, aBaseMetaTileEntity))
+ && (addIfExtractor(xCenter - 1, yCenter, zCenter - 7, aBaseMetaTileEntity)) && (addIfExtractor(xCenter - 1, yCenter, zCenter + 7, aBaseMetaTileEntity))
+ && (addIfExtractor(xCenter + 5, yCenter, zCenter - 1, aBaseMetaTileEntity)) && (addIfExtractor(xCenter + 5, yCenter, zCenter + 1, aBaseMetaTileEntity))
+ && (addIfExtractor(xCenter - 5, yCenter, zCenter - 1, aBaseMetaTileEntity)) && (addIfExtractor(xCenter - 5, yCenter, zCenter + 1, aBaseMetaTileEntity))
+ && (addIfExtractor(xCenter + 7, yCenter, zCenter - 1, aBaseMetaTileEntity)) && (addIfExtractor(xCenter + 7, yCenter, zCenter + 1, aBaseMetaTileEntity))
+ && (addIfExtractor(xCenter - 7, yCenter, zCenter - 1, aBaseMetaTileEntity)) && (addIfExtractor(xCenter - 7, yCenter, zCenter + 1, aBaseMetaTileEntity))
+ && (addIfInjector(xCenter + 1, yCenter + 1, zCenter - 6, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 1, yCenter + 1, zCenter + 6, aBaseMetaTileEntity))
+ && (addIfInjector(xCenter - 1, yCenter + 1, zCenter - 6, aBaseMetaTileEntity)) && (addIfInjector(xCenter - 1, yCenter + 1, zCenter + 6, aBaseMetaTileEntity))
+ && (addIfInjector(xCenter - 6, yCenter + 1, zCenter + 1, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 6, yCenter + 1, zCenter + 1, aBaseMetaTileEntity))
+ && (addIfInjector(xCenter - 6, yCenter + 1, zCenter - 1, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 6, yCenter + 1, zCenter - 1, aBaseMetaTileEntity))
+ && (addIfInjector(xCenter + 1, yCenter - 1, zCenter - 6, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 1, yCenter - 1, zCenter + 6, aBaseMetaTileEntity))
+ && (addIfInjector(xCenter - 1, yCenter - 1, zCenter - 6, aBaseMetaTileEntity)) && (addIfInjector(xCenter - 1, yCenter - 1, zCenter + 6, aBaseMetaTileEntity))
+ && (addIfInjector(xCenter - 6, yCenter - 1, zCenter + 1, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 6, yCenter - 1, zCenter + 1, aBaseMetaTileEntity))
+ && (addIfInjector(xCenter - 6, yCenter - 1, zCenter - 1, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 6, yCenter - 1, zCenter - 1, aBaseMetaTileEntity))
+ && (this.mEnergyHatches.size() >= 1) && (this.mOutputHatches.size() >= 1) && (this.mInputHatches.size() >= 2)) {
+ if (this.mEnergyHatches != null) {
+ for (int i = 0; i < this.mEnergyHatches.size(); i++) {
+ if (this.mEnergyHatches.get(i).mTier < tier())
+ return false;
+ }
+ }
+ if (this.mOutputHatches != null) {
+ for (int i = 0; i < this.mOutputHatches.size(); i++) {
+ if (this.mOutputHatches.get(i).mTier < tier())
+ return false;
+ }
+ }
+ if (this.mInputHatches != null) {
+ for (int i = 0; i < this.mInputHatches.size(); i++) {
+ if (this.mInputHatches.get(i).mTier < tier())
+ return false;
+ }
+ }
+ mWrench = true;
+ mScrewdriver = true;
+ mSoftHammer = true;
+ mHardHammer = true;
+ mSolderingTool = true;
+ mCrowbar = true;
+ return true;
+ }
+ return false;
+ }
+
+ private boolean checkTier(byte tier, ArrayList<GT_MetaTileEntity_Hatch> list) {
+ if (list != null) {
+ for (int i = 0; i < list.size(); i++) {
+ if (list.get(i).mTier < tier) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ private boolean checkCoils(int aX, int aY, int aZ) {
+ return (isFusionCoil(aX + 6, aY, aZ - 1)) && (isFusionCoil(aX + 6, aY, aZ)) && (isFusionCoil(aX + 6, aY, aZ + 1)) && (isFusionCoil(aX + 5, aY, aZ - 3)) && (isFusionCoil(aX + 5, aY, aZ - 2))
+ && (isFusionCoil(aX + 5, aY, aZ + 2)) && (isFusionCoil(aX + 5, aY, aZ + 3)) && (isFusionCoil(aX + 4, aY, aZ - 4)) && (isFusionCoil(aX + 4, aY, aZ + 4))
+ && (isFusionCoil(aX + 3, aY, aZ - 5)) && (isFusionCoil(aX + 3, aY, aZ + 5)) && (isFusionCoil(aX + 2, aY, aZ - 5)) && (isFusionCoil(aX + 2, aY, aZ + 5))
+ && (isFusionCoil(aX + 1, aY, aZ - 6)) && (isFusionCoil(aX + 1, aY, aZ + 6)) && (isFusionCoil(aX, aY, aZ - 6)) && (isFusionCoil(aX, aY, aZ + 6)) && (isFusionCoil(aX - 1, aY, aZ - 6))
+ && (isFusionCoil(aX - 1, aY, aZ + 6)) && (isFusionCoil(aX - 2, aY, aZ - 5)) && (isFusionCoil(aX - 2, aY, aZ + 5)) && (isFusionCoil(aX - 3, aY, aZ - 5))
+ && (isFusionCoil(aX - 3, aY, aZ + 5)) && (isFusionCoil(aX - 4, aY, aZ - 4)) && (isFusionCoil(aX - 4, aY, aZ + 4)) && (isFusionCoil(aX - 5, aY, aZ - 3))
+ && (isFusionCoil(aX - 5, aY, aZ - 2)) && (isFusionCoil(aX - 5, aY, aZ + 2)) && (isFusionCoil(aX - 5, aY, aZ + 3)) && (isFusionCoil(aX - 6, aY, aZ - 1))
+ && (isFusionCoil(aX - 6, aY, aZ)) && (isFusionCoil(aX - 6, aY, aZ + 1));
+ }
+
+ private boolean checkUpperOrLowerHulls(int aX, int aY, int aZ) {
+ return (isAdvancedMachineCasing(aX + 6, aY, aZ)) && (isAdvancedMachineCasing(aX + 5, aY, aZ - 3)) && (isAdvancedMachineCasing(aX + 5, aY, aZ - 2))
+ && (isAdvancedMachineCasing(aX + 5, aY, aZ + 2)) && (isAdvancedMachineCasing(aX + 5, aY, aZ + 3)) && (isAdvancedMachineCasing(aX + 4, aY, aZ - 4))
+ && (isAdvancedMachineCasing(aX + 4, aY, aZ + 4)) && (isAdvancedMachineCasing(aX + 3, aY, aZ - 5)) && (isAdvancedMachineCasing(aX + 3, aY, aZ + 5))
+ && (isAdvancedMachineCasing(aX + 2, aY, aZ - 5)) && (isAdvancedMachineCasing(aX + 2, aY, aZ + 5)) && (isAdvancedMachineCasing(aX, aY, aZ - 6))
+ && (isAdvancedMachineCasing(aX, aY, aZ + 6)) && (isAdvancedMachineCasing(aX - 2, aY, aZ - 5)) && (isAdvancedMachineCasing(aX - 2, aY, aZ + 5))
+ && (isAdvancedMachineCasing(aX - 3, aY, aZ - 5)) && (isAdvancedMachineCasing(aX - 3, aY, aZ + 5)) && (isAdvancedMachineCasing(aX - 4, aY, aZ - 4))
+ && (isAdvancedMachineCasing(aX - 4, aY, aZ + 4)) && (isAdvancedMachineCasing(aX - 5, aY, aZ - 3)) && (isAdvancedMachineCasing(aX - 5, aY, aZ - 2))
+ && (isAdvancedMachineCasing(aX - 5, aY, aZ + 2)) && (isAdvancedMachineCasing(aX - 5, aY, aZ + 3)) && (isAdvancedMachineCasing(aX - 6, aY, aZ));
+ }
+
+ private boolean checkHulls(int aX, int aY, int aZ) {
+ return (isAdvancedMachineCasing(aX + 6, aY, aZ - 3)) && (isAdvancedMachineCasing(aX + 6, aY, aZ - 2)) && (isAdvancedMachineCasing(aX + 6, aY, aZ + 2))
+ && (isAdvancedMachineCasing(aX + 6, aY, aZ + 3)) && (isAdvancedMachineCasing(aX + 3, aY, aZ - 6)) && (isAdvancedMachineCasing(aX + 3, aY, aZ + 6))
+ && (isAdvancedMachineCasing(aX + 2, aY, aZ - 6)) && (isAdvancedMachineCasing(aX + 2, aY, aZ + 6)) && (isAdvancedMachineCasing(aX - 2, aY, aZ - 6))
+ && (isAdvancedMachineCasing(aX - 2, aY, aZ + 6)) && (isAdvancedMachineCasing(aX - 3, aY, aZ - 6)) && (isAdvancedMachineCasing(aX - 3, aY, aZ + 6))
+ && (isAdvancedMachineCasing(aX - 7, aY, aZ)) && (isAdvancedMachineCasing(aX + 7, aY, aZ)) && (isAdvancedMachineCasing(aX, aY, aZ - 7)) && (isAdvancedMachineCasing(aX, aY, aZ + 7))
+ && (isAdvancedMachineCasing(aX - 6, aY, aZ - 3)) && (isAdvancedMachineCasing(aX - 6, aY, aZ - 2)) && (isAdvancedMachineCasing(aX - 6, aY, aZ + 2))
+ && (isAdvancedMachineCasing(aX - 6, aY, aZ + 3)) && (isAdvancedMachineCasing(aX - 4, aY, aZ - 2)) && (isAdvancedMachineCasing(aX - 4, aY, aZ + 2))
+ && (isAdvancedMachineCasing(aX + 4, aY, aZ - 2)) && (isAdvancedMachineCasing(aX + 4, aY, aZ + 2)) && (isAdvancedMachineCasing(aX - 2, aY, aZ - 4))
+ && (isAdvancedMachineCasing(aX - 2, aY, aZ + 4)) && (isAdvancedMachineCasing(aX + 2, aY, aZ - 4)) && (isAdvancedMachineCasing(aX + 2, aY, aZ + 4));
+ }
+
+ private boolean addIfEnergyInjector(int aX, int aY, int aZ, IGregTechTileEntity aBaseMetaTileEntity) {
+ if (addEnergyInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntity(aX, aY, aZ), 53)) {
+ return true;
+ }
+ return isAdvancedMachineCasing(aX, aY, aZ);
+ }
+
+ private boolean addIfInjector(int aX, int aY, int aZ, IGregTechTileEntity aTileEntity) {
+ if (addInputToMachineList(aTileEntity.getIGregTechTileEntity(aX, aY, aZ), 53)) {
+ return true;
+ }
+ return isAdvancedMachineCasing(aX, aY, aZ);
+ }
+
+ private boolean addIfExtractor(int aX, int aY, int aZ, IGregTechTileEntity aTileEntity) {
+ if (addOutputToMachineList(aTileEntity.getIGregTechTileEntity(aX, aY, aZ), 53)) {
+ return true;
+ }
+ return isAdvancedMachineCasing(aX, aY, aZ);
+ }
+
+ private boolean isAdvancedMachineCasing(int aX, int aY, int aZ) {
+ return (getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getCasing()) && (getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getCasingMeta());
+ }
+
+ public abstract Block getCasing();
+
+ public abstract int getCasingMeta();
+
+ private boolean isFusionCoil(int aX, int aY, int aZ) {
+ return (getBaseMetaTileEntity().getBlock(aX, aY, aZ) == getFusionCoil() && (getBaseMetaTileEntity().getMetaID(aX, aY, aZ) == getFusionCoilMeta()));
+ }
+
+ public abstract Block getFusionCoil();
+
+ public abstract int getFusionCoilMeta();
+
+ public abstract String[] getDescription();
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ ITexture[] sTexture;
+ if (aSide == aFacing) {
+ sTexture = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, Dyes.getModulation(-1, Dyes._NULL.mRGBa)), new GT_RenderedTexture(getIconOverlay())};
+ } else {
+ if (!aActive) {
+ sTexture = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, Dyes.getModulation(-1, Dyes._NULL.mRGBa))};
+ } else {
+ sTexture = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW, Dyes.getModulation(-1, Dyes._NULL.mRGBa))};
+ }
+ }
+ return sTexture;
+ }
+
+ public abstract IIconContainer getIconOverlay();
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ public int overclock(int mStartEnergy) {
+ if (tierOverclock() == 1) {
+ return 1;
+ }
+ if (tierOverclock() == 2) {
+ return mStartEnergy < 160000000 ? 2 : 1;
+ }
+ return mStartEnergy < 160000000 ? 4 : mStartEnergy > 320000000 ? 2 : 1;
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ ArrayList<FluidStack> tFluidList = getStoredFluids();
+ for (int i = 0; i < tFluidList.size() - 1; i++) {
+ for (int j = i + 1; j < tFluidList.size(); j++) {
+ if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) {
+ if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) {
+ tFluidList.remove(j--);
+ } else {
+ tFluidList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+ if (tFluidList.size() > 1) {
+ FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]);
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sFusionRecipes.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, GT_Values.V[8], tFluids, new ItemStack[]{});
+ if (tRecipe == null && !mRunningOnLoad) {
+ turnCasingActive(false);
+ this.mLastRecipe = null;
+ return false;
+ }
+ if (mRunningOnLoad || tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[]{})) {
+ this.mLastRecipe = tRecipe;
+ this.mEUt = (this.mLastRecipe.mEUt * overclock(this.mLastRecipe.mSpecialValue));
+ this.mMaxProgresstime = this.mLastRecipe.mDuration / overclock(this.mLastRecipe.mSpecialValue);
+ this.mEfficiencyIncrease = 10000;
+ this.mOutputFluids = this.mLastRecipe.mFluidOutputs;
+ turnCasingActive(true);
+ mRunningOnLoad = false;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public abstract int tierOverclock();
+
+ public boolean turnCasingActive(boolean status) {
+ if (this.mEnergyHatches != null) {
+ for (GT_MetaTileEntity_Hatch_Energy hatch : this.mEnergyHatches) {
+ hatch.mMachineBlock = status ? (byte) 52 : (byte) 53;
+ }
+ }
+ if (this.mOutputHatches != null) {
+ for (GT_MetaTileEntity_Hatch_Output hatch : this.mOutputHatches) {
+ hatch.mMachineBlock = status ? (byte) 52 : (byte) 53;
+ }
+ }
+ if (this.mInputHatches != null) {
+ for (GT_MetaTileEntity_Hatch_Input hatch : this.mInputHatches) {
+ hatch.mMachineBlock = status ? (byte) 52 : (byte) 53;
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+ if (mEfficiency < 0)
+ mEfficiency = 0;
+ if (mRunningOnLoad && checkMachine(aBaseMetaTileEntity, mInventory[1])) {
+ this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU();
+ checkRecipe(mInventory[1]);
+ }
+ if (--mUpdate == 0 || --mStartUpCheck == 0) {
+ mInputHatches.clear();
+ mInputBusses.clear();
+ mOutputHatches.clear();
+ mOutputBusses.clear();
+ mDynamoHatches.clear();
+ mEnergyHatches.clear();
+ mMufflerHatches.clear();
+ mMaintenanceHatches.clear();
+ mMachine = checkMachine(aBaseMetaTileEntity, mInventory[1]);
+ }
+ if (mStartUpCheck < 0) {
+ if (mMachine) {
+ if (this.mEnergyHatches != null) {
+ for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches)
+ if (isValidMetaTileEntity(tHatch)) {
+ if (aBaseMetaTileEntity.getStoredEU() + (2048 * tierOverclock()) < maxEUStore()
+ && tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(2048 * tierOverclock(), false)) {
+ aBaseMetaTileEntity.increaseStoredEnergyUnits(2048 * tierOverclock(), true);
+ }
+ }
+ }
+ if (this.mEUStore <= 0 && mMaxProgresstime > 0) {
+ stopMachine();
+ }
+ if (getRepairStatus() > 0) {
+ if (mMaxProgresstime > 0 && doRandomMaintenanceDamage()) {
+ this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(mEUt, true);
+ if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime) {
+ if (mOutputItems != null)
+ for (ItemStack tStack : mOutputItems) if (tStack != null) addOutput(tStack);
+ if (mOutputFluids != null)
+ for (FluidStack tStack : mOutputFluids) if (tStack != null) addOutput(tStack);
+ mEfficiency = Math.max(0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000)));
+ mOutputItems = null;
+ mProgresstime = 0;
+ mMaxProgresstime = 0;
+ mEfficiencyIncrease = 0;
+ if (mOutputFluids != null && mOutputFluids.length > 0) {
+ try {
+ GT_Mod.instance.achievements.issueAchivementHatchFluid(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), mOutputFluids[0]);
+ } catch (Exception e) {
+ }
+ }
+ this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU();
+ if (aBaseMetaTileEntity.isAllowedToWork())
+ checkRecipe(mInventory[1]);
+ }
+ } else {
+ if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified()) {
+ turnCasingActive(mMaxProgresstime > 0);
+ if (aBaseMetaTileEntity.isAllowedToWork()) {
+ this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU();
+ if (checkRecipe(mInventory[1]) && aBaseMetaTileEntity.getStoredEU() >= this.mLastRecipe.mSpecialValue) {
+ aBaseMetaTileEntity.decreaseStoredEnergyUnits(this.mLastRecipe.mSpecialValue, true);
+ }
+ }
+ if (mMaxProgresstime <= 0)
+ mEfficiency = Math.max(0, mEfficiency - 1000);
+ }
+ }
+ } else {
+ this.mLastRecipe = null;
+ stopMachine();
+ }
+ } else {
+ turnCasingActive(false);
+ this.mLastRecipe = null;
+ stopMachine();
+ }
+ }
+ aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mWrench ? 0 : 1) | (mScrewdriver ? 0 : 2) | (mSoftHammer ? 0 : 4) | (mHardHammer ? 0 : 8)
+ | (mSolderingTool ? 0 : 16) | (mCrowbar ? 0 : 32) | (mMachine ? 0 : 64));
+ aBaseMetaTileEntity.setActive(mMaxProgresstime > 0);
+ }
+ }
+
+ @Override
+ public boolean onRunningTick(ItemStack aStack) {
+ if (mEUt < 0) {
+ if (!drainEnergyInput(((long) -mEUt * 10000) / Math.max(1000, mEfficiency))) {
+ this.mLastRecipe = null;
+ stopMachine();
+ return false;
+ }
+ }
+ if (this.mEUStore <= 0) {
+ this.mLastRecipe = null;
+ stopMachine();
+ return false;
+ }
+ return true;
+ }
+
+ public boolean drainEnergyInput(long aEU) {
+ return false;
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 0;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
} \ No newline at end of file
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java
index 924695b54f..39d38e9bd3 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java
@@ -7,47 +7,63 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import net.minecraft.block.Block;
-public class GT_MetaTileEntity_FusionComputer1 extends GT_MetaTileEntity_FusionComputer{
-
- public GT_MetaTileEntity_FusionComputer1(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional, 6);
- }
-
- public GT_MetaTileEntity_FusionComputer1(String aName) {super(aName);}
-
- @Override
- public int tier() {return 6;}
-
- @Override
- public long maxEUStore() {return 160000000L*(Math.min(16, this.mEnergyHatches.size()))/16L;}
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_FusionComputer1(mName);
- }
- @Override
- public int getCasingMeta() {return 6;}
-
- @Override
- public Block getFusionCoil() {return GregTech_API.sBlockCasings1;}
-
- @Override
- public int getFusionCoilMeta() {return 15;}
-
- public String[] getDescription()
- {return new String[] { "It's over 9000!!!","LuV Casings around Superconducting Coils","2-16 Input Hatches","1-16 Output Hatches","1-16 Energy Hatches","All Hatches must be LuV or better","2048EU/t and 10mio EU Cap per Energy Hatch" };}
-
- @Override
- public int tierOverclock() {return 1;}
-
- @Override
- public Block getCasing() {
- return GregTech_API.sBlockCasings1;
- }
-
- @Override
- public IIconContainer getIconOverlay() {
- return Textures.BlockIcons.OVERLAY_FUSION1;
- }
+public class GT_MetaTileEntity_FusionComputer1 extends GT_MetaTileEntity_FusionComputer {
+
+ public GT_MetaTileEntity_FusionComputer1(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, 6);
+ }
+
+ public GT_MetaTileEntity_FusionComputer1(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public int tier() {
+ return 6;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return 160000000L * (Math.min(16, this.mEnergyHatches.size())) / 16L;
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_FusionComputer1(mName);
+ }
+
+ @Override
+ public int getCasingMeta() {
+ return 6;
+ }
+
+ @Override
+ public Block getFusionCoil() {
+ return GregTech_API.sBlockCasings1;
+ }
+
+ @Override
+ public int getFusionCoilMeta() {
+ return 15;
+ }
+
+ public String[] getDescription() {
+ return new String[]{"It's over 9000!!!", "LuV Casings around Superconducting Coils", "2-16 Input Hatches", "1-16 Output Hatches", "1-16 Energy Hatches", "All Hatches must be LuV or better", "2048EU/t and 10mio EU Cap per Energy Hatch"};
+ }
+
+ @Override
+ public int tierOverclock() {
+ return 1;
+ }
+
+ @Override
+ public Block getCasing() {
+ return GregTech_API.sBlockCasings1;
+ }
+
+ @Override
+ public IIconContainer getIconOverlay() {
+ return Textures.BlockIcons.OVERLAY_FUSION1;
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java
index cd0790ba91..1fd1ca7576 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java
@@ -7,45 +7,62 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import net.minecraft.block.Block;
-public class GT_MetaTileEntity_FusionComputer2 extends GT_MetaTileEntity_FusionComputer{
-
- public GT_MetaTileEntity_FusionComputer2(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional, 6);
- }
-
- public GT_MetaTileEntity_FusionComputer2(String aName) {super(aName);}
-
- @Override
- public int tier() {return 7;}
-
- @Override
- public long maxEUStore() {return 320000000L*(Math.min(16, this.mEnergyHatches.size()))/16L;}
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_FusionComputer2(mName);
- }
- @Override
- public int getCasingMeta() {return 6;}
-
- @Override
- public Block getFusionCoil() {return GregTech_API.sBlockCasings4;}
-
- @Override
- public int getFusionCoilMeta() {return 7;}
-
- public String[] getDescription()
- {return new String[] { "It's over 9000!!!","Fusion Casings around Fusion Coils","2-16 Input Hatches","1-16 Output Hatches","1-16 Energy Hatches","All Hatches must be ZPMV or better","4096EU/t and 20mio EU Cap per Energy Hatch" };}
-
- @Override
- public int tierOverclock() {return 2;}
-
- @Override
- public Block getCasing() {
- return GregTech_API.sBlockCasings4;
- }
- @Override
- public IIconContainer getIconOverlay() {
- return Textures.BlockIcons.OVERLAY_FUSION2;
- }
+public class GT_MetaTileEntity_FusionComputer2 extends GT_MetaTileEntity_FusionComputer {
+
+ public GT_MetaTileEntity_FusionComputer2(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, 6);
+ }
+
+ public GT_MetaTileEntity_FusionComputer2(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public int tier() {
+ return 7;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return 320000000L * (Math.min(16, this.mEnergyHatches.size())) / 16L;
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_FusionComputer2(mName);
+ }
+
+ @Override
+ public int getCasingMeta() {
+ return 6;
+ }
+
+ @Override
+ public Block getFusionCoil() {
+ return GregTech_API.sBlockCasings4;
+ }
+
+ @Override
+ public int getFusionCoilMeta() {
+ return 7;
+ }
+
+ public String[] getDescription() {
+ return new String[]{"It's over 9000!!!", "Fusion Casings around Fusion Coils", "2-16 Input Hatches", "1-16 Output Hatches", "1-16 Energy Hatches", "All Hatches must be ZPMV or better", "4096EU/t and 20mio EU Cap per Energy Hatch"};
+ }
+
+ @Override
+ public int tierOverclock() {
+ return 2;
+ }
+
+ @Override
+ public Block getCasing() {
+ return GregTech_API.sBlockCasings4;
+ }
+
+ @Override
+ public IIconContainer getIconOverlay() {
+ return Textures.BlockIcons.OVERLAY_FUSION2;
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java
index 6aabc38cb8..9d1a9a9579 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java
@@ -7,46 +7,63 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import net.minecraft.block.Block;
-public class GT_MetaTileEntity_FusionComputer3 extends GT_MetaTileEntity_FusionComputer{
-
- public GT_MetaTileEntity_FusionComputer3(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional, 6);
- }
-
- public GT_MetaTileEntity_FusionComputer3(String aName) {super(aName);}
-
- @Override
- public int tier() {return 8;}
-
- @Override
- public long maxEUStore() {return 640000000L*(Math.min(16, this.mEnergyHatches.size()))/16L;}
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_FusionComputer3(mName);
- }
- @Override
- public int getCasingMeta() {return 8;}
-
- @Override
- public Block getFusionCoil() {return GregTech_API.sBlockCasings4;}
-
- @Override
- public int getFusionCoilMeta() {return 7;}
-
- public String[] getDescription()
- {return new String[] { "A SUN DOWN ON EARTH","Fusion Casings MK II around Fusion Coils","2-16 Input Hatches","1-16 Output Hatches","1-16 Energy Hatches","All Hatches must be UV or better","8192EU/t and 40mio EU Cap per Energy Hatch" };}
-
- @Override
- public int tierOverclock() {return 4;}
-
- @Override
- public Block getCasing() {
- return GregTech_API.sBlockCasings4;
- }
- @Override
- public IIconContainer getIconOverlay() {
- return Textures.BlockIcons.OVERLAY_FUSION3;
- }
+public class GT_MetaTileEntity_FusionComputer3 extends GT_MetaTileEntity_FusionComputer {
+
+ public GT_MetaTileEntity_FusionComputer3(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, 6);
+ }
+
+ public GT_MetaTileEntity_FusionComputer3(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public int tier() {
+ return 8;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return 640000000L * (Math.min(16, this.mEnergyHatches.size())) / 16L;
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_FusionComputer3(mName);
+ }
+
+ @Override
+ public int getCasingMeta() {
+ return 8;
+ }
+
+ @Override
+ public Block getFusionCoil() {
+ return GregTech_API.sBlockCasings4;
+ }
+
+ @Override
+ public int getFusionCoilMeta() {
+ return 7;
+ }
+
+ public String[] getDescription() {
+ return new String[]{"A SUN DOWN ON EARTH", "Fusion Casings MK II around Fusion Coils", "2-16 Input Hatches", "1-16 Output Hatches", "1-16 Energy Hatches", "All Hatches must be UV or better", "8192EU/t and 40mio EU Cap per Energy Hatch"};
+ }
+
+ @Override
+ public int tierOverclock() {
+ return 4;
+ }
+
+ @Override
+ public Block getCasing() {
+ return GregTech_API.sBlockCasings4;
+ }
+
+ @Override
+ public IIconContainer getIconOverlay() {
+ return Textures.BlockIcons.OVERLAY_FUSION3;
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java
index 446c52f460..3b76ecccaf 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java
@@ -1,18 +1,6 @@
package gregtech.common.tileentities.machines.multi;
-import java.util.ArrayList;
-
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidRegistry;
-import net.minecraftforge.fluids.FluidStack;
-import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.Materials;
import gregtech.api.enums.Textures;
import gregtech.api.gui.GT_GUIContainer_MultiMachine;
import gregtech.api.interfaces.ITexture;
@@ -20,285 +8,274 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-
-public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBlockBase{
-
- public GT_MetaTileEntity_HeatExchanger(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_HeatExchanger(String aName)
- {
- super(aName);
- }
-
- public String[] getDescription()
- {
- return new String[] { "Controller Block for the Heat Exchanger", "Size: 3x3x4", "Controller (front middle at bottom)", "3x3x4 of Stable Titanium Casing (hollow, Min 24!)", "2 Titanium Pipe Casing Blocks inside the Hollow Casing", "1x Distillated Water Input (one of the Casings)","min 1 Steam Output (one of the Casings)", "1x Maintenance Hatch (one of the Casings)", "1x Hot Fluid Input (botton Center)", "1x Cold Fluid Output (top Center)" };
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- superheated = aNBT.getBoolean("superheated");
- super.loadNBTData(aNBT);}
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setBoolean("superheated", superheated);
- super.saveNBTData(aNBT);}
-
- public GT_MetaTileEntity_Hatch_Input mInputHotFluidHatch;
- public GT_MetaTileEntity_Hatch_Output mOutputColdFluidHatch;
- public boolean superheated=false;
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
- {
- if (aSide == aFacing) {
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[50], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER) };
- }
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[50] };
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeBoiler.png");
- }
-
- public boolean isCorrectMachinePart(ItemStack aStack)
- {
- return true;
- }
-
- public boolean isFacingValid(byte aFacing)
- {
- return aFacing > 1;
- }
-
- public boolean checkRecipe(ItemStack aStack) {
- if (mInputHotFluidHatch.getFluid() == null)
- return true;
-
- int fluidAmountToConsume = mInputHotFluidHatch.getFluidAmount(); // how much fluid is in hatch
-
- int superheated_threshold = 4000; // default: must have 4000L per second to generate superheated steam
- float efficiency = 1f; // default: operate at 100% efficiency with no integrated circuitry
- float penalty_per_config = 0.015f; // penalize 1.5% efficiency per circuitry level (1-25)
- int shs_reduction_per_config = 150; // reduce threshold 150L/s per circuitry level (1-25)
- float steam_output_multiplier = 4f; // default: multiply output by 4
- float penalty = 0.0f; // penalty to apply to output based on circuitry level (1-25).
- boolean do_lava = false;
-
- // Do we have an integrated circuit with a valid configuration?
- if (mInventory[1] != null && mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit")) {
- int circuit_config = mInventory[1].getItemDamage();
- if (circuit_config >= 1 && circuit_config <= 25) {
- // If so, apply the penalty and reduced threshold.
- penalty = (circuit_config - 1) * penalty_per_config;
- superheated_threshold -= (shs_reduction_per_config * (circuit_config - 1));
- }
- }
- efficiency -= penalty;
-
- // If we're working with lava, adjust the threshold and multipliers accordingly.
- if (GT_ModHandler.isLava(mInputHotFluidHatch.getFluid())) {
- superheated_threshold /= 4;
- do_lava = true;
- } else if (mInputHotFluidHatch.getFluid().isFluidEqual(FluidRegistry.getFluidStack("ic2hotcoolant", 1))) {
- steam_output_multiplier = 0.5f;
- } else {
- // If we're working with neither, fail out
- return false;
- }
-
- superheated = fluidAmountToConsume >= superheated_threshold; // set the internal superheated flag if we have enough hot fluid. Used in the onRunningTick method.
- fluidAmountToConsume = Math.min(fluidAmountToConsume, superheated_threshold * 2); // Don't consume too much hot fluid per second
- mInputHotFluidHatch.drain(fluidAmountToConsume, true);
- this.mMaxProgresstime = 20;
- this.mEUt = (int) (fluidAmountToConsume * steam_output_multiplier * efficiency);
- if (do_lava) {
- mOutputColdFluidHatch.fill(FluidRegistry.getFluidStack("ic2pahoehoelava", fluidAmountToConsume), true);
- this.mEfficiencyIncrease = 80;
- } else {
- mOutputColdFluidHatch.fill(FluidRegistry.getFluidStack("ic2coolant", fluidAmountToConsume), true);
- this.mEfficiencyIncrease = 80;
- }
- return true;
- }
-
- private float water;
- private int useWater(float input) {
- water = water + input;
- int usage = (int) water;
- water = water - (int) usage;
- return usage;
- }
-
- public boolean onRunningTick(ItemStack aStack) {
- if (this.mEUt > 0) {
- int tGeneratedEU = (int) (this.mEUt * 2L * this.mEfficiency / 10000L); // APPROXIMATELY how much steam to generate.
- if (tGeneratedEU > 0) {
-
- if (superheated)
- tGeneratedEU /= 2; // We produce half as much superheated steam if necessary
-
- int distilledConsumed = useWater(tGeneratedEU / 160f); // how much distilled water to consume
- //tGeneratedEU = distilledConsumed * 160; // EXACTLY how much steam to generate, producing a perfect 1:160 ratio with distilled water consumption
-
- FluidStack distilledStack = GT_ModHandler.getDistilledWater(distilledConsumed);
- if (depleteInput(distilledStack)) // Consume the distilled water
- {
- if (superheated) {
- addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", tGeneratedEU)); // Generate superheated steam
- } else {
- addOutput(GT_ModHandler.getSteam(tGeneratedEU)); // Generate regular steam
- }
- } else {
- explodeMultiblock(); // Generate crater
- }
- }
- return true;
- }
- return true;
- }
- private static boolean controller;
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack)
- {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
-
- int tCasingAmount = 0;int tFireboxAmount = 0;controller=false;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- if ((i != 0) || (j != 0))
- {
- for (int k = 0; k <= 3; k++) {
- if (!addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, k, zDir + j), 50)&&!addInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, k, zDir + j), 50)&&!addMaintenanceToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, k, zDir + j), 50)&&!ignoreController(aBaseMetaTileEntity.getBlockOffset(xDir + i, k, zDir + j)))
- {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, k, zDir + j) != getCasingBlock()) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, k, zDir + j) != getCasingMeta()) {
- return false;
- }
- tCasingAmount++;
- }
- }
- }else{
- if(!addHotFluidInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j), 50)){
- return false;
- }
- if(!addColdFluidOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 3, zDir + j), 50)){
- return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != getPipeBlock()) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != getPipeMeta()) {
- return false;
- }
-
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != getPipeBlock()) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) != getPipeMeta()) {
- return false;
- }
- }
- }
- }
- return (tCasingAmount >= 24);
- }
-
- public boolean ignoreController(Block tTileEntity){
- if(!controller&&tTileEntity == GregTech_API.sBlockMachines){return true;}
- return false;
- }
-
- public boolean addColdFluidOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- if (aTileEntity == null) return false;
- IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) return false;
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) {
- ((GT_MetaTileEntity_Hatch)aMetaTileEntity).mMachineBlock = (byte)aBaseCasingIndex;
- mOutputColdFluidHatch = (GT_MetaTileEntity_Hatch_Output)aMetaTileEntity;
- return true;
- }
- return false;
- }
-
- public boolean addHotFluidInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- if (aTileEntity == null) return false;
- IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) return false;
- if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
- ((GT_MetaTileEntity_Hatch)aMetaTileEntity).mMachineBlock = (byte)aBaseCasingIndex;
- ((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity).mRecipeMap = getRecipeMap();
- mInputHotFluidHatch = (GT_MetaTileEntity_Hatch_Input)aMetaTileEntity;
- return true;
- }
- return false;
- }
-
- public Block getCasingBlock()
- {
- return GregTech_API.sBlockCasings4;
- }
-
- public byte getCasingMeta()
- {
- return 2;
- }
-
- public byte getCasingTextureIndex()
- {
- return 50;
- }
-
- public Block getPipeBlock()
- {
- return GregTech_API.sBlockCasings2;
- }
-
- public byte getPipeMeta()
- {
- return 14;
- }
-
- public int getMaxEfficiency(ItemStack aStack)
- {
- return 10000;
- }
-
- public int getPollutionPerTick(ItemStack aStack)
- {
- return 0;
- }
-
- public int getDamageToComponent(ItemStack aStack)
- {
- return 0;
- }
-
- public int getAmountOfOutputs()
- {
- return 1;
- }
-
- public boolean explodesOnComponentBreak(ItemStack aStack)
- {
- return false;
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_HeatExchanger(this.mName);
- }
- }
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fluids.FluidStack;
+
+public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBlockBase {
+
+ private static boolean controller;
+ public GT_MetaTileEntity_Hatch_Input mInputHotFluidHatch;
+ public GT_MetaTileEntity_Hatch_Output mOutputColdFluidHatch;
+ public boolean superheated = false;
+ private float water;
+
+ public GT_MetaTileEntity_HeatExchanger(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+ public GT_MetaTileEntity_HeatExchanger(String aName) {
+ super(aName);
+ }
+
+ public String[] getDescription() {
+ return new String[]{"Controller Block for the Heat Exchanger", "Size: 3x3x4", "Controller (front middle at bottom)", "3x3x4 of Stable Titanium Casing (hollow, Min 24!)", "2 Titanium Pipe Casing Blocks inside the Hollow Casing", "1x Distillated Water Input (one of the Casings)", "min 1 Steam Output (one of the Casings)", "1x Maintenance Hatch (one of the Casings)", "1x Hot Fluid Input (botton Center)", "1x Cold Fluid Output (top Center)"};
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ superheated = aNBT.getBoolean("superheated");
+ super.loadNBTData(aNBT);
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setBoolean("superheated", superheated);
+ super.saveNBTData(aNBT);
+ }
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[50], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER)};
+ }
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[50]};
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeBoiler.png");
+ }
+
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ public boolean checkRecipe(ItemStack aStack) {
+ if (mInputHotFluidHatch.getFluid() == null)
+ return true;
+
+ int fluidAmountToConsume = mInputHotFluidHatch.getFluidAmount(); // how much fluid is in hatch
+
+ int superheated_threshold = 4000; // default: must have 4000L per second to generate superheated steam
+ float efficiency = 1f; // default: operate at 100% efficiency with no integrated circuitry
+ float penalty_per_config = 0.015f; // penalize 1.5% efficiency per circuitry level (1-25)
+ int shs_reduction_per_config = 150; // reduce threshold 150L/s per circuitry level (1-25)
+ float steam_output_multiplier = 4f; // default: multiply output by 4
+ float penalty = 0.0f; // penalty to apply to output based on circuitry level (1-25).
+ boolean do_lava = false;
+
+ // Do we have an integrated circuit with a valid configuration?
+ if (mInventory[1] != null && mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit")) {
+ int circuit_config = mInventory[1].getItemDamage();
+ if (circuit_config >= 1 && circuit_config <= 25) {
+ // If so, apply the penalty and reduced threshold.
+ penalty = (circuit_config - 1) * penalty_per_config;
+ superheated_threshold -= (shs_reduction_per_config * (circuit_config - 1));
+ }
+ }
+ efficiency -= penalty;
+
+ // If we're working with lava, adjust the threshold and multipliers accordingly.
+ if (GT_ModHandler.isLava(mInputHotFluidHatch.getFluid())) {
+ superheated_threshold /= 4;
+ do_lava = true;
+ } else if (mInputHotFluidHatch.getFluid().isFluidEqual(FluidRegistry.getFluidStack("ic2hotcoolant", 1))) {
+ steam_output_multiplier = 0.5f;
+ } else {
+ // If we're working with neither, fail out
+ return false;
+ }
+
+ superheated = fluidAmountToConsume >= superheated_threshold; // set the internal superheated flag if we have enough hot fluid. Used in the onRunningTick method.
+ fluidAmountToConsume = Math.min(fluidAmountToConsume, superheated_threshold * 2); // Don't consume too much hot fluid per second
+ mInputHotFluidHatch.drain(fluidAmountToConsume, true);
+ this.mMaxProgresstime = 20;
+ this.mEUt = (int) (fluidAmountToConsume * steam_output_multiplier * efficiency);
+ if (do_lava) {
+ mOutputColdFluidHatch.fill(FluidRegistry.getFluidStack("ic2pahoehoelava", fluidAmountToConsume), true);
+ this.mEfficiencyIncrease = 80;
+ } else {
+ mOutputColdFluidHatch.fill(FluidRegistry.getFluidStack("ic2coolant", fluidAmountToConsume), true);
+ this.mEfficiencyIncrease = 80;
+ }
+ return true;
+ }
+
+ private int useWater(float input) {
+ water = water + input;
+ int usage = (int) water;
+ water = water - (int) usage;
+ return usage;
+ }
+
+ public boolean onRunningTick(ItemStack aStack) {
+ if (this.mEUt > 0) {
+ int tGeneratedEU = (int) (this.mEUt * 2L * this.mEfficiency / 10000L); // APPROXIMATELY how much steam to generate.
+ if (tGeneratedEU > 0) {
+
+ if (superheated)
+ tGeneratedEU /= 2; // We produce half as much superheated steam if necessary
+
+ int distilledConsumed = useWater(tGeneratedEU / 160f); // how much distilled water to consume
+ //tGeneratedEU = distilledConsumed * 160; // EXACTLY how much steam to generate, producing a perfect 1:160 ratio with distilled water consumption
+
+ FluidStack distilledStack = GT_ModHandler.getDistilledWater(distilledConsumed);
+ if (depleteInput(distilledStack)) // Consume the distilled water
+ {
+ if (superheated) {
+ addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", tGeneratedEU)); // Generate superheated steam
+ } else {
+ addOutput(GT_ModHandler.getSteam(tGeneratedEU)); // Generate regular steam
+ }
+ } else {
+ explodeMultiblock(); // Generate crater
+ }
+ }
+ return true;
+ }
+ return true;
+ }
+
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+
+ int tCasingAmount = 0;
+ int tFireboxAmount = 0;
+ controller = false;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if ((i != 0) || (j != 0)) {
+ for (int k = 0; k <= 3; k++) {
+ if (!addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, k, zDir + j), 50) && !addInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, k, zDir + j), 50) && !addMaintenanceToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, k, zDir + j), 50) && !ignoreController(aBaseMetaTileEntity.getBlockOffset(xDir + i, k, zDir + j))) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, k, zDir + j) != getCasingBlock()) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, k, zDir + j) != getCasingMeta()) {
+ return false;
+ }
+ tCasingAmount++;
+ }
+ }
+ } else {
+ if (!addHotFluidInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j), 50)) {
+ return false;
+ }
+ if (!addColdFluidOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 3, zDir + j), 50)) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != getPipeBlock()) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != getPipeMeta()) {
+ return false;
+ }
+
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != getPipeBlock()) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) != getPipeMeta()) {
+ return false;
+ }
+ }
+ }
+ }
+ return (tCasingAmount >= 24);
+ }
+
+ public boolean ignoreController(Block tTileEntity) {
+ if (!controller && tTileEntity == GregTech_API.sBlockMachines) {
+ return true;
+ }
+ return false;
+ }
+
+ public boolean addColdFluidOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) return false;
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ mOutputColdFluidHatch = (GT_MetaTileEntity_Hatch_Output) aMetaTileEntity;
+ return true;
+ }
+ return false;
+ }
+
+ public boolean addHotFluidInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) return false;
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = getRecipeMap();
+ mInputHotFluidHatch = (GT_MetaTileEntity_Hatch_Input) aMetaTileEntity;
+ return true;
+ }
+ return false;
+ }
+
+ public Block getCasingBlock() {
+ return GregTech_API.sBlockCasings4;
+ }
+
+ public byte getCasingMeta() {
+ return 2;
+ }
+
+ public byte getCasingTextureIndex() {
+ return 50;
+ }
+
+ public Block getPipeBlock() {
+ return GregTech_API.sBlockCasings2;
+ }
+
+ public byte getPipeMeta() {
+ return 14;
+ }
+
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
+
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_HeatExchanger(this.mName);
+ }
+}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java
index fdc206b3f9..a611843530 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java
@@ -2,7 +2,6 @@ package gregtech.common.tileentities.machines.multi;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.gui.GT_GUIContainer_MultiMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -10,165 +9,139 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Map;
-
import net.minecraft.block.Block;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
+import java.util.ArrayList;
+import java.util.Arrays;
+
public class GT_MetaTileEntity_ImplosionCompressor
- extends GT_MetaTileEntity_MultiBlockBase
-{
- public GT_MetaTileEntity_ImplosionCompressor(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_ImplosionCompressor(String aName)
- {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_ImplosionCompressor(this.mName);
- }
-
- public String[] getDescription()
- {
- return new String[] { "Controller Block for the Implosion Compressor", "Size: 3x3x3 (Hollow)", "Controller (front centered)", "1x Input (anywhere)", "1x Output (anywhere)", "1x Energy Hatch (anywhere)", "1x Maintenance Hatch (anywhere)", "1x Muffler Hatch (anywhere)", "Solid Steel Casings for the rest (16 at least!)" };
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
- {
- if (aSide == aFacing) {
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[16], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR) };
- }
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[16] };
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ImplosionCompressor.png");
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipeMap()
- {
- return GT_Recipe.GT_Recipe_Map.sImplosionRecipes;
- }
-
- public boolean isCorrectMachinePart(ItemStack aStack)
- {
- return true;
- }
-
- public boolean isFacingValid(byte aFacing)
- {
- return aFacing > 1;
- }
-
- public boolean checkRecipe(ItemStack aStack)
- {
- ArrayList<ItemStack> tInputList = getStoredInputs();
- for (int i = 0; i < tInputList.size() - 1; i++) {
- for (int j = i + 1; j < tInputList.size(); j++) {
- if (GT_Utility.areStacksEqual((ItemStack)tInputList.get(i), (ItemStack)tInputList.get(j))) {
- if (((ItemStack)tInputList.get(i)).stackSize >= ((ItemStack)tInputList.get(j)).stackSize)
- {
- tInputList.remove(j--);
- }
- else
- {
- tInputList.remove(i--); break;
- }
+ extends GT_MetaTileEntity_MultiBlockBase {
+ public GT_MetaTileEntity_ImplosionCompressor(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_ImplosionCompressor(String aName) {
+ super(aName);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_ImplosionCompressor(this.mName);
+ }
+
+ public String[] getDescription() {
+ return new String[]{"Controller Block for the Implosion Compressor", "Size: 3x3x3 (Hollow)", "Controller (front centered)", "1x Input (anywhere)", "1x Output (anywhere)", "1x Energy Hatch (anywhere)", "1x Maintenance Hatch (anywhere)", "1x Muffler Hatch (anywhere)", "Solid Steel Casings for the rest (16 at least!)"};
+ }
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[16], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR)};
}
- }
- }
- ItemStack[] tInputs = (ItemStack[])Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
- if (tInputList.size() > 0)
- {
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sImplosionRecipes.findRecipe(getBaseMetaTileEntity(), false, 9223372036854775807L, null, tInputs);
- if ((tRecipe != null) && (tRecipe.isRecipeInputEqual(true, null, tInputs)))
- {
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
-
- this.mEUt = (-tRecipe.mEUt);
- this.mMaxProgresstime = Math.max(1, tRecipe.mDuration);
- this.mOutputItems = new ItemStack[] { tRecipe.getOutput(0), tRecipe.getOutput(1) };
- sendLoopStart((byte)20);
- updateSlots();
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[16]};
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ImplosionCompressor.png");
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sImplosionRecipes;
+ }
+
+ public boolean isCorrectMachinePart(ItemStack aStack) {
return true;
- }
- }
- return false;
- }
-
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
- {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 20) {
- GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(5)), 10, 1.0F, aX, aY, aZ);
- }
- }
-
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack)
- {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
- if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
- return false;
- }
- int tAmount = 0;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- for (int h = -1; h < 2; h++) {
- if ((h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0))))
- {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
- if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addMufflerToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16)) && (!addOutputToMachineList(tTileEntity, 16)) && (!addEnergyInputToMachineList(tTileEntity, 16)))
- {
- Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
- byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
- if (((tBlock != GregTech_API.sBlockCasings2) || (tMeta != 0)) && ((tBlock != GregTech_API.sBlockCasings3) || (tMeta != 4))) {
- return false;
- }
- tAmount++;
+ }
+
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ public boolean checkRecipe(ItemStack aStack) {
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ for (int i = 0; i < tInputList.size() - 1; i++) {
+ for (int j = i + 1; j < tInputList.size(); j++) {
+ if (GT_Utility.areStacksEqual((ItemStack) tInputList.get(i), (ItemStack) tInputList.get(j))) {
+ if (((ItemStack) tInputList.get(i)).stackSize >= ((ItemStack) tInputList.get(j)).stackSize) {
+ tInputList.remove(j--);
+ } else {
+ tInputList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+ ItemStack[] tInputs = (ItemStack[]) Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
+ if (tInputList.size() > 0) {
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sImplosionRecipes.findRecipe(getBaseMetaTileEntity(), false, 9223372036854775807L, null, tInputs);
+ if ((tRecipe != null) && (tRecipe.isRecipeInputEqual(true, null, tInputs))) {
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ this.mEUt = (-tRecipe.mEUt);
+ this.mMaxProgresstime = Math.max(1, tRecipe.mDuration);
+ this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)};
+ sendLoopStart((byte) 20);
+ updateSlots();
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 20) {
+ GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(5)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
+ return false;
+ }
+ int tAmount = 0;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ for (int h = -1; h < 2; h++) {
+ if ((h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
+ if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addMufflerToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16)) && (!addOutputToMachineList(tTileEntity, 16)) && (!addEnergyInputToMachineList(tTileEntity, 16))) {
+ Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j);
+ byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j);
+ if (((tBlock != GregTech_API.sBlockCasings2) || (tMeta != 0)) && ((tBlock != GregTech_API.sBlockCasings3) || (tMeta != 4))) {
+ return false;
+ }
+ tAmount++;
+ }
+ }
+ }
}
- }
}
- }
- }
- return tAmount >= 16;
- }
-
- public int getMaxEfficiency(ItemStack aStack)
- {
- return 10000;
- }
-
- public int getPollutionPerTick(ItemStack aStack)
- {
- return 1000;
- }
-
- public int getDamageToComponent(ItemStack aStack)
- {
- return 0;
- }
-
- public int getAmountOfOutputs()
- {
- return 2;
- }
-
- public boolean explodesOnComponentBreak(ItemStack aStack)
- {
- return false;
- }
+ return tAmount >= 16;
+ }
+
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 1000;
+ }
+
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ public int getAmountOfOutputs() {
+ return 2;
+ }
+
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java
index b9b6ca44f4..2975c6104f 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java
@@ -3,7 +3,6 @@ package gregtech.common.tileentities.machines.multi;
import gregtech.GT_Mod;
import gregtech.api.enums.Materials;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.gui.GT_GUIContainer_MultiMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -11,251 +10,221 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockB
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map_Fuel;
import gregtech.api.util.GT_Utility;
-
-import java.util.ArrayList;
-
import net.minecraft.block.Block;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
+import java.util.ArrayList;
+
public abstract class GT_MetaTileEntity_LargeBoiler
- extends GT_MetaTileEntity_MultiBlockBase
-{
- public GT_MetaTileEntity_LargeBoiler(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_LargeBoiler(String aName)
- {
- super(aName);
- }
-
- public String[] getDescription()
- {
- return new String[] { "Controller Block for the Large Boiler", "Size: 3x3x5", "Controller (front middle in Fireboxes)", "3x3 of Fire Boxes (bottom Layer, Min 3!)", "3x3x4 of Casing (above Fireboxes, hollow, Min 24!)", "3 Pipe Casing Blocks inside the Hollow Casing", "1x Input (one of Fireboxes)", "1x Maintenance Hatch (one of Fireboxes)", "1x Muffler Hatch (one of Fireboxes)", "1x Fluid Output (one of Main Casing)" };
- }
-
- public abstract Block getCasingBlock();
-
- public abstract byte getCasingMeta();
-
- public abstract byte getCasingTextureIndex();
-
- public abstract Block getPipeBlock();
-
- public abstract byte getPipeMeta();
-
- public abstract Block getFireboxBlock();
-
- public abstract byte getFireboxMeta();
-
- public abstract byte getFireboxTextureIndex();
-
- public abstract int getEUt();
-
- public abstract int getEfficiencyIncrease();
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
- {
- if (aSide == aFacing) {
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[getCasingTextureIndex()], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER) };
- }
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[getCasingTextureIndex()] };
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeBoiler.png");
- }
-
- public boolean isCorrectMachinePart(ItemStack aStack)
- {
- return true;
- }
-
- public boolean isFacingValid(byte aFacing)
- {
- return aFacing > 1;
- }
-
- public boolean checkRecipe(ItemStack aStack)
- {
- for (GT_Recipe tRecipe : GT_Recipe.GT_Recipe_Map.sDieselFuels.mRecipeList)
- {
- FluidStack tFluid = GT_Utility.getFluidForFilledItem(tRecipe.getRepresentativeInput(0), true);
- if ((tFluid != null) && (tRecipe.mSpecialValue > 1))
- {
- tFluid.amount = 1000;
- if (depleteInput(tFluid))
- {
- this.mMaxProgresstime = (runtimeBoost(tRecipe.mSpecialValue / 2));
- this.mEUt = getEUt();
- this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease() * 4);
- return true;
- }
- }
+ extends GT_MetaTileEntity_MultiBlockBase {
+ private boolean firstRun = true;
+
+ public GT_MetaTileEntity_LargeBoiler(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
}
- for (GT_Recipe tRecipe : GT_Recipe.GT_Recipe_Map.sDenseLiquidFuels.mRecipeList)
- {
- FluidStack tFluid = GT_Utility.getFluidForFilledItem(tRecipe.getRepresentativeInput(0), true);
- if (tFluid != null)
- {
- tFluid.amount = 1000;
- if (depleteInput(tFluid))
- {
- this.mMaxProgresstime = Math.max(1, runtimeBoost(tRecipe.mSpecialValue * 2));
- this.mEUt = getEUt();
- this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease());
- return true;
- }
- }
+
+ public GT_MetaTileEntity_LargeBoiler(String aName) {
+ super(aName);
}
- ArrayList<ItemStack> tInputList = getStoredInputs();
- if (!tInputList.isEmpty()) {
- for (ItemStack tInput : tInputList) {
- if ((GT_Utility.getFluidForFilledItem(tInput, true) == null) && ((this.mMaxProgresstime = runtimeBoost(GT_ModHandler.getFuelValue(tInput) / 80)) > 0))
- {
- this.mEUt = getEUt();
- this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease());
- this.mOutputItems = new ItemStack[] { GT_Utility.getContainerItem(tInput, true) };
- tInput.stackSize -= 1;
- updateSlots();
- return true;
- }
- }
+
+ public String[] getDescription() {
+ return new String[]{"Controller Block for the Large Boiler", "Size: 3x3x5", "Controller (front middle in Fireboxes)", "3x3 of Fire Boxes (bottom Layer, Min 3!)", "3x3x4 of Casing (above Fireboxes, hollow, Min 24!)", "3 Pipe Casing Blocks inside the Hollow Casing", "1x Input (one of Fireboxes)", "1x Maintenance Hatch (one of Fireboxes)", "1x Muffler Hatch (one of Fireboxes)", "1x Fluid Output (one of Main Casing)"};
}
- this.mMaxProgresstime = 0;
- this.mEUt = 0;
- return false;
- }
-
- abstract int runtimeBoost(int mTime);
-
- public boolean onRunningTick(ItemStack aStack)
- {
- if (this.mEUt > 0)
- {
- int tGeneratedEU = (int)(this.mEUt * 2L * this.mEfficiency / 10000L);
- if (tGeneratedEU > 0) {
- long amount = (tGeneratedEU + 160) / 160;
- if (depleteInput(Materials.Water.getFluid(amount)) || depleteInput(GT_ModHandler.getDistilledWater(amount))) {
- addOutput(GT_ModHandler.getSteam(tGeneratedEU));
- } else {
- explodeMultiblock();
+
+ public abstract Block getCasingBlock();
+
+ public abstract byte getCasingMeta();
+
+ public abstract byte getCasingTextureIndex();
+
+ public abstract Block getPipeBlock();
+
+ public abstract byte getPipeMeta();
+
+ public abstract Block getFireboxBlock();
+
+ public abstract byte getFireboxMeta();
+
+ public abstract byte getFireboxTextureIndex();
+
+ public abstract int getEUt();
+
+ public abstract int getEfficiencyIncrease();
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[getCasingTextureIndex()], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER)};
}
- }
- return true;
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[getCasingTextureIndex()]};
}
- return true;
- }
-private boolean firstRun = true;
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeBoiler.png");
+ }
-@Override
-public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (mProgresstime>0&&firstRun) {firstRun = false;try{
- GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "extremepressure");}catch (Exception e){}
- }
- super.onPostTick(aBaseMetaTileEntity, aTick);
-}
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
-
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack)
- {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
-
- int tCasingAmount = 0;int tFireboxAmount = 0;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- if ((i != 0) || (j != 0))
- {
- for (int k = 1; k <= 4; k++) {
- if (!addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, k, zDir + j), getCasingTextureIndex()))
- {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, k, zDir + j) != getCasingBlock()) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, k, zDir + j) != getCasingMeta()) {
- return false;
- }
- tCasingAmount++;
+ public boolean checkRecipe(ItemStack aStack) {
+ for (GT_Recipe tRecipe : GT_Recipe.GT_Recipe_Map.sDieselFuels.mRecipeList) {
+ FluidStack tFluid = GT_Utility.getFluidForFilledItem(tRecipe.getRepresentativeInput(0), true);
+ if ((tFluid != null) && (tRecipe.mSpecialValue > 1)) {
+ tFluid.amount = 1000;
+ if (depleteInput(tFluid)) {
+ this.mMaxProgresstime = (runtimeBoost(tRecipe.mSpecialValue / 2));
+ this.mEUt = getEUt();
+ this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease() * 4);
+ return true;
+ }
}
- }
}
- else
- {
- for (int k = 1; k <= 3; k++)
- {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, k, zDir + j) != getPipeBlock()) {
- return false;
+ for (GT_Recipe tRecipe : GT_Recipe.GT_Recipe_Map.sDenseLiquidFuels.mRecipeList) {
+ FluidStack tFluid = GT_Utility.getFluidForFilledItem(tRecipe.getRepresentativeInput(0), true);
+ if (tFluid != null) {
+ tFluid.amount = 1000;
+ if (depleteInput(tFluid)) {
+ this.mMaxProgresstime = Math.max(1, runtimeBoost(tRecipe.mSpecialValue * 2));
+ this.mEUt = getEUt();
+ this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease());
+ return true;
+ }
}
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, k, zDir + j) != getPipeMeta()) {
- return false;
+ }
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ if (!tInputList.isEmpty()) {
+ for (ItemStack tInput : tInputList) {
+ if ((GT_Utility.getFluidForFilledItem(tInput, true) == null) && ((this.mMaxProgresstime = runtimeBoost(GT_ModHandler.getFuelValue(tInput) / 80)) > 0)) {
+ this.mEUt = getEUt();
+ this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease());
+ this.mOutputItems = new ItemStack[]{GT_Utility.getContainerItem(tInput, true)};
+ tInput.stackSize -= 1;
+ updateSlots();
+ return true;
+ }
}
- }
- if (!addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 4, zDir + j), getCasingTextureIndex()))
- {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 4, zDir + j) != getCasingBlock()) {
- return false;
+ }
+ this.mMaxProgresstime = 0;
+ this.mEUt = 0;
+ return false;
+ }
+
+ abstract int runtimeBoost(int mTime);
+
+ public boolean onRunningTick(ItemStack aStack) {
+ if (this.mEUt > 0) {
+ int tGeneratedEU = (int) (this.mEUt * 2L * this.mEfficiency / 10000L);
+ if (tGeneratedEU > 0) {
+ long amount = (tGeneratedEU + 160) / 160;
+ if (depleteInput(Materials.Water.getFluid(amount)) || depleteInput(GT_ModHandler.getDistilledWater(amount))) {
+ addOutput(GT_ModHandler.getSteam(tGeneratedEU));
+ } else {
+ explodeMultiblock();
+ }
}
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 4, zDir + j) != getCasingMeta()) {
- return false;
+ return true;
+ }
+ return true;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (mProgresstime > 0 && firstRun) {
+ firstRun = false;
+ try {
+ GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "extremepressure");
+ } catch (Exception e) {
}
- tCasingAmount++;
- }
}
- }
+ super.onPostTick(aBaseMetaTileEntity, aTick);
}
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- if ((xDir + i != 0) || (zDir + j != 0))
- {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j);
- if ((!addMaintenanceToMachineList(tTileEntity, getFireboxTextureIndex())) && (!addInputToMachineList(tTileEntity, getFireboxTextureIndex())) && (!addMufflerToMachineList(tTileEntity, getFireboxTextureIndex())))
- {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != getFireboxBlock()) {
- return false;
+
+
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+
+ int tCasingAmount = 0;
+ int tFireboxAmount = 0;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if ((i != 0) || (j != 0)) {
+ for (int k = 1; k <= 4; k++) {
+ if (!addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, k, zDir + j), getCasingTextureIndex())) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, k, zDir + j) != getCasingBlock()) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, k, zDir + j) != getCasingMeta()) {
+ return false;
+ }
+ tCasingAmount++;
+ }
+ }
+ } else {
+ for (int k = 1; k <= 3; k++) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, k, zDir + j) != getPipeBlock()) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, k, zDir + j) != getPipeMeta()) {
+ return false;
+ }
+ }
+ if (!addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 4, zDir + j), getCasingTextureIndex())) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 4, zDir + j) != getCasingBlock()) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 4, zDir + j) != getCasingMeta()) {
+ return false;
+ }
+ tCasingAmount++;
+ }
+ }
}
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != getFireboxMeta()) {
- return false;
+ }
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if ((xDir + i != 0) || (zDir + j != 0)) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j);
+ if ((!addMaintenanceToMachineList(tTileEntity, getFireboxTextureIndex())) && (!addInputToMachineList(tTileEntity, getFireboxTextureIndex())) && (!addMufflerToMachineList(tTileEntity, getFireboxTextureIndex()))) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != getFireboxBlock()) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != getFireboxMeta()) {
+ return false;
+ }
+ tFireboxAmount++;
+ }
+ }
}
- tFireboxAmount++;
- }
}
- }
+ return (tCasingAmount >= 24) && (tFireboxAmount >= 3);
+ }
+
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 10;
+ }
+
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
}
- return (tCasingAmount >= 24) && (tFireboxAmount >= 3);
- }
-
- public int getMaxEfficiency(ItemStack aStack)
- {
- return 10000;
- }
-
- public int getPollutionPerTick(ItemStack aStack)
- {
- return 10;
- }
-
- public int getDamageToComponent(ItemStack aStack)
- {
- return 0;
- }
-
- public int getAmountOfOutputs()
- {
- return 1;
- }
-
- public boolean explodesOnComponentBreak(ItemStack aStack)
- {
- return false;
- }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java
index 78fef710c8..7c5dad3c96 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java
@@ -6,75 +6,61 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.block.Block;
public class GT_MetaTileEntity_LargeBoiler_Bronze
- extends GT_MetaTileEntity_LargeBoiler
-{
- public GT_MetaTileEntity_LargeBoiler_Bronze(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_LargeBoiler_Bronze(String aName)
- {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_LargeBoiler_Bronze(this.mName);
- }
-
- public Block getCasingBlock()
- {
- return GregTech_API.sBlockCasings1;
- }
-
- public byte getCasingMeta()
- {
- return 10;
- }
-
- public byte getCasingTextureIndex()
- {
- return 10;
- }
-
- public Block getPipeBlock()
- {
- return GregTech_API.sBlockCasings2;
- }
-
- public byte getPipeMeta()
- {
- return 12;
- }
-
- public Block getFireboxBlock()
- {
- return GregTech_API.sBlockCasings3;
- }
-
- public byte getFireboxMeta()
- {
- return 13;
- }
-
- public byte getFireboxTextureIndex()
- {
- return 45;
- }
-
- public int getEUt()
- {
- return 400;
- }
-
- public int getEfficiencyIncrease()
- {
- return 16;
- }
+ extends GT_MetaTileEntity_LargeBoiler {
+ public GT_MetaTileEntity_LargeBoiler_Bronze(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
-@Override
-int runtimeBoost(int mTime) {
- return mTime * 2;
-}
+ public GT_MetaTileEntity_LargeBoiler_Bronze(String aName) {
+ super(aName);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_LargeBoiler_Bronze(this.mName);
+ }
+
+ public Block getCasingBlock() {
+ return GregTech_API.sBlockCasings1;
+ }
+
+ public byte getCasingMeta() {
+ return 10;
+ }
+
+ public byte getCasingTextureIndex() {
+ return 10;
+ }
+
+ public Block getPipeBlock() {
+ return GregTech_API.sBlockCasings2;
+ }
+
+ public byte getPipeMeta() {
+ return 12;
+ }
+
+ public Block getFireboxBlock() {
+ return GregTech_API.sBlockCasings3;
+ }
+
+ public byte getFireboxMeta() {
+ return 13;
+ }
+
+ public byte getFireboxTextureIndex() {
+ return 45;
+ }
+
+ public int getEUt() {
+ return 400;
+ }
+
+ public int getEfficiencyIncrease() {
+ return 16;
+ }
+
+ @Override
+ int runtimeBoost(int mTime) {
+ return mTime * 2;
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java
index 8432e8f9e8..a68c0e6212 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java
@@ -6,75 +6,61 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.block.Block;
public class GT_MetaTileEntity_LargeBoiler_Steel
- extends GT_MetaTileEntity_LargeBoiler
-{
- public GT_MetaTileEntity_LargeBoiler_Steel(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_LargeBoiler_Steel(String aName)
- {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_LargeBoiler_Steel(this.mName);
- }
-
- public Block getCasingBlock()
- {
- return GregTech_API.sBlockCasings2;
- }
-
- public byte getCasingMeta()
- {
- return 0;
- }
-
- public byte getCasingTextureIndex()
- {
- return 16;
- }
-
- public Block getPipeBlock()
- {
- return GregTech_API.sBlockCasings2;
- }
-
- public byte getPipeMeta()
- {
- return 13;
- }
-
- public Block getFireboxBlock()
- {
- return GregTech_API.sBlockCasings3;
- }
-
- public byte getFireboxMeta()
- {
- return 14;
- }
-
- public byte getFireboxTextureIndex()
- {
- return 46;
- }
-
- public int getEUt()
- {
- return 600;
- }
-
- public int getEfficiencyIncrease()
- {
- return 12;
- }
-
- @Override
- int runtimeBoost(int mTime) {
- return mTime * 150 /100;
- }
+ extends GT_MetaTileEntity_LargeBoiler {
+ public GT_MetaTileEntity_LargeBoiler_Steel(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_LargeBoiler_Steel(String aName) {
+ super(aName);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_LargeBoiler_Steel(this.mName);
+ }
+
+ public Block getCasingBlock() {
+ return GregTech_API.sBlockCasings2;
+ }
+
+ public byte getCasingMeta() {
+ return 0;
+ }
+
+ public byte getCasingTextureIndex() {
+ return 16;
+ }
+
+ public Block getPipeBlock() {
+ return GregTech_API.sBlockCasings2;
+ }
+
+ public byte getPipeMeta() {
+ return 13;
+ }
+
+ public Block getFireboxBlock() {
+ return GregTech_API.sBlockCasings3;
+ }
+
+ public byte getFireboxMeta() {
+ return 14;
+ }
+
+ public byte getFireboxTextureIndex() {
+ return 46;
+ }
+
+ public int getEUt() {
+ return 600;
+ }
+
+ public int getEfficiencyIncrease() {
+ return 12;
+ }
+
+ @Override
+ int runtimeBoost(int mTime) {
+ return mTime * 150 / 100;
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java
index 9f18d77ec7..6fc32f8c34 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java
@@ -6,75 +6,61 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.block.Block;
public class GT_MetaTileEntity_LargeBoiler_Titanium
- extends GT_MetaTileEntity_LargeBoiler
-{
- public GT_MetaTileEntity_LargeBoiler_Titanium(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_LargeBoiler_Titanium(String aName)
- {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_LargeBoiler_Titanium(this.mName);
- }
-
- public Block getCasingBlock()
- {
- return GregTech_API.sBlockCasings4;
- }
-
- public byte getCasingMeta()
- {
- return 2;
- }
-
- public byte getCasingTextureIndex()
- {
- return 50;
- }
-
- public Block getPipeBlock()
- {
- return GregTech_API.sBlockCasings2;
- }
-
- public byte getPipeMeta()
- {
- return 14;
- }
-
- public Block getFireboxBlock()
- {
- return GregTech_API.sBlockCasings4;
- }
-
- public byte getFireboxMeta()
- {
- return 3;
- }
-
- public byte getFireboxTextureIndex()
- {
- return 51;
- }
-
- public int getEUt()
- {
- return 800;
- }
-
- public int getEfficiencyIncrease()
- {
- return 8;
- }
-
- @Override
- int runtimeBoost(int mTime) {
- return mTime * 130 /100;
- }
+ extends GT_MetaTileEntity_LargeBoiler {
+ public GT_MetaTileEntity_LargeBoiler_Titanium(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_LargeBoiler_Titanium(String aName) {
+ super(aName);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_LargeBoiler_Titanium(this.mName);
+ }
+
+ public Block getCasingBlock() {
+ return GregTech_API.sBlockCasings4;
+ }
+
+ public byte getCasingMeta() {
+ return 2;
+ }
+
+ public byte getCasingTextureIndex() {
+ return 50;
+ }
+
+ public Block getPipeBlock() {
+ return GregTech_API.sBlockCasings2;
+ }
+
+ public byte getPipeMeta() {
+ return 14;
+ }
+
+ public Block getFireboxBlock() {
+ return GregTech_API.sBlockCasings4;
+ }
+
+ public byte getFireboxMeta() {
+ return 3;
+ }
+
+ public byte getFireboxTextureIndex() {
+ return 51;
+ }
+
+ public int getEUt() {
+ return 800;
+ }
+
+ public int getEfficiencyIncrease() {
+ return 8;
+ }
+
+ @Override
+ int runtimeBoost(int mTime) {
+ return mTime * 130 / 100;
+ }
} \ No newline at end of file
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java
index 733eb6a22d..997a176e34 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java
@@ -6,76 +6,62 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.block.Block;
public class GT_MetaTileEntity_LargeBoiler_TungstenSteel
- extends GT_MetaTileEntity_LargeBoiler
-{
- public GT_MetaTileEntity_LargeBoiler_TungstenSteel(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_LargeBoiler_TungstenSteel(String aName)
- {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_LargeBoiler_TungstenSteel(this.mName);
- }
-
- public Block getCasingBlock()
- {
- return GregTech_API.sBlockCasings4;
- }
-
- public byte getCasingMeta()
- {
- return 0;
- }
-
- public byte getCasingTextureIndex()
- {
- return 48;
- }
-
- public Block getPipeBlock()
- {
- return GregTech_API.sBlockCasings2;
- }
-
- public byte getPipeMeta()
- {
- return 15;
- }
-
- public Block getFireboxBlock()
- {
- return GregTech_API.sBlockCasings3;
- }
-
- public byte getFireboxMeta()
- {
- return 15;
- }
-
- public byte getFireboxTextureIndex()
- {
- return 47;
- }
-
- public int getEUt()
- {
- return 1000;
- }
-
- public int getEfficiencyIncrease()
- {
- return 4;
- }
-
- @Override
- int runtimeBoost(int mTime) {
- return mTime * 120 /100;
- }
-
+ extends GT_MetaTileEntity_LargeBoiler {
+ public GT_MetaTileEntity_LargeBoiler_TungstenSteel(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_LargeBoiler_TungstenSteel(String aName) {
+ super(aName);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_LargeBoiler_TungstenSteel(this.mName);
+ }
+
+ public Block getCasingBlock() {
+ return GregTech_API.sBlockCasings4;
+ }
+
+ public byte getCasingMeta() {
+ return 0;
+ }
+
+ public byte getCasingTextureIndex() {
+ return 48;
+ }
+
+ public Block getPipeBlock() {
+ return GregTech_API.sBlockCasings2;
+ }
+
+ public byte getPipeMeta() {
+ return 15;
+ }
+
+ public Block getFireboxBlock() {
+ return GregTech_API.sBlockCasings3;
+ }
+
+ public byte getFireboxMeta() {
+ return 15;
+ }
+
+ public byte getFireboxTextureIndex() {
+ return 47;
+ }
+
+ public int getEUt() {
+ return 1000;
+ }
+
+ public int getEfficiencyIncrease() {
+ return 4;
+ }
+
+ @Override
+ int runtimeBoost(int mTime) {
+ return mTime * 120 / 100;
+ }
+
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java
index 9bc636a95b..7544ef600d 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java
@@ -1,192 +1,187 @@
package gregtech.common.tileentities.machines.multi;
-import java.util.ArrayList;
-
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraftforge.fluids.FluidStack;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.ItemList;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.items.GT_MetaGenerated_Tool;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
import gregtech.common.items.GT_MetaGenerated_Tool_01;
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.fluids.FluidStack;
+
+import java.util.ArrayList;
+
+public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_MultiBlockBase {
+
+ protected int baseEff = 0;
+ protected int optFlow = 0;
+ protected int counter = 0;
+
+ public GT_MetaTileEntity_LargeTurbine(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+ public GT_MetaTileEntity_LargeTurbine(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return getMaxEfficiency(aStack) > 0;
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ byte tSide = getBaseMetaTileEntity().getBackFacing();
+ if ((getBaseMetaTileEntity().getAirAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 1)) && (getBaseMetaTileEntity().getAirAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 2))) {
+ int tAirCount = 0;
+ for (byte i = -1; i < 2; i = (byte) (i + 1)) {
+ for (byte j = -1; j < 2; j = (byte) (j + 1)) {
+ for (byte k = -1; k < 2; k = (byte) (k + 1)) {
+ if (getBaseMetaTileEntity().getAirOffset(i, j, k)) {
+ tAirCount++;
+ }
+ }
+ }
+ }
+ if (tAirCount != 10) {
+ return false;
+ }
+ for (byte i = 2; i < 6; i = (byte) (i + 1)) {
+ IGregTechTileEntity tTileEntity;
+ if ((null != (tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(i, 2))) &&
+ (tTileEntity.getFrontFacing() == getBaseMetaTileEntity().getFrontFacing()) && (tTileEntity.getMetaTileEntity() != null) &&
+ ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_LargeTurbine))) {
+ return false;
+ }
+ }
+ int tX = getBaseMetaTileEntity().getXCoord();
+ int tY = getBaseMetaTileEntity().getYCoord();
+ int tZ = getBaseMetaTileEntity().getZCoord();
+ for (byte i = -1; i < 2; i = (byte) (i + 1)) {
+ for (byte j = -1; j < 2; j = (byte) (j + 1)) {
+ if ((i != 0) || (j != 0)) {
+ for (byte k = 0; k < 4; k = (byte) (k + 1)) {
+ if (((i == 0) || (j == 0)) && ((k == 1) || (k == 2))) {
+ if (getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingMeta()) {
+ } else if (!addToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)))) {
+ return false;
+ }
+ } else if (getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingMeta()) {
+ } else {
+ return false;
+ }
+ }
+ }
+ }
+ }
+ this.mDynamoHatches.clear();
+ IGregTechTileEntity tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 3);
+ if ((tTileEntity != null) && (tTileEntity.getMetaTileEntity() != null)) {
+ if ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Dynamo)) {
+ this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) tTileEntity.getMetaTileEntity());
+ ((GT_MetaTileEntity_Hatch) tTileEntity.getMetaTileEntity()).mMachineBlock = getCasingTextureIndex();
+ } else {
+ return false;
+ }
+ }
+ } else {
+ return false;
+ }
+ return true;
+ }
+
+ public abstract Block getCasingBlock();
+
+ public abstract byte getCasingMeta();
+
+ public abstract byte getCasingTextureIndex();
+
+ private boolean addToMachineList(IGregTechTileEntity tTileEntity) {
+ return ((addMaintenanceToMachineList(tTileEntity, getCasingTextureIndex())) || (addInputToMachineList(tTileEntity, getCasingTextureIndex())) || (addOutputToMachineList(tTileEntity, getCasingTextureIndex())) || (addMufflerToMachineList(tTileEntity, getCasingTextureIndex())));
+ }
+
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ ArrayList<FluidStack> tFluids = getStoredFluids();
+ if (tFluids.size() > 0) {
+ if (baseEff == 0 || optFlow == 0 || counter >= 1000 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()
+ || this.getBaseMetaTileEntity().hasInventoryBeenModified()) {
+ counter = 0;
+ baseEff = (int) ((50.0F
+ + (10.0F * ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack))) * 100);
+ optFlow = (int) Math.max(Float.MIN_NORMAL,
+ ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack).getSpeedMultiplier()
+ * ((GT_MetaGenerated_Tool) aStack.getItem()).getPrimaryMaterial(aStack).mToolSpeed
+ * 50);
+ } else {
+ counter++;
+ }
+ }
+
+ int newPower = fluidIntoPower(tFluids, optFlow, baseEff); // How much the turbine should be producing with this flow
+ int difference = newPower - this.mEUt; // difference between current output and new output
+
+ // Magic numbers: can always change by at least 10 eu/t, but otherwise by at most 1 percent of the difference in power level (per tick)
+ // This is how much the turbine can actually change during this tick
+ int maxChangeAllowed = Math.max(10, (int) Math.ceil(Math.abs(difference) * 0.01));
+
+ if (Math.abs(difference) > maxChangeAllowed) { // If this difference is too big, use the maximum allowed change
+ int change = maxChangeAllowed * (difference > 0 ? 1 : -1); // Make the change positive or negative.
+ this.mEUt += change; // Apply the change
+ } else
+ this.mEUt = newPower;
+
+ if (mEUt <= 0) {
-public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_MultiBlockBase{
-
- public GT_MetaTileEntity_LargeTurbine(int aID, String aName, String aNameRegional){super(aID, aName, aNameRegional);}
- public GT_MetaTileEntity_LargeTurbine(String aName){super(aName);}
-
-
- @Override
- public boolean isCorrectMachinePart(ItemStack aStack) {
- return getMaxEfficiency(aStack) > 0;
- }
-
- protected int baseEff=0;
- protected int optFlow=0;
- protected int counter=0;
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- byte tSide = getBaseMetaTileEntity().getBackFacing();
- if ((getBaseMetaTileEntity().getAirAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 1)) && (getBaseMetaTileEntity().getAirAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 2)))
- {
- int tAirCount = 0;
- for (byte i = -1; i < 2; i = (byte)(i + 1)) {
- for (byte j = -1; j < 2; j = (byte)(j + 1)) {
- for (byte k = -1; k < 2; k = (byte)(k + 1)) {
- if (getBaseMetaTileEntity().getAirOffset(i, j, k)) {
- tAirCount++;
- }
- }
- }
- }
- if (tAirCount != 10) {
- return false;
- }
- for (byte i = 2; i < 6; i = (byte)(i + 1))
- {
- IGregTechTileEntity tTileEntity;
- if ((null != (tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(i, 2))) &&
- (tTileEntity.getFrontFacing() == getBaseMetaTileEntity().getFrontFacing()) && (tTileEntity.getMetaTileEntity() != null) &&
- ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_LargeTurbine))) {
- return false;
- }
- }
- int tX = getBaseMetaTileEntity().getXCoord();int tY = getBaseMetaTileEntity().getYCoord();int tZ = getBaseMetaTileEntity().getZCoord();
- for (byte i = -1; i < 2; i = (byte)(i + 1)) {
- for (byte j = -1; j < 2; j = (byte)(j + 1)) {
- if ((i != 0) || (j != 0)) {
- for (byte k = 0; k < 4; k = (byte)(k + 1)) {
- if (((i == 0) || (j == 0)) && ((k == 1) || (k == 2)))
- {
- if (getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingBlock() && getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingMeta())
- {}else if (!addToMachineList(getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)))) {
- return false;
- }
- }
- else if (getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingBlock()&& getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == getCasingMeta())
- {}else {return false;
- }
- }
- }
- }
- }
- this.mDynamoHatches.clear();
- IGregTechTileEntity tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 3);
- if ((tTileEntity != null) && (tTileEntity.getMetaTileEntity() != null)) {
- if ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Dynamo)) {
- this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo)tTileEntity.getMetaTileEntity());
- ((GT_MetaTileEntity_Hatch)tTileEntity.getMetaTileEntity()).mMachineBlock = getCasingTextureIndex();
- } else {
- return false;
- }
- }
- }
- else
- {
- return false;
- }
- return true;
- }
-
- public abstract Block getCasingBlock();
-
- public abstract byte getCasingMeta();
-
- public abstract byte getCasingTextureIndex();
-
- private boolean addToMachineList(IGregTechTileEntity tTileEntity){
- return ((addMaintenanceToMachineList(tTileEntity, getCasingTextureIndex())) || (addInputToMachineList(tTileEntity, getCasingTextureIndex())) || (addOutputToMachineList(tTileEntity, getCasingTextureIndex()))|| (addMufflerToMachineList(tTileEntity, getCasingTextureIndex())));
- }
-
-
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- }
-
- @Override
- public boolean checkRecipe(ItemStack aStack) {
- ArrayList<FluidStack> tFluids = getStoredFluids();
- if (tFluids.size() > 0) {
- if (baseEff == 0 || optFlow == 0 || counter >= 1000 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()
- || this.getBaseMetaTileEntity().hasInventoryBeenModified()) {
- counter = 0;
- baseEff = (int) ((50.0F
- + (10.0F * ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack))) * 100);
- optFlow = (int) Math.max(Float.MIN_NORMAL,
- ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack).getSpeedMultiplier()
- * ((GT_MetaGenerated_Tool) aStack.getItem()).getPrimaryMaterial(aStack).mToolSpeed
- * 50);
- } else {
- counter++;
- }
- }
-
- int newPower = fluidIntoPower(tFluids, optFlow, baseEff); // How much the turbine should be producing with this flow
- int difference = newPower - this.mEUt; // difference between current output and new output
-
- // Magic numbers: can always change by at least 10 eu/t, but otherwise by at most 1 percent of the difference in power level (per tick)
- // This is how much the turbine can actually change during this tick
- int maxChangeAllowed = Math.max(10, (int) Math.ceil(Math.abs(difference) * 0.01));
-
- if (Math.abs(difference) > maxChangeAllowed) { // If this difference is too big, use the maximum allowed change
- int change = maxChangeAllowed * (difference > 0 ? 1 : -1); // Make the change positive or negative.
- this.mEUt += change; // Apply the change
- }
- else
- this.mEUt = newPower;
-
- if (mEUt <= 0) {
-
// this.mEfficiencyIncrease = (-10);
- this.mEfficiency = 0;
- //stopMachine();
- return false;
- } else {
- this.mMaxProgresstime = 1;
- this.mEfficiencyIncrease = (10);
- return true;
- }
- }
-
- abstract int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff);
-
- @Override
- public int getDamageToComponent(ItemStack aStack) {
- return 1;
- }
-
- public int getMaxEfficiency(ItemStack aStack)
- {
- if (GT_Utility.isStackInvalid(aStack)) {
- return 0;
- }
- if (aStack.getItem() instanceof GT_MetaGenerated_Tool_01) {
- return 10000;
- }
- return 0;
- }
-
- @Override
- public int getAmountOfOutputs() {return 0;}
- @Override
- public boolean explodesOnComponentBreak(ItemStack aStack) {return true;}
+ this.mEfficiency = 0;
+ //stopMachine();
+ return false;
+ } else {
+ this.mMaxProgresstime = 1;
+ this.mEfficiencyIncrease = (10);
+ return true;
+ }
+ }
+
+ abstract int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff);
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 1;
+ }
+
+ public int getMaxEfficiency(ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack)) {
+ return 0;
+ }
+ if (aStack.getItem() instanceof GT_MetaGenerated_Tool_01) {
+ return 10000;
+ }
+ return 0;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 0;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return true;
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java
index 2f750ab914..0fa94f008a 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java
@@ -1,73 +1,83 @@
package gregtech.common.tileentities.machines.multi;
-import java.util.ArrayList;
-import java.util.Collection;
-
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidStack;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.items.GT_MetaGenerated_Tool;
import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeTurbine {
+
+ public GT_MetaTileEntity_LargeTurbine_Gas(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_LargeTurbine_Gas(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]};
+ }
-public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeTurbine{
-
- public GT_MetaTileEntity_LargeTurbine_Gas(int aID, String aName, String aNameRegional){super(aID, aName, aNameRegional);}
- public GT_MetaTileEntity_LargeTurbine_Gas(String aName){super(aName);}
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex+1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5):new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]};
- }
-
-
- public String[] getDescription()
- {
- return new String[] {
- "Controller Block for the Large Gas Turbine",
- "Size: 3x3x4 (Hollow)", "Controller (front centered)",
- "1x Input Hatch (side centered)",
- "1x Dynamo Hatch (back centered)",
- "1x Maintenance Hatch (side centered)",
- "1x Muffler Hatch (side centered)",
- "Turbine Casings for the rest (24 at least!)",
- "Needs a Turbine Item (inside controller GUI)"};
- }
-
- public int getFuelValue(FluidStack aLiquid) {
- if (aLiquid == null || GT_Recipe_Map.sTurbineFuels == null) return 0;
- FluidStack tLiquid;
- Collection<GT_Recipe> tRecipeList = GT_Recipe_Map.sTurbineFuels.mRecipeList;
- if (tRecipeList != null) for (GT_Recipe tFuel : tRecipeList) if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null) if (aLiquid.isFluidEqual(tLiquid)) return tFuel.mSpecialValue;
- return 0;
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {return new GT_MetaTileEntity_LargeTurbine_Gas(mName);}
- @Override
- public Block getCasingBlock() {
- return GregTech_API.sBlockCasings4;
- }
- @Override
- public byte getCasingMeta() {
- return 9;
- }
- @Override
- public byte getCasingTextureIndex() {
- return 46;
- }
- @Override
- public int getPollutionPerTick(ItemStack aStack) {
- return 10;
- }
+
+ public String[] getDescription() {
+ return new String[]{
+ "Controller Block for the Large Gas Turbine",
+ "Size: 3x3x4 (Hollow)", "Controller (front centered)",
+ "1x Input Hatch (side centered)",
+ "1x Dynamo Hatch (back centered)",
+ "1x Maintenance Hatch (side centered)",
+ "1x Muffler Hatch (side centered)",
+ "Turbine Casings for the rest (24 at least!)",
+ "Needs a Turbine Item (inside controller GUI)"};
+ }
+
+ public int getFuelValue(FluidStack aLiquid) {
+ if (aLiquid == null || GT_Recipe_Map.sTurbineFuels == null) return 0;
+ FluidStack tLiquid;
+ Collection<GT_Recipe> tRecipeList = GT_Recipe_Map.sTurbineFuels.mRecipeList;
+ if (tRecipeList != null) for (GT_Recipe tFuel : tRecipeList)
+ if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null)
+ if (aLiquid.isFluidEqual(tLiquid)) return tFuel.mSpecialValue;
+ return 0;
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_LargeTurbine_Gas(mName);
+ }
+
+ @Override
+ public Block getCasingBlock() {
+ return GregTech_API.sBlockCasings4;
+ }
+
+ @Override
+ public byte getCasingMeta() {
+ return 9;
+ }
+
+ @Override
+ public byte getCasingTextureIndex() {
+ return 46;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 10;
+ }
@Override
int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) {
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java
index bbf4df7c32..03f8501527 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java
@@ -1,63 +1,72 @@
package gregtech.common.tileentities.machines.multi;
-import java.util.ArrayList;
-
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidStack;
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.items.GT_MetaGenerated_Tool;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+
+import java.util.ArrayList;
+
+public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_LargeTurbine {
+
+ public boolean achievement = false;
+
+ public GT_MetaTileEntity_LargeTurbine_HPSteam(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_LargeTurbine_HPSteam(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]};
+ }
+
+ public String[] getDescription() {
+ return new String[]{
+ "Controller Block for the Large High Pressure Steam Turbine",
+ "Size: 3x3x4 (Hollow)", "Controller (front centered)",
+ "1x Input Hatch (side centered)", "1x Output Hatch(side centered)",
+ "1x Dynamo Hatch (back centered)",
+ "1x Maintenance Hatch (side centered)",
+ "Turbine Casings for the rest (24 at least!)",
+ "Needs a Turbine Item (inside controller GUI)"};
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_LargeTurbine_HPSteam(mName);
+ }
+
+ @Override
+ public Block getCasingBlock() {
+ return GregTech_API.sBlockCasings4;
+ }
+
+ @Override
+ public byte getCasingMeta() {
+ return 9;
+ }
+
+ @Override
+ public byte getCasingTextureIndex() {
+ return 46;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
-public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_LargeTurbine{
-
- public GT_MetaTileEntity_LargeTurbine_HPSteam(int aID, String aName, String aNameRegional){super(aID, aName, aNameRegional);}
- public GT_MetaTileEntity_LargeTurbine_HPSteam(String aName){super(aName);}
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex+1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5):new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]};
- }
-
-
- public String[] getDescription()
- {
- return new String[] {
- "Controller Block for the Large High Pressure Steam Turbine",
- "Size: 3x3x4 (Hollow)", "Controller (front centered)",
- "1x Input Hatch (side centered)", "1x Output Hatch(side centered)",
- "1x Dynamo Hatch (back centered)",
- "1x Maintenance Hatch (side centered)",
- "Turbine Casings for the rest (24 at least!)",
- "Needs a Turbine Item (inside controller GUI)" };
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {return new GT_MetaTileEntity_LargeTurbine_HPSteam(mName);}
- @Override
- public Block getCasingBlock() {
- return GregTech_API.sBlockCasings4;
- }
- @Override
- public byte getCasingMeta() {
- return 9;
- }
- @Override
- public byte getCasingTextureIndex() {
- return 46;
- }
- @Override
- public int getPollutionPerTick(ItemStack aStack) {
- return 0;
- }
- public boolean achievement=false;
-
@Override
int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) {
int tEU = 0;
@@ -72,13 +81,16 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La
depleteInput(new FluidStack(aFluids.get(i), flow)); // deplete that amount
remainingFlow -= flow; // track amount we're allowed to keep depleting from hatches
totalFlow += flow; // track total used
- if(!achievement){
- try{GT_Mod.instance.achievements.issueAchievement(this.getBaseMetaTileEntity().getWorld().getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "efficientsteam");}catch(Exception e){}
- achievement=true;
- }
+ if (!achievement) {
+ try {
+ GT_Mod.instance.achievements.issueAchievement(this.getBaseMetaTileEntity().getWorld().getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "efficientsteam");
+ } catch (Exception e) {
+ }
+ achievement = true;
+ }
}
}
-
+
tEU = (int) (Math.min((float) aOptFlow, totalFlow));
addOutput(GT_ModHandler.getSteam(totalFlow));
if (totalFlow > 0 && totalFlow != aOptFlow) {
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java
index bab1efcd54..ace7524606 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java
@@ -1,73 +1,83 @@
package gregtech.common.tileentities.machines.multi;
-import java.util.ArrayList;
-import java.util.Collection;
-
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidStack;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.items.GT_MetaGenerated_Tool;
import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_LargeTurbine {
+
+ public GT_MetaTileEntity_LargeTurbine_Plasma(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_LargeTurbine_Plasma(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]};
+ }
+
+
+ public String[] getDescription() {
+ return new String[]{
+ "Controller Block for the Large Plasma Generator",
+ "Size: 3x3x4 (Hollow)", "Controller (front centered)",
+ "1x Input Hatch (side centered)",
+ "1x Dynamo Hatch (back centered)",
+ "1x Maintenance Hatch (side centered)",
+ "Turbine Casings for the rest (24 at least!)",
+ "Needs a Turbine Item (inside controller GUI)"};
+ }
+
+ public int getFuelValue(FluidStack aLiquid) {
+ if (aLiquid == null || GT_Recipe_Map.sTurbineFuels == null) return 0;
+ FluidStack tLiquid;
+ Collection<GT_Recipe> tRecipeList = GT_Recipe_Map.sPlasmaFuels.mRecipeList;
+ if (tRecipeList != null) for (GT_Recipe tFuel : tRecipeList)
+ if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null)
+ if (aLiquid.isFluidEqual(tLiquid)) return tFuel.mSpecialValue;
+ return 0;
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_LargeTurbine_Plasma(mName);
+ }
+
+ @Override
+ public Block getCasingBlock() {
+ return GregTech_API.sBlockCasings4;
+ }
+
+ @Override
+ public byte getCasingMeta() {
+ return 9;
+ }
+
+ @Override
+ public byte getCasingTextureIndex() {
+ return 46;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
-public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_LargeTurbine{
-
- public GT_MetaTileEntity_LargeTurbine_Plasma(int aID, String aName, String aNameRegional){super(aID, aName, aNameRegional);}
- public GT_MetaTileEntity_LargeTurbine_Plasma(String aName){super(aName);}
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex+1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5):new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]};
- }
-
-
- public String[] getDescription()
- {
- return new String[] {
- "Controller Block for the Large Plasma Generator",
- "Size: 3x3x4 (Hollow)", "Controller (front centered)",
- "1x Input Hatch (side centered)",
- "1x Dynamo Hatch (back centered)",
- "1x Maintenance Hatch (side centered)",
- "Turbine Casings for the rest (24 at least!)",
- "Needs a Turbine Item (inside controller GUI)" };
- }
-
- public int getFuelValue(FluidStack aLiquid) {
- if (aLiquid == null || GT_Recipe_Map.sTurbineFuels == null) return 0;
- FluidStack tLiquid;
- Collection<GT_Recipe> tRecipeList = GT_Recipe_Map.sPlasmaFuels.mRecipeList;
- if (tRecipeList != null) for (GT_Recipe tFuel : tRecipeList) if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null) if (aLiquid.isFluidEqual(tLiquid)) return tFuel.mSpecialValue;
- return 0;
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {return new GT_MetaTileEntity_LargeTurbine_Plasma(mName);}
- @Override
- public Block getCasingBlock() {
- return GregTech_API.sBlockCasings4;
- }
- @Override
- public byte getCasingMeta() {
- return 9;
- }
- @Override
- public byte getCasingTextureIndex() {
- return 46;
- }
- @Override
- public int getPollutionPerTick(ItemStack aStack) {
- return 0;
- }
-
@Override
int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) {
@@ -79,7 +89,7 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar
if (aFluids.size() >= 1) {
FluidStack firstFuelType = new FluidStack(aFluids.get(0), 0); // Identify a SINGLE type of fluid to process. Doesn't matter which one. Ignore the rest!
int fuelValue = getFuelValue(firstFuelType);
- actualOptimalFlow = (int) ((aOptFlow + fuelValue -1 )/ fuelValue);
+ actualOptimalFlow = (int) ((aOptFlow + fuelValue - 1) / fuelValue);
int remainingFlow = (int) (actualOptimalFlow * 1.25f); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios.
int flow = 0;
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java
index d49c5a67f8..b697ad8205 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java
@@ -1,72 +1,81 @@
package gregtech.common.tileentities.machines.multi;
-import java.util.ArrayList;
-
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidStack;
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.items.GT_MetaGenerated_Tool;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+
+import java.util.ArrayList;
+
+public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_LargeTurbine {
+
+ private float water;
+ private boolean achievement = false;
+
+ public GT_MetaTileEntity_LargeTurbine_Steam(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+
+ public GT_MetaTileEntity_LargeTurbine_Steam(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]};
+ }
+
+ public String[] getDescription() {
+ return new String[]{
+ "Controller Block for the Large Steam Turbine",
+ "Size: 3x3x4 (Hollow)", "Controller (front centered)",
+ "1x Input Hatch (side centered)", "1x Output Hatch(side centered)",
+ "1x Dynamo Hatch (back centered)",
+ "1x Maintenance Hatch (side centered)",
+ "Turbine Casings for the rest (24 at least!)",
+ "Needs a Turbine Item (inside controller GUI)"};
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_LargeTurbine_Steam(mName);
+ }
+
+ @Override
+ public Block getCasingBlock() {
+ return GregTech_API.sBlockCasings4;
+ }
+
+ @Override
+ public byte getCasingMeta() {
+ return 9;
+ }
+
+ @Override
+ public byte getCasingTextureIndex() {
+ return 46;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
+
+ private int useWater(float input) {
+ water = water + input;
+ int usage = (int) water;
+ water = water - (int) usage;
+ return usage;
+ }
-public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_LargeTurbine{
-
- public GT_MetaTileEntity_LargeTurbine_Steam(int aID, String aName, String aNameRegional){super(aID, aName, aNameRegional);}
- public GT_MetaTileEntity_LargeTurbine_Steam(String aName){super(aName);}
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex+1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5):new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]};
- }
-
-
- public String[] getDescription()
- {
- return new String[] {
- "Controller Block for the Large Steam Turbine",
- "Size: 3x3x4 (Hollow)", "Controller (front centered)",
- "1x Input Hatch (side centered)", "1x Output Hatch(side centered)",
- "1x Dynamo Hatch (back centered)",
- "1x Maintenance Hatch (side centered)",
- "Turbine Casings for the rest (24 at least!)",
- "Needs a Turbine Item (inside controller GUI)" };
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {return new GT_MetaTileEntity_LargeTurbine_Steam(mName);}
- @Override
- public Block getCasingBlock() {
- return GregTech_API.sBlockCasings4;
- }
- @Override
- public byte getCasingMeta() {
- return 9;
- }
- @Override
- public byte getCasingTextureIndex() {
- return 46;
- }
- @Override
- public int getPollutionPerTick(ItemStack aStack) {
- return 0;
- }
-
- private float water;
- private int useWater(float input){
- water = water + input;
- int usage = (int)water;
- water = water - (int)usage;
- return usage;
- }
-
- private boolean achievement = false;
-
@Override
int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) {
int tEU = 0;
@@ -75,17 +84,20 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg
int remainingFlow = (int) (aOptFlow * 1.25f); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios.
for (int i = 0; i < aFluids.size() && remainingFlow > 0; i++) { // loop through each hatch; extract inputs and track totals.
- String fluidName = aFluids.get(i).getFluid().getUnlocalizedName(aFluids.get(i));
- if (fluidName.equals("fluid.steam") || fluidName.equals("ic2.fluidSteam") || fluidName.equals("fluid.mfr.steam.still.name")) {
- flow = aFluids.get(i).amount; // Get all (steam) in hatch
+ String fluidName = aFluids.get(i).getFluid().getUnlocalizedName(aFluids.get(i));
+ if (fluidName.equals("fluid.steam") || fluidName.equals("ic2.fluidSteam") || fluidName.equals("fluid.mfr.steam.still.name")) {
+ flow = aFluids.get(i).amount; // Get all (steam) in hatch
flow = Math.min(flow, Math.min(remainingFlow, (int) (aOptFlow * 1.25f))); // try to use up to 125% of optimal flow w/o exceeding remainingFlow
depleteInput(new FluidStack(aFluids.get(i), flow)); // deplete that amount
remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches
totalFlow += flow; // track total input used
- if(!achievement){
- try{GT_Mod.instance.achievements.issueAchievement(this.getBaseMetaTileEntity().getWorld().getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "muchsteam");}catch(Exception e){}
- achievement=true;
- }
+ if (!achievement) {
+ try {
+ GT_Mod.instance.achievements.issueAchievement(this.getBaseMetaTileEntity().getWorld().getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "muchsteam");
+ } catch (Exception e) {
+ }
+ achievement = true;
+ }
}
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java
index fc2a8a908b..77698c078c 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java
@@ -2,7 +2,6 @@ package gregtech.common.tileentities.machines.multi;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.gui.GT_GUIContainer_MultiMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -11,179 +10,158 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockB
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
-
-import java.util.ArrayList;
-
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
+import java.util.ArrayList;
+
public class GT_MetaTileEntity_MultiFurnace
- extends GT_MetaTileEntity_MultiBlockBase
-{
- private int mLevel = 0;
-
- public GT_MetaTileEntity_MultiFurnace(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_MultiFurnace(String aName)
- {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_MultiFurnace(this.mName);
- }
-
- public String[] getDescription()
- {
- return new String[] { "Smelts up to 6-18 Items at once", "Controller Block for the Multi Smelter", "Size: 3x3x3 (Hollow)", "Controller (front middle at bottom)", "8x Heating Coils (middle Layer, hollow)", "1x Input (one of bottom)", "1x Output (one of bottom)", "1x Energy Hatch (one of bottom)", "1x Maintenance Hatch (one of bottom)", "1x Muffler Hatch (top middle)", "Heat Proof Machine Casings for the rest" };
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
- {
- if (aSide == aFacing) {
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[11], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER) };
- }
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[11] };
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MultiFurnace.png");
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipeMap()
- {
- return GT_Recipe.GT_Recipe_Map.sFurnaceRecipes;
- }
-
- public boolean isCorrectMachinePart(ItemStack aStack)
- {
- return true;
- }
-
- public boolean isFacingValid(byte aFacing)
- {
- return aFacing > 1;
- }
-
- public boolean checkRecipe(ItemStack aStack)
- {
- ArrayList<ItemStack> tInputList = getStoredInputs();
- if (!tInputList.isEmpty())
- {
- byte tTier = (byte)Math.max(1, GT_Utility.getTier(getMaxInputVoltage()));
-
- int j = 0;
- this.mOutputItems = new ItemStack[6 * this.mLevel];
- for (int i = 0; (i < 100) && (j < this.mOutputItems.length); i++) {
- if (null != (this.mOutputItems[j] = GT_ModHandler.getSmeltingOutput((ItemStack)tInputList.get(i % tInputList.size()), true, null))) {
- j++;
+ extends GT_MetaTileEntity_MultiBlockBase {
+ private int mLevel = 0;
+
+ public GT_MetaTileEntity_MultiFurnace(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_MultiFurnace(String aName) {
+ super(aName);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_MultiFurnace(this.mName);
+ }
+
+ public String[] getDescription() {
+ return new String[]{"Smelts up to 6-18 Items at once", "Controller Block for the Multi Smelter", "Size: 3x3x3 (Hollow)", "Controller (front middle at bottom)", "8x Heating Coils (middle Layer, hollow)", "1x Input (one of bottom)", "1x Output (one of bottom)", "1x Energy Hatch (one of bottom)", "1x Maintenance Hatch (one of bottom)", "1x Muffler Hatch (top middle)", "Heat Proof Machine Casings for the rest"};
+ }
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[11], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER)};
}
- }
- if (j > 0)
- {
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
-
- this.mEUt = (-4 * (1 << tTier - 1) * (1 << tTier - 1) * this.mLevel);
- this.mMaxProgresstime = Math.max(1, 512 / (1 << tTier - 1));
- }
- updateSlots();
- return true;
- }
- return false;
- }
-
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack)
- {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
-
- this.mLevel = 0;
- if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) {
- return false;
- }
- addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 2, zDir), 11);
-
- byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 1, zDir);
- switch (tUsedMeta)
- {
- case 12:
- this.mLevel = 1; break;
- case 13:
- this.mLevel = 2; break;
- case 14:
- this.mLevel = 3; break;
- default:
- return false;
- }
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- if ((i != 0) || (j != 0))
- {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != GregTech_API.sBlockCasings1) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != tUsedMeta) {
- return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != GregTech_API.sBlockCasings1) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) != 11) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[11]};
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MultiFurnace.png");
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sFurnaceRecipes;
+ }
+
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ public boolean checkRecipe(ItemStack aStack) {
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ if (!tInputList.isEmpty()) {
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(getMaxInputVoltage()));
+
+ int j = 0;
+ this.mOutputItems = new ItemStack[6 * this.mLevel];
+ for (int i = 0; (i < 100) && (j < this.mOutputItems.length); i++) {
+ if (null != (this.mOutputItems[j] = GT_ModHandler.getSmeltingOutput((ItemStack) tInputList.get(i % tInputList.size()), true, null))) {
+ j++;
+ }
+ }
+ if (j > 0) {
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ this.mEUt = (-4 * (1 << tTier - 1) * (1 << tTier - 1) * this.mLevel);
+ this.mMaxProgresstime = Math.max(1, 512 / (1 << tTier - 1));
+ }
+ updateSlots();
+ return true;
+ }
+ return false;
+ }
+
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+
+ this.mLevel = 0;
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) {
return false;
- }
}
- }
- }
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- if ((xDir + i != 0) || (zDir + j != 0))
- {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j);
- if ((!addMaintenanceToMachineList(tTileEntity, 11)) && (!addInputToMachineList(tTileEntity, 11)) && (!addOutputToMachineList(tTileEntity, 11)) && (!addEnergyInputToMachineList(tTileEntity, 11)))
- {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != GregTech_API.sBlockCasings1) {
- return false;
+ addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 2, zDir), 11);
+
+ byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 1, zDir);
+ switch (tUsedMeta) {
+ case 12:
+ this.mLevel = 1;
+ break;
+ case 13:
+ this.mLevel = 2;
+ break;
+ case 14:
+ this.mLevel = 3;
+ break;
+ default:
+ return false;
+ }
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if ((i != 0) || (j != 0)) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != GregTech_API.sBlockCasings1) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != tUsedMeta) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != GregTech_API.sBlockCasings1) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) != 11) {
+ return false;
+ }
+ }
}
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 11) {
- return false;
+ }
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if ((xDir + i != 0) || (zDir + j != 0)) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j);
+ if ((!addMaintenanceToMachineList(tTileEntity, 11)) && (!addInputToMachineList(tTileEntity, 11)) && (!addOutputToMachineList(tTileEntity, 11)) && (!addEnergyInputToMachineList(tTileEntity, 11))) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != GregTech_API.sBlockCasings1) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 11) {
+ return false;
+ }
+ }
+ }
}
- }
}
- }
- }
- return true;
- }
-
- public int getMaxEfficiency(ItemStack aStack)
- {
- return 10000;
- }
-
- public int getPollutionPerTick(ItemStack aStack)
- {
- return 20;
- }
-
- public int getDamageToComponent(ItemStack aStack)
- {
- return 0;
- }
-
- public int getAmountOfOutputs()
- {
- return 18;
- }
-
- public boolean explodesOnComponentBreak(ItemStack aStack)
- {
- return false;
- }
+ return true;
+ }
+
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 20;
+ }
+
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ public int getAmountOfOutputs() {
+ return 18;
+ }
+
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java
index 246ba2e716..5e7cc4937a 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java
@@ -1,10 +1,5 @@
package gregtech.common.tileentities.machines.multi;
-import java.util.ArrayList;
-
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
import gregtech.api.enums.Textures;
@@ -16,226 +11,233 @@ import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+
+import java.util.ArrayList;
public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_MultiBlockBase {
- public GT_MetaTileEntity_OilCracker(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_OilCracker(String aName) {
- super(aName);
- }
-
- public String[] getDescription() {
- return new String[] {
- "Controller Block for the Oil Cracking Unit",
- "Cracks heavy oil into lighter parts",
- "Size: 3 high, 3 deep, 5 wide",
- "Controller (front center)",
- "Made from Clean Stainless Steel Casings (18 at least!)",
- "On both sides of the Controller each",
- "a ring of 8 Cupronickel Coils",
- "2 Blocks left Input Hatch and 8 Casings",
- "2 Blocks right Output Hatch and 8 Casings",
- "beween coils: Controller, second input Hatch",
- "Maintainance Hatch and Energy Hatch"};
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- if (aSide == aFacing) {
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[49],
- new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER) };
- }
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[49] };
- }
-
- @Override
- public boolean checkRecipe(ItemStack aStack) {
- ArrayList<FluidStack> tInputList = getStoredFluids();
- for (FluidStack tInput : tInputList)
- {
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte)Math.max(1, GT_Utility.getTier(tVoltage));
-
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sCrakingRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[] { tInput }, new ItemStack[]{});
- if (tRecipe != null) {
- if (tRecipe.isRecipeInputEqual(true, new FluidStack[] { tInput }, new ItemStack[]{}))
- {
- boolean steam=false;boolean hydrogen = false;
- for(FluidStack tInput2: tInputList){
- if(tInput2.getFluid()==GT_ModHandler.getSteam(1).getFluid()){steam=true;tInput2.amount -=64;}
- if(tInput2.getFluid()==Materials.Hydrogen.mGas){hydrogen=true;steam=false;tInput2.amount -=64;}
-
- }
-
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
- if (tRecipe.mEUt <= 16)
- {
- this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
- }
- else
- {
- this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = tRecipe.mDuration;
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)])
- {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
- }
- }
- if(steam)this.mEUt = this.mEUt*66/100;
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- this.mOutputFluids = new FluidStack[] { tRecipe.getFluidOutput(0) };
- if(hydrogen)this.mOutputFluids[0].amount=this.mOutputFluids[0].amount*130/100;
- return true;
- }
- }
- }
- return false;
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
- int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
- int amount = 0;
- if(xDir!=0){
- for (int i = -1; i < 2; i++) {// xDirection
- for (int j = -1; j < 2; j++) {// height
- for (int h = -2; h < 3; h++) {
- if (!(j == 0 && i == 0 && (h == -1 || h == 0 || h == 1))) {
- if (h == 1 || h == -1) {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, j, h + zDir);
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, j, h + zDir) != GregTech_API.sBlockCasings1) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, j, h + zDir) != 12) {
- return false;
- }
- }
- if (h == 2||h==-2) {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, j, h + zDir);
- boolean tSide = ((aBaseMetaTileEntity.getBackFacing()==4&&2==h)||(aBaseMetaTileEntity.getBackFacing()==5&&-2==h));
- if ( tSide ? !addInputToMachineList(tTileEntity, 49) : !addOutputToMachineList(tTileEntity, 49)) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, j, h + zDir) != GregTech_API.sBlockCasings4) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, j, h + zDir) != 1) {
- return false;
- }
- amount++;
- }
- }
- if (h == 0) {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, j, h + zDir);
- if ((!addMaintenanceToMachineList(tTileEntity, 49)) && (!addInputToMachineList(tTileEntity, 49))
- && (!addEnergyInputToMachineList(tTileEntity, 49))) {
- if (!((xDir + i) == 0 && j == 0 && (h + zDir) == 0)) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, j, h + zDir) != GregTech_API.sBlockCasings4) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, j, h + zDir) != 1) {
- return false;
- }
- amount++;
- }
- }
- }
-
- }
- }
- }
- }
- }else{
- for (int i = -1; i < 2; i++) {// zDirection
- for (int j = -1; j < 2; j++) {// height
- for (int h = -2; h < 3; h++) {
- if (!(j == 0 && i == 0 && (h == -1 || h == 0 || h == 1))) {
- if (h == 1 || h == -1) {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + h, j, i + zDir);
- if (aBaseMetaTileEntity.getBlockOffset(xDir + h, j, i + zDir) != GregTech_API.sBlockCasings1) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + h, j, i + zDir) != 12) {
- return false;
- }
- }
- if (h == 2||h==-2) {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + h, j, i + zDir);
- boolean tSide = (aBaseMetaTileEntity.getBackFacing()==h||(aBaseMetaTileEntity.getBackFacing()==3&&-2==h));
- if ( tSide ? !addOutputToMachineList(tTileEntity, 49) : !addInputToMachineList(tTileEntity, 49)) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + h, j, i + zDir) != GregTech_API.sBlockCasings4) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + h, j, i + zDir) != 1) {
- return false;
- }
- amount++;
- }
- }
- if (h == 0) {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + h, j, i + zDir);
- if ((!addMaintenanceToMachineList(tTileEntity, 49)) && (!addInputToMachineList(tTileEntity, 49))
- && (!addEnergyInputToMachineList(tTileEntity, 49))) {
- if (!((xDir + h) == 0 && j == 0 && (i + zDir) == 0)) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + h, j, i + zDir) != GregTech_API.sBlockCasings4) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + h, j, i + zDir) != 1) {
- return false;
- }
- amount++;
- }
- }
- }
-
- }
- }
- }
- }
- }
- if(amount<19)return false;
- return true;
- }
-
- @Override
- public boolean isCorrectMachinePart(ItemStack aStack) {
- return true;
- }
-
- @Override
- public int getMaxEfficiency(ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerTick(ItemStack aStack) {
- return 0;
- }
-
- @Override
- public int getDamageToComponent(ItemStack aStack) {
- return 0;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 0;
- }
-
- @Override
- public boolean explodesOnComponentBreak(ItemStack aStack) {
- return false;
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_OilCracker(this.mName);
- }
+ public GT_MetaTileEntity_OilCracker(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_OilCracker(String aName) {
+ super(aName);
+ }
+
+ public String[] getDescription() {
+ return new String[]{
+ "Controller Block for the Oil Cracking Unit",
+ "Cracks heavy oil into lighter parts",
+ "Size: 3 high, 3 deep, 5 wide",
+ "Controller (front center)",
+ "Made from Clean Stainless Steel Casings (18 at least!)",
+ "On both sides of the Controller each",
+ "a ring of 8 Cupronickel Coils",
+ "2 Blocks left Input Hatch and 8 Casings",
+ "2 Blocks right Output Hatch and 8 Casings",
+ "beween coils: Controller, second input Hatch",
+ "Maintainance Hatch and Energy Hatch"};
+ }
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[49],
+ new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER)};
+ }
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[49]};
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ ArrayList<FluidStack> tInputList = getStoredFluids();
+ for (FluidStack tInput : tInputList) {
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sCrakingRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[]{tInput}, new ItemStack[]{});
+ if (tRecipe != null) {
+ if (tRecipe.isRecipeInputEqual(true, new FluidStack[]{tInput}, new ItemStack[]{})) {
+ boolean steam = false;
+ boolean hydrogen = false;
+ for (FluidStack tInput2 : tInputList) {
+ if (tInput2.getFluid() == GT_ModHandler.getSteam(1).getFluid()) {
+ steam = true;
+ tInput2.amount -= 64;
+ }
+ if (tInput2.getFluid() == Materials.Hydrogen.mGas) {
+ hydrogen = true;
+ steam = false;
+ tInput2.amount -= 64;
+ }
+
+ }
+
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ if (tRecipe.mEUt <= 16) {
+ this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
+ } else {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = tRecipe.mDuration;
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ if (steam) this.mEUt = this.mEUt * 66 / 100;
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)};
+ if (hydrogen) this.mOutputFluids[0].amount = this.mOutputFluids[0].amount * 130 / 100;
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ int amount = 0;
+ if (xDir != 0) {
+ for (int i = -1; i < 2; i++) {// xDirection
+ for (int j = -1; j < 2; j++) {// height
+ for (int h = -2; h < 3; h++) {
+ if (!(j == 0 && i == 0 && (h == -1 || h == 0 || h == 1))) {
+ if (h == 1 || h == -1) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, j, h + zDir);
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, j, h + zDir) != GregTech_API.sBlockCasings1) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, j, h + zDir) != 12) {
+ return false;
+ }
+ }
+ if (h == 2 || h == -2) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, j, h + zDir);
+ boolean tSide = ((aBaseMetaTileEntity.getBackFacing() == 4 && 2 == h) || (aBaseMetaTileEntity.getBackFacing() == 5 && -2 == h));
+ if (tSide ? !addInputToMachineList(tTileEntity, 49) : !addOutputToMachineList(tTileEntity, 49)) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, j, h + zDir) != GregTech_API.sBlockCasings4) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, j, h + zDir) != 1) {
+ return false;
+ }
+ amount++;
+ }
+ }
+ if (h == 0) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, j, h + zDir);
+ if ((!addMaintenanceToMachineList(tTileEntity, 49)) && (!addInputToMachineList(tTileEntity, 49))
+ && (!addEnergyInputToMachineList(tTileEntity, 49))) {
+ if (!((xDir + i) == 0 && j == 0 && (h + zDir) == 0)) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, j, h + zDir) != GregTech_API.sBlockCasings4) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, j, h + zDir) != 1) {
+ return false;
+ }
+ amount++;
+ }
+ }
+ }
+
+ }
+ }
+ }
+ }
+ } else {
+ for (int i = -1; i < 2; i++) {// zDirection
+ for (int j = -1; j < 2; j++) {// height
+ for (int h = -2; h < 3; h++) {
+ if (!(j == 0 && i == 0 && (h == -1 || h == 0 || h == 1))) {
+ if (h == 1 || h == -1) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + h, j, i + zDir);
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + h, j, i + zDir) != GregTech_API.sBlockCasings1) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + h, j, i + zDir) != 12) {
+ return false;
+ }
+ }
+ if (h == 2 || h == -2) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + h, j, i + zDir);
+ boolean tSide = (aBaseMetaTileEntity.getBackFacing() == h || (aBaseMetaTileEntity.getBackFacing() == 3 && -2 == h));
+ if (tSide ? !addOutputToMachineList(tTileEntity, 49) : !addInputToMachineList(tTileEntity, 49)) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + h, j, i + zDir) != GregTech_API.sBlockCasings4) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + h, j, i + zDir) != 1) {
+ return false;
+ }
+ amount++;
+ }
+ }
+ if (h == 0) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + h, j, i + zDir);
+ if ((!addMaintenanceToMachineList(tTileEntity, 49)) && (!addInputToMachineList(tTileEntity, 49))
+ && (!addEnergyInputToMachineList(tTileEntity, 49))) {
+ if (!((xDir + h) == 0 && j == 0 && (i + zDir) == 0)) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + h, j, i + zDir) != GregTech_API.sBlockCasings4) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + h, j, i + zDir) != 1) {
+ return false;
+ }
+ amount++;
+ }
+ }
+ }
+
+ }
+ }
+ }
+ }
+ }
+ if (amount < 19) return false;
+ return true;
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 0;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_OilCracker(this.mName);
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill.java
index 930ee98238..13dc671e01 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill.java
@@ -1,13 +1,5 @@
package gregtech.common.tileentities.machines.multi;
-import static gregtech.api.enums.GT_Values.V;
-
-import java.util.ArrayList;
-
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
@@ -17,192 +9,222 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockB
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
-public class GT_MetaTileEntity_OilDrill extends GT_MetaTileEntity_MultiBlockBase{
-
- public GT_MetaTileEntity_OilDrill(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_OilDrill(String aName)
- {
- super(aName);
- }
-
- public String[] getDescription()
- {
- return new String[] {
- "Controller Block for the Oil Drilling Rig",
- "Size: 3x7x3", "Controller (front middle at bottom)",
- "3x3 Base of Solid Steel Casings",
- "Also part of Base: Energy Input Hatch",
- "Fluid Output Hatch and Maintainance Hatch",
- "3x Solid Steel Casings on top the Center of the base",
- "Steel Frame Boxes on each side and 3 more on top"};
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
- {
- if (aSide == aFacing) {
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[16], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER) };
- }
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[16] };
- }
- private boolean completedCycle = false;
-
- @Override
- public boolean checkRecipe(ItemStack aStack) {
- if(mInventory[1]==null||(mInventory[1].isItemEqual(GT_ModHandler.getIC2Item("miningPipe", 1L)) && mInventory[1].stackSize<mInventory[1].getMaxStackSize())){
- ArrayList<ItemStack> tItems = getStoredInputs();
- for(ItemStack tStack : tItems){
- if(tStack.isItemEqual(GT_ModHandler.getIC2Item("miningPipe", 1L))){
- if(tStack.stackSize<2){
- tStack = null;
- }else{tStack.stackSize--;}
-
- }
- if(mInventory[1]==null){
- mInventory[1] = GT_ModHandler.getIC2Item("miningPipe", 1L);
- }else{
- mInventory[1].stackSize++;}
- }
- }
- FluidStack tFluid = GT_Utility.getUndergroundOil(getBaseMetaTileEntity().getWorld(), getBaseMetaTileEntity().getXCoord(), getBaseMetaTileEntity().getZCoord());
- if(tFluid==null){
- return false;
- }
- if(getBaseMetaTileEntity().getBlockOffset(ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX, getYOfPumpHead()-1-getBaseMetaTileEntity().getYCoord(), ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ)!=Blocks.bedrock){
- if(completedCycle){moveOneDown();}
- tFluid=null;
- if(mEnergyHatches.size()>0&&mEnergyHatches.get(0).getEUVar()>(512+getMaxInputVoltage()*4))completedCycle=true;
- }else if(tFluid.amount<5000){
- return false;
- }else{tFluid.amount = tFluid.amount/5000;}
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte)Math.max(1, GT_Utility.getTier(tVoltage));
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+import java.util.ArrayList;
+
+public class GT_MetaTileEntity_OilDrill extends GT_MetaTileEntity_MultiBlockBase {
+
+ private boolean completedCycle = false;
+
+ public GT_MetaTileEntity_OilDrill(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_OilDrill(String aName) {
+ super(aName);
+ }
+
+ public String[] getDescription() {
+ return new String[]{
+ "Controller Block for the Oil Drilling Rig",
+ "Size: 3x7x3", "Controller (front middle at bottom)",
+ "3x3 Base of Solid Steel Casings",
+ "Also part of Base: Energy Input Hatch",
+ "Fluid Output Hatch and Maintainance Hatch",
+ "3x Solid Steel Casings on top the Center of the base",
+ "Steel Frame Boxes on each side and 3 more on top"};
+ }
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[16], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER)};
+ }
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[16]};
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ if (mInventory[1] == null || (mInventory[1].isItemEqual(GT_ModHandler.getIC2Item("miningPipe", 1L)) && mInventory[1].stackSize < mInventory[1].getMaxStackSize())) {
+ ArrayList<ItemStack> tItems = getStoredInputs();
+ for (ItemStack tStack : tItems) {
+ if (tStack.isItemEqual(GT_ModHandler.getIC2Item("miningPipe", 1L))) {
+ if (tStack.stackSize < 2) {
+ tStack = null;
+ } else {
+ tStack.stackSize--;
+ }
+
+ }
+ if (mInventory[1] == null) {
+ mInventory[1] = GT_ModHandler.getIC2Item("miningPipe", 1L);
+ } else {
+ mInventory[1].stackSize++;
+ }
+ }
+ }
+ FluidStack tFluid = GT_Utility.getUndergroundOil(getBaseMetaTileEntity().getWorld(), getBaseMetaTileEntity().getXCoord(), getBaseMetaTileEntity().getZCoord());
+ if (tFluid == null) {
+ return false;
+ }
+ if (getBaseMetaTileEntity().getBlockOffset(ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX, getYOfPumpHead() - 1 - getBaseMetaTileEntity().getYCoord(), ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ) != Blocks.bedrock) {
+ if (completedCycle) {
+ moveOneDown();
+ }
+ tFluid = null;
+ if (mEnergyHatches.size() > 0 && mEnergyHatches.get(0).getEUVar() > (512 + getMaxInputVoltage() * 4))
+ completedCycle = true;
+ } else if (tFluid.amount < 5000) {
+ return false;
+ } else {
+ tFluid.amount = tFluid.amount / 5000;
+ }
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
this.mEfficiencyIncrease = 10000;
int tEU = 24;
int tDuration = 160;
- if (tEU <= 16)
- {
- this.mEUt = (tEU * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (tDuration / (1 << tTier - 1));
- }
- else
- {
- this.mEUt = tEU;
- this.mMaxProgresstime = tDuration;
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)])
- {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
- }
+ if (tEU <= 16) {
+ this.mEUt = (tEU * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (tDuration / (1 << tTier - 1));
+ } else {
+ this.mEUt = tEU;
+ this.mMaxProgresstime = tDuration;
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
}
if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
+ this.mEUt = (-this.mEUt);
}
this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- this.mOutputFluids = new FluidStack[] { tFluid };
- return true;
- }
-
- private boolean moveOneDown() {
- if ((this.mInventory[1] == null) || (this.mInventory[1].stackSize < 1)
- || (!GT_Utility.areStacksEqual(this.mInventory[1], GT_ModHandler.getIC2Item("miningPipe", 1L)))) {
- return false;
- }
- int xDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ;
- int yHead = getYOfPumpHead();
- if (yHead <= 0) {
- return false;
- }
- if(getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord()+xDir, yHead-1, getBaseMetaTileEntity().getZCoord()+zDir) == Blocks.bedrock){
- return false;
- }
- if (!(getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord()+xDir, yHead - 1, getBaseMetaTileEntity().getZCoord()+zDir,GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))))) {
- return false;
- }
- if (yHead != getBaseMetaTileEntity().getYCoord()) {
- getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord()+xDir, yHead, getBaseMetaTileEntity().getZCoord()+zDir,GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L)));
- }
- getBaseMetaTileEntity().decrStackSize(1, 1);
- return true;
- }
-
- private int getYOfPumpHead() {
- int xDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ;
- int y = getBaseMetaTileEntity().getYCoord() - 1;
- while (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord()+xDir, y, getBaseMetaTileEntity().getZCoord()+zDir) == GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L))) {
- y--;
- }
- if (y == getBaseMetaTileEntity().getYCoord() - 1) {
- if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord()+xDir, y, getBaseMetaTileEntity().getZCoord()+zDir) != GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))) {
- return y + 1;
- }
- } else if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord()+xDir, y, getBaseMetaTileEntity().getZCoord()+zDir) != GT_Utility
- .getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))&&this.mInventory[1] != null&&this.mInventory[1].stackSize>0&&GT_Utility.areStacksEqual(this.mInventory[1], GT_ModHandler.getIC2Item("miningPipe", 1L))) {
- getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord()+xDir, y, getBaseMetaTileEntity().getZCoord()+zDir,
- GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L)));
- getBaseMetaTileEntity().decrStackSize(0, 1);
- }
- return y;
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity,ItemStack aStack) {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- if ((xDir + i != 0) || (zDir + j != 0))
- {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j);
- if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16)) && (!addOutputToMachineList(tTileEntity, 16)) && (!addEnergyInputToMachineList(tTileEntity, 16)))
- {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != GregTech_API.sBlockCasings2) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 0) {
- return false;
- }
- }
- }
- }
- }
- for(int y=1;y<4;y++){
- if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir) != GregTech_API.sBlockCasings2) {
- return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir+1, y, zDir) != GregTech_API.sBlockMachines) {
- return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir-1, y, zDir) != GregTech_API.sBlockMachines) {
- return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir+1) != GregTech_API.sBlockMachines) {
- return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir-1) != GregTech_API.sBlockMachines) {
- return false;
- }
- if (aBaseMetaTileEntity.getBlockOffset(xDir, y+3, zDir) != GregTech_API.sBlockMachines) {
- return false;
- }
- }
- return true;
- }
-
- @Override public boolean isCorrectMachinePart(ItemStack aStack) {return true; }
- @Override public int getMaxEfficiency(ItemStack aStack) {return 10000;}
- @Override public int getPollutionPerTick(ItemStack aStack) {return 0; }
- @Override public int getDamageToComponent(ItemStack aStack) {return 0;}
- @Override public int getAmountOfOutputs() {return 0;}
- @Override public boolean explodesOnComponentBreak(ItemStack aStack) {return false;}
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_OilDrill(this.mName);
- }
+ this.mOutputFluids = new FluidStack[]{tFluid};
+ return true;
+ }
+
+ private boolean moveOneDown() {
+ if ((this.mInventory[1] == null) || (this.mInventory[1].stackSize < 1)
+ || (!GT_Utility.areStacksEqual(this.mInventory[1], GT_ModHandler.getIC2Item("miningPipe", 1L)))) {
+ return false;
+ }
+ int xDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ;
+ int yHead = getYOfPumpHead();
+ if (yHead <= 0) {
+ return false;
+ }
+ if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord() + xDir, yHead - 1, getBaseMetaTileEntity().getZCoord() + zDir) == Blocks.bedrock) {
+ return false;
+ }
+ if (!(getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord() + xDir, yHead - 1, getBaseMetaTileEntity().getZCoord() + zDir, GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))))) {
+ return false;
+ }
+ if (yHead != getBaseMetaTileEntity().getYCoord()) {
+ getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord() + xDir, yHead, getBaseMetaTileEntity().getZCoord() + zDir, GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L)));
+ }
+ getBaseMetaTileEntity().decrStackSize(1, 1);
+ return true;
+ }
+
+ private int getYOfPumpHead() {
+ int xDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ;
+ int y = getBaseMetaTileEntity().getYCoord() - 1;
+ while (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord() + xDir, y, getBaseMetaTileEntity().getZCoord() + zDir) == GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L))) {
+ y--;
+ }
+ if (y == getBaseMetaTileEntity().getYCoord() - 1) {
+ if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord() + xDir, y, getBaseMetaTileEntity().getZCoord() + zDir) != GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))) {
+ return y + 1;
+ }
+ } else if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord() + xDir, y, getBaseMetaTileEntity().getZCoord() + zDir) != GT_Utility
+ .getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L)) && this.mInventory[1] != null && this.mInventory[1].stackSize > 0 && GT_Utility.areStacksEqual(this.mInventory[1], GT_ModHandler.getIC2Item("miningPipe", 1L))) {
+ getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord() + xDir, y, getBaseMetaTileEntity().getZCoord() + zDir,
+ GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L)));
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ }
+ return y;
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if ((xDir + i != 0) || (zDir + j != 0)) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j);
+ if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16)) && (!addOutputToMachineList(tTileEntity, 16)) && (!addEnergyInputToMachineList(tTileEntity, 16))) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != GregTech_API.sBlockCasings2) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 0) {
+ return false;
+ }
+ }
+ }
+ }
+ }
+ for (int y = 1; y < 4; y++) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir) != GregTech_API.sBlockCasings2) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + 1, y, zDir) != GregTech_API.sBlockMachines) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getBlockOffset(xDir - 1, y, zDir) != GregTech_API.sBlockMachines) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir + 1) != GregTech_API.sBlockMachines) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir - 1) != GregTech_API.sBlockMachines) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getBlockOffset(xDir, y + 3, zDir) != GregTech_API.sBlockMachines) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 0;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_OilDrill(this.mName);
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java
index 4e6c1a2e24..81259fbef8 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java
@@ -1,296 +1,311 @@
package gregtech.common.tileentities.machines.multi;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.commons.lang3.ArrayUtils;
-
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
import gregtech.api.gui.GT_GUIContainer_MultiMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_GT_Recipe;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+import org.apache.commons.lang3.ArrayUtils;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBlockBase {
+
+ GT_Recipe mLastRecipe;
+
+ public GT_MetaTileEntity_ProcessingArray(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_ProcessingArray(String aName) {
+ super(aName);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_ProcessingArray(this.mName);
+ }
+
+ public String[] getDescription() {
+ return new String[]{"Controller Block for the Processing Array",
+ "Size: 3x3x3 (Hollow)",
+ "Controller (front centered)",
+ "1x Input (anywhere)",
+ "1x Output (anywhere)",
+ "1x Energy Hatch (anywhere)",
+ "1x Maintenance Hatch (anywhere)",
+ "Robust Tungstensteel Casings for the rest (16 at least!)",
+ "Place up to 16 Single Block GT Machines into the GUI Inventory",
+ "They will work the same way as placed directly in world"};
+ }
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[48], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER)};
+ }
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[48]};
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png");
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ if (mInventory[1] == null) return null;
+ String tmp = mInventory[1].getUnlocalizedName().replaceAll("gt.blockmachines.basicmachine.", "");
+ if (tmp.startsWith("centrifuge")) {
+ return GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes;
+ } else if (tmp.startsWith("electrolyzer")) {
+ return GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes;
+ } else if (tmp.startsWith("alloysmelter")) {
+ return GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes;
+ } else if (tmp.startsWith("assembler")) {
+ return GT_Recipe.GT_Recipe_Map.sAssemblerRecipes;
+ } else if (tmp.startsWith("compressor")) {
+ return GT_Recipe.GT_Recipe_Map.sCompressorRecipes;
+ } else if (tmp.startsWith("extractor")) {
+ return GT_Recipe.GT_Recipe_Map.sExtractorRecipes;
+ } else if (tmp.startsWith("macerator")) {
+ return GT_Recipe.GT_Recipe_Map.sMaceratorRecipes;
+ } else if (tmp.startsWith("recycler")) {
+ return GT_Recipe.GT_Recipe_Map.sRecyclerRecipes;
+ } else if (tmp.startsWith("thermalcentrifuge")) {
+ return GT_Recipe.GT_Recipe_Map.sThermalCentrifugeRecipes;
+ } else if (tmp.startsWith("orewasher")) {
+ return GT_Recipe.GT_Recipe_Map.sOreWasherRecipes;
+ } else if (tmp.startsWith("chemicalreactor")) {
+ return GT_Recipe.GT_Recipe_Map.sChemicalRecipes;
+ } else if (tmp.startsWith("chemicalbath")) {
+ return GT_Recipe.GT_Recipe_Map.sChemicalBathRecipes;
+ } else if (tmp.startsWith("electromagneticseparator")) {
+ return GT_Recipe.GT_Recipe_Map.sElectroMagneticSeparatorRecipes;
+ } else if (tmp.startsWith("autoclave")) {
+ return GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes;
+ } else if (tmp.startsWith("mixer")) {
+ return GT_Recipe.GT_Recipe_Map.sMixerRecipes;
+ } else if (tmp.startsWith("hammer")) {
+ return GT_Recipe.GT_Recipe_Map.sHammerRecipes;
+ } else if (tmp.startsWith("sifter")) {
+ return GT_Recipe.GT_Recipe_Map.sSifterRecipes;
+ } else if (tmp.startsWith("extruder")) {
+ return GT_Recipe.GT_Recipe_Map.sExtruderRecipes;
+ } else if (tmp.startsWith("laserengraver")) {
+ return GT_Recipe.GT_Recipe_Map.sLaserEngraverRecipes;
+ } else if (tmp.startsWith("bender")) {
+ return GT_Recipe.GT_Recipe_Map.sBenderRecipes;
+ } else if (tmp.startsWith("wiremill")) {
+ return GT_Recipe.GT_Recipe_Map.sWiremillRecipes;
+ } else if (tmp.startsWith("arcfurnace")) {
+ return GT_Recipe.GT_Recipe_Map.sArcFurnaceRecipes;
+ }
+
+ return null;
+ }
+
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ if (aStack != null && aStack.getUnlocalizedName().startsWith("gt.blockmachines.basicmachine.")) {
+ return true;
+ }
+ return false;
+ }
+
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ public boolean checkRecipe(ItemStack aStack) {
+ if (!isCorrectMachinePart(mInventory[1])) {
+ return false;
+ }
+ GT_Recipe.GT_Recipe_Map map = getRecipeMap();
+ if (map == null) {
+ return false;
+ }
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ int tTier = 0;
+ if (mInventory[1].getUnlocalizedName().endsWith("1")) {
+ tTier = 1;
+ }
+ if (mInventory[1].getUnlocalizedName().endsWith("2")) {
+ tTier = 2;
+ }
+ if (mInventory[1].getUnlocalizedName().endsWith("3")) {
+ tTier = 3;
+ }
+ if (mInventory[1].getUnlocalizedName().endsWith("4")) {
+ tTier = 4;
+ }
+ if (mInventory[1].getUnlocalizedName().endsWith("5")) {
+ tTier = 5;
+ }
+ for (int i = 0; i < tInputList.size() - 1; i++) {
+ for (int j = i + 1; j < tInputList.size(); j++) {
+ if (GT_Utility.areStacksEqual((ItemStack) tInputList.get(i), (ItemStack) tInputList.get(j))) {
+ if (((ItemStack) tInputList.get(i)).stackSize >= ((ItemStack) tInputList.get(j)).stackSize) {
+ tInputList.remove(j--);
+ } else {
+ tInputList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+ ItemStack[] tInputs = (ItemStack[]) Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
+
+ ArrayList<FluidStack> tFluidList = getStoredFluids();
+ for (int i = 0; i < tFluidList.size() - 1; i++) {
+ for (int j = i + 1; j < tFluidList.size(); j++) {
+ if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) {
+ if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) {
+ tFluidList.remove(j--);
+ } else {
+ tFluidList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+ FluidStack[] tFluids = (FluidStack[]) Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1);
+ if (tInputList.size() > 0 || tFluids.length > 0) {
+ GT_Recipe tRecipe = map.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
+ if (tRecipe != null) {
+ mLastRecipe = tRecipe;
+ this.mEUt = 0;
+ this.mOutputItems = null;
+ this.mOutputFluids = null;
+ int machines = Math.min(16, mInventory[1].stackSize);
+ int i = 0;
+ for (; i < machines; i++) {
+ if (!tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) {
+ if (i == 0) {
+ return false;
+ }
+ break;
+ }
+ }
+ this.mMaxProgresstime = tRecipe.mDuration;
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ if (tRecipe.mEUt <= 16) {
+ this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
+ } else {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = tRecipe.mDuration;
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ this.mEUt *= i;
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+ ItemStack[] tOut = new ItemStack[tRecipe.mOutputs.length];
+ for (int h = 0; h < tRecipe.mOutputs.length; h++) {
+ tOut[h] = tRecipe.getOutput(h).copy();
+ tOut[h].stackSize = 0;
+ }
+ FluidStack tFOut = null;
+ if (tRecipe.getFluidOutput(0) != null) tFOut = tRecipe.getFluidOutput(0).copy();
+ for (int f = 0; f < tOut.length; f++) {
+ if (tRecipe.mOutputs[f] != null && tOut[f] != null) {
+ for (int g = 0; g < i; g++) {
+ if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f))
+ tOut[f].stackSize += tRecipe.mOutputs[f].stackSize;
+ }
+ }
+ }
+ if (tFOut != null) {
+ int tSize = tFOut.amount;
+ tFOut.amount = tSize * i;
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ List<ItemStack> overStacks = new ArrayList<ItemStack>();
+ for (int f = 0; f < tOut.length; f++) {
+ if (tOut[f].getMaxStackSize() < tOut[f].stackSize) {
+ while (tOut[f].getMaxStackSize() < tOut[f].stackSize) {
+ ItemStack tmp = tOut[f].copy();
+ tmp.stackSize = tmp.getMaxStackSize();
+ tOut[f].stackSize = tOut[f].stackSize - tOut[f].getMaxStackSize();
+ overStacks.add(tmp);
+ }
+ }
+ }
+ if (overStacks.size() > 0) {
+ ItemStack[] tmp = new ItemStack[overStacks.size()];
+ tmp = overStacks.toArray(tmp);
+ tOut = ArrayUtils.addAll(tOut, tmp);
+ }
+ List<ItemStack> tSList = new ArrayList<ItemStack>();
+ for (ItemStack tS : tOut) {
+ if (tS.stackSize > 0) tSList.add(tS);
+ }
+ tOut = tSList.toArray(new ItemStack[tSList.size()]);
+ this.mOutputItems = tOut;
+ this.mOutputFluids = new FluidStack[]{tFOut};
+ updateSlots();
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
+ return false;
+ }
+ int tAmount = 0;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ for (int h = -1; h < 2; h++) {
+ if ((h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
+ if ((!addMaintenanceToMachineList(tTileEntity, 48)) && (!addInputToMachineList(tTileEntity, 48)) && (!addOutputToMachineList(tTileEntity, 48)) && (!addEnergyInputToMachineList(tTileEntity, 48))) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings4) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 0) {
+ return false;
+ }
+ tAmount++;
+ }
+ }
+ }
+ }
+ }
+ return tAmount >= 16;
+ }
+
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
+
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ public int getAmountOfOutputs() {
+ return 1;
+ }
-public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBlockBase{
-
- public GT_MetaTileEntity_ProcessingArray(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_ProcessingArray(String aName)
- {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_ProcessingArray(this.mName);
- }
-
- public String[] getDescription()
- {
- return new String[] { "Controller Block for the Processing Array",
- "Size: 3x3x3 (Hollow)",
- "Controller (front centered)",
- "1x Input (anywhere)",
- "1x Output (anywhere)",
- "1x Energy Hatch (anywhere)",
- "1x Maintenance Hatch (anywhere)",
- "Robust Tungstensteel Casings for the rest (16 at least!)",
- "Place up to 16 Single Block GT Machines into the GUI Inventory",
- "They will work the same way as placed directly in world"};
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
- {
- if (aSide == aFacing) {
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[48], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER) };
- }
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[48] };
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png");
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipeMap()
- {
- if(mInventory[1]==null)return null;
- String tmp = mInventory[1].getUnlocalizedName().replaceAll("gt.blockmachines.basicmachine.", "");
- if(tmp.startsWith("centrifuge")){
- return GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes;
- }else if(tmp.startsWith("electrolyzer")){
- return GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes;
- }else if(tmp.startsWith("alloysmelter")){
- return GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes;
- }else if(tmp.startsWith("assembler")){
- return GT_Recipe.GT_Recipe_Map.sAssemblerRecipes;
- }else if(tmp.startsWith("compressor")){
- return GT_Recipe.GT_Recipe_Map.sCompressorRecipes;
- }else if(tmp.startsWith("extractor")){
- return GT_Recipe.GT_Recipe_Map.sExtractorRecipes;
- }else if(tmp.startsWith("macerator")){
- return GT_Recipe.GT_Recipe_Map.sMaceratorRecipes;
- }else if(tmp.startsWith("recycler")){
- return GT_Recipe.GT_Recipe_Map.sRecyclerRecipes;
- }else if(tmp.startsWith("thermalcentrifuge")){
- return GT_Recipe.GT_Recipe_Map.sThermalCentrifugeRecipes;
- }else if(tmp.startsWith("orewasher")){
- return GT_Recipe.GT_Recipe_Map.sOreWasherRecipes;
- }else if(tmp.startsWith("chemicalreactor")){
- return GT_Recipe.GT_Recipe_Map.sChemicalRecipes;
- }else if(tmp.startsWith("chemicalbath")){
- return GT_Recipe.GT_Recipe_Map.sChemicalBathRecipes;
- }else if(tmp.startsWith("electromagneticseparator")){
- return GT_Recipe.GT_Recipe_Map.sElectroMagneticSeparatorRecipes;
- }else if(tmp.startsWith("autoclave")){
- return GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes;
- }else if(tmp.startsWith("mixer")){
- return GT_Recipe.GT_Recipe_Map.sMixerRecipes;
- }else if(tmp.startsWith("hammer")){
- return GT_Recipe.GT_Recipe_Map.sHammerRecipes;
- }else if(tmp.startsWith("sifter")){
- return GT_Recipe.GT_Recipe_Map.sSifterRecipes;
- }else if(tmp.startsWith("extruder")){
- return GT_Recipe.GT_Recipe_Map.sExtruderRecipes;
- }else if(tmp.startsWith("laserengraver")){
- return GT_Recipe.GT_Recipe_Map.sLaserEngraverRecipes;
- }else if(tmp.startsWith("bender")){
- return GT_Recipe.GT_Recipe_Map.sBenderRecipes;
- }else if(tmp.startsWith("wiremill")){
- return GT_Recipe.GT_Recipe_Map.sWiremillRecipes;
- }else if(tmp.startsWith("arcfurnace")){
- return GT_Recipe.GT_Recipe_Map.sArcFurnaceRecipes;
- }
-
- return null;
- }
-
- public boolean isCorrectMachinePart(ItemStack aStack)
- {
- if(aStack!=null&&aStack.getUnlocalizedName().startsWith("gt.blockmachines.basicmachine.")){
- return true;}
- return false;
- }
-
- public boolean isFacingValid(byte aFacing)
- {
- return aFacing > 1;
- }
-
- GT_Recipe mLastRecipe;
- public boolean checkRecipe(ItemStack aStack){
- if(!isCorrectMachinePart(mInventory[1])){return false;}
- GT_Recipe.GT_Recipe_Map map = getRecipeMap();
- if(map==null){return false;}
- ArrayList<ItemStack> tInputList = getStoredInputs();
- int tTier = 0;
- if(mInventory[1].getUnlocalizedName().endsWith("1")){tTier=1;}
- if(mInventory[1].getUnlocalizedName().endsWith("2")){tTier=2;}
- if(mInventory[1].getUnlocalizedName().endsWith("3")){tTier=3;}
- if(mInventory[1].getUnlocalizedName().endsWith("4")){tTier=4;}
- if(mInventory[1].getUnlocalizedName().endsWith("5")){tTier=5;}
- for (int i = 0; i < tInputList.size() - 1; i++) {
- for (int j = i + 1; j < tInputList.size(); j++) {
- if (GT_Utility.areStacksEqual((ItemStack)tInputList.get(i), (ItemStack)tInputList.get(j))) {
- if (((ItemStack)tInputList.get(i)).stackSize >= ((ItemStack)tInputList.get(j)).stackSize)
- {
- tInputList.remove(j--);
- }
- else
- {
- tInputList.remove(i--); break;
- }
- }
- }
- }
- ItemStack[] tInputs = (ItemStack[])Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
-
- ArrayList<FluidStack> tFluidList = getStoredFluids();
- for (int i = 0; i < tFluidList.size() - 1; i++) {
- for (int j = i + 1; j < tFluidList.size(); j++) {
- if (GT_Utility.areFluidsEqual((FluidStack)tFluidList.get(i), (FluidStack)tFluidList.get(j))) {
- if (((FluidStack)tFluidList.get(i)).amount >= ((FluidStack)tFluidList.get(j)).amount)
- {
- tFluidList.remove(j--);
- }
- else
- {
- tFluidList.remove(i--); break;
- }
- }
- }
- }
- FluidStack[] tFluids = (FluidStack[])Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1);
- if(tInputList.size() > 0 || tFluids.length>0){
- GT_Recipe tRecipe = map.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
- if (tRecipe != null) {
- mLastRecipe = tRecipe;
- this.mEUt = 0;
- this.mOutputItems = null;
- this.mOutputFluids = null;
- int machines = Math.min(16,mInventory[1].stackSize);
- int i = 0;
- for(;i<machines;i++){
- if(!tRecipe.isRecipeInputEqual(true, tFluids, tInputs)){if(i==0){return false;}
- break;}
- }
- this.mMaxProgresstime = tRecipe.mDuration;
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
- if (tRecipe.mEUt <= 16)
- {
- this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
- }
- else
- {
- this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = tRecipe.mDuration;
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)])
- {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
- }
- }
- this.mEUt*=i;
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
- ItemStack[] tOut = new ItemStack[tRecipe.mOutputs.length];
- for(int h = 0;h<tRecipe.mOutputs.length;h++){
- tOut[h] = tRecipe.getOutput(h).copy();
- tOut[h].stackSize =0;
- }FluidStack tFOut=null;
- if(tRecipe.getFluidOutput(0)!=null) tFOut = tRecipe.getFluidOutput(0).copy();
- for(int f =0; f < tOut.length ; f++){
- if(tRecipe.mOutputs[f]!=null&&tOut[f]!=null){
- for(int g =0;g<i;g++){
- if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f)) tOut[f].stackSize += tRecipe.mOutputs[f].stackSize;
- }
- }
- }
- if(tFOut!=null){
- int tSize = tFOut.amount;
- tFOut.amount = tSize * i;
- }
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- List<ItemStack> overStacks = new ArrayList<ItemStack>();
- for(int f =0; f < tOut.length ; f++){
- if(tOut[f].getMaxStackSize()<tOut[f].stackSize){
- while(tOut[f].getMaxStackSize()<tOut[f].stackSize){
- ItemStack tmp = tOut[f].copy();
- tmp.stackSize = tmp.getMaxStackSize();
- tOut[f].stackSize = tOut[f].stackSize - tOut[f].getMaxStackSize();
- overStacks.add(tmp);
- }
- }
- }
- if(overStacks.size()>0){
- ItemStack[] tmp = new ItemStack[overStacks.size()];
- tmp = overStacks.toArray(tmp);
- tOut = ArrayUtils.addAll(tOut, tmp);
- }
- List<ItemStack> tSList = new ArrayList<ItemStack>();
- for(ItemStack tS : tOut){
- if(tS.stackSize>0)tSList.add(tS);
- }
- tOut = tSList.toArray(new ItemStack[tSList.size()]);
- this.mOutputItems = tOut;
- this.mOutputFluids = new FluidStack[]{tFOut};
- updateSlots();
- return true;
- }
- }
- return false;
- }
-
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack)
- {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
- if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
- return false;
- }
- int tAmount = 0;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- for (int h = -1; h < 2; h++) {
- if ((h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0))))
- {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
- if ((!addMaintenanceToMachineList(tTileEntity, 48)) && (!addInputToMachineList(tTileEntity, 48)) && (!addOutputToMachineList(tTileEntity, 48)) && (!addEnergyInputToMachineList(tTileEntity, 48)))
- {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings4) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 0) {
- return false;
- }
- tAmount++;
- }
- }
- }
- }
- }
- return tAmount >= 16;
- }
-
- public int getMaxEfficiency(ItemStack aStack){return 10000;}
- public int getPollutionPerTick(ItemStack aStack){return 0;}
- public int getDamageToComponent(ItemStack aStack){return 0;}
- public int getAmountOfOutputs(){return 1;}
- public boolean explodesOnComponentBreak(ItemStack aStack){return false;}
- } \ No newline at end of file
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+} \ No newline at end of file
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java
index 05c7a4a0ef..e14a425a39 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java
@@ -1,13 +1,6 @@
package gregtech.common.tileentities.machines.multi;
-import java.util.ArrayList;
-
-import net.minecraft.block.BlockDynamicLiquid;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -16,156 +9,163 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockB
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+
+import java.util.ArrayList;
public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlockBase {
- public GT_MetaTileEntity_PyrolyseOven(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_PyrolyseOven(String aName) {
- super(aName);
- }
-
- public String[] getDescription() {
- return new String[] {
- "Controller Block for the Pyrolyse Oven",
- "Industrial Charcoal producer and Oil from Plants",
- "Size: 5x4x5, Controller (bottom center)",
- "Made from ULV Machine Casings (min 60)",
- "Bottom 3x3 Kantal Heating Coils",
- "4 high ULV Casings around the coils",
- "bottom row of casings are Energy Hatch",
- "Maintainance Hatch and Output Hatch/Bus",
- "top 3x3 has Input Hatch/Bus and Muffler Hatch"};
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- if (aSide == aFacing) {
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[0],
- new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER) };
- }
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[0] };
- }
-
- @Override
- public boolean checkRecipe(ItemStack aStack) {
- ArrayList<ItemStack> tInputList = getStoredInputs();
- ArrayList<FluidStack> tFluidInputs = getStoredFluids();
- for (ItemStack tInput : tInputList)
- {
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte)Math.max(1, GT_Utility.getTier(tVoltage));
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluidInputs.isEmpty() ? null :new FluidStack[]{tFluidInputs.get(0)}, new ItemStack[] { mInventory[1],tInput });
- if (tRecipe != null) {
- if (tRecipe.isRecipeInputEqual(true, tFluidInputs.isEmpty() ? null :new FluidStack[]{tFluidInputs.get(0)}, new ItemStack[] { tInput, mInventory[1] }))
- {
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
-
- this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = tRecipe.mDuration;
-
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- if(tRecipe.mOutputs.length>0)this.mOutputItems = new ItemStack[] { tRecipe.getOutput(0) };
- if(tRecipe.mFluidOutputs.length>0)this.mOutputFluids = new FluidStack[] { tRecipe.getFluidOutput(0) };
- updateSlots();
- return true;
- }
- }
- }
- return false;
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX*2;
- int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ*2;
- for (int i = -2; i < 3; i++) {
- for (int j = -2; j < 3; j++) {
- for (int h = 0; h < 4; h++) {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
- if ((i != -2 && i != 2) && (j != -2 && j != 2)) {// innerer 3x3 ohne höhe
- if (h == 0) {// innen boden (kantal coils)
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings1) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 13) {
- return false;
- }
- } else if (h == 3) {// innen decke (ulv casings + input + muffler)
- if ((!addInputToMachineList(tTileEntity, 120)) && (!addMufflerToMachineList(tTileEntity, 120))) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings1) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 0) {
- return false;
- }
- }
- } else {// innen air
- if (!aBaseMetaTileEntity.getAir(xDir + i, h, zDir + j)) {
- return false;
- }
- }
- } else {// Außerer 5x5 ohne höhe
- if (h == 0) {// außen boden (controller, output, energy, maintainance, rest ulv casings)
- if ((!addMaintenanceToMachineList(tTileEntity, 120)) && (!addOutputToMachineList(tTileEntity, 120)) && (!addEnergyInputToMachineList(tTileEntity, 120))) {
- if ((xDir + i != 0) || (zDir + j != 0)){//no controller
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings1) { return false;}
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 0) {
- return false;
- }}
- }
- } else {// außen über boden (ulv casings)
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings1) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 0) {
- return false;
- }
- }
- }
- }
- }
- }
- return true;
- }
-
- @Override
- public boolean isCorrectMachinePart(ItemStack aStack) {
- return true;
- }
-
- @Override
- public int getMaxEfficiency(ItemStack aStack) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerTick(ItemStack aStack) {
- return 20;
- }
-
- @Override
- public int getDamageToComponent(ItemStack aStack) {
- return 0;
- }
-
- @Override
- public int getAmountOfOutputs() {
- return 0;
- }
-
- @Override
- public boolean explodesOnComponentBreak(ItemStack aStack) {
- return false;
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_PyrolyseOven(this.mName);
- }
+ public GT_MetaTileEntity_PyrolyseOven(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_PyrolyseOven(String aName) {
+ super(aName);
+ }
+
+ public String[] getDescription() {
+ return new String[]{
+ "Controller Block for the Pyrolyse Oven",
+ "Industrial Charcoal producer and Oil from Plants",
+ "Size: 5x4x5, Controller (bottom center)",
+ "Made from ULV Machine Casings (min 60)",
+ "Bottom 3x3 Kantal Heating Coils",
+ "4 high ULV Casings around the coils",
+ "bottom row of casings are Energy Hatch",
+ "Maintainance Hatch and Output Hatch/Bus",
+ "top 3x3 has Input Hatch/Bus and Muffler Hatch"};
+ }
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[0],
+ new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER)};
+ }
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[0]};
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ ArrayList<FluidStack> tFluidInputs = getStoredFluids();
+ for (ItemStack tInput : tInputList) {
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluidInputs.isEmpty() ? null : new FluidStack[]{tFluidInputs.get(0)}, new ItemStack[]{mInventory[1], tInput});
+ if (tRecipe != null) {
+ if (tRecipe.isRecipeInputEqual(true, tFluidInputs.isEmpty() ? null : new FluidStack[]{tFluidInputs.get(0)}, new ItemStack[]{tInput, mInventory[1]})) {
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = tRecipe.mDuration;
+
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ if (tRecipe.mOutputs.length > 0) this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)};
+ if (tRecipe.mFluidOutputs.length > 0)
+ this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)};
+ updateSlots();
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2;
+ for (int i = -2; i < 3; i++) {
+ for (int j = -2; j < 3; j++) {
+ for (int h = 0; h < 4; h++) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
+ if ((i != -2 && i != 2) && (j != -2 && j != 2)) {// innerer 3x3 ohne h�he
+ if (h == 0) {// innen boden (kantal coils)
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings1) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 13) {
+ return false;
+ }
+ } else if (h == 3) {// innen decke (ulv casings + input + muffler)
+ if ((!addInputToMachineList(tTileEntity, 120)) && (!addMufflerToMachineList(tTileEntity, 120))) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings1) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 0) {
+ return false;
+ }
+ }
+ } else {// innen air
+ if (!aBaseMetaTileEntity.getAir(xDir + i, h, zDir + j)) {
+ return false;
+ }
+ }
+ } else {// Au�erer 5x5 ohne h�he
+ if (h == 0) {// au�en boden (controller, output, energy, maintainance, rest ulv casings)
+ if ((!addMaintenanceToMachineList(tTileEntity, 120)) && (!addOutputToMachineList(tTileEntity, 120)) && (!addEnergyInputToMachineList(tTileEntity, 120))) {
+ if ((xDir + i != 0) || (zDir + j != 0)) {//no controller
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings1) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 0) {
+ return false;
+ }
+ }
+ }
+ } else {// au�en �ber boden (ulv casings)
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings1) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 0) {
+ return false;
+ }
+ }
+ }
+ }
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 20;
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 0;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_PyrolyseOven(this.mName);
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java
index c0d4af2582..e222584df8 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java
@@ -2,7 +2,6 @@ package gregtech.common.tileentities.machines.multi;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.gui.GT_GUIContainer_MultiMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -10,160 +9,134 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
-
-import java.util.ArrayList;
-
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
+import java.util.ArrayList;
+
public class GT_MetaTileEntity_VacuumFreezer
- extends GT_MetaTileEntity_MultiBlockBase
-{
- public GT_MetaTileEntity_VacuumFreezer(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_VacuumFreezer(String aName)
- {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_VacuumFreezer(this.mName);
- }
-
- public String[] getDescription()
- {
- return new String[] { "Controller Block for the Vacuum Freezer", "Size: 3x3x3 (Hollow)", "Controller (front centered)", "1x Input (anywhere)", "1x Output (anywhere)", "1x Energy Hatch (anywhere)", "1x Maintenance Hatch (anywhere)", "Frost Proof Casings for the rest (16 at least!)" };
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
- {
- if (aSide == aFacing) {
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[17], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER) };
- }
- return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[17] };
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png");
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipeMap()
- {
- return GT_Recipe.GT_Recipe_Map.sVacuumRecipes;
- }
-
- public boolean isCorrectMachinePart(ItemStack aStack)
- {
- return true;
- }
-
- public boolean isFacingValid(byte aFacing)
- {
- return aFacing > 1;
- }
-
- public boolean checkRecipe(ItemStack aStack)
- {
- ArrayList<ItemStack> tInputList = getStoredInputs();
- for (ItemStack tInput : tInputList)
- {
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte)Math.max(1, GT_Utility.getTier(tVoltage));
-
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], null, new ItemStack[] { tInput });
- if (tRecipe != null) {
- if (tRecipe.isRecipeInputEqual(true, null, new ItemStack[] { tInput }))
- {
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
- if (tRecipe.mEUt <= 16)
- {
- this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
- }
- else
- {
- this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = tRecipe.mDuration;
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)])
- {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
+ extends GT_MetaTileEntity_MultiBlockBase {
+ public GT_MetaTileEntity_VacuumFreezer(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GT_MetaTileEntity_VacuumFreezer(String aName) {
+ super(aName);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_VacuumFreezer(this.mName);
+ }
+
+ public String[] getDescription() {
+ return new String[]{"Controller Block for the Vacuum Freezer", "Size: 3x3x3 (Hollow)", "Controller (front centered)", "1x Input (anywhere)", "1x Output (anywhere)", "1x Energy Hatch (anywhere)", "1x Maintenance Hatch (anywhere)", "Frost Proof Casings for the rest (16 at least!)"};
+ }
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[17], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER)};
+ }
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[17]};
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png");
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sVacuumRecipes;
+ }
+
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ public boolean checkRecipe(ItemStack aStack) {
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ for (ItemStack tInput : tInputList) {
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], null, new ItemStack[]{tInput});
+ if (tRecipe != null) {
+ if (tRecipe.isRecipeInputEqual(true, null, new ItemStack[]{tInput})) {
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ if (tRecipe.mEUt <= 16) {
+ this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
+ } else {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = tRecipe.mDuration;
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)};
+ updateSlots();
+ return true;
+ }
}
- }
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- this.mOutputItems = new ItemStack[] { tRecipe.getOutput(0) };
- updateSlots();
- return true;
}
- }
- }
- return false;
- }
-
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack)
- {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
- if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
- return false;
- }
- int tAmount = 0;
- for (int i = -1; i < 2; i++) {
- for (int j = -1; j < 2; j++) {
- for (int h = -1; h < 2; h++) {
- if ((h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0))))
- {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
- if ((!addMaintenanceToMachineList(tTileEntity, 17)) && (!addInputToMachineList(tTileEntity, 17)) && (!addOutputToMachineList(tTileEntity, 17)) && (!addEnergyInputToMachineList(tTileEntity, 17)))
- {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings2) {
- return false;
- }
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 1) {
- return false;
- }
- tAmount++;
+ return false;
+ }
+
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
+ return false;
+ }
+ int tAmount = 0;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ for (int h = -1; h < 2; h++) {
+ if ((h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
+ if ((!addMaintenanceToMachineList(tTileEntity, 17)) && (!addInputToMachineList(tTileEntity, 17)) && (!addOutputToMachineList(tTileEntity, 17)) && (!addEnergyInputToMachineList(tTileEntity, 17))) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings2) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 1) {
+ return false;
+ }
+ tAmount++;
+ }
+ }
+ }
}
- }
}
- }
- }
- return tAmount >= 16;
- }
-
- public int getMaxEfficiency(ItemStack aStack)
- {
- return 10000;
- }
-
- public int getPollutionPerTick(ItemStack aStack)
- {
- return 0;
- }
-
- public int getDamageToComponent(ItemStack aStack)
- {
- return 0;
- }
-
- public int getAmountOfOutputs()
- {
- return 1;
- }
-
- public boolean explodesOnComponentBreak(ItemStack aStack)
- {
- return false;
- }
+ return tAmount >= 16;
+ }
+
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
+
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java
index ce722b63a7..c62b795adb 100644
--- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java
+++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java
@@ -2,7 +2,6 @@ package gregtech.common.tileentities.machines.steam;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.gui.GT_GUIContainer_BasicMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -10,107 +9,83 @@ import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Bronze;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
-
-import java.util.Map;
-
import net.minecraft.entity.player.InventoryPlayer;
public class GT_MetaTileEntity_AlloySmelter_Bronze
- extends GT_MetaTileEntity_BasicMachine_Bronze
-{
- public GT_MetaTileEntity_AlloySmelter_Bronze(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional, "Combination Smelter", 2, 1, true);
- }
-
- public GT_MetaTileEntity_AlloySmelter_Bronze(String aName, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aDescription, aTextures, 2, 1, true);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_AlloySmelter_Bronze(this.mName, this.mDescription, this.mTextures);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeAlloySmelter.png", GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes.mUnlocalizedName);
- }
-
- public int checkRecipe()
- {
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[1], null, getAllInputs());
- if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs())))
- {
- this.mOutputItems[0] = tRecipe.getOutput(0);
- if (tRecipe.mEUt <= 16)
- {
- this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = (tRecipe.mDuration * 2);
- }
- else
- {
- this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = (tRecipe.mDuration * 2);
- }
- return 2;
+ extends GT_MetaTileEntity_BasicMachine_Bronze {
+ public GT_MetaTileEntity_AlloySmelter_Bronze(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, "Combination Smelter", 2, 1, true);
+ }
+
+ public GT_MetaTileEntity_AlloySmelter_Bronze(String aName, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aDescription, aTextures, 2, 1, true);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_AlloySmelter_Bronze(this.mName, this.mDescription, this.mTextures);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeAlloySmelter.png", GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes.mUnlocalizedName);
}
- return 0;
- }
-
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
- {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 1) {
- GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(208)), 10, 1.0F, aX, aY, aZ);
+
+ public int checkRecipe() {
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[1], null, getAllInputs());
+ if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) {
+ this.mOutputItems[0] = tRecipe.getOutput(0);
+ if (tRecipe.mEUt <= 16) {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = (tRecipe.mDuration * 2);
+ } else {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = (tRecipe.mDuration * 2);
+ }
+ return 2;
+ }
+ return 0;
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(208)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public void startProcess() {
+ sendLoopStart((byte) 1);
+ }
+
+ public ITexture[] getSideFacingActive(byte aColor) {
+ return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE)};
+ }
+
+ public ITexture[] getSideFacingInactive(byte aColor) {
+ return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_ALLOY_SMELTER)};
+ }
+
+ public ITexture[] getFrontFacingActive(byte aColor) {
+ return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE)};
+ }
+
+ public ITexture[] getFrontFacingInactive(byte aColor) {
+ return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_ALLOY_SMELTER)};
+ }
+
+ public ITexture[] getTopFacingActive(byte aColor) {
+ return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE)};
+ }
+
+ public ITexture[] getTopFacingInactive(byte aColor) {
+ return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_ALLOY_SMELTER)};
+ }
+
+ public ITexture[] getBottomFacingActive(byte aColor) {
+ return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE)};
+ }
+
+ public ITexture[] getBottomFacingInactive(byte aColor) {
+ return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER)};
}
- }
-
- public void startProcess()
- {
- sendLoopStart((byte)1);
- }
-
- public ITexture[] getSideFacingActive(byte aColor)
- {
- return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE) };
- }
-
- public ITexture[] getSideFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_ALLOY_SMELTER) };
- }
-
- public ITexture[] getFrontFacingActive(byte aColor)
- {
- return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE) };
- }
-
- public ITexture[] getFrontFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_ALLOY_SMELTER) };
- }
-
- public ITexture[] getTopFacingActive(byte aColor)
- {
- return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE) };
- }
-
- public ITexture[] getTopFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_ALLOY_SMELTER) };
- }
-
- public ITexture[] getBottomFacingActive(byte aColor)
- {
- return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE) };
- }
-
- public ITexture[] getBottomFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER) };
- }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java
index 3de31757be..fe32ca8bce 100644
--- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java
+++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java
@@ -2,7 +2,6 @@ package gregtech.common.tileentities.machines.steam;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.gui.GT_GUIContainer_BasicMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -10,107 +9,83 @@ import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Steel;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
-
-import java.util.Map;
-
import net.minecraft.entity.player.InventoryPlayer;
public class GT_MetaTileEntity_AlloySmelter_Steel
- extends GT_MetaTileEntity_BasicMachine_Steel
-{
- public GT_MetaTileEntity_AlloySmelter_Steel(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional, "Combination Smelter", 2, 1, true);
- }
-
- public GT_MetaTileEntity_AlloySmelter_Steel(String aName, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aDescription, aTextures, 2, 1, true);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_AlloySmelter_Steel(this.mName, this.mDescription, this.mTextures);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelAlloySmelter.png", GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes.mUnlocalizedName);
- }
-
- public int checkRecipe()
- {
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[2], null, getAllInputs());
- if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs())))
- {
- this.mOutputItems[0] = tRecipe.getOutput(0);
- if (tRecipe.mEUt <= 16)
- {
- this.mEUt = (tRecipe.mEUt * 3);
- this.mMaxProgresstime = tRecipe.mDuration;
- }
- else
- {
- this.mEUt = (tRecipe.mEUt * 3);
- this.mMaxProgresstime = tRecipe.mDuration;
- }
- return 2;
+ extends GT_MetaTileEntity_BasicMachine_Steel {
+ public GT_MetaTileEntity_AlloySmelter_Steel(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, "Combination Smelter", 2, 1, true);
+ }
+
+ public GT_MetaTileEntity_AlloySmelter_Steel(String aName, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aDescription, aTextures, 2, 1, true);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_AlloySmelter_Steel(this.mName, this.mDescription, this.mTextures);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelAlloySmelter.png", GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes.mUnlocalizedName);
}
- return 0;
- }
-
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
- {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 1) {
- GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(208)), 10, 1.0F, aX, aY, aZ);
+
+ public int checkRecipe() {
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[2], null, getAllInputs());
+ if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) {
+ this.mOutputItems[0] = tRecipe.getOutput(0);
+ if (tRecipe.mEUt <= 16) {
+ this.mEUt = (tRecipe.mEUt * 3);
+ this.mMaxProgresstime = tRecipe.mDuration;
+ } else {
+ this.mEUt = (tRecipe.mEUt * 3);
+ this.mMaxProgresstime = tRecipe.mDuration;
+ }
+ return 2;
+ }
+ return 0;
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(208)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public void startProcess() {
+ sendLoopStart((byte) 1);
+ }
+
+ public ITexture[] getSideFacingActive(byte aColor) {
+ return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE)};
+ }
+
+ public ITexture[] getSideFacingInactive(byte aColor) {
+ return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_ALLOY_SMELTER)};
+ }
+
+ public ITexture[] getFrontFacingActive(byte aColor) {
+ return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE)};
+ }
+
+ public ITexture[] getFrontFacingInactive(byte aColor) {
+ return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_ALLOY_SMELTER)};
+ }
+
+ public ITexture[] getTopFacingActive(byte aColor) {
+ return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE)};
+ }
+
+ public ITexture[] getTopFacingInactive(byte aColor) {
+ return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_ALLOY_SMELTER)};
+ }
+
+ public ITexture[] getBottomFacingActive(byte aColor) {
+ return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE)};
+ }
+
+ public ITexture[] getBottomFacingInactive(byte aColor) {
+ return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER)};
}
- }
-
- public void startProcess()
- {
- sendLoopStart((byte)1);
- }
-
- public ITexture[] getSideFacingActive(byte aColor)
- {
- return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE) };
- }
-
- public ITexture[] getSideFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_ALLOY_SMELTER) };
- }
-
- public ITexture[] getFrontFacingActive(byte aColor)
- {
- return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE) };
- }
-
- public ITexture[] getFrontFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_ALLOY_SMELTER) };
- }
-
- public ITexture[] getTopFacingActive(byte aColor)
- {
- return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE) };
- }
-
- public ITexture[] getTopFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_ALLOY_SMELTER) };
- }
-
- public ITexture[] getBottomFacingActive(byte aColor)
- {
- return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE) };
- }
-
- public ITexture[] getBottomFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER) };
- }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java
index f69dd2ad45..b3bbcc9853 100644
--- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java
+++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java
@@ -2,7 +2,6 @@ package gregtech.common.tileentities.machines.steam;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.gui.GT_GUIContainer_BasicMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -11,102 +10,83 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachin
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
-
-import java.util.Map;
-
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_Compressor_Bronze
- extends GT_MetaTileEntity_BasicMachine_Bronze
-{
- public GT_MetaTileEntity_Compressor_Bronze(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional, "Compressing Items", 1, 1, false);
- }
-
- public GT_MetaTileEntity_Compressor_Bronze(String aName, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aDescription, aTextures, 1, 1, false);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeCompressor.png", "ic2.compressor");
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_Compressor_Bronze(this.mName, this.mDescription, this.mTextures);
- }
-
- public int checkRecipe()
- {
- if (null != (this.mOutputItems[0] = GT_ModHandler.getCompressorOutput(getInputAt(0), true, getOutputAt(0))))
- {
- this.mEUt = 2;
- this.mMaxProgresstime = 800;
- return 2;
- }
- return 0;
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
- {
- if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {return false;}
- return GT_ModHandler.getCompressorOutput(GT_Utility.copyAmount(64L, new Object[] { aStack }), false, null) != null;
- }
-
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
- {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 1) {
- GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(203)), 10, 1.0F, aX, aY, aZ);
- }
- }
-
- public void startProcess()
- {
- sendLoopStart((byte)1);
- }
-
- public ITexture[] getSideFacingActive(byte aColor)
- {
- return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE) };
- }
-
- public ITexture[] getSideFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_COMPRESSOR) };
- }
-
- public ITexture[] getFrontFacingActive(byte aColor)
- {
- return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE) };
- }
-
- public ITexture[] getFrontFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR) };
- }
-
- public ITexture[] getTopFacingActive(byte aColor)
- {
- return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE) };
- }
-
- public ITexture[] getTopFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_COMPRESSOR) };
- }
-
- public ITexture[] getBottomFacingActive(byte aColor)
- {
- return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE) };
- }
-
- public ITexture[] getBottomFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_COMPRESSOR) };
- }
+ extends GT_MetaTileEntity_BasicMachine_Bronze {
+ public GT_MetaTileEntity_Compressor_Bronze(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, "Compressing Items", 1, 1, false);
+ }
+
+ public GT_MetaTileEntity_Compressor_Bronze(String aName, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aDescription, aTextures, 1, 1, false);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeCompressor.png", "ic2.compressor");
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Compressor_Bronze(this.mName, this.mDescription, this.mTextures);
+ }
+
+ public int checkRecipe() {
+ if (null != (this.mOutputItems[0] = GT_ModHandler.getCompressorOutput(getInputAt(0), true, getOutputAt(0)))) {
+ this.mEUt = 2;
+ this.mMaxProgresstime = 800;
+ return 2;
+ }
+ return 0;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {
+ return false;
+ }
+ return GT_ModHandler.getCompressorOutput(GT_Utility.copyAmount(64L, new Object[]{aStack}), false, null) != null;
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(203)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public void startProcess() {
+ sendLoopStart((byte) 1);
+ }
+
+ public ITexture[] getSideFacingActive(byte aColor) {
+ return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE)};
+ }
+
+ public ITexture[] getSideFacingInactive(byte aColor) {
+ return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_COMPRESSOR)};
+ }
+
+ public ITexture[] getFrontFacingActive(byte aColor) {
+ return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE)};
+ }
+
+ public ITexture[] getFrontFacingInactive(byte aColor) {
+ return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR)};
+ }
+
+ public ITexture[] getTopFacingActive(byte aColor) {
+ return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE)};
+ }
+
+ public ITexture[] getTopFacingInactive(byte aColor) {
+ return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_COMPRESSOR)};
+ }
+
+ public ITexture[] getBottomFacingActive(byte aColor) {
+ return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE)};
+ }
+
+ public ITexture[] getBottomFacingInactive(byte aColor) {
+ return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_COMPRESSOR)};
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java
index f448e8b4e8..94917c918d 100644
--- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java
+++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java
@@ -2,7 +2,6 @@ package gregtech.common.tileentities.machines.steam;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.gui.GT_GUIContainer_BasicMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -11,102 +10,83 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachin
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
-
-import java.util.Map;
-
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_Compressor_Steel
- extends GT_MetaTileEntity_BasicMachine_Steel
-{
- public GT_MetaTileEntity_Compressor_Steel(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional, "Compressing Items", 1, 1, false);
- }
-
- public GT_MetaTileEntity_Compressor_Steel(String aName, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aDescription, aTextures, 1, 1, false);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelCompressor.png", "ic2.compressor");
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_Compressor_Steel(this.mName, this.mDescription, this.mTextures);
- }
-
- public int checkRecipe()
- {
- if (null != (this.mOutputItems[0] = GT_ModHandler.getCompressorOutput(getInputAt(0), true, getOutputAt(0))))
- {
- this.mEUt = 6;
- this.mMaxProgresstime = 400;
- return 2;
- }
- return 0;
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
- {
- if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {return false;}
- return GT_ModHandler.getCompressorOutput(GT_Utility.copyAmount(64L, new Object[] { aStack }), false, null) != null;
- }
-
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
- {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 1) {
- GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(203)), 10, 1.0F, aX, aY, aZ);
- }
- }
-
- public void startProcess()
- {
- sendLoopStart((byte)1);
- }
-
- public ITexture[] getSideFacingActive(byte aColor)
- {
- return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE) };
- }
-
- public ITexture[] getSideFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_COMPRESSOR) };
- }
-
- public ITexture[] getFrontFacingActive(byte aColor)
- {
- return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE) };
- }
-
- public ITexture[] getFrontFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR) };
- }
-
- public ITexture[] getTopFacingActive(byte aColor)
- {
- return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE) };
- }
-
- public ITexture[] getTopFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_COMPRESSOR) };
- }
-
- public ITexture[] getBottomFacingActive(byte aColor)
- {
- return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE) };
- }
-
- public ITexture[] getBottomFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_COMPRESSOR) };
- }
+ extends GT_MetaTileEntity_BasicMachine_Steel {
+ public GT_MetaTileEntity_Compressor_Steel(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, "Compressing Items", 1, 1, false);
+ }
+
+ public GT_MetaTileEntity_Compressor_Steel(String aName, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aDescription, aTextures, 1, 1, false);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelCompressor.png", "ic2.compressor");
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Compressor_Steel(this.mName, this.mDescription, this.mTextures);
+ }
+
+ public int checkRecipe() {
+ if (null != (this.mOutputItems[0] = GT_ModHandler.getCompressorOutput(getInputAt(0), true, getOutputAt(0)))) {
+ this.mEUt = 6;
+ this.mMaxProgresstime = 400;
+ return 2;
+ }
+ return 0;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {
+ return false;
+ }
+ return GT_ModHandler.getCompressorOutput(GT_Utility.copyAmount(64L, new Object[]{aStack}), false, null) != null;
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(203)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public void startProcess() {
+ sendLoopStart((byte) 1);
+ }
+
+ public ITexture[] getSideFacingActive(byte aColor) {
+ return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE)};
+ }
+
+ public ITexture[] getSideFacingInactive(byte aColor) {
+ return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_COMPRESSOR)};
+ }
+
+ public ITexture[] getFrontFacingActive(byte aColor) {
+ return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE)};
+ }
+
+ public ITexture[] getFrontFacingInactive(byte aColor) {
+ return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR)};
+ }
+
+ public ITexture[] getTopFacingActive(byte aColor) {
+ return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE)};
+ }
+
+ public ITexture[] getTopFacingInactive(byte aColor) {
+ return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_COMPRESSOR)};
+ }
+
+ public ITexture[] getBottomFacingActive(byte aColor) {
+ return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE)};
+ }
+
+ public ITexture[] getBottomFacingInactive(byte aColor) {
+ return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_COMPRESSOR)};
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java
index 03c31a5b07..5181c8277a 100644
--- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java
+++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java
@@ -2,7 +2,6 @@ package gregtech.common.tileentities.machines.steam;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.gui.GT_GUIContainer_BasicMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -11,102 +10,83 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachin
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
-
-import java.util.Map;
-
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_Extractor_Bronze
- extends GT_MetaTileEntity_BasicMachine_Bronze
-{
- public GT_MetaTileEntity_Extractor_Bronze(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional, "Extracting your first Rubber", 1, 1, false);
- }
-
- public GT_MetaTileEntity_Extractor_Bronze(String aName, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aDescription, aTextures, 1, 1, false);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeExtractor.png", "ic2.extractor");
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_Extractor_Bronze(this.mName, this.mDescription, this.mTextures);
- }
-
- public int checkRecipe()
- {
- if (null != (this.mOutputItems[0] = GT_ModHandler.getExtractorOutput(getInputAt(0), true, getOutputAt(0))))
- {
- this.mEUt = 2;
- this.mMaxProgresstime = 800;
- return 2;
- }
- return 0;
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
- {
- if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {return false;}
- return GT_ModHandler.getExtractorOutput(GT_Utility.copyAmount(64L, new Object[] { aStack }), false, null) != null;
- }
-
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
- {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 1) {
- GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(200)), 10, 1.0F, aX, aY, aZ);
- }
- }
-
- public void startProcess()
- {
- sendLoopStart((byte)1);
- }
-
- public ITexture[] getSideFacingActive(byte aColor)
- {
- return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE) };
- }
-
- public ITexture[] getSideFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_EXTRACTOR) };
- }
-
- public ITexture[] getFrontFacingActive(byte aColor)
- {
- return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE) };
- }
-
- public ITexture[] getFrontFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_EXTRACTOR) };
- }
-
- public ITexture[] getTopFacingActive(byte aColor)
- {
- return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE) };
- }
-
- public ITexture[] getTopFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_EXTRACTOR) };
- }
-
- public ITexture[] getBottomFacingActive(byte aColor)
- {
- return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE) };
- }
-
- public ITexture[] getBottomFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_EXTRACTOR) };
- }
+ extends GT_MetaTileEntity_BasicMachine_Bronze {
+ public GT_MetaTileEntity_Extractor_Bronze(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, "Extracting your first Rubber", 1, 1, false);
+ }
+
+ public GT_MetaTileEntity_Extractor_Bronze(String aName, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aDescription, aTextures, 1, 1, false);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeExtractor.png", "ic2.extractor");
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Extractor_Bronze(this.mName, this.mDescription, this.mTextures);
+ }
+
+ public int checkRecipe() {
+ if (null != (this.mOutputItems[0] = GT_ModHandler.getExtractorOutput(getInputAt(0), true, getOutputAt(0)))) {
+ this.mEUt = 2;
+ this.mMaxProgresstime = 800;
+ return 2;
+ }
+ return 0;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {
+ return false;
+ }
+ return GT_ModHandler.getExtractorOutput(GT_Utility.copyAmount(64L, new Object[]{aStack}), false, null) != null;
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(200)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public void startProcess() {
+ sendLoopStart((byte) 1);
+ }
+
+ public ITexture[] getSideFacingActive(byte aColor) {
+ return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE)};
+ }
+
+ public ITexture[] getSideFacingInactive(byte aColor) {
+ return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_EXTRACTOR)};
+ }
+
+ public ITexture[] getFrontFacingActive(byte aColor) {
+ return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE)};
+ }
+
+ public ITexture[] getFrontFacingInactive(byte aColor) {
+ return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_EXTRACTOR)};
+ }
+
+ public ITexture[] getTopFacingActive(byte aColor) {
+ return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE)};
+ }
+
+ public ITexture[] getTopFacingInactive(byte aColor) {
+ return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_EXTRACTOR)};
+ }
+
+ public ITexture[] getBottomFacingActive(byte aColor) {
+ return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE)};
+ }
+
+ public ITexture[] getBottomFacingInactive(byte aColor) {
+ return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_EXTRACTOR)};
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java
index f30adfc533..db044aea0b 100644
--- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java
+++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java
@@ -2,7 +2,6 @@ package gregtech.common.tileentities.machines.steam;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.gui.GT_GUIContainer_BasicMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -11,102 +10,83 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachin
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
-
-import java.util.Map;
-
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_Extractor_Steel
- extends GT_MetaTileEntity_BasicMachine_Steel
-{
- public GT_MetaTileEntity_Extractor_Steel(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional, "Extracting your first Rubber", 1, 1, false);
- }
-
- public GT_MetaTileEntity_Extractor_Steel(String aName, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aDescription, aTextures, 1, 1, false);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelExtractor.png", "ic2.extractor");
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_Extractor_Steel(this.mName, this.mDescription, this.mTextures);
- }
-
- public int checkRecipe()
- {
- if (null != (this.mOutputItems[0] = GT_ModHandler.getExtractorOutput(getInputAt(0), true, getOutputAt(0))))
- {
- this.mEUt = 6;
- this.mMaxProgresstime = 400;
- return 2;
- }
- return 0;
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
- {
- if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {return false;}
- return GT_ModHandler.getExtractorOutput(GT_Utility.copyAmount(64L, new Object[] { aStack }), false, null) != null;
- }
-
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
- {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 1) {
- GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(200)), 10, 1.0F, aX, aY, aZ);
- }
- }
-
- public void startProcess()
- {
- sendLoopStart((byte)1);
- }
-
- public ITexture[] getSideFacingActive(byte aColor)
- {
- return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE) };
- }
-
- public ITexture[] getSideFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_EXTRACTOR) };
- }
-
- public ITexture[] getFrontFacingActive(byte aColor)
- {
- return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE) };
- }
-
- public ITexture[] getFrontFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_EXTRACTOR) };
- }
-
- public ITexture[] getTopFacingActive(byte aColor)
- {
- return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE) };
- }
-
- public ITexture[] getTopFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_EXTRACTOR) };
- }
-
- public ITexture[] getBottomFacingActive(byte aColor)
- {
- return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE) };
- }
-
- public ITexture[] getBottomFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_EXTRACTOR) };
- }
+ extends GT_MetaTileEntity_BasicMachine_Steel {
+ public GT_MetaTileEntity_Extractor_Steel(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, "Extracting your first Rubber", 1, 1, false);
+ }
+
+ public GT_MetaTileEntity_Extractor_Steel(String aName, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aDescription, aTextures, 1, 1, false);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelExtractor.png", "ic2.extractor");
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Extractor_Steel(this.mName, this.mDescription, this.mTextures);
+ }
+
+ public int checkRecipe() {
+ if (null != (this.mOutputItems[0] = GT_ModHandler.getExtractorOutput(getInputAt(0), true, getOutputAt(0)))) {
+ this.mEUt = 6;
+ this.mMaxProgresstime = 400;
+ return 2;
+ }
+ return 0;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {
+ return false;
+ }
+ return GT_ModHandler.getExtractorOutput(GT_Utility.copyAmount(64L, new Object[]{aStack}), false, null) != null;
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(200)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public void startProcess() {
+ sendLoopStart((byte) 1);
+ }
+
+ public ITexture[] getSideFacingActive(byte aColor) {
+ return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE)};
+ }
+
+ public ITexture[] getSideFacingInactive(byte aColor) {
+ return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_EXTRACTOR)};
+ }
+
+ public ITexture[] getFrontFacingActive(byte aColor) {
+ return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE)};
+ }
+
+ public ITexture[] getFrontFacingInactive(byte aColor) {
+ return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_EXTRACTOR)};
+ }
+
+ public ITexture[] getTopFacingActive(byte aColor) {
+ return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE)};
+ }
+
+ public ITexture[] getTopFacingInactive(byte aColor) {
+ return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_EXTRACTOR)};
+ }
+
+ public ITexture[] getBottomFacingActive(byte aColor) {
+ return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE)};
+ }
+
+ public ITexture[] getBottomFacingInactive(byte aColor) {
+ return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_EXTRACTOR)};
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java
index 8cdaf470c8..5b0877a3f1 100644
--- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java
+++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java
@@ -2,7 +2,6 @@ package gregtech.common.tileentities.machines.steam;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.gui.GT_GUIContainer_BasicMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -10,107 +9,83 @@ import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Bronze;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
-
-import java.util.Map;
-
import net.minecraft.entity.player.InventoryPlayer;
public class GT_MetaTileEntity_ForgeHammer_Bronze
- extends GT_MetaTileEntity_BasicMachine_Bronze
-{
- public GT_MetaTileEntity_ForgeHammer_Bronze(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional, "Forge Hammer", 1, 1, false);
- }
-
- public GT_MetaTileEntity_ForgeHammer_Bronze(String aName, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aDescription, aTextures, 1, 1, false);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_ForgeHammer_Bronze(this.mName, this.mDescription, this.mTextures);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeHammer.png", GT_Recipe.GT_Recipe_Map.sHammerRecipes.mUnlocalizedName, (byte)6, (byte)3);
- }
-
- public int checkRecipe()
- {
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[1], null, getAllInputs());
- if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs())))
- {
- this.mOutputItems[0] = tRecipe.getOutput(0);
- if (tRecipe.mEUt <= 16)
- {
- this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = (tRecipe.mDuration * 2);
- }
- else
- {
- this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = (tRecipe.mDuration * 2);
- }
- return 2;
+ extends GT_MetaTileEntity_BasicMachine_Bronze {
+ public GT_MetaTileEntity_ForgeHammer_Bronze(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, "Forge Hammer", 1, 1, false);
+ }
+
+ public GT_MetaTileEntity_ForgeHammer_Bronze(String aName, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aDescription, aTextures, 1, 1, false);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_ForgeHammer_Bronze(this.mName, this.mDescription, this.mTextures);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeHammer.png", GT_Recipe.GT_Recipe_Map.sHammerRecipes.mUnlocalizedName, (byte) 6, (byte) 3);
}
- return 0;
- }
-
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
- {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 1) {
- GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(1)), 10, 1.0F, aX, aY, aZ);
+
+ public int checkRecipe() {
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[1], null, getAllInputs());
+ if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) {
+ this.mOutputItems[0] = tRecipe.getOutput(0);
+ if (tRecipe.mEUt <= 16) {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = (tRecipe.mDuration * 2);
+ } else {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = (tRecipe.mDuration * 2);
+ }
+ return 2;
+ }
+ return 0;
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(1)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public void startProcess() {
+ sendLoopStart((byte) 1);
+ }
+
+ public ITexture[] getSideFacingActive(byte aColor) {
+ return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_HAMMER_ACTIVE)};
+ }
+
+ public ITexture[] getSideFacingInactive(byte aColor) {
+ return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_HAMMER)};
+ }
+
+ public ITexture[] getFrontFacingActive(byte aColor) {
+ return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_HAMMER_ACTIVE)};
+ }
+
+ public ITexture[] getFrontFacingInactive(byte aColor) {
+ return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_HAMMER)};
+ }
+
+ public ITexture[] getTopFacingActive(byte aColor) {
+ return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_HAMMER_ACTIVE)};
+ }
+
+ public ITexture[] getTopFacingInactive(byte aColor) {
+ return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_HAMMER)};
+ }
+
+ public ITexture[] getBottomFacingActive(byte aColor) {
+ return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE)};
+ }
+
+ public ITexture[] getBottomFacingInactive(byte aColor) {
+ return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_HAMMER)};
}
- }
-
- public void startProcess()
- {
- sendLoopStart((byte)1);
- }
-
- public ITexture[] getSideFacingActive(byte aColor)
- {
- return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_HAMMER_ACTIVE) };
- }
-
- public ITexture[] getSideFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_HAMMER) };
- }
-
- public ITexture[] getFrontFacingActive(byte aColor)
- {
- return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_HAMMER_ACTIVE) };
- }
-
- public ITexture[] getFrontFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_HAMMER) };
- }
-
- public ITexture[] getTopFacingActive(byte aColor)
- {
- return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_HAMMER_ACTIVE) };
- }
-
- public ITexture[] getTopFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_HAMMER) };
- }
-
- public ITexture[] getBottomFacingActive(byte aColor)
- {
- return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE) };
- }
-
- public ITexture[] getBottomFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_HAMMER) };
- }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java
index a8e4159809..6d2c7d48a8 100644
--- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java
+++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java
@@ -2,7 +2,6 @@ package gregtech.common.tileentities.machines.steam;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.gui.GT_GUIContainer_BasicMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -10,107 +9,83 @@ import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Steel;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
-
-import java.util.Map;
-
import net.minecraft.entity.player.InventoryPlayer;
public class GT_MetaTileEntity_ForgeHammer_Steel
- extends GT_MetaTileEntity_BasicMachine_Steel
-{
- public GT_MetaTileEntity_ForgeHammer_Steel(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional, "Forge Hammer", 1, 1, false);
- }
-
- public GT_MetaTileEntity_ForgeHammer_Steel(String aName, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aDescription, aTextures, 1, 1, false);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_ForgeHammer_Steel(this.mName, this.mDescription, this.mTextures);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelHammer.png", GT_Recipe.GT_Recipe_Map.sHammerRecipes.mUnlocalizedName, (byte)6, (byte)3);
- }
-
- public int checkRecipe()
- {
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[2], null, getAllInputs());
- if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs())))
- {
- this.mOutputItems[0] = tRecipe.getOutput(0);
- if (tRecipe.mEUt <= 16)
- {
- this.mEUt = (tRecipe.mEUt * 3);
- this.mMaxProgresstime = tRecipe.mDuration;
- }
- else
- {
- this.mEUt = (tRecipe.mEUt * 3);
- this.mMaxProgresstime = tRecipe.mDuration;
- }
- return 2;
+ extends GT_MetaTileEntity_BasicMachine_Steel {
+ public GT_MetaTileEntity_ForgeHammer_Steel(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, "Forge Hammer", 1, 1, false);
+ }
+
+ public GT_MetaTileEntity_ForgeHammer_Steel(String aName, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aDescription, aTextures, 1, 1, false);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_ForgeHammer_Steel(this.mName, this.mDescription, this.mTextures);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelHammer.png", GT_Recipe.GT_Recipe_Map.sHammerRecipes.mUnlocalizedName, (byte) 6, (byte) 3);
}
- return 0;
- }
-
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
- {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 1) {
- GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(1)), 10, 1.0F, aX, aY, aZ);
+
+ public int checkRecipe() {
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[2], null, getAllInputs());
+ if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) {
+ this.mOutputItems[0] = tRecipe.getOutput(0);
+ if (tRecipe.mEUt <= 16) {
+ this.mEUt = (tRecipe.mEUt * 3);
+ this.mMaxProgresstime = tRecipe.mDuration;
+ } else {
+ this.mEUt = (tRecipe.mEUt * 3);
+ this.mMaxProgresstime = tRecipe.mDuration;
+ }
+ return 2;
+ }
+ return 0;
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(1)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public void startProcess() {
+ sendLoopStart((byte) 1);
+ }
+
+ public ITexture[] getSideFacingActive(byte aColor) {
+ return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_HAMMER_ACTIVE)};
+ }
+
+ public ITexture[] getSideFacingInactive(byte aColor) {
+ return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_HAMMER)};
+ }
+
+ public ITexture[] getFrontFacingActive(byte aColor) {
+ return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_HAMMER_ACTIVE)};
+ }
+
+ public ITexture[] getFrontFacingInactive(byte aColor) {
+ return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_HAMMER)};
+ }
+
+ public ITexture[] getTopFacingActive(byte aColor) {
+ return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_HAMMER_ACTIVE)};
+ }
+
+ public ITexture[] getTopFacingInactive(byte aColor) {
+ return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_HAMMER)};
+ }
+
+ public ITexture[] getBottomFacingActive(byte aColor) {
+ return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE)};
+ }
+
+ public ITexture[] getBottomFacingInactive(byte aColor) {
+ return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_HAMMER)};
}
- }
-
- public void startProcess()
- {
- sendLoopStart((byte)1);
- }
-
- public ITexture[] getSideFacingActive(byte aColor)
- {
- return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_HAMMER_ACTIVE) };
- }
-
- public ITexture[] getSideFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_HAMMER) };
- }
-
- public ITexture[] getFrontFacingActive(byte aColor)
- {
- return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_HAMMER_ACTIVE) };
- }
-
- public ITexture[] getFrontFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_HAMMER) };
- }
-
- public ITexture[] getTopFacingActive(byte aColor)
- {
- return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_HAMMER_ACTIVE) };
- }
-
- public ITexture[] getTopFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_HAMMER) };
- }
-
- public ITexture[] getBottomFacingActive(byte aColor)
- {
- return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE) };
- }
-
- public ITexture[] getBottomFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_HAMMER) };
- }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java
index 0a4f86fc3f..1aaeb7f624 100644
--- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java
+++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java
@@ -2,7 +2,6 @@ package gregtech.common.tileentities.machines.steam;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.gui.GT_GUIContainer_BasicMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -11,102 +10,83 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachin
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
-
-import java.util.Map;
-
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_Furnace_Bronze
- extends GT_MetaTileEntity_BasicMachine_Bronze
-{
- public GT_MetaTileEntity_Furnace_Bronze(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional, "Smelting things with compressed Steam", 1, 1, true);
- }
-
- public GT_MetaTileEntity_Furnace_Bronze(String aName, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aDescription, aTextures, 1, 1, true);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeFurnace.png", "smelting");
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_Furnace_Bronze(this.mName, this.mDescription, this.mTextures);
- }
-
- public int checkRecipe()
- {
- if (null != (this.mOutputItems[0] = GT_ModHandler.getSmeltingOutput(getInputAt(0), true, getOutputAt(0))))
- {
- this.mEUt = 4;
- this.mMaxProgresstime = 256;
- return 2;
- }
- return 0;
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
- {
- if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {return false;}
- return GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64L, new Object[] { aStack }), false, null) != null;
- }
-
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
- {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 1) {
- GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(207)), 10, 1.0F, aX, aY, aZ);
- }
- }
-
- public void startProcess()
- {
- sendLoopStart((byte)1);
- }
-
- public ITexture[] getSideFacingActive(byte aColor)
- {
- return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_FURNACE_ACTIVE) };
- }
-
- public ITexture[] getSideFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_FURNACE) };
- }
-
- public ITexture[] getFrontFacingActive(byte aColor)
- {
- return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_FURNACE_ACTIVE) };
- }
-
- public ITexture[] getFrontFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_FURNACE) };
- }
-
- public ITexture[] getTopFacingActive(byte aColor)
- {
- return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_FURNACE_ACTIVE) };
- }
-
- public ITexture[] getTopFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_FURNACE) };
- }
-
- public ITexture[] getBottomFacingActive(byte aColor)
- {
- return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE) };
- }
-
- public ITexture[] getBottomFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_FURNACE) };
- }
+ extends GT_MetaTileEntity_BasicMachine_Bronze {
+ public GT_MetaTileEntity_Furnace_Bronze(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, "Smelting things with compressed Steam", 1, 1, true);
+ }
+
+ public GT_MetaTileEntity_Furnace_Bronze(String aName, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aDescription, aTextures, 1, 1, true);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeFurnace.png", "smelting");
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Furnace_Bronze(this.mName, this.mDescription, this.mTextures);
+ }
+
+ public int checkRecipe() {
+ if (null != (this.mOutputItems[0] = GT_ModHandler.getSmeltingOutput(getInputAt(0), true, getOutputAt(0)))) {
+ this.mEUt = 4;
+ this.mMaxProgresstime = 256;
+ return 2;
+ }
+ return 0;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {
+ return false;
+ }
+ return GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64L, new Object[]{aStack}), false, null) != null;
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(207)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public void startProcess() {
+ sendLoopStart((byte) 1);
+ }
+
+ public ITexture[] getSideFacingActive(byte aColor) {
+ return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_FURNACE_ACTIVE)};
+ }
+
+ public ITexture[] getSideFacingInactive(byte aColor) {
+ return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_FURNACE)};
+ }
+
+ public ITexture[] getFrontFacingActive(byte aColor) {
+ return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_FURNACE_ACTIVE)};
+ }
+
+ public ITexture[] getFrontFacingInactive(byte aColor) {
+ return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_FURNACE)};
+ }
+
+ public ITexture[] getTopFacingActive(byte aColor) {
+ return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_FURNACE_ACTIVE)};
+ }
+
+ public ITexture[] getTopFacingInactive(byte aColor) {
+ return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_FURNACE)};
+ }
+
+ public ITexture[] getBottomFacingActive(byte aColor) {
+ return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE)};
+ }
+
+ public ITexture[] getBottomFacingInactive(byte aColor) {
+ return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_FURNACE)};
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java
index 12b915af13..4e79958f06 100644
--- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java
+++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java
@@ -2,7 +2,6 @@ package gregtech.common.tileentities.machines.steam;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.gui.GT_GUIContainer_BasicMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -11,102 +10,83 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachin
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
-
-import java.util.Map;
-
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_Furnace_Steel
- extends GT_MetaTileEntity_BasicMachine_Steel
-{
- public GT_MetaTileEntity_Furnace_Steel(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional, "Smelting things with compressed Steam", 1, 1, true);
- }
-
- public GT_MetaTileEntity_Furnace_Steel(String aName, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aDescription, aTextures, 1, 1, true);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelFurnace.png", "smelting");
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_Furnace_Steel(this.mName, this.mDescription, this.mTextures);
- }
-
- public int checkRecipe()
- {
- if (null != (this.mOutputItems[0] = GT_ModHandler.getSmeltingOutput(getInputAt(0), true, getOutputAt(0))))
- {
- this.mEUt = 12;
- this.mMaxProgresstime = 128;
- return 2;
- }
- return 0;
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
- {
- if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {return false;}
- return GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64L, new Object[] { aStack }), false, null) != null;
- }
-
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
- {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 1) {
- GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(207)), 10, 1.0F, aX, aY, aZ);
- }
- }
-
- public void startProcess()
- {
- sendLoopStart((byte)1);
- }
-
- public ITexture[] getSideFacingActive(byte aColor)
- {
- return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_FURNACE_ACTIVE) };
- }
-
- public ITexture[] getSideFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_FURNACE) };
- }
-
- public ITexture[] getFrontFacingActive(byte aColor)
- {
- return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_FURNACE_ACTIVE) };
- }
-
- public ITexture[] getFrontFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_FURNACE) };
- }
-
- public ITexture[] getTopFacingActive(byte aColor)
- {
- return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_FURNACE_ACTIVE) };
- }
-
- public ITexture[] getTopFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_FURNACE) };
- }
-
- public ITexture[] getBottomFacingActive(byte aColor)
- {
- return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE) };
- }
-
- public ITexture[] getBottomFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_FURNACE) };
- }
+ extends GT_MetaTileEntity_BasicMachine_Steel {
+ public GT_MetaTileEntity_Furnace_Steel(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, "Smelting things with compressed Steam", 1, 1, true);
+ }
+
+ public GT_MetaTileEntity_Furnace_Steel(String aName, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aDescription, aTextures, 1, 1, true);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelFurnace.png", "smelting");
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Furnace_Steel(this.mName, this.mDescription, this.mTextures);
+ }
+
+ public int checkRecipe() {
+ if (null != (this.mOutputItems[0] = GT_ModHandler.getSmeltingOutput(getInputAt(0), true, getOutputAt(0)))) {
+ this.mEUt = 12;
+ this.mMaxProgresstime = 128;
+ return 2;
+ }
+ return 0;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {
+ return false;
+ }
+ return GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64L, new Object[]{aStack}), false, null) != null;
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(207)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public void startProcess() {
+ sendLoopStart((byte) 1);
+ }
+
+ public ITexture[] getSideFacingActive(byte aColor) {
+ return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_FURNACE_ACTIVE)};
+ }
+
+ public ITexture[] getSideFacingInactive(byte aColor) {
+ return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_FURNACE)};
+ }
+
+ public ITexture[] getFrontFacingActive(byte aColor) {
+ return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_FURNACE_ACTIVE)};
+ }
+
+ public ITexture[] getFrontFacingInactive(byte aColor) {
+ return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_FURNACE)};
+ }
+
+ public ITexture[] getTopFacingActive(byte aColor) {
+ return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_FURNACE_ACTIVE)};
+ }
+
+ public ITexture[] getTopFacingInactive(byte aColor) {
+ return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_FURNACE)};
+ }
+
+ public ITexture[] getBottomFacingActive(byte aColor) {
+ return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE)};
+ }
+
+ public ITexture[] getBottomFacingInactive(byte aColor) {
+ return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_FURNACE)};
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java
index fd84eab38c..6704b42499 100644
--- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java
+++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java
@@ -1,9 +1,7 @@
package gregtech.common.tileentities.machines.steam;
-import static gregtech.api.enums.GT_Values.V;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.gui.GT_GUIContainer_BasicMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -12,121 +10,105 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachin
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
-import java.util.Map;
import java.util.Random;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-import net.minecraftforge.fluids.FluidStack;
+import static gregtech.api.enums.GT_Values.V;
public class GT_MetaTileEntity_Macerator_Bronze
- extends GT_MetaTileEntity_BasicMachine_Bronze
-{
- public GT_MetaTileEntity_Macerator_Bronze(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional, "Macerating your Ores", 1, 1, false);
- }
-
- public GT_MetaTileEntity_Macerator_Bronze(String aName, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aDescription, aTextures, 1, 1, false);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeMacerator.png", "ic2.macerator");
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_Macerator_Bronze(this.mName, this.mDescription, this.mTextures);
- }
-
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick)
- {
- super.onPreTick(aBaseMetaTileEntity, aTick);
- if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive()) && (aBaseMetaTileEntity.getFrontFacing() != 1) && (aBaseMetaTileEntity.getCoverIDAtSide((byte)1) == 0) && (!aBaseMetaTileEntity.getOpacityAtSide((byte)1)))
- {
- Random tRandom = aBaseMetaTileEntity.getWorld().rand;
- aBaseMetaTileEntity.getWorld().spawnParticle("smoke", aBaseMetaTileEntity.getXCoord() + 0.8F - tRandom.nextFloat() * 0.6F, aBaseMetaTileEntity.getYCoord() + 0.9F + tRandom.nextFloat() * 0.2F, aBaseMetaTileEntity.getZCoord() + 0.8F - tRandom.nextFloat() * 0.6F, 0.0D, 0.0D, 0.0D);
- }
- }
-
- public int checkRecipe()
- {
- GT_Recipe_Map tMap = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes;
- if (tMap == null) return DID_NOT_FIND_RECIPE;
- GT_Recipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[1], null, null, getAllInputs());
- if (tRecipe == null) return DID_NOT_FIND_RECIPE;
- if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe;
- if (!canOutput(tRecipe)) {mOutputBlocked++; return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;}
- if(tRecipe.getOutput(0)!=null) mOutputItems[0] = tRecipe.getOutput(0);
- this.mEUt = 2;
- this.mMaxProgresstime = 800;
- getInputAt(0).stackSize-=tRecipe.mInputs[0].stackSize;
- return FOUND_AND_SUCCESSFULLY_USED_RECIPE;
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
- {
- if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {return false;}
- return GT_ModHandler.getMaceratorOutput(GT_Utility.copyAmount(64L, new Object[] { aStack }), false, null) != null;
- }
-
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
- {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 1) {
- GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(201)), 10, 1.0F, aX, aY, aZ);
- }
- }
-
- public void startProcess()
- {
- sendLoopStart((byte)1);
- }
-
- public ITexture[] getSideFacingActive(byte aColor)
- {
- return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE) };
- }
-
- public ITexture[] getSideFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_MACERATOR) };
- }
-
- public ITexture[] getFrontFacingActive(byte aColor)
- {
- return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE) };
- }
-
- public ITexture[] getFrontFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_MACERATOR) };
- }
-
- public ITexture[] getTopFacingActive(byte aColor)
- {
- return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR_ACTIVE) };
- }
-
- public ITexture[] getTopFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR) };
- }
-
- public ITexture[] getBottomFacingActive(byte aColor)
- {
- return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE) };
- }
-
- public ITexture[] getBottomFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_MACERATOR) };
- }
+ extends GT_MetaTileEntity_BasicMachine_Bronze {
+ public GT_MetaTileEntity_Macerator_Bronze(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, "Macerating your Ores", 1, 1, false);
+ }
+
+ public GT_MetaTileEntity_Macerator_Bronze(String aName, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aDescription, aTextures, 1, 1, false);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeMacerator.png", "ic2.macerator");
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Macerator_Bronze(this.mName, this.mDescription, this.mTextures);
+ }
+
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive()) && (aBaseMetaTileEntity.getFrontFacing() != 1) && (aBaseMetaTileEntity.getCoverIDAtSide((byte) 1) == 0) && (!aBaseMetaTileEntity.getOpacityAtSide((byte) 1))) {
+ Random tRandom = aBaseMetaTileEntity.getWorld().rand;
+ aBaseMetaTileEntity.getWorld().spawnParticle("smoke", aBaseMetaTileEntity.getXCoord() + 0.8F - tRandom.nextFloat() * 0.6F, aBaseMetaTileEntity.getYCoord() + 0.9F + tRandom.nextFloat() * 0.2F, aBaseMetaTileEntity.getZCoord() + 0.8F - tRandom.nextFloat() * 0.6F, 0.0D, 0.0D, 0.0D);
+ }
+ }
+
+ public int checkRecipe() {
+ GT_Recipe_Map tMap = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes;
+ if (tMap == null) return DID_NOT_FIND_RECIPE;
+ GT_Recipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[1], null, null, getAllInputs());
+ if (tRecipe == null) return DID_NOT_FIND_RECIPE;
+ if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe;
+ if (!canOutput(tRecipe)) {
+ mOutputBlocked++;
+ return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
+ }
+ if (tRecipe.getOutput(0) != null) mOutputItems[0] = tRecipe.getOutput(0);
+ this.mEUt = 2;
+ this.mMaxProgresstime = 800;
+ getInputAt(0).stackSize -= tRecipe.mInputs[0].stackSize;
+ return FOUND_AND_SUCCESSFULLY_USED_RECIPE;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {
+ return false;
+ }
+ return GT_ModHandler.getMaceratorOutput(GT_Utility.copyAmount(64L, new Object[]{aStack}), false, null) != null;
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(201)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public void startProcess() {
+ sendLoopStart((byte) 1);
+ }
+
+ public ITexture[] getSideFacingActive(byte aColor) {
+ return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE)};
+ }
+
+ public ITexture[] getSideFacingInactive(byte aColor) {
+ return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_MACERATOR)};
+ }
+
+ public ITexture[] getFrontFacingActive(byte aColor) {
+ return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE)};
+ }
+
+ public ITexture[] getFrontFacingInactive(byte aColor) {
+ return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_MACERATOR)};
+ }
+
+ public ITexture[] getTopFacingActive(byte aColor) {
+ return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR_ACTIVE)};
+ }
+
+ public ITexture[] getTopFacingInactive(byte aColor) {
+ return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR)};
+ }
+
+ public ITexture[] getBottomFacingActive(byte aColor) {
+ return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE)};
+ }
+
+ public ITexture[] getBottomFacingInactive(byte aColor) {
+ return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_MACERATOR)};
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java
index 59b13f6e70..41c4046e5a 100644
--- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java
+++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java
@@ -1,9 +1,7 @@
package gregtech.common.tileentities.machines.steam;
-import static gregtech.api.enums.GT_Values.V;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.gui.GT_GUIContainer_BasicMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -12,120 +10,105 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachin
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
-import java.util.Map;
import java.util.Random;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
+import static gregtech.api.enums.GT_Values.V;
public class GT_MetaTileEntity_Macerator_Steel
- extends GT_MetaTileEntity_BasicMachine_Steel
-{
- public GT_MetaTileEntity_Macerator_Steel(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional, "Macerating your Ores", 1, 1, false);
- }
-
- public GT_MetaTileEntity_Macerator_Steel(String aName, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aDescription, aTextures, 1, 1, false);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
- {
- return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelMacerator.png", "ic2.macerator");
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_Macerator_Steel(this.mName, this.mDescription, this.mTextures);
- }
-
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick)
- {
- super.onPreTick(aBaseMetaTileEntity, aTick);
- if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive()) && (aBaseMetaTileEntity.getFrontFacing() != 1) && (aBaseMetaTileEntity.getCoverIDAtSide((byte)1) == 0) && (!aBaseMetaTileEntity.getOpacityAtSide((byte)1)))
- {
- Random tRandom = aBaseMetaTileEntity.getWorld().rand;
- aBaseMetaTileEntity.getWorld().spawnParticle("smoke", aBaseMetaTileEntity.getXCoord() + 0.8F - tRandom.nextFloat() * 0.6F, aBaseMetaTileEntity.getYCoord() + 0.9F + tRandom.nextFloat() * 0.2F, aBaseMetaTileEntity.getZCoord() + 0.8F - tRandom.nextFloat() * 0.6F, 0.0D, 0.0D, 0.0D);
- }
- }
-
- public int checkRecipe()
- {
- GT_Recipe_Map tMap = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes;
- if (tMap == null) return DID_NOT_FIND_RECIPE;
- GT_Recipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[1], null, null, getAllInputs());
- if (tRecipe == null) return DID_NOT_FIND_RECIPE;
- if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe;
- if (!canOutput(tRecipe)) {mOutputBlocked++; return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;}
- if(tRecipe.getOutput(0)!=null) mOutputItems[0] = tRecipe.getOutput(0);
- this.mEUt = 6;
- this.mMaxProgresstime = 400;
- getInputAt(0).stackSize-=tRecipe.mInputs[0].stackSize;
- return FOUND_AND_SUCCESSFULLY_USED_RECIPE;
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
- {
- if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {return false;}
- return GT_ModHandler.getMaceratorOutput(GT_Utility.copyAmount(64L, new Object[] { aStack }), false, null) != null;
- }
-
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ)
- {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 1) {
- GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(201)), 10, 1.0F, aX, aY, aZ);
- }
- }
-
- public void startProcess()
- {
- sendLoopStart((byte)1);
- }
-
- public ITexture[] getSideFacingActive(byte aColor)
- {
- return new ITexture[] { super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE) };
- }
-
- public ITexture[] getSideFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_MACERATOR) };
- }
-
- public ITexture[] getFrontFacingActive(byte aColor)
- {
- return new ITexture[] { super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE) };
- }
-
- public ITexture[] getFrontFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_MACERATOR) };
- }
-
- public ITexture[] getTopFacingActive(byte aColor)
- {
- return new ITexture[] { super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR_ACTIVE) };
- }
-
- public ITexture[] getTopFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR) };
- }
-
- public ITexture[] getBottomFacingActive(byte aColor)
- {
- return new ITexture[] { super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE) };
- }
-
- public ITexture[] getBottomFacingInactive(byte aColor)
- {
- return new ITexture[] { super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_MACERATOR) };
- }
+ extends GT_MetaTileEntity_BasicMachine_Steel {
+ public GT_MetaTileEntity_Macerator_Steel(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, "Macerating your Ores", 1, 1, false);
+ }
+
+ public GT_MetaTileEntity_Macerator_Steel(String aName, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aDescription, aTextures, 1, 1, false);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelMacerator.png", "ic2.macerator");
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Macerator_Steel(this.mName, this.mDescription, this.mTextures);
+ }
+
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive()) && (aBaseMetaTileEntity.getFrontFacing() != 1) && (aBaseMetaTileEntity.getCoverIDAtSide((byte) 1) == 0) && (!aBaseMetaTileEntity.getOpacityAtSide((byte) 1))) {
+ Random tRandom = aBaseMetaTileEntity.getWorld().rand;
+ aBaseMetaTileEntity.getWorld().spawnParticle("smoke", aBaseMetaTileEntity.getXCoord() + 0.8F - tRandom.nextFloat() * 0.6F, aBaseMetaTileEntity.getYCoord() + 0.9F + tRandom.nextFloat() * 0.2F, aBaseMetaTileEntity.getZCoord() + 0.8F - tRandom.nextFloat() * 0.6F, 0.0D, 0.0D, 0.0D);
+ }
+ }
+
+ public int checkRecipe() {
+ GT_Recipe_Map tMap = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes;
+ if (tMap == null) return DID_NOT_FIND_RECIPE;
+ GT_Recipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[1], null, null, getAllInputs());
+ if (tRecipe == null) return DID_NOT_FIND_RECIPE;
+ if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe;
+ if (!canOutput(tRecipe)) {
+ mOutputBlocked++;
+ return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
+ }
+ if (tRecipe.getOutput(0) != null) mOutputItems[0] = tRecipe.getOutput(0);
+ this.mEUt = 6;
+ this.mMaxProgresstime = 400;
+ getInputAt(0).stackSize -= tRecipe.mInputs[0].stackSize;
+ return FOUND_AND_SUCCESSFULLY_USED_RECIPE;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {
+ return false;
+ }
+ return GT_ModHandler.getMaceratorOutput(GT_Utility.copyAmount(64L, new Object[]{aStack}), false, null) != null;
+ }
+
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1) {
+ GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(201)), 10, 1.0F, aX, aY, aZ);
+ }
+ }
+
+ public void startProcess() {
+ sendLoopStart((byte) 1);
+ }
+
+ public ITexture[] getSideFacingActive(byte aColor) {
+ return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE)};
+ }
+
+ public ITexture[] getSideFacingInactive(byte aColor) {
+ return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_MACERATOR)};
+ }
+
+ public ITexture[] getFrontFacingActive(byte aColor) {
+ return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE)};
+ }
+
+ public ITexture[] getFrontFacingInactive(byte aColor) {
+ return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_MACERATOR)};
+ }
+
+ public ITexture[] getTopFacingActive(byte aColor) {
+ return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR_ACTIVE)};
+ }
+
+ public ITexture[] getTopFacingInactive(byte aColor) {
+ return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR)};
+ }
+
+ public ITexture[] getBottomFacingActive(byte aColor) {
+ return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE)};
+ }
+
+ public ITexture[] getBottomFacingInactive(byte aColor) {
+ return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_MACERATOR)};
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_Locker.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_Locker.java
index f0beaa4584..c9b57fc728 100644
--- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_Locker.java
+++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_Locker.java
@@ -2,7 +2,6 @@ package gregtech.common.tileentities.storage;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -10,188 +9,152 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachi
import gregtech.api.objects.GT_ItemStack;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Utility;
-
-import java.util.Map;
-
import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
public class GT_MetaTileEntity_Locker
- extends GT_MetaTileEntity_TieredMachineBlock
-{
- public byte mType = 0;
-
- public GT_MetaTileEntity_Locker(int aID, String aName, String aNameRegional, int aTier)
- {
- super(aID, aName, aNameRegional, aTier, 4, "Stores and recharges Armor", new ITexture[0]);
- }
-
- public GT_MetaTileEntity_Locker(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aTier, 4, aDescription, aTextures);
- }
-
- public String[] getDescription()
- {
- return new String[] { this.mDescription, "Click with Screwdriver to change Style" };
- }
-
- public ITexture[][][] getTextureSet(ITexture[] aTextures)
- {
- ITexture[][][] rTextures = new ITexture[3][17][];
- for (byte i = -1; i < 16; i = (byte)(i + 1))
- {ITexture[] tmp0 ={ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][(i + 1)] };
- rTextures[0][(i + 1)] = tmp0;
- ITexture[] tmp1 ={ Textures.BlockIcons.MACHINE_CASINGS[this.mTier][(i + 1)], Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier] };
-rTextures[1][(i + 1)] = tmp1;
- ITexture[] tmp2 = { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][(i + 1)], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_LOCKER) };
-rTextures[2][(i + 1)] =tmp2;
- }
- return rTextures;
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
- {
- if (aSide == aFacing) {
- return new ITexture[] { this.mTextures[2][(aColorIndex + 1)][0], this.mTextures[2][(aColorIndex + 1)][1], Textures.BlockIcons.LOCKERS[java.lang.Math.abs(this.mType % Textures.BlockIcons.LOCKERS.length)] };
- }
- return this.mTextures[0][(aColorIndex + 1)];
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_Locker(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- public boolean isSimpleMachine()
- {
- return false;
- }
-
- public boolean isElectric()
- {
- return true;
- }
-
- public boolean isValidSlot(int aIndex)
- {
- return true;
- }
-
- public boolean isFacingValid(byte aFacing)
- {
- return aFacing > 1;
- }
-
- public boolean isEnetInput()
- {
- return true;
- }
-
- public boolean isInputFacing(byte aSide)
- {
- return aSide == getBaseMetaTileEntity().getBackFacing();
- }
-
- public boolean isTeleporterCompatible()
- {
- return false;
- }
-
- public long maxEUStore()
- {
- return gregtech.api.enums.GT_Values.V[this.mTier] * maxAmperesIn();
- }
-
- public long maxEUInput()
- {
- return gregtech.api.enums.GT_Values.V[this.mTier];
- }
-
- public long maxAmperesIn()
- {
- return this.mInventory.length * 2;
- }
-
- public int rechargerSlotStartIndex()
- {
- return 0;
- }
-
- public int rechargerSlotCount()
- {
- return getBaseMetaTileEntity().isAllowedToWork() ? this.mInventory.length : 0;
- }
-
- public boolean isAccessAllowed(EntityPlayer aPlayer)
- {
- return true;
- }
-
- public void saveNBTData(NBTTagCompound aNBT)
- {
- aNBT.setByte("mType", this.mType);
- }
-
- public void loadNBTData(NBTTagCompound aNBT)
- {
- this.mType = aNBT.getByte("mType");
- }
-
- public void onValueUpdate(byte aValue)
- {
- this.mType = aValue;
- }
-
- public byte getUpdateData()
- {
- return this.mType;
- }
-
- public void doSound(byte aIndex, double aX, double aY, double aZ)
- {
- if (aIndex == 16) {
- GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(3)), 1, 1.0F);
- }
- }
-
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ)
- {
- if (aSide == getBaseMetaTileEntity().getFrontFacing()) {
- this.mType = ((byte)(this.mType + 1));
- }
- }
-
- public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack)
- {
- return aSide != getBaseMetaTileEntity().getFrontFacing();
- }
-
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ)
- {
- if ((aBaseMetaTileEntity.isServerSide()) && (aSide == aBaseMetaTileEntity.getFrontFacing()))
- {
- for (int i = 0; i < 4; i++)
- {
- ItemStack tSwapStack = this.mInventory[i];
- this.mInventory[i] = aPlayer.inventory.armorInventory[i];
- aPlayer.inventory.armorInventory[i] = tSwapStack;
- }
- aPlayer.inventoryContainer.detectAndSendChanges();
- sendSound((byte)16);
- }
- return true;
- }
-
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
- {
- return false;
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
- {
- return false;
- }
+ extends GT_MetaTileEntity_TieredMachineBlock {
+ public byte mType = 0;
+
+ public GT_MetaTileEntity_Locker(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 4, "Stores and recharges Armor", new ITexture[0]);
+ }
+
+ public GT_MetaTileEntity_Locker(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 4, aDescription, aTextures);
+ }
+
+ public String[] getDescription() {
+ return new String[]{this.mDescription, "Click with Screwdriver to change Style"};
+ }
+
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[3][17][];
+ for (byte i = -1; i < 16; i = (byte) (i + 1)) {
+ ITexture[] tmp0 = {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][(i + 1)]};
+ rTextures[0][(i + 1)] = tmp0;
+ ITexture[] tmp1 = {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][(i + 1)], Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier]};
+ rTextures[1][(i + 1)] = tmp1;
+ ITexture[] tmp2 = {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][(i + 1)], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_LOCKER)};
+ rTextures[2][(i + 1)] = tmp2;
+ }
+ return rTextures;
+ }
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{this.mTextures[2][(aColorIndex + 1)][0], this.mTextures[2][(aColorIndex + 1)][1], Textures.BlockIcons.LOCKERS[java.lang.Math.abs(this.mType % Textures.BlockIcons.LOCKERS.length)]};
+ }
+ return this.mTextures[0][(aColorIndex + 1)];
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_Locker(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ public boolean isElectric() {
+ return true;
+ }
+
+ public boolean isValidSlot(int aIndex) {
+ return true;
+ }
+
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ public boolean isEnetInput() {
+ return true;
+ }
+
+ public boolean isInputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getBackFacing();
+ }
+
+ public boolean isTeleporterCompatible() {
+ return false;
+ }
+
+ public long maxEUStore() {
+ return gregtech.api.enums.GT_Values.V[this.mTier] * maxAmperesIn();
+ }
+
+ public long maxEUInput() {
+ return gregtech.api.enums.GT_Values.V[this.mTier];
+ }
+
+ public long maxAmperesIn() {
+ return this.mInventory.length * 2;
+ }
+
+ public int rechargerSlotStartIndex() {
+ return 0;
+ }
+
+ public int rechargerSlotCount() {
+ return getBaseMetaTileEntity().isAllowedToWork() ? this.mInventory.length : 0;
+ }
+
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setByte("mType", this.mType);
+ }
+
+ public void loadNBTData(NBTTagCompound aNBT) {
+ this.mType = aNBT.getByte("mType");
+ }
+
+ public void onValueUpdate(byte aValue) {
+ this.mType = aValue;
+ }
+
+ public byte getUpdateData() {
+ return this.mType;
+ }
+
+ public void doSound(byte aIndex, double aX, double aY, double aZ) {
+ if (aIndex == 16) {
+ GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(3)), 1, 1.0F);
+ }
+ }
+
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (aSide == getBaseMetaTileEntity().getFrontFacing()) {
+ this.mType = ((byte) (this.mType + 1));
+ }
+ }
+
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) {
+ return aSide != getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) {
+ if ((aBaseMetaTileEntity.isServerSide()) && (aSide == aBaseMetaTileEntity.getFrontFacing())) {
+ for (int i = 0; i < 4; i++) {
+ ItemStack tSwapStack = this.mInventory[i];
+ this.mInventory[i] = aPlayer.inventory.armorInventory[i];
+ aPlayer.inventory.armorInventory[i] = tSwapStack;
+ }
+ aPlayer.inventoryContainer.detectAndSendChanges();
+ sendSound((byte) 16);
+ }
+ return true;
+ }
+
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumChest.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumChest.java
index 08428153aa..a05ca2baf4 100644
--- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumChest.java
+++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumChest.java
@@ -1,63 +1,62 @@
package gregtech.common.tileentities.storage;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
import gregtech.api.enums.Textures;
-import gregtech.api.gui.GT_ContainerMetaTile_Machine;
-import gregtech.api.gui.GT_Container_1by1;
-import gregtech.api.gui.GT_Container_2by2;
-import gregtech.api.gui.GT_Container_3by3;
-import gregtech.api.gui.GT_Container_4by4;
-import gregtech.api.gui.GT_Container_BasicTank;
-import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
-import gregtech.api.gui.GT_GUIContainer_1by1;
-import gregtech.api.gui.GT_GUIContainer_2by2;
-import gregtech.api.gui.GT_GUIContainer_3by3;
-import gregtech.api.gui.GT_GUIContainer_4by4;
-import gregtech.api.gui.GT_GUIContainer_BasicTank;
import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Utility;
import gregtech.common.gui.GT_Container_QuantumChest;
import gregtech.common.gui.GT_GUIContainer_QuantumChest;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+
+public class GT_MetaTileEntity_QuantumChest extends GT_MetaTileEntity_TieredMachineBlock {
+ public int mItemCount = 0;
+ public ItemStack mItemStack = null;
+ public GT_MetaTileEntity_QuantumChest(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 3, "This Chest stores " + ((int) ((Math.pow(6, aTier)) * 270000)) + " Blocks");
+ }
+
+ public GT_MetaTileEntity_QuantumChest(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 3, aDescription, aTextures);
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return true;
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_QuantumChest(mName, mTier, mDescription, mTextures);
+ }
+
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) return true;
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
-public class GT_MetaTileEntity_QuantumChest extends GT_MetaTileEntity_TieredMachineBlock{
- public GT_MetaTileEntity_QuantumChest(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 3, "This Chest stores "+((int)((Math.pow(6, aTier))*270000))+" Blocks");
- }
-
-
- public int mItemCount = 0;
- public ItemStack mItemStack = null;
-
- public GT_MetaTileEntity_QuantumChest(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, 3, aDescription, aTextures);
- }
-
- @Override public boolean isSimpleMachine() {return true;}
- @Override public boolean isFacingValid(byte aFacing) {return true;}
- @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;}
- @Override public boolean isValidSlot(int aIndex) {return true;}
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_QuantumChest(mName, mTier, mDescription, mTextures);
- }
-
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) return true;
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
-
// public void onRightclick(EntityPlayer aPlayer)
// {
// ItemStack tPlayerItem = aPlayer.inventory.getCurrentItem();
@@ -95,143 +94,133 @@ public class GT_MetaTileEntity_QuantumChest extends GT_MetaTileEntity_TieredMach
// aPlayer.field_71069_bz.func_75142_b();
// }
// }
-
- @Override
+
+ @Override
public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_QuantumChest(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
+ return new GT_Container_QuantumChest(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_QuantumChest(aPlayerInventory, aBaseMetaTileEntity, getLocalName());
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
-
- if (getBaseMetaTileEntity().isServerSide()&& getBaseMetaTileEntity().isAllowedToWork())
- {
- if ((getItemCount() <= 0) ){
- this.mItemStack = null;
- this.mItemCount = 0;
- }
- if (this.mItemStack == null&&this.mInventory[0]!=null)
- {
- this.mItemStack = mInventory[0].copy();
- }
- if ((this.mInventory[0]!=null)&&(this.mItemCount < getMaxItemCount()) && GT_Utility.areStacksEqual(this.mInventory[0],this.mItemStack))
- {
- this.mItemCount += this.mInventory[0].stackSize;
- if (this.mItemCount > getMaxItemCount())
- {
- this.mInventory[0].stackSize = (this.mItemCount - getMaxItemCount());
- this.mItemCount = getMaxItemCount();
- }
- else
- {
- this.mInventory[0] = null;
- }
- }
- if (this.mInventory[1] == null&&mItemStack!=null)
- {
- this.mInventory[1] = mItemStack.copy();
- this.mInventory[1].stackSize = Math.min(mItemStack.getMaxStackSize(), this.mItemCount);
- this.mItemCount -= this.mInventory[1].stackSize;
- }
- else if ((this.mItemCount > 0) && GT_Utility.areStacksEqual(this.mInventory[1],this.mItemStack)&&this.mInventory[1].getMaxStackSize()>this.mInventory[1].stackSize)
- {
- int tmp = Math.min(this.mItemCount, this.mInventory[1].getMaxStackSize()-this.mInventory[1].stackSize);
- this.mInventory[1].stackSize += tmp;
- this.mItemCount -= tmp;
- }
- if(this.mItemStack!=null){
- this.mInventory[2]= this.mItemStack.copy();
- }else{this.mInventory[2]=null;}
- }
- }
-
- private int getItemCount()
- {
- return this.mItemCount;
- }
-
- public int getProgresstime()
- {
- return this.mItemCount + (this.mInventory[0] == null ? 0 : this.mInventory[0].stackSize) + (this.mInventory[1] == null ? 0 : this.mInventory[1].stackSize);
- }
-
- public int maxProgresstime()
- {
- return getMaxItemCount();
- }
-
- public int getMaxItemCount()
- {
- return (int) (((Math.pow(6, mTier))*270000) - 128);
- }
-
- public void setItemCount(int aCount)
- {
- this.mItemCount = aCount;
- }
-
- @Override
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return true;
- }
-
- @Override
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return true;
- }
-
- @Override
- public String[] getInfoData() {
-
- if(mItemStack==null){
- return new String[]{
- "Quantum Chest",
- "Stored Items:",
- "No Items",
- Integer.toString(0),
- Integer.toString(getMaxItemCount())};
- }
- return new String[] {
- "Quantum Chest",
- "Stored Items:",
- mItemStack.getDisplayName(),
- Integer.toString(mItemCount),
- Integer.toString(getMaxItemCount())};
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setInteger("mItemCount", this.mItemCount);
- if(this.mItemStack!=null)
- aNBT.setTag("mItemStack", this.mItemStack.writeToNBT(new NBTTagCompound()));
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- if(aNBT.hasKey("mItemCount"))
- this.mItemCount = aNBT.getInteger("mItemCount");
- if(aNBT.hasKey("mItemStack"))
- this.mItemStack = ItemStack.loadItemStackFromNBT((NBTTagCompound) aNBT.getTag("mItemStack"));
- }
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity,byte aSide, byte aFacing, byte aColorIndex, boolean aActive,boolean aRedstone) {
- if(aBaseMetaTileEntity.getFrontFacing()==0&&aSide==4){return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1],new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_QCHEST)}; }
- return aSide == aBaseMetaTileEntity.getFrontFacing() ? new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1],new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_QCHEST)} :new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1]};//aSide != aFacing ? mMachineBlock != 0 ? new ITexture[] {Textures.BlockIcons.CASING_BLOCKS[mMachineBlock]} : new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1]} : mMachineBlock != 0 ? aActive ? getTexturesActive(Textures.BlockIcons.CASING_BLOCKS[mMachineBlock]) : getTexturesInactive(Textures.BlockIcons.CASING_BLOCKS[mMachineBlock]) : aActive ? getTexturesActive(Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1]) : getTexturesInactive(Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1]);
- }
-
- @Override
- public ITexture[][][] getTextureSet(ITexture[] aTextures) {
- return new ITexture[0][0][0];
- }
+ return new GT_GUIContainer_QuantumChest(aPlayerInventory, aBaseMetaTileEntity, getLocalName());
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
+
+ if (getBaseMetaTileEntity().isServerSide() && getBaseMetaTileEntity().isAllowedToWork()) {
+ if ((getItemCount() <= 0)) {
+ this.mItemStack = null;
+ this.mItemCount = 0;
+ }
+ if (this.mItemStack == null && this.mInventory[0] != null) {
+ this.mItemStack = mInventory[0].copy();
+ }
+ if ((this.mInventory[0] != null) && (this.mItemCount < getMaxItemCount()) && GT_Utility.areStacksEqual(this.mInventory[0], this.mItemStack)) {
+ this.mItemCount += this.mInventory[0].stackSize;
+ if (this.mItemCount > getMaxItemCount()) {
+ this.mInventory[0].stackSize = (this.mItemCount - getMaxItemCount());
+ this.mItemCount = getMaxItemCount();
+ } else {
+ this.mInventory[0] = null;
+ }
+ }
+ if (this.mInventory[1] == null && mItemStack != null) {
+ this.mInventory[1] = mItemStack.copy();
+ this.mInventory[1].stackSize = Math.min(mItemStack.getMaxStackSize(), this.mItemCount);
+ this.mItemCount -= this.mInventory[1].stackSize;
+ } else if ((this.mItemCount > 0) && GT_Utility.areStacksEqual(this.mInventory[1], this.mItemStack) && this.mInventory[1].getMaxStackSize() > this.mInventory[1].stackSize) {
+ int tmp = Math.min(this.mItemCount, this.mInventory[1].getMaxStackSize() - this.mInventory[1].stackSize);
+ this.mInventory[1].stackSize += tmp;
+ this.mItemCount -= tmp;
+ }
+ if (this.mItemStack != null) {
+ this.mInventory[2] = this.mItemStack.copy();
+ } else {
+ this.mInventory[2] = null;
+ }
+ }
+ }
+
+ private int getItemCount() {
+ return this.mItemCount;
+ }
+
+ public void setItemCount(int aCount) {
+ this.mItemCount = aCount;
+ }
+
+ public int getProgresstime() {
+ return this.mItemCount + (this.mInventory[0] == null ? 0 : this.mInventory[0].stackSize) + (this.mInventory[1] == null ? 0 : this.mInventory[1].stackSize);
+ }
+
+ public int maxProgresstime() {
+ return getMaxItemCount();
+ }
+
+ public int getMaxItemCount() {
+ return (int) (((Math.pow(6, mTier)) * 270000) - 128);
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public String[] getInfoData() {
+
+ if (mItemStack == null) {
+ return new String[]{
+ "Quantum Chest",
+ "Stored Items:",
+ "No Items",
+ Integer.toString(0),
+ Integer.toString(getMaxItemCount())};
+ }
+ return new String[]{
+ "Quantum Chest",
+ "Stored Items:",
+ mItemStack.getDisplayName(),
+ Integer.toString(mItemCount),
+ Integer.toString(getMaxItemCount())};
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setInteger("mItemCount", this.mItemCount);
+ if (this.mItemStack != null)
+ aNBT.setTag("mItemStack", this.mItemStack.writeToNBT(new NBTTagCompound()));
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ if (aNBT.hasKey("mItemCount"))
+ this.mItemCount = aNBT.getInteger("mItemCount");
+ if (aNBT.hasKey("mItemStack"))
+ this.mItemStack = ItemStack.loadItemStackFromNBT((NBTTagCompound) aNBT.getTag("mItemStack"));
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aBaseMetaTileEntity.getFrontFacing() == 0 && aSide == 4) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_QCHEST)};
+ }
+ return aSide == aBaseMetaTileEntity.getFrontFacing() ? new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_QCHEST)} : new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1]};//aSide != aFacing ? mMachineBlock != 0 ? new ITexture[] {Textures.BlockIcons.CASING_BLOCKS[mMachineBlock]} : new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1]} : mMachineBlock != 0 ? aActive ? getTexturesActive(Textures.BlockIcons.CASING_BLOCKS[mMachineBlock]) : getTexturesInactive(Textures.BlockIcons.CASING_BLOCKS[mMachineBlock]) : aActive ? getTexturesActive(Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1]) : getTexturesInactive(Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1]);
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ return new ITexture[0][0][0];
+ }
} \ No newline at end of file
diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java
index 2b37049dc6..1be8e2ff6f 100644
--- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java
+++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java
@@ -2,128 +2,137 @@ package gregtech.common.tileentities.storage;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.metatileentity.implementations.*;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
import gregtech.api.objects.GT_RenderedTexture;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
public class GT_MetaTileEntity_QuantumTank
- extends GT_MetaTileEntity_BasicTank
-{
- public GT_MetaTileEntity_QuantumTank(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 3, "Stores "+((int)(Math.pow(6, aTier)*267000))+"L of fluid");
- }
-
- public GT_MetaTileEntity_QuantumTank(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, 3, aDescription, aTextures);
- }
-
- @Override
- public ITexture[][][] getTextureSet(ITexture[] aTextures) {
- return new ITexture[0][0][0];
- }
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- return aSide ==1 ? new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1],new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_QTANK)} :new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1]};
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- }
-
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) return true;
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
-
- @Override public boolean isSimpleMachine() {return true;}
- @Override public boolean isFacingValid(byte aFacing) {return true;}
- @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;}
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- }
-
- @Override
- public final byte getUpdateData() {
- return 0x00;
- }
-
- @Override
- public boolean doesFillContainers() {
- return true;
- }
-
- @Override
- public boolean doesEmptyContainers() {
- return true;
- }
-
- @Override
- public boolean canTankBeFilled() {
- return true;
- }
-
- @Override
- public boolean canTankBeEmptied() {
- return true;
- }
-
- @Override
- public boolean displaysItemStack() {
- return true;
- }
-
- @Override
- public boolean displaysStackSize() {
- return false;
- }
-
- @Override
- public String[] getInfoData() {
-
- if(mFluid==null){
- return new String[]{
- "Quantum Tank",
- "Stored Fluid:",
- "No Fluid",
- Integer.toString(0)+"L",
- Integer.toString(getCapacity())+"L"};
- }
- return new String[] {
- "Quantum Tank",
- "Stored Fluid:",
- mFluid.getLocalizedName(),
- Integer.toString(mFluid.amount)+"L",
- Integer.toString(getCapacity())+"L"};
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_QuantumTank(mName, mTier, mDescription, mTextures);
- }
-
- @Override
- public int getCapacity() {
- return (int) (Math.pow(6, mTier)*267000);
- }
-
- @Override
- public int getTankPressure() {
- return 100;
- }
-
+ extends GT_MetaTileEntity_BasicTank {
+ public GT_MetaTileEntity_QuantumTank(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 3, "Stores " + ((int) (Math.pow(6, aTier) * 267000)) + "L of fluid");
+ }
+
+ public GT_MetaTileEntity_QuantumTank(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 3, aDescription, aTextures);
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ return new ITexture[0][0][0];
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return aSide == 1 ? new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_QTANK)} : new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1]};
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) return true;
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ }
+
+ @Override
+ public final byte getUpdateData() {
+ return 0x00;
+ }
+
+ @Override
+ public boolean doesFillContainers() {
+ return true;
+ }
+
+ @Override
+ public boolean doesEmptyContainers() {
+ return true;
+ }
+
+ @Override
+ public boolean canTankBeFilled() {
+ return true;
+ }
+
+ @Override
+ public boolean canTankBeEmptied() {
+ return true;
+ }
+
+ @Override
+ public boolean displaysItemStack() {
+ return true;
+ }
+
+ @Override
+ public boolean displaysStackSize() {
+ return false;
+ }
+
+ @Override
+ public String[] getInfoData() {
+
+ if (mFluid == null) {
+ return new String[]{
+ "Quantum Tank",
+ "Stored Fluid:",
+ "No Fluid",
+ Integer.toString(0) + "L",
+ Integer.toString(getCapacity()) + "L"};
+ }
+ return new String[]{
+ "Quantum Tank",
+ "Stored Fluid:",
+ mFluid.getLocalizedName(),
+ Integer.toString(mFluid.amount) + "L",
+ Integer.toString(getCapacity()) + "L"};
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_QuantumTank(mName, mTier, mDescription, mTextures);
+ }
+
+ @Override
+ public int getCapacity() {
+ return (int) (Math.pow(6, mTier) * 267000);
+ }
+
+ @Override
+ public int getTankPressure() {
+ return 100;
+ }
+
} \ No newline at end of file