diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2022-01-16 19:51:13 +0000 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2022-01-16 19:51:13 +0000 |
commit | e5eeec1ffc3eab063c765da7bb889017d87aabdd (patch) | |
tree | 9387d445ff67c9001ac69c760184c6573afa7147 /src/main/java/gtPlusPlus | |
parent | 222b1d640fb66dff8a865307c3ecf27db34f17ae (diff) | |
download | GT5-Unofficial-e5eeec1ffc3eab063c765da7bb889017d87aabdd.tar.gz GT5-Unofficial-e5eeec1ffc3eab063c765da7bb889017d87aabdd.tar.bz2 GT5-Unofficial-e5eeec1ffc3eab063c765da7bb889017d87aabdd.zip |
Added Recipe for Computer Cube MKII, Turbine Shaft, Rotor Assembly & Elemental Duplicator.
Removed a whole heap of pointless Reactor Planner files/functions.
Hide some of the modes in the Computer Cube.
Diffstat (limited to 'src/main/java/gtPlusPlus')
7 files changed, 568 insertions, 188 deletions
diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java index 1876001f11..cd960e5ca1 100644 --- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -266,11 +266,31 @@ public class RECIPES_Machines { multiSolarTower(); multiElementalDuplicator(); + computerCube(); + resonanceChambers(); modulators(); } + + private static void computerCube() { + + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(20), + CI.getTieredGTPPMachineCasing(4, 1), + CI.getCircuit(4, 8), + CI.getFieldGenerator(2, 4), + CI.getDoublePlate(4, 8), + CI.getRobotArm(4, 8) + }, + Materials.Redstone.getMolten(144 * 32), + GregtechItemList.Gregtech_Computer_Cube_Machine.get(1), + 20 * 60 * 10, + MaterialUtils.getVoltageForTier(4)); + + } private static void gt4FarmManager() { @@ -532,6 +552,25 @@ public class RECIPES_Machines { private static void multiXlTurbines() { + RecipeUtils.addShapedRecipe( + CI.getDoublePlate(4, 1), CI.getElectricMotor(3, 1), CI.getDoublePlate(4, 1), + ItemUtils.getItemStackOfAmountFromOreDict("cellLubricant", 1), ItemList.Casing_Gearbox_Titanium.get(1), ItemUtils.getItemStackOfAmountFromOreDict("cellLubricant", 1), + CI.getDoublePlate(4, 1), CI.getElectricMotor(3, 1), CI.getDoublePlate(4, 1), + GregtechItemList.Casing_Turbine_Shaft.get(1)); + + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(18), + ItemList.Casing_Turbine.get(1), + CI.getPlate(4, 4), + CI.getScrew(4, 8), + CI.getCircuit(4, 4), + CI.getGear(3, 8) + }, + CI.tieredMaterials[3].getMolten(144 * 8), + GregtechItemList.Hatch_Turbine_Rotor.get(1), + 20 * 60, + MaterialUtils.getVoltageForTier(4)); // Steam CORE.RA.addSixSlotAssemblingRecipe( @@ -712,6 +751,84 @@ public class RECIPES_Machines { private static void multiElementalDuplicator() { + CORE.RA.addAssemblylineRecipe( + ItemList.Machine_IV_Replicator.get(1), + 20 * 60 * 60 * 12, + new Object[] { + CI.getTieredMachineHull(7, 4), + CI.getFieldGenerator(5, GTNH ? 32 : 16), + CI.getElectricMotor(7, GTNH ? 32 : 16), + CI.getElectricPiston(7, GTNH ? 16 : 4), + CI.getEnergyCore(6, GTNH ? 8 : 2), + CI.getPlate(7, GTNH ? 32 : 16), + CI.getScrew(7, GTNH ? 64 : 32), + CI.getBolt(6, GTNH ? 64 : 32), + CI.getTieredComponent(OrePrefixes.rod, 6, GTNH ? 20 : 10), + new Object[] {CI.getTieredCircuitOreDictName(7), 20}, + ItemList.Tool_DataOrb.get(32), + GregtechItemList.Laser_Lens_Special.get(1) + }, + new FluidStack[] { + CI.getTieredFluid(7, 144 * 32), + CI.getAlternativeTieredFluid(6, 144 * 16), + CI.getTertiaryTieredFluid(6, 144 * 16), + ALLOY.BABBIT_ALLOY.getFluidStack(128 * 144), + + }, + GregtechItemList.Controller_ElementalDuplicator.get(1), + 20 * 60 * 60 * (GTNH ? 2 : 1), + (int) MaterialUtils.getVoltageForTier(7)); + + CORE.RA.addAssemblylineRecipe( + GregtechItemList.Modulator_III.get(1), + 20 * 60 * 60 * 4, + new Object[] { + CI.getTieredGTPPMachineCasing(7, 2), + CI.getFieldGenerator(4, GTNH ? 8 : 4), + CI.getEnergyCore(4, GTNH ? 8 : 2), + CI.getPlate(7, GTNH ? 16 : 8), + CI.getScrew(6, GTNH ? 32 : 16), + CI.getBolt(6, GTNH ? 32 : 16), + CI.getTieredComponent(OrePrefixes.rod, 5, GTNH ? 32 : 16), + new Object[] {CI.getTieredCircuitOreDictName(6), 32}, + ItemList.Tool_DataOrb.get(32), + }, + new FluidStack[] { + CI.getTieredFluid(6, 144 * 16), + CI.getAlternativeTieredFluid(5, 144 * 8), + CI.getTertiaryTieredFluid(5, 144 * 8), + ALLOY.BABBIT_ALLOY.getFluidStack(64 * 144), + + }, + GregtechItemList.Hatch_Input_Elemental_Duplicator.get(1), + 20 * 60 * 60 * (GTNH ? 4 : 2), + (int) MaterialUtils.getVoltageForTier(6)); + + CORE.RA.addAssemblylineRecipe( + GregtechItemList.ResonanceChamber_III.get(1), + 20 * 60 * 60 * 2, + new Object[] { + CI.getTieredMachineHull(6, 5), + CI.getFieldGenerator(3, GTNH ? 32 : 16), + CI.getEnergyCore(2, GTNH ? 8 : 2), + CI.getPlate(7, GTNH ? 8 : 4), + CI.getScrew(7, GTNH ? 8 : 4), + CI.getBolt(6, GTNH ? 16 : 8), + CI.getTieredComponent(OrePrefixes.rod, 5, GTNH ? 8 : 4), + new Object[] {CI.getTieredCircuitOreDictName(5), 4}, + ItemList.Tool_DataStick.get(4), + }, + new FluidStack[] { + CI.getTieredFluid(5, 144 * 16), + CI.getAlternativeTieredFluid(4, 144 * 8), + CI.getTertiaryTieredFluid(4, 144 * 8), + ALLOY.BABBIT_ALLOY.getFluidStack(16 * 144), + + }, + GregtechItemList.Casing_ElementalDuplicator.get(1), + 20 * 60 * (GTNH ? 20 : 10), + (int) MaterialUtils.getVoltageForTier(6)); + } private static void resonanceChambers() { diff --git a/src/main/java/gtPlusPlus/core/recipe/common/CI.java b/src/main/java/gtPlusPlus/core/recipe/common/CI.java index 6bdf77bec5..c5a514c31a 100644 --- a/src/main/java/gtPlusPlus/core/recipe/common/CI.java +++ b/src/main/java/gtPlusPlus/core/recipe/common/CI.java @@ -541,7 +541,7 @@ public class CI { ALLOY.TUMBAGA, ALLOY.EGLIN_STEEL, ALLOY.INCONEL_792, - ALLOY.TUNGSTEN_TITANIUM_CARBIDE, + ALLOY.INCOLOY_MA956, ALLOY.NITINOL_60, ALLOY.ZERON_100, ALLOY.PIKYONIUM, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index c61195a9e8..4d67603db0 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -501,12 +501,25 @@ public enum GregtechItemList implements GregtechItemContainer { Hatch_SuperBus_Output_MAX, - - //---------------------------------------------------------------------------- + /** + * Blocks + */ + + + ResonanceChamber_I, + ResonanceChamber_II, + ResonanceChamber_III, + ResonanceChamber_IV, + + Modulator_I, + Modulator_II, + Modulator_III, + Modulator_IV, + //---------------------------------------------------------------------------- /** diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_Container_ComputerCube.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_Container_ComputerCube.java index 80202695e7..8abe7bff66 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_Container_ComputerCube.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_Container_ComputerCube.java @@ -4,22 +4,16 @@ import java.util.Iterator; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.gui.GT_ContainerMetaTile_Machine; -import gregtech.api.gui.GT_Slot_Holo; -import gregtech.api.gui.GT_Slot_Output; +import gregtech.api.gui.*; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GT_ItemStack; import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.slots.SlotDataStick; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.common.tileentities.misc.GT_TileEntity_ComputerCube; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; +import net.minecraft.entity.player.*; +import net.minecraft.inventory.*; import net.minecraft.item.ItemStack; public class GT_Container_ComputerCube extends GT_ContainerMetaTile_Machine { @@ -39,6 +33,13 @@ public class GT_Container_ComputerCube extends GT_ContainerMetaTile_Machine { public long mEU; public int mEU1; public int mEU2; + + public long mStoredEU; + public int mStoredEU1; + public int mStoredEU2; + public long mMaxStoredEU; + public int mMaxStoredEU1; + public int mMaxStoredEU2; public int mProgress; @@ -66,90 +67,72 @@ public class GT_Container_ComputerCube extends GT_ContainerMetaTile_Machine { int y; mID = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMode; Logger.INFO(""+(Utils.isClient() ? "Client" : "Server")+" Mode: " + mID); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 58, 156 + ((this.mID == 5) ? 50 : 0), 4, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 156 + ((this.mID == 5) ? 50 : 0), 4, false, false, 1)); switch (this.mID) { case 1 : - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 58, 156, 86, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 58, 156, 70, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 58, 156, 54, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 156, 86, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 156, 70, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 156, 54, false, false, 1)); for (y = 0; y < 6; y++) { for (int x = 0; x < 9; x++) - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, x + y * 9, 5 + x * 16, 5 + y * 16, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, x + y * 9, 5 + x * 16, 5 + y * 16, false, false, 64)); } - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 113, 153, 28, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 113, 153, 28, false, false, 64)); break; case 2 : - addSlotToContainer(new Slot((IInventory) this.mTileEntity, 54, 8, 28)); - addSlotToContainer(new Slot((IInventory) this.mTileEntity, 55, 26, 28)); - addSlotToContainer(new GT_Slot_Output((IInventory) this.mTileEntity, 56, 134, 28)); - addSlotToContainer(new GT_Slot_Output((IInventory) this.mTileEntity, 57, 152, 28)); + addSlotToContainer(new SlotDataStick(this.mTileEntity, 54, 8, 28)); + addSlotToContainer(new Slot(this.mTileEntity, 55, 26, 28)); + addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 56, 134, 28)); + addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 57, 152, 28)); break; case 3 : - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 58, 88, 65, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 58, 104, 65, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 59, 122, 35, false, false, 64)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 60, 92, 5, false, false, 64)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 61, 122, 5, false, false, 64)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 62, 152, 35, false, false, 64)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 63, 122, 65, false, false, 64)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 64, 92, 35, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 88, 65, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 104, 65, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 59, 122, 35, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 60, 92, 5, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 61, 122, 5, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 62, 152, 35, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 63, 122, 65, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 64, 92, 35, false, false, 64)); break; case 4 : - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 58, 88, 65, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 58, 104, 65, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 59, 122, 5, false, false, 64)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 60, 122, 65, false, false, 64)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 61, 152, 35, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 88, 65, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 104, 65, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 59, 122, 5, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 60, 122, 65, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 61, 152, 35, false, false, 64)); break; case 5 : - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 58, 190, 146, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 58, 206, 146, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 59, 206, 38, false, false, 64)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 60, 206, 56, false, false, 64)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 61, 206, 74, false, false, 64)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 62, 206, 92, false, false, 64)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 63, 206, 110, false, false, 64)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 64, 153, 7, false, false, 64)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 65, 169, 7, false, false, 64)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 66, 185, 7, false, false, 64)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 67, 153, 23, false, false, 64)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 68, 169, 23, false, false, 64)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 69, 185, 23, false, false, 64)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 70, 153, 39, false, false, 64)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 71, 169, 39, false, false, 64)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 72, 185, 39, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 190, 146, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 206, 146, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 59, 206, 38, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 60, 206, 56, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 61, 206, 74, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 62, 206, 92, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 63, 206, 110, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 64, 153, 7, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 65, 169, 7, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 66, 185, 7, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 67, 153, 23, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 68, 169, 23, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 69, 185, 23, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 70, 153, 39, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 71, 169, 39, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 72, 185, 39, false, false, 64)); break; case 6 : - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 58, 88, 65, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 58, 104, 65, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 59, 122, 35, false, false, 64)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 60, 92, 5, false, false, 64)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 61, 122, 5, false, false, 64)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 62, 152, 35, false, false, 64)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 63, 122, 65, false, false, 64)); - addSlotToContainer(new GT_Slot_Holo((IInventory) this.mTileEntity, 64, 92, 35, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 88, 65, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 104, 65, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 59, 122, 35, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 60, 92, 5, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 61, 122, 5, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 62, 152, 35, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 63, 122, 65, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 64, 92, 35, false, false, 64)); break; } } - public int getComputerCubeGUIID() { - switch (getMode()) { - case 1 : - return 32; - case 2 : - return 34; - case 3 : - return 35; - case 4 : - return 36; - case 5 : - return 37; - case 6 : - return 38; - } - return 4; - } - public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { //Logger.INFO("Clicked slot " + aSlotIndex); if (aSlotIndex < 0) { @@ -187,51 +170,51 @@ public class GT_Container_ComputerCube extends GT_ContainerMetaTile_Machine { else if (aSlotIndex <= 2 && this.mID == 3) { if (aSlotIndex == 1) { ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchCentrifugePageBackward(); - onCraftMatrixChanged((IInventory) this.mTileEntity); + onCraftMatrixChanged(this.mTileEntity); } else if (aSlotIndex == 2) { ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchCentrifugePageForward(); - onCraftMatrixChanged((IInventory) this.mTileEntity); + onCraftMatrixChanged(this.mTileEntity); } } else if (aSlotIndex <= 2 && this.mID == 6) { if (aSlotIndex == 1) { ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchElectrolyzerPageBackward(); - onCraftMatrixChanged((IInventory) this.mTileEntity); + onCraftMatrixChanged(this.mTileEntity); } else if (aSlotIndex == 2) { ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchElectrolyzerPageForward(); - onCraftMatrixChanged((IInventory) this.mTileEntity); + onCraftMatrixChanged(this.mTileEntity); } } else if (aSlotIndex <= 2 && this.mID == 4) { if (aSlotIndex == 1) { ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchFusionPageBackward(); - onCraftMatrixChanged((IInventory) this.mTileEntity); + onCraftMatrixChanged(this.mTileEntity); } else if (aSlotIndex == 2) { ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchFusionPageForward(); - onCraftMatrixChanged((IInventory) this.mTileEntity); + onCraftMatrixChanged(this.mTileEntity); } } else if (aSlotIndex <= 2 && this.mID == 5) { if (aSlotIndex == 1) { ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchDescriptionPageBackward(); - onCraftMatrixChanged((IInventory) this.mTileEntity); + onCraftMatrixChanged(this.mTileEntity); } else if (aSlotIndex == 2) { ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchDescriptionPageForward(); - onCraftMatrixChanged((IInventory) this.mTileEntity); + onCraftMatrixChanged(this.mTileEntity); } } else if (aSlotIndex <= 58 && this.mID == 1) { if (aSlotIndex == 1) { ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchNuclearReactor(); - onCraftMatrixChanged((IInventory) this.mTileEntity); + onCraftMatrixChanged(this.mTileEntity); } else if (aSlotIndex == 2) { ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).loadNuclearReactor(); - onCraftMatrixChanged((IInventory) this.mTileEntity); + onCraftMatrixChanged(this.mTileEntity); } else if (aSlotIndex == 3) { ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).saveNuclearReactor(); @@ -307,6 +290,16 @@ public class GT_Container_ComputerCube extends GT_ContainerMetaTile_Machine { if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) { return; } + mStoredEU = mTileEntity.getStoredEU(); + mMaxStoredEU = mTileEntity.getEUCapacity(); + int[] aStored = MathUtils.splitLongIntoTwoIntegers(mStoredEU); + int[] aMaxStorage = MathUtils.splitLongIntoTwoIntegers(mMaxStoredEU); + mStoredEU1 = aStored[0]; + mStoredEU2 = aStored[1]; + mMaxStoredEU1 = aMaxStorage[0]; + mMaxStoredEU2 = aMaxStorage[1]; + + this.mID = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMode; this.mEUOut = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mEUOut; int[] aEUSplit1 = MathUtils.splitLongIntoTwoIntegers(mEUOut); @@ -318,24 +311,30 @@ public class GT_Container_ComputerCube extends GT_ContainerMetaTile_Machine { this.mExplosionStrength = (int) (((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mExplosionStrength * 100.0F); this.mEU = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mEU; this.mProgress = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mProgress; + this.mMaxProgressTime = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMaxProgress; + this.mProgressTime = (int) ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).getEUVar(); int[] aEUSplit2 = MathUtils.splitLongIntoTwoIntegers(mEU); this.mEU1 = aEUSplit2[0]; this.mEU2 = aEUSplit2[1]; Iterator<ICrafting> var2 = this.crafters.iterator(); while (var2.hasNext()) { ICrafting var1 = var2.next(); - var1.sendProgressBarUpdate((Container) this, 101, this.mID); - var1.sendProgressBarUpdate((Container) this, 102, this.mHeat & 0xFFFF); - var1.sendProgressBarUpdate((Container) this, 103, this.mMaxHeat & 0xFFFF); - var1.sendProgressBarUpdate((Container) this, 104, this.mHEM); - var1.sendProgressBarUpdate((Container) this, 105, this.mExplosionStrength); - var1.sendProgressBarUpdate((Container) this, 106, this.mHeat >>> 16); - var1.sendProgressBarUpdate((Container) this, 107, this.mMaxHeat >>> 16); - var1.sendProgressBarUpdate((Container) this, 108, this.mEU1); - var1.sendProgressBarUpdate((Container) this, 109, this.mEU2); - var1.sendProgressBarUpdate((Container) this, 110, this.mProgress); - var1.sendProgressBarUpdate((Container) this, 111, this.mEUOut1); - var1.sendProgressBarUpdate((Container) this, 112, this.mEUOut2); + var1.sendProgressBarUpdate(this, 101, this.mID); + var1.sendProgressBarUpdate(this, 102, this.mHeat & 0xFFFF); + var1.sendProgressBarUpdate(this, 103, this.mMaxHeat & 0xFFFF); + var1.sendProgressBarUpdate(this, 104, this.mHEM); + var1.sendProgressBarUpdate(this, 105, this.mExplosionStrength); + var1.sendProgressBarUpdate(this, 106, this.mHeat >>> 16); + var1.sendProgressBarUpdate(this, 107, this.mMaxHeat >>> 16); + var1.sendProgressBarUpdate(this, 108, this.mEU1); + var1.sendProgressBarUpdate(this, 109, this.mEU2); + var1.sendProgressBarUpdate(this, 110, this.mProgress); + var1.sendProgressBarUpdate(this, 111, this.mEUOut1); + var1.sendProgressBarUpdate(this, 112, this.mEUOut2); + var1.sendProgressBarUpdate(this, 113, mStoredEU1); + var1.sendProgressBarUpdate(this, 114, mStoredEU2); + var1.sendProgressBarUpdate(this, 115, mMaxStoredEU1); + var1.sendProgressBarUpdate(this, 116, mMaxStoredEU2); } } @@ -379,6 +378,20 @@ public class GT_Container_ComputerCube extends GT_ContainerMetaTile_Machine { this.mEUOut2 = par2; this.mEUOut = MathUtils.combineTwoIntegersToLong(mEUOut1, mEUOut2); break; + case 113 : + mStoredEU1 = par2; + break; + case 114 : + mStoredEU2 = par2; + mStoredEU = MathUtils.combineTwoIntegersToLong(mStoredEU1, mStoredEU2); + break; + case 115 : + mMaxStoredEU1 = par2; + break; + case 116 : + mMaxStoredEU2 = par2; + mMaxStoredEU = MathUtils.combineTwoIntegersToLong(mMaxStoredEU1, mMaxStoredEU2); + break; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_ComputerCube.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_ComputerCube.java index c56e167319..71defdc72a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_ComputerCube.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_ComputerCube.java @@ -2,21 +2,25 @@ package gtPlusPlus.xmod.gregtech.api.gui.computer; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.common.computer.GT_Computercube_Description; +import gtPlusPlus.xmod.gregtech.common.tileentities.misc.GT_TileEntity_ComputerCube; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; public class GT_GUIContainer_ComputerCube extends GT_GUIContainerMetaTile_Machine { + + public final GT_Container_ComputerCube mPowerContainer; + public GT_GUIContainer_ComputerCube(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aBaseMetaTileEntity, int aID) { super(new GT_Container_ComputerCube(aInventoryPlayer, aBaseMetaTileEntity, aID), CORE.RES_PATH_GUI + "computer/"+aID+".png"); - GT_Container_ComputerCube tContainer = (GT_Container_ComputerCube) this.mContainer; - Logger.INFO("1 GUI Mode: "+aID); - Logger.INFO("2 GUI Mode: "+tContainer.mID); - if (tContainer.mID == 5) { + mPowerContainer = (GT_Container_ComputerCube) mContainer; + if (mPowerContainer.mID == 5) { this.xSize += 50; } } @@ -43,8 +47,8 @@ public class GT_GUIContainer_ComputerCube extends GT_GUIContainerMetaTile_Machin if (tContainer != null) switch (tContainer.mID) { case 0 : - this.fontRendererObj.drawString("G.L.A.D.-OS", 64, 61, 16448255); - this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752); + this.fontRendererObj.drawString("Solaris 1.7.10", 56, 70, Utils.rgbtoHexValue(100, 190, 255)); + //this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752); break; case 1 : this.fontRendererObj.drawString("Reactorstats:", 7, 108, 16448255); @@ -58,11 +62,13 @@ public class GT_GUIContainer_ComputerCube extends GT_GUIContainerMetaTile_Machin this.fontRendererObj.drawString("Scanner", 51, 7, 16448255); if (tContainer.mProgress == 0) { this.fontRendererObj.drawString("Can be used to", 51, 24, 16448255); - this.fontRendererObj.drawString("scan Seedbags", 51, 32, 16448255); + this.fontRendererObj.drawString("scan things", 51, 32, 16448255); + this.fontRendererObj.drawString("Currently", 51, 48, Utils.rgbtoHexValue(200, 20, 20)); + this.fontRendererObj.drawString("Disabled", 51, 56, Utils.rgbtoHexValue(200, 20, 20)); } else { this.fontRendererObj.drawString("Progress:", 51, 24, 16448255); - this.fontRendererObj.drawString(tContainer.mProgress + "%", 51, 32, 16448255); + this.fontRendererObj.drawString(MathUtils.findPercentage(tContainer.mProgress, tContainer.mMaxProgressTime) + " %", 51, 32, 16448255); } this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752); break; @@ -73,15 +79,17 @@ public class GT_GUIContainer_ComputerCube extends GT_GUIContainerMetaTile_Machin break; case 4 : this.fontRendererObj.drawString("Fusionreactor", 7, 7, 16448255); - this.fontRendererObj.drawString("Recipe: " + (tContainer.mMaxHeat + 1) + "/" + GT_Recipe_Map.sFusionRecipes.mRecipeList.size(), 7, 23, 16448255); - this.fontRendererObj.drawString("Start: " + toNumber(tContainer.mEU) + "EU", 7, 31, 16448255); - this.fontRendererObj.drawString("EU/t: " + toNumber(tContainer.mEUOut), 7, 39, 16448255); - this.fontRendererObj.drawString(toNumber(tContainer.mHeat) + " Ticks", 7, 47, 16448255); + this.fontRendererObj.drawString("Recipe: " + (tContainer.mMaxHeat + 1) + "/" + GT_TileEntity_ComputerCube.sFusionReactorRecipes.size(), 7, 15, 16448255); + this.fontRendererObj.drawString("Start: " + toNumber(tContainer.mEU) + "EU", 7, 23, 16448255); + this.fontRendererObj.drawString("EU/t: " + toNumber(tContainer.mEUOut), 7, 31, 16448255); + this.fontRendererObj.drawString(toNumber(tContainer.mHeat) + " Ticks", 7, 39, 16448255); + GT_Recipe tRecipe = GT_TileEntity_ComputerCube.sFusionReactorRecipes.get(tContainer.mMaxHeat); + this.fontRendererObj.drawString(""+tRecipe.mFluidOutputs[0].getLocalizedName(), 7, 55, 16448255); if (tContainer.mEUOut < 0) { - this.fontRendererObj.drawString("IN: " + toNumber(-tContainer.mEUOut * tContainer.mHeat) + "EU", 7, 55, 16448255); + this.fontRendererObj.drawString("IN: " + toNumber(-tContainer.mEUOut * tContainer.mHeat) + "EU", 7, 47, 16448255); break; } - this.fontRendererObj.drawString("OUT: " + toNumber(tContainer.mEUOut * tContainer.mHeat) + "EU", 7, 55, 16448255); + this.fontRendererObj.drawString("OUT: " + toNumber(tContainer.mEUOut * tContainer.mHeat) + "EU", 7, 47, 16448255); break; case 5 : if (tContainer.mID == 5 && this.xSize == 176) { @@ -114,6 +122,17 @@ public class GT_GUIContainer_ComputerCube extends GT_GUIContainerMetaTile_Machin int y = (height - ySize) / 2; drawTexturedModalRect(x, y, 0, 0, xSize, ySize); switch (tContainer.mID) { + case 0 : + if (this.mPowerContainer.mStoredEU > 0 && this.mPowerContainer.mMaxStoredEU > 0) { + final double tScale = MathUtils.findPercentage(this.mPowerContainer.mStoredEU, this.mPowerContainer.mMaxStoredEU); + this.drawTexturedModalRect(x + 44, y + 8, 0, 166, Math.min(MathUtils.roundToClosestInt(tScale), 95), 5); + } + else { + // + //Logger.INFO("1 No Power? "+tContainer.mProgressTime+" | "+tContainer.mTileEntity.getEUCapacity()); + //Logger.INFO("2 No Power? "+aComp.getEUVar()+" | "+aComp.maxEUStore()); + } + break; case 5 : if (tContainer.mExplosionStrength != 0) drawTexturedModalRect(x + 152, y + 6, 0, 166, 50, 50); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings2.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings2.java index 7ec655dca5..a80b788aa1 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings2.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings2.java @@ -7,6 +7,7 @@ import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; import gregtech.api.util.GT_LanguageManager; import gregtech.common.blocks.GT_Material_Casings; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; @@ -59,7 +60,14 @@ public class GregtechMetaSpecialMultiCasings2 extends GregtechMetaCasingBlocksAb GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", ""); // Unused GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", ""); // Unused - //GregtechItemList.Casing_Turbine_Shaft.set(new ItemStack(this, 1, 0)); + GregtechItemList.ResonanceChamber_I.set(new ItemStack(this, 1, 0)); + GregtechItemList.ResonanceChamber_II.set(new ItemStack(this, 1, 1)); + GregtechItemList.ResonanceChamber_III.set(new ItemStack(this, 1, 2)); + GregtechItemList.ResonanceChamber_IV.set(new ItemStack(this, 1, 3)); + GregtechItemList.Modulator_I.set(new ItemStack(this, 1, 4)); + GregtechItemList.Modulator_II.set(new ItemStack(this, 1, 5)); + GregtechItemList.Modulator_III.set(new ItemStack(this, 1, 6)); + GregtechItemList.Modulator_IV.set(new ItemStack(this, 1, 7)); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/GT_TileEntity_ComputerCube.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/GT_TileEntity_ComputerCube.java index 033a5f925b..67999087f3 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/GT_TileEntity_ComputerCube.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/GT_TileEntity_ComputerCube.java @@ -1,39 +1,50 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.misc; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes; + import java.util.ArrayList; import java.util.Collections; import Ic2ExpReactorPlanner.SimulationData; +import cpw.mods.fml.common.FMLCommonHandler; import gregtech.api.GregTech_API; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; +import gregtech.api.enums.*; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; -import gregtech.api.objects.GT_ItemStack; -import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_Recipe; +import gregtech.api.objects.*; +import gregtech.api.util.*; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -import gregtech.api.util.GT_Utility; +import gregtech.common.items.behaviors.Behaviour_DataOrb; import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.api.gui.computer.GT_Container_ComputerCube; import gtPlusPlus.xmod.gregtech.api.gui.computer.GT_GUIContainer_ComputerCube; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.computer.GT_Computercube_Description; import gtPlusPlus.xmod.gregtech.common.computer.GT_Computercube_Simulator; -import ic2.core.Ic2Items; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank { + public static int MODE_MAIN = 0; + public static int MODE_REACTOR_PLANNER = 1; + public static int MODE_SCANNER = 2; + public static int MODE_CENTRIFUGE = 3; + public static int MODE_FUSION = 4; + public static int MODE_INFO = 5; + public static int MODE_ELECTROLYZER = 6; + public static boolean mSeedscanner = true; public static boolean mReactorplanner = true; @@ -48,11 +59,12 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank { public long mEUOut = 0; - public int mMaxHeat = 10000; + public int mMaxHeat = 1; public long mEU = 0; public int mProgress = 0; + public int mMaxProgress = 0; public int mEUTimer = 0; @@ -65,13 +77,15 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank { public int mEULast4 = 0; public float mHEM = 1.0F, mExplosionStrength = 0.0F; + + public String mFusionOutput = ""; private boolean mNeedsUpdate; private GT_Computercube_Simulator mSimulator; public GT_TileEntity_ComputerCube(final int aID, final String aDescription) { - super(aID, "computer.cube", "Computer Cube", 5, 114, aDescription); + super(aID, "computer.cube", "Computer Cube MKII", 5, 114, aDescription); } public GT_TileEntity_ComputerCube(final String aName, final String aDescription, final ITexture[][][] aTextures) { @@ -91,6 +105,17 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank { } @Override + public String[] getDescription() { + return new String[]{ + this.mDescription, + "Built in Reactor Planner", + "Built in Scanner", + "Built in Info-Bank", + "Displays Fusion Recipes", + CORE.GT_Tooltip}; + } + + @Override public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { if (aBaseMetaTileEntity.isClientSide()) { return true; @@ -143,7 +168,7 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank { @Override public long maxEUInput() { - return GT_Values.V[2]; + return GT_Values.V[4]; } @Override @@ -213,6 +238,8 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank { this.mHEM = 1.0F; this.mExplosionStrength = 0.0F; this.mProgress = 0; + this.mMaxProgress = 0; + this.mFusionOutput = ""; this.mInventory[113] = null; int i; for (i = 0; i < 54; i++) { @@ -229,37 +256,51 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank { } public void switchModeForward() { - this.mMode = (this.mMode + 1) % 7; + int aTempMode = mMode; + aTempMode++; + if (aTempMode == MODE_ELECTROLYZER ||aTempMode == MODE_CENTRIFUGE) { + aTempMode++; + } + if (aTempMode >= 7) { + aTempMode = 0; + } + mMode = aTempMode; switchMode(); } public void switchModeBackward() { - this.mMode--; - if (this.mMode < 0) - this.mMode = 6; + int aTempMode = mMode; + aTempMode--; + if (aTempMode == MODE_ELECTROLYZER ||aTempMode == MODE_CENTRIFUGE) { + aTempMode--; + } + if (aTempMode < 0) { + aTempMode = 6; + } + mMode = aTempMode; switchMode(); } private void switchMode() { reset(); - if (this.mMode == 1 && !mReactorplanner) { + if (this.mMode == MODE_REACTOR_PLANNER && !mReactorplanner) { switchMode(); return; } - if (this.mMode == 2 && !mSeedscanner) { + if (this.mMode == MODE_SCANNER && !mSeedscanner) { switchMode(); return; } - if (this.mMode == 3) { + if (this.mMode == MODE_CENTRIFUGE) { showCentrifugeRecipe(0); } - if (this.mMode == 4) { + if (this.mMode == MODE_FUSION) { showFusionRecipe(0); } - if (this.mMode == 5) { + if (this.mMode == MODE_INFO) { showDescription(0); } - if (this.mMode == 6) { + if (this.mMode == MODE_ELECTROLYZER) { showElectrolyzerRecipe(0); } this.getWorld().addBlockEvent(this.getXCoord(), this.getYCoord(), this.getZCoord(), GregTech_API.sBlockMachines, 10, this.mMode); @@ -540,6 +581,7 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank { this.mEUOut = tRecipe.mEUt; this.mHeat = tRecipe.mDuration; this.mMaxHeat = aIndex; + this.mFusionOutput = tRecipe.mFluidOutputs[0].getLocalizedName(); } this.getWorld().addBlockEvent(this.getXCoord(), this.getYCoord(), this.getZCoord(), GregTech_API.sBlockMachines, 11, this.mMaxHeat); } @@ -582,6 +624,7 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank { super.saveNBTData(aNBT); aNBT.setInteger("mMode", this.mMode); aNBT.setInteger("mProgress", this.mProgress); + aNBT.setInteger("mMaxProgress", this.mMaxProgress); aNBT.setBoolean("mStarted", this.mStarted); int[] aSplitLong1 = MathUtils.splitLongIntoTwoIntegers(mEU); aNBT.setInteger("mEU1", aSplitLong1[0]); @@ -593,6 +636,7 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank { aNBT.setInteger("mMaxHeat", this.mMaxHeat); aNBT.setFloat("mHEM", this.mHEM); aNBT.setFloat("mExplosionStrength", this.mExplosionStrength); + aNBT.setString("mFusionOutput", this.mFusionOutput); } @Override @@ -600,6 +644,7 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank { super.loadNBTData(aNBT); this.mMode = aNBT.getInteger("mMode"); this.mProgress = aNBT.getInteger("mProgress"); + this.mMaxProgress = aNBT.getInteger("mMaxProgress"); this.mStarted = aNBT.getBoolean("mStarted"); int partA = aNBT.getInteger("mEU1"); int partB = aNBT.getInteger("mEU2"); @@ -611,6 +656,7 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank { this.mMaxHeat = aNBT.getInteger("mMaxHeat"); this.mHEM = aNBT.getFloat("mHEM"); this.mExplosionStrength = aNBT.getFloat("mExplosionStrength"); + this.mFusionOutput = aNBT.getString("mFusionOutput"); } @Override @@ -633,17 +679,32 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank { this.mNeedsUpdate = false; } if (this.getBaseMetaTileEntity().isServerSide()) { - if (this.mMode == 2) { - if (this.mInventory[55] == null) { + if (this.mMode == MODE_SCANNER) { + /*if (this.mInventory[55] == null) { this.mInventory[55] = this.mInventory[54]; this.mInventory[54] = null; - } + }*/ if (this.mInventory[57] == null) { this.mInventory[57] = this.mInventory[56]; this.mInventory[56] = null; } - if (mSeedscanner && this.mInventory[55] != null && GT_Utility.areStacksEqual(this.mInventory[55], Ic2Items.cropSeed, true) && this.mInventory[55].getTagCompound() != null) { + // 54 - 55 || 56 - 57 + // Do scanny bits + if (mSeedscanner && this.mMode == MODE_SCANNER) { + /*if (doScan(this.mInventory[55]) == 4) { + if ((this.mInventory[57] != null) && (this.mInventory[57].getUnlocalizedName().equals("gt.metaitem.01.32707"))) { + GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "scanning"); + } + }*/ + /*if (this.mEU > 0) { + if (!this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(this.mEU, false)) { + this.mProgress = 0; + } + }*/ + } + + /*if (mSeedscanner && this.mInventory[55] != null && GT_Utility.areStacksEqual(this.mInventory[55], Ic2Items.cropSeed, true) && this.mInventory[55].getTagCompound() != null) { if (this.mInventory[55].getTagCompound().getByte("scan") < 4) { if (this.mProgress >= 100) { this.mInventory[55].getTagCompound().setByte("scan", (byte) 4); @@ -667,10 +728,10 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank { this.mInventory[56] = this.mInventory[55]; this.mInventory[55] = null; } - } + }*/ } - if (this.mMode == 1 && mReactorplanner && this.mSimulator != null && this.mSimulator.simulator != null && this.mSimulator.simulatedReactor != null) { + if (this.mMode == MODE_REACTOR_PLANNER && mReactorplanner && this.mSimulator != null && this.mSimulator.simulator != null && this.mSimulator.simulatedReactor != null) { SimulationData aData = this.mSimulator.simulator.getData(); if (aData != null && aData.totalReactorTicks > 0 && this.mProgress != aData.totalReactorTicks) { Logger.INFO("Updating Variables"); @@ -684,50 +745,6 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank { } } - /*if (this.mMode == 1 && mReactorplanner && this.mStarted && this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(32, false)) - for (int i = 0; i < 25 && this.mStarted; i++) { - this.mEUOut = 0; - this.mMaxHeat = 10000; - this.mHEM = 1.0F; - this.mExplosionStrength = 10.0F; - float tMultiplier = 1.0F; - for (int y = 0; y < 6; y++) { - for (int x = 0; x < 9; x++) { - ItemStack tStack = getStackInSlot(x + y * 9); - if (tStack != null) - if (tStack.getItem() instanceof IReactorComponent) { - IReactorComponent tComponent = (IReactorComponent) tStack.getItem(); - tComponent.processChamber(this, tStack, x, y, false); //TODO - float tInfluence = ((IReactorComponent) tStack.getItem()).influenceExplosion(this, tStack); - if (tInfluence > 0.0F && tInfluence < 1.0F) { - tMultiplier *= tInfluence; - } - else { - this.mExplosionStrength += tInfluence; - } - } - else if (tStack.isItemEqual(GT_ModHandler.getIC2Item("nearDepletedUraniumCell", 1)) || tStack.isItemEqual(GT_ModHandler.getIC2Item("reEnrichedUraniumCell", 1))) { - stopNuclearReactor(); - } - else { - setInventorySlotContents(x + y * 9, (ItemStack) null); - } - } - } - this.mEUOut *= getReactorEUOutput(); - if ((this.mEUOut == 0 && this.mEUTimer++ > 20) || this.mHeat >= this.mMaxHeat) - stopNuclearReactor(); - if (this.mEUOut != 0) - this.mEUTimer = 0; - this.mExplosionStrength *= this.mHEM * tMultiplier; - this.mEU += this.mEUOut * 20; - int tEU = this.mEULast1; - this.mEULast1 = this.mEULast2; - this.mEULast2 = this.mEULast3; - this.mEULast3 = this.mEULast4; - this.mEULast4 = this.mEUOut; - this.mEUOut = (this.mEUOut + this.mEULast1 + this.mEULast2 + this.mEULast3 + tEU) / 5; - }*/ if (aTick % 20L == 0L) { this.getWorld().addBlockEvent(this.getXCoord(), this.getYCoord(), this.getZCoord(), GregTech_API.sBlockMachines, 10, this.mMode); this.getWorld().addBlockEvent(this.getXCoord(), this.getYCoord(), this.getZCoord(), GregTech_API.sBlockMachines, 11, this.mMaxHeat); @@ -765,12 +782,12 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank { @Override public boolean canInsertItem(int i, ItemStack itemstack, int j) { - return (this.mMode == 2) ? ((i == 54 || i == 55)) : false; + return (this.mMode == MODE_SCANNER) ? ((i == 54 || i == 55)) : false; } @Override public boolean canExtractItem(int i, ItemStack itemstack, int j) { - return (this.mMode == 2) ? ((i == 56 || i == 57)) : false; + return (this.mMode == MODE_SCANNER) ? ((i == 56 || i == 57)) : false; } public World getWorld() { @@ -838,5 +855,198 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank { public ITexture[] getSides(final byte aColor) { return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Computer_Cube)}; } + + protected static final int + DID_NOT_FIND_RECIPE = 0, + FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS = 1, + FOUND_AND_SUCCESSFULLY_USED_RECIPE = 2; + + /** + * Calcualtes overclocked ness using long integers + * @param aEUt - recipe EUt + * @param aDuration - recipe Duration + */ + protected void calculateOverclockedNess(int aEUt, int aDuration) { + if(mTier==0){ + //Long time calculation + long xMaxProgresstime = ((long)aDuration)<<1; + if(xMaxProgresstime>Integer.MAX_VALUE-1){ + //make impossible if too long + mEU=Integer.MAX_VALUE-1; + mMaxProgress=Integer.MAX_VALUE-1; + }else{ + mEU=aEUt>>2; + mMaxProgress=(int)xMaxProgresstime; + } + }else{ + //Long EUt calculation + long xEUt=aEUt; + //Isnt too low EUt check? + long tempEUt = Math.max(xEUt, V[1]); + + mMaxProgress = aDuration; + + while (tempEUt <= V[mTier -1] * (long)this.maxAmperesIn()) { + tempEUt<<=2;//this actually controls overclocking + //xEUt *= 4;//this is effect of everclocking + mMaxProgress>>=1;//this is effect of overclocking + xEUt = mMaxProgress==0 ? xEUt>>1 : xEUt<<2;//U know, if the time is less than 1 tick make the machine use 2x less power + } + if(xEUt>Integer.MAX_VALUE-1){ + mEU = Integer.MAX_VALUE-1; + mMaxProgress = Integer.MAX_VALUE-1; + }else{ + mEU = (int)xEUt; + if(mEU==0) + mEU = 1; + if(mMaxProgress==0) + mMaxProgress = 1;//set time to 1 tick + } + } + } + + public int doScan(ItemStack aInput) { + if (this.mMode != MODE_SCANNER) { + return DID_NOT_FIND_RECIPE; + } + ItemStack aStack = aInput; + if (this.mInventory[56] != null) { + return DID_NOT_FIND_RECIPE; + } else if ((GT_Utility.isStackValid(aStack)) && (aStack.stackSize > 0)) { + + + if (ItemList.IC2_Crop_Seeds.isStackEqual(aStack, true, true)) { + NBTTagCompound tNBT = aStack.getTagCompound(); + if (tNBT == null) { + tNBT = new NBTTagCompound(); + } + if (tNBT.getByte("scan") < 4) { + tNBT.setByte("scan", (byte) 4); + calculateOverclockedNess(8, 160); + //In case recipe is too OP for that machine + if (mMaxProgress == Integer.MAX_VALUE - 1 && mEU == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + } else { + this.mMaxProgress = 1; + this.mEU = 1; + } + aStack.stackSize -= 1; + this.mInventory[57] = GT_Utility.copyAmount(1L, aStack); + this.mInventory[57].setTagCompound(tNBT); + return 2; + } + + + if (ItemList.Tool_DataOrb.isStackEqual(getSpecialSlot(), false, true)) { + if (ItemList.Tool_DataOrb.isStackEqual(aStack, false, true)) { + aStack.stackSize -= 1; + this.mInventory[57] = GT_Utility.copyAmount(1L, getSpecialSlot()); + calculateOverclockedNess(30, 512); + //In case recipe is too OP for that machine + if (mMaxProgress == Integer.MAX_VALUE - 1 && mEU == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + return 2; + } + ItemData tData = GT_OreDictUnificator.getAssociation(aStack); + if ((tData != null) && ((tData.mPrefix == OrePrefixes.dust) || (tData.mPrefix == OrePrefixes.cell)) && (tData.mMaterial.mMaterial.mElement != null) && (!tData.mMaterial.mMaterial.mElement.mIsIsotope) && (tData.mMaterial.mMaterial != Materials.Magic) && (tData.mMaterial.mMaterial.getMass() > 0L)) { + getSpecialSlot().stackSize -= 1; + aStack.stackSize -= 1; + + this.mInventory[57] = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(this.mInventory[57], "Elemental-Scan"); + Behaviour_DataOrb.setDataName(this.mInventory[57], tData.mMaterial.mMaterial.mElement.name()); + calculateOverclockedNess(30, GT_Utility.safeInt(tData.mMaterial.mMaterial.getMass() * 8192L)); + //In case recipe is too OP for that machine + if (mMaxProgress == Integer.MAX_VALUE - 1 && mEU == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + return 2; + } + } + + + if (ItemList.Tool_DataStick.isStackEqual(getSpecialSlot(), false, true)) { + if (ItemList.Tool_DataStick.isStackEqual(aStack, false, true)) { + aStack.stackSize -= 1; + this.mInventory[57] = GT_Utility.copyAmount(1L, getSpecialSlot()); + calculateOverclockedNess(30, 128); + //In case recipe is too OP for that machine + if (mMaxProgress == Integer.MAX_VALUE - 1 && mEU == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + return 2; + } + if (aStack.getItem() == Items.written_book) { + getSpecialSlot().stackSize -= 1; + aStack.stackSize -= 1; + + this.mInventory[57] = GT_Utility.copyAmount(1L, getSpecialSlot()); + this.mInventory[57].setTagCompound(aStack.getTagCompound()); + calculateOverclockedNess(30, 128); + //In case recipe is too OP for that machine + if (mMaxProgress == Integer.MAX_VALUE - 1 && mEU == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + return 2; + } + if (aStack.getItem() == Items.filled_map) { + getSpecialSlot().stackSize -= 1; + aStack.stackSize -= 1; + + this.mInventory[57] = GT_Utility.copyAmount(1L, getSpecialSlot()); + this.mInventory[57].setTagCompound(GT_Utility.getNBTContainingShort(new NBTTagCompound(), "map_id", (short) aStack.getItemDamage())); + calculateOverclockedNess(30, 128); + //In case recipe is too OP for that machine + if (mMaxProgress == Integer.MAX_VALUE - 1 && mEU == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + return 2; + } + + } + + 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)) { + boolean failScanner = true; + for (GT_Recipe scannerRecipe : sScannerFakeRecipes.mRecipeList) { + if (GT_Utility.areStacksEqual(scannerRecipe.mInputs[0], aStack, true)) { + failScanner = false; + break; + } + } + if (failScanner) { + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + } + + + String s = tRecipe.mOutput.getDisplayName(); + if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { + s = GT_Assemblyline_Server.lServerNames.get(tRecipe.mOutput.getDisplayName()); + if (s == null) + s = tRecipe.mOutput.getDisplayName(); + } + this.mInventory[57] = GT_Utility.copyAmount(1L, getSpecialSlot()); + + + // Use Assline Utils + if (GT_AssemblyLineUtils.setAssemblyLineRecipeOnDataStick(this.mInventory[57], tRecipe)) { + aStack.stackSize -= 1; + calculateOverclockedNess(30, tRecipe.mResearchTime); + //In case recipe is too OP for that machine + if (mMaxProgress == Integer.MAX_VALUE - 1 && mEU == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + getSpecialSlot().stackSize -= 1; + return 2; + } + + } + } + } + + } + return 0; + } + + private ItemStack getSpecialSlot() { + return this.mInventory[54]; + } + } |