diff options
Diffstat (limited to 'src/main/java/gregtech/common/tileentities')
86 files changed, 4340 insertions, 2743 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 540f9991df..6e0879068b 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,67 +1,67 @@ -package gregtech.common.tileentities.automation;
-
-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_Buffer;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_Utility;
-import gregtech.common.gui.GT_Container_ChestBuffer;
-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 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.mDescriptionArray, 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);
- }
-}
+package gregtech.common.tileentities.automation; + +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_Buffer; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Utility; +import gregtech.common.gui.GT_Container_ChestBuffer; +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 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.mDescriptionArray, 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); + } +} 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 a0c752bdc0..73069ac0ed 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,79 +1,79 @@ -package gregtech.common.tileentities.automation;
-
-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_Buffer;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_Utility;
-import gregtech.common.gui.GT_Container_Filter;
-import gregtech.common.gui.GT_GUIContainer_Filter;
-import net.minecraft.entity.player.InventoryPlayer;
-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 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.mDescriptionArray, 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;
- }
- 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 GT_Utility.areStacksEqual(this.mInventory[(aIndex + 9)], aStack, this.bIgnoreNBT);
- }
-}
+package gregtech.common.tileentities.automation; + +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_Buffer; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Utility; +import gregtech.common.gui.GT_Container_Filter; +import gregtech.common.gui.GT_GUIContainer_Filter; +import net.minecraft.entity.player.InventoryPlayer; +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 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.mDescriptionArray, 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; + } + 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 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 9dde9094c0..7d9e7cda62 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 @@ -41,7 +41,7 @@ public class GT_MetaTileEntity_Regulator }
public boolean isValidSlot(int aIndex) {
- return aIndex < 9 ;
+ return aIndex < 9;
}
public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
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 dfea774a2f..82f8d6def9 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,41 +1,41 @@ -package gregtech.common.tileentities.automation;
-
-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.objects.GT_RenderedTexture;
-import gregtech.common.gui.GT_Container_SuperBuffer;
-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 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.mDescriptionArray, 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);
- }
-}
+package gregtech.common.tileentities.automation; + +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.objects.GT_RenderedTexture; +import gregtech.common.gui.GT_Container_SuperBuffer; +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 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.mDescriptionArray, 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/boilers/GT_MetaTileEntity_Boiler_Bronze.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java index c725634030..70f85673c4 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 @@ -14,7 +14,6 @@ import gregtech.common.GT_Pollution; import gregtech.common.gui.GT_Container_Boiler; import gregtech.common.gui.GT_GUIContainer_Boiler; import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.world.ChunkPosition; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidHandler; 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 8aef783b6b..352a9c66a3 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 @@ -14,7 +14,6 @@ import gregtech.common.GT_Pollution; import gregtech.common.gui.GT_Container_Boiler;
import gregtech.common.gui.GT_GUIContainer_Boiler;
import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.world.ChunkPosition;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidHandler;
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 e8b4ed1e8f..a7633b630c 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 @@ -1,151 +1,151 @@ -package gregtech.common.tileentities.boilers;
-
-import gregtech.api.enums.Dyes;
-import gregtech.api.enums.Textures;
-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.common.gui.GT_Container_Boiler;
-import gregtech.common.gui.GT_GUIContainer_Boiler;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.nbt.NBTTagCompound;
-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, new String[]{
- "Steam Power by the Sun",
- "Produces 120L of Steam per second",
- "Calcifies over time, reducing Steam output to 40L/s",
- "Break and replace to decalcify"});
- }
-
- public GT_MetaTileEntity_Boiler_Solar(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- }
-
- 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;
- }
- 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.mDescriptionArray, this.mTextures);
- }
-
- private int mRunTime = 0;
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- aNBT.setInteger("mRunTime", this.mRunTime);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- this.mRunTime = aNBT.getInteger("mRunTime");
- }
-
- 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);
- }
- }
- }
- }
- 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;
- mRunTime += 1;
- int tOutput = 150;
- if (mRunTime > 10000) {
- tOutput = Math.max(50, 150 - ((mRunTime - 10000) / 100));
- }
- if (this.mSteam == null) {
- this.mSteam = GT_ModHandler.getSteam(tOutput);
- } else if (GT_ModHandler.isSteam(this.mSteam)) {
- this.mSteam.amount += tOutput;
- } else {
- this.mSteam = GT_ModHandler.getSteam(tOutput);
- }
- }
- } 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);
- }
- }
-}
+package gregtech.common.tileentities.boilers; + +import gregtech.api.enums.Dyes; +import gregtech.api.enums.Textures; +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.common.gui.GT_Container_Boiler; +import gregtech.common.gui.GT_GUIContainer_Boiler; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.nbt.NBTTagCompound; +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, new String[]{ + "Steam Power by the Sun", + "Produces 120L of Steam per second", + "Calcifies over time, reducing Steam output to 40L/s", + "Break and replace to decalcify"}); + } + + public GT_MetaTileEntity_Boiler_Solar(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + 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; + } + 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.mDescriptionArray, this.mTextures); + } + + private int mRunTime = 0; + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setInteger("mRunTime", this.mRunTime); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + this.mRunTime = aNBT.getInteger("mRunTime"); + } + + 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); + } + } + } + } + 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; + mRunTime += 1; + int tOutput = 150; + if (mRunTime > 10000) { + tOutput = Math.max(50, 150 - ((mRunTime - 10000) / 100)); + } + if (this.mSteam == null) { + this.mSteam = GT_ModHandler.getSteam(tOutput); + } else if (GT_ModHandler.isSteam(this.mSteam)) { + this.mSteam.amount += tOutput; + } else { + this.mSteam = GT_ModHandler.getSteam(tOutput); + } + } + } 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); + } + } +} 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 208c4d4e91..b4b2097d86 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 @@ -14,13 +14,12 @@ import gregtech.common.GT_Pollution; import gregtech.common.gui.GT_Container_Boiler;
import gregtech.common.gui.GT_GUIContainer_Boiler;
import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.world.ChunkPosition;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidHandler;
public class GT_MetaTileEntity_Boiler_Steel
- extends GT_MetaTileEntity_Boiler {
+ extends GT_MetaTileEntity_Boiler {//TODO CHECK POLLUTION VALUES AND DESCRIPTIONS FOR POLLUTION SPOILERS
public GT_MetaTileEntity_Boiler_Steel(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, new String[]{
"Faster than the Bronze Boiler",
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 503a1f7efb..b1505b0e2a 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 @@ -10,6 +10,7 @@ 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_Log;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
@@ -72,6 +73,15 @@ public class GT_MetaTileEntity_DieselGenerator return rValue;
}
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if(aTick%100==0 && mFluid!=null && mFluid.amount>this.getCapacity()){
+ GT_Log.err.println("Dupe Abuse: "+aBaseMetaTileEntity.getOwnerName()+" Coords: "+aBaseMetaTileEntity.getXCoord()+" "+aBaseMetaTileEntity.getYCoord()+" "+aBaseMetaTileEntity.getZCoord());
+ aBaseMetaTileEntity.setToFire();
+ }
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ }
+
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]};
}
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 504b511de1..567d41ef00 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 @@ -16,7 +16,7 @@ public class GT_MetaTileEntity_FluidNaquadahReactor 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]);
+ super(aID, aName, aNameRegional, aTier, "Requires Long Enriched Naquadah Rods", new ITexture[0]);
onConfigLoad();
}
@@ -56,7 +56,7 @@ public class GT_MetaTileEntity_FluidNaquadahReactor }
public void onConfigLoad() {
- this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "FluidNaquadah.efficiency.tier." + this.mTier, 100);
+ this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "FluidNaquadah.efficiency.tier." + this.mTier, 125);
}
public ITexture[] getFront(byte aColor) {
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 293669094b..7365877d6b 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 @@ -1,107 +1,105 @@ -package gregtech.common.tileentities.generators;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.ConfigCategories;
-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;
-
-public class GT_MetaTileEntity_GasTurbine
- extends GT_MetaTileEntity_BasicGenerator {
-
- public static final int BASE_POLLUTION = 1;
-
- public int mEfficiency;
-
-
- public GT_MetaTileEntity_GasTurbine(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, new String[]{
- "Requires flammable Gasses",
- "Causes " + (int) (20 * BASE_POLLUTION * Math.pow(2, aTier - 1)) + " Pollution per second"});
- onConfigLoad();
- }
-
- public GT_MetaTileEntity_GasTurbine(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- 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.mDescriptionArray, 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 ITexture[] getSidesActive(byte aColor) {
- return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_SIDE_ACTIVE)};
- }
-
- @Override
- public int getPollution() {
- return (int) (GT_MetaTileEntity_GasTurbine.BASE_POLLUTION * Math.pow(2, mTier - 1));
- }
-}
+package gregtech.common.tileentities.generators; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; +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; + +public class GT_MetaTileEntity_GasTurbine + extends GT_MetaTileEntity_BasicGenerator { + + public static final int BASE_POLLUTION = 1; + + public int mEfficiency; + + public GT_MetaTileEntity_GasTurbine(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, new String[]{ + "Requires flammable Gasses"}); + onConfigLoad(); + } + + public GT_MetaTileEntity_GasTurbine(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + 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.mDescriptionArray, 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 ITexture[] getSidesActive(byte aColor) { + return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_SIDE_ACTIVE)}; + } + + @Override + public int getPollution() { + return (int) (GT_MetaTileEntity_GasTurbine.BASE_POLLUTION * Math.pow(2, mTier - 1)); + } +} diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java index 2ae23a0d80..2efe67384d 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java @@ -29,7 +29,7 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach @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?(aActive ? new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) : new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)):Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]}; + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1],aSide==1?(aActive ? new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) : new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)):Textures.BlockIcons.OVERLAYS_ENERGY_OUT_POWER[mTier]}; } @Override @@ -137,4 +137,4 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach @Override public void loadNBTData(NBTTagCompound aNBT) { } -}
\ 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 cb4d988658..6adde2638d 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 @@ -245,7 +245,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B @Override public long maxEUStore() { - return Math.max(getEUVar(), V[mTier] * 16000 + getMinimumStoredEU()); + return Math.max(getEUVar(), V[mTier] * 16000L + getMinimumStoredEU()); } public ITexture[] getFront(byte aColor) { 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 a8c0908ca4..52c7e1112c 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 @@ -47,7 +47,7 @@ public class GT_MetaTileEntity_PlasmaGenerator } public void onConfigLoad() { - this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "PlasmaGenerator.efficiency.tier." + this.mTier, (10 + (this.mTier * 10))); + this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "PlasmaGenerator.efficiency.tier." + this.mTier, Math.max(10,10 + Math.min(90,this.mTier * 10))); } 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 422901c850..864907ceaa 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 @@ -50,7 +50,7 @@ public class GT_MetaTileEntity_SolidNaquadahReactor }
public void onConfigLoad() {
- this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "SolidNaquadah.efficiency.tier." + this.mTier, 40 + mTier * 10);
+ this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "SolidNaquadah.efficiency.tier." + this.mTier, 80);
}
public ITexture[] getFront(byte aColor) {
diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SolidNaquadahReactor2.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SolidNaquadahReactor2.java new file mode 100644 index 0000000000..da993f059c --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SolidNaquadahReactor2.java @@ -0,0 +1,95 @@ +package gregtech.common.tileentities.generators; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; +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; + +public class GT_MetaTileEntity_SolidNaquadahReactor2 + extends GT_MetaTileEntity_BasicGenerator { + public int mEfficiency; + + public GT_MetaTileEntity_SolidNaquadahReactor2(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, "Requires Enriched Naquadah Rods", new ITexture[0]); + onConfigLoad(); + } + + public GT_MetaTileEntity_SolidNaquadahReactor2(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_SolidNaquadahReactor2(this.mName, this.mTier, this.mDescription, this.mTextures); + } + + public GT_Recipe.GT_Recipe_Map getRecipes() { + return GT_Recipe.GT_Recipe_Map.sLargeNaquadahReactorFuels; + } + + 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, 100); + } + + 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)}; + } + + @Override + public int getPollution() { + return 0; + } +} diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SolidNaquadahReactor3.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SolidNaquadahReactor3.java new file mode 100644 index 0000000000..373146937f --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SolidNaquadahReactor3.java @@ -0,0 +1,95 @@ +package gregtech.common.tileentities.generators; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; +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; + +public class GT_MetaTileEntity_SolidNaquadahReactor3 + extends GT_MetaTileEntity_BasicGenerator { + public int mEfficiency; + + public GT_MetaTileEntity_SolidNaquadahReactor3(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, "Requires Naquadria Rods", new ITexture[0]); + onConfigLoad(); + } + + public GT_MetaTileEntity_SolidNaquadahReactor3(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_SolidNaquadahReactor3(this.mName, this.mTier, this.mDescription, this.mTextures); + } + + public GT_Recipe.GT_Recipe_Map getRecipes() { + return GT_Recipe.GT_Recipe_Map.sHugeNaquadahReactorFuels; + } + + 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, 150); + } + + 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)}; + } + + @Override + public int getPollution() { + return 0; + } +} diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SolidNaquadahReactor4.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SolidNaquadahReactor4.java new file mode 100644 index 0000000000..26c7dae112 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SolidNaquadahReactor4.java @@ -0,0 +1,95 @@ +package gregtech.common.tileentities.generators; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; +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; + +public class GT_MetaTileEntity_SolidNaquadahReactor4 + extends GT_MetaTileEntity_BasicGenerator { + public int mEfficiency; + + public GT_MetaTileEntity_SolidNaquadahReactor4(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, "Requires Long Naquadria Rods", new ITexture[0]); + onConfigLoad(); + } + + public GT_MetaTileEntity_SolidNaquadahReactor4(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_SolidNaquadahReactor4(this.mName, this.mTier, this.mDescription, this.mTextures); + } + + public GT_Recipe.GT_Recipe_Map getRecipes() { + return GT_Recipe.GT_Recipe_Map.sExtraHugeNaquadahReactorFuels; + } + + 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, 200); + } + + 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)}; + } + + @Override + public int getPollution() { + return 0; + } +} 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 a9cd81f32d..27ffc096f0 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 @@ -1,38 +1,38 @@ -package gregtech.common.tileentities.machines;
-
-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;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric;
-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 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.mDescriptionArray, 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;
- }
-}
+package gregtech.common.tileentities.machines; + +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; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric; +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 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.mDescriptionArray, 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; + } +} 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 df91b61db9..694a701306 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,41 +1,41 @@ -package gregtech.common.tileentities.machines;
-
-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;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric;
-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 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.mDescriptionArray, 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;
- }
-}
+package gregtech.common.tileentities.machines; + +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; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric; +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 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.mDescriptionArray, 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; + } +} 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 04ee00e209..f697b75f0f 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 @@ -1,41 +1,41 @@ -package gregtech.common.tileentities.machines;
-
-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;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric;
-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 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.mDescriptionArray, 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;
- }
-}
+package gregtech.common.tileentities.machines; + +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; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric; +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 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.mDescriptionArray, 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; + } +} 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 eeecb3f88e..a86fb19928 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 @@ -1,41 +1,41 @@ -package gregtech.common.tileentities.machines;
-
-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;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric;
-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 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.mDescriptionArray, 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;
- }
-}
+package gregtech.common.tileentities.machines; + +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; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric; +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 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.mDescriptionArray, 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; + } +} diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java index 24eaf87292..b0f36ae7e5 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java @@ -1,25 +1,15 @@ package gregtech.common.tileentities.machines.basic; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; - import gregtech.api.GregTech_API; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; 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; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.objects.ItemData; -import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import gregtech.common.GT_UndergroundOil; @@ -36,6 +26,10 @@ import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.ChunkPosition; import net.minecraftforge.fluids.FluidStack; +import java.util.HashMap; +import java.util.Map; + + public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_BasicMachine { boolean ready = false; int radius; @@ -167,6 +161,12 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba } } + //private void putOil(int x, int z, HashMap<String, Integer> aOils) {//TODO Old method?? + // FluidStack tFluid = GT_Utility.undergroundOil(getBaseMetaTileEntity().getWorld(),x,z,false,0); + // if (tFluid.amount / 5000 > 0) + // aOils.put(x + "," + z + "," + (tFluid.amount / 5000) + "," + tFluid.getLocalizedName(), tFluid.amount / 5000); + //} + private void prospectOres(Map<String, Integer> aNearOres, Map<String, Integer> aMiddleOres, Map<String, Integer> aFarOres) { int tLeftXBound = this.getBaseMetaTileEntity().getXCoord() - radius; int tRightXBound = tLeftXBound + 2*radius; @@ -188,16 +188,12 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba } } - private void prospectHole( - int i, int k, Map<String, Integer> aOres) { - - String tFoundOre = null; + private void prospectHole(int i, int k, Map<String, Integer> aOres) { + String tFoundOre; for (int j = this.getBaseMetaTileEntity().getYCoord(); j > 0; j--) { tFoundOre = checkForOre(i, j, k); - if (tFoundOre == null) - continue; - - countOre(aOres, tFoundOre); + if (tFoundOre != null) + countOre(aOres, tFoundOre); } } 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 865c31285b..c135740096 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,103 +1,108 @@ -package gregtech.common.tileentities.machines.basic;
-
-import gregtech.api.enums.ItemList;
-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_BasicMachine;
-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;
-
-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 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.mDescriptionArray, 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;
- }
- 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;
- }
-
- 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;
- }
-}
+package gregtech.common.tileentities.machines.basic; + +import gregtech.api.enums.ItemList; +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_BasicMachine; +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; + +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 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.mDescriptionArray, 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 != DID_NOT_FIND_RECIPE) { + return tCheck; + } + 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; + calculateOverclockedNess(32,16); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + return FOUND_AND_SUCCESSFULLY_USED_RECIPE; + } + } + return DID_NOT_FIND_RECIPE; + } + 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; + calculateOverclockedNess(32,32); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + return FOUND_AND_SUCCESSFULLY_USED_RECIPE; + } + } + return DID_NOT_FIND_RECIPE; + } + 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; + calculateOverclockedNess(32,64); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + } + } + return DID_NOT_FIND_RECIPE; + } + } + return DID_NOT_FIND_RECIPE; + } + + 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[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; + } +} 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 c8a9e0be96..b614bc598e 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 @@ -7,6 +7,7 @@ import gregtech.api.metatileentity.BaseMetaTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicBatteryBuffer; import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; import static gregtech.api.enums.GT_Values.V; @@ -31,22 +32,20 @@ public class GT_MetaTileEntity_Charger extends GT_MetaTileEntity_BasicBatteryBuf @Override public long getMinimumStoredEU() { - return V[mTier] * 64 * mInventory.length; + return V[mTier] * 64L * mInventory.length; } @Override - public long maxEUStore() { - return V[mTier] * 256 * mInventory.length; - } + public long maxEUStore() { return V[mTier] * 256L * mInventory.length;} @Override public long maxAmperesIn() { - return mChargeableCount * 8; + return Math.max(mChargeableCount * 8L,4L); } @Override public long maxAmperesOut() { - return mBatteryCount * 4; + return Math.max(mBatteryCount * 4L,2L); } @Override @@ -61,7 +60,7 @@ public class GT_MetaTileEntity_Charger extends GT_MetaTileEntity_BasicBatteryBuf 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); + mBaseMetaTileEntity.increaseStoredEnergyUnits(GT_ModHandler.dischargeElectricItem(mMetaTileEntity.mInventory[i], GT_Utility.safeInt(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; } @@ -70,7 +69,7 @@ public class GT_MetaTileEntity_Charger extends GT_MetaTileEntity_BasicBatteryBuf 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); + mBaseMetaTileEntity.decreaseStoredEU(GT_ModHandler.chargeElectricItem(mMetaTileEntity.mInventory[i], GT_Utility.safeInt(Math.min(V[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_CuringOven.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CuringOven.java index fcddee5bb3..e2663a15e4 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CuringOven.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CuringOven.java @@ -1,8 +1,6 @@ package gregtech.common.tileentities.machines.basic; -import java.util.Iterator; - import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; import gregtech.api.gui.GT_Container_1by1; @@ -11,8 +9,8 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +import gregtech.api.objects.GT_RenderedTexture; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; 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 132072910d..1935cb348a 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,5 +1,6 @@ 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.interfaces.ITexture;
@@ -15,7 +16,7 @@ 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 " + Math.min(100, (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)});
+ super(aID, aName, aNameRegional, aTier, 1, "Disassembles Machines at " + Math.min(50 + 10 * aTier,100) + "% 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) {
@@ -46,28 +47,59 @@ public class GT_MetaTileEntity_Disassembler if (tNBT != null) {
tNBT = tNBT.getCompoundTag("GT.CraftingComponents");
if (tNBT != null) {
- this.mEUt = (16 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ boolean isAnyOutput=false;
+ calculateOverclockedNessDisassembler(16);
this.mMaxProgresstime = 80;
+ //In case recipe is too OP for that machine
+ if (mEUt == Integer.MAX_VALUE - 1)//&& mMaxProgresstime==Integer.MAX_VALUE-1
+ return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
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;
+ this.mMaxProgresstime *= 1.7F;
+ isAnyOutput=true;
}
}
}
- if(this.mTier>5){
- this.mMaxProgresstime = this.mMaxProgresstime >> (mTier-5);
- }
- if(mMaxProgresstime==80){
- return 0;
+ if(!isAnyOutput)
+ return DID_NOT_FIND_RECIPE;
+ for(int i=mTier-5;i>0;i--){
+ this.mMaxProgresstime>>=1;
+ if(this.mMaxProgresstime==0)
+ this.mEUt = this.mEUt>>1;
}
+ if(this.mEUt==0)
+ mEUt = 1;
+ if(this.mMaxProgresstime==0)
+ this.mMaxProgresstime = 1;
getInputAt(0).stackSize -= 1;
- return 2;
+ return FOUND_AND_SUCCESSFULLY_USED_RECIPE;
}
}
}
- return 0;
+ return DID_NOT_FIND_RECIPE;
+ }
+
+ private void calculateOverclockedNessDisassembler(int aEUt) {
+ if(mTier==0){
+ mEUt=aEUt>>2;
+ }else{
+ //Long EUt calculation
+ long xEUt=aEUt;
+ //Isnt too low EUt check?
+ long tempEUt = xEUt<GT_Values.V[1] ? GT_Values.V[1] : xEUt;
+
+ while (tempEUt <= GT_Values.V[mTier -1] * (long)mAmperage) {
+ tempEUt<<=2;//this actually controls overclocking
+ xEUt<<=2;//this is effect of overclocking
+ }
+ if(xEUt>Integer.MAX_VALUE-1){
+ mEUt = Integer.MAX_VALUE-1;
+ }else{
+ mEUt = (int)xEUt;
+ }
+ }
}
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
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 9de7168cf4..79c3e5399d 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,9 +1,6 @@ package gregtech.common.tileentities.machines.basic;
-import gregtech.api.enums.ConfigCategories;
-import gregtech.api.enums.ItemList;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.Textures;
+import gregtech.api.enums.*;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
@@ -54,15 +51,17 @@ public class GT_MetaTileEntity_Massfabricator @Override
public long maxEUStore() {
- return V[mTier] * 512;
+ return V[mTier] * 512L;
}
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[1]) * (int)Math.pow(2, this.mTier + 2));
- this.mMaxProgresstime = (sDurationMultiplier / (1 << this.mTier - 1));
+ calculateOverclockedNessMassFabricator();
+ //In case recipe is too OP for that machine
+ if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
+ return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
if (((tFluid = getFillableStack()) != null) && (tFluid.amount >= sUUAperUUM) && (tFluid.isFluidEqual(Materials.UUAmplifier.getFluid(1L)))) {
tFluid.amount -= sUUAperUUM;
this.mMaxProgresstime /= sUUASpeedBonus;
@@ -72,12 +71,50 @@ public class GT_MetaTileEntity_Massfabricator }
return 0;
}
-
- @Override
+ @Override
public GT_Recipe.GT_Recipe_Map getRecipeList() {
return GT_Recipe.GT_Recipe_Map.sMassFabFakeRecipes;
}
+ private void calculateOverclockedNessMassFabricator() {
+ if(mTier==0){
+ //Long time calculation
+ long xMaxProgresstime = ((long)sDurationMultiplier)<<1;
+ if(xMaxProgresstime>Integer.MAX_VALUE-1){
+ //make impossible if too long
+ mEUt=Integer.MAX_VALUE-1;
+ mMaxProgresstime=Integer.MAX_VALUE-1;
+ }else{
+ mEUt= (int)(GT_Values.V[1]<<2);//2^2=4 so shift <<2
+ mMaxProgresstime=(int)xMaxProgresstime;
+ }
+ }else{
+ //Long EUt calculation
+ long xEUt=GT_Values.V[1] * (long)Math.pow(2,mTier+2);
+
+ long tempEUt = GT_Values.V[1];
+
+ mMaxProgresstime = sDurationMultiplier;
+
+ while (tempEUt <= V[mTier -1]) {
+ tempEUt<<=2;//this actually controls overclocking
+ mMaxProgresstime>>=1;//this is effect of overclocking
+ if(mMaxProgresstime==0)
+ xEUt = (long)(xEUt/1.1D);//U know, if the time is less than 1 tick make the machine use less power
+ }
+ if(xEUt>Integer.MAX_VALUE-1){
+ mEUt = Integer.MAX_VALUE-1;
+ mMaxProgresstime = Integer.MAX_VALUE-1;
+ }else{
+ mEUt = (int)xEUt;
+ if(mEUt==0)
+ mEUt = 1;
+ if(mMaxProgresstime==0)
+ mMaxProgresstime = 1;//set time to 1 tick
+ }
+ }
+ }
+
public boolean isFluidInputAllowed(FluidStack aFluid) {
return aFluid.isFluidEqual(Materials.UUAmplifier.getFluid(1L));
}
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 859dd0a6e1..3d8cbb34ca 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,5 +1,6 @@ package gregtech.common.tileentities.machines.basic; +import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; @@ -7,6 +8,9 @@ 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.BaseMetaTileEntity; +import gregtech.api.metatileentity.BaseTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Config; @@ -18,6 +22,7 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; import net.minecraftforge.fluids.FluidStack; @@ -26,16 +31,16 @@ import static gregtech.api.enums.GT_Values.V; public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEntity_BasicTank { - public static boolean sInterDimensionalTeleportAllowed = true; + private static boolean sInterDimensionalTeleportAllowed = true; + private static int mMaxLoss = 50; + private static int mMaxLossDistance = 10000; + private static boolean mPassiveEnergyUse = 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 boolean hasBlock = false; public int tTargetX = 0; public int tTargetY = 0; public int tTargetZ = 0; @@ -57,7 +62,7 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { if (aBaseMetaTileEntity.isClientSide()) return true; - this.hasEgg = checkForEgg(); + this.hasBlock = checkForBlock(); aBaseMetaTileEntity.openGUI(aPlayer); return true; } @@ -78,7 +83,15 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt } public String[] getInfoData() { - return new String[]{"Coordinates:", "X: " + this.mTargetX, "Y: " + this.mTargetY, "Z: " + this.mTargetZ, "Dimension: " + this.mTargetD}; + return new String[]{ + "Coordinates:", + "X: "+EnumChatFormatting.GREEN+ this.mTargetX+EnumChatFormatting.RESET, + "Y: "+EnumChatFormatting.GREEN+ this.mTargetY+EnumChatFormatting.RESET, + "Z: "+EnumChatFormatting.GREEN+ this.mTargetZ+EnumChatFormatting.RESET, + "Dimension: " + EnumChatFormatting.GREEN+this.mTargetD+EnumChatFormatting.RESET, + "Dimension Valid: " + (GT_Utility.isRealDimension(this.mTargetD) ? EnumChatFormatting.GREEN+"Yes"+EnumChatFormatting.RESET : EnumChatFormatting.RED+"No"+EnumChatFormatting.RESET), + "Dimension Registered: " + (DimensionManager.isDimensionRegistered(this.mTargetD) ? EnumChatFormatting.GREEN+"Yes"+EnumChatFormatting.RESET : EnumChatFormatting.RED+"No"+EnumChatFormatting.RESET) + }; } @Override @@ -113,22 +126,22 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt @Override public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { - if (getBaseMetaTileEntity().isServerSide()) { + if (aBaseMetaTileEntity.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.mTargetX = aBaseMetaTileEntity.getXCoord(); + this.mTargetY = aBaseMetaTileEntity.getYCoord(); + this.mTargetZ = aBaseMetaTileEntity.getZCoord(); + this.mTargetD = aBaseMetaTileEntity.getWorld().provider.dimensionId; } - this.hasEgg = checkForEgg(); + this.hasBlock = checkForBlock(); } } - public boolean checkForEgg() { + public boolean checkForBlock() { 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) { + if (getBaseMetaTileEntity().getBlockOffset(i, j, k) == GregTech_API.sBlockMetal5 && getBaseMetaTileEntity().getMetaIDOffset(i, j, k) == 8) {//require osmiridium block return true; } } @@ -138,11 +151,19 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt } public boolean hasDimensionalTeleportCapability() { - return (this.mDebug) || (this.hasEgg) || (mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)) && mFluid.amount >= 1000); + return this.mDebug || + ( + sInterDimensionalTeleportAllowed && + ( + this.hasBlock || + 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))); + return this.mDebug || (hasDimensionalTeleportCapability() && GT_Utility.isRealDimension(this.mTargetD) && GT_Utility.isRealDimension(getBaseMetaTileEntity().getWorld().provider.dimensionId)); } @Override @@ -153,12 +174,12 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt super.onPostTick(aBaseMetaTileEntity, aTick); if (getBaseMetaTileEntity().isServerSide()) { if (getBaseMetaTileEntity().getTimer() % 100L == 50L) { - this.hasEgg = checkForEgg(); + this.hasBlock = checkForBlock(); } if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().getRedstone())) { if (getBaseMetaTileEntity().getStoredEU() > (V[mTier] * 16)) { if (mPassiveEnergyUse) { - getBaseMetaTileEntity().decreaseStoredEnergyUnits((long) Math.pow(2, mTier), false); + getBaseMetaTileEntity().decreaseStoredEnergyUnits(2L<<(mTier-1), false); } if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1))) { mFluid.amount--; @@ -181,14 +202,25 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt } } 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(tTile!=null) { + if (tTile instanceof IEnergyConnected) { + long packetSize=V[mTier]; + if(tTile instanceof IGregTechTileEntity){ + IMetaTileEntity mte=((IGregTechTileEntity) tTile).getMetaTileEntity(); + if(mte instanceof BaseMetaTileEntity) { + packetSize=((BaseMetaTileEntity) mte).getMaxSafeInput(); + } + } + long energyUse = 10; if (mMaxLossDistance != 0) { - tLoss = 10 + tDistance * (mMaxLoss - 10) / mMaxLossDistance; + energyUse = GT_Utility.safeInt(10L + (tDistance * Math.max(mMaxLoss - 10L, 0) / mMaxLossDistance)); + } + energyUse=packetSize + ((V[mTier] * energyUse) / 100); + if (getBaseMetaTileEntity().isUniversalEnergyStored(energyUse)) { + if (((IEnergyConnected) tTile).injectEnergyUnits((byte) 6, packetSize, 1) > 0) { + getBaseMetaTileEntity().decreaseStoredEnergyUnits(energyUse, false); + } } - getBaseMetaTileEntity().decreaseStoredEnergyUnits(V[mTier] + ((V[mTier] * tLoss) / 100), false); } } } 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 a4cbe31bca..3bc6717642 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 @@ -44,7 +44,7 @@ public class GT_MetaTileEntity_MonsterRepellent extends GT_MetaTileEntity_Tiered 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)) { + if (aBaseMetaTileEntity.isUniversalEnergyStored(getMinimumStoredEU()) && aBaseMetaTileEntity.decreaseStoredEnergyUnits(1L << (this.mTier * 2), false)) { mRange = 16 + (48 * mTier); } else { mRange = 4 + (12 * mTier); @@ -91,12 +91,12 @@ public class GT_MetaTileEntity_MonsterRepellent extends GT_MetaTileEntity_Tiered @Override public long getMinimumStoredEU() { - return 512; + return 512L; } @Override public long maxEUStore() { - return 512 + V[mTier] * 50; + return 512L + V[mTier] * 50; } @Override 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 0f3f618737..59b43cbcb2 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 @@ -1,143 +1,145 @@ -package gregtech.common.tileentities.machines.basic;
-
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
-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_BasicMachine;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-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 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.mDescriptionArray, 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;
- }
- 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");
- }
- }
- }
- 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 (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;
- }
-
- 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;
- }
-}
+package gregtech.common.tileentities.machines.basic; + +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +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_BasicMachine; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +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 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.mDescriptionArray, 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 != DID_NOT_FIND_RECIPE) { + return tCheck; + } + + calculateOverclockedNess(4,128); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + + 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"); + } + } + } + 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; + return 2; + } + if (getFillableStack().amount < 750) { + return 0; + } + getInputAt(0).stackSize -= 1; + getFillableStack().amount -= 750; + 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 2f1eecdd91..44c39612c6 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 @@ -1,53 +1,55 @@ -package gregtech.common.tileentities.machines.basic;
-
-import gregtech.api.enums.OrePrefixes;
-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;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-import net.minecraft.item.ItemStack;
-
-import java.util.ArrayList;
-
-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;
- } 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;
- }
-}
+package gregtech.common.tileentities.machines.basic; + +import gregtech.api.enums.OrePrefixes; +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; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.item.ItemStack; + +import java.util.ArrayList; + +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; + } 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)}); + calculateOverclockedNess(1,32); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + getInputAt(0).stackSize -= 1; + return 2; + } + } + } + } + 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 f484c4b635..2300118c24 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 @@ -17,8 +17,10 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.ChunkPosition; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidBlock; +import net.minecraftforge.fluids.IFluidHandler; import java.util.ArrayList; import java.util.Iterator; @@ -34,7 +36,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { 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!"); + super(aID, aName, aNameRegional, aTier, 3, "The best way of emptying Oceans! Outputs on top."); } public GT_MetaTileEntity_Pump(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -125,7 +127,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { ((GT_MetaTileEntity_Pump) tTileEntity.getMetaTileEntity()).mPumpTimer -= 1; } if (this.mPumpCountBelow <= 0) { - if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().isUniversalEnergyStored(16 * ((int) Math.pow(4, this.mTier)))) + if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().isUniversalEnergyStored(16 * ((long) Math.pow(4, this.mTier)))) && ((this.mFluid == null) || (this.mFluid.amount + 1000 <= getCapacity()))) { boolean tMovedOneDown = false; if ((this.mPumpList.isEmpty()) && (getBaseMetaTileEntity().getTimer() % 100L == 0L)) { @@ -150,7 +152,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { 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))); + scanForFluid(getBaseMetaTileEntity().getXCoord(), y, getBaseMetaTileEntity().getZCoord(), this.mPumpList, getBaseMetaTileEntity().getXCoord(), getBaseMetaTileEntity().getZCoord(), 10 * ((int) Math.pow(1.6D, this.mTier))); } } if ((!tMovedOneDown) && (this.mPumpTimer <= 0)) { @@ -160,12 +162,26 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { ((ChunkPosition) this.mPumpList.remove(this.mPumpList.size() - 1)).chunkPosZ))) { //Should this be empty? } - this.mPumpTimer = 160 / ((int) Math.pow(2, this.mTier)); + this.mPumpTimer = GT_Utility.safeInt(160 / (long)Math.pow(2, this.mTier) ); + this.mPumpTimer = mPumpTimer==0 ? 1 : mPumpTimer; } } } getBaseMetaTileEntity().setActive(!this.mPumpList.isEmpty()); } + + //auto outputs on top + if (this.mFluid != null && (aTick % 20 == 0)) { + IFluidHandler tTank = aBaseMetaTileEntity.getITankContainerAtSide((byte)1);//1 is up. + if (tTank != null) { + FluidStack tDrained = drain(1000, false); + if (tDrained != null) { + int tFilledAmount = tTank.fill(ForgeDirection.UP, tDrained, false); + if (tFilledAmount > 0) + tTank.fill(ForgeDirection.UP, drain(tFilledAmount, true), true); + } + } + } } } @@ -287,31 +303,31 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { 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); + getBaseMetaTileEntity().decreaseStoredEnergyUnits(16 * ((long) 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); + getBaseMetaTileEntity().decreaseStoredEnergyUnits(16 * ((long) Math.pow(4, this.mTier)), true); this.mFluid.amount += 1000; } else { return false; } } else { - getBaseMetaTileEntity().decreaseStoredEnergyUnits(4 * ((int) Math.pow(4, this.mTier)), true); + getBaseMetaTileEntity().decreaseStoredEnergyUnits(4 * ((long) 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); + getBaseMetaTileEntity().decreaseStoredEnergyUnits(16 * ((long) 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); + getBaseMetaTileEntity().decreaseStoredEnergyUnits(16 * ((long) Math.pow(4, this.mTier)), true); this.mFluid.amount += 1000; } else { return false; } } else { - getBaseMetaTileEntity().decreaseStoredEnergyUnits(4 * ((int) Math.pow(4, this.mTier)), true); + getBaseMetaTileEntity().decreaseStoredEnergyUnits(4 * ((long) Math.pow(4, this.mTier)), true); } } if ((aBlock instanceof IFluidBlock)) { @@ -321,7 +337,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { } 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); + getBaseMetaTileEntity().decreaseStoredEnergyUnits(16 * ((long) Math.pow(4, this.mTier)), true); } else { return false; } @@ -433,7 +449,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { @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)}; + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], (aSide == 0 || aSide == 1) ? new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) : new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ADV_PUMP)}; } @Override 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 591cf2f7b6..f3fcb3c5a7 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 @@ -45,8 +45,13 @@ public class GT_MetaTileEntity_Replicator 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)));
+
+ this.mEUt = GT_Utility.safeInt(gregtech.api.enums.GT_Values.V[this.mTier],1);
+ this.mMaxProgresstime = GT_Utility.safeInt(tMass * 1024L / (1 << this.mTier),1);
+ if (mMaxProgresstime == Integer.MAX_VALUE - 1 || mEUt == Integer.MAX_VALUE - 1)
+ return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
+
+
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) {
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 2698d9efc4..eacaf1703d 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 @@ -1,72 +1,76 @@ -package gregtech.common.tileentities.machines.basic;
-
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
-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_BasicMachine;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Recipe;
-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 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.mDescriptionArray, 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;
- }
-}
+package gregtech.common.tileentities.machines.basic; + +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +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_BasicMachine; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +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 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.mDescriptionArray, 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; + calculateOverclockedNess(32,128); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + this.mOutputItems[0] = tOutput; + return 2; + } + } else if (canOutput(new ItemStack[]{tOutput})) { + calculateOverclockedNess(32,16); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + this.mOutputItems[0] = tOutput; + return 2; + } + } + } + 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 f71027d63d..bbf6be7519 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 @@ -11,18 +11,13 @@ 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.util.GT_LanguageManager;
-import gregtech.api.util.GT_Log;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
+import gregtech.api.util.*;
import gregtech.common.items.behaviors.Behaviour_DataOrb;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.nbt.NBTTagString;
-import scala.tools.nsc.symtab.SymbolLoadersStats;
public class GT_MetaTileEntity_Scanner
extends GT_MetaTileEntity_BasicMachine {
@@ -58,8 +53,10 @@ public class GT_MetaTileEntity_Scanner 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));
+ calculateOverclockedNess(2,500);
+ //In case recipe is too OP for that machine
+ if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
+ return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
return 2;
}
this.mOutputItems[0] = GT_Utility.copy(new Object[]{aStack});
@@ -81,8 +78,10 @@ public class GT_MetaTileEntity_Scanner }
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));
+ calculateOverclockedNess(8,160);
+ //In case recipe is too OP for that machine
+ if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
+ return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
} else {
this.mMaxProgresstime = 1;
this.mEUt = 1;
@@ -96,8 +95,10 @@ public class GT_MetaTileEntity_Scanner 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));
+ calculateOverclockedNess(32,512);
+ //In case recipe is too OP for that machine
+ if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
+ return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
return 2;
}
ItemData tData = GT_OreDictUnificator.getAssociation(aStack);
@@ -108,8 +109,10 @@ public class GT_MetaTileEntity_Scanner 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));
+ calculateOverclockedNess(32,GT_Utility.safeInt(tData.mMaterial.mMaterial.getMass() * 8192L));
+ //In case recipe is too OP for that machine
+ if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
+ return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
return 2;
}
}
@@ -117,8 +120,10 @@ public class GT_MetaTileEntity_Scanner 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));
+ calculateOverclockedNess(32,128);
+ //In case recipe is too OP for that machine
+ if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
+ return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
return 2;
}
if (aStack.getItem() == Items.written_book) {
@@ -127,8 +132,10 @@ public class GT_MetaTileEntity_Scanner 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));
+ calculateOverclockedNess(32,128);
+ //In case recipe is too OP for that machine
+ if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
+ return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
return 2;
}
if (aStack.getItem() == Items.filled_map) {
@@ -137,8 +144,10 @@ public class GT_MetaTileEntity_Scanner 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));
+ calculateOverclockedNess(32,128);
+ //In case recipe is too OP for that machine
+ if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
+ return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
return 2;
}
}
@@ -149,8 +158,10 @@ public class GT_MetaTileEntity_Scanner 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));
+ calculateOverclockedNess(32,1000);
+ //In case recipe is too OP for that machine
+ if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
+ return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
return 2;
}
@@ -158,12 +169,14 @@ public class GT_MetaTileEntity_Scanner if(ItemList.Tool_DataStick.isStackEqual(getSpecialSlot(), false, true)&& aStack !=null){
for(GT_Recipe.GT_Recipe_AssemblyLine tRecipe:GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes){
if(GT_Utility.areStacksEqual(tRecipe.mResearchItem, aStack, true)){
+
this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()});
GT_Utility.ItemNBT.setBookTitle(this.mOutputItems[0], GT_LanguageManager.getTranslation(tRecipe.mOutput.getDisplayName())+" Construction Data");
+
NBTTagCompound tNBT = this.mOutputItems[0].getTagCompound();
if (tNBT == null) {
tNBT = new NBTTagCompound();
- }
+ }
tNBT.setTag("output", tRecipe.mOutput.writeToNBT(new NBTTagCompound()));
tNBT.setInteger("time", tRecipe.mDuration);
tNBT.setInteger("eu", tRecipe.mEUt);
@@ -175,9 +188,9 @@ public class GT_MetaTileEntity_Scanner tNBT.setTag("f"+i, tRecipe.mFluidInputs[i].writeToNBT(new NBTTagCompound()));
}
- tNBT.setString("author", "Assembly Line Recipe Generator");
+ tNBT.setString("author", "Assembling Line Recipe Generator");
NBTTagList tNBTList = new NBTTagList();
- tNBTList.appendTag(new NBTTagString("Constructionplan for "+tRecipe.mOutput.stackSize+" "+GT_LanguageManager.getTranslation(tRecipe.mOutput.getDisplayName())+". Needed EU/t: "+tRecipe.mEUt+" Productiontime: "+(tRecipe.mDuration/20)));
+ tNBTList.appendTag(new NBTTagString("Construction plan for "+tRecipe.mOutput.stackSize+" "+GT_LanguageManager.getTranslation(tRecipe.mOutput.getDisplayName())+". Needed EU/t: "+tRecipe.mEUt+" Production time: "+(tRecipe.mDuration/20)));
for(int i=0;i<tRecipe.mInputs.length;i++){
if(tRecipe.mInputs[i]!=null){
tNBTList.appendTag(new NBTTagString("Input Bus "+(i+1)+": "+tRecipe.mInputs[i].stackSize+" "+GT_LanguageManager.getTranslation(tRecipe.mInputs[i].getDisplayName())));
@@ -191,9 +204,12 @@ public class GT_MetaTileEntity_Scanner tNBT.setTag("pages", tNBTList);
this.mOutputItems[0].setTagCompound(tNBT);
+
aStack.stackSize -= 1;
- this.mMaxProgresstime = (tRecipe.mResearchTime / (1 << this.mTier - 1));
- this.mEUt = (30 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ calculateOverclockedNess(30,tRecipe.mResearchTime);
+ //In case recipe is too OP for that machine
+ if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
+ return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
getSpecialSlot().stackSize -= 1;
return 2;
}
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 85defad0cb..de9b656941 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 @@ -32,7 +32,7 @@ public class GT_MetaTileEntity_SeismicProspector extends GT_MetaTileEntity_Basic 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(8 Dynamite, 1 Glyceryl, 4 TNT or 2 ITNT), 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)}); + super(aID, aName, aNameRegional, aTier, 1, "Place, activate with explosives(8 Dynamite, 1 Glyceryl, 4 TNT or 2 ITNT), use Data Stick then Print.", 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) { 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 aa4e5645a0..83a83575b6 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 @@ -33,6 +33,7 @@ import net.minecraft.inventory.IInventory; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; import net.minecraftforge.fluids.FluidStack; @@ -40,16 +41,16 @@ import static gregtech.api.enums.GT_Values.V; public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { - public static boolean sInterDimensionalTeleportAllowed = true; - public static int sPassiveEnergyDrain = 2048; - public static int sPowerMultiplyer = 100; - public static double sFPowerMultiplyer = 1.0; + private static boolean sInterDimensionalTeleportAllowed = true; + private static int sPassiveEnergyDrain = 2048; + private static int sPowerMultiplyer = 100; + private static double sFPowerMultiplyer = 1.0; public int mTargetX = 0; public int mTargetY = 0; public int mTargetZ = 0; - public int mTargetD = 0; + public int mTargetD = Integer.MIN_VALUE;//0 public boolean mDebug = false; - public boolean hasEgg = 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."); @@ -145,7 +146,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { if (aBaseMetaTileEntity.isClientSide()) return true; - this.hasEgg = checkForEgg(); + //this.hasEgg = checkForEgg(); aBaseMetaTileEntity.openGUI(aPlayer); return true; } @@ -172,12 +173,20 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { public String[] getInfoData() { - return new String[]{"Coordinates:", "X: " + this.mTargetX, "Y: " + this.mTargetY, "Z: " + this.mTargetZ, "Dimension: " + this.mTargetD}; + return new String[]{ + "Coordinates:", + "X: "+ EnumChatFormatting.GREEN+ this.mTargetX+EnumChatFormatting.RESET, + "Y: "+EnumChatFormatting.GREEN+ this.mTargetY+EnumChatFormatting.RESET, + "Z: "+EnumChatFormatting.GREEN+ this.mTargetZ+EnumChatFormatting.RESET, + "Dimension: " + EnumChatFormatting.GREEN+this.mTargetD+EnumChatFormatting.RESET, + "Dimension Valid: " + (GT_Utility.isRealDimension(this.mTargetD) ? EnumChatFormatting.GREEN+"Yes"+EnumChatFormatting.RESET : EnumChatFormatting.RED+"No"+EnumChatFormatting.RESET), + "Dimension Registered: " + (DimensionManager.isDimensionRegistered(this.mTargetD) ? EnumChatFormatting.GREEN+"Yes"+EnumChatFormatting.RESET : EnumChatFormatting.RED+"No"+EnumChatFormatting.RESET) + }; } @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)}; + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], (aSide != this.getBaseMetaTileEntity().getFrontFacing()) ? new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER_SIDES) : aActive ? new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE) : new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER)}; } public void saveNBTData(NBTTagCompound aNBT) { @@ -208,55 +217,65 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { @Override public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { 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; + if ((this.mTargetX == 0) && (this.mTargetY == 0) && (this.mTargetZ == 0) && (this.mTargetD == Integer.MIN_VALUE)) { + this.mTargetX = aBaseMetaTileEntity.getXCoord(); + this.mTargetY = aBaseMetaTileEntity.getYCoord(); + this.mTargetZ = aBaseMetaTileEntity.getZCoord(); + this.mTargetD = aBaseMetaTileEntity.getWorld().provider.dimensionId; } - this.hasEgg = checkForEgg(); + //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 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 >= 10); + return this.mDebug || + //( + sInterDimensionalTeleportAllowed //&& + // ( + // 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))); + 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); + if (mFluid != null) {//Was if null -> Materials.Nitrogen.getPlasma(0); + mFluid = null; } super.onPostTick(aBaseMetaTileEntity, aTick); if (getBaseMetaTileEntity().isServerSide()) { - if (getBaseMetaTileEntity().getTimer() % 100L == 50L) { - this.hasEgg = checkForEgg(); - } + //if (getBaseMetaTileEntity().getTimer() % 100L == 50L) { + // this.hasEgg = checkForEgg(); + //} if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().getRedstone())) { if (getBaseMetaTileEntity().decreaseStoredEnergyUnits(sPassiveEnergyDrain, false)) { - if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasEgg || mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)))&& new XSTR().nextInt(10)==0) { - mFluid.amount--; - if (mFluid.amount < 1) { - mFluid = null; - } - } + //if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasEgg || mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)))&& new XSTR().nextInt(10)==0) { + // mFluid.amount--; + // if (mFluid.amount < 1) { + // mFluid = null; + // } + //} int tDistance = distanceCalculation(); if (mInventory[0] != null) { TileEntity tTile = null; @@ -272,7 +291,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { 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) (Math.pow(tDistance, 1.5) * tDistance * (tStacksize - (mInventory[0] == null ? 0 : mInventory[0].stackSize)) * sFPowerMultiplyer), false); + getBaseMetaTileEntity().decreaseStoredEnergyUnits((long) (Math.pow(tDistance, 1.5) * tDistance * (tStacksize - (mInventory[0] == null ? 0 : mInventory[0].stackSize)) * sFPowerMultiplyer), false); } } @@ -281,13 +300,13 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { if (((tObject instanceof Entity)) && (!((Entity) tObject).isDead)) { Entity tEntity = (Entity) tObject; // System.out.println("teleport"+(Math.pow(tDistance, 1.5))); - if (getBaseMetaTileEntity().decreaseStoredEnergyUnits((int) (Math.pow(tDistance, 1.5) * weightCalculation(tEntity) * sFPowerMultiplyer), false)) { - if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasEgg || mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)))) { - mFluid.amount = mFluid.amount - ((int) Math.min(10, (Math.pow(tDistance, 1.5) * weightCalculation(tEntity) / 8192))); - if (mFluid.amount < 1) { - mFluid = null; - } - } + if (getBaseMetaTileEntity().decreaseStoredEnergyUnits((long) (Math.pow(tDistance, 1.5) * weightCalculation(tEntity) * sFPowerMultiplyer), false)) { + //if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasEgg || mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)))) { + // mFluid.amount = mFluid.amount - ((int) Math.min(10, (Math.pow(tDistance, 1.5) * weightCalculation(tEntity) / 8192))); + // if (mFluid.amount < 1) { + // mFluid = null; + // } + //} if (tEntity.ridingEntity != null) { tEntity.mountEntity(null); } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java index 09fabef2a2..19adad356a 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java @@ -33,14 +33,14 @@ public class GT_MetaTileEntity_AssemblyLine } public String[] getDescription() { - return new String[]{"Assembly Line", + return new String[]{"Assembling Line", "Size: 3x(5-16)x4, variable length", - "Bottom: Steel Casing(or Maintenance or Input Hatch),", - "Input Bus(Last Output Bus), Steel Casing", - "Middle: Reinforced Glass, Assembly Line, Reinforced Glass", - "UpMiddle: Grate Casing, Assembling Casing,", - "Grate Casing(or Controller)", - "Top: Steel Casing(or Energy Hatch)", + "Bottom: Solid Steel Machine Casing(or Maintenance or Input Hatch),", + "Input Bus(Last Output Bus), Steel Machine Casing", + "Middle: Reinforced Glass, Assembling Line Casing, Reinforced Glass", + "UpMiddle: Grate Machine Casing, Assembler Machine Casing,", + "Grate Machine Casing(or Controller)", + "Top: Solid Steel Casing(or Energy Hatch)", "Up to 16 repeating slices, last is Output Bus"}; } @@ -135,19 +135,11 @@ public class GT_MetaTileEntity_AssemblyLine byte tTier = (byte) Math.max(1, GT_Utility.getTier(getMaxInputVoltage())); this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - if (mEUt <= 16) { - this.mEUt = (mEUt * (1 << tTier - 1) * (1 << tTier - 1)); - this.mMaxProgresstime = (mMaxProgresstime / (1 << tTier - 1)); - } else { - 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); + calculateOverclockedNessMulti(mEUt, mMaxProgresstime, 1, getMaxInputVoltage()); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + this.mEUt = this.mEUt > 0 ? -this.mEUt : this.mEUt;//makes it use power... updateSlots(); if(GT_Values.D1)System.out.println("Recipe sucessfull"); return true; @@ -296,4 +288,4 @@ public class GT_MetaTileEntity_AssemblyLine 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_BronzeBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java index 3b287d9ca4..c46ad5e7bc 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 @@ -22,7 +22,6 @@ import net.minecraft.init.Blocks; import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.world.ChunkPosition;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
@@ -207,7 +206,7 @@ public class GT_MetaTileEntity_BronzeBlastFurnace }
}
if(this.mMaxProgresstime>0 && (aTimer % 20L == 0L)){
- GT_Pollution.addPollution(getBaseMetaTileEntity(), 50);
+ GT_Pollution.addPollution(getBaseMetaTileEntity(), 200);
}
aBaseMetaTileEntity.setActive((this.mMaxProgresstime > 0) && (this.mMachine));
@@ -243,7 +242,7 @@ public class GT_MetaTileEntity_BronzeBlastFurnace aWorld.spawnParticle("largesmoke", xPos + floatGen.nextFloat(), yPos, zPos + floatGen.nextFloat(), 0.0D, 0.6D, 0.0D);
}
}
-}
+ }
private void addOutputProducts() {
if (this.mOutputItem1 != null) {
@@ -354,4 +353,4 @@ public class GT_MetaTileEntity_BronzeBlastFurnace public byte getTileEntityBaseType() {
return 0;
}
-}
\ No newline at end of file +}
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 ff3af18e53..098fb6af1c 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 @@ -8,6 +8,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; 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_Log; import gregtech.api.util.GT_Recipe; import gregtech.common.GT_Pollution; import net.minecraft.block.Block; @@ -16,6 +17,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.world.ChunkPosition; +import net.minecraftforge.oredict.OreDictionary; import java.util.ArrayList; @@ -87,7 +89,7 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock this.mEfficiency = 10000; this.mEfficiencyIncrease = 10000; this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - GT_Pollution.addPollution(getBaseMetaTileEntity(), mMaxProgresstime*5); + GT_Pollution.addPollution(getBaseMetaTileEntity(), mMaxProgresstime*10); return true; } else { this.mEfficiency = 0; @@ -98,17 +100,17 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock } private boolean checkRecursiveBlocks() { - ArrayList<ChunkPosition> tList1 = new ArrayList(); - ArrayList<ChunkPosition> tList2 = new ArrayList(); + ArrayList<ChunkPosition> tList1 = new ArrayList<>(); + ArrayList<ChunkPosition> tList2 = new ArrayList<>(); Block tBlock = this.getBaseMetaTileEntity().getBlockOffset(0, -1, 0); - if (!isWoodLog(tBlock)) { + if (!isWoodLog(tBlock, this.getBaseMetaTileEntity().getMetaIDOffset(0, -1, 0))) { return false; } else { tList2.add(new ChunkPosition(0, -1, 0)); } while (!tList2.isEmpty()) { - ChunkPosition tPos = (ChunkPosition) tList2.get(0); + ChunkPosition tPos = tList2.get(0); tList2.remove(0); if (!checkAllBlockSides(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ, tList1, tList2)) { return false; @@ -116,7 +118,7 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock } if (running) { for (ChunkPosition tPos : tList1) { - if (isWoodLog(this.getBaseMetaTileEntity().getBlockOffset(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ))) + if (isWoodLog(this.getBaseMetaTileEntity().getBlockOffset(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ), this.getBaseMetaTileEntity().getMetaIDOffset(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ))) 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; @@ -136,7 +138,7 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock p5 = false; p6 = false; Block tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX + 1, aY, aZ); - if (aX + 1 < 6 && (isWoodLog(tBlock))) { + if (aX + 1 < 6 && (isWoodLog(tBlock, this.getBaseMetaTileEntity().getMetaIDOffset(aX + 1, aY, aZ)))) { 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)) { @@ -144,7 +146,7 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock } tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX - 1, aY, aZ); - if (aX - 1 > -6 && (isWoodLog(tBlock))) { + if (aX - 1 > -6 && (isWoodLog(tBlock, this.getBaseMetaTileEntity().getMetaIDOffset(aX - 1, aY, aZ)))) { 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)) { @@ -152,7 +154,7 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock } tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX, aY + 1, aZ); - if (aY + 1 < 1 && (isWoodLog(tBlock))) { + if (aY + 1 < 1 && (isWoodLog(tBlock, this.getBaseMetaTileEntity().getMetaIDOffset(aX, aY + 1, aZ)))) { 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))) { @@ -160,7 +162,7 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock } tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX, aY - 1, aZ); - if (aY - 1 > -6 && (isWoodLog(tBlock))) { + if (aY - 1 > -6 && (isWoodLog(tBlock, this.getBaseMetaTileEntity().getMetaIDOffset(aX, aY - 1, aZ)))) { 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) { @@ -168,7 +170,7 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock } tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX, aY, aZ + 1); - if (aZ + 1 < 6 && (isWoodLog(tBlock))) { + if (aZ + 1 < 6 && (isWoodLog(tBlock, this.getBaseMetaTileEntity().getMetaIDOffset(aX, aY, aZ + 1)))) { 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)) { @@ -176,7 +178,7 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock } tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX, aY, aZ - 1); - if (aZ - 1 > -6 && (isWoodLog(tBlock))) { + if (aZ - 1 > -6 && (isWoodLog(tBlock, this.getBaseMetaTileEntity().getMetaIDOffset(aX, aY, aZ - 1)))) { 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)) { @@ -192,9 +194,13 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock return true; } - public boolean isWoodLog(Block log){ - String tTool = log.getHarvestTool(0); - return OrePrefixes.log.contains(new ItemStack(log, 1))&& ((tTool != null) && (tTool.equals("axe"))) && (log.getMaterial() == Material.wood); + private boolean isWoodLog(Block log, int meta){ + for (int id : OreDictionary.getOreIDs(new ItemStack(log, 1, meta))) { + if(OreDictionary.getOreName(id).equals("logWood")) + return true; + } + String tTool = log.getHarvestTool(meta); + return OrePrefixes.log.contains(new ItemStack(log, 1,meta)) && ((tTool != null) && (tTool.equals("axe"))) && (log.getMaterial() == Material.wood); } public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { @@ -222,4 +228,4 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlock 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_Cleanroom.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java index 170604ff6e..214628f39a 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java @@ -26,125 +26,129 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas super(aName); } - public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Cleanroom(this.mName); - } + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Cleanroom(this.mName); + } + @Override public String[] getDescription() { return new String[]{ "Controller Block for the Cleanroom", "Min(WxHxD): 3x4x3 (Hollow), Max(WxHxD): 15x15x15 (Hollow)", "Controller (Top center)", - "Top besides contoller and edges filter casings", - "1 Reinforced Door(keep closed for 100% efficency", + "Top besides contoller and edges: Filter Casings", + "1 Reinforced Door (keep closed for 100% efficency)", "1x Energy Hatch, 1x Maintainance Hatch", - "up to 10 Machine Hull Item & Energy transfer through walls", - "Remaining Blocks Plascrete"}; - } - - public boolean checkRecipe(ItemStack aStack) { - this.mEfficiencyIncrease = 100; - this.mMaxProgresstime = 100; - this.mEUt = -4; - return true; - } - - public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - int x = 1; - int z = 1; - int y = 1; - int mDoorCount = 0; - int mHullCount = 0; - int mPlascreteCount = 0; - boolean doorState = false; - mUpdate = 100; - for (int i = 1; i < 8; i++) { - Block tBlock = aBaseMetaTileEntity.getBlockOffset(i, 0, 0); - int tMeta = aBaseMetaTileEntity.getMetaIDOffset(i, 0, 0); - if (tBlock != GregTech_API.sBlockCasings3 || tMeta != 11) { - if (tBlock == GregTech_API.sBlockReinforced || tMeta == 2) { - x = i; - z = i; - break; - } else { - return false; - } - } - } - for (int i = -1; i > -16; i--) { - Block tBlock = aBaseMetaTileEntity.getBlockOffset(x, i, z); - int tMeta = aBaseMetaTileEntity.getMetaIDOffset(x, i, z); - if (tBlock != GregTech_API.sBlockReinforced || tMeta != 2) { - y = i + 1; - break; - } - } - if (y > -2) { - return false; - } - for (int dX = -x; dX <= x; dX++) { - for (int dZ = -z; dZ <= z; dZ++) { - for (int dY = 0; dY >= y; dY--) { - if (dX == -x || dX == x || dY == -y || dY == y || dZ == -z || dZ == z) { - Block tBlock = aBaseMetaTileEntity.getBlockOffset(dX, dY, dZ); - int tMeta = aBaseMetaTileEntity.getMetaIDOffset(dX, dY, dZ); - if (y == 0) { - if (dX == -x || dX == x || dZ == -z || dZ == z) { - if (tBlock != GregTech_API.sBlockReinforced || tMeta != 2) { - return false; - } - } else if (dX == 0 && dZ == 0) { - } else { - if (tBlock != GregTech_API.sBlockCasings3 || tMeta != 11) { - return false; - } - } - } else if (tBlock == GregTech_API.sBlockReinforced && tMeta == 2) { - mPlascreteCount++; - } else { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(dX, dY, dZ); - if ((!addMaintenanceToMachineList(tTileEntity, 82)) && (!addEnergyInputToMachineList(tTileEntity, 82))) { - if (tBlock instanceof ic2.core.block.BlockIC2Door) { - if ((tMeta & 8) == 0) { - doorState = (Math.abs(dX) > Math.abs(dZ) == ((tMeta & 1) != 0)) != ((tMeta & 4) != 0); - } - mDoorCount++; - } else { - if (tTileEntity == null) { - return false; - } - IMetaTileEntity aMetaTileEntity = tTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } - if (aMetaTileEntity instanceof GT_MetaTileEntity_BasicHull) { - mHullCount++; - } else { - return false; - } - } - } - } - } - } - } - } - if (mMaintenanceHatches.size() != 1 || mEnergyHatches.size() != 1 || mDoorCount != 2 || mHullCount > 10) { - return false; - } - for (int dX = -x + 1; dX <= x - 1; dX++) { - for (int dZ = -z + 1; dZ <= z - 1; dZ++) { - for (int dY = -1; dY >= y + 1; dY--) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(dX, dY, dZ); - if (tTileEntity != null) { - IMetaTileEntity aMetaTileEntity = tTileEntity.getMetaTileEntity(); - if (aMetaTileEntity != null && aMetaTileEntity instanceof GT_MetaTileEntity_BasicMachine_GT_Recipe) { - ((GT_MetaTileEntity_BasicMachine_GT_Recipe) aMetaTileEntity).mCleanroom = this; - } - } - } - } - } + "Up to 10 Machine Hull Item & Energy transfer through walls", + "Remaining Blocks: Plascrete, 20 min"}; + } + + @Override + public boolean checkRecipe(ItemStack aStack) { + this.mEfficiencyIncrease = 100; + this.mMaxProgresstime = 100; + this.mEUt = -4; + return true; + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + int x = 1; + int z = 1; + int y = 1; + int mDoorCount = 0; + int mHullCount = 0; + int mPlascreteCount = 0; + boolean doorState = false; + mUpdate = 100; + for (int i = 1; i < 8; i++) { + Block tBlock = aBaseMetaTileEntity.getBlockOffset(i, 0, 0); + int tMeta = aBaseMetaTileEntity.getMetaIDOffset(i, 0, 0); + if (tBlock != GregTech_API.sBlockCasings3 || tMeta != 11) { + if (tBlock == GregTech_API.sBlockReinforced || tMeta == 2) { + x = i; + z = i; + break; + } else { + return false; + } + } + } + for (int i = -1; i > -16; i--) { + Block tBlock = aBaseMetaTileEntity.getBlockOffset(x, i, z); + int tMeta = aBaseMetaTileEntity.getMetaIDOffset(x, i, z); + if (tBlock != GregTech_API.sBlockReinforced || tMeta != 2) { + y = i + 1; + break; + } + } + if (y > -2) { + return false; + } + for (int dX = -x; dX <= x; dX++) { + for (int dZ = -z; dZ <= z; dZ++) { + for (int dY = 0; dY >= y; dY--) { + if (dX == -x || dX == x || dY == -y || dY == y || dZ == -z || dZ == z) { + Block tBlock = aBaseMetaTileEntity.getBlockOffset(dX, dY, dZ); + int tMeta = aBaseMetaTileEntity.getMetaIDOffset(dX, dY, dZ); + if (y == 0) { + if (dX == -x || dX == x || dZ == -z || dZ == z) { + if (tBlock != GregTech_API.sBlockReinforced || tMeta != 2) { + return false; + } + } else if (dX == 0 && dZ == 0) { + } else { + if (tBlock != GregTech_API.sBlockCasings3 || tMeta != 11) { + return false; + } + } + } else if (tBlock == GregTech_API.sBlockReinforced && tMeta == 2) { + mPlascreteCount++; + } else { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(dX, dY, dZ); + if ((!addMaintenanceToMachineList(tTileEntity, 82)) && (!addEnergyInputToMachineList(tTileEntity, 82))) { + if (tBlock instanceof ic2.core.block.BlockIC2Door) { + if ((tMeta & 8) == 0) { + doorState = (Math.abs(dX) > Math.abs(dZ) == ((tMeta & 1) != 0)) != ((tMeta & 4) != 0); + } + mDoorCount++; + } else { + if (tTileEntity == null) { + return false; + } + IMetaTileEntity aMetaTileEntity = tTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_BasicHull) { + mHullCount++; + } else { + return false; + } + } + } + } + } + } + } + } + if (mMaintenanceHatches.size() != 1 || mEnergyHatches.size() != 1 || mDoorCount != 2 || mHullCount > 10) { + return false; + } + for (int dX = -x + 1; dX <= x - 1; dX++) { + for (int dZ = -z + 1; dZ <= z - 1; dZ++) { + for (int dY = -1; dY >= y + 1; dY--) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(dX, dY, dZ); + if (tTileEntity != null) { + IMetaTileEntity aMetaTileEntity = tTileEntity.getMetaTileEntity(); + if (aMetaTileEntity != null && aMetaTileEntity instanceof GT_MetaTileEntity_BasicMachine_GT_Recipe) { + ((GT_MetaTileEntity_BasicMachine_GT_Recipe) aMetaTileEntity).mCleanroom = this; + } + } + } + } + } if (doorState) { mEfficiency = Math.max(0, mEfficiency - 200); @@ -154,7 +158,7 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas aBaseMetaTileEntity.setInternalOutputRedstoneSignal(i, t); } - return true; + return mPlascreteCount>=20; } @Override @@ -171,39 +175,43 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas return new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.BLOCK_PLASCRETE)}; } - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MultiblockDisplay.png"); - } - - public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return null; - } - - public boolean isCorrectMachinePart(ItemStack aStack) { - return true; - } - - public boolean isFacingValid(byte aFacing) { - return aFacing > 1; - } - - 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 0; - } - - public boolean explodesOnComponentBreak(ItemStack aStack) { - return false; - } + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MultiblockDisplay.png"); + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return null; + } + + @Override + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + @Override + public boolean isFacingValid(byte aFacing) { + return aFacing > 1; + } + + @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 boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java index 55c83d1c91..1cab3f5ab8 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java @@ -9,6 +9,7 @@ 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_Dynamo; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; @@ -17,6 +18,7 @@ import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; @@ -40,14 +42,14 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_MultiBlock return new String[]{ "Controller Block for the Large Diesel Engine", "Size(WxHxD): 3x3x4, Controller (front centered)", - "3x3x4 of Stable Titanium Casing (hollow, Min 16!)", - "2x Titanium Gear Box Casing inside the Hollow Casing", - "8x Engine Intake Casings (around controller)", - "2x Input Hatch (one of the Casings next to a Gear Box)", + "3x3x4 of Stable Titanium Machine Casing (hollow, Min 16!)", + "2x Titanium Gear Box Machine Casing inside the Hollow Casing", + "8x Engine Intake Machine Casing (around controller)", + "2x Input Hatch (Fuel/Lubricant) (one of the Casings next to a Gear Box)", "1x Maintenance Hatch (one of the Casings next to a Gear Box)", "1x Muffler Hatch (top middle back, next to the rear Gear Box)", "1x Dynamo Hatch (back centered)", - "Engine Intake Casings not obstructed in front (only air blocks)", + "Engine Intake Casings must not be obstructed in front (only air blocks)", "Supply Diesel Fuel and 1000L of Lubricant per hour to run.", "Supply 40L of Oxygen per second to boost output (optional).", "Default: Produces 2048EU/t at 100% efficiency", @@ -93,7 +95,7 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_MultiBlock fuelValue = aFuel.mSpecialValue; fuelRemaining = hatchFluid1.amount; //Record available fuel - this.mEUt = mEfficiency < 2000 ? 0 : 2048; //Output 0 if startup is less than 20% + this.mEUt = mEfficiency < 2000 ? 0 : (int) ((boostEu?6144:2048) * (((float) Math.min(mEfficiency,10000)) / 10000)); //Output 0 if startup is less than 20% this.mProgresstime = 1; this.mMaxProgresstime = 1; this.mEfficiencyIncrease = 15; @@ -230,13 +232,34 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_MultiBlock @Override public String[] getInfoData() { + int mPollutionReduction=0; + for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { + if (isValidMetaTileEntity(tHatch)) { + mPollutionReduction=Math.max(tHatch.calculatePollutionReduction(100),mPollutionReduction); + } + } + + long storedEnergy=0; + long maxEnergy=0; + for(GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) { + if (isValidMetaTileEntity(tHatch)) { + storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity(); + } + } + return new String[]{ - "Diesel Engine", - "Current Output: "+mEUt*mEfficiency/10000 +" EU/t", - "Fuel Consumption: "+fuelConsumption+"L/t", - "Fuel Value: "+fuelValue+" EU/L", - "Fuel Remaining: "+fuelRemaining+" Litres", - "Current Efficiency: "+(mEfficiency/100)+"%"}; + EnumChatFormatting.BLUE+"Diesel Engine"+EnumChatFormatting.RESET, + "Stored Energy:", + EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+ + EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU", + "Current Output: "+EnumChatFormatting.RED+(-mEUt)+EnumChatFormatting.RESET+" EU/t", + "Fuel Consumption: "+EnumChatFormatting.YELLOW+fuelConsumption+EnumChatFormatting.RESET+" L/t", + "Fuel Value: "+EnumChatFormatting.YELLOW+fuelValue+EnumChatFormatting.RESET+" EU/L", + "Fuel Remaining: "+EnumChatFormatting.GOLD+fuelRemaining+EnumChatFormatting.RESET+" L", + "Current Efficiency: "+EnumChatFormatting.YELLOW+(mEfficiency/100F)+EnumChatFormatting.YELLOW+" %", + "Pollution reduced to: "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %" + }; } @Override 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 78f247bb3b..76628572da 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 @@ -9,6 +9,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; 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_ModHandler; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; @@ -23,7 +24,8 @@ import java.util.Arrays; public class GT_MetaTileEntity_DistillationTower extends GT_MetaTileEntity_MultiBlockBase { - private static boolean controller; + private static final int CASING_INDEX = 49; + private short controllerY; public GT_MetaTileEntity_DistillationTower(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -40,20 +42,23 @@ public class GT_MetaTileEntity_DistillationTower public String[] getDescription() { return new String[]{ "Controller Block for the Distillation Tower", - "Size(WxHxD): 3x6x3 (Hollow), Controller (Front bottom)", + "Size(WxHxD): 3xhx3 (Hollow), with h ranging from 3 to 12", + "Controller (Front bottom)", "1x Input Hatch (Any bottom layer casing)", - "5x Output Hatch (Any casing besides bottom layer)", + "2-11x Output Hatch (One per layer except bottom layer)", "1x Output Bus (Any bottom layer casing)", "1x Maintenance Hatch (Any casing)", "1x Energy Hatch (Any casing)", - "Clean Stainless Steel Casings for the rest (36 at least!)"}; + "Fluids are only put out at the correct height", + "The correct height equals the slot number in the NEI recipe", + "Clean Stainless Steel Machine Casings for the rest (7 x h - 5 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_DISTILLATION_TOWER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER)}; + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[CASING_INDEX], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER)}; } - return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[49]}; + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[CASING_INDEX]}; } public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { @@ -89,7 +94,7 @@ public class GT_MetaTileEntity_DistillationTower } long tVoltage = getMaxInputVoltage(); - byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + byte tTier = (byte) Math.max(0, GT_Utility.getTier(tVoltage)); FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); if (tFluids.length > 0) { for(int i = 0;i<tFluids.length;i++){ @@ -98,24 +103,16 @@ public class GT_MetaTileEntity_DistillationTower if (tRecipe.isRecipeInputEqual(true, tFluids, 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; - } - } + calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; 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.clone(); - ArrayUtils.reverse(mOutputFluids); updateSlots(); return true; } @@ -127,62 +124,61 @@ public class GT_MetaTileEntity_DistillationTower } public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + controllerY = aBaseMetaTileEntity.getYCoord(); 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.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]; - int mOutputHatches_sS=this.mOutputHatches.size(); - for (int i = 0; i < mOutputHatches_sS; i++) { - int hatchNumber = this.mOutputHatches.get(i).getBaseMetaTileEntity().getYCoord() - 1 - height; - if (tmpHatches[hatchNumber] == null) { - tmpHatches[hatchNumber] = this.mOutputHatches.get(i); - } else { - return false; - } + int y = 0; //height + int casingAmount = 0; + boolean reachedTop = false; + + for (int x = xDir - 1; x <= xDir + 1; x++) { //x=width + for (int z = zDir - 1; z <= zDir + 1; z++) { //z=depth + if (x != 0 || z != 0) { + IGregTechTileEntity tileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(x, y, z); + Block block = aBaseMetaTileEntity.getBlockOffset(x, y, z); + if (!addInputToMachineList(tileEntity, CASING_INDEX) + && !addOutputToMachineList(tileEntity, CASING_INDEX) + && !addMaintenanceToMachineList(tileEntity, CASING_INDEX) + && !addEnergyInputToMachineList(tileEntity, CASING_INDEX)) { + if (block == GregTech_API.sBlockCasings4 && aBaseMetaTileEntity.getMetaIDOffset(x, y, z) == 1) { + casingAmount++; + } else { + return false; + } + } + } + } + } + y++; + + while (y < 12 && !reachedTop) { + for (int x = xDir - 1; x <= xDir + 1; x++) { //x=width + for (int z = zDir - 1; z <= zDir + 1; z++) { //z=depth + IGregTechTileEntity tileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(x, y, z); + Block block = aBaseMetaTileEntity.getBlockOffset(x, y, z); + if (aBaseMetaTileEntity.getAirOffset(x, y, z)) { + if (x != xDir || z != zDir) { + return false; + } + } else { + if (x == xDir && z == zDir) { + reachedTop = true; + } + if (!addOutputToMachineList(tileEntity, CASING_INDEX) + && !addMaintenanceToMachineList(tileEntity, CASING_INDEX) + && !addEnergyInputToMachineList(tileEntity, CASING_INDEX)) { + if (block == GregTech_API.sBlockCasings4 && aBaseMetaTileEntity.getMetaIDOffset(x, y, z) == 1) { + casingAmount++; + } else { + return false; + } + } + } + } + } + y++; } - this.mOutputHatches.clear(); - for (int i = 0; i < tmpHatches.length; i++) { - this.mOutputHatches.add(tmpHatches[i]); - } - if(this.mMaintenanceHatches.size()!=1)return false; - return tAmount >= 36; - } - - public boolean ignoreController(Block tTileEntity) { - if (!controller && tTileEntity == GregTech_API.sBlockMachines) { - return true; - } - return false; + return casingAmount >= 7 * y - 5 && y >= 3 && y <= 12 && reachedTop; } public int getMaxEfficiency(ItemStack aStack) { @@ -201,4 +197,35 @@ public class GT_MetaTileEntity_DistillationTower public boolean explodesOnComponentBreak(ItemStack aStack) { return false; } + +@Override + public boolean addOutput(FluidStack aLiquid) { + if (aLiquid == null) return false; + FluidStack tLiquid = aLiquid.copy(); + for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) { + if (isValidMetaTileEntity(tHatch) && GT_ModHandler.isSteam(aLiquid) ? tHatch.outputsSteam() : tHatch.outputsLiquids()) { + if (tHatch.getBaseMetaTileEntity().getYCoord() == this.controllerY + 1) { + int tAmount = tHatch.fill(tLiquid, false); + if (tAmount >= tLiquid.amount) { + return tHatch.fill(tLiquid, true) >= tLiquid.amount; + } else if (tAmount > 0) { + tLiquid.amount = tLiquid.amount - tHatch.fill(tLiquid, true); + } + } + } + } + return false; + } + + @Override + protected void addFluidOutputs(FluidStack[] mOutputFluids2) { + for (int i = 0; i < mOutputFluids2.length; i++) { + if (mOutputHatches.size() > i && mOutputHatches.get(i) != null && mOutputFluids2[i] != null && isValidMetaTileEntity(mOutputHatches.get(i))) { + if (mOutputHatches.get(i).getBaseMetaTileEntity().getYCoord() == this.controllerY + 1 + i) { + mOutputHatches.get(i).fill(mOutputFluids2[i], true); + } + } + } + + } }
\ 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 0f07a3e743..ffc3db80c3 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 @@ -6,12 +6,15 @@ 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_Hatch_Energy;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler;
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.minecraft.util.EnumChatFormatting;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
@@ -117,24 +120,18 @@ public class GT_MetaTileEntity_ElectricBlastFurnace if ((tRecipe != null) && (this.mHeatingCapacity >= tRecipe.mSpecialValue) && (tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) {
this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
this.mEfficiencyIncrease = 10000;
- int tHeatCapacityDivTiers = (mHeatingCapacity - tRecipe.mSpecialValue) / 900;
- 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;
- int i = 2;
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
- this.mEUt *= 4;
- this.mMaxProgresstime /= (tHeatCapacityDivTiers >= i ? 4 : 2);
- i += 2;
- }
- }
- if (tHeatCapacityDivTiers > 0) this.mEUt = (int) (this.mEUt * (Math.pow(0.95, tHeatCapacityDivTiers)));
+ int tHeatCapacityDivTiers = (mHeatingCapacity - tRecipe.mSpecialValue)/900;
+ calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage);
+ //In case recipe is too OP for that machine
+ if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
+ return false;
if (this.mEUt > 0) {
this.mEUt = (-this.mEUt);
}
+ if(tHeatCapacityDivTiers>0){
+ this.mEUt = (int) (this.mEUt * (Math.pow(0.95, tHeatCapacityDivTiers)));
+ this.mMaxProgresstime >>=tHeatCapacityDivTiers/2;
+ }
this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)};
updateSlots();
@@ -144,7 +141,7 @@ public class GT_MetaTileEntity_ElectricBlastFurnace return false;
}
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ private boolean checkMachineFunction(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
@@ -224,15 +221,22 @@ public class GT_MetaTileEntity_ElectricBlastFurnace }
}
}
+ this.mHeatingCapacity += 100 * (GT_Utility.getTier(getMaxInputVoltage()) - 2);
return true;
}
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack){
+ boolean result= this.checkMachineFunction(aBaseMetaTileEntity,aStack);
+ if (!result) this.mHeatingCapacity=0;
+ return result;
+ }
+
public int getMaxEfficiency(ItemStack aStack) {
return 10000;
}
public int getPollutionPerTick(ItemStack aStack) {
- return 5;
+ return 20;
}
public int getDamageToComponent(ItemStack aStack) {
@@ -264,4 +268,44 @@ public class GT_MetaTileEntity_ElectricBlastFurnace }
}
}
+
+
+ @Override
+ public String[] getInfoData() {
+ int mPollutionReduction=0;
+ for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ mPollutionReduction=Math.max(tHatch.calculatePollutionReduction(100),mPollutionReduction);
+ }
+ }
+
+ long storedEnergy=0;
+ long maxEnergy=0;
+ for(GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU();
+ maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity();
+ }
+ }
+
+ return new String[]{
+ "Progress:",
+ EnumChatFormatting.GREEN + Integer.toString(mProgresstime/20) + EnumChatFormatting.RESET +" s / "+
+ EnumChatFormatting.YELLOW + Integer.toString(mMaxProgresstime/20) + EnumChatFormatting.RESET +" s",
+ "Stored Energy:",
+ EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+
+ EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU",
+ "Probably uses: "+
+ EnumChatFormatting.RED + Integer.toString(-mEUt) + EnumChatFormatting.RESET + " EU/t",
+ "Maximum total power (to all Energy Hatches, not single ones): ",
+ EnumChatFormatting.YELLOW+Long.toString(getMaxInputVoltage())+EnumChatFormatting.RESET+ " EU/t * 2A",
+ "Problems: "+
+ EnumChatFormatting.RED+ (getIdealStatus() - getRepairStatus())+EnumChatFormatting.RESET+
+ " Efficiency: "+
+ EnumChatFormatting.YELLOW+Float.toString(mEfficiency / 100.0F)+EnumChatFormatting.RESET + " %",
+ "Heat capacity: "+
+ EnumChatFormatting.GREEN+mHeatingCapacity+EnumChatFormatting.RESET+" K",
+ "Pollution reduced to: "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %"
+ };
+ }
}
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 b34b2dc85b..e6abada66c 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 @@ -19,6 +19,7 @@ import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -129,6 +130,18 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity return false; } + private boolean checkTier(byte tier, ArrayList<GT_MetaTileEntity_Hatch> list) { + if (list != null) { + int list_sS=list.size(); + for (int i = 0; i < list_sS; 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)) @@ -258,14 +271,14 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity 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; + 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; @@ -355,11 +368,11 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity if (aBaseMetaTileEntity.isAllowedToWork()) { this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU(); if (checkRecipe(mInventory[1])) { - if (this.mEUStore < this.mLastRecipe.mSpecialValue) { + if (this.mEUStore < this.mLastRecipe.mSpecialValue - this.mEUt) { mMaxProgresstime = 0; turnCasingActive(false); } - aBaseMetaTileEntity.decreaseStoredEnergyUnits(this.mLastRecipe.mSpecialValue, true); + aBaseMetaTileEntity.decreaseStoredEnergyUnits(this.mLastRecipe.mSpecialValue - this.mEUt, true); } } if (mMaxProgresstime <= 0) @@ -424,7 +437,7 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity @Override public String[] getInfoData() { - String tier = tier() == 6 ? "I" : tier() == 7 ? "II" : "III"; + String tier = tier() == 6 ? EnumChatFormatting.RED+"I"+EnumChatFormatting.RESET : tier() == 7 ? EnumChatFormatting.YELLOW+"II"+EnumChatFormatting.RESET : EnumChatFormatting.GRAY+"III"+EnumChatFormatting.RESET; float plasmaOut = 0; int powerRequired = 0; if (this.mLastRecipe != null) { @@ -435,14 +448,14 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity } return new String[]{ - "Fusion Reactor MK "+tier, - "EU Required: "+powerRequired+"EU/t", - "Stored EU: "+mEUStore+" / "+maxEUStore(), - "Plasma Output: "+plasmaOut+"L/t"}; + EnumChatFormatting.BLUE+"Fusion Reactor MK "+EnumChatFormatting.RESET+tier, + "EU Required: "+EnumChatFormatting.RED+powerRequired+EnumChatFormatting.RESET+"EU/t", + "Stored EU: "+EnumChatFormatting.GREEN+mEUStore+EnumChatFormatting.RESET+" EU / "+EnumChatFormatting.YELLOW+maxEUStore()+EnumChatFormatting.RESET+" EU", + "Plasma Output: "+EnumChatFormatting.YELLOW+plasmaOut+EnumChatFormatting.RESET+"L/t"}; } @Override public boolean isGivingInformation() { return true; } -}
\ 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 0f9fe133b3..77290441cd 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 @@ -48,7 +48,13 @@ public class GT_MetaTileEntity_FusionComputer1 extends GT_MetaTileEntity_FusionC } 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"}; + return new String[]{ + "It's over 9000!!!", + "LuV Machine Casings around Superconducting Coil Blocks", + "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 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 ea44772d77..c091d637bc 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 @@ -48,7 +48,14 @@ public class GT_MetaTileEntity_FusionComputer2 extends GT_MetaTileEntity_FusionC } 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"}; + return new String[]{ + "It's over 9000!!!", + "Fusion Machine Casings around Fusion Coil Blocks", + "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 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 870ac54846..bc50b5ee5f 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 @@ -48,7 +48,14 @@ public class GT_MetaTileEntity_FusionComputer3 extends GT_MetaTileEntity_FusionC } 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"}; + return new String[]{ + "A SUN DOWN ON EARTH", + "Fusion Machine Casings MK II around Fusion Coil Blocks", + "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 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 30a98f096b..6c786a749b 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 @@ -16,16 +16,19 @@ import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; 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 { + public static float penalty_per_config = 0.015f; // penalize 1.5% efficiency per circuitry level (1-25) private static boolean controller; - public GT_MetaTileEntity_Hatch_Input mInputHotFluidHatch; - public GT_MetaTileEntity_Hatch_Output mOutputColdFluidHatch; - public boolean superheated = false; + private GT_MetaTileEntity_Hatch_Input mInputHotFluidHatch; + private GT_MetaTileEntity_Hatch_Output mOutputColdFluidHatch; + private boolean superheated = false; + private int superheated_threshold=0; private float water; public GT_MetaTileEntity_HeatExchanger(int aID, String aName, String aNameRegional) { @@ -39,10 +42,10 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBloc return new String[]{ "Controller Block for the Heat Exchanger", "Size(WxHxD): 3x4x3, Controller (Front middle at bottom)", - "3x3x4 of Stable Titanium Casing (hollow, Min 24!)", - "2 Titanium Pipe Casing Blocks (Inside the Hollow Casing)", + "3x3x4 of Stable Titanium Machine Casings (hollow, Min 20!)", + "2x Titanium Pipe Casing (Inside the Hollow Machine Casings)", "1x Distillated Water Input (Any casing)", - "min 1 Steam Output (Any casing)", + "1x Steam Output (Any casing)", "1x Hot Fluid Input (Bottom center)", "1x Cold Fluid Output (Top Center)", "1x Maintenance Hatch (Any casing)"}; @@ -85,11 +88,10 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBloc int fluidAmountToConsume = mInputHotFluidHatch.getFluidAmount(); // how much fluid is in hatch - int superheated_threshold = 4000; // default: must have 4000L per second to generate superheated steam + 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 steam_output_multiplier = 20f; // default: multiply output by 4 * 10 (boosted x5) float penalty = 0.0f; // penalty to apply to output based on circuitry level (1-25). boolean do_lava = false; @@ -106,12 +108,15 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBloc // If we're working with lava, adjust the threshold and multipliers accordingly. if (GT_ModHandler.isLava(mInputHotFluidHatch.getFluid())) { - superheated_threshold /= 4; + steam_output_multiplier /= 5f; // lava is not boosted + superheated_threshold /= 4f; // unchanged do_lava = true; } else if (mInputHotFluidHatch.getFluid().isFluidEqual(FluidRegistry.getFluidStack("ic2hotcoolant", 1))) { - steam_output_multiplier = 2f; + //steam_output_multiplier /= 2f; // boosted x2 on top of x5 -> total x10 + superheated_threshold /=10f; // 10x smaller since the Hot Things production in reactor is the same. } else { // If we're working with neither, fail out + superheated_threshold=0; return false; } @@ -133,7 +138,7 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBloc private int useWater(float input) { water = water + input; int usage = (int) water; - water = water - (int) usage; + water = water - usage; return usage; } @@ -170,13 +175,15 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBloc 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 (!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; } @@ -209,7 +216,7 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBloc } } } - return (tCasingAmount >= 24); + return tCasingAmount >= 20; } public boolean ignoreController(Block tTileEntity) { @@ -282,4 +289,26 @@ public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBloc public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_HeatExchanger(this.mName); } + + @Override + public boolean isGivingInformation() { + return super.isGivingInformation(); + } + + @Override + public String[] getInfoData() { + return new String[]{ + "Progress:", + EnumChatFormatting.GREEN + Integer.toString(mProgresstime/20) + EnumChatFormatting.RESET +" s / "+ + EnumChatFormatting.YELLOW + Integer.toString(mMaxProgresstime/20) + EnumChatFormatting.RESET +" s", + "Probably uses (in steam): "+ + EnumChatFormatting.RED + Integer.toString(-mEUt) + EnumChatFormatting.RESET + " EU/t", + "Problems: "+ + EnumChatFormatting.RED+ (getIdealStatus() - getRepairStatus())+EnumChatFormatting.RESET+ + " Efficiency: "+ + EnumChatFormatting.YELLOW+Float.toString(mEfficiency / 100.0F)+EnumChatFormatting.RESET + " %", + "Super Heated: "+ (superheated?EnumChatFormatting.RED:EnumChatFormatting.BLUE) + superheated + EnumChatFormatting.RESET, + "Super Heated Threshold: "+ EnumChatFormatting.GREEN + superheated_threshold + EnumChatFormatting.RESET + }; + } }
\ No newline at end of file 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 090b84320b..fa94603f03 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 @@ -41,7 +41,7 @@ public class GT_MetaTileEntity_ImplosionCompressor "1x Maintenance Hatch (Any casing)",
"1x Muffler Hatch (Any casing)",
"1x Energy Hatch (Any casing)",
- "Solid Steel Casings for the rest (16 at least!)",
+ "Solid Steel Machine Casings for the rest (16 at least!)",
"Causes " + 20 * getPollutionPerTick(null) + " Pollution per second"};
}
@@ -89,9 +89,14 @@ public class GT_MetaTileEntity_ImplosionCompressor 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);
+ //OC THAT EXPLOSIVE SHIT!!!
+ calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, getMaxInputVoltage());
+ //In case recipe is too OP for that machine
+ if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
+ return false;
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)};
sendLoopStart((byte) 20);
updateSlots();
@@ -140,7 +145,7 @@ public class GT_MetaTileEntity_ImplosionCompressor }
public int getPollutionPerTick(ItemStack aStack) {
- return 100;
+ return 500;
}
public int getDamageToComponent(ItemStack aStack) {
@@ -150,4 +155,4 @@ public class GT_MetaTileEntity_ImplosionCompressor 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_LargeBoiler.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java index 467030cf21..fa7d32726c 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 @@ -51,7 +51,8 @@ public abstract class GT_MetaTileEntity_LargeBoiler "1x Muffler Hatch (Any Firebox)",
"Diesel fuels have 1/4 efficiency",
String.format("Takes %.2f seconds to heat up", 500.0 / getEfficiencyIncrease()),
- "Causes up to " + 20 * getPollutionPerTick(null) + " Pollution per second"};
+ //"Causes up to " + 20 * getPollutionPerTick(null) + " Pollution per second"
+};
}
public abstract String getCasingMaterial();
@@ -281,4 +282,4 @@ public abstract class GT_MetaTileEntity_LargeBoiler this.excessProjectedEU %= adjustedEUt;
return adjustedBurnTime;
}
-}
\ No newline at end of file +}
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 cc494498da..5ecd45508c 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 @@ -1,70 +1,70 @@ -package gregtech.common.tileentities.machines.multi;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-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 String getCasingMaterial(){
- return "Bronze";
- }
-
- 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;
- }
-}
+package gregtech.common.tileentities.machines.multi; + +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +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 String getCasingMaterial(){ + return "Bronze"; + } + + 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 984290a3c6..f7d7ad4b55 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 @@ -1,70 +1,70 @@ -package gregtech.common.tileentities.machines.multi;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-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 String getCasingMaterial(){
- return "Steel";
- }
-
- 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;
- }
-}
+package gregtech.common.tileentities.machines.multi; + +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +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 String getCasingMaterial(){ + return "Steel"; + } + + 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_TungstenSteel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java index b69bac2f94..126da571c5 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 @@ -1,71 +1,71 @@ -package gregtech.common.tileentities.machines.multi;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-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 String getCasingMaterial(){
- return "TungstenSteel";
- }
-
- 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;
- }
-
-}
+package gregtech.common.tileentities.machines.multi; + +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +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 String getCasingMaterial(){ + return "TungstenSteel"; + } + + 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_LargeChemicalReactor.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java new file mode 100644 index 0000000000..1a7b444b54 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java @@ -0,0 +1,199 @@ +package gregtech.common.tileentities.machines.multi; + +import java.util.ArrayList; +import java.util.Arrays; + +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.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; + +public class GT_MetaTileEntity_LargeChemicalReactor extends GT_MetaTileEntity_MultiBlockBase { + + private static final int CASING_INDEX = 52; + + public GT_MetaTileEntity_LargeChemicalReactor(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_MetaTileEntity_LargeChemicalReactor(String aName) { + super(aName); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_LargeChemicalReactor(this.mName); + } + + @Override + public String[] getDescription() { + return new String[] { + "Controller block for the Large Chemical Reactor", + "Has the same recipes as the Chemical Reactor", + "Does not lose efficiency when overclocked", + "Accepts fluids instead of fluid cells", + "Size(WxHxD): 3x3x3", + "3x3x3 of Chemically Inert Machine Casings (hollow, min 8!)", + "Controller (Front centered)", + "1x Cupronickel Coil Block (Bottom centered)", + "1x PTFE Pipe Machine Casing (inside the hollow casings)", + "1x Input Bus/Hatch (Any inert casing)", + "1x Output Bus/Hatch (Any inert casing)", + "1x Maintenance Hatch (Any inert casing)", + "1x Energy Hatch (Any inert casing)"}; + } + + @Override + 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[CASING_INDEX], + new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE + : Textures.BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR) }; + } + return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[CASING_INDEX] }; + } + + @Override + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + @Override + public boolean checkRecipe(ItemStack aStack) { + ArrayList<ItemStack> tInputList = getStoredInputs(); + int tInputList_sS = tInputList.size(); + for (int i = 0; i < tInputList_sS - 1; i++) { + for (int j = i + 1; j < tInputList_sS; 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--); + tInputList_sS = tInputList.size(); + } else { + tInputList.remove(i--); + tInputList_sS = tInputList.size(); + break; + } + } + } + } + ItemStack[] inputs = tInputList.toArray(new ItemStack[tInputList.size()]); + + ArrayList<FluidStack> tFluidList = getStoredFluids(); + int tFluidList_sS = tFluidList.size(); + for (int i = 0; i < tFluidList_sS - 1; i++) { + for (int j = i + 1; j < tFluidList_sS; j++) { + if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) { + if (tFluidList.get(i).amount >= tFluidList.get(j).amount) { + tFluidList.remove(j--); + tFluidList_sS = tFluidList.size(); + } else { + tFluidList.remove(i--); + tFluidList_sS = tFluidList.size(); + break; + } + } + } + } + FluidStack[] fluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); + + if (inputs.length > 0 || fluids.length > 0) { + long voltage = getMaxInputVoltage(); + byte tier = (byte) Math.max(1, GT_Utility.getTier(voltage)); + GT_Recipe recipe = GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.findRecipe(getBaseMetaTileEntity(), false, + gregtech.api.enums.GT_Values.V[tier], fluids, inputs); + if (recipe != null && recipe.isRecipeInputEqual(true, fluids, inputs)) { + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + + int EUt = recipe.mEUt; + int maxProgresstime = recipe.mDuration; + + while (EUt <= gregtech.api.enums.GT_Values.V[tier - 1] && maxProgresstime > 2) { + EUt *= 4; + maxProgresstime /= 4; + } + if (maxProgresstime < 2) { + maxProgresstime = 2; + EUt = recipe.mEUt * recipe.mDuration / 2; + } + + this.mEUt = -EUt; + this.mMaxProgresstime = maxProgresstime; + this.mOutputItems = recipe.mOutputs; + this.mOutputFluids = recipe.mFluidOutputs; + 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 casingAmount = 0; + // x=width, z=depth, y=height + for (int x = -1 + xDir; x <= xDir + 1; x++) { + for (int z = -1 + zDir; z <= zDir + 1; z++) { + for (int y = -1; y <= 1; y++) { + IGregTechTileEntity tileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(x, y, z); + Block block = aBaseMetaTileEntity.getBlockOffset(x, y, z); + if (x == xDir && z == zDir && y <= 0) { + if ((y == -1) + && (block != GregTech_API.sBlockCasings5 || aBaseMetaTileEntity.getMetaIDOffset(x, y, z) != 0)) { + return false; + } else if (y == 0 && (block != GregTech_API.sBlockCasings4 || aBaseMetaTileEntity.getMetaIDOffset(x, y, z) != 5)) { + return false; + } + } else if (x != 0 || y != 0 || z != 0) { + if (!addInputToMachineList(tileEntity, CASING_INDEX) && !addOutputToMachineList(tileEntity, CASING_INDEX) + && !addMaintenanceToMachineList(tileEntity, CASING_INDEX) + && !addEnergyInputToMachineList(tileEntity, CASING_INDEX)) { + if (block == GregTech_API.sBlockCasings4 && aBaseMetaTileEntity.getMetaIDOffset(x, y, z) == 4) { + casingAmount++; + } else { + return false; + } + } + } + + } + } + + } + return casingAmount >= 8; + } + + @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 boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } + +} 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 74daf36a32..0d1abed760 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 @@ -5,6 +5,7 @@ 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_Hatch_Muffler; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.util.GT_Utility; import gregtech.common.items.GT_MetaGenerated_Tool_01; @@ -12,6 +13,7 @@ import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; @@ -126,18 +128,24 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_M @Override public boolean checkRecipe(ItemStack aStack) { - if(aStack==null || !(aStack.getItem() instanceof GT_MetaGenerated_Tool) || aStack.getItemDamage() < 170 || aStack.getItemDamage() >179)return false; + if((counter&7)==0 && (aStack==null || !(aStack.getItem() instanceof GT_MetaGenerated_Tool) || aStack.getItemDamage() < 170 || aStack.getItemDamage() >179)) { + stopMachine(); + return false; + } ArrayList<FluidStack> tFluids = getStoredFluids(); if (tFluids.size() > 0) { - if (baseEff == 0 || optFlow == 0 || counter >= 1000 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled() + if (baseEff == 0 || optFlow == 0 || counter >= 512 || 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, + baseEff = GT_Utility.safeInt((long)((5F + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack)) * 1000F)); + optFlow = GT_Utility.safeInt((long)Math.max(Float.MIN_NORMAL, ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack).getSpeedMultiplier() * ((GT_MetaGenerated_Tool) aStack.getItem()).getPrimaryMaterial(aStack).mToolSpeed - * 50); + * 50)); + if(optFlow<=0 || baseEff<=0){ + stopMachine();//in case the turbine got removed + return false; + } } else { counter++; } @@ -148,7 +156,7 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_M // 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)); + int maxChangeAllowed = Math.max(10, GT_Utility.safeInt((long)Math.abs(difference)/100)); 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. @@ -156,18 +164,18 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_M } else this.mEUt = newPower; - if (mEUt <= 0) { - -// this.mEfficiencyIncrease = (-10); - this.mEfficiency = 0; + if (this.mEUt <= 0) { //stopMachine(); + this.mEUt=0; + this.mEfficiency=0; return false; } else { this.mMaxProgresstime = 1; - this.mEfficiencyIncrease = (10); + this.mEfficiencyIncrease = 10; if(this.mDynamoHatches.size()>0){ - if(this.mDynamoHatches.get(0).getBaseMetaTileEntity().getOutputVoltage() < (int)((long)mEUt * (long)mEfficiency / 10000L)){ - explodeMultiblock();} + for(GT_MetaTileEntity_Hatch dynamo:mDynamoHatches) + if(isValidMetaTileEntity(dynamo) && dynamo.maxEUOutput() < mEUt) + explodeMultiblock(); } return true; } @@ -196,23 +204,48 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_M @Override public String[] getInfoData() { - String tRunning = mMaxProgresstime>0 ? "Turbine running":"Turbine stopped"; - String tMaintainance = getIdealStatus() == getRepairStatus() ? "No Maintainance issues" : "Needs Maintainance" ; + int mPollutionReduction=0; + for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { + if (isValidMetaTileEntity(tHatch)) { + mPollutionReduction=Math.max(tHatch.calculatePollutionReduction(100),mPollutionReduction); + } + } + + String tRunning = mMaxProgresstime>0 ? + EnumChatFormatting.GREEN+"Turbine running"+EnumChatFormatting.RESET : + EnumChatFormatting.RED+"Turbine stopped"+EnumChatFormatting.RESET; + String tMaintainance = getIdealStatus() == getRepairStatus() ? + EnumChatFormatting.GREEN+"No Maintainance issues"+EnumChatFormatting.RESET : + EnumChatFormatting.RED+"Needs Maintainance"+EnumChatFormatting.RESET ; int tDura = 0; if (mInventory[1] != null && mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) { - tDura = (int) ((100.0f / GT_MetaGenerated_Tool.getToolMaxDamage(mInventory[1]) * (GT_MetaGenerated_Tool.getToolDamage(mInventory[1]))+1)); + tDura = GT_Utility.safeInt((long)(100.0f / GT_MetaGenerated_Tool.getToolMaxDamage(mInventory[1]) * (GT_MetaGenerated_Tool.getToolDamage(mInventory[1]))+1)); + } + + long storedEnergy=0; + long maxEnergy=0; + for(GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) { + if (isValidMetaTileEntity(tHatch)) { + storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity(); + } } return new String[]{ - "Large Turbine", + EnumChatFormatting.BLUE+"Large Turbine"+EnumChatFormatting.RESET, + "Stored Energy:", + EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+ + EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU", tRunning, - "Current Output: "+mEUt+" EU/t", - "Optimal Flow: "+(int)realOptFlow+" L/t", - "Fuel Remaining: "+storedFluid+"L", - "Current Speed: "+(mEfficiency/100)+"%", - "Turbine Damage: "+tDura+"%", - tMaintainance}; + "Current Output: "+EnumChatFormatting.RED+mEUt+EnumChatFormatting.RESET+" EU/t", + "Optimal Flow: "+EnumChatFormatting.YELLOW+GT_Utility.safeInt((long)realOptFlow)+EnumChatFormatting.RESET+" L/t", + "Fuel Remaining: "+EnumChatFormatting.GOLD+storedFluid+EnumChatFormatting.RESET+"L", + "Current Speed: "+EnumChatFormatting.YELLOW+(mEfficiency/100F)+EnumChatFormatting.RESET+"%", + "Turbine Damage: "+EnumChatFormatting.RED+Integer.toString(tDura)+EnumChatFormatting.RESET+"%", + tMaintainance, + "Pollution reduced to: "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %" + }; } @Override 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 8e98444472..a1ec97a497 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 @@ -36,14 +36,12 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT return new String[]{ "Controller Block for the Large Gas Turbine", "Size(WxHxD): 3x3x4 (Hollow), Controller (Front centered)", - "1x Input Hatch (Side centered)", + "1x Gas Input Hatch (Side centered)", "1x Maintenance Hatch (Side centered)", "1x Muffler Hatch (Side centered)", "1x Dynamo Hatch (Back centered)", "Stainless Steel Turbine Casings for the rest (24 at least!)", - "Needs a Turbine Item (Inside controller GUI)", - "Output depending on Rotor: 102-6720EU/t", - "Causes " + 20 * getPollutionPerTick(null) + " Pollution per second"}; + "Needs a Turbine Item (Inside controller GUI)"}; } public int getFuelValue(FluidStack aLiquid) { @@ -78,48 +76,47 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT @Override public int getPollutionPerTick(ItemStack aStack) { - return 8; + return 15; } @Override int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) { - int tEU = 0; - - int actualOptimalFlow = 0; - if (aFluids.size() >= 1) { + int tEU = 0; + int actualOptimalFlow = 0; + 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); + actualOptimalFlow = GT_Utility.safeInt((long)aOptFlow / fuelValue); this.realOptFlow = actualOptimalFlow; - 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 remainingFlow = GT_Utility.safeInt((long)(actualOptimalFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios. int flow = 0; int totalFlow = 0; + storedFluid=0; int aFluids_sS=aFluids.size(); for (int i = 0; i < aFluids_sS; i++) { if (aFluids.get(i).isFluidEqual(firstFuelType)) { - flow = aFluids.get(i).amount; // Get all (steam) in hatch - flow = Math.min(flow, Math.min(remainingFlow, (int) (actualOptimalFlow * 1.25f))); // try to use up to 125% of optimal flow w/o exceeding remainingFlow + flow = Math.min(aFluids.get(i).amount, remainingFlow); // try to use up to 125% of optimal flow w/o exceeding remainingFlow depleteInput(new FluidStack(aFluids.get(i), flow)); // deplete that amount - this.storedFluid = aFluids.get(i).amount; + this.storedFluid += aFluids.get(i).amount; remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches totalFlow += flow; // track total input used } } - - tEU = (int) (Math.min((float) actualOptimalFlow, totalFlow) * fuelValue); + if(totalFlow<=0)return 0; + tEU = GT_Utility.safeInt((long)totalFlow * fuelValue); if (totalFlow != actualOptimalFlow) { - float efficiency = 1.0f - Math.abs(((totalFlow - (float) actualOptimalFlow) / actualOptimalFlow)); - if(totalFlow>actualOptimalFlow){efficiency = 1.0f;} - if (efficiency < 0) - efficiency = 0; // Can happen with really ludicrously poor inefficiency. + float efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow) / (float)actualOptimalFlow); + //if(totalFlow>actualOptimalFlow){efficiency = 1.0f;} + //if (efficiency < 0) + // efficiency = 0; // Can happen with really ludicrously poor inefficiency. tEU *= efficiency; - tEU = Math.max(1, (int)((long)tEU * (long)aBaseEff / 10000L)); + tEU = GT_Utility.safeInt((long)tEU * (long)aBaseEff / 10000L); } else { - tEU = (int)((long)tEU * (long)aBaseEff / 10000L); + tEU = GT_Utility.safeInt((long)tEU * (long)aBaseEff / 10000L); } return tEU; 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 a4f144139f..465269ba9e 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 @@ -8,6 +8,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; 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.item.ItemStack; import net.minecraftforge.fluids.FluidStack; @@ -35,7 +36,7 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La return new String[]{ "Controller Block for the Large High Pressure Steam Turbine", "Size(WxHxD): 3x3x4 (Hollow), Controller (Front centered)", - "1x Input Hatch (Side centered)", + "1x Superheated Steam Input Hatch (Side centered)", "1x Maintenance Hatch (Side centered)", "1x Dynamo Hatch (Back centered)", "Titanium Turbine Casings for the rest (24 at least!)", @@ -73,36 +74,39 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La int tEU = 0; int totalFlow = 0; // Byproducts are based on actual flow int flow = 0; - int remainingFlow = (int) (aOptFlow * 1.25f); // Allowed to use up to 125% of optimal flow + int remainingFlow = GT_Utility.safeInt((long)(aOptFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios. this.realOptFlow = aOptFlow; + storedFluid=0; for (int i = 0; i < aFluids.size() && remainingFlow > 0; i++) { String fluidName = aFluids.get(i).getFluid().getUnlocalizedName(aFluids.get(i)); if (fluidName.equals("ic2.fluidSuperheatedSteam")) { - 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 + flow = Math.min(aFluids.get(i).amount, remainingFlow); // try to use up w/o exceeding remainingFlow depleteInput(new FluidStack(aFluids.get(i), flow)); // deplete that amount - this.storedFluid = aFluids.get(i).amount; - remainingFlow -= flow; // track amount we're allowed to keep depleting from hatches - totalFlow += flow; // track total used + this.storedFluid += aFluids.get(i).amount; + remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches + totalFlow += flow; // track total input used if (!achievement) { - GT_Mod.instance.achievements.issueAchievement(this.getBaseMetaTileEntity().getWorld().getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "efficientsteam"); + try { + GT_Mod.instance.achievements.issueAchievement(this.getBaseMetaTileEntity().getWorld().getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "efficientsteam"); + } catch (Exception e) { + } achievement = true; } }else if(fluidName.equals("fluid.steam") || fluidName.equals("ic2.fluidSteam") || fluidName.equals("fluid.mfr.steam.still.name")){ depleteInput(new FluidStack(aFluids.get(i), aFluids.get(i).amount)); } } - - tEU = (int) (Math.min((float) aOptFlow, totalFlow)); + if(totalFlow<=0)return 0; + tEU = totalFlow; addOutput(GT_ModHandler.getSteam(totalFlow)); - if (totalFlow > 0 && totalFlow != aOptFlow) { - float efficiency = 1.0f - Math.abs(((totalFlow - (float) aOptFlow) / aOptFlow)); - if(totalFlow>aOptFlow){efficiency = 1.0f;} + if (totalFlow != aOptFlow) { + float efficiency = 1.0f - Math.abs((totalFlow - aOptFlow) / (float)aOptFlow); + //if(totalFlow>aOptFlow){efficiency = 1.0f;} tEU *= efficiency; - tEU = Math.max(1, (int)((long)tEU * (long)aBaseEff / 10000L)); + tEU = Math.max(1, GT_Utility.safeInt((long)tEU * (long)aBaseEff / 10000L)); } else { - tEU = (int)((long)tEU * (long)aBaseEff / 10000L); + tEU = GT_Utility.safeInt((long)tEU * (long)aBaseEff / 10000L); } return tEU; 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 b3af446944..f536c500c0 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 @@ -5,15 +5,19 @@ 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.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 gregtech.common.items.GT_MetaGenerated_Tool_01; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; +import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.fluids.FluidRegistry; - +import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; import java.util.Collection; @@ -38,12 +42,11 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar return new String[]{ "Controller Block for the Large Plasma Generator", "Size(WxHxD): 3x3x4 (Hollow), Controller (Front centered)", - "1x Input Hatch (Side centered)", + "1x Plasma Input Hatch (Side centered)", "1x Maintenance Hatch (Side centered)", "1x Dynamo Hatch (Back centered)", "Tungstensteel Turbine Casings for the rest (24 at least!)", - "Needs a Turbine Item (Inside controller GUI)", - "Output depending on Rotor: 6553-332595EU/t"}; + "Needs a Turbine Item (Inside controller GUI)"}; } public int getFuelValue(FluidStack aLiquid) { @@ -83,29 +86,28 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar @Override int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) { - - aOptFlow *= 40; - int tEU = 0; + if (aFluids.size() >= 1) { + aOptFlow *= 800;//CHANGED THINGS HERE, check recipe runs once per 20 ticks + int tEU = 0; int actualOptimalFlow = 0; - 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 = GT_Utility.safeInt((long)Math.ceil((double)aOptFlow / (double)fuelValue)); this.realOptFlow = actualOptimalFlow; // For scanner info - 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 remainingFlow = GT_Utility.safeInt((long)(actualOptimalFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios. int flow = 0; int totalFlow = 0; + storedFluid=0; int aFluids_sS=aFluids.size(); for (int i = 0; i < aFluids_sS; i++) { if (aFluids.get(i).isFluidEqual(firstFuelType)) { - flow = aFluids.get(i).amount; // Get all (steam) in hatch - flow = Math.min(flow, Math.min(remainingFlow, (int) (actualOptimalFlow * 1.25f))); // try to use up to 125% of optimal flow w/o exceeding remainingFlow + flow = Math.min(aFluids.get(i).amount, remainingFlow); // try to use up w/o exceeding remainingFlow depleteInput(new FluidStack(aFluids.get(i), flow)); // deplete that amount - this.storedFluid = aFluids.get(i).amount; + this.storedFluid += aFluids.get(i).amount; remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches totalFlow += flow; // track total input used } @@ -122,18 +124,20 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar addOutput(output); } } + if(totalFlow<=0)return 0; + tEU = GT_Utility.safeInt((long)((fuelValue / 20D) * (double)totalFlow)); - tEU = (int) (Math.min((float) actualOptimalFlow, totalFlow) * fuelValue); + //System.out.println(totalFlow+" : "+fuelValue+" : "+aOptFlow+" : "+actualOptimalFlow+" : "+tEU); if (totalFlow != actualOptimalFlow) { - float efficiency = 1.0f - Math.abs(((totalFlow - (float) actualOptimalFlow) / actualOptimalFlow)); - if(totalFlow>actualOptimalFlow){efficiency = 1.0f;} - if (efficiency < 0) - efficiency = 0; // Can happen with really ludicrously poor inefficiency. - tEU *= efficiency; - tEU = Math.max(1, (int)((long)tEU * (long)aBaseEff / 10000L)); + double efficiency = 1.0D - Math.abs((totalFlow - actualOptimalFlow) / (float)actualOptimalFlow); + //if(totalFlow>actualOptimalFlow){efficiency = 1.0f;} + //if (efficiency < 0) + // efficiency = 0; // Can happen with really ludicrously poor inefficiency. + tEU = (int)(tEU * efficiency); + tEU = GT_Utility.safeInt((long)(aBaseEff/10000D*tEU)); } else { - tEU = (int)((long)tEU * (long)aBaseEff / 10000L); + tEU = GT_Utility.safeInt((long)(aBaseEff/10000D*tEU)); } return tEU; @@ -142,5 +146,98 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar return 0; } + @Override + public boolean checkRecipe(ItemStack aStack) { + if((counter&7)==0 && (aStack==null || !(aStack.getItem() instanceof GT_MetaGenerated_Tool) || aStack.getItemDamage() < 170 || aStack.getItemDamage() >179)) { + stopMachine(); + return false; + } + ArrayList<FluidStack> tFluids = getStoredFluids(); + if (tFluids.size() > 0) { + if (baseEff == 0 || optFlow == 0 || counter >= 512 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled() + || this.getBaseMetaTileEntity().hasInventoryBeenModified()) { + counter = 0; + baseEff = GT_Utility.safeInt((long)((5F + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack)) * 1000F)); + optFlow = GT_Utility.safeInt((long)Math.max(Float.MIN_NORMAL, + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack).getSpeedMultiplier() + * ((GT_MetaGenerated_Tool) aStack.getItem()).getPrimaryMaterial(aStack).mToolSpeed + * 50)); + } else { + counter++; + } + } + + if(optFlow<=0 || baseEff<=0){ + stopMachine();//in case the turbine got removed + return false; + } + 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(200, GT_Utility.safeInt((long)Math.abs(difference)/5)); + + 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 (this.mEUt <= 0) { + //stopMachine(); + this.mEUt=0; + this.mEfficiency=0; + return false; + } else { + this.mMaxProgresstime = 20; + this.mEfficiencyIncrease = 200; + if(this.mDynamoHatches.size()>0){ + for(GT_MetaTileEntity_Hatch dynamo:mDynamoHatches) + if(isValidMetaTileEntity(dynamo) && dynamo.maxEUOutput() < mEUt) + explodeMultiblock(); + } + return true; + } + } + + @Override + public String[] getInfoData() { + String tRunning = mMaxProgresstime>0 ? + EnumChatFormatting.GREEN+"Turbine running"+EnumChatFormatting.RESET : + EnumChatFormatting.RED+"Turbine stopped"+EnumChatFormatting.RESET; + String tMaintainance = getIdealStatus() == getRepairStatus() ? + EnumChatFormatting.GREEN+"No Maintainance issues"+EnumChatFormatting.RESET : + EnumChatFormatting.RED+"Needs Maintainance"+EnumChatFormatting.RESET ; + int tDura = 0; + + if (mInventory[1] != null && mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) { + tDura = GT_Utility.safeInt((long)(100.0f / GT_MetaGenerated_Tool.getToolMaxDamage(mInventory[1]) * (GT_MetaGenerated_Tool.getToolDamage(mInventory[1]))+1)); + } + + long storedEnergy=0; + long maxEnergy=0; + for(GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) { + if (isValidMetaTileEntity(tHatch)) { + storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity(); + } + } + + return new String[]{ + EnumChatFormatting.BLUE+"Large Turbine"+EnumChatFormatting.RESET, + "Stored Energy:", + EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+ + EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU", + tRunning, + "Current Output: "+EnumChatFormatting.RED+mEUt+EnumChatFormatting.RESET+" EU/t", + "Optimal Flow: "+EnumChatFormatting.YELLOW+GT_Utility.safeInt((long)realOptFlow)+EnumChatFormatting.RESET+" L/s", + "Fuel Remaining: "+EnumChatFormatting.GOLD+storedFluid+EnumChatFormatting.RESET+"L", + "Current Speed: "+EnumChatFormatting.YELLOW+(mEfficiency/100F)+EnumChatFormatting.RESET+"%", + "Turbine Damage: "+EnumChatFormatting.RED+Integer.toString(tDura)+EnumChatFormatting.RESET+"%", + tMaintainance, + }; + } } 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 32577368e2..c7b2e62eb2 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 @@ -8,6 +8,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; 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.item.ItemStack; import net.minecraftforge.fluids.FluidStack; @@ -37,12 +38,11 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg return new String[]{ "Controller Block for the Large Steam Turbine", "Size(WxHxD): 3x3x4 (Hollow), Controller (Front centered)", - "1x Input Hatch (Side centered)", + "1x Steam Input Hatch (Side centered)", "1x Maintenance Hatch (Side centered)", "1x Dynamo Hatch (Back centered)", "Turbine Casings for the rest (24 at least!)", - "Needs a Turbine Item (Inside controller GUI)", - "Output depending on Rotor: 60-3360EU/t"}; + "Needs a Turbine Item (Inside controller GUI)"}; } @Override @@ -62,7 +62,7 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg @Override public byte getCasingTextureIndex() { - return 46; + return 16; } @Override @@ -73,7 +73,7 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg private int useWater(float input) { water = water + input; int usage = (int) water; - water = water - (int) usage; + water = water - usage; return usage; } @@ -82,16 +82,16 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg int tEU = 0; int totalFlow = 0; // Byproducts are based on actual flow int flow = 0; - int remainingFlow = (int) (aOptFlow * 1.25f); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios. - this.realOptFlow = ((aOptFlow / 2) / (0.5)); + int remainingFlow = GT_Utility.safeInt((long)(aOptFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios. + this.realOptFlow = aOptFlow; + storedFluid=0; 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 - flow = Math.min(flow, Math.min(remainingFlow, (int) (aOptFlow * 1.25f))); // try to use up to 125% of optimal flow w/o exceeding remainingFlow + flow = Math.min(aFluids.get(i).amount, remainingFlow); // try to use up w/o exceeding remainingFlow depleteInput(new FluidStack(aFluids.get(i), flow)); // deplete that amount - this.storedFluid = aFluids.get(i).amount; + this.storedFluid += aFluids.get(i).amount; remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches totalFlow += flow; // track total input used if (!achievement) { @@ -99,20 +99,20 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg achievement = true; } }else if(fluidName.equals("ic2.fluidSuperheatedSteam")){ - depleteInput(new FluidStack(aFluids.get(i), aFluids.get(i).amount)); + depleteInput(new FluidStack(aFluids.get(i), aFluids.get(i).amount)); } } - - tEU = (int) (Math.min((float) aOptFlow, totalFlow)); + if(totalFlow<=0)return 0; + tEU = totalFlow; int waterToOutput = useWater(totalFlow / 160.0f); addOutput(GT_ModHandler.getDistilledWater(waterToOutput)); - if (totalFlow > 0 && totalFlow != aOptFlow) { - float efficiency = 1.0f - Math.abs(((totalFlow - (float) aOptFlow) / aOptFlow)); - if(totalFlow>aOptFlow){efficiency = 1.0f;} + if (totalFlow != aOptFlow) { + float efficiency = 1.0f - Math.abs((totalFlow - aOptFlow) / (float)aOptFlow); + //if(totalFlow>aOptFlow){efficiency = 1.0f;} tEU *= efficiency; - tEU = Math.max(1, (int)((long)tEU * (long)aBaseEff / 20000L)); + tEU = Math.max(1, GT_Utility.safeInt((long)tEU * (long)aBaseEff / 20000L)); } else { - tEU = (int)((long)tEU * (long)aBaseEff / 20000L); + tEU = GT_Utility.safeInt((long)tEU * (long)aBaseEff / 20000L); } return tEU; 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 71fcfceaa2..9ae4ba1437 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 @@ -1,13 +1,13 @@ package gregtech.common.tileentities.machines.multi;
-import java.util.ArrayList;
-
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_Hatch_Energy;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_ModHandler;
@@ -15,8 +15,11 @@ 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.minecraft.util.EnumChatFormatting;
import net.minecraftforge.common.util.ForgeDirection;
+import java.util.ArrayList;
+
public class GT_MetaTileEntity_MultiFurnace
extends GT_MetaTileEntity_MultiBlockBase {
private int mLevel = 0;
@@ -75,7 +78,7 @@ public class GT_MetaTileEntity_MultiFurnace public boolean checkRecipe(ItemStack aStack) {
ArrayList<ItemStack> tInputList = getStoredInputs();
if (!tInputList.isEmpty()) {
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(getMaxInputVoltage()));
+ int mVolatage=GT_Utility.safeInt(getMaxInputVoltage());
int j = 0;
this.mOutputItems = new ItemStack[8 * this.mLevel];
@@ -87,9 +90,17 @@ public class GT_MetaTileEntity_MultiFurnace if (j > 0) {
this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
this.mEfficiencyIncrease = 10000;
+ calculateOverclockedNessMulti(4, 512, 1, mVolatage);
+ //In case recipe is too OP for that machine
+ if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
+ return false;
- this.mEUt = (-4 * (1 << tTier - 1) * (1 << tTier - 1) * this.mLevel / this.mCostDiscount);
- this.mMaxProgresstime = Math.max(1, 512 / (1 << tTier - 1));
+ this.mEUt = GT_Utility.safeInt(((long)mEUt) * this.mLevel / (long)this.mCostDiscount,1);
+ if (mEUt == Integer.MAX_VALUE - 1)
+ return false;
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
}
updateSlots();
return true;
@@ -97,7 +108,7 @@ public class GT_MetaTileEntity_MultiFurnace return false;
}
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ private boolean checkMachineFunction(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
@@ -176,13 +187,18 @@ public class GT_MetaTileEntity_MultiFurnace }
return true;
}
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack){
+ boolean result= this.checkMachineFunction(aBaseMetaTileEntity,aStack);
+ if (!result) this.mLevel=0;
+ return result;
+ }
public int getMaxEfficiency(ItemStack aStack) {
return 10000;
}
public int getPollutionPerTick(ItemStack aStack) {
- return 5;
+ return 20;
}
public int getDamageToComponent(ItemStack aStack) {
@@ -212,4 +228,45 @@ public class GT_MetaTileEntity_MultiFurnace }
}
}
+
+
+ @Override
+ public String[] getInfoData() {
+ int mPollutionReduction=0;
+ for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ mPollutionReduction=Math.max(tHatch.calculatePollutionReduction(100),mPollutionReduction);
+ }
+ }
+
+ long storedEnergy=0;
+ long maxEnergy=0;
+ for(GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU();
+ maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity();
+ }
+ }
+
+ return new String[]{
+ "Progress:",
+ EnumChatFormatting.GREEN + Integer.toString(mProgresstime/20) + EnumChatFormatting.RESET +" s / "+
+ EnumChatFormatting.YELLOW + Integer.toString(mMaxProgresstime/20) + EnumChatFormatting.RESET +" s",
+ "Stored Energy:",
+ EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+
+ EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU",
+ "Probably uses: "+
+ EnumChatFormatting.RED + Integer.toString(-mEUt) + EnumChatFormatting.RESET + " EU/t",
+ "Maximum total power (to all Energy Hatches, not single ones): ",
+ EnumChatFormatting.YELLOW+Long.toString(getMaxInputVoltage())+EnumChatFormatting.RESET+ " EU/t * 2A",
+ "Problems: "+
+ EnumChatFormatting.RED+ (getIdealStatus() - getRepairStatus())+EnumChatFormatting.RESET+
+ " Efficiency: "+
+ EnumChatFormatting.YELLOW+Float.toString(mEfficiency / 100.0F)+EnumChatFormatting.RESET + " %",
+ "Multi smelting: "+
+ EnumChatFormatting.GREEN+mLevel*8+EnumChatFormatting.RESET+" Discount: (EU/t) / "+EnumChatFormatting.GREEN+mCostDiscount+EnumChatFormatting.RESET,
+ "Pollution reduced to: "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %"
+ };
+ }
+
}
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 4aef1285df..0d0094e535 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 @@ -9,6 +9,7 @@ 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_Hatch_Input; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; @@ -20,9 +21,8 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_MultiBlockBase { - private final FluidStack fluidToDecreaseEu = GT_ModHandler.getSteam(128); - private final FluidStack fluidToIncreaseOutput = Materials.Hydrogen.getGas(64); - + private ForgeDirection orientation; + private int controllerX, controllerZ; public GT_MetaTileEntity_OilCracker(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -35,16 +35,15 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_MultiBlockBa public String[] getDescription() { return new String[]{ "Controller Block for the Oil Cracking Unit", - "Cracks heavy oil into lighter parts", + "Thermally cracks heavy hydrocarbons into lighter fractions", "Size(WxHxD): 5x3x3 (Hollow), Controller (Front center)", "Ring of 8 Cupronickel Coils (Each side of Controller)", - "1x Input Hatch (Any left side casing)", - "1x Input Hatch (Any middle ring casing)", - "1x Output Hatch (Any right side casing)", + "1x Hydrocarbon Input Bus/Hatch (Any left side casing)", + "1x Steam/Hydrogen Input Hatch (Any middle ring casing)", + "1x Cracked Hydrocarbon Output Hatch (Any right side casing)", "1x Maintenance Hatch (Any middle ring casing)", "1x Energy Hatch (Any middle ring casing)", - "Clean Stainless Steel Casings for the rest (18 at least!)", - "Optional Steam(50% less EU/t) or Hydrogen(30% more output)"}; + "Clean Stainless Steel Machine Casings for the rest (18 at least!)"}; } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { @@ -62,47 +61,38 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_MultiBlockBa @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 needDecreaseEu = depleteInput(fluidToDecreaseEu); - boolean needIncreaseOutput = !needDecreaseEu && depleteInput(fluidToIncreaseOutput); - - 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 (needDecreaseEu) this.mEUt = this.mEUt / 2; - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); - } - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; - if (needIncreaseOutput) this.mOutputFluids[0].amount = this.mOutputFluids[0].amount * 130 / 100; - return true; - } + FluidStack[] tFluidInputs = tInputList.toArray(new FluidStack[tInputList.size()]); + 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], tFluidInputs ,new ItemStack[]{mInventory[1]}); + if (tRecipe != null && tRecipe.isRecipeInputEqual(true, tFluidInputs, new ItemStack[]{mInventory[1]})) { + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + 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.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; + 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; + this.orientation = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()); + this.controllerX = aBaseMetaTileEntity.getXCoord(); + this.controllerZ = aBaseMetaTileEntity.getZCoord(); + int xDir = this.orientation.offsetX; + int zDir = this.orientation.offsetZ; int amount = 0; replaceDeprecatedCoils(aBaseMetaTileEntity); if (xDir != 0) { @@ -244,7 +234,7 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_MultiBlockBa continue; } if (aBaseMetaTileEntity.getBlock(xPos, yPos, zPos) == GregTech_API.sBlockCasings1 && - aBaseMetaTileEntity.getMetaID(xPos, yPos, zPos) == 12) + aBaseMetaTileEntity.getMetaID(xPos, yPos, zPos) == 12) { aBaseMetaTileEntity.getWorld().setBlock(xPos, yPos, zPos, GregTech_API.sBlockCasings5, 0, 3); } @@ -252,4 +242,33 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_MultiBlockBa } } } -} + + @Override + public ArrayList<FluidStack> getStoredFluids() { + ArrayList<FluidStack> rList = new ArrayList<FluidStack>(); + for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) { + tHatch.mRecipeMap = getRecipeMap(); + if (isValidMetaTileEntity(tHatch) && tHatch.getFillableStack() != null) { + FluidStack tStack = tHatch.getFillableStack(); + if (tStack.isFluidEqual(GT_ModHandler.getSteam(1000)) || tStack.isFluidEqual(Materials.Hydrogen.getGas(1000))) { + if (isHatchInMiddleRing(tHatch)) { + rList.add(tStack); + } + } else { + if (!isHatchInMiddleRing(tHatch)) { + rList.add(tStack); + } + } + } + } + return rList; + } + + private boolean isHatchInMiddleRing(GT_MetaTileEntity_Hatch_Input inputHatch){ + if (orientation == ForgeDirection.NORTH || orientation == ForgeDirection.SOUTH) { + return inputHatch.getBaseMetaTileEntity().getXCoord() == this.controllerX; + } else { + return inputHatch.getBaseMetaTileEntity().getZCoord() == this.controllerZ; + } + } +}
\ No newline at end of file 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 c86bdce89d..e3e0c8524d 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 @@ -6,6 +6,8 @@ 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_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; @@ -13,6 +15,7 @@ import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -23,6 +26,7 @@ import static gregtech.common.GT_UndergroundOil.undergroundOil; public class GT_MetaTileEntity_OilDrill extends GT_MetaTileEntity_MultiBlockBase { private boolean completedCycle = false; + private int extractionSpeed=0; public GT_MetaTileEntity_OilDrill(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -36,12 +40,13 @@ public class GT_MetaTileEntity_OilDrill extends GT_MetaTileEntity_MultiBlockBase return new String[]{ "Controller Block for the Oil Drilling Rig", "Size(WxHxD): 3x7x3", "Controller (Front middle at bottom)", - "3x1x3 Base of Solid Steel Casings", - "1x3x1 Solid Steel Casing pillar (Center of base)", + "3x1x3 Base of Solid Steel Machine Casings", + "1x3x1 Solid Steel Machine Casing pillar (Center of base)", "1x3x1 Steel Frame Boxes (Each Steel pillar side and on top)", "1x Output Hatch (One of base casings)", "1x Maintenance Hatch (One of base casings)", - "1x Energy Hatch (One of base casings)"}; + "1x Energy Hatch (One of base casings)", + "Also check the seismic prospector..."}; } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { @@ -75,46 +80,37 @@ public class GT_MetaTileEntity_OilDrill extends GT_MetaTileEntity_MultiBlockBase } } } - FluidStack tFluid = undergroundOil(getBaseMetaTileEntity(),.5F+(getInputTier()*.25F)); - if (tFluid == null) { - stopMachine(); - return false; + //Output fluid + FluidStack tFluid = undergroundOil(getBaseMetaTileEntity(),.5F+(getInputTier()*.25F));//consumes here... + if (tFluid == null){ + extractionSpeed=0; + stopMachine(); + return false;//impossible } - if (getYOfPumpHead() > 0 && getBaseMetaTileEntity().getBlockOffset(ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX, getYOfPumpHead() - 1 - getBaseMetaTileEntity().getYCoord(), ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ) != Blocks.bedrock) { - + if (getBaseMetaTileEntity().getBlockOffset(ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX, getYOfPumpHead() - 1 - getBaseMetaTileEntity().getYCoord(), ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ) != Blocks.bedrock) { + //Not at bedrock layer - i prefer to keep it like it is... if (completedCycle) { moveOneDown(); } tFluid = null; if (mEnergyHatches.size() > 0 && mEnergyHatches.get(0).getEUVar() > (512 + getMaxInputVoltage() * 4)) completedCycle = true; - } else if (tFluid.amount < 5000) { - stopMachine(); - return false; + } else if (tFluid.amount == 0) {//no fluid remaining, for SANity + extractionSpeed=0; + stopMachine(); + return false;//stops processing?? } else { - tFluid.amount = tFluid.amount / 5000; + extractionSpeed=tFluid.amount; } - 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; - } - } + calculateOverclockedNessMulti(24, 160, 1, getMaxInputVoltage()); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; if (this.mEUt > 0) { this.mEUt = (-this.mEUt); } - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputFluids = new FluidStack[]{tFluid}; return true; } @@ -234,4 +230,41 @@ public class GT_MetaTileEntity_OilDrill extends GT_MetaTileEntity_MultiBlockBase return new GT_MetaTileEntity_OilDrill(this.mName); } -}
\ No newline at end of file + @Override + public String[] getInfoData() { + int mPollutionReduction=0; + for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { + if (isValidMetaTileEntity(tHatch)) { + mPollutionReduction=Math.max(tHatch.calculatePollutionReduction(100),mPollutionReduction); + } + } + + long storedEnergy=0; + long maxEnergy=0; + for(GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { + if (isValidMetaTileEntity(tHatch)) { + storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity(); + } + } + + return new String[]{ + "Progress:", + EnumChatFormatting.GREEN + Integer.toString(mProgresstime/20) + EnumChatFormatting.RESET +" s / "+ + EnumChatFormatting.YELLOW + Integer.toString(mMaxProgresstime/20) + EnumChatFormatting.RESET +" s", + "Stored Energy:", + EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+ + EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU", + "Probably uses: "+ + EnumChatFormatting.RED + Integer.toString(-mEUt) + EnumChatFormatting.RESET + " EU/t", + "Maximum total power (to all Energy Hatches, not single ones): ", + EnumChatFormatting.YELLOW+Long.toString(getMaxInputVoltage())+EnumChatFormatting.RESET+ " EU/t * 2A", + "Problems: "+ + EnumChatFormatting.RED+ (getIdealStatus() - getRepairStatus())+EnumChatFormatting.RESET+ + " Efficiency: "+ + EnumChatFormatting.YELLOW+Float.toString(mEfficiency / 100.0F)+EnumChatFormatting.RESET + " %", + "Pollution reduced to: "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %", + "Extraction this cycle: "+ EnumChatFormatting.GOLD + extractionSpeed + EnumChatFormatting.RESET+" L" + }; + } +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant1.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant1.java index 25e4e3eb5d..8d1f68346d 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant1.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant1.java @@ -1,3 +1,4 @@ + package gregtech.common.tileentities.machines.multi; import gregtech.api.enums.ItemList; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant4.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant4.java index 55fc1ef7e0..2488bc1040 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant4.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant4.java @@ -1,3 +1,4 @@ + package gregtech.common.tileentities.machines.multi; import gregtech.api.enums.ItemList; 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 b45c0da6ca..389ddf4c5b 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 @@ -2,16 +2,20 @@ package gregtech.common.tileentities.machines.multi; import gregtech.GT_Mod; import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; 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_Hatch_Energy; 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.minecraft.util.EnumChatFormatting; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import org.apache.commons.lang3.ArrayUtils; @@ -27,7 +31,9 @@ import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Basi public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBlockBase { - GT_Recipe mLastRecipe; + private GT_Recipe mLastRecipe; + private int tTier = 0; + private int mMult = 0; public GT_MetaTileEntity_ProcessingArray(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -50,8 +56,9 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl "1x Output Hatch/Bus (Any casing)", "1x Maintenance Hatch (Any casing)", "1x Energy Hatch (Any casing)", - "Robust Tungstensteel Casings for the rest (16 at least!)", - "Place up to 16 Single Block GT Machines into the GUI Inventory"}; + "Robust Tungstensteel Machine Casings for the rest (14 at least!)", + "Place up to 64 Single Block GT Machines into the Controller Inventory", + "Maximal overclockedness of machines inside: Tier 9"}; } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { @@ -65,6 +72,29 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ProcessingArray.png"); } + //TODO: Expand so it also does the non recipe map recipes + /* + public void remoteRecipeCheck() { + if (mInventory[1] == null) return; + String tmp = mInventory[1].getUnlocalizedName().replaceAll("gt.blockmachines.basicmachine.", ""); + if (tmp.startsWith("replicator")) { + + } else if (tmp.startsWith("brewery")) { + + } else if (tmp.startsWith("packer")) { + + } else if (tmp.startsWith("printer")) { + + } else if (tmp.startsWith("disassembler")) { + + } else if (tmp.startsWith("massfab")) { + + } else if (tmp.startsWith("scanner")) { + + } + } + */ + public GT_Recipe.GT_Recipe_Map getRecipeMap() { if (mInventory[1] == null) return null; String tmp = mInventory[1].getUnlocalizedName().replaceAll("gt\\.blockmachines\\.basicmachine\\.", ""); @@ -138,8 +168,6 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl return GT_Recipe.GT_Recipe_Map.sPlasmaArcFurnaceRecipes; } else if (tmp.startsWith("printer")) { return GT_Recipe.GT_Recipe_Map.sPrinterRecipes; - } else if (tmp.startsWith("press")) { - return GT_Recipe.GT_Recipe_Map.sPressRecipes; } else if (tmp.startsWith("fluidcanner")) { return GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes; } else if (tmp.startsWith("fluidheater")) { @@ -153,6 +181,7 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl } else if (tmp.startsWith("circuitassembler")) { return GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes; } + return null; } @@ -167,7 +196,7 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl return aFacing > 1; } - public String mMachine = ""; + private String mMachine = ""; public boolean checkRecipe(ItemStack aStack) { if (!isCorrectMachinePart(mInventory[1])) { return false; @@ -175,44 +204,70 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl 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")) { + + if (mInventory[1].getUnlocalizedName().endsWith("10")) { + tTier = 9; + mMult = 2;//u need 4x less machines and they will use 4x less power + } else if (mInventory[1].getUnlocalizedName().endsWith("11")) { + tTier = 9; + mMult = 4;//u need 16x less machines and they will use 16x less power + } else if (mInventory[1].getUnlocalizedName().endsWith("12") || + mInventory[1].getUnlocalizedName().endsWith("13") || + mInventory[1].getUnlocalizedName().endsWith("14") || + mInventory[1].getUnlocalizedName().endsWith("15")) { + tTier = 9; + mMult = 6;//u need 64x less machines and they will use 64x less power + } else if (mInventory[1].getUnlocalizedName().endsWith("1")) { tTier = 1; - }else if (mInventory[1].getUnlocalizedName().endsWith("2")) { + mMult = 0;//*1 + } else if (mInventory[1].getUnlocalizedName().endsWith("2")) { tTier = 2; - }else if (mInventory[1].getUnlocalizedName().endsWith("3")) { + mMult = 0;//*1 + } else if (mInventory[1].getUnlocalizedName().endsWith("3")) { tTier = 3; - }else if (mInventory[1].getUnlocalizedName().endsWith("4")) { + mMult = 0;//*1 + } else if (mInventory[1].getUnlocalizedName().endsWith("4")) { tTier = 4; - }else if (mInventory[1].getUnlocalizedName().endsWith("5")) { + mMult = 0;//*1 + } else if (mInventory[1].getUnlocalizedName().endsWith("5")) { tTier = 5; - }else if (mInventory[1].getUnlocalizedName().endsWith("6")) { + mMult = 0;//*1 + } else if (mInventory[1].getUnlocalizedName().endsWith("6")) { tTier = 6; - }else if (mInventory[1].getUnlocalizedName().endsWith("7")) { + mMult = 0;//*1 + } else if (mInventory[1].getUnlocalizedName().endsWith("7")) { tTier = 7; - }else if (mInventory[1].getUnlocalizedName().endsWith("8")) { + mMult = 0;//*1 + } else if (mInventory[1].getUnlocalizedName().endsWith("8")) { tTier = 8; + mMult = 0;//*1 + } else if (mInventory[1].getUnlocalizedName().endsWith("9")) { + tTier = 9; + mMult = 0;//*1 + } else { + tTier = 0; + mMult = 0;//*1 } - - if(!mMachine.equals(mInventory[1].getUnlocalizedName()))mLastRecipe=null; + + if (!mMachine.equals(mInventory[1].getUnlocalizedName())) mLastRecipe = null; mMachine = mInventory[1].getUnlocalizedName(); ItemStack[] tInputs = (ItemStack[]) tInputList.toArray(new ItemStack[tInputList.size()]); ArrayList<FluidStack> tFluidList = getStoredFluids(); - - FluidStack[] tFluids = (FluidStack[]) tFluidList.toArray(new FluidStack[tFluidList.size()]); + + FluidStack[] tFluids = (FluidStack[]) tFluidList.toArray(new FluidStack[tFluidList.size()]); 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) { if (GT_Mod.gregtechproxy.mLowGravProcessing && tRecipe.mSpecialValue == -100 && - !isValidForLowGravity(tRecipe,getBaseMetaTileEntity().getWorld().provider.dimensionId)) + !isValidForLowGravity(tRecipe, getBaseMetaTileEntity().getWorld().provider.dimensionId)) return false; mLastRecipe = tRecipe; this.mEUt = 0; this.mOutputItems = null; this.mOutputFluids = null; - int machines = Math.min(16, mInventory[1].stackSize); + int machines = Math.min(64, mInventory[1].stackSize << mMult); //Upped max Cap to 64 int i = 0; for (; i < machines; i++) { if (!tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { @@ -225,26 +280,23 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl 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 <= V[tTier - 1] * map.mAmperage) { - this.mEUt *= 4; - this.mMaxProgresstime /= 2; - } - } - this.mEUt *= i; + calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, map.mAmperage, GT_Values.V[tTier]); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + this.mEUt = GT_Utility.safeInt(((long) this.mEUt * i) >> mMult, 1); + if (mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) { this.mEUt = (-this.mEUt); } ItemStack[] tOut = new ItemStack[tRecipe.mOutputs.length]; for (int h = 0; h < tRecipe.mOutputs.length; h++) { - if(tRecipe.getOutput(h)!=null){ - tOut[h] = tRecipe.getOutput(h).copy(); - tOut[h].stackSize = 0;} + if (tRecipe.getOutput(h) != null) { + tOut[h] = tRecipe.getOutput(h).copy(); + tOut[h].stackSize = 0; + } } FluidStack tFOut = null; if (tRecipe.getFluidOutput(0) != null) tFOut = tRecipe.getFluidOutput(0).copy(); @@ -265,11 +317,12 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl List<ItemStack> overStacks = new ArrayList<ItemStack>(); for (int f = 0; f < tOut.length; f++) { while (tOut[f].getMaxStackSize() < tOut[f].stackSize) { - if(tOut[f]!=null){ - ItemStack tmp = tOut[f].copy(); - tmp.stackSize = tmp.getMaxStackSize(); - tOut[f].stackSize = tOut[f].stackSize - tOut[f].getMaxStackSize(); - overStacks.add(tmp);} + if (tOut[f] != null) { + 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) { @@ -286,7 +339,9 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl this.mOutputFluids = new FluidStack[]{tFOut}; updateSlots(); return true; - } + }/* else{ + ...remoteRecipeCheck() + }*/ } return false; } @@ -322,7 +377,7 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl } } } - return tAmount >= 16; + return tAmount >= 14; } public int getMaxEfficiency(ItemStack aStack) { @@ -340,4 +395,40 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl public boolean explodesOnComponentBreak(ItemStack aStack) { return false; } + + + @Override + public String[] getInfoData() { + long storedEnergy=0; + long maxEnergy=0; + for(GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { + if (isValidMetaTileEntity(tHatch)) { + storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU(); + maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity(); + } + } + + return new String[]{ + "Progress:", + EnumChatFormatting.GREEN + Integer.toString(mProgresstime/20) + EnumChatFormatting.RESET +" s / "+ + EnumChatFormatting.YELLOW + Integer.toString(mMaxProgresstime/20) + EnumChatFormatting.RESET +" s", + "Stored Energy:", + EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+ + EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU", + "Probably uses: "+ + EnumChatFormatting.RED + Integer.toString(-mEUt) + EnumChatFormatting.RESET + " EU/t", + "Maximum total power (to all Energy Hatches, not single ones): ", + EnumChatFormatting.YELLOW+Long.toString(getMaxInputVoltage())+EnumChatFormatting.RESET+ " EU/t * 2A", + "Problems: "+ + EnumChatFormatting.RED+ (getIdealStatus() - getRepairStatus())+EnumChatFormatting.RESET+ + " Efficiency: "+ + EnumChatFormatting.YELLOW+Float.toString(mEfficiency / 100.0F)+EnumChatFormatting.RESET + " %", + "Machine tier installed: "+ + EnumChatFormatting.GREEN+tTier+EnumChatFormatting.RESET+ + " Discount: "+ + EnumChatFormatting.GREEN+(1<<mMult)+EnumChatFormatting.RESET + " x", + "Parallel processing: "+EnumChatFormatting.GREEN+(mInventory[1].stackSize<<mMult)+EnumChatFormatting.RESET + }; + } + } 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 00ce54c9f6..f87c9fafed 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,7 +1,7 @@ package gregtech.common.tileentities.machines.multi; -import java.util.ArrayList; - +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_MultiMachine; @@ -12,11 +12,15 @@ 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.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; +import java.util.Arrays; + public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlockBase { public GT_MetaTileEntity_PyrolyseOven(int aID, String aName, String aNameRegional) { @@ -32,23 +36,22 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock "Controller Block for the Pyrolyse Oven", "Industrial Charcoal producer and Oil from Plants", "Size(WxHxD): 5x4x5, Controller (Bottom center)", - "3x1x3 Kanthal Heating Coils (Inside bottom 5x1x5 layer)", - "9x Kanthal Heating Coils (Centered 3x1x3 area in Bottom layer)", + "3x1x3 Kanthal Heating Coils (At the center of the bottom layer)", "1x Input Hatch/Bus (Centered 3x1x3 area in Top layer)", "1x Output Hatch/Bus (Any bottom layer casing)", "1x Maintenance Hatch (Any bottom layer casing)", "1x Muffler Hatch (Centered 3x1x3 area in Top layer)", "1x Energy Hatch (Any bottom layer casing)", - "ULV Machine Casings for the rest (60 at least!)", + "Pyrolyse Oven Casings for the rest (60 at least!)", "Causes " + 20 * getPollutionPerTick(null) + " Pollution per second"}; } 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], + return new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_8V_SIDE), new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN)}; } - return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[0]}; + return new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_8V_SIDE)}; } public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { @@ -58,41 +61,59 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock @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 (tRecipe.mEUt <= 16) { - this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1)); - this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1)); + int tInputList_sS=tInputList.size(); + for (int i = 0; i < tInputList_sS - 1; i++) { + for (int j = i + 1; j < tInputList_sS; 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--); tInputList_sS=tInputList.size(); } 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; - } + tInputList.remove(i--); tInputList_sS=tInputList.size(); + break; } - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); + } + } + } + ItemStack[] tInputs = (ItemStack[]) Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2); + + ArrayList<FluidStack> tFluidList = getStoredFluids(); + int tFluidList_sS=tFluidList.size(); + for (int i = 0; i < tFluidList_sS - 1; i++) { + for (int j = i + 1; j < tFluidList_sS; 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--); tFluidList_sS=tFluidList.size(); + } else { + tFluidList.remove(i--); tFluidList_sS=tFluidList.size(); + break; } - 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; } } } + 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.sPyrolyseRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + if (tRecipe != null && tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + + calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return false; + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + 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; } @@ -100,6 +121,10 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2; + + Block CasingBlock= Loader.isModLoaded("dreamcraft")? GameRegistry.findBlock("dreamcraft","gt.blockcasingsNH"): GregTech_API.sBlockCasings1; + int CasingMeta= Loader.isModLoaded("dreamcraft")?2:0; + replaceDeprecatedCoils(aBaseMetaTileEntity); for (int i = -2; i < 3; i++) { for (int j = -2; j < 3; j++) { @@ -115,10 +140,10 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock } } 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) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != CasingBlock) { return false; } - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 0) { + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != CasingMeta) { return false; } } @@ -131,19 +156,19 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock 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) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != CasingBlock) { return false; } - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 0) { + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != CasingMeta) { return false; } } } } else {// au�en �ber boden (ulv casings) - if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings1) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != CasingBlock) { return false; } - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 0) { + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != CasingMeta) { return false; } } @@ -166,7 +191,7 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock @Override public int getPollutionPerTick(ItemStack aStack) { - return 20; + return 30; } @Override 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 e6b3992a9c..aa7870e3be 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 @@ -39,7 +39,7 @@ public class GT_MetaTileEntity_VacuumFreezer "1x Output Bus (Any casing)",
"1x Maintenance Hatch (Any casing)",
"1x Energy Hatch (Any casing)",
- "Frost Proof Casings for the rest (16 at least!)"};
+ "Frost Proof Machine Casings for the rest (16 at least!)"};
}
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
@@ -76,17 +76,11 @@ public class GT_MetaTileEntity_VacuumFreezer 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;
- }
- }
+
+ calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage);
+ //In case recipe is too OP for that machine
+ if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
+ return false;
if (this.mEUt > 0) {
this.mEUt = (-this.mEUt);
}
@@ -143,4 +137,4 @@ public class GT_MetaTileEntity_VacuumFreezer public boolean explodesOnComponentBreak(ItemStack aStack) {
return false;
}
-}
\ No newline at end of file +}
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 0fbd7383a8..4cf20fdf16 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 @@ -1,90 +1,89 @@ -package gregtech.common.tileentities.machines.steam;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
-import gregtech.api.gui.GT_GUIContainer_BasicMachine;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-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_Utility;
-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 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.mDescriptionArray, 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);
- 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)};
- }
-}
+package gregtech.common.tileentities.machines.steam; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_GUIContainer_BasicMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +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_Utility; +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 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.mDescriptionArray, 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); + 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)}; + } +} 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 75a3f6447b..4066460fd0 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 @@ -1,90 +1,89 @@ -package gregtech.common.tileentities.machines.steam;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
-import gregtech.api.gui.GT_GUIContainer_BasicMachine;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-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_Utility;
-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 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.mDescriptionArray, 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);
- 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)};
- }
-}
+package gregtech.common.tileentities.machines.steam; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_GUIContainer_BasicMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +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_Utility; +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 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.mDescriptionArray, 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); + 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)}; + } +} 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 3863c59d0f..f0d57ab0bb 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 @@ -8,14 +8,11 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; 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_ModHandler;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-public class GT_MetaTileEntity_Compressor_Bronze
- extends GT_MetaTileEntity_BasicMachine_Bronze {
+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);
}
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 6bf91a7447..a3d5407022 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 @@ -8,14 +8,11 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; 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_ModHandler;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-public class GT_MetaTileEntity_Compressor_Steel
- extends GT_MetaTileEntity_BasicMachine_Steel {
+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);
}
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 a5e6ae74ac..fcfbb5737d 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 @@ -8,14 +8,11 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; 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_ModHandler;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-public class GT_MetaTileEntity_Extractor_Bronze
- extends GT_MetaTileEntity_BasicMachine_Bronze {
+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);
}
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 9a18312871..45f4a506d4 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 @@ -8,14 +8,11 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; 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_ModHandler;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-public class GT_MetaTileEntity_Extractor_Steel
- extends GT_MetaTileEntity_BasicMachine_Steel {
+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);
}
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 7a24222701..cc99d43c0d 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 @@ -1,90 +1,89 @@ -package gregtech.common.tileentities.machines.steam;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
-import gregtech.api.gui.GT_GUIContainer_BasicMachine;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-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_Utility;
-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 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.mDescriptionArray, 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);
- 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)};
- }
-}
+package gregtech.common.tileentities.machines.steam; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_GUIContainer_BasicMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +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_Utility; +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 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.mDescriptionArray, 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); + 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)}; + } +} 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 66c40990cf..cd575e0965 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 @@ -1,90 +1,89 @@ -package gregtech.common.tileentities.machines.steam;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
-import gregtech.api.gui.GT_GUIContainer_BasicMachine;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-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_Utility;
-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 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.mDescriptionArray, 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);
- 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)};
- }
-}
+package gregtech.common.tileentities.machines.steam; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_GUIContainer_BasicMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +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_Utility; +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 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.mDescriptionArray, 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); + 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)}; + } +} 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 717a09004d..3018b3c9c7 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 @@ -1,96 +1,95 @@ -package gregtech.common.tileentities.machines.steam;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
-import gregtech.api.gui.GT_GUIContainer_BasicMachine;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-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_ModHandler;
-import gregtech.api.util.GT_Utility;
-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 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.mDescriptionArray, 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)};
- }
-}
+package gregtech.common.tileentities.machines.steam; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_GUIContainer_BasicMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +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_ModHandler; +import gregtech.api.util.GT_Utility; +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 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.mDescriptionArray, 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 b572b79fbc..4ac1f0efd0 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 @@ -1,96 +1,95 @@ -package gregtech.common.tileentities.machines.steam;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
-import gregtech.api.gui.GT_GUIContainer_BasicMachine;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-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_ModHandler;
-import gregtech.api.util.GT_Utility;
-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 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.mDescriptionArray, 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)};
- }
-}
+package gregtech.common.tileentities.machines.steam; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_GUIContainer_BasicMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +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_ModHandler; +import gregtech.api.util.GT_Utility; +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 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.mDescriptionArray, 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 573af14373..7d666e8c58 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 @@ -8,7 +8,6 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; 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_ModHandler; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; @@ -19,8 +18,7 @@ import java.util.Random; import static gregtech.api.enums.GT_Values.V; -public class GT_MetaTileEntity_Macerator_Bronze - extends GT_MetaTileEntity_BasicMachine_Bronze { +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); } 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 d83711ac95..66c1a3883d 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 @@ -8,7 +8,6 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; 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_ModHandler;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
@@ -19,8 +18,7 @@ import java.util.Random; import static gregtech.api.enums.GT_Values.V;
-public class GT_MetaTileEntity_Macerator_Steel
- extends GT_MetaTileEntity_BasicMachine_Steel {
+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);
}
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 22e9a23843..1eb62153e7 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 @@ -1,167 +1,167 @@ -package gregtech.common.tileentities.storage;
-
-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.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
-import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_Utility;
-import net.minecraft.entity.player.EntityPlayer;
-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 GT_MetaTileEntity_Locker(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, 4, aDescription, aTextures);
- }
-
- public String[] getDescription() {
- String[] desc = new String[mDescriptionArray.length + 1];
- System.arraycopy(mDescriptionArray, 0, desc, 0, mDescriptionArray.length);
- desc[mDescriptionArray.length] = "Click with Screwdriver to change Style";
- return desc;
- }
-
- 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.mDescriptionArray, 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;
- }
-}
+package gregtech.common.tileentities.storage; + +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.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayer; +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 GT_MetaTileEntity_Locker(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 4, aDescription, aTextures); + } + + public String[] getDescription() { + String[] desc = new String[mDescriptionArray.length + 1]; + System.arraycopy(mDescriptionArray, 0, desc, 0, mDescriptionArray.length); + desc[mDescriptionArray.length] = "Click with Screwdriver to change Style"; + return desc; + } + + 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[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.mDescriptionArray, 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 a17f11d495..5ab451bb03 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 @@ -13,12 +13,13 @@ 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.util.EnumChatFormatting; 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"); + super(aID, aName, aNameRegional, aTier, 3, "This Chest stores " + CommonSizeCompute(aTier) + " Blocks"); } public GT_MetaTileEntity_QuantumChest(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -125,8 +126,25 @@ public class GT_MetaTileEntity_QuantumChest extends GT_MetaTileEntity_TieredMach return getMaxItemCount(); } + private static int CommonSizeCompute(int tier){ + switch(tier){ + case 6: + return 128000000; + case 7: + return 256000000; + case 8: + return 512000000; + case 9: + return 1024000000; + case 10: + return 2147483640; + default: + return 0; + } + } + public int getMaxItemCount() { - return (int) (((Math.pow(6, mTier)) * 270000) - 128); + return CommonSizeCompute(mTier); } @Override @@ -144,18 +162,20 @@ public class GT_MetaTileEntity_QuantumChest extends GT_MetaTileEntity_TieredMach if (mItemStack == null) { return new String[]{ - "Quantum Chest", + EnumChatFormatting.BLUE + "Quantum Chest"+ EnumChatFormatting.RESET, "Stored Items:", - "No Items", - Integer.toString(0), - Integer.toString(getMaxItemCount())}; + EnumChatFormatting.GOLD+ "No Items"+ EnumChatFormatting.RESET, + EnumChatFormatting.GREEN + "0" + EnumChatFormatting.RESET+" "+ + EnumChatFormatting.YELLOW + Integer.toString(getMaxItemCount())+ EnumChatFormatting.RESET + }; } return new String[]{ - "Quantum Chest", + EnumChatFormatting.BLUE + "Quantum Chest"+ EnumChatFormatting.RESET, "Stored Items:", - mItemStack.getDisplayName(), - Integer.toString(mItemCount), - Integer.toString(getMaxItemCount())}; + EnumChatFormatting.GOLD + mItemStack.getDisplayName() + EnumChatFormatting.RESET, + EnumChatFormatting.GREEN + Integer.toString(mItemCount) + EnumChatFormatting.RESET+" "+ + EnumChatFormatting.YELLOW + Integer.toString(getMaxItemCount())+ EnumChatFormatting.RESET + }; } @Override @@ -190,4 +210,4 @@ public class GT_MetaTileEntity_QuantumChest extends GT_MetaTileEntity_TieredMach 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 015ea7ab4b..10a1a14bda 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 @@ -8,11 +8,12 @@ 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; +import net.minecraft.util.EnumChatFormatting; 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"); + super(aID, aName, aNameRegional, aTier, 3, "Stores " + CommonSizeCompute(aTier) + "L of fluid"); } public GT_MetaTileEntity_QuantumTank(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -105,18 +106,20 @@ public class GT_MetaTileEntity_QuantumTank if (mFluid == null) { return new String[]{ - "Quantum Tank", + EnumChatFormatting.BLUE + "Quantum Tank"+ EnumChatFormatting.RESET, "Stored Fluid:", - "No Fluid", - Integer.toString(0) + "L", - Integer.toString(getCapacity()) + "L"}; + EnumChatFormatting.GOLD + "No Fluid"+ EnumChatFormatting.RESET, + EnumChatFormatting.GREEN + Integer.toString(0) + " L"+ EnumChatFormatting.RESET+" "+ + EnumChatFormatting.YELLOW + Integer.toString(getCapacity()) + " L"+ EnumChatFormatting.RESET + }; } return new String[]{ - "Quantum Tank", + EnumChatFormatting.BLUE + "Quantum Tank"+ EnumChatFormatting.RESET, "Stored Fluid:", - mFluid.getLocalizedName(), - Integer.toString(mFluid.amount) + "L", - Integer.toString(getCapacity()) + "L"}; + EnumChatFormatting.GOLD + mFluid.getLocalizedName()+ EnumChatFormatting.RESET, + EnumChatFormatting.GREEN + Integer.toString(mFluid.amount) + " L"+ EnumChatFormatting.RESET+" "+ + EnumChatFormatting.YELLOW+ Integer.toString(getCapacity()) + " L"+ EnumChatFormatting.RESET + }; } @Override @@ -129,9 +132,26 @@ public class GT_MetaTileEntity_QuantumTank return new GT_MetaTileEntity_QuantumTank(mName, mTier, mDescriptionArray, mTextures); } + private static int CommonSizeCompute(int tier){ + switch(tier){ + case 6: + return 128000000; + case 7: + return 256000000; + case 8: + return 512000000; + case 9: + return 1024000000; + case 10: + return 2147483640; + default: + return 0; + } + } + @Override public int getCapacity() { - return (int) (Math.pow(6, mTier) * 267000); + return CommonSizeCompute(mTier); } @Override @@ -139,4 +159,4 @@ public class GT_MetaTileEntity_QuantumTank return 100; } -}
\ No newline at end of file +} diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperChest.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperChest.java new file mode 100644 index 0000000000..76e10eddc1 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperChest.java @@ -0,0 +1,250 @@ +package gregtech.common.tileentities.storage; + +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_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; +import net.minecraft.util.EnumChatFormatting; + +public class GT_MetaTileEntity_SuperChest extends GT_MetaTileEntity_TieredMachineBlock { + public int mItemCount = 0; + public ItemStack mItemStack = null; + public GT_MetaTileEntity_SuperChest(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 3, "This Chest stores " + CommonSizeCompute(aTier) + " Blocks"); + } + + public GT_MetaTileEntity_SuperChest(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_SuperChest(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(); +// if (tPlayerItem == null) +// { +// if (this.mItemID > 0) +// { +// for (int i = 0; (this.mItemCount < getMaxItemCount()) && (i < aPlayer.field_71071_by.func_70302_i_()); i++) +// { +// if ((aPlayer.field_71071_by.func_70301_a(i) != null) && (aPlayer.field_71071_by.func_70301_a(i).field_77993_c == this.mItemID) && (aPlayer.field_71071_by.func_70301_a(i).func_77960_j() == this.mItemMeta) && (!aPlayer.field_71071_by.func_70301_a(i).func_77942_o())) +// { +// this.mItemCount += aPlayer.field_71071_by.func_70301_a(i).field_77994_a; +// if (aPlayer.field_71071_by.func_70301_a(i).field_77994_a == 111) +// { +// this.mItemCount = (getMaxItemCount() + 192 - (this.mItemCount + (this.mInventory[0] == null ? 0 : this.mInventory[0].field_77994_a) + (this.mInventory[1] == null ? 0 : this.mInventory[1].field_77994_a) + (this.mInventory[2] == null ? 0 : this.mInventory[2].field_77994_a))); +// } +// else if (this.mItemCount > getMaxItemCount()) +// { +// aPlayer.field_71071_by.func_70301_a(i).field_77994_a = (this.mItemCount - getMaxItemCount()); +// this.mItemCount = getMaxItemCount(); +// } +// else +// { +// aPlayer.field_71071_by.func_70301_a(i).field_77994_a = 0; +// } +// } +// if ((aPlayer.field_71071_by.func_70301_a(i) != null) && (aPlayer.field_71071_by.func_70301_a(i).field_77994_a <= 0)) { +// aPlayer.field_71071_by.func_70299_a(i, null); +// } +// } +// GT_Utility.sendChatToPlayer(aPlayer, this.mItemCount + (this.mInventory[0] == null ? 0 : this.mInventory[0].field_77994_a) + (this.mInventory[1] == null ? 0 : this.mInventory[1].field_77994_a) + (this.mInventory[2] == null ? 0 : this.mInventory[2].field_77994_a) + " of " + new ItemStack(this.mItemID, 1, this.mItemMeta).func_82833_r()); +// } +// } +// if (aPlayer.field_71069_bz != null) { +// aPlayer.field_71069_bz.func_75142_b(); +// } +// } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + 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(mInventory[0]!=null)System.out.println("input: "+mInventory[0].stackSize); +// System.out.println("store: "+mItemCount); +// if(mInventory[0]!=null)System.out.println("output: "+mInventory[2].stackSize); + 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(); + this.mInventory[2].stackSize = Math.min(mItemStack.getMaxStackSize(), this.mItemCount); + } 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(); + } + + private static int CommonSizeCompute(int tier){ + switch(tier){ + case 1: + return 4000000; + case 2: + return 8000000; + case 3: + return 16000000; + case 4: + return 32000000; + case 5: + return 64000000; + default: + return 0; + } + } + + public int getMaxItemCount() { + return CommonSizeCompute(mTier); + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return aIndex==1; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return aIndex==0&&(mInventory[0]==null||GT_Utility.areStacksEqual(this.mInventory[0], aStack)); + } + + @Override + public String[] getInfoData() { + + if (mItemStack == null) { + return new String[]{ + EnumChatFormatting.BLUE + "Super Chest"+ EnumChatFormatting.RESET, + "Stored Items:", + EnumChatFormatting.GOLD+ "No Items"+ EnumChatFormatting.RESET, + EnumChatFormatting.GREEN + "0" + EnumChatFormatting.RESET+" "+ + EnumChatFormatting.YELLOW + Integer.toString(getMaxItemCount())+ EnumChatFormatting.RESET + }; + } + return new String[]{ + EnumChatFormatting.BLUE + "Super Chest"+ EnumChatFormatting.RESET, + "Stored Items:", + EnumChatFormatting.GOLD + mItemStack.getDisplayName() + EnumChatFormatting.RESET, + EnumChatFormatting.GREEN + Integer.toString(mItemCount) + EnumChatFormatting.RESET+" "+ + EnumChatFormatting.YELLOW + Integer.toString(getMaxItemCount())+ EnumChatFormatting.RESET + }; + } + + @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_SCHEST)}; + } + return aSide == aBaseMetaTileEntity.getFrontFacing() ? new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SCHEST)} : new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1]}; + } + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + return new ITexture[0][0][0]; + } +} diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperTank.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperTank.java new file mode 100644 index 0000000000..57068bb584 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperTank.java @@ -0,0 +1,158 @@ +package gregtech.common.tileentities.storage; + +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_BasicTank; +import gregtech.api.objects.GT_RenderedTexture; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; + +public class GT_MetaTileEntity_SuperTank + extends GT_MetaTileEntity_BasicTank { + public GT_MetaTileEntity_SuperTank(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 3, "Stores " + CommonSizeCompute(aTier) + "L of fluid"); + } + + public GT_MetaTileEntity_SuperTank(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_STANK)} : 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[]{ + EnumChatFormatting.BLUE + "Super Tank"+ EnumChatFormatting.RESET, + "Stored Fluid:", + EnumChatFormatting.GOLD + "No Fluid"+ EnumChatFormatting.RESET, + EnumChatFormatting.GREEN + Integer.toString(0) + " L"+ EnumChatFormatting.RESET+" "+ + EnumChatFormatting.YELLOW + Integer.toString(getCapacity()) + " L"+ EnumChatFormatting.RESET + }; + } + return new String[]{ + EnumChatFormatting.BLUE + "Super Tank"+ EnumChatFormatting.RESET, + "Stored Fluid:", + EnumChatFormatting.GOLD + mFluid.getLocalizedName()+ EnumChatFormatting.RESET, + EnumChatFormatting.GREEN + Integer.toString(mFluid.amount) + " L"+ EnumChatFormatting.RESET+" "+ + EnumChatFormatting.YELLOW+ Integer.toString(getCapacity()) + " L"+ EnumChatFormatting.RESET + }; + } + + @Override + public boolean isGivingInformation() { + return true; + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_SuperTank(mName, mTier, mDescription, mTextures); + } + + private static int CommonSizeCompute(int tier){ + switch(tier){ + case 1: + return 4000000; + case 2: + return 8000000; + case 3: + return 16000000; + case 4: + return 32000000; + case 5: + return 64000000; + default: + return 0; + } + } + + @Override + public int getCapacity() { + return CommonSizeCompute(mTier); + } + + @Override + public int getTankPressure() { + return 100; + } + +} |