From 3aae928510b260af3f1d1abe458a62289feffdc4 Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Mon, 11 Apr 2016 21:47:47 +0200 Subject: Added Assembly Line Multiblock --- .../multi/GT_MetaTileEntity_AssemblyLine.java | 199 +++++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java (limited to 'src/main/java/gregtech/common/tileentities') 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 new file mode 100644 index 0000000000..bead2e19c4 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java @@ -0,0 +1,199 @@ +package gregtech.common.tileentities.machines.multi; + +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_MultiBlockBase; +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 java.util.ArrayList; +import java.util.Arrays; + +public class GT_MetaTileEntity_AssemblyLine + extends GT_MetaTileEntity_MultiBlockBase { + public GT_MetaTileEntity_AssemblyLine(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_MetaTileEntity_AssemblyLine(String aName) { + super(aName); + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_AssemblyLine(this.mName); + } + + public String[] getDescription() { + return new String[]{"Assembly line", + "Size: 3x(2-16)x4, variable lenght", + "Bottom: Steel Casing(or Maintainance or Input Hatch), Input Bus(Last Output Bus), Steel Casing", + "Middle: Reinforced Glass, Assembling Line, Reinforced Glass", + "UpMiddle: Grate Casing(or Controller), Assambling Casing, Grate Casing", + "Top: Steel Casing(or Energy Hatch)", + "Up to 16 repeating slices, last is Butput Bus"}; + } + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[16], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR)}; + } + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[16]}; + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ImplosionCompressor.png"); + } + + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return GT_Recipe.GT_Recipe_Map.sImplosionRecipes; + } + + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + public boolean isFacingValid(byte aFacing) { + return aFacing > 1; + } + + public boolean checkRecipe(ItemStack aStack) { + ArrayList tInputList = getStoredInputs(); + + return false; + } + + public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { + super.startSoundLoop(aIndex, aX, aY, aZ); + if (aIndex == 20) { + GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(212), 10, 1.0F, aX, aY, aZ); + } + } + + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + if (xDir != 0) { + for(int r = 0; r <= 16; r++){ + int i = r*xDir; + + if(i!=0&&aBaseMetaTileEntity.getBlockOffset(0, 0, i)!=GregTech_API.sBlockCasings3&&aBaseMetaTileEntity.getMetaIDOffset(0, 0, i)!=10){return false;} + if(!aBaseMetaTileEntity.getBlockOffset(0, -1, i).getUnlocalizedName().equals("blockAlloyGlass")){return false;} + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(0, -2, i); + if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16))){ + if (aBaseMetaTileEntity.getBlockOffset(0, -2, i) != GregTech_API.sBlockCasings2) {return false;} + if (aBaseMetaTileEntity.getMetaIDOffset(0, -2, i) != 0) {return false;} + } + + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 1, i); + if (!addEnergyInputToMachineList(tTileEntity, 16)){ + if (aBaseMetaTileEntity.getBlockOffset(xDir, 1, i) != GregTech_API.sBlockCasings2) {return false;} + if (aBaseMetaTileEntity.getMetaIDOffset(xDir, 1, i) != 0) {return false;} + } + if(i!=0&&aBaseMetaTileEntity.getBlockOffset(xDir, 0, i)!=GregTech_API.sBlockCasings2&&aBaseMetaTileEntity.getMetaIDOffset(xDir, 0, i)!=9){return false;} + if(i!=0&&aBaseMetaTileEntity.getBlockOffset(xDir,-1, i)!=GregTech_API.sBlockCasings2&&aBaseMetaTileEntity.getMetaIDOffset(xDir,-1, i)!=5){return false;} + + + if(aBaseMetaTileEntity.getBlockOffset(xDir*2, 0, i)!=GregTech_API.sBlockCasings3&&aBaseMetaTileEntity.getMetaIDOffset(xDir*2, 0, i)!=10){return false;} + if(!aBaseMetaTileEntity.getBlockOffset(xDir*2, -1, i).getUnlocalizedName().equals("blockAlloyGlass")){return false;} + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir*2, -2, i); + if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16))){ + if (aBaseMetaTileEntity.getBlockOffset(xDir*2, -2, i) != GregTech_API.sBlockCasings2) {return false;} + if (aBaseMetaTileEntity.getMetaIDOffset(xDir*2, -2, i) != 0) {return false;} + } + + + + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, -2, i); + if (!addInputToMachineList(tTileEntity, 16)){ + if (!addOutputToMachineList(tTileEntity, 16)){ + System.out.println("finish3");return false; + }else{if(r>0){System.out.println("finish");return true;}else{System.out.println("finish2");return false;}} + } + System.out.println("success: "+i); + + + } + }else{ + for(int r = 0; r <= 16; r++){ + int i = r*zDir; + + if(i!=0&&aBaseMetaTileEntity.getBlockOffset(i, 0, 0)!=GregTech_API.sBlockCasings3&&aBaseMetaTileEntity.getMetaIDOffset(i, 0, 0)!=10){return false;} + if(!aBaseMetaTileEntity.getBlockOffset(i, -1, 0).getUnlocalizedName().equals("blockAlloyGlass")){return false;} + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, 0); + if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16))){ + if (aBaseMetaTileEntity.getBlockOffset(i, -2, 0) != GregTech_API.sBlockCasings2) {return false;} + if (aBaseMetaTileEntity.getMetaIDOffset(i, -2, 0) != 0) {return false;} + } + + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, 1, zDir); + if (!addEnergyInputToMachineList(tTileEntity, 16)){ + if (aBaseMetaTileEntity.getBlockOffset(i, 1, zDir) != GregTech_API.sBlockCasings2) {return false;} + if (aBaseMetaTileEntity.getMetaIDOffset(i, 1, zDir) != 0) {return false;} + } + if(i!=0&&aBaseMetaTileEntity.getBlockOffset(i, 0, zDir)!=GregTech_API.sBlockCasings2&&aBaseMetaTileEntity.getMetaIDOffset(i, 0, zDir)!=9){return false;} + if(i!=0&&aBaseMetaTileEntity.getBlockOffset(i,-1, zDir)!=GregTech_API.sBlockCasings2&&aBaseMetaTileEntity.getMetaIDOffset(i,-1, zDir)!=5){return false;} + + + if(aBaseMetaTileEntity.getBlockOffset(i, 0, zDir*2)!=GregTech_API.sBlockCasings3&&aBaseMetaTileEntity.getMetaIDOffset(i, 0, zDir*2)!=10){return false;} + if(!aBaseMetaTileEntity.getBlockOffset(i, -1, zDir*2).getUnlocalizedName().equals("blockAlloyGlass")){return false;} + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, zDir*2); + if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16))){ + if (aBaseMetaTileEntity.getBlockOffset(i, -2, zDir*2) != GregTech_API.sBlockCasings2) {return false;} + if (aBaseMetaTileEntity.getMetaIDOffset(i, -2, zDir*2) != 0) {return false;} + } + + + + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, zDir); + if (!addInputToMachineList(tTileEntity, 16)){ + if (!addOutputToMachineList(tTileEntity, 16)){ + System.out.println("finish3");return false; + }else{if(r>0){System.out.println("finish");return true;}else{System.out.println("finish2");return false;}} + } + System.out.println("success: "+i); + + + } + + } + + + + + + + + + + return false; + } + + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + public int getPollutionPerTick(ItemStack aStack) { + return 1000; + } + + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + public int getAmountOfOutputs() { + return 2; + } + + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } +} -- cgit From 83344732eb6678a507042997e7b3008d1c935486 Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Mon, 11 Apr 2016 21:50:01 +0200 Subject: Cleanup --- .../multi/GT_MetaTileEntity_AssemblyLine.java | 34 ++++------------------ 1 file changed, 5 insertions(+), 29 deletions(-) (limited to 'src/main/java/gregtech/common/tileentities') 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 bead2e19c4..bdfdce8707 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 @@ -109,18 +109,11 @@ public class GT_MetaTileEntity_AssemblyLine if (aBaseMetaTileEntity.getBlockOffset(xDir*2, -2, i) != GregTech_API.sBlockCasings2) {return false;} if (aBaseMetaTileEntity.getMetaIDOffset(xDir*2, -2, i) != 0) {return false;} } - - - tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, -2, i); if (!addInputToMachineList(tTileEntity, 16)){ - if (!addOutputToMachineList(tTileEntity, 16)){ - System.out.println("finish3");return false; - }else{if(r>0){System.out.println("finish");return true;}else{System.out.println("finish2");return false;}} + if (!addOutputToMachineList(tTileEntity, 16)){;return false; + }else{if(r>0){return true;}else{return false;}} } - System.out.println("success: "+i); - - } }else{ for(int r = 0; r <= 16; r++){ @@ -150,30 +143,13 @@ public class GT_MetaTileEntity_AssemblyLine if (aBaseMetaTileEntity.getBlockOffset(i, -2, zDir*2) != GregTech_API.sBlockCasings2) {return false;} if (aBaseMetaTileEntity.getMetaIDOffset(i, -2, zDir*2) != 0) {return false;} } - - - tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, zDir); if (!addInputToMachineList(tTileEntity, 16)){ if (!addOutputToMachineList(tTileEntity, 16)){ - System.out.println("finish3");return false; - }else{if(r>0){System.out.println("finish");return true;}else{System.out.println("finish2");return false;}} + }else{if(r>0){return true;}else{return false;}} } - System.out.println("success: "+i); - - - } - - } - - - - - - - - - + } + } return false; } -- cgit From 22dd09be013869e961d8532b8f7bfe5a53091f6f Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Mon, 11 Apr 2016 22:30:53 +0200 Subject: Adding assembly line recipes --- .../tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common/tileentities') 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 bdfdce8707..721f157d99 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 @@ -117,7 +117,7 @@ public class GT_MetaTileEntity_AssemblyLine } }else{ for(int r = 0; r <= 16; r++){ - int i = r*zDir; + int i = r*-zDir; if(i!=0&&aBaseMetaTileEntity.getBlockOffset(i, 0, 0)!=GregTech_API.sBlockCasings3&&aBaseMetaTileEntity.getMetaIDOffset(i, 0, 0)!=10){return false;} if(!aBaseMetaTileEntity.getBlockOffset(i, -1, 0).getUnlocalizedName().equals("blockAlloyGlass")){return false;} -- cgit From c98736b7b3f8911e70654047e963ed80b1f4d34a Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Mon, 11 Apr 2016 23:14:57 +0200 Subject: Adding assembly line recipe check --- .../multi/GT_MetaTileEntity_AssemblyLine.java | 57 +++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common/tileentities') 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 721f157d99..46a21b34af 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 @@ -14,6 +14,7 @@ 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; @@ -67,7 +68,61 @@ public class GT_MetaTileEntity_AssemblyLine public boolean checkRecipe(ItemStack aStack) { ArrayList tInputList = getStoredInputs(); - + for (int i = 0; i < tInputList.size() - 1; i++) { + for (int j = i + 1; j < tInputList.size(); j++) { + if (GT_Utility.areStacksEqual((ItemStack) tInputList.get(i), (ItemStack) tInputList.get(j))) { + if (((ItemStack) tInputList.get(i)).stackSize >= ((ItemStack) tInputList.get(j)).stackSize) { + tInputList.remove(j--); + } else { + tInputList.remove(i--); + break; + } + } + } + } + ItemStack[] tInputs = (ItemStack[]) Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2); + + ArrayList tFluidList = getStoredFluids(); + for (int i = 0; i < tFluidList.size() - 1; i++) { + for (int j = i + 1; j < tFluidList.size(); j++) { + if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) { + if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) { + tFluidList.remove(j--); + } else { + tFluidList.remove(i--); + break; + } + } + } + } + FluidStack[] tFluids = (FluidStack[]) Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1); + if (tInputList.size() > 0) { + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sAssemblylineRecipes.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; + if (tRecipe.mEUt <= 16) { + this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1)); + this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1)); + } else { + this.mEUt = tRecipe.mEUt; + this.mMaxProgresstime = tRecipe.mDuration; + while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { + this.mEUt *= 4; + this.mMaxProgresstime /= 2; + } + } + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)}; + updateSlots(); + return true; + } + } return false; } -- cgit From 31e4330b69c8d08099af177af18c8955e029aeae Mon Sep 17 00:00:00 2001 From: Muramasa Date: Sun, 17 Apr 2016 01:41:06 +0100 Subject: Large Diesel Generator Added large diesel generator to the game. It replicates the Large Plasma Generator but it's nominal output is 1/8 that plasmas is. Plasma Nominal: Optimal Steam Flow * 40 Diesel Nominal: Optimal Steam Flow * 5 --- .../GT_MetaTileEntity_LargeTurbine_Diesel.java | 128 +++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Diesel.java (limited to 'src/main/java/gregtech/common/tileentities') diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Diesel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Diesel.java new file mode 100644 index 0000000000..ddd11bb338 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Diesel.java @@ -0,0 +1,128 @@ +package gregtech.common.tileentities.machines.multi; + +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.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 net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import java.util.ArrayList; +import java.util.Collection; + +public class GT_MetaTileEntity_LargeTurbine_Diesel extends GT_MetaTileEntity_LargeTurbine { + + public GT_MetaTileEntity_LargeTurbine_Diesel(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_MetaTileEntity_LargeTurbine_Diesel(String aName) { + super(aName); + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]}; + } + + + public String[] getDescription() { + return new String[]{ + "Controller Block for the Large Diesel Generator", + "Size: 3x4x3 (Hollow)", "Controller (front centered)", + "1x Input Hatch (side centered)", + "1x Dynamo Hatch (back centered)", + "1x Maintenance Hatch (side centered)", + "Turbine Casings for the rest (24 at least!)", + "Needs a Turbine Item (inside controller GUI)"}; + } + + public int getFuelValue(FluidStack aLiquid) { + if (aLiquid == null || GT_Recipe_Map.sTurbineFuels == null) return 0; + FluidStack tLiquid; + Collection tRecipeList = GT_Recipe_Map.sDieselFuels.mRecipeList; + if (tRecipeList != null) for (GT_Recipe tFuel : tRecipeList) + if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null) + if (aLiquid.isFluidEqual(tLiquid)) return tFuel.mSpecialValue; + return 0; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_LargeTurbine_Plasma(mName); + } + + @Override + public Block getCasingBlock() { + return GregTech_API.sBlockCasings4; + } + + @Override + public byte getCasingMeta() { + return 9; + } + + @Override + public byte getCasingTextureIndex() { + return 46; + } + + @Override + public int getPollutionPerTick(ItemStack aStack) { + return 0; + } + + @Override + int fluidIntoPower(ArrayList aFluids, int aOptFlow, int aBaseEff) { + + aOptFlow *= 5; + 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); + + int remainingFlow = (int) (actualOptimalFlow * 1.25f); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios. + int flow = 0; + int totalFlow = 0; + + for (int i = 0; i < aFluids.size(); 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 + depleteInput(new FluidStack(aFluids.get(i), flow)); // deplete that amount + remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches + totalFlow += flow; // track total input used + } + } + + tEU = (int) (Math.min((float) actualOptimalFlow, totalFlow) * fuelValue); + + if (totalFlow != actualOptimalFlow) { + float efficiency = 1.0f - Math.abs(((totalFlow - (float) actualOptimalFlow) / actualOptimalFlow)); + if(totalFlow>aOptFlow){efficiency = 1.0f;} + if (efficiency < 0) + efficiency = 0; // Can happen with really ludicrously poor inefficiency. + tEU *= efficiency; + tEU = Math.max(1, tEU * aBaseEff / 10000); + } else { + tEU = tEU * aBaseEff / 10000; + } + + return tEU; + + } + return 0; + } + + +} -- cgit From 063b62b4ca34c4f90696216317de21b975aa2d41 Mon Sep 17 00:00:00 2001 From: Muramasa Date: Sun, 17 Apr 2016 03:05:58 +0100 Subject: Fixed newMetaEntity using Plasma Generator --- .../machines/multi/GT_MetaTileEntity_LargeTurbine_Diesel.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common/tileentities') diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Diesel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Diesel.java index ddd11bb338..6a5a9e0473 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Diesel.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Diesel.java @@ -55,7 +55,7 @@ public class GT_MetaTileEntity_LargeTurbine_Diesel extends GT_MetaTileEntity_Lar @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_LargeTurbine_Plasma(mName); + return new GT_MetaTileEntity_LargeTurbine_Diesel(mName); } @Override @@ -89,6 +89,7 @@ public class GT_MetaTileEntity_LargeTurbine_Diesel extends GT_MetaTileEntity_Lar if (aFluids.size() >= 1) { FluidStack firstFuelType = new FluidStack(aFluids.get(0), 0); // Identify a SINGLE type of fluid to process. Doesn't matter which one. Ignore the rest! int fuelValue = getFuelValue(firstFuelType); + System.out.println(fuelValue); actualOptimalFlow = (int) ((aOptFlow + fuelValue - 1) / fuelValue); int remainingFlow = (int) (actualOptimalFlow * 1.25f); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios. -- cgit From ddc0c4299e8d3c703b6b93f876ce38f961d08236 Mon Sep 17 00:00:00 2001 From: Muramasa Date: Sun, 17 Apr 2016 07:40:10 +0100 Subject: Turbine Rebalance Added 3 new turbine casings to rebalance the turbines. Also changed turbine controller recipes to fit the rebalance. Large Steam: Steel Turbine Casing Large HP Steam Turbine: Stainless Steel Turbine Casing Large Gas Turbine: Steel Turbine Casing Large Diesel Turbine: Titanium Turbine Casing Large Plasma Turbine: Tungstensteel Turbine Casing --- .../machines/multi/GT_MetaTileEntity_LargeTurbine_Diesel.java | 6 +++--- .../machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java | 6 +++--- .../machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java | 6 +++--- .../machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java | 6 +++--- .../machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src/main/java/gregtech/common/tileentities') diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Diesel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Diesel.java index 6a5a9e0473..7866d96435 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Diesel.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Diesel.java @@ -28,7 +28,7 @@ public class GT_MetaTileEntity_LargeTurbine_Diesel extends GT_MetaTileEntity_Lar @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]}; + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_TI_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_TI5) : Textures.BlockIcons.CASING_BLOCKS[59]}; } @@ -39,7 +39,7 @@ public class GT_MetaTileEntity_LargeTurbine_Diesel extends GT_MetaTileEntity_Lar "1x Input Hatch (side centered)", "1x Dynamo Hatch (back centered)", "1x Maintenance Hatch (side centered)", - "Turbine Casings for the rest (24 at least!)", + "Titanium Turbine Casings for the rest (24 at least!)", "Needs a Turbine Item (inside controller GUI)"}; } @@ -65,7 +65,7 @@ public class GT_MetaTileEntity_LargeTurbine_Diesel extends GT_MetaTileEntity_Lar @Override public byte getCasingMeta() { - return 9; + return 11; } @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 419b885d47..a371ce9646 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 @@ -28,7 +28,7 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]}; + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_SS_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_SS5) : Textures.BlockIcons.CASING_BLOCKS[58]}; } @@ -40,7 +40,7 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT "1x Dynamo Hatch (back centered)", "1x Maintenance Hatch (side centered)", "1x Muffler Hatch (side centered)", - "Turbine Casings for the rest (24 at least!)", + "Stainless Steel Turbine Casings for the rest (24 at least!)", "Needs a Turbine Item (inside controller GUI)"}; } @@ -66,7 +66,7 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT @Override public byte getCasingMeta() { - return 9; + return 10; } @Override 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 b9b4b7b2b4..e1a33330d5 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 @@ -28,7 +28,7 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]}; + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_SS_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_SS5) : Textures.BlockIcons.CASING_BLOCKS[58]}; } public String[] getDescription() { @@ -38,7 +38,7 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La "1x Input Hatch (side centered)", "1x Output Hatch(side centered)", "1x Dynamo Hatch (back centered)", "1x Maintenance Hatch (side centered)", - "Turbine Casings for the rest (24 at least!)", + "Stainless Steel Turbine Casings for the rest (24 at least!)", "Needs a Turbine Item (inside controller GUI)"}; } @@ -54,7 +54,7 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La @Override public byte getCasingMeta() { - return 9; + return 10; } @Override 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 7cb84129c4..ab986bf717 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 @@ -28,7 +28,7 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]}; + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_TU_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_TU5) : Textures.BlockIcons.CASING_BLOCKS[60]}; } @@ -39,7 +39,7 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar "1x Input Hatch (side centered)", "1x Dynamo Hatch (back centered)", "1x Maintenance Hatch (side centered)", - "Turbine Casings for the rest (24 at least!)", + "Tungstensteel Turbine Casings for the rest (24 at least!)", "Needs a Turbine Item (inside controller GUI)"}; } @@ -65,7 +65,7 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar @Override public byte getCasingMeta() { - return 9; + return 12; } @Override 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 34e23196a7..534f53c36b 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 @@ -30,7 +30,7 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]}; + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ST_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ST5) : Textures.BlockIcons.CASING_BLOCKS[57]}; } public String[] getDescription() { -- cgit From 79444adc76688a463ddedfdb4088fb6aa8fe6747 Mon Sep 17 00:00:00 2001 From: Muramasa Date: Sun, 17 Apr 2016 07:41:35 +0100 Subject: Revert "Turbine Rebalance" This reverts commit ddc0c4299e8d3c703b6b93f876ce38f961d08236. --- .../machines/multi/GT_MetaTileEntity_LargeTurbine_Diesel.java | 6 +++--- .../machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java | 6 +++--- .../machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java | 6 +++--- .../machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java | 6 +++--- .../machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src/main/java/gregtech/common/tileentities') diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Diesel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Diesel.java index 7866d96435..6a5a9e0473 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Diesel.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Diesel.java @@ -28,7 +28,7 @@ public class GT_MetaTileEntity_LargeTurbine_Diesel extends GT_MetaTileEntity_Lar @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_TI_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_TI5) : Textures.BlockIcons.CASING_BLOCKS[59]}; + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]}; } @@ -39,7 +39,7 @@ public class GT_MetaTileEntity_LargeTurbine_Diesel extends GT_MetaTileEntity_Lar "1x Input Hatch (side centered)", "1x Dynamo Hatch (back centered)", "1x Maintenance Hatch (side centered)", - "Titanium Turbine Casings for the rest (24 at least!)", + "Turbine Casings for the rest (24 at least!)", "Needs a Turbine Item (inside controller GUI)"}; } @@ -65,7 +65,7 @@ public class GT_MetaTileEntity_LargeTurbine_Diesel extends GT_MetaTileEntity_Lar @Override public byte getCasingMeta() { - return 11; + return 9; } @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 a371ce9646..419b885d47 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 @@ -28,7 +28,7 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_SS_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_SS5) : Textures.BlockIcons.CASING_BLOCKS[58]}; + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]}; } @@ -40,7 +40,7 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT "1x Dynamo Hatch (back centered)", "1x Maintenance Hatch (side centered)", "1x Muffler Hatch (side centered)", - "Stainless Steel Turbine Casings for the rest (24 at least!)", + "Turbine Casings for the rest (24 at least!)", "Needs a Turbine Item (inside controller GUI)"}; } @@ -66,7 +66,7 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT @Override public byte getCasingMeta() { - return 10; + return 9; } @Override 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 e1a33330d5..b9b4b7b2b4 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 @@ -28,7 +28,7 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_SS_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_SS5) : Textures.BlockIcons.CASING_BLOCKS[58]}; + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]}; } public String[] getDescription() { @@ -38,7 +38,7 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La "1x Input Hatch (side centered)", "1x Output Hatch(side centered)", "1x Dynamo Hatch (back centered)", "1x Maintenance Hatch (side centered)", - "Stainless Steel Turbine Casings for the rest (24 at least!)", + "Turbine Casings for the rest (24 at least!)", "Needs a Turbine Item (inside controller GUI)"}; } @@ -54,7 +54,7 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La @Override public byte getCasingMeta() { - return 10; + return 9; } @Override 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 ab986bf717..7cb84129c4 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 @@ -28,7 +28,7 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_TU_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_TU5) : Textures.BlockIcons.CASING_BLOCKS[60]}; + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]}; } @@ -39,7 +39,7 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar "1x Input Hatch (side centered)", "1x Dynamo Hatch (back centered)", "1x Maintenance Hatch (side centered)", - "Tungstensteel Turbine Casings for the rest (24 at least!)", + "Turbine Casings for the rest (24 at least!)", "Needs a Turbine Item (inside controller GUI)"}; } @@ -65,7 +65,7 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar @Override public byte getCasingMeta() { - return 12; + return 9; } @Override 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 534f53c36b..34e23196a7 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 @@ -30,7 +30,7 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ST_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ST5) : Textures.BlockIcons.CASING_BLOCKS[57]}; + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]}; } public String[] getDescription() { -- cgit From 12a1d1c46ee02ba437a275cb9c9554db3f38fa8e Mon Sep 17 00:00:00 2001 From: Muramasa Date: Tue, 19 Apr 2016 23:17:31 +0100 Subject: Main Commit --- .../machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java | 8 ++++---- .../machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java | 8 ++++---- .../machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java | 8 ++++---- .../machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src/main/java/gregtech/common/tileentities') 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 419b885d47..a914ab3a12 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 @@ -28,7 +28,7 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]}; + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_SS_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_SS5) : Textures.BlockIcons.CASING_BLOCKS[59]}; } @@ -40,7 +40,7 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT "1x Dynamo Hatch (back centered)", "1x Maintenance Hatch (side centered)", "1x Muffler Hatch (side centered)", - "Turbine Casings for the rest (24 at least!)", + "Stainless Steel Turbine Casings for the rest (24 at least!)", "Needs a Turbine Item (inside controller GUI)"}; } @@ -66,12 +66,12 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT @Override public byte getCasingMeta() { - return 9; + return 11; } @Override public byte getCasingTextureIndex() { - return 46; + return 59; } @Override 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 b9b4b7b2b4..7befab0088 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 @@ -28,7 +28,7 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]}; + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_SS_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_SS5) : Textures.BlockIcons.CASING_BLOCKS[58]}; } public String[] getDescription() { @@ -38,7 +38,7 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La "1x Input Hatch (side centered)", "1x Output Hatch(side centered)", "1x Dynamo Hatch (back centered)", "1x Maintenance Hatch (side centered)", - "Turbine Casings for the rest (24 at least!)", + "Stainless Steel Turbine Casings for the rest (24 at least!)", "Needs a Turbine Item (inside controller GUI)"}; } @@ -54,12 +54,12 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La @Override public byte getCasingMeta() { - return 9; + return 10; } @Override public byte getCasingTextureIndex() { - return 46; + return 58; } @Override 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 7cb84129c4..c72e880783 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 @@ -28,7 +28,7 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]}; + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_TU_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_TU5) : Textures.BlockIcons.CASING_BLOCKS[60]}; } @@ -39,7 +39,7 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar "1x Input Hatch (side centered)", "1x Dynamo Hatch (back centered)", "1x Maintenance Hatch (side centered)", - "Turbine Casings for the rest (24 at least!)", + "Tungstensteel Turbine Casings for the rest (24 at least!)", "Needs a Turbine Item (inside controller GUI)"}; } @@ -65,12 +65,12 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar @Override public byte getCasingMeta() { - return 9; + return 12; } @Override public byte getCasingTextureIndex() { - return 46; + return 60; } @Override 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 34e23196a7..534f53c36b 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 @@ -30,7 +30,7 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]}; + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ST_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ST5) : Textures.BlockIcons.CASING_BLOCKS[57]}; } public String[] getDescription() { -- cgit From d713c5ddec9e944c636795d2cfcc6fa296ce7bf0 Mon Sep 17 00:00:00 2001 From: Muramasa Date: Tue, 19 Apr 2016 23:19:59 +0100 Subject: Remove Diesel Turbine --- .../GT_MetaTileEntity_LargeTurbine_Diesel.java | 129 --------------------- 1 file changed, 129 deletions(-) delete mode 100644 src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Diesel.java (limited to 'src/main/java/gregtech/common/tileentities') diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Diesel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Diesel.java deleted file mode 100644 index 6a5a9e0473..0000000000 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Diesel.java +++ /dev/null @@ -1,129 +0,0 @@ -package gregtech.common.tileentities.machines.multi; - -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.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 net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; - -import java.util.ArrayList; -import java.util.Collection; - -public class GT_MetaTileEntity_LargeTurbine_Diesel extends GT_MetaTileEntity_LargeTurbine { - - public GT_MetaTileEntity_LargeTurbine_Diesel(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - } - - public GT_MetaTileEntity_LargeTurbine_Diesel(String aName) { - super(aName); - } - - @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5) : new GT_RenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]}; - } - - - public String[] getDescription() { - return new String[]{ - "Controller Block for the Large Diesel Generator", - "Size: 3x4x3 (Hollow)", "Controller (front centered)", - "1x Input Hatch (side centered)", - "1x Dynamo Hatch (back centered)", - "1x Maintenance Hatch (side centered)", - "Turbine Casings for the rest (24 at least!)", - "Needs a Turbine Item (inside controller GUI)"}; - } - - public int getFuelValue(FluidStack aLiquid) { - if (aLiquid == null || GT_Recipe_Map.sTurbineFuels == null) return 0; - FluidStack tLiquid; - Collection tRecipeList = GT_Recipe_Map.sDieselFuels.mRecipeList; - if (tRecipeList != null) for (GT_Recipe tFuel : tRecipeList) - if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null) - if (aLiquid.isFluidEqual(tLiquid)) return tFuel.mSpecialValue; - return 0; - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_LargeTurbine_Diesel(mName); - } - - @Override - public Block getCasingBlock() { - return GregTech_API.sBlockCasings4; - } - - @Override - public byte getCasingMeta() { - return 9; - } - - @Override - public byte getCasingTextureIndex() { - return 46; - } - - @Override - public int getPollutionPerTick(ItemStack aStack) { - return 0; - } - - @Override - int fluidIntoPower(ArrayList aFluids, int aOptFlow, int aBaseEff) { - - aOptFlow *= 5; - 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); - System.out.println(fuelValue); - actualOptimalFlow = (int) ((aOptFlow + fuelValue - 1) / fuelValue); - - int remainingFlow = (int) (actualOptimalFlow * 1.25f); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios. - int flow = 0; - int totalFlow = 0; - - for (int i = 0; i < aFluids.size(); 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 - depleteInput(new FluidStack(aFluids.get(i), flow)); // deplete that amount - remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches - totalFlow += flow; // track total input used - } - } - - tEU = (int) (Math.min((float) actualOptimalFlow, totalFlow) * fuelValue); - - if (totalFlow != actualOptimalFlow) { - float efficiency = 1.0f - Math.abs(((totalFlow - (float) actualOptimalFlow) / actualOptimalFlow)); - if(totalFlow>aOptFlow){efficiency = 1.0f;} - if (efficiency < 0) - efficiency = 0; // Can happen with really ludicrously poor inefficiency. - tEU *= efficiency; - tEU = Math.max(1, tEU * aBaseEff / 10000); - } else { - tEU = tEU * aBaseEff / 10000; - } - - return tEU; - - } - return 0; - } - - -} -- cgit From 3f46725bbcf94ce0253119ecbc79ef266ef73725 Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Fri, 29 Apr 2016 20:54:05 +0200 Subject: Fix Butput Bus :P --- .../tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common/tileentities') 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 46a21b34af..e292c4a1c3 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 @@ -40,7 +40,7 @@ public class GT_MetaTileEntity_AssemblyLine "Middle: Reinforced Glass, Assembling Line, Reinforced Glass", "UpMiddle: Grate Casing(or Controller), Assambling Casing, Grate Casing", "Top: Steel Casing(or Energy Hatch)", - "Up to 16 repeating slices, last is Butput Bus"}; + "Up to 16 repeating slices, last is Output Bus"}; } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { -- cgit