aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/common')
-rw-r--r--src/main/java/common/Blocks.java28
-rw-r--r--src/main/java/common/CommonProxy.java44
-rw-r--r--src/main/java/common/Recipes.java494
-rw-r--r--src/main/java/common/TileEntities.java45
-rw-r--r--src/main/java/common/blocks/Block_BeamTransmitter.java55
-rw-r--r--src/main/java/common/blocks/Block_IchorJar.java1
-rw-r--r--src/main/java/common/blocks/Block_ItemServerDrive.java57
-rw-r--r--src/main/java/common/blocks/Block_ItemServerIOPort.java43
-rw-r--r--src/main/java/common/blocks/Block_ItemServerRackCasing.java30
-rw-r--r--src/main/java/common/blocks/Block_LapotronicEnergyUnit.java32
-rw-r--r--src/main/java/common/blocks/Block_LargeHexPlate.java61
-rw-r--r--src/main/java/common/blocks/Block_TFFTMultiHatch.java64
-rw-r--r--src/main/java/common/blocks/Block_ThaumiumReinforcedJar.java9
-rw-r--r--src/main/java/common/itemBlocks/IB_ItemServerDrive.java22
-rw-r--r--src/main/java/common/itemBlocks/IB_ItemServerIOPort.java22
-rw-r--r--src/main/java/common/itemBlocks/IB_ItemServerRackCasing.java22
-rw-r--r--src/main/java/common/itemBlocks/IB_LapotronicEnergyUnit.java2
-rw-r--r--src/main/java/common/itemBlocks/IB_TFFTMultiHatch.java22
-rw-r--r--src/main/java/common/items/ErrorItem.java48
-rw-r--r--src/main/java/common/items/MetaItem_CraftingComponent.java101
-rw-r--r--src/main/java/common/items/MetaItem_ReactorComponent.java142
-rw-r--r--src/main/java/common/reactorItem/AbstractReactorItem.java29
-rw-r--r--src/main/java/common/reactorItem/ReactorItem.java48
-rw-r--r--src/main/java/common/tileentities/GTMTE_FluidMultiStorage.java1063
-rw-r--r--src/main/java/common/tileentities/GTMTE_ItemServer.java393
-rw-r--r--src/main/java/common/tileentities/GTMTE_LapotronicSuperCapacitor.java281
-rw-r--r--src/main/java/common/tileentities/GTMTE_ModularNuclearReactor.java9
-rw-r--r--src/main/java/common/tileentities/GTMTE_SOFuelCellMK1.java45
-rw-r--r--src/main/java/common/tileentities/GTMTE_SOFuelCellMK2.java46
-rw-r--r--src/main/java/common/tileentities/GTMTE_SpaceElevator.java25
-rw-r--r--src/main/java/common/tileentities/GTMTE_TFFTMultiHatch.java217
-rw-r--r--src/main/java/common/tileentities/TE_BeamTransmitter.java47
-rw-r--r--src/main/java/common/tileentities/TE_ItemServerIOPort.java145
-rw-r--r--src/main/java/common/tileentities/TE_TFFTMultiHatch.java146
34 files changed, 2030 insertions, 1808 deletions
diff --git a/src/main/java/common/Blocks.java b/src/main/java/common/Blocks.java
index 18725b6000..8c145bd634 100644
--- a/src/main/java/common/Blocks.java
+++ b/src/main/java/common/Blocks.java
@@ -33,22 +33,25 @@ public class Blocks {
public static Block jarIchor;
public static Block lscLapotronicEnergyUnit;
+ public static Block beamTransmitter;
public static Block spaceElevatorStructure;
public static Block spaceElevatorCapacitor;
public static Block spaceElevatorTether;
+
+ public static Block largeHexPlate;
public static void preInit() {
KekzCore.LOGGER.info("Registering blocks...");
registerBlocks_SOFC();
registerBlocks_TFFT();
- registerBlocks_Nuclear();
- //registerBlocks_ItemServer();
+ //registerBlocks_Nuclear();
//registerBlocks_ItemProxy();
registerBlocks_Jars();
registerBlocks_LSC();
- registerBlocks_SpaceElevator();
+ //registerBlocks_SpaceElevator();
+ registerBlocks_Cosmetics();
KekzCore.LOGGER.info("Finished registering blocks");
}
@@ -68,23 +71,17 @@ public class Blocks {
tfftMultiHatch = Block_TFFTMultiHatch.registerBlock();
}
- private static void registerBlocks_Nuclear() {
+ /*private static void registerBlocks_Nuclear() {
reactorChamberOFF = Block_ReactorChamber_OFF.registerBlock();
reactorChamberON = Block_ReactorChamber_ON.registerBlock();
reactorControlRod = Block_ControlRod.registerBlock();
}
-
- private static void registerBlocks_ItemServer() {
- itemServerDrive = Block_ItemServerDrive.registerBlock();
- itemServerRackCasing = Block_ItemServerRackCasing.registerBlock();
- itemServerIOPort = Block_ItemServerIOPort.registerBlock();
- }
-
+
private static void registerBlocks_ItemProxy() {
itemProxyCable = Block_ItemProxyCable.registerBlock();
itemProxySource = Block_ItemProxySource.registerBlock();
itemProxyEndpoint = Block_ItemProxyEndpoint.registerBlock();
- }
+ }*/
private static void registerBlocks_Jars() {
jarThaumiumReinforced = Block_ThaumiumReinforcedJar.registerBlock();
@@ -93,12 +90,17 @@ public class Blocks {
private static void registerBlocks_LSC() {
lscLapotronicEnergyUnit = Block_LapotronicEnergyUnit.registerBlock();
+ //beamTransmitter = Block_BeamTransmitter.registerBlock();
}
- private static void registerBlocks_SpaceElevator() {
+ /*private static void registerBlocks_SpaceElevator() {
spaceElevatorStructure = Block_SpaceElevator.registerBlock();
spaceElevatorCapacitor = Block_SpaceElevatorCapacitor.registerBlock();
spaceElevatorTether = Block_SpaceElevatorTether.registerBlock();
+ }*/
+
+ private static void registerBlocks_Cosmetics() {
+ largeHexPlate = Block_LargeHexPlate.registerBlock();
}
}
diff --git a/src/main/java/common/CommonProxy.java b/src/main/java/common/CommonProxy.java
new file mode 100644
index 0000000000..1e577148fb
--- /dev/null
+++ b/src/main/java/common/CommonProxy.java
@@ -0,0 +1,44 @@
+package common;
+
+import common.items.ErrorItem;
+import common.items.MetaItem_CraftingComponent;
+import common.items.MetaItem_ReactorComponent;
+import cpw.mods.fml.common.event.FMLInitializationEvent;
+import cpw.mods.fml.common.event.FMLPostInitializationEvent;
+import cpw.mods.fml.common.event.FMLPreInitializationEvent;
+import cpw.mods.fml.common.network.NetworkRegistry;
+import kekztech.GuiHandler;
+import kekztech.Items;
+import kekztech.KekzCore;
+
+public class CommonProxy {
+
+ public void preInit(final FMLPreInitializationEvent e) {
+ // Items
+ ErrorItem.getInstance().registerItem();
+ MetaItem_ReactorComponent.getInstance().registerItem();
+ MetaItem_CraftingComponent.getInstance().registerItem();
+ Items.registerOreDictNames();
+ // Blocks
+ Blocks.preInit();
+ // TileEntities
+ TileEntities.preInit();
+ // TC Research
+ Researches.preInit();
+ // GUI Handler
+ NetworkRegistry.INSTANCE.registerGuiHandler(KekzCore.instance, new GuiHandler());
+ }
+
+ public void init(final FMLInitializationEvent e) {
+ // GregTech Meta TileEntities
+ TileEntities.init();
+ }
+
+ public void postInit(final FMLPostInitializationEvent e) {
+ // Recipes
+ Recipes.postInit();
+ // Research
+ Researches.postInit();
+ }
+
+}
diff --git a/src/main/java/common/Recipes.java b/src/main/java/common/Recipes.java
index 0e3fdfc41f..d93b40b47f 100644
--- a/src/main/java/common/Recipes.java
+++ b/src/main/java/common/Recipes.java
@@ -1,5 +1,7 @@
package common;
+import common.items.ErrorItem;
+import common.items.MetaItem_CraftingComponent;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.enums.GT_Values;
@@ -8,10 +10,7 @@ import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import items.ErrorItem;
-import items.MetaItem_CraftingComponent;
import kekztech.Items;
import kekztech.KekzCore;
import net.minecraft.item.ItemStack;
@@ -24,8 +23,6 @@ import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.crafting.InfusionRecipe;
import util.Util;
-import java.util.ArrayList;
-import java.util.Arrays;
import java.util.HashMap;
public class Recipes {
@@ -37,32 +34,15 @@ public class Recipes {
registerRecipes_TFFT();
registerRecipes_SOFC();
- registerRecipes_Nuclear();
- //registerRecipes_ItemServer();
+ //registerRecipes_Nuclear();
registerRecipes_Jars();
registerRecipes_LSC();
- registerRecipes_SpaceElevator();
+ //registerRecipes_SpaceElevator();
+ registerRecipes_Cosmetics();
KekzCore.LOGGER.info("Finished registering recipes");
}
- private static void lapoCapacitorRecipeAdder(GT_Recipe.GT_Recipe_AssemblyLine baseRecipe, Materials boxMaterial, ItemStack newResearchTrigger, ItemStack result) {
- if(baseRecipe != null) {
- final ArrayList<ItemStack> baseInputs = new ArrayList<>(Arrays.asList(baseRecipe.mInputs));
- if(baseInputs.size() <= 14){
- baseInputs.add(GT_OreDictUnificator.get(OrePrefixes.frameGt, boxMaterial, 4));
- baseInputs.add(GT_OreDictUnificator.get(OrePrefixes.screw, boxMaterial, 24));
-
- GT_Values.RA.addAssemblylineRecipe(newResearchTrigger, baseRecipe.mResearchTime,
- Util.toItemStackArray(baseInputs), baseRecipe.mFluidInputs, result,
- baseRecipe.mDuration * 2, baseRecipe.mEUt);
- KekzCore.LOGGER.info("Successfully extended Lapotronic Battery recipe for Lapotronic Capacitor of tier " + result.getItemDamage());
- }
- } else {
- KekzCore.LOGGER.info("Base recipe was NULL. Failed to extended Lapotronic Battery recipe for Lapotronic Capacitor of tier " + result.getItemDamage());
- }
- }
-
private static void registerRecipes_TFFT() {
// Controller
@@ -74,7 +54,7 @@ public class Recipes {
'V', OrePrefixes.rotor.get(Materials.VibrantAlloy),
'C', OrePrefixes.circuit.get(Materials.Data)
};
- GT_ModHandler.addCraftingRecipe(KekzCore.fms.getStackForm(1), tfft_recipe);
+ GT_ModHandler.addCraftingRecipe(TileEntities.fms.getStackForm(1), tfft_recipe);
// Blocks
final ItemStack[] tfftcasing = {
@@ -83,82 +63,103 @@ public class Recipes {
GT_OreDictUnificator.get(OrePrefixes.plate, Materials.EnderPearl, 3),
GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.StainlessSteel, 1),
};
- GT_Values.RA.addAssemblerRecipe(
- tfftcasing,
- FluidRegistry.getFluidStack("molten.polytetrafluoroethylene", 144),
- new ItemStack(Blocks.tfftCasing, 1),
- 200, 256);
- final ItemStack[] tfftstoragefield1 = {
+ GT_Values.RA.addAssemblerRecipe(
+ tfftcasing,
+ FluidRegistry.getFluidStack("molten.polytetrafluoroethylene", 144),
+ new ItemStack(Blocks.tfftCasing, 1),
+ 200, 256);
+ final ItemStack[] tfftstoragefield1 = {
+ GT_Utility.getIntegratedCircuit(6),
+ GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 1),
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.PulsatingIron, 1),
+ GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Steel, 1),
+ ItemList.Electric_Pump_LV.get(1L)
+ };
+ GT_Values.RA.addAssemblerRecipe(
+ tfftstoragefield1,
+ FluidRegistry.getFluidStack("molten.glass", 144),
+ new ItemStack(Blocks.tfftStorageField1, 1),
+ 200, 256);
+ final ItemStack[] tfftstoragefield2 = {
+ GT_Utility.getIntegratedCircuit(6),
+ GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2),
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.PulsatingIron, 4),
+ GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.StainlessSteel, 1),
+ ItemList.Electric_Pump_MV.get(1L)
+ };
+ GT_Values.RA.addAssemblerRecipe(
+ tfftstoragefield2,
+ FluidRegistry.getFluidStack("molten.plastic", 576),
+ new ItemStack(Blocks.tfftStorageField2, 1),
+ 200, 480);
+ final ItemStack[] tfftstoragefield3 = {
GT_Utility.getIntegratedCircuit(6),
- GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 1),
- GT_OreDictUnificator.get(OrePrefixes.plate, Materials.PulsatingIron, 1),
- GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Steel, 1),
- ItemList.Electric_Pump_LV.get(1L)
+ GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Data, 2),
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.VibrantAlloy, 2),
+ GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Titanium, 1),
+ ItemList.Field_Generator_MV.get(1L),
+ ItemList.Electric_Pump_HV.get(2L)
};
- GT_Values.RA.addAssemblerRecipe(
- tfftstoragefield1,
- FluidRegistry.getFluidStack("molten.glass", 144),
- new ItemStack(Blocks.tfftStorageField1, 1),
- 200, 256);
- final ItemStack[] tfftstoragefield2 = {
- GT_Utility.getIntegratedCircuit(6),
- GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2),
- GT_OreDictUnificator.get(OrePrefixes.plate, Materials.PulsatingIron, 4),
- GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.StainlessSteel, 1),
- ItemList.Electric_Pump_MV.get(1L)
- };
- GT_Values.RA.addAssemblerRecipe(
- tfftstoragefield2,
- FluidRegistry.getFluidStack("molten.plastic", 576),
- new ItemStack(Blocks.tfftStorageField2, 1),
- 200, 480);
- final ItemStack[] tfftstoragefield3 = {
- GT_Utility.getIntegratedCircuit(6),
- GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Data, 2),
- GT_OreDictUnificator.get(OrePrefixes.plate, Materials.VibrantAlloy, 2),
- GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Titanium, 1),
- ItemList.Field_Generator_MV.get(1L),
- ItemList.Electric_Pump_HV.get(2L)
- };
- GT_Values.RA.addAssemblerRecipe(
- tfftstoragefield3,
- FluidRegistry.getFluidStack("molten.epoxid", 576),
- new ItemStack(Blocks.tfftStorageField3, 1),
- 300, 1920);
- final ItemStack[] tfftstoragefield4 = {
- GT_Utility.getIntegratedCircuit(6),
- GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Elite, 4),
- GT_OreDictUnificator.get(OrePrefixes.plateTriple, Materials.NiobiumTitanium, 1),
- GT_OreDictUnificator.get(OrePrefixes.pipeHuge, Materials.TungstenSteel, 1),
- ItemList.Field_Generator_HV.get(1L),
- ItemList.Electric_Pump_EV.get(1L)
- };
- GT_Values.RA.addAssemblerRecipe(
- tfftstoragefield4,
- FluidRegistry.getFluidStack("molten.epoxid", 1152),
- new ItemStack(Blocks.tfftStorageField4, 1),
- 400, 4098);
- final ItemStack[] tfftstoragefield5 = {
- GT_Utility.getIntegratedCircuit(6),
- GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 4),
- GT_OreDictUnificator.get(OrePrefixes.plateTriple, Materials.HSSS, 1),
- GT_OreDictUnificator.get(OrePrefixes.pipeHuge, Materials.Enderium, 1),
- ItemList.Field_Generator_EV.get(1L),
- ItemList.Electric_Pump_IV.get(1L)
- };
- GT_Values.RA.addAssemblerRecipe(
- tfftstoragefield5,
- FluidRegistry.getFluidStack("molten.epoxid", 1152),
- new ItemStack(Blocks.tfftStorageField5, 1),
- 400, 6147);
- final Object[] multi_hatch = {
- "PRP", "UFU", "PRP",
- 'P', GT_OreDictUnificator.get(OrePrefixes.pipeTiny, Materials.NiobiumTitanium, 1),
- 'R', GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.StainlessSteel, 1),
- 'U', ItemList.Electric_Pump_IV.get(1L),
- 'F', ItemList.Field_Generator_HV.get(1L)
- };
- GT_ModHandler.addCraftingRecipe(new ItemStack(Blocks.tfftMultiHatch), multi_hatch);
+ GT_Values.RA.addAssemblerRecipe(
+ tfftstoragefield3,
+ FluidRegistry.getFluidStack("molten.epoxid", 576),
+ new ItemStack(Blocks.tfftStorageField3, 1),
+ 300, 1920);
+ final ItemStack[] tfftstoragefield4 = {
+ GT_Utility.getIntegratedCircuit(6),
+ GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Elite, 4),
+ GT_OreDictUnificator.get(OrePrefixes.plateTriple, Materials.NiobiumTitanium, 1),
+ GT_OreDictUnificator.get(OrePrefixes.pipeHuge, Materials.TungstenSteel, 1),
+ ItemList.Field_Generator_HV.get(1L),
+ ItemList.Electric_Pump_EV.get(1L)
+ };
+ GT_Values.RA.addAssemblerRecipe(
+ tfftstoragefield4,
+ FluidRegistry.getFluidStack("molten.epoxid", 1152),
+ new ItemStack(Blocks.tfftStorageField4, 1),
+ 400, 4098);
+ final ItemStack[] tfftstoragefield5 = {
+ GT_Utility.getIntegratedCircuit(6),
+ GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 4),
+ GT_OreDictUnificator.get(OrePrefixes.plateTriple, Materials.HSSS, 1),
+ GT_OreDictUnificator.get(OrePrefixes.pipeHuge, Materials.Enderium, 1),
+ ItemList.Field_Generator_EV.get(1L),
+ ItemList.Electric_Pump_IV.get(1L)
+ };
+ GT_Values.RA.addAssemblerRecipe(
+ tfftstoragefield5,
+ FluidRegistry.getFluidStack("molten.epoxid", 1152),
+ new ItemStack(Blocks.tfftStorageField5, 1),
+ 400, 6147);
+ // Multi Hatch
+ final Object[] multi_hatch_HV = {
+ "PRP", "UFU", "PRP",
+ 'P', GT_OreDictUnificator.get(OrePrefixes.pipeTiny, Materials.StainlessSteel, 1),
+ 'R', GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.StainlessSteel, 1),
+ 'U', ItemList.Electric_Pump_HV.get(1L),
+ 'F', ItemList.Field_Generator_LV.get(1L)
+ };
+ GT_ModHandler.addCraftingRecipe(new ItemStack(Blocks.tfftMultiHatch), multi_hatch_HV);
+ final Object[] multi_hatch_IV = {
+ "PRP", "UFU", "PRP",
+ 'P', GT_OreDictUnificator.get(OrePrefixes.pipeTiny, Materials.TungstenSteel, 1),
+ 'R', GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.TungstenSteel, 1),
+ 'U', ItemList.Electric_Pump_IV.get(1L),
+ 'F', ItemList.Field_Generator_HV.get(1L)
+ };
+ GT_ModHandler.addCraftingRecipe(new ItemStack(Blocks.tfftMultiHatch), multi_hatch_IV);
+ final Object[] multi_hatch_ZPM = {
+ "PRP", "UFU", "PRP",
+ 'P', GT_OreDictUnificator.get(OrePrefixes.pipeTiny, Materials.NaquadahAlloy, 1),
+ 'R', GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.NaquadahAlloy, 1),
+ 'U', ItemList.Electric_Pump_ZPM.get(1L),
+ 'F', ItemList.Field_Generator_IV.get(1L)
+ };
+ GT_ModHandler.addCraftingRecipe(new ItemStack(Blocks.tfftMultiHatch), multi_hatch_ZPM);
+
+ // Conversion recipe from deprecated hatch to new one (old hatch is equal to new IV hatch)
+ GT_ModHandler.addShapelessCraftingRecipe(TileEntities.mhIV.getStackForm(1),
+ new ItemStack[]{new ItemStack(Blocks.tfftMultiHatch, 1)});
}
private static void registerRecipes_SOFC() {
@@ -175,7 +176,7 @@ public class Recipes {
'B', GT_OreDictUnificator.get(OrePrefixes.cableGt02, Materials.Gold, 1),
'L', GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.StainlessSteel, 1)
};
- GT_ModHandler.addCraftingRecipe(KekzCore.sofc1.getStackForm(1), mk1_recipe);
+ GT_ModHandler.addCraftingRecipe(TileEntities.sofc1.getStackForm(1), mk1_recipe);
final Object[] mk2_recipe = {
"CCC", "PHP", "FBL",
'C', OrePrefixes.circuit.get(Materials.Master),
@@ -185,7 +186,7 @@ public class Recipes {
'B', Util.getStackofAmountFromOreDict("wireGt04SuperconductorEV", 1),
'L', GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Ultimate, 1)
};
- GT_ModHandler.addCraftingRecipe(KekzCore.sofc2.getStackForm(1), mk2_recipe);
+ GT_ModHandler.addCraftingRecipe(TileEntities.sofc2.getStackForm(1), mk2_recipe);
// Blocks
final ItemStack[] yszUnit = {
@@ -254,7 +255,7 @@ public class Recipes {
400, 1920);
}
- private static void registerRecipes_Nuclear() {
+ /*private static void registerRecipes_Nuclear() {
final MetaItem_CraftingComponent craftingItem = MetaItem_CraftingComponent.getInstance();
@@ -330,68 +331,7 @@ public class Recipes {
craftingItem.getStackOfAmountFromDamage(Items.IsotopicallyPureDiamondCrystal.getMetaID(), 4),
craftingItem.getStackFromDamage(Items.DiamondHeatPipe.getMetaID()),
null, 1200, 7680);
- }
-
- private static void registerRecipes_ItemServer() {
-
- final MetaItem_CraftingComponent craftingItem = MetaItem_CraftingComponent.getInstance();
-
- // Controller
- final Object[] is_recipe = {
- "FRF", "CGC", "PZP",
- 'F', GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.TungstenSteel, 1),
- 'R', GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.TungstenSteel, 1),
- 'C', ItemList.Conveyor_Module_LuV.get(1L),
- 'G', ItemList.Field_Generator_EV.get(1L),
- 'P', GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.VanadiumGallium, 1),
- 'Z', GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Master, 1)
- };
- GT_ModHandler.addCraftingRecipe(KekzCore.is.getStackForm(1), is_recipe);
-
- // Blocks
- final Object[] is_rack_recipe = {
- "BRB", "CFC", "BRB",
- 'B', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlueSteel, 1),
- 'R', GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.Aluminium, 1),
- 'C', GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Platinum, 1),
- 'F', GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.TungstenSteel, 1),
- };
- GT_ModHandler.addCraftingRecipe(new ItemStack(Blocks.itemServerRackCasing), is_rack_recipe);
- final ItemStack[] is_ioport = {
- GT_Utility.getIntegratedCircuit(6),
- new ItemStack(Blocks.itemServerRackCasing),
- GT_OreDictUnificator.get(OrePrefixes.bolt, Materials.Platinum, 16),
- GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Platinum, 2),
- ItemList.Field_Generator_HV.get(1L),
- ItemList.Robot_Arm_EV.get(4L)
- };
- GT_Values.RA.addAssemblerRecipe(
- is_ioport,
- FluidRegistry.getFluidStack("molten.polytetrafluoroethylene", 144),
- new ItemStack(Blocks.itemServerIOPort, 1),
- 200, 7680);
- final Object[] is_blade = {
- "CRC", "CMC", "HPH",
- 'C', GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Elite, 1),
- 'R', GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.Aluminium, 1),
- 'P', GT_OreDictUnificator.get(OrePrefixes.cableGt08, Materials.Platinum, 1),
- 'M', ItemList.Electric_Motor_EV.get(1L),
- 'H', craftingItem.getStackFromDamage(Items.BoronArsenideHeatPipe.getMetaID()),
- };
- GT_ModHandler.addCraftingRecipe(craftingItem.getStackOfAmountFromDamage(Items.ItemServerBlade.getMetaID(), 8), is_blade);
- final ItemStack[] is_drive = {
- GT_Utility.getIntegratedCircuit(6),
- craftingItem.getStackOfAmountFromDamage(Items.ItemServerBlade.getMetaID(), 8),
- GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BlueSteel, 4),
- GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Aluminium, 1),
- GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Aluminium, 16)
- };
- GT_Values.RA.addAssemblerRecipe(
- is_drive,
- FluidRegistry.getFluidStack("molten.polyethylene", 1152),
- new ItemStack(Blocks.itemServerDrive, 1),
- 200, 7680);
- }
+ }*/
private static void registerRecipes_Jars() {
@@ -419,15 +359,11 @@ public class Recipes {
ThaumcraftApi.addInfusionCraftingRecipe("THAUMIUMREINFORCEDJAR", new ItemStack(Blocks.jarThaumiumReinforced, 1, 0),
5, aspects_jarthaumiumreinforced, ItemApi.getBlock("blockJar", 0), recipe_jarthaumiumreinforced));
// Thaumium Reinforced Void Jar
- final ItemStack n1 = GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Obsidian, 1);
- final ItemStack n2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Blaze, 1);
- final ItemStack n3 = GT_OreDictUnificator.get(OrePrefixes.plate, Materials.EnderEye, 1);
- final ItemStack n4 = ItemApi.getItem("itemNugget", 5);
final ItemStack[] recipe_voidjarupgrade = {
- n1,
- n2,
- n3,
- n4
+ GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Obsidian, 1),
+ GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Blaze, 1),
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.EnderEye, 1),
+ ItemApi.getItem("itemNugget", 5)
};
final AspectList aspects_voidjarupgrade = new AspectList()
.add(Aspect.VOID, 14)
@@ -480,7 +416,7 @@ public class Recipes {
'C', OrePrefixes.circuit.get(Materials.Master),
'B', new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 0),
};
- GT_ModHandler.addCraftingRecipe(KekzCore.lsc.getStackForm(1), lsc_recipe);
+ GT_ModHandler.addCraftingRecipe(TileEntities.lsc.getStackForm(1), lsc_recipe);
// Blocks
final Object[] lcBase_recipe = {
@@ -491,6 +427,28 @@ public class Recipes {
'L', OrePrefixes.block.get(Materials.Lapis)
};
GT_ModHandler.addCraftingRecipe(new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 0), lcBase_recipe);
+
+ // Empty Capacitor
+ final Object[] lcEmpty_recipe = {
+ "SLS", "L L", "SLS",
+ 'S', OrePrefixes.screw.get(Materials.Lapis),
+ 'L', OrePrefixes.plate.get(Materials.Lapis)
+ };
+ GT_ModHandler.addCraftingRecipe(new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 6), lcEmpty_recipe);
+
+ // EV Capacitor
+ final Object[] lcEV_recipe = {
+ "SLS", "LCL", "SLS",
+ 'S', OrePrefixes.screw.get(Materials.Lapis),
+ 'L', OrePrefixes.plate.get(Materials.Lapis),
+ 'C', GT_ModHandler.getIC2Item("lapotronCrystal", 1L, GT_Values.W)
+ };
+ GT_ModHandler.addCraftingRecipe(new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 7), lcEV_recipe);
+
+ //EV cap alt recipe
+ GT_Values.RA.addAssemblerRecipe(new ItemStack[] {(new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 6)), GT_ModHandler.getIC2Item("lapotronCrystal", 1L, GT_Values.W), GT_Utility.getIntegratedCircuit(7)}, null, new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 7), 200, 480);
+
+ // IV Capacitor
final Object[] lcIV_recipe = {
"SLS", "LOL", "SLS",
'S', OrePrefixes.screw.get(Materials.Lapis),
@@ -499,82 +457,118 @@ public class Recipes {
};
GT_ModHandler.addCraftingRecipe(new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 1), lcIV_recipe);
- KekzCore.LOGGER.info("Reading Assembly Line recipes from GregTech recipe map");
- GT_Recipe.GT_Recipe_AssemblyLine arLuV = null;
- // Next two are hardcoded because my code can't find them
- GT_Recipe.GT_Recipe_AssemblyLine arZPM = new GT_Recipe.GT_Recipe_AssemblyLine(
- ItemList.Energy_LapotronicOrb2.get(1L), 288000, new ItemStack[] {
- GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Europium, 16L),
- GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 1),
- GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 1),
- GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 1),
- GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Ultimate, 1),
- ItemList.Energy_LapotronicOrb2.get(8L),
- ItemList.Field_Generator_LuV.get(2),
- ItemList.Circuit_Wafer_SoC2.get(64),
- ItemList.Circuit_Wafer_SoC2.get(64),
- ItemList.Circuit_Parts_DiodeASMD.get(8),
- GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Naquadah, 32)
+ //IV cap alt recipe
+ GT_Values.RA.addAssemblerRecipe(new ItemStack[] {(new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 6)), ItemList.Energy_LapotronicOrb.get(1L), GT_Utility.getIntegratedCircuit(1)}, null, new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 1), 200, 1920);
+
+ // LuV Capacitor
+ GT_Values.RA.addAssemblylineRecipe(
+ new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 1), 288000,
+ new Object[] {
+ GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Osmiridium, 4),
+ GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Osmiridium, 24),
+ ItemList.Circuit_Board_Elite.get(1),
+ GT_OreDictUnificator.get(OrePrefixes.foil, Materials.NaquadahAlloy, 64),
+ new Object[]{OrePrefixes.circuit.get(Materials.Master), 4},
+ ItemList.Circuit_Parts_Crystal_Chip_Master.get(36),
+ ItemList.Circuit_Parts_Crystal_Chip_Master.get(36),
+ ItemList.Circuit_Chip_HPIC.get(64),
+ ItemList.Circuit_Parts_DiodeASMD.get(8),
+ ItemList.Circuit_Parts_CapacitorASMD.get(8),
+ ItemList.Circuit_Parts_ResistorASMD.get(8),
+ ItemList.Circuit_Parts_TransistorASMD.get(8),
+ GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Platinum, 64)
+ },
+ new FluidStack[] {
+ Materials.SolderingAlloy.getMolten(720)
+ },
+ new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 2), 2000, 100000
+ );
+
+ // ZPM Capacitor
+ GT_Values.RA.addAssemblylineRecipe(
+ new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 2), 288000,
+ new Object[] {
+ GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.NaquadahAlloy, 4),
+ GT_OreDictUnificator.get(OrePrefixes.screw, Materials.NaquadahAlloy, 24),
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Europium, 16L),
+ new Object[]{OrePrefixes.circuit.get(Materials.Ultimate), 1},
+ new Object[]{OrePrefixes.circuit.get(Materials.Ultimate), 1},
+ new Object[]{OrePrefixes.circuit.get(Materials.Ultimate), 1},
+ new Object[]{OrePrefixes.circuit.get(Materials.Ultimate), 1},
+ ItemList.Energy_LapotronicOrb2.get(8L),
+ ItemList.Field_Generator_LuV.get(2),
+ ItemList.Circuit_Wafer_SoC2.get(64),
+ ItemList.Circuit_Wafer_SoC2.get(64),
+ ItemList.Circuit_Parts_DiodeASMD.get(8),
+ GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Naquadah, 32)
},
new FluidStack[] {
Materials.SolderingAlloy.getMolten(2880),
new FluidStack(FluidRegistry.getFluid("ic2coolant"), 16000)
},
- ItemList.Energy_Module.get(1), 2000, 100000
+ new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 3), 2000, 100000
);
- GT_Recipe.GT_Recipe_AssemblyLine arUV = new GT_Recipe.GT_Recipe_AssemblyLine(
- ItemList.Energy_Module.get(1L), 288000, new ItemStack[] {
- GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Americium, 32L),
- GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Superconductor, 1),
- GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Superconductor, 1),
- GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Superconductor, 1),
- GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Superconductor, 1),
- ItemList.Energy_Module.get(8L),
- ItemList.Field_Generator_ZPM.get(2),
- ItemList.Circuit_Wafer_HPIC.get(64),
- ItemList.Circuit_Wafer_HPIC.get(64),
- ItemList.Circuit_Parts_DiodeASMD.get(16),
- GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.NaquadahAlloy, 32)
+
+ // UV Capacitor
+ GT_Values.RA.addAssemblylineRecipe(
+ new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 3), 288000,
+ new Object[] {
+ GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Neutronium, 4),
+ GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Neutronium, 24),
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Americium, 32L),
+ new Object[]{OrePrefixes.circuit.get(Materials.Superconductor), 1},
+ new Object[]{OrePrefixes.circuit.get(Materials.Superconductor), 1},
+ new Object[]{OrePrefixes.circuit.get(Materials.Superconductor), 1},
+ new Object[]{OrePrefixes.circuit.get(Materials.Superconductor), 1},
+ ItemList.Energy_Module.get(8L),
+ ItemList.Field_Generator_ZPM.get(2),
+ ItemList.Circuit_Wafer_HPIC.get(64),
+ ItemList.Circuit_Wafer_HPIC.get(64),
+ ItemList.Circuit_Parts_DiodeASMD.get(16),
+ GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.NaquadahAlloy, 32)
},
new FluidStack[] {
Materials.SolderingAlloy.getMolten(2880),
new FluidStack(FluidRegistry.getFluid("ic2coolant"), 16000)
},
- ItemList.Energy_Cluster.get(1), 2000, 200000
+ new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 4), 2000, 200000
+ );
+
+ // Ultimate Capacitor
+ GT_Values.RA.addAssemblylineRecipe(
+ new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 4), 288000,
+ new Object[] {
+ GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.CosmicNeutronium, 4),
+ GT_OreDictUnificator.get(OrePrefixes.screw, Materials.CosmicNeutronium, 24),
+ GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Neutronium, 32L),
+ GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Neutronium, 32L),
+ new Object[]{OrePrefixes.circuit.get(Materials.Bio), 1},
+ new Object[]{OrePrefixes.circuit.get(Materials.Bio), 1},
+ new Object[]{OrePrefixes.circuit.get(Materials.Bio), 1},
+ new Object[]{OrePrefixes.circuit.get(Materials.Bio), 1},
+ ItemList.ZPM2.get(8L),
+ ItemList.Field_Generator_UHV.get(4),
+ ItemList.Circuit_Wafer_UHPIC.get(64),
+ ItemList.Circuit_Wafer_UHPIC.get(64),
+ ItemList.Circuit_Wafer_SoC2.get(32),
+ ItemList.Circuit_Parts_DiodeASMD.get(64)
+ },
+ new FluidStack[] {
+ Materials.SolderingAlloy.getMolten(3760),
+ Materials.Naquadria.getMolten(9216),
+ new FluidStack(FluidRegistry.getFluid("ic2coolant"), 32000)
+ },
+ new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 5), 2000, 200000
);
- GT_Recipe.GT_Recipe_AssemblyLine arU = null;
- for(GT_Recipe.GT_Recipe_AssemblyLine ar : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes) {
- if(GT_Utility.areStacksEqual(ar.mOutput, ItemList.Energy_LapotronicOrb2.get(1L), true)) {
- // LuV Lapo Orb
- arLuV = ar;
- } else if(GT_Utility.areStacksEqual(ar.mOutput, ItemList.Energy_Module.get(1L), true)) {
- // ZPM Lapo Orb
- KekzCore.LOGGER.info("Found matching recipe for Energy Module?");
- } else if(GT_Utility.areStacksEqual(ar.mOutput, ItemList.Energy_Cluster.get(1L), true)) {
- // UV Lapo Orb
- KekzCore.LOGGER.info("Found matching recipe for Energy Cluster?");
- } else if(GT_Utility.areStacksEqual(ar.mOutput, ItemList.ZPM2.get(1L), true)) {
- // Ultimate Battery
- arU = ar;
- }
- }
- lapoCapacitorRecipeAdder(arLuV, Materials.Osmiridium,
- GT_OreDictUnificator.get(OrePrefixes.block, Materials.Lapis, 1),
- new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 2));
- lapoCapacitorRecipeAdder(arZPM, Materials.NaquadahAlloy,
- new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 2),
- new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 3));
- lapoCapacitorRecipeAdder(arUV, Materials.Neutronium,
- new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 3),
- new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 4));
- lapoCapacitorRecipeAdder(arU, Materials.CosmicNeutronium,
- new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 4),
- new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 5));
// Capacitor recycling
+ GT_Values.RA.addUnboxingRecipe(new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 7),
+ GT_ModHandler.getIC2Item("lapotronCrystal", 1L, 26),
+ new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 6),
+ 1200, 32);
GT_Values.RA.addUnboxingRecipe(new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 1),
ItemList.Energy_LapotronicOrb.get(1L),
- GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Lapis, 4),
+ new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 6),
1200, 32);
GT_Values.RA.addUnboxingRecipe(new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 2),
ItemList.Energy_LapotronicOrb2.get(1L),
@@ -592,9 +586,22 @@ public class Recipes {
ItemList.ZPM2.get(1L),
GT_OreDictUnificator.get(OrePrefixes.screw, Materials.CosmicNeutronium, 24),
1200, 32);
+
+ // For the people that already made the Really Ultimate Battery but want to use the LSC
+ GT_Values.RA.addAssemblerRecipe(
+ new ItemStack[] {
+ ItemList.ZPM3.get(1),
+ GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.CosmicNeutronium, 4),
+ GT_OreDictUnificator.get(OrePrefixes.screw, Materials.CosmicNeutronium, 24),
+ GT_Utility.getIntegratedCircuit(6)
+ },
+ null,
+ new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 5),
+ 12000, 200000
+ );
}
- private static void registerRecipes_SpaceElevator() {
+ /*private static void registerRecipes_SpaceElevator() {
// Controller
final Object[] se_recipe = {
"BCB", "CPC", "BCB",
@@ -602,7 +609,7 @@ public class Recipes {
'C', OrePrefixes.cableGt16.get(Materials.Aluminium),
'P', OrePrefixes.circuit.get(Materials.Master)
};
- GT_ModHandler.addCraftingRecipe(KekzCore.se.getStackForm(1), se_recipe);
+ GT_ModHandler.addCraftingRecipe(TileEntities.se.getStackForm(1), se_recipe);
// Blocks
final Object[] seBase_recipe = {
"DRD", "RCR", "DRD",
@@ -618,5 +625,20 @@ public class Recipes {
'C', OrePrefixes.cableGt01.get(Materials.Aluminium)
};
GT_ModHandler.addCraftingRecipe(new ItemStack(Blocks.spaceElevatorStructure, 1, 1), seCoilHolder_recipe);
+ }*/
+
+ private static void registerRecipes_Cosmetics() {
+ // Hex Tiles
+ final ItemStack[] hexTiles = {
+ GT_Utility.getIntegratedCircuit(6),
+ GT_OreDictUnificator.get(OrePrefixes.stone, Materials.Concrete, 1),
+ GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Steel, 1),
+ GT_OreDictUnificator.get(OrePrefixes.foil, Materials.DarkSteel, 2)
+ };
+ GT_Values.RA.addAssemblerRecipe(
+ hexTiles,
+ FluidRegistry.getFluidStack("molten.plastic", 36),
+ new ItemStack(Blocks.largeHexPlate, 2),
+ 600, 120);
}
}
diff --git a/src/main/java/common/TileEntities.java b/src/main/java/common/TileEntities.java
new file mode 100644
index 0000000000..740b985b00
--- /dev/null
+++ b/src/main/java/common/TileEntities.java
@@ -0,0 +1,45 @@
+package common;
+
+import common.tileentities.*;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public class TileEntities {
+
+ // Multiblock controllers
+ public static GTMTE_SOFuelCellMK1 sofc1;
+ public static GTMTE_SOFuelCellMK2 sofc2;
+ //public static GTMTE_ModularNuclearReactor mdr;
+ public static GTMTE_FluidMultiStorage fms;
+ public static GTMTE_LapotronicSuperCapacitor lsc;
+ public static GTMTE_SpaceElevator se;
+ // Singleblocks
+ public static GTMTE_TFFTMultiHatch mhHV;
+ public static GTMTE_TFFTMultiHatch mhIV;
+ public static GTMTE_TFFTMultiHatch mhZPM;
+
+ public static void preInit() {
+ GameRegistry.registerTileEntity(TE_TFFTMultiHatch.class, "kekztech_tfftmultihatch_tile");
+ //GameRegistry.registerTileEntity(TE_ItemProxyCable.class, "kekztech_itemproxycable_tile");
+ //GameRegistry.registerTileEntity(TE_ItemProxySource.class, "kekztech_itemproxysource_tile");
+ //GameRegistry.registerTileEntity(TE_ItemProxyEndpoint.class, "kekztech_itemproxyendpoint_tile");
+ GameRegistry.registerTileEntity(TE_ThaumiumReinforcedJar.class, "kekztech_thaumiumreinforcedjar");
+ GameRegistry.registerTileEntity(TE_IchorJar.class, "kekztech_ichorjar");
+ //GameRegistry.registerTileEntity(TE_SpaceElevatorCapacitor.class, "kekztech_secapacitor");
+ //GameRegistry.registerTileEntity(TE_BeamTransmitter.class, "kekztech_beamtransmitter");
+ }
+
+ public static void init() {
+ // Multiblock controllers
+ sofc1 = new GTMTE_SOFuelCellMK1(13101, "multimachine.fuelcellmk1", "Solid-Oxide Fuel Cell Mk I");
+ sofc2 = new GTMTE_SOFuelCellMK2(13102, "multimachine.fuelcellmk2", "Solid-Oxide Fuel Cell Mk II");
+ //mdr = new GTMTE_ModularNuclearReactor(13103, "multimachine.nuclearreactor", "Nuclear Reactor");
+ fms = new GTMTE_FluidMultiStorage(13104, "multimachine.tf_fluidtank", "T.F.F.T");
+ lsc = new GTMTE_LapotronicSuperCapacitor(13106, "multimachine.supercapacitor", "Lapotronic Supercapacitor");
+ //se = new GTMTE_SpaceElevator(13107, "multimachine.spaceelevator", "Space Elevator");
+ // Singleblocks
+ mhHV = new GTMTE_TFFTMultiHatch(13108, "machine.multihatch.0", "T.F.F.T Multi I/O Hatch [HV]", 3);
+ mhIV = new GTMTE_TFFTMultiHatch(13109, "machine.multihatch.1", "T.F.F.T Multi I/O Hatch [IV]", 5);
+ mhZPM = new GTMTE_TFFTMultiHatch(13110, "machine.multihatch.2", "T.F.F.T Multi I/O Hatch [ZPM]", 7);
+ }
+
+}
diff --git a/src/main/java/common/blocks/Block_BeamTransmitter.java b/src/main/java/common/blocks/Block_BeamTransmitter.java
new file mode 100644
index 0000000000..af7a837fdd
--- /dev/null
+++ b/src/main/java/common/blocks/Block_BeamTransmitter.java
@@ -0,0 +1,55 @@
+package common.blocks;
+
+import common.tileentities.TE_BeamTransmitter;
+import common.tileentities.TE_SpaceElevatorTether;
+import cpw.mods.fml.common.registry.GameRegistry;
+import kekztech.KekzCore;
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.World;
+
+public class Block_BeamTransmitter extends Block {
+
+ private static final Block_BeamTransmitter INSTANCE = new Block_BeamTransmitter();
+
+ private Block_BeamTransmitter() {
+ super(Material.glass);
+ }
+
+ public static Block registerBlock() {
+ final String blockName = "kekztech_beamtransmitter_block";
+ INSTANCE.setBlockName(blockName);
+ INSTANCE.setCreativeTab(CreativeTabs.tabMisc);
+ INSTANCE.setHardness(5.0f);
+ INSTANCE.setResistance(5.0f);
+ INSTANCE.setBlockTextureName(KekzCore.MODID + ":" + "Tether_top");
+ GameRegistry.registerBlock(INSTANCE, blockName);
+
+ return INSTANCE;
+ }
+
+ @Override
+ public TileEntity createTileEntity(World world, int meta) {
+ return new TE_BeamTransmitter();
+ }
+
+ @Override
+ public boolean hasTileEntity(int meta) {
+ return true;
+ }
+
+ @Override
+ public boolean isOpaqueCube()
+ {
+ return false;
+ }
+
+ @Override
+ public boolean renderAsNormalBlock()
+ {
+ return false;
+ }
+
+}
diff --git a/src/main/java/common/blocks/Block_IchorJar.java b/src/main/java/common/blocks/Block_IchorJar.java
index 560fd0c37b..0c2417b2f1 100644
--- a/src/main/java/common/blocks/Block_IchorJar.java
+++ b/src/main/java/common/blocks/Block_IchorJar.java
@@ -42,6 +42,7 @@ public class Block_IchorJar extends BlockJar {
public static Block registerBlock() {
final String blockName = "kekztech_ichorjar_block";
INSTANCE.setBlockName(blockName);
+ INSTANCE.setHarvestLevel("pickaxe", 3);
GameRegistry.registerBlock(INSTANCE, IB_IchorJar.class, blockName);
return INSTANCE;
diff --git a/src/main/java/common/blocks/Block_ItemServerDrive.java b/src/main/java/common/blocks/Block_ItemServerDrive.java
deleted file mode 100644
index 63747a8598..0000000000
--- a/src/main/java/common/blocks/Block_ItemServerDrive.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package common.blocks;
-
-import common.itemBlocks.IB_ItemServerDrive;
-import cpw.mods.fml.common.registry.GameRegistry;
-import kekztech.KekzCore;
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.util.IIcon;
-
-public class Block_ItemServerDrive extends BaseGTUpdateableBlock{
-
- private static Block_ItemServerDrive instance = new Block_ItemServerDrive();
-
- private IIcon[] faces = new IIcon[6];
-
- private Block_ItemServerDrive() {
- super(Material.iron);
- }
-
- public static Block registerBlock() {
- final String blockName = "kekztech_itemserverdrive_block";
- instance.setBlockName(blockName);
- instance.setCreativeTab(CreativeTabs.tabMisc);
- instance.setHardness(5.0f);
- instance.setResistance(6.0f);
- GameRegistry.registerBlock(instance, IB_ItemServerDrive.class, blockName);
-
- return instance;
- }
-
- @Override
- public void registerBlockIcons(IIconRegister reg) {
- for(int i = 0; i < 6; i++) {
- if(i == 0) {
- faces[i] = reg.registerIcon(KekzCore.MODID + ":" + "ItemServerDrive_BOTTOM");
- } else if(i == 1) {
- faces[i] = reg.registerIcon(KekzCore.MODID + ":" + "ItemServerDrive_TOP");
- } else {
- faces[i] = reg.registerIcon(KekzCore.MODID + ":" + "ItemServerDrive");
- }
-
- }
- }
-
- @Override
- public IIcon getIcon(int side, int meta) {
- return faces[side];
- }
-
- @Override
- public int getLightValue() {
- return 7;
- }
-
-}
diff --git a/src/main/java/common/blocks/Block_ItemServerIOPort.java b/src/main/java/common/blocks/Block_ItemServerIOPort.java
deleted file mode 100644
index 6af90b6e42..0000000000
--- a/src/main/java/common/blocks/Block_ItemServerIOPort.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package common.blocks;
-
-import common.itemBlocks.IB_ItemServerIOPort;
-import common.tileentities.TE_ItemServerIOPort;
-import cpw.mods.fml.common.registry.GameRegistry;
-import kekztech.KekzCore;
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-
-public class Block_ItemServerIOPort extends BaseGTUpdateableBlock {
-
- private static Block_ItemServerIOPort instance = new Block_ItemServerIOPort();
-
- private Block_ItemServerIOPort() {
- super(Material.iron);
- }
-
- public static Block registerBlock() {
- final String blockName = "kekztech_itemserverioport_block";
- instance.setBlockName(blockName);
- instance.setCreativeTab(CreativeTabs.tabMisc);
- instance.setBlockTextureName(KekzCore.MODID + ":" + "ItemServerIOPort");
- instance.setHardness(5.0f);
- instance.setResistance(6.0f);
- GameRegistry.registerBlock(instance, IB_ItemServerIOPort.class, blockName);
-
- return instance;
- }
-
- @Override
- public boolean hasTileEntity(int metadata) {
- return true;
- }
-
- @Override
- public TileEntity createTileEntity(World world, int metadata) {
- return new TE_ItemServerIOPort();
- }
-
-}
diff --git a/src/main/java/common/blocks/Block_ItemServerRackCasing.java b/src/main/java/common/blocks/Block_ItemServerRackCasing.java
deleted file mode 100644
index db0ec9c3e6..0000000000
--- a/src/main/java/common/blocks/Block_ItemServerRackCasing.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package common.blocks;
-
-import common.itemBlocks.IB_ItemServerRackCasing;
-import cpw.mods.fml.common.registry.GameRegistry;
-import kekztech.KekzCore;
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.creativetab.CreativeTabs;
-
-public class Block_ItemServerRackCasing extends BaseGTUpdateableBlock {
-
- private static Block_ItemServerRackCasing instance = new Block_ItemServerRackCasing();
-
- private Block_ItemServerRackCasing() {
- super(Material.iron);
- }
-
- public static Block registerBlock() {
- final String blockName = "kekztech_itemserverrackcasing_block";
- instance.setBlockName(blockName);
- instance.setCreativeTab(CreativeTabs.tabMisc);
- instance.setBlockTextureName(KekzCore.MODID + ":" + "ItemServerRackCasing");
- instance.setHardness(5.0f);
- instance.setResistance(6.0f);
- GameRegistry.registerBlock(instance, IB_ItemServerRackCasing.class, blockName);
-
- return instance;
- }
-
-}
diff --git a/src/main/java/common/blocks/Block_LapotronicEnergyUnit.java b/src/main/java/common/blocks/Block_LapotronicEnergyUnit.java
index 9a6aad0b5b..75de60a308 100644
--- a/src/main/java/common/blocks/Block_LapotronicEnergyUnit.java
+++ b/src/main/java/common/blocks/Block_LapotronicEnergyUnit.java
@@ -14,11 +14,15 @@ import net.minecraft.util.IIcon;
public class Block_LapotronicEnergyUnit extends BaseGTUpdateableBlock {
- private static final Block_LapotronicEnergyUnit instance = new Block_LapotronicEnergyUnit();
+ private static final Block_LapotronicEnergyUnit INSTANCE = new Block_LapotronicEnergyUnit();
private IIcon iconBaseSide;
private IIcon iconBaseTop;
+ private IIcon iconLapoEmptySide;
+ private IIcon iconLapoEmptyTop;
+ private IIcon iconLapoEVSide;
+ private IIcon iconLapoEVTop;
private IIcon iconLapoIVSide;
private IIcon iconLapoIVTop;
private IIcon iconLapoLuVSide;
@@ -36,13 +40,13 @@ public class Block_LapotronicEnergyUnit extends BaseGTUpdateableBlock {
public static Block registerBlock() {
final String blockName = "kekztech_lapotronicenergyunit_block";
- instance.setBlockName(blockName);
- instance.setCreativeTab(CreativeTabs.tabMisc);
- instance.setHardness(5.0f);
- instance.setResistance(6.0f);
- GameRegistry.registerBlock(instance, IB_LapotronicEnergyUnit.class, blockName);
-
- return instance;
+ INSTANCE.setBlockName(blockName);
+ INSTANCE.setCreativeTab(CreativeTabs.tabMisc);
+ INSTANCE.setHardness(5.0f);
+ INSTANCE.setResistance(6.0f);
+ GameRegistry.registerBlock(INSTANCE, IB_LapotronicEnergyUnit.class, blockName);
+
+ return INSTANCE;
}
@Override
@@ -50,6 +54,11 @@ public class Block_LapotronicEnergyUnit extends BaseGTUpdateableBlock {
iconBaseSide = ir.registerIcon("kekztech:LSCBase_side");
iconBaseTop = ir.registerIcon("kekztech:LSCBase_top");
+
+ iconLapoEmptySide = ir.registerIcon("kekztech:LapotronicEnergyUnit6_side");
+ iconLapoEmptyTop = ir.registerIcon("kekztech:LapotronicEnergyUnit6_top");
+ iconLapoEVSide = ir.registerIcon("kekztech:LapotronicEnergyUnit7_side");
+ iconLapoEVTop = ir.registerIcon("kekztech:LapotronicEnergyUnit7_top");
iconLapoIVSide = ir.registerIcon("kekztech:LapotronicEnergyUnit1_side");
iconLapoIVTop = ir.registerIcon("kekztech:LapotronicEnergyUnit1_top");
iconLapoLuVSide = ir.registerIcon("kekztech:LapotronicEnergyUnit2_side");
@@ -68,7 +77,10 @@ public class Block_LapotronicEnergyUnit extends BaseGTUpdateableBlock {
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
// Multi casing
par3List.add(new ItemStack(par1, 1, 0));
- // Lapo units IV - UV
+ // Empty capacitor
+ par3List.add(new ItemStack(par1, 1, 6));
+ // Lapo capacitors EV - UV
+ par3List.add(new ItemStack(par1, 1, 7));
par3List.add(new ItemStack(par1, 1, 1));
par3List.add(new ItemStack(par1, 1, 2));
par3List.add(new ItemStack(par1, 1, 3));
@@ -86,6 +98,8 @@ public class Block_LapotronicEnergyUnit extends BaseGTUpdateableBlock {
case 3: return (side < 2) ? iconLapoZPMTop : iconLapoZPMSide;
case 4: return (side < 2) ? iconLapoUVTop : iconLapoUVSide;
case 5: return (side < 2) ? iconUltimateTop : iconUltimateSide;
+ case 6: return (side < 2) ? iconLapoEmptyTop : iconLapoEmptySide;
+ case 7: return (side < 2) ? iconLapoEVTop : iconLapoEVSide;
default: return iconUltimateTop;
}
}
diff --git a/src/main/java/common/blocks/Block_LargeHexPlate.java b/src/main/java/common/blocks/Block_LargeHexPlate.java
new file mode 100644
index 0000000000..8bdad56323
--- /dev/null
+++ b/src/main/java/common/blocks/Block_LargeHexPlate.java
@@ -0,0 +1,61 @@
+package common.blocks;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
+
+public class Block_LargeHexPlate extends Block {
+
+ private static final Block_LargeHexPlate INSTANCE = new Block_LargeHexPlate();
+ private static final int BATCH_SIZE = 4;
+
+ private final IIcon[][] parts = new IIcon[BATCH_SIZE][BATCH_SIZE];
+
+ private Block_LargeHexPlate() {
+ super(Material.rock);
+ }
+
+ public static Block registerBlock() {
+ final String blockName = "kekztech_largehextile_block";
+ INSTANCE.setBlockName(blockName);
+ INSTANCE.setCreativeTab(CreativeTabs.tabMisc);
+ INSTANCE.setHardness(6.0f);
+ INSTANCE.setResistance(10.0f);
+ GameRegistry.registerBlock(INSTANCE, blockName);
+
+ return INSTANCE;
+ }
+
+ @Override
+ public void registerBlockIcons(IIconRegister ir) {
+ for(int x = 0; x < BATCH_SIZE; x++) {
+ for(int z = 0; z < BATCH_SIZE; z++) {
+ parts[x][z] = ir.registerIcon("kekztech:LargeHexTile_" + x + "_" + z);
+ }
+ }
+ }
+
+ @Override
+ public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
+ final int xMod = x >= 0 ? Math.abs(x % BATCH_SIZE) : Math.abs((Math.abs(x) % BATCH_SIZE) - BATCH_SIZE) % BATCH_SIZE;
+ final int yMod = y >= 0 ? Math.abs(y % BATCH_SIZE) : Math.abs((Math.abs(y) % BATCH_SIZE) - BATCH_SIZE) % BATCH_SIZE;
+ final int zMod = z >= 0 ? Math.abs(z % BATCH_SIZE) : Math.abs((Math.abs(z) % BATCH_SIZE) - BATCH_SIZE) % BATCH_SIZE;
+
+ if(side == 0 || side == 1) {
+ return parts[xMod][zMod];
+ } else if(side == 2 || side == 3) {
+ return parts[xMod][yMod];
+ } else {
+ return parts[zMod][yMod];
+ }
+ }
+
+ @Override
+ public IIcon getIcon(int side, int meta) {
+ return parts[(int) Math.ceil(BATCH_SIZE / 2)][(int) Math.ceil(BATCH_SIZE / 2)];
+ }
+}
diff --git a/src/main/java/common/blocks/Block_TFFTMultiHatch.java b/src/main/java/common/blocks/Block_TFFTMultiHatch.java
index be7b588fa5..564113efe5 100644
--- a/src/main/java/common/blocks/Block_TFFTMultiHatch.java
+++ b/src/main/java/common/blocks/Block_TFFTMultiHatch.java
@@ -6,60 +6,60 @@ import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.GregTech_API;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
-import kekztech.KekzCore;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import java.util.List;
+
+@Deprecated
public class Block_TFFTMultiHatch extends BaseGTUpdateableBlock {
- private static Block_TFFTMultiHatch instance = new Block_TFFTMultiHatch();
-
+ private static final Block_TFFTMultiHatch INSTANCE = new Block_TFFTMultiHatch();
+
+ private IIcon casing;
+
private Block_TFFTMultiHatch() {
super(Material.iron);
}
public static Block registerBlock() {
final String blockName = "kekztech_tfftmultihatch_block";
- instance.setBlockName(blockName);
- instance.setCreativeTab(CreativeTabs.tabMisc);
- instance.setBlockTextureName(KekzCore.MODID + ":" + "TFFTMultiHatch");
- instance.setHardness(5.0f);
- instance.setResistance(6.0f);
- GameRegistry.registerBlock(instance, IB_TFFTMultiHatch.class, blockName);
-
- return instance;
+ INSTANCE.setBlockName(blockName);
+ INSTANCE.setCreativeTab(CreativeTabs.tabMisc);
+ INSTANCE.setHardness(5.0f);
+ INSTANCE.setResistance(6.0f);
+ GameRegistry.registerBlock(INSTANCE, IB_TFFTMultiHatch.class, blockName);
+
+ return INSTANCE;
}
@Override
- public TileEntity createTileEntity(World world, int p_149915_2_) {
- return new TE_TFFTMultiHatch();
+ public void registerBlockIcons(IIconRegister ir) {
+ casing = ir.registerIcon("kekztech:TFFTCasing");
}
@Override
- public boolean hasTileEntity(int metadata) {
- return true;
+ public IIcon getIcon(int side, int meta) {
+ return casing;
}
-
+
@Override
- public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) {
- // Code block taken from GregTech's BaseMetaTileEntity.class
- if (GT_Utility.isStackInList(player.getHeldItem(), GregTech_API.sScrewdriverList)) {
- if (GT_ModHandler.damageOrDechargeItem(player.getHeldItem(), 1, 200, player)) {
- final TileEntity te = world.getTileEntity(x, y, z);
- if(te instanceof TE_TFFTMultiHatch) {
- ((TE_TFFTMultiHatch) te).toggleAutoOutput();
- GT_Utility.sendSoundToPlayers(world, GregTech_API.sSoundList.get(100), 1.0F, -1.0F, x, y, z);
- // Give chat feedback
- GT_Utility.sendChatToPlayer(player, ((TE_TFFTMultiHatch) te).isOutputting() ? "Auto-output enabled" : "Auto-output disabled");
-
- }
- }
- return true;
- }
- return false;
+ public TileEntity createTileEntity(World world, int meta) {
+ return new TE_TFFTMultiHatch();
}
+
+ @Override
+ public boolean hasTileEntity(int meta) {
+ return true;
+ }
+
}
diff --git a/src/main/java/common/blocks/Block_ThaumiumReinforcedJar.java b/src/main/java/common/blocks/Block_ThaumiumReinforcedJar.java
index 61ca0e2390..cce03b0236 100644
--- a/src/main/java/common/blocks/Block_ThaumiumReinforcedJar.java
+++ b/src/main/java/common/blocks/Block_ThaumiumReinforcedJar.java
@@ -30,7 +30,7 @@ import java.util.List;
public class Block_ThaumiumReinforcedJar extends BlockJar {
- private static final Block_ThaumiumReinforcedJar instance = new Block_ThaumiumReinforcedJar();
+ private static final Block_ThaumiumReinforcedJar INSTANCE = new Block_ThaumiumReinforcedJar();
private Block_ThaumiumReinforcedJar() {
super();
@@ -41,10 +41,11 @@ public class Block_ThaumiumReinforcedJar extends BlockJar {
public static Block registerBlock() {
final String blockName = "kekztech_thaumiumreinforcedjar_block";
- instance.setBlockName(blockName);
- GameRegistry.registerBlock(instance, IB_ThaumiumReinforcedJar.class, blockName);
+ INSTANCE.setBlockName(blockName);
+ INSTANCE.setHarvestLevel("pickaxe", 2);
+ GameRegistry.registerBlock(INSTANCE, IB_ThaumiumReinforcedJar.class, blockName);
- return instance;
+ return INSTANCE;
}
@Override
diff --git a/src/main/java/common/itemBlocks/IB_ItemServerDrive.java b/src/main/java/common/itemBlocks/IB_ItemServerDrive.java
deleted file mode 100644
index a937230da5..0000000000
--- a/src/main/java/common/itemBlocks/IB_ItemServerDrive.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package common.itemBlocks;
-
-import java.util.List;
-
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.StatCollector;
-
-public class IB_ItemServerDrive extends ItemBlock {
-
- public IB_ItemServerDrive(Block block) {
- super(block);
- }
-
- @SuppressWarnings({"unchecked"})
- @Override
- public void addInformation(ItemStack stack, EntityPlayer player, List lines, boolean advancedTooltips) {
- lines.add(StatCollector.translateToLocal("tile.kekztech_itemserverdrive_block.0.desc"));
- }
-}
diff --git a/src/main/java/common/itemBlocks/IB_ItemServerIOPort.java b/src/main/java/common/itemBlocks/IB_ItemServerIOPort.java
deleted file mode 100644
index 10803af14c..0000000000
--- a/src/main/java/common/itemBlocks/IB_ItemServerIOPort.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package common.itemBlocks;
-
-import java.util.List;
-
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.StatCollector;
-
-public class IB_ItemServerIOPort extends ItemBlock {
-
- public IB_ItemServerIOPort(Block block) {
- super(block);
- }
-
- @SuppressWarnings({"unchecked"})
- @Override
- public void addInformation(ItemStack stack, EntityPlayer player, List lines, boolean advancedTooltips) {
- lines.add(StatCollector.translateToLocal("tile.kekztech_itemserverioport_block.0.desc"));
- }
-}
diff --git a/src/main/java/common/itemBlocks/IB_ItemServerRackCasing.java b/src/main/java/common/itemBlocks/IB_ItemServerRackCasing.java
deleted file mode 100644
index f1da1fcb5e..0000000000
--- a/src/main/java/common/itemBlocks/IB_ItemServerRackCasing.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package common.itemBlocks;
-
-import java.util.List;
-
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.StatCollector;
-
-public class IB_ItemServerRackCasing extends ItemBlock {
-
- public IB_ItemServerRackCasing(Block block) {
- super(block);
- }
-
- @SuppressWarnings({"unchecked"})
- @Override
- public void addInformation(ItemStack stack, EntityPlayer player, List lines, boolean advancedTooltips) {
- lines.add(StatCollector.translateToLocal("tile.kekztech_itemserverrackcasing_block.0.desc="));
- }
-}
diff --git a/src/main/java/common/itemBlocks/IB_LapotronicEnergyUnit.java b/src/main/java/common/itemBlocks/IB_LapotronicEnergyUnit.java
index 7891be8ea1..b6a8fc2468 100644
--- a/src/main/java/common/itemBlocks/IB_LapotronicEnergyUnit.java
+++ b/src/main/java/common/itemBlocks/IB_LapotronicEnergyUnit.java
@@ -39,6 +39,8 @@ public class IB_LapotronicEnergyUnit extends ItemBlock {
case 3: lines.add("Capacity: 10,000,000,000 EU"); break;
case 4: lines.add("Capacity: 100,000,000,000 EU"); break;
case 5: lines.add("Capacity: 9,223,372,036,854,775,807 EU"); break;
+ case 6: lines.add("Capacity: None"); break;
+ case 7: lines.add("Capacity: 10,000,000 EU"); break;
}
}
}
diff --git a/src/main/java/common/itemBlocks/IB_TFFTMultiHatch.java b/src/main/java/common/itemBlocks/IB_TFFTMultiHatch.java
index 38b8997f0f..f00c5ef0c2 100644
--- a/src/main/java/common/itemBlocks/IB_TFFTMultiHatch.java
+++ b/src/main/java/common/itemBlocks/IB_TFFTMultiHatch.java
@@ -2,24 +2,38 @@ package common.itemBlocks;
import java.util.List;
+import common.tileentities.TE_TFFTMultiHatch;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
+@Deprecated
public class IB_TFFTMultiHatch extends ItemBlock {
public IB_TFFTMultiHatch(Block block) {
super(block);
}
-
+
+ @Override
+ public int getMetadata(int meta) {
+ return meta;
+ }
+
+ @Override
+ public boolean getHasSubtypes() {
+ return true;
+ }
+
+ @Override
+ public String getUnlocalizedName(ItemStack stack) {
+ return super.getUnlocalizedName() + "." + stack.getItemDamage();
+ }
+
@SuppressWarnings({"unchecked"})
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List lines, boolean advancedTooltips) {
lines.add(StatCollector.translateToLocal("tile.kekztech_tfftmultihatch_block.0.desc"));
- lines.add(StatCollector.translateToLocal("tile.kekztech_tfftmultihatch_block.1.desc"));
- lines.add(StatCollector.translateToLocal("tile.kekztech_tfftmultihatch_block.2.desc"));
- lines.add(StatCollector.translateToLocal("tile.kekztech_tfftmultihatch_block.3.desc"));
}
}
diff --git a/src/main/java/common/items/ErrorItem.java b/src/main/java/common/items/ErrorItem.java
new file mode 100644
index 0000000000..4b79e5fbd8
--- /dev/null
+++ b/src/main/java/common/items/ErrorItem.java
@@ -0,0 +1,48 @@
+package common.items;
+
+import java.util.List;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import kekztech.KekzCore;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+
+public class ErrorItem extends Item {
+
+ private static final ErrorItem INSTANCE = new ErrorItem();
+
+ private ErrorItem() { }
+
+ public static ErrorItem getInstance() {
+ return INSTANCE;
+ }
+
+ public void registerItem() {
+ super.setHasSubtypes(false);
+ final String unlocalizedName = "kekztech_error_item";
+ super.setUnlocalizedName(unlocalizedName);
+ super.setCreativeTab(CreativeTabs.tabMisc);
+ super.setMaxStackSize(64);
+ super.setTextureName(KekzCore.MODID + ":" + "Error");
+ GameRegistry.registerItem(getInstance(), unlocalizedName);
+ }
+
+ @SuppressWarnings({"unchecked"})
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean b) {
+ list.add("REMINDER: KekzTech recipes are only tested to work in GTNH!");
+ list.add("Placeholder item in case something went wrong");
+ list.add("If this item shows up in GTNH, you may report it to:");
+ list.add("https://github.com/kekzdealer/KekzTech");
+ }
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player) {
+ player.swingItem();
+ return item;
+ }
+
+}
diff --git a/src/main/java/common/items/MetaItem_CraftingComponent.java b/src/main/java/common/items/MetaItem_CraftingComponent.java
new file mode 100644
index 0000000000..ca1c3dee7b
--- /dev/null
+++ b/src/main/java/common/items/MetaItem_CraftingComponent.java
@@ -0,0 +1,101 @@
+package common.items;
+
+import java.util.List;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import kekztech.KekzCore;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+
+public class MetaItem_CraftingComponent extends Item {
+
+ private static final MetaItem_CraftingComponent INSTANCE = new MetaItem_CraftingComponent();
+ private final IIcon[] icons = new IIcon[16];
+
+ private MetaItem_CraftingComponent() { }
+
+ public static MetaItem_CraftingComponent getInstance() {
+ return INSTANCE;
+ }
+
+ public void registerItem() {
+ super.setHasSubtypes(true);
+ final String unlocalizedName = "kekztech_crafting_item";
+ super.setUnlocalizedName(unlocalizedName);
+ super.setCreativeTab(CreativeTabs.tabMisc);
+ super.setMaxStackSize(64);
+ GameRegistry.registerItem(getInstance(), unlocalizedName);
+ }
+
+ @Override
+ public void registerIcons(IIconRegister reg) {
+ int counter = 9;
+ // Raw heat pipes
+ /*icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + "CopperHeatPipe");
+ icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + "SilverHeatPipe");
+ icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + "BoronArsenideHeatPipe");
+ icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + "DiamondHeatPipe");
+ // Dust
+ icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + "BoronArsenideDust");
+ icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + "IsotopicallyPureDiamondDust");
+ icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + "AmineCarbamateDust");
+ // Crystal
+ icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + "BoronArsenideCrystal");
+ icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + "IsotopicallyPureDiamondCrystal");*/
+ // Ceramics
+ icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + "YSZCeramicDust");
+ icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + "GDCCeramicDust");
+ icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + "YttriaDust");
+ icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + "ZirconiaDust");
+ icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + "CeriaDust");
+ icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + "YSZCeramicPlate");
+ icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + "GDCCeramicPlate");
+ }
+
+ @Override
+ public IIcon getIconFromDamage(int meta) {
+ return icons[meta];
+ }
+
+ @SuppressWarnings({"unchecked"})
+ @Override
+ public void getSubItems(Item item, CreativeTabs tab, List list) {
+ for(int i = 9; i < icons.length; i++) {
+ list.add(new ItemStack(item, 1, i));
+ }
+ }
+
+ @Override
+ public String getUnlocalizedName(ItemStack stack) {
+ return super.getUnlocalizedName() + "." + stack.getItemDamage();
+ }
+
+ @SuppressWarnings({"unchecked"})
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean b) {
+ list.add("Crafting component for KekzTech things");
+ }
+
+ @Override
+ public double getDurabilityForDisplay(ItemStack stack) {
+ return 0.0d;
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return false;
+ }
+
+ public ItemStack getStackFromDamage(int meta) {
+ return new ItemStack(getInstance(), 1, meta);
+ }
+
+ public ItemStack getStackOfAmountFromDamage(int meta, int amount) {
+ return new ItemStack(getInstance(), amount, meta);
+ }
+
+}
diff --git a/src/main/java/common/items/MetaItem_ReactorComponent.java b/src/main/java/common/items/MetaItem_ReactorComponent.java
new file mode 100644
index 0000000000..9d364e7585
--- /dev/null
+++ b/src/main/java/common/items/MetaItem_ReactorComponent.java
@@ -0,0 +1,142 @@
+package common.items;
+
+import java.util.List;
+
+import org.lwjgl.input.Keyboard;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import kekztech.KekzCore;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.IIcon;
+import reactor.items.CoolantCell;
+import reactor.items.FuelRod;
+import reactor.items.HeatExchanger;
+import reactor.items.HeatVent;
+import reactor.items.NeutronReflector;
+
+public class MetaItem_ReactorComponent extends Item {
+
+ private static final MetaItem_ReactorComponent INSTANCE = new MetaItem_ReactorComponent();
+ private final IIcon[] icons = new IIcon[50];
+
+ private MetaItem_ReactorComponent() { }
+
+ public static MetaItem_ReactorComponent getInstance() {
+ return INSTANCE;
+ }
+
+ public void registerItem() {
+ super.setHasSubtypes(true);
+ final String unlocalizedName = "kekztech_reactor_item";
+ super.setUnlocalizedName(unlocalizedName);
+ super.setCreativeTab(CreativeTabs.tabMisc);
+ super.setMaxStackSize(1);
+ //GameRegistry.registerItem(getInstance(), unlocalizedName);
+ }
+
+ @Override
+ public void registerIcons(IIconRegister reg) {
+ int counter = 0;
+ for(String s : HeatVent.RESOURCE_NAMES) {
+ icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + s);
+ }
+ for(String s : HeatExchanger.RESOURCE_NAME) {
+ icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + s);
+ }
+ for(String s : FuelRod.RESOURCE_NAME) {
+ icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + s);
+ }
+ for(String s : FuelRod.RESOURCE_NAME_DEPLETED) {
+ icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + s);
+ }
+ for(String s : NeutronReflector.RESOURCE_NAME) {
+ icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + s);
+ }
+ for(String s : CoolantCell.RESOURCE_NAME) {
+ icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + s);
+ }
+ }
+
+ @Override
+ public IIcon getIconFromDamage(int meta) {
+ return icons[meta];
+ }
+
+ @SuppressWarnings({"unchecked"})
+ @Override
+ public void getSubItems(Item item, CreativeTabs tab, List list) {
+ for(int i = 0; i < icons.length; i++) {
+ list.add(new ItemStack(item, 1, i));
+ }
+ }
+
+ @Override
+ public String getUnlocalizedName(ItemStack stack) {
+ return super.getUnlocalizedName() + "." + stack.getItemDamage();
+ }
+
+ @SuppressWarnings({"unchecked"})
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean b) {
+ if(Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
+ list.add("Property = 1");
+ } else {
+ list.add("Part for the Modular Nuclear Reactor");
+ list.add("Hold " + EnumChatFormatting.BOLD + "[LSHIFT]" + EnumChatFormatting.RESET + EnumChatFormatting.GRAY + " to display properties");
+ }
+ }
+
+ @Override
+ public double getDurabilityForDisplay(ItemStack stack) {
+ NBTTagCompound nbt = (stack.getTagCompound() == null) ? new NBTTagCompound() : stack.getTagCompound();
+ if(nbt.getInteger("HEALTH") != 0 && nbt.getInteger("MAXHEALTH") != 0) {
+ return 1 - (double) (nbt.getInteger("HEALTH") / nbt.getInteger("MAXHEALTH"));
+ } else {
+ return 0.0d;
+ }
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ final int meta = stack.getItemDamage();
+ return meta < 31 || meta > 45;
+ }
+
+ public ItemStack getStackFromDamage(int meta) {
+ return new ItemStack(getInstance(), 1, meta);
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
diff --git a/src/main/java/common/reactorItem/AbstractReactorItem.java b/src/main/java/common/reactorItem/AbstractReactorItem.java
new file mode 100644
index 0000000000..e78889b57f
--- /dev/null
+++ b/src/main/java/common/reactorItem/AbstractReactorItem.java
@@ -0,0 +1,29 @@
+package common.reactorItem;
+
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+
+public abstract class AbstractReactorItem extends Item {
+
+ private final int[] behaviourID;
+
+ protected AbstractReactorItem(int...behaviourID) {
+ this.behaviourID = behaviourID;
+ }
+
+ @Override
+ public abstract double getDurabilityForDisplay(ItemStack stack);
+
+ @Override
+ public abstract boolean showDurabilityBar(ItemStack stack);
+
+ @Override
+ public final String getUnlocalizedName(ItemStack stack) {
+ return super.hasSubtypes ? (super.getUnlocalizedName() + "." + stack.getItemDamage())
+ : super.getUnlocalizedName();
+ }
+
+ public final int getBehaviourID(int meta) {
+ return behaviourID[meta];
+ }
+}
diff --git a/src/main/java/common/reactorItem/ReactorItem.java b/src/main/java/common/reactorItem/ReactorItem.java
new file mode 100644
index 0000000000..e8dfbef21e
--- /dev/null
+++ b/src/main/java/common/reactorItem/ReactorItem.java
@@ -0,0 +1,48 @@
+package common.reactorItem;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+
+public class ReactorItem extends AbstractReactorItem {
+
+ private static final ReactorItem INSTANCE = new ReactorItem();
+
+ private final IIcon[] icons = new IIcon[50];
+
+ private ReactorItem() {
+ super();
+ }
+
+ public static ReactorItem registerItem() {
+ INSTANCE.setHasSubtypes(true);
+ INSTANCE.setCreativeTab(CreativeTabs.tabMisc);
+ INSTANCE.setMaxStackSize(1);
+ final String unloc = "kekztech_reactor_item";
+ INSTANCE.setUnlocalizedName(unloc);
+ GameRegistry.registerItem(INSTANCE, unloc);
+ return INSTANCE;
+ }
+
+ @Override
+ public void registerIcons(IIconRegister reg) {
+
+ }
+
+ @Override
+ public IIcon getIconFromDamage(int meta) {
+ return icons[meta];
+ }
+
+ @Override
+ public double getDurabilityForDisplay(ItemStack stack) {
+ return 0;
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack) {
+ return false;
+ }
+}
diff --git a/src/main/java/common/tileentities/GTMTE_FluidMultiStorage.java b/src/main/java/common/tileentities/GTMTE_FluidMultiStorage.java
index 1c32525c4e..a12f4130cb 100644
--- a/src/main/java/common/tileentities/GTMTE_FluidMultiStorage.java
+++ b/src/main/java/common/tileentities/GTMTE_FluidMultiStorage.java
@@ -1,531 +1,534 @@
-package common.tileentities;
-
-import gregtech.api.enums.Textures.BlockIcons;
-import gregtech.api.gui.GT_GUIContainer_MultiMachine;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
-import gregtech.api.objects.GT_RenderedTexture;
-import kekztech.MultiFluidHandler;
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.ChatComponentText;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
-import org.lwjgl.input.Keyboard;
-
-import common.Blocks;
-import common.blocks.*;
-import util.MultiBlockTooltipBuilder;
-import util.Vector3i;
-import util.Vector3ic;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-
-public class GTMTE_FluidMultiStorage extends GT_MetaTileEntity_MultiBlockBase {
-
- private final static String glassNameIC2Reinforced = "blockAlloyGlass";
- private final static Block CASING = Blocks.tfftCasing;
- private final static Block_TFFTStorageFieldBlockT1 STORAGE_FIELD1 = (Block_TFFTStorageFieldBlockT1) Blocks.tfftStorageField1;
- private final static Block_TFFTStorageFieldBlockT2 STORAGE_FIELD2 = (Block_TFFTStorageFieldBlockT2) Blocks.tfftStorageField2;
- private final static Block_TFFTStorageFieldBlockT3 STORAGE_FIELD3 = (Block_TFFTStorageFieldBlockT3) Blocks.tfftStorageField3;
- private final static Block_TFFTStorageFieldBlockT4 STORAGE_FIELD4 = (Block_TFFTStorageFieldBlockT4) Blocks.tfftStorageField4;
- private final static Block_TFFTStorageFieldBlockT5 STORAGE_FIELD5 = (Block_TFFTStorageFieldBlockT5) Blocks.tfftStorageField5;
- private final static Block MULTI_HATCH = Blocks.tfftMultiHatch;
- private final static int CASING_TEXTURE_ID = 176;
-
- private MultiFluidHandler mfh;
- private HashSet<TE_TFFTMultiHatch> multiHatches = new HashSet<>();
-
- private int runningCost = 0;
- private boolean doVoidExcess = false;
- private byte fluidSelector = 0;
-
- public GTMTE_FluidMultiStorage(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GTMTE_FluidMultiStorage(String aName) {
- super(aName);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity var1) {
- return new GTMTE_FluidMultiStorage(super.mName);
- }
-
- @Override
- public String[] getDescription() {
- final MultiBlockTooltipBuilder b = new MultiBlockTooltipBuilder();
- b.addInfo("High-Tech fluid tank that can hold up to 25 different fluids!")
- .addInfo("Has 1/25th of the total capacity as capacity for each fluid.")
- .addInfo("Right clicking the controller with a screwdriver will turn on excess voiding.")
- .addInfo("Fluid storage amount and running cost depends on the storage field blocks used.")
- .addSeparator()
- .addInfo("Note on hatch locking:")
- .addInfo("Use an Integrated Circuit in the GUI slot to limit which fluid is output.")
- .addInfo("The index of a stored fluid can be obtained through the Tricorder.")
- .addSeparator()
- .beginStructureBlock(5, 9, 5)
- .addController("Top Center")
- .addEnergyHatch("Any top or bottom casing")
- .addOtherStructurePart("Inner 3x7x3 solid pillar", "Storage Field Blocks")
- .addOtherStructurePart("Outer 5x7x5 glass shell", "IC2 Reinforced Glass")
- .addMaintenanceHatch("Any top or bottom casing")
- .addIOHatches("Instead of any casing or glass, have to touch storage field.")
- .signAndFinalize("Kekzdealer");
- if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
- return b.getInformation();
- } else {
- return b.getStructureInformation();
- }
- }
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
- boolean aActive, boolean aRedstone) {
- return aSide == aFacing
- ? new ITexture[]{BlockIcons.casingTexturePages[1][48],
- new GT_RenderedTexture(aActive
- ? BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE
- : BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR)}
- : new ITexture[]{BlockIcons.casingTexturePages[1][48]};
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(),
- "MultiblockDisplay.png");
- }
-
- @Override
- public boolean isCorrectMachinePart(ItemStack var1) {
- return true;
- }
-
- @Override
- public boolean checkRecipe(ItemStack guiSlotItem) {
-
- super.mEfficiency = 10000 - (super.getIdealStatus() - super.getRepairStatus()) * 1000;
- super.mEfficiencyIncrease = 10000;
- super.mEUt = runningCost;
- super.mMaxProgresstime = 10;
-
- if(guiSlotItem != null && guiSlotItem.getUnlocalizedName().equals("gt.integrated_circuit")) {
- this.fluidSelector = (byte) guiSlotItem.getItemDamage();
- }
-
- // If there are no basic I/O hatches, let multi hatches handle it and skip a lot of code!
- if (multiHatches.size() > 0 && super.mInputHatches.size() == 0 && super.mOutputHatches.size() == 0) {
- return true;
- }
-
- // Suck in fluids
- final ArrayList<FluidStack> inputHatchFluids = super.getStoredFluids();
- if (inputHatchFluids.size() > 0) {
-
- for (FluidStack fluidStack : inputHatchFluids) {
-
- final int pushed = mfh.pushFluid(fluidStack, true);
- final FluidStack toDeplete = fluidStack.copy();
- toDeplete.amount = pushed;
- super.depleteInput(toDeplete);
- }
- }
-
- // Push out fluids
- if (guiSlotItem != null && guiSlotItem.getUnlocalizedName().equals("gt.integrated_circuit")) {
- final FluidStack storedFluid = mfh.getFluid(fluidSelector);
- // Sum available output capacity
- int possibleOutput = 0;
- for (GT_MetaTileEntity_Hatch_Output outputHatch : super.mOutputHatches) {
- if (outputHatch.isFluidLocked() && outputHatch.getLockedFluidName().equals(storedFluid.getUnlocalizedName())) {
- possibleOutput += outputHatch.getCapacity() - outputHatch.getFluidAmount();
- } else if (outputHatch.getFluid() != null && outputHatch.getFluid().getUnlocalizedName().equals(storedFluid.getUnlocalizedName())) {
- possibleOutput += outputHatch.getCapacity() - outputHatch.getFluidAmount();
- } else if (outputHatch.getFluid() == null) {
- possibleOutput += outputHatch.getCapacity() - outputHatch.getFluidAmount();
- }
- }
- // Output as much as possible
- final FluidStack tempStack = storedFluid.copy();
- tempStack.amount = possibleOutput;
- tempStack.amount = mfh.pullFluid(tempStack, fluidSelector, true);
- super.addOutput(tempStack);
-
- } else {
- for (FluidStack storedFluid : mfh.getFluids()) {
- // Sum available output capacity
- int possibleOutput = 0;
- for (GT_MetaTileEntity_Hatch_Output outputHatch : super.mOutputHatches) {
- if (outputHatch.isFluidLocked() && outputHatch.getLockedFluidName().equals(storedFluid.getUnlocalizedName())) {
- possibleOutput += outputHatch.getCapacity() - outputHatch.getFluidAmount();
- } else if (outputHatch.getFluid() != null && outputHatch.getFluid().getUnlocalizedName().equals(storedFluid.getUnlocalizedName())) {
- possibleOutput += outputHatch.getCapacity() - outputHatch.getFluidAmount();
- } else if (outputHatch.getFluid() == null) {
- possibleOutput += outputHatch.getCapacity() - outputHatch.getFluidAmount();
- }
- }
- // output as much as possible
- final FluidStack tempStack = storedFluid.copy();
- tempStack.amount = possibleOutput;
- // TODO possible concurrent modification exception as pullFluid calls remove() without an iterator
- tempStack.amount = mfh.pullFluid(tempStack, true);
- super.addOutput(tempStack);
- }
- }
-
- return true;
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
-
- if (mfh != null) {
- mfh.setLock(!super.getBaseMetaTileEntity().isActive());
- mfh.setFluidSelector(fluidSelector);
- mfh.setDoVoidExcess(doVoidExcess);
- }
- }
-
- public Vector3ic rotateOffsetVector(Vector3ic forgeDirection, int x, int y, int z) {
- final Vector3i offset = new Vector3i();
-
- // either direction on z-axis
- if (forgeDirection.x() == 0 && forgeDirection.z() == -1) {
- offset.x = x;
- offset.y = y;
- offset.z = z;
- }
- if (forgeDirection.x() == 0 && forgeDirection.z() == 1) {
- offset.x = -x;
- offset.y = y;
- offset.z = -z;
- }
- // either direction on x-axis
- if (forgeDirection.x() == -1 && forgeDirection.z() == 0) {
- offset.x = z;
- offset.y = y;
- offset.z = -x;
- }
- if (forgeDirection.x() == 1 && forgeDirection.z() == 0) {
- offset.x = -z;
- offset.y = y;
- offset.z = x;
- }
- // either direction on y-axis
- if (forgeDirection.y() == -1) {
- offset.x = x;
- offset.y = z;
- offset.z = y;
- }
-
- return offset;
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity thisController, ItemStack guiSlotItem) {
- // Figure out the vector for the direction the back face of the controller is facing
- final Vector3ic forgeDirection = new Vector3i(
- ForgeDirection.getOrientation(thisController.getBackFacing()).offsetX,
- ForgeDirection.getOrientation(thisController.getBackFacing()).offsetY,
- ForgeDirection.getOrientation(thisController.getBackFacing()).offsetZ
- );
- int minCasingAmount = 20;
- boolean formationChecklist = true; // If this is still true at the end, machine is good to go :)
- float runningCostAcc = 0;
- double fluidCapacityAcc = 0;
-
- multiHatches.clear();
-
- // Front segment
- for (int X = -2; X <= 2; X++) {
- for (int Y = -2; Y <= 2; Y++) {
- if (X == 0 && Y == 0) {
- continue; // Skip controller
- }
-
- // Get next TE
- final Vector3ic offset = rotateOffsetVector(forgeDirection, X, Y, 0);
- final IGregTechTileEntity currentTE =
- thisController.getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z());
-
- // Fluid hatches should touch the storage field.
- // Maintenance/Energy hatch can go anywhere
- if (X > -2 && X < 2 && Y > -2 && Y < 2) {
- if (!super.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID)
- && !super.addInputToMachineList(currentTE, CASING_TEXTURE_ID)
- && !super.addOutputToMachineList(currentTE, CASING_TEXTURE_ID)
- && !super.addEnergyInputToMachineList(currentTE, CASING_TEXTURE_ID)) {
-
- final Block b = thisController.getBlockOffset(offset.x(), offset.y(), offset.z());
-
- // If it's not a hatch, is it the right casing for this machine? Check block and block meta.
- // Also check for multi hatch
- if (b == CASING) {
- // Seems to be valid casing. Decrement counter.
- minCasingAmount--;
- } else if (b == MULTI_HATCH) {
- final TE_TFFTMultiHatch mh =
- (TE_TFFTMultiHatch) thisController.getWorld().getTileEntity(
- thisController.getXCoord() + offset.x(),
- thisController.getYCoord() + offset.y(),
- thisController.getZCoord() + offset.z());
- multiHatches.add(mh);
- } else {
- formationChecklist = false;
- }
- }
- } else {
- if (!super.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID)
- && !super.addEnergyInputToMachineList(currentTE, CASING_TEXTURE_ID)) {
-
- // If it's not a hatch, is it the right casing for this machine? Check block and block meta.
- if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CASING) {
- // Seems to be valid casing. Decrement counter.
- minCasingAmount--;
- } else {
- formationChecklist = false;
- }
- }
- }
- }
- }
-
- // Middle seven long segment
- for (int X = -2; X <= 2; X++) {
- for (int Y = -2; Y <= 2; Y++) {
- for (int Z = -1; Z >= -7; Z--) {
- final Vector3ic offset = rotateOffsetVector(forgeDirection, X, Y, Z);
- if (X > -2 && X < 2 && Y > -2 && Y < 2) {
- if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName()
- .equals(STORAGE_FIELD1.getUnlocalizedName())) {
- runningCostAcc += 0.5f;
- fluidCapacityAcc += (float) Block_TFFTStorageFieldBlockT1.getCapacity();
- } else if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName()
- .equals(STORAGE_FIELD2.getUnlocalizedName())) {
- runningCostAcc += 1.0f;
- fluidCapacityAcc += (float) Block_TFFTStorageFieldBlockT2.getCapacity();
- } else if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName()
- .equals(STORAGE_FIELD3.getUnlocalizedName())) {
- runningCostAcc += 2.0f;
- fluidCapacityAcc += (float) Block_TFFTStorageFieldBlockT3.getCapacity();
- } else if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName()
- .equals(STORAGE_FIELD4.getUnlocalizedName())) {
- runningCostAcc += 4.0f;
- fluidCapacityAcc += (float) Block_TFFTStorageFieldBlockT4.getCapacity();
- } else if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName()
- .equals(STORAGE_FIELD5.getUnlocalizedName())) {
- runningCostAcc += 8.0f;
- fluidCapacityAcc += (float) Block_TFFTStorageFieldBlockT5.getCapacity();
- } else {
- formationChecklist = false;
- }
- continue;
- }
-
- // Get next TE
- final IGregTechTileEntity currentTE =
- thisController.getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z());
-
- // Corner allows only glass
- if (X == -2 && Y == -2 || X == 2 && Y == 2 || X == -2 && Y == 2 || X == 2 && Y == -2) {
- if (!(thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName().equals(glassNameIC2Reinforced))) {
- formationChecklist = false;
- }
- } else {
- // Tries to add TE as either of those kinds of hatches.
- // The number is the texture index number for the texture that needs to be painted over the hatch texture (TAE for GT++)
- if (!super.addInputToMachineList(currentTE, CASING_TEXTURE_ID)
- && !super.addOutputToMachineList(currentTE, CASING_TEXTURE_ID)) {
-
- // If it's not a hatch, is it the right casing for this machine? Check block and block meta.
- // Also check for multi hatch
- if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CASING) {
- // Seems to be valid casing. Decrement counter.
- minCasingAmount--;
- } else if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == MULTI_HATCH) {
- final TE_TFFTMultiHatch mh =
- (TE_TFFTMultiHatch) thisController.getWorld().getTileEntity(
- thisController.getXCoord() + offset.x(),
- thisController.getYCoord() + offset.y(),
- thisController.getZCoord() + offset.z());
- multiHatches.add(mh);
- } else if (!thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName().equals(glassNameIC2Reinforced)) {
- formationChecklist = false;
- }
- }
- }
- }
- }
- }
-
- // Back segment
- for (int X = -2; X <= 2; X++) {
- for (int Y = -2; Y <= 2; Y++) {
- // Get next TE
- final Vector3ic offset = rotateOffsetVector(forgeDirection, X, Y, -8);
- final IGregTechTileEntity currentTE =
- thisController.getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z());
-
- // Fluid hatches should touch the storage field.
- // Maintenance/Energy hatch can go anywhere
- if (X > -2 && X < 2 && Y > -2 && Y < 2) {
- if (!super.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID)
- && !super.addInputToMachineList(currentTE, CASING_TEXTURE_ID)
- && !super.addOutputToMachineList(currentTE, CASING_TEXTURE_ID)
- && !super.addEnergyInputToMachineList(currentTE, CASING_TEXTURE_ID)) {
-
- // If it's not a hatch, is it the right casing for this machine? Check block and block meta.
- if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CASING) {
- // Seems to be valid casing. Decrement counter.
- minCasingAmount--;
- } else if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == MULTI_HATCH) {
- final TE_TFFTMultiHatch mh =
- (TE_TFFTMultiHatch) thisController.getWorld().getTileEntity(
- thisController.getXCoord() + offset.x(),
- thisController.getYCoord() + offset.y(),
- thisController.getZCoord() + offset.z());
- multiHatches.add(mh);
- } else {
- formationChecklist = false;
- }
- }
- } else {
- if (!super.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID)
- && !super.addEnergyInputToMachineList(currentTE, CASING_TEXTURE_ID)) {
-
- // If it's not a hatch, is it the right casing for this machine? Check block and block meta.
- if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CASING) {
- // Seems to be valid casing. Decrement counter.
- minCasingAmount--;
- } else {
- formationChecklist = false;
- }
- }
- }
- }
- }
-
- if (this.mEnergyHatches.size() < 1) {
- formationChecklist = false;
- }
-
- if (this.mMaintenanceHatches.size() < 1) {
- formationChecklist = false;
- }
-
- if (minCasingAmount > 0) {
- formationChecklist = false;
- }
-
- if (formationChecklist) {
- runningCost = Math.round(-runningCostAcc);
- // Update MultiFluidHandler in case storage cells have been changed
- final int capacityPerFluid = (int) Math.round(fluidCapacityAcc / 25.0f);
- if (mfh == null) {
- mfh = new MultiFluidHandler(capacityPerFluid);
- } else {
- if (mfh.getCapacity() != capacityPerFluid) {
- mfh = new MultiFluidHandler(capacityPerFluid, mfh.getFluids());
- }
- }
- for (TE_TFFTMultiHatch mh : multiHatches) {
- mh.setMultiFluidHandler(mfh);
- }
- }
-
- return formationChecklist;
- }
-
- @Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (doVoidExcess) {
- doVoidExcess = false;
- aPlayer.addChatComponentMessage(new ChatComponentText("Auto-voiding turned off"));
- } else {
- doVoidExcess = true;
- aPlayer.addChatComponentMessage(new ChatComponentText("Auto-voiding turned on"));
- }
- }
-
- @Override
- public String[] getInfoData() {
- final ArrayList<String> ll = mfh.getInfoData();
-
- ll.add(EnumChatFormatting.YELLOW + "Operational Data:" + EnumChatFormatting.RESET);
- ll.add("Auto-voiding: " + doVoidExcess);
- ll.add("Per-Fluid Capacity: " + mfh.getCapacity() + "L");
- ll.add("Running Cost: "
- // mEUt does not naturally reflect efficiency status. Do that here.
- + ((-super.mEUt) * 10000 / Math.max(1000, super.mEfficiency)) + "EU/t");
- ll.add("Maintenance Status: " + ((super.getRepairStatus() == super.getIdealStatus())
- ? EnumChatFormatting.GREEN + "Working perfectly" + EnumChatFormatting.RESET
- : EnumChatFormatting.RED + "Has Problems" + EnumChatFormatting.RESET));
- ll.add("---------------------------------------------");
-
- final String[] a = new String[ll.size()];
- return ll.toArray(a);
- }
-
- @Override
- public void saveNBTData(NBTTagCompound nbt) {
- nbt = (nbt == null) ? new NBTTagCompound() : nbt;
-
- nbt.setInteger("runningCost", runningCost);
- nbt.setBoolean("doVoidExcess", doVoidExcess);
-
- nbt.setInteger("capacityPerFluid", mfh.getCapacity());
- nbt.setTag("fluids", mfh.saveNBTData(new NBTTagCompound()));
-
- super.saveNBTData(nbt);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound nbt) {
- nbt = (nbt == null) ? new NBTTagCompound() : nbt;
-
- runningCost = nbt.getInteger("runningCost");
- doVoidExcess = nbt.getBoolean("doVoidExcess");
-
- mfh = new MultiFluidHandler();
- mfh.loadNBTData(nbt);
- for (TE_TFFTMultiHatch mh : multiHatches) {
- mh.setMultiFluidHandler(mfh);
- }
- super.loadNBTData(nbt);
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public int getMaxEfficiency(ItemStack var1) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerTick(ItemStack var1) {
- return 0;
- }
-
- @Override
- public int getDamageToComponent(ItemStack var1) {
- return 0;
- }
-
- @Override
- public boolean explodesOnComponentBreak(ItemStack var1) {
- return false;
- }
+package common.tileentities;
+
+import common.Blocks;
+import common.blocks.*;
+import gregtech.api.enums.Textures.BlockIcons;
+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.*;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
+import gregtech.api.util.GT_Utility;
+import kekztech.MultiFluidHandler;
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.ChatComponentText;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+import org.lwjgl.input.Keyboard;
+import util.Vector3i;
+import util.Vector3ic;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+
+public class GTMTE_FluidMultiStorage extends GT_MetaTileEntity_MultiBlockBase {
+
+ private final static String glassNameIC2Reinforced = "blockAlloyGlass";
+ private final static Block CASING = Blocks.tfftCasing;
+ private final static Block_TFFTStorageFieldBlockT1 STORAGE_FIELD1 = (Block_TFFTStorageFieldBlockT1) Blocks.tfftStorageField1;
+ private final static Block_TFFTStorageFieldBlockT2 STORAGE_FIELD2 = (Block_TFFTStorageFieldBlockT2) Blocks.tfftStorageField2;
+ private final static Block_TFFTStorageFieldBlockT3 STORAGE_FIELD3 = (Block_TFFTStorageFieldBlockT3) Blocks.tfftStorageField3;
+ private final static Block_TFFTStorageFieldBlockT4 STORAGE_FIELD4 = (Block_TFFTStorageFieldBlockT4) Blocks.tfftStorageField4;
+ private final static Block_TFFTStorageFieldBlockT5 STORAGE_FIELD5 = (Block_TFFTStorageFieldBlockT5) Blocks.tfftStorageField5;
+ private final static int CASING_TEXTURE_ID = 176;
+
+ private MultiFluidHandler mfh;
+ private final HashSet<GTMTE_TFFTMultiHatch> sMultiHatches = new HashSet<>();
+
+ private int runningCost = 0;
+ private boolean doVoidExcess = false;
+ private byte fluidSelector = 0;
+
+ public GTMTE_FluidMultiStorage(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GTMTE_FluidMultiStorage(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity var1) {
+ return new GTMTE_FluidMultiStorage(super.mName);
+ }
+
+ @Override
+ public String[] getDescription() {
+ final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType("Fluid Tank")
+ .addInfo("High-Tech fluid tank that can hold up to 25 different fluids!")
+ .addInfo("Has 1/25th of the total capacity as capacity for each fluid.")
+ .addInfo("Right clicking the controller with a screwdriver will turn on excess voiding.")
+ .addInfo("Fluid storage amount and running cost depends on the storage field blocks used.")
+ .addSeparator()
+ .addInfo("Note on hatch locking:")
+ .addInfo("Use an Integrated Circuit in the GUI slot to limit which fluid is output.")
+ .addInfo("The index of a stored fluid can be obtained through the Tricorder.")
+ .addSeparator()
+ .beginStructureBlock(5, 9, 5, false)
+ .addController("Top Center")
+ .addCasingInfo("T.F.F.T. Casing", 20)
+ .addOtherStructurePart("Storage Field Blocks (Tier I-V)", "Inner 3x7x3 solid pillar")
+ .addOtherStructurePart("IC2 Reinforced Glass", "Outer 5x7x5 glass shell")
+ .addMaintenanceHatch("Any top or bottom casing")
+ .addEnergyHatch("Any top or bottom casing")
+ .addInputHatch("Instead of any casing or glass, has to touch storage field block")
+ .addOutputHatch("Instead of any casing or glass, has to touch storage field block")
+ .addStructureInfo("You can have a bunch of hatches")
+ .addOtherStructurePart("Multi I/O Hatches", "Instead of any casing or glass, has to touch storage field block")
+ .addStructureInfo("Use MIOH with conduits or fluid storage busses to see all fluids at once. If it's fixed.")
+ .addStructureInfo("Ask someone else why there's 4 versions, with 2 uncraftable ones")
+ .toolTipFinisher("KekzTech");
+ if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
+ return tt.getInformation();
+ } else {
+ return tt.getStructureInformation();
+ }
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ boolean aActive, boolean aRedstone) {
+ return aSide == aFacing
+ ? new ITexture[]{BlockIcons.casingTexturePages[1][48],
+ new GT_RenderedTexture(aActive
+ ? BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE
+ : BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR)}
+ : new ITexture[]{BlockIcons.casingTexturePages[1][48]};
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(),
+ "MultiblockDisplay.png");
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack var1) {
+ return true;
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack guiSlotItem) {
+
+ super.mEfficiency = 10000 - (super.getIdealStatus() - super.getRepairStatus()) * 1000;
+ super.mEfficiencyIncrease = 10000;
+ super.mEUt = runningCost;
+ super.mMaxProgresstime = 10;
+
+ if(guiSlotItem != null && guiSlotItem.getUnlocalizedName().equals("gt.integrated_circuit")) {
+ this.fluidSelector = (byte) guiSlotItem.getItemDamage();
+ }
+
+ // If there are no basic I/O hatches, let multi hatches handle it and skip a lot of code!
+ if (sMultiHatches.size() > 0 && super.mInputHatches.size() == 0 && super.mOutputHatches.size() == 0) {
+ return true;
+ }
+
+ // Suck in fluids
+ final ArrayList<FluidStack> inputHatchFluids = super.getStoredFluids();
+ if (inputHatchFluids.size() > 0) {
+
+ for (FluidStack fluidStack : inputHatchFluids) {
+
+ final int pushed = mfh.pushFluid(fluidStack, true);
+ final FluidStack toDeplete = fluidStack.copy();
+ toDeplete.amount = pushed;
+ super.depleteInput(toDeplete);
+ }
+ }
+
+ // Push out fluids
+ if (guiSlotItem != null && guiSlotItem.getUnlocalizedName().equals("gt.integrated_circuit")) {
+ final FluidStack storedFluid = mfh.getFluidCopy(fluidSelector);
+ // Sum available output capacity
+ int possibleOutput = 0;
+ for (GT_MetaTileEntity_Hatch_Output outputHatch : super.mOutputHatches) {
+ if (outputHatch.isFluidLocked() && outputHatch.getLockedFluidName().equals(storedFluid.getUnlocalizedName())) {
+ possibleOutput += outputHatch.getCapacity() - outputHatch.getFluidAmount();
+ } else if (outputHatch.getFluid() != null && outputHatch.getFluid().getUnlocalizedName().equals(storedFluid.getUnlocalizedName())) {
+ possibleOutput += outputHatch.getCapacity() - outputHatch.getFluidAmount();
+ } else if (outputHatch.getFluid() == null) {
+ possibleOutput += outputHatch.getCapacity() - outputHatch.getFluidAmount();
+ }
+ }
+ // Output as much as possible
+ final FluidStack tempStack = storedFluid.copy();
+ tempStack.amount = possibleOutput;
+ tempStack.amount = mfh.pullFluid(tempStack, fluidSelector, true);
+ super.addOutput(tempStack);
+
+ } else {
+ int tDistinct = mfh.getDistinctFluids();
+ int tDistinctCount = 0;
+ int tMaxDistinct = mfh.getMaxDistinctFluids();
+ for(int i = 0; i < tMaxDistinct && tDistinctCount< tDistinct;i++) {
+ final FluidStack storedFluidCopy = mfh.getFluidCopy(i);
+ if (storedFluidCopy == null)
+ continue;
+ tDistinctCount++;
+ storedFluidCopy.amount = 0;
+ // Calculate how much capacity all available Output Hatches offer
+ for (GT_MetaTileEntity_Hatch_Output outputHatch : super.mOutputHatches) {
+ if (outputHatch.isFluidLocked() && outputHatch.getLockedFluidName().equals(storedFluidCopy.getUnlocalizedName())) {
+ storedFluidCopy.amount += outputHatch.getCapacity() - outputHatch.getFluidAmount();
+ addFluidToHatch(storedFluidCopy,outputHatch);
+ } else if (outputHatch.getFluid() != null && outputHatch.getFluid().isFluidEqual(storedFluidCopy)) {
+ storedFluidCopy.amount += outputHatch.getCapacity() - outputHatch.getFluidAmount();
+ addFluidToHatch(storedFluidCopy,outputHatch);
+ } else if (!outputHatch.isFluidLocked() && outputHatch.getFluid() == null) {
+ storedFluidCopy.amount += outputHatch.getCapacity() - outputHatch.getFluidAmount();
+ addFluidToHatch(storedFluidCopy,outputHatch);
+ }
+ }
+ }
+ }
+
+ return true;
+ }
+
+ public void addFluidToHatch(FluidStack aFluid, GT_MetaTileEntity_Hatch_Output aHatch) {
+ aFluid.amount = mfh.pullFluid(aFluid, true);
+ aHatch.fill(aFluid,true);
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+
+ if (mfh != null) {
+ mfh.setLock(!super.getBaseMetaTileEntity().isActive());
+ mfh.setFluidSelector(fluidSelector);
+ mfh.setDoVoidExcess(doVoidExcess);
+ }
+ }
+
+ public Vector3ic rotateOffsetVector(Vector3ic forgeDirection, int x, int y, int z) {
+ final Vector3i offset = new Vector3i();
+
+ // either direction on z-axis
+ if (forgeDirection.x() == 0 && forgeDirection.z() == -1) {
+ offset.x = x;
+ offset.y = y;
+ offset.z = z;
+ }
+ if (forgeDirection.x() == 0 && forgeDirection.z() == 1) {
+ offset.x = -x;
+ offset.y = y;
+ offset.z = -z;
+ }
+ // either direction on x-axis
+ if (forgeDirection.x() == -1 && forgeDirection.z() == 0) {
+ offset.x = z;
+ offset.y = y;
+ offset.z = -x;
+ }
+ if (forgeDirection.x() == 1 && forgeDirection.z() == 0) {
+ offset.x = -z;
+ offset.y = y;
+ offset.z = x;
+ }
+ // either direction on y-axis
+ if (forgeDirection.y() == -1) {
+ offset.x = x;
+ offset.y = z;
+ offset.z = y;
+ }
+
+ return offset;
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity thisController, ItemStack guiSlotItem) {
+ // Figure out the vector for the direction the back face of the controller is facing
+ final Vector3ic forgeDirection = new Vector3i(
+ ForgeDirection.getOrientation(thisController.getBackFacing()).offsetX,
+ ForgeDirection.getOrientation(thisController.getBackFacing()).offsetY,
+ ForgeDirection.getOrientation(thisController.getBackFacing()).offsetZ
+ );
+ int minCasingAmount = 20;
+ boolean formationChecklist = true; // If this is still true at the end, machine is good to go :)
+ float runningCostAcc = 0;
+ double fluidCapacityAcc = 0;
+
+ sMultiHatches.clear();
+
+ // Front segment
+ for (int X = -2; X <= 2; X++) {
+ for (int Y = -2; Y <= 2; Y++) {
+ if (X == 0 && Y == 0) {
+ continue; // Skip controller
+ }
+
+ // Get next TE
+ final Vector3ic offset = rotateOffsetVector(forgeDirection, X, Y, 0);
+ final IGregTechTileEntity currentTE =
+ thisController.getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z());
+
+ // Fluid hatches should touch the storage field.
+ // Maintenance/Energy hatch can go anywhere
+ if (X > -2 && X < 2 && Y > -2 && Y < 2) {
+ if (!super.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID)
+ && !super.addInputToMachineList(currentTE, CASING_TEXTURE_ID)
+ && !super.addOutputToMachineList(currentTE, CASING_TEXTURE_ID)
+ && !super.addEnergyInputToMachineList(currentTE, CASING_TEXTURE_ID)
+ && !addMultiHatchToMachineList(currentTE, CASING_TEXTURE_ID)) {
+
+ // If it's not a hatch, is it the right casing for this machine? Check block and block meta.
+ // Also check for multi hatch
+ if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CASING) {
+ // Seems to be valid casing. Decrement counter.
+ minCasingAmount--;
+ } else {
+ formationChecklist = false;
+ }
+ }
+ } else {
+ if (!super.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID)
+ && !super.addEnergyInputToMachineList(currentTE, CASING_TEXTURE_ID)) {
+
+ // If it's not a hatch, is it the right casing for this machine? Check block and block meta.
+ if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CASING) {
+ // Seems to be valid casing. Decrement counter.
+ minCasingAmount--;
+ } else {
+ formationChecklist = false;
+ }
+ }
+ }
+ }
+ }
+
+ // Middle seven long segment
+ for (int X = -2; X <= 2; X++) {
+ for (int Y = -2; Y <= 2; Y++) {
+ for (int Z = -1; Z >= -7; Z--) {
+ final Vector3ic offset = rotateOffsetVector(forgeDirection, X, Y, Z);
+ if (X > -2 && X < 2 && Y > -2 && Y < 2) {
+ if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName()
+ .equals(STORAGE_FIELD1.getUnlocalizedName())) {
+ runningCostAcc += 0.5f;
+ fluidCapacityAcc += (float) Block_TFFTStorageFieldBlockT1.getCapacity();
+ } else if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName()
+ .equals(STORAGE_FIELD2.getUnlocalizedName())) {
+ runningCostAcc += 1.0f;
+ fluidCapacityAcc += (float) Block_TFFTStorageFieldBlockT2.getCapacity();
+ } else if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName()
+ .equals(STORAGE_FIELD3.getUnlocalizedName())) {
+ runningCostAcc += 2.0f;
+ fluidCapacityAcc += (float) Block_TFFTStorageFieldBlockT3.getCapacity();
+ } else if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName()
+ .equals(STORAGE_FIELD4.getUnlocalizedName())) {
+ runningCostAcc += 4.0f;
+ fluidCapacityAcc += (float) Block_TFFTStorageFieldBlockT4.getCapacity();
+ } else if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName()
+ .equals(STORAGE_FIELD5.getUnlocalizedName())) {
+ runningCostAcc += 8.0f;
+ fluidCapacityAcc += (float) Block_TFFTStorageFieldBlockT5.getCapacity();
+ } else {
+ formationChecklist = false;
+ }
+ continue;
+ }
+
+ // Get next TE
+ final IGregTechTileEntity currentTE =
+ thisController.getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z());
+
+ // Corner allows only glass
+ if (X == -2 && Y == -2 || X == 2 && Y == 2 || X == -2 && Y == 2 || X == 2 && Y == -2) {
+ if (!(thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName().equals(glassNameIC2Reinforced))) {
+ formationChecklist = false;
+ }
+ } else {
+ // Tries to add TE as either of those kinds of hatches.
+ // The number is the texture index number for the texture that needs to be painted over the hatch texture (TAE for GT++)
+ if (!super.addInputToMachineList(currentTE, CASING_TEXTURE_ID)
+ && !super.addOutputToMachineList(currentTE, CASING_TEXTURE_ID)
+ && !addMultiHatchToMachineList(currentTE, CASING_TEXTURE_ID)) {
+
+ // If it's not a hatch, is it the right casing for this machine? Check block and block meta.
+ // Also check for multi hatch
+ if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CASING) {
+ // Seems to be valid casing. Decrement counter.
+ minCasingAmount--;
+ } else if (!thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName().equals(glassNameIC2Reinforced)) {
+ formationChecklist = false;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // Back segment
+ for (int X = -2; X <= 2; X++) {
+ for (int Y = -2; Y <= 2; Y++) {
+ // Get next TE
+ final Vector3ic offset = rotateOffsetVector(forgeDirection, X, Y, -8);
+ final IGregTechTileEntity currentTE =
+ thisController.getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z());
+
+ // Fluid hatches should touch the storage field.
+ // Maintenance/Energy hatch can go anywhere
+ if (X > -2 && X < 2 && Y > -2 && Y < 2) {
+ if (!super.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID)
+ && !super.addInputToMachineList(currentTE, CASING_TEXTURE_ID)
+ && !super.addOutputToMachineList(currentTE, CASING_TEXTURE_ID)
+ && !super.addEnergyInputToMachineList(currentTE, CASING_TEXTURE_ID)
+ && !addMultiHatchToMachineList(currentTE, CASING_TEXTURE_ID)) {
+
+ // If it's not a hatch, is it the right casing for this machine? Check block and block meta.
+ if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CASING) {
+ // Seems to be valid casing. Decrement counter.
+ minCasingAmount--;
+ } else {
+ formationChecklist = false;
+ }
+ }
+ } else {
+ if (!super.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID)
+ && !super.addEnergyInputToMachineList(currentTE, CASING_TEXTURE_ID)) {
+
+ // If it's not a hatch, is it the right casing for this machine? Check block and block meta.
+ if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CASING) {
+ // Seems to be valid casing. Decrement counter.
+ minCasingAmount--;
+ } else {
+ formationChecklist = false;
+ }
+ }
+ }
+ }
+ }
+
+ if (this.mEnergyHatches.size() < 1) {
+ formationChecklist = false;
+ }
+
+ if (this.mMaintenanceHatches.size() != 1) {
+ formationChecklist = false;
+ }
+
+ if (minCasingAmount > 0) {
+ formationChecklist = false;
+ }
+
+ if (formationChecklist) {
+ runningCost = Math.round(-runningCostAcc);
+ // Update MultiFluidHandler in case storage cells have been changed
+ final int capacityPerFluid = (int) Math.round(fluidCapacityAcc / 25.0f);
+ if (mfh == null) {
+ mfh = MultiFluidHandler.newInstance(25, capacityPerFluid);
+ } else {
+ if (mfh.getCapacity() != capacityPerFluid) {
+ mfh = MultiFluidHandler.newAdjustedInstance(mfh, capacityPerFluid);
+ }
+ }
+ for (GTMTE_TFFTMultiHatch mh : sMultiHatches) {
+ mh.setMultiFluidHandler(mfh);
+ }
+ }
+
+ return formationChecklist;
+ }
+
+ public boolean addMultiHatchToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ } else {
+ final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ } else if (aMetaTileEntity instanceof GTMTE_TFFTMultiHatch) {
+ ((GTMTE_TFFTMultiHatch)aMetaTileEntity).updateTexture(aBaseCasingIndex);
+ return this.sMultiHatches.add((GTMTE_TFFTMultiHatch)aMetaTileEntity);
+ } else {
+ return false;
+ }
+ }
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ doVoidExcess = !doVoidExcess;
+ GT_Utility.sendChatToPlayer(aPlayer, doVoidExcess ? "Auto-voiding enabled" : "Auto-voiding disabled");
+ }
+
+ @Override
+ public String[] getInfoData() {
+ final ArrayList<String> ll = mfh.getInfoData();
+
+ ll.add(EnumChatFormatting.YELLOW + "Operational Data:" + EnumChatFormatting.RESET);
+ ll.add("Auto-voiding: " + doVoidExcess);
+ ll.add("Per-Fluid Capacity: " + mfh.getCapacity() + "L");
+ ll.add("Running Cost: "
+ // mEUt does not naturally reflect efficiency status. Do that here.
+ + ((-super.mEUt) * 10000 / Math.max(1000, super.mEfficiency)) + "EU/t");
+ ll.add("Maintenance Status: " + ((super.getRepairStatus() == super.getIdealStatus())
+ ? EnumChatFormatting.GREEN + "Working perfectly" + EnumChatFormatting.RESET
+ : EnumChatFormatting.RED + "Has Problems" + EnumChatFormatting.RESET));
+ ll.add("---------------------------------------------");
+
+ final String[] a = new String[ll.size()];
+ return ll.toArray(a);
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound nbt) {
+ nbt = (nbt == null) ? new NBTTagCompound() : nbt;
+
+ nbt.setInteger("runningCost", runningCost);
+ nbt.setBoolean("doVoidExcess", doVoidExcess);
+
+ nbt.setInteger("capacityPerFluid", mfh.getCapacity());
+ nbt.setTag("fluids", mfh.saveNBTData(new NBTTagCompound()));
+
+ super.saveNBTData(nbt);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound nbt) {
+ nbt = (nbt == null) ? new NBTTagCompound() : nbt;
+
+ runningCost = nbt.getInteger("runningCost");
+ doVoidExcess = nbt.getBoolean("doVoidExcess");
+
+ mfh = MultiFluidHandler.loadNBTData(nbt);
+ for (GTMTE_TFFTMultiHatch mh : sMultiHatches) {
+ mh.setMultiFluidHandler(mfh);
+ }
+ super.loadNBTData(nbt);
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack var1) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack var1) {
+ return 0;
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack var1) {
+ return 0;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack var1) {
+ return false;
+ }
} \ No newline at end of file
diff --git a/src/main/java/common/tileentities/GTMTE_ItemServer.java b/src/main/java/common/tileentities/GTMTE_ItemServer.java
deleted file mode 100644
index cfff360ce4..0000000000
--- a/src/main/java/common/tileentities/GTMTE_ItemServer.java
+++ /dev/null
@@ -1,393 +0,0 @@
-package common.tileentities;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-
-import org.lwjgl.input.Keyboard;
-
-import common.Blocks;
-import common.blocks.Block_ItemServerDrive;
-import common.blocks.Block_ItemServerIOPort;
-import common.blocks.Block_ItemServerRackCasing;
-import gregtech.api.enums.Textures.BlockIcons;
-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 kekztech.MultiItemHandler;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraftforge.common.util.ForgeDirection;
-import util.MultiBlockTooltipBuilder;
-import util.Vector3i;
-import util.Vector3ic;
-
-public class GTMTE_ItemServer extends GT_MetaTileEntity_MultiBlockBase {
-
- private static final int BASE_SEGMENT_ENERGY_COST = 1;
- private static final int BASE_PER_ITEM_CAPACITY = 1024;
- private static final int BASE_ITEM_TYPES_PER_SEGMENT = 4;
-
- private final Block_ItemServerDrive DRIVE = (Block_ItemServerDrive) Blocks.itemServerDrive;
- private final Block_ItemServerRackCasing CASING = (Block_ItemServerRackCasing) Blocks.itemServerRackCasing;
- private final Block_ItemServerIOPort IO_PORT = (Block_ItemServerIOPort) Blocks.itemServerIOPort;
- private final String ALU_FRAME_BOX_NAME = "gt.blockmachines";
- private final int ALU_FRAME_BOX_META = 6;
- private final int CASING_TEXTURE_ID = 176;
-
- private MultiItemHandler mih;
- private HashSet<TE_ItemServerIOPort> ioPorts = new HashSet<>();
- private int sliceCount = 0;
-
- public GTMTE_ItemServer(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GTMTE_ItemServer(String aName) {
- super(aName);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity var1) {
- return new GTMTE_ItemServer(super.mName);
- }
-
- @Override
- public String[] getDescription() {
- final MultiBlockTooltipBuilder b = new MultiBlockTooltipBuilder();
- b.addInfo("[W.I.P - Probably doesn't work]")
- .addInfo("High-Tech item storage!")
- .addInfo("Variable length: Slices 2-4 can be repeated as long as the total length does not exceed 16 blocks.")
- .addInfo("Each segment offers storage for 128 item types")
- .addInfo("Storage capacity per item depends on the controller configuration.")
- .addInfo("Insert an Integrated Circuit into the controller with your desired configuration.")
- .addInfo("The base configuration (0) is 1024 items per type. For each higher level, the capacity quadruples.")
- .addInfo("Each slice also adds 1EU/t of power consumption and doubles with rising configuration values.")
- .addInfo("Valid config values are from zero to eight.")
- .addSeparator()
- .beginStructureBlock(3, 5, 4)
- .addController("Front Bottom Center")
- .addEnergyHatch("Any casing")
- .addOtherStructurePart("Front slice", "3x5x1 Item Server Rack Casing")
- .addOtherStructurePart("2nd and 3rd slice, center", "1x4x1 Aluminium Frame Box")
- .addOtherStructurePart("2nd and 3rd slice, top", "3x1x1 Item Server Rack Casing")
- .addOtherStructurePart("2nd and 3rd slice, sides", "2x 1x4x1 Item Server Drive")
- .addOtherStructurePart("Back slice", "3x5x1 Item Server Rack Casing")
- .signAndFinalize("Kekzdealer");
- if(!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
- return b.getInformation();
- } else {
- return b.getStructureInformation();
- }
- }
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
- boolean aActive, boolean aRedstone) {
- return aSide == aFacing
- ? new ITexture[]{BlockIcons.casingTexturePages[1][48],
- new GT_RenderedTexture(aActive
- ? BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE
- : BlockIcons.OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR)}
- : new ITexture[]{BlockIcons.casingTexturePages[1][48]};
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(),
- "MultiblockDisplay.png");
- }
-
- @Override
- public boolean isCorrectMachinePart(ItemStack var1) {
- return true;
- }
-
- @Override
- public boolean checkRecipe(ItemStack guiSlotItem) {
- final int config = (guiSlotItem != null && guiSlotItem.getUnlocalizedName().equals("gt.integrated_circuit"))
- ? Math.min(8, guiSlotItem.getItemDamage()) : 0;
-
- this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000;
- this.mEfficiencyIncrease = 10000;
- this.mEUt = (int) -(BASE_SEGMENT_ENERGY_COST * sliceCount * Math.pow(2, config));
- super.mMaxProgresstime = 20;
-
- mih.setPerTypeCapacity((int) (BASE_PER_ITEM_CAPACITY * Math.pow(4, config)));
-
- return true;
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
-
- if(mih != null) {
- mih.setLock(!super.getBaseMetaTileEntity().isActive());
- }
- }
-
- public Vector3ic rotateOffsetVector(Vector3ic forgeDirection, int x, int y, int z) {
- final Vector3i offset = new Vector3i();
-
- // either direction on z-axis
- if(forgeDirection.x() == 0 && forgeDirection.z() == -1) {
- offset.x = x;
- offset.y = y;
- offset.z = z;
- }
- if(forgeDirection.x() == 0 && forgeDirection.z() == 1) {
- offset.x = -x;
- offset.y = y;
- offset.z = -z;
- }
- // either direction on x-axis
- if(forgeDirection.x() == -1 && forgeDirection.z() == 0) {
- offset.x = z;
- offset.y = y;
- offset.z = -x;
- }
- if(forgeDirection.x() == 1 && forgeDirection.z() == 0) {
- offset.x = -z;
- offset.y = y;
- offset.z = x;
- }
-
- return offset;
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity thisController, ItemStack guiSlotItem) {
- // Figure out the vector for the direction the back face of the controller is facing
- final Vector3ic forgeDirection = new Vector3i(
- ForgeDirection.getOrientation(thisController.getBackFacing()).offsetX,
- ForgeDirection.getOrientation(thisController.getBackFacing()).offsetY,
- ForgeDirection.getOrientation(thisController.getBackFacing()).offsetZ
- );
- boolean formationChecklist = true;
-
- // Front slice
- for(int X = -1; X <= 1; X++) {
- for(int Y = 0; Y <= 4; Y++) {
- if(X == 0 && Y == 0) {
- continue; // is controller
- }
-
- // Get next TE
- final Vector3ic offset = rotateOffsetVector(forgeDirection, X, Y, 0);
- IGregTechTileEntity currentTE =
- thisController.getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z());
-
- if(!super.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID)
- && !super.addEnergyInputToMachineList(currentTE, CASING_TEXTURE_ID)) {
-
- // Is casing or IO port?
- if(thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CASING) {
- // Is casing, but there's no casing requirements
- } else if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == IO_PORT) {
- final TE_ItemServerIOPort port =
- (TE_ItemServerIOPort) thisController.getWorld().getTileEntity(
- thisController.getXCoord() + offset.x(),
- thisController.getYCoord() + offset.y(),
- thisController.getZCoord() + offset.z());
- ioPorts.add(port);
- } else {
- formationChecklist = false;
- }
- }
- }
- }
-
- // Check slices
- int segmentsFound = 0;
- int zOffset = -1; // -1 is the first slice after the front one. It goes in negative direction.
-
- while(segmentsFound < 5) {
- if(checkSegment(thisController, forgeDirection, zOffset)) {
- segmentsFound++;
- zOffset -= 3; // Each segment is 3 blocks long, so progress Z by -3
-
- System.out.println("Item Server segment approved: " + segmentsFound);
- } else {
- System.out.println("Item Server segment rejected: " + (segmentsFound + 1));
- break;
- }
- }
-
- if(segmentsFound < 1) {
- System.out.println("At least one slice required for storage");
- formationChecklist = false;
- }
-
- if(this.mEnergyHatches.size() < 1) {
- System.out.println("At least one energy hatch is required!");
- formationChecklist = false;
- }
-
- if(this.mMaintenanceHatches.size() < 1) {
- System.out.println("You need a maintenance hatch to do maintenance.");
- formationChecklist = false;
- }
-
- if(formationChecklist) {
- sliceCount = segmentsFound;
-
- if(mih == null) {
- mih = new MultiItemHandler();
- mih.setItemTypeCapacity(segmentsFound * BASE_ITEM_TYPES_PER_SEGMENT);
- }
- System.out.println("Configuring " + ioPorts.size() + " ports");
- for(TE_ItemServerIOPort port : ioPorts) {
- port.setMultiItemHandler(mih);
- }
- }
-
- return formationChecklist;
- }
-
- public boolean checkSegment(IGregTechTileEntity thisController, Vector3ic forgeDirection, int zOffset) {
- boolean formationChecklist = true;
- // Slice by slice
- for(int Z = 0; Z >= -2; Z--) {
- // Is not back slice
- if(Z != -2) {
- // Left to right
- for(int X = -1; X <= 1; X++) {
- // Bottom to top
- for(int Y = 0; Y <= 4; Y++) {
- final Vector3ic offset = rotateOffsetVector(forgeDirection, X, Y, zOffset + Z);
-
- // Server rack roof
- if(Y == 4) {
- final IGregTechTileEntity currentTE =
- thisController.getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z());
-
- if(!super.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID)
- && !super.addEnergyInputToMachineList(currentTE, CASING_TEXTURE_ID)) {
- // Is casing or IO port?
- if(thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CASING) {
- // Is casing, but there's no casing requirements
- } else if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == IO_PORT) {
- final TE_ItemServerIOPort port =
- (TE_ItemServerIOPort) thisController.getWorld().getTileEntity(
- thisController.getXCoord() + offset.x(),
- thisController.getYCoord() + offset.y(),
- thisController.getZCoord() + offset.z());
- ioPorts.add(port);
- } else {
- formationChecklist = false;
- }
- }
- }
-
- // Middle wall is aluminium frame boxes
- else if(Y <= 3 && X == 0) {
- if(!(thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName().equals(ALU_FRAME_BOX_NAME))
- || !(thisController.getMetaIDOffset(offset.x(), offset.y(), offset.z()) == ALU_FRAME_BOX_META)) {
- formationChecklist = false;
- }
- }
-
- // Side walls are item server drives
- else if(Y <= 3 && X != 0) {
- if(!(thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == DRIVE)) {
- formationChecklist = false;
- }
- }
- }
- }
- } else {
- // Back slice
- for(int X = -1; X <= 1; X++) {
- for(int Y = 0; Y <= 4; Y++) {
-
- final Vector3ic offset = rotateOffsetVector(forgeDirection, X, Y, zOffset + Z);
- IGregTechTileEntity currentTE =
- thisController.getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z());
-
- if(!super.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID)
- && !super.addEnergyInputToMachineList(currentTE, CASING_TEXTURE_ID)) {
- // Is casing or IO port?
- if(thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CASING) {
- // Is casing, but there's no casing requirements
- } else if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == IO_PORT) {
- final TE_ItemServerIOPort port =
- (TE_ItemServerIOPort) thisController.getWorld().getTileEntity(
- thisController.getXCoord() + offset.x(),
- thisController.getYCoord() + offset.y(),
- thisController.getZCoord() + offset.z());
- ioPorts.add(port);
- } else {
- formationChecklist = false;
- }
- }
- }
- }
- }
- }
-
-
- return formationChecklist;
- }
-
- @Override
- public String[] getInfoData() {
- final ArrayList<String> ll = new ArrayList<>();//mfh.getInfoData();
-
- ll.add(EnumChatFormatting.YELLOW + "Operational Data:" + EnumChatFormatting.RESET);
- ll.add("Per-Item Capacity: " + mih.getPerTypeCapacity());
- ll.add("Item-Type Capacity: " + BASE_ITEM_TYPES_PER_SEGMENT * sliceCount);
- ll.add("Running Cost: "
- // mEUt does not naturally reflect efficiency status. Do that here.
- + ((-super.mEUt) * 10000 / Math.max(1000, super.mEfficiency)) + "EU/t");
- ll.add("Maintenance Status: " + ((super.getRepairStatus() == super.getIdealStatus())
- ? EnumChatFormatting.GREEN + "Working perfectly" + EnumChatFormatting.RESET
- : EnumChatFormatting.RED + "Has Problems" + EnumChatFormatting.RESET));
- ll.add("---------------------------------------------");
-
- final String[] a = new String[ll.size()];
- return ll.toArray(a);
- }
-
- @Override
- public void saveNBTData(NBTTagCompound nbt) {
- nbt = (nbt == null) ? new NBTTagCompound() : nbt;
-
- super.saveNBTData(nbt);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound nbt) {
- nbt = (nbt == null) ? new NBTTagCompound() : nbt;
-
- super.loadNBTData(nbt);
- }
-
- @Override
- public boolean isGivingInformation() {
- return true;
- }
-
- @Override
- public int getMaxEfficiency(ItemStack var1) {
- return 10000;
- }
-
- @Override
- public int getPollutionPerTick(ItemStack var1) {
- return 0;
- }
-
- @Override
- public int getDamageToComponent(ItemStack var1) {
- return 0;
- }
-
- @Override
- public boolean explodesOnComponentBreak(ItemStack var1) {
- return false;
- }
-}
diff --git a/src/main/java/common/tileentities/GTMTE_LapotronicSuperCapacitor.java b/src/main/java/common/tileentities/GTMTE_LapotronicSuperCapacitor.java
index fc743a56d3..b3d2c9fea3 100644
--- a/src/main/java/common/tileentities/GTMTE_LapotronicSuperCapacitor.java
+++ b/src/main/java/common/tileentities/GTMTE_LapotronicSuperCapacitor.java
@@ -11,11 +11,12 @@ import gregtech.api.gui.GT_GUIContainer_MultiMachine;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
+import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import net.minecraft.block.Block;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
@@ -23,7 +24,6 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.input.Keyboard;
-import util.MultiBlockTooltipBuilder;
import util.Vector3i;
import util.Vector3ic;
@@ -51,14 +51,17 @@ public class GTMTE_LapotronicSuperCapacitor extends GT_MetaTileEntity_MultiBlock
private final Set<GT_MetaTileEntity_Hatch_EnergyTunnel> mEnergyTunnelsTT = new HashSet<>();
private final Set<GT_MetaTileEntity_Hatch_DynamoTunnel> mDynamoTunnelsTT = new HashSet<>();
// Count the amount of capacitors of each tier in each slot (translate with meta - 1)
- private final int[] capacitors = new int[5];
+ private final int[] capacitors = new int[7];
private BigInteger capacity = BigInteger.ZERO;
private BigInteger stored = BigInteger.ZERO;
private BigInteger passiveDischargeAmount = BigInteger.ZERO;
- private BigInteger intputLastTick = BigInteger.ZERO;
+ private BigInteger inputLastTick = BigInteger.ZERO;
private BigInteger outputLastTick = BigInteger.ZERO;
private int repairStatusCache = 0;
+ private long mMaxEUIn = 0;
+ private long mMaxEUOut = 0;
+
public GTMTE_LapotronicSuperCapacitor(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
@@ -74,29 +77,34 @@ public class GTMTE_LapotronicSuperCapacitor extends GT_MetaTileEntity_MultiBlock
@Override
public String[] getDescription() {
- final MultiBlockTooltipBuilder b = new MultiBlockTooltipBuilder();
- b.addInfo("Power storage structure!")
- .addInfo("Looses energy equal to 1% of the total capacity every 24 hours.")
- .addInfo("EXCEPTION: Ultimate Capacitors only count as Lapotronic Capacitors (UV) for the")
- .addInfo("purpose of passive loss calculation. The full capacity is counted towards the actual power capacity.")
- .addSeparator()
- .addInfo("Glass shell has to be Tier - 2 of the highest capacitor tier")
- .addInfo("UV-Tier glass required for TecTech Laser Hatches")
- .addInfo("Modular height of 4 to 18 blocks.")
- .addSeparator()
- .beginStructureBlock(5, 4, 5)
- .addController("Front Bottom Center")
- .addDynamoHatch("Instead of any casing")
- .addEnergyHatch("Instead of any casing")
- .addOtherStructurePart("Lapotronic Capacitor Base", "5x2x5 base (at least 17x)")
- .addOtherStructurePart("Lapotronic Capacitor, (Really) Ultimate Capacitor", "Center 3x(1-15)x3 above base (9-135 blocks)")
- .addOtherStructurePart("Borosilicate Glass", "41-265x, Encase capacitor pillar")
- .addMaintenanceHatch("Instead of any casing")
- .signAndFinalize("Kekzdealer");
+ final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType("Battery Buffer")
+ .addInfo("Power storage structure. Does not charge batteries or tools, however.")
+ .addInfo("Loses energy equal to 1% of the total capacity every 24 hours.")
+ .addInfo("Exception: Ultimate Capacitors only count as Lapotronic Capacitors (UV) for the")
+ .addInfo("purposes of passive loss calculation. The full capacity is counted towards the actual power capacity.")
+ .addSeparator()
+ .addInfo("Glass shell has to be Tier - 2 of the highest capacitor tier")
+ .addInfo("UV-tier glass required for TecTech Laser Hatches")
+ .addInfo("Add more or better capacitors to increase capacity")
+ .addSeparator()
+ .beginStructureBlock(5, 4, 5, false)
+ .addStructureInfo("Modular height of 4-18 blocks.")
+ .addController("Front center bottom")
+ .addOtherStructurePart("Lapotronic Super Capacitor Casing", "5x2x5 base (at least 17x)")
+ .addOtherStructurePart("Lapotronic Capacitor (EV-UV), Ultimate Capacitor (UHV)", "Center 3x(1-15)x3 above base (9-135 blocks)")
+ .addStructureInfo("You can also use the Empty Capacitor to save materials if you use it for less than half the blocks")
+ .addOtherStructurePart("Borosilicate Glass (any)", "41-265x, Encase capacitor pillar")
+ .addEnergyHatch("Any casing")
+ .addDynamoHatch("Any casing")
+ .addOtherStructurePart("Laser Target/Source Hatches", "Any casing, must be using UV-tier glass")
+ .addStructureInfo("You can have several I/O Hatches")
+ .addMaintenanceHatch("Any casing")
+ .toolTipFinisher("KekzTech");
if(!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
- return b.getInformation();
+ return tt.getInformation();
} else {
- return b.getStructureInformation();
+ return tt.getStructureInformation();
}
}
@@ -184,6 +192,9 @@ public class GTMTE_LapotronicSuperCapacitor extends GT_MetaTileEntity_MultiBlock
mDynamoHatchesTT.clear();
mEnergyTunnelsTT.clear();
mDynamoTunnelsTT.clear();
+
+ mMaxEUIn = 0;
+ mMaxEUOut = 0;
// Temp var for loss calculation
BigInteger tempCapacity = BigInteger.ZERO;
@@ -196,8 +207,7 @@ public class GTMTE_LapotronicSuperCapacitor extends GT_MetaTileEntity_MultiBlock
}
final Vector3ic offset = rotateOffsetVector(forgeDirection, X, Y, Z);
- final IGregTechTileEntity currentTE =
- thisController.getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z());
+ final IGregTechTileEntity currentTE = thisController.getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z());
// Tries to add TE as either of those kinds of hatches.
// The number is the texture index number for the texture that needs to be painted over the hatch texture
@@ -229,14 +239,7 @@ public class GTMTE_LapotronicSuperCapacitor extends GT_MetaTileEntity_MultiBlock
final int meta = thisController.getMetaIDOffset(offset.x(), offset.y(), offset.z());
if(thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == LSC_PART && (meta > 0)) {
// Add capacity
- if(meta <= 4){
- final long c = (long) (100000000L * Math.pow(10, meta - 1));
- tempCapacity = tempCapacity.add(BigInteger.valueOf(c));
- capacity = capacity.add(BigInteger.valueOf(c));
- } else if(meta <= 5){
- tempCapacity = tempCapacity.add(BigInteger.valueOf((long) (100000000L * Math.pow(10, 3))));
- capacity = capacity.add(MAX_LONG);
- }
+ tempCapacity = calculateTempCapacity(tempCapacity, meta);
capacitors[meta - 1]++;
} else if(thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName().equals(glassNameBorosilicate)){
firstGlassHeight = Y;
@@ -281,7 +284,7 @@ public class GTMTE_LapotronicSuperCapacitor extends GT_MetaTileEntity_MultiBlock
}
}
- if(minCasingAmount > 0){
+ if(minCasingAmount > 0) {
formationChecklist = false;
}
@@ -290,11 +293,8 @@ public class GTMTE_LapotronicSuperCapacitor extends GT_MetaTileEntity_MultiBlock
// Borosilicate glass after 5 are just recolours of 0
final int colourCorrectedMeta = firstGlassMeta > 5 ? 0 : firstGlassMeta;
for(int highestCapacitor = capacitors.length - 1; highestCapacitor >= 0; highestCapacitor--){
- if(capacitors[highestCapacitor] > 0){
- if(colourCorrectedMeta < highestCapacitor){
- formationChecklist = false;
- }
- break;
+ if(capacitors[highestCapacitor] > 0 && formationChecklist == true) {
+ formationChecklist = checkGlassTier(colourCorrectedMeta, highestCapacitor);
}
}
@@ -305,44 +305,115 @@ public class GTMTE_LapotronicSuperCapacitor extends GT_MetaTileEntity_MultiBlock
}
mEnergyTunnelsTT.clear();
mDynamoTunnelsTT.clear();
-
}
+ //Check if enough (more than 50%) non-empty caps
+ double emptyCheck = ((double) capacitors[5]) / (double) (capacitors[0] + capacitors[1] + capacitors[2] + capacitors[3] + capacitors[4] + capacitors[6]);
+ if (emptyCheck > 0.5)
+ formationChecklist = false;
+
// Calculate total capacity
- capacity = BigInteger.ZERO;
- for(int i = 0; i < capacitors.length; i++){
- if(i <= 3){
- final long c = (long) (100000000L * Math.pow(10, i));
- capacity = capacity.add(
- BigInteger.valueOf(c).multiply(BigInteger.valueOf(capacitors[i])));
- } else {
- capacity = capacity.add(
- MAX_LONG.multiply(BigInteger.valueOf(capacitors[i])));
- }
- }
+ calculateCapacity();
+
// Calculate how much energy to void each tick
passiveDischargeAmount = new BigDecimal(tempCapacity).multiply(PASSIVE_DISCHARGE_FACTOR_PER_TICK).toBigInteger();
passiveDischargeAmount = recalculateLossWithMaintenance(super.getRepairStatus());
return formationChecklist;
}
+ public BigInteger calculateTempCapacity(BigInteger tempCapacity, int meta) {
+ switch(meta) {
+ case 1: tempCapacity = tempCapacity.add(BigInteger.valueOf(100000000L)); capacity = capacity.add(BigInteger.valueOf(100000000L)); break;
+ case 2: tempCapacity = tempCapacity.add(BigInteger.valueOf(1000000000L)); capacity = capacity.add(BigInteger.valueOf(1000000000L)); break;
+ case 3: tempCapacity = tempCapacity.add(BigInteger.valueOf(10000000000L)); capacity = capacity.add(BigInteger.valueOf(10000000000L)); break;
+ case 4: tempCapacity = tempCapacity.add(BigInteger.valueOf(100000000000L)); capacity = capacity.add(BigInteger.valueOf(100000000000L)); break;
+ case 5: tempCapacity = tempCapacity.add(BigInteger.valueOf(100000000000L)); capacity = capacity.add(MAX_LONG); break;
+ case 6: break;
+ case 7: tempCapacity = tempCapacity.add(BigInteger.valueOf(10000000L)); capacity = capacity.add(BigInteger.valueOf(10000000L)); break;
+ default: break;
+ }
+ return tempCapacity;
+ }
+
+ public boolean checkGlassTier(int colourCorrectedMeta, int highestCapacitor) {
+ Boolean check = true;
+ switch (highestCapacitor) {
+ case 0://For the empty/EV/IV caps, any BS glass works. The case is meta - 1
+ break;
+ case 1:
+ if(colourCorrectedMeta < highestCapacitor) {
+ check = false;
+ }
+ break;
+ case 2:
+ if(colourCorrectedMeta < highestCapacitor) {
+ check = false;
+ }
+ break;
+ case 3:
+ if(colourCorrectedMeta < highestCapacitor) {
+ check = false;
+ }
+ break;
+ case 4:
+ if(colourCorrectedMeta < highestCapacitor) {
+ check = false;
+ }
+ break;
+ case 5:
+ break;
+ case 6:
+ break;
+ default:
+ check = false;
+ }
+ return check; //Return false if it fails the check, otherwise true
+ }
+
+ public void calculateCapacity() {
+ capacity = BigInteger.ZERO;
+ for(int i = 0; i < capacitors.length; i++) {
+ switch(i) {
+ case 0: capacity = capacity.add(BigInteger.valueOf(100000000L).multiply(BigInteger.valueOf(capacitors[i]))); break;
+ case 1: capacity = capacity.add(BigInteger.valueOf(1000000000L).multiply(BigInteger.valueOf(capacitors[i]))); break;
+ case 2: capacity = capacity.add(BigInteger.valueOf(10000000000L).multiply(BigInteger.valueOf(capacitors[i]))); break;
+ case 3: capacity = capacity.add(BigInteger.valueOf(100000000000L).multiply(BigInteger.valueOf(capacitors[i]))); break;
+ case 4: capacity = capacity.add(MAX_LONG.multiply(BigInteger.valueOf(capacitors[i]))); break;
+ case 5: break;
+ case 6: capacity = capacity.add(BigInteger.valueOf(10000000L).multiply(BigInteger.valueOf(capacitors[i]))); break;
+ default: break;
+ }
+ }
+ }
+
@Override
public boolean addEnergyInputToMachineList(IGregTechTileEntity te, int aBaseCasingIndex) {
if (te == null) {
return false;
} else {
final IMetaTileEntity mte = te.getMetaTileEntity();
+
+ if (mte instanceof MetaTileEntity) {
+ mMaxEUIn += ((MetaTileEntity) mte).maxEUInput() * ((MetaTileEntity) mte).maxAmperesIn();
+ }
+
if (mte instanceof GT_MetaTileEntity_Hatch_Energy) {
// Add GT hatches
- ((GT_MetaTileEntity_Hatch) mte).updateTexture(aBaseCasingIndex);
- return super.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) mte);
+ final GT_MetaTileEntity_Hatch_Energy tHatch = ((GT_MetaTileEntity_Hatch_Energy) mte);
+ tHatch.updateTexture(aBaseCasingIndex);
+
+ return super.mEnergyHatches.add(tHatch);
} else if(mte instanceof GT_MetaTileEntity_Hatch_EnergyTunnel) {
// Add TT Laser hatches
+ final GT_MetaTileEntity_Hatch_EnergyTunnel tHatch = ((GT_MetaTileEntity_Hatch_EnergyTunnel) mte);
+
return mEnergyTunnelsTT.add((GT_MetaTileEntity_Hatch_EnergyTunnel) mte);
} else if(mte instanceof GT_MetaTileEntity_Hatch_EnergyMulti) {
// Add TT hatches
- ((GT_MetaTileEntity_Hatch) mte).updateTexture(aBaseCasingIndex);
- return mEnergyHatchesTT.add((GT_MetaTileEntity_Hatch_EnergyMulti) mte);
+ final GT_MetaTileEntity_Hatch_EnergyMulti tHatch = (GT_MetaTileEntity_Hatch_EnergyMulti) mte;
+ tHatch.updateTexture(aBaseCasingIndex);
+
+ return mEnergyHatchesTT.add(tHatch);
} else {
return false;
}
@@ -355,17 +426,28 @@ public class GTMTE_LapotronicSuperCapacitor extends GT_MetaTileEntity_MultiBlock
return false;
} else {
final IMetaTileEntity mte = te.getMetaTileEntity();
+
+ if (mte instanceof MetaTileEntity) {
+ mMaxEUOut += ((MetaTileEntity) mte).maxEUOutput() * ((MetaTileEntity) mte).maxAmperesOut();
+ }
+
if (mte instanceof GT_MetaTileEntity_Hatch_Dynamo) {
// Add GT hatches
- ((GT_MetaTileEntity_Hatch) mte).updateTexture(aBaseCasingIndex);
- return super.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) mte);
+ final GT_MetaTileEntity_Hatch_Dynamo tDynamo = (GT_MetaTileEntity_Hatch_Dynamo) mte;
+ tDynamo.updateTexture(aBaseCasingIndex);
+
+ return super.mDynamoHatches.add(tDynamo);
} else if(mte instanceof GT_MetaTileEntity_Hatch_DynamoTunnel) {
// Add TT Laser hatches
- return mDynamoTunnelsTT.add((GT_MetaTileEntity_Hatch_DynamoTunnel) mte);
+ final GT_MetaTileEntity_Hatch_DynamoTunnel tDynamo = (GT_MetaTileEntity_Hatch_DynamoTunnel) mte;
+
+ return mDynamoTunnelsTT.add(tDynamo);
} else if(mte instanceof GT_MetaTileEntity_Hatch_DynamoMulti) {
// Add TT hatches
- ((GT_MetaTileEntity_Hatch) mte).updateTexture(aBaseCasingIndex);
- return mDynamoHatchesTT.add((GT_MetaTileEntity_Hatch_DynamoMulti) mte);
+ final GT_MetaTileEntity_Hatch_DynamoMulti tDynamo = (GT_MetaTileEntity_Hatch_DynamoMulti) mte;
+ tDynamo.updateTexture(aBaseCasingIndex);
+
+ return mDynamoHatchesTT.add(tDynamo);
} else {
return false;
}
@@ -375,9 +457,11 @@ public class GTMTE_LapotronicSuperCapacitor extends GT_MetaTileEntity_MultiBlock
@Override
public boolean onRunningTick(ItemStack stack){
// Reset I/O cache
- intputLastTick = BigInteger.ZERO;
+ inputLastTick = BigInteger.ZERO;
outputLastTick = BigInteger.ZERO;
+ //System.out.println(getBaseMetaTileEntity().)
+
// Draw energy from GT hatches
for(GT_MetaTileEntity_Hatch_Energy eHatch : super.mEnergyHatches) {
if(eHatch == null || eHatch.getBaseMetaTileEntity().isInvalidTileEntity()) {
@@ -387,7 +471,7 @@ public class GTMTE_LapotronicSuperCapacitor extends GT_MetaTileEntity_MultiBlock
if(eHatch.getEUVar() >= power) {
eHatch.setEUVar(eHatch.getEUVar() - power);
stored = stored.add(BigInteger.valueOf(power));
- intputLastTick = intputLastTick.add(BigInteger.valueOf(power));
+ inputLastTick = inputLastTick.add(BigInteger.valueOf(power));
}
}
// Output energy to GT hatches
@@ -411,7 +495,7 @@ public class GTMTE_LapotronicSuperCapacitor extends GT_MetaTileEntity_MultiBlock
if(eHatch.getEUVar() >= power) {
eHatch.setEUVar(eHatch.getEUVar() - power);
stored = stored.add(BigInteger.valueOf(power));
- intputLastTick = intputLastTick.add(BigInteger.valueOf(power));
+ inputLastTick = inputLastTick.add(BigInteger.valueOf(power));
}
}
// Output energy to TT hatches
@@ -436,7 +520,7 @@ public class GTMTE_LapotronicSuperCapacitor extends GT_MetaTileEntity_MultiBlock
if(eHatch.getEUVar() >= power) {
eHatch.setEUVar(eHatch.getEUVar() - power);
stored = stored.add(BigInteger.valueOf(power));
- intputLastTick = intputLastTick.add(BigInteger.valueOf(power));
+ inputLastTick = inputLastTick.add(BigInteger.valueOf(power));
}
}
// Output energy to TT Laser hatches
@@ -460,6 +544,11 @@ public class GTMTE_LapotronicSuperCapacitor extends GT_MetaTileEntity_MultiBlock
stored = stored.subtract(passiveDischargeAmount);
stored = (stored.compareTo(BigInteger.ZERO) <= 0) ? BigInteger.ZERO : stored;
+ IGregTechTileEntity tBMTE = this.getBaseMetaTileEntity();
+
+ tBMTE.injectEnergyUnits((byte)ForgeDirection.UNKNOWN.ordinal(), inputLastTick.longValue(), 1L);
+ tBMTE.drainEnergyUnits((byte)ForgeDirection.UNKNOWN.ordinal(), outputLastTick.longValue(), 1L);
+
return true;
}
@@ -500,13 +589,17 @@ public class GTMTE_LapotronicSuperCapacitor extends GT_MetaTileEntity_MultiBlock
@Override
public String[] getInfoData() {
+ final IGregTechTileEntity tGTTE = getBaseMetaTileEntity();
+
final ArrayList<String> ll = new ArrayList<>();
ll.add(EnumChatFormatting.YELLOW + "Operational Data:" + EnumChatFormatting.RESET);
ll.add("Used Capacity: " + NumberFormat.getNumberInstance().format(stored) + "EU");
ll.add("Total Capacity: " + NumberFormat.getNumberInstance().format(capacity) + "EU");
ll.add("Passive Loss: " + NumberFormat.getNumberInstance().format(passiveDischargeAmount) + "EU/t");
- ll.add("EU IN: " + NumberFormat.getNumberInstance().format(intputLastTick) + "EU/t");
+ ll.add("EU IN: " + NumberFormat.getNumberInstance().format(inputLastTick) + "EU/t");
ll.add("EU OUT: " + NumberFormat.getNumberInstance().format(outputLastTick) + "EU/t");
+ ll.add("Avg EU IN: " + NumberFormat.getNumberInstance().format(tGTTE.getAverageElectricInput()));
+ ll.add("Avg EU OUT: " + NumberFormat.getNumberInstance().format(tGTTE.getAverageElectricOutput()));
ll.add("Maintenance Status: " + ((super.getRepairStatus() == super.getIdealStatus())
? EnumChatFormatting.GREEN + "Working perfectly" + EnumChatFormatting.RESET
: EnumChatFormatting.RED + "Has Problems" + EnumChatFormatting.RESET));
@@ -554,5 +647,57 @@ public class GTMTE_LapotronicSuperCapacitor extends GT_MetaTileEntity_MultiBlock
@Override
public boolean explodesOnComponentBreak(ItemStack stack) { return false; }
-
+
+ //called by the getEUCapacity() function in BaseMetaTileEntity
+ @Override
+ public long maxEUStore()
+ {
+ return capacity.longValue();
+ }
+
+ //called by the getEUStored() function in BaseMetaTileEntity
+ @Override
+ public long getEUVar()
+ {
+ return stored.longValue();
+ }
+
+ /* all of these are needed for the injectEnergyUnits() and drainEnergyUnits()
+ in IGregTechTileEntity
+ */
+ @Override
+ public long maxEUInput()
+ {
+ return mMaxEUIn;
+ }
+
+ @Override
+ public long maxAmperesIn()
+ {
+ return 1L;
+ }
+
+ @Override
+ public long maxEUOutput()
+ {
+ return mMaxEUOut;
+ }
+
+ @Override
+ public long maxAmperesOut()
+ {
+ return 1L;
+ }
+
+ @Override
+ public boolean isEnetInput()
+ {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetOutput()
+ {
+ return true;
+ }
}
diff --git a/src/main/java/common/tileentities/GTMTE_ModularNuclearReactor.java b/src/main/java/common/tileentities/GTMTE_ModularNuclearReactor.java
index 5e0b86ed69..ec720b9354 100644
--- a/src/main/java/common/tileentities/GTMTE_ModularNuclearReactor.java
+++ b/src/main/java/common/tileentities/GTMTE_ModularNuclearReactor.java
@@ -16,7 +16,6 @@ import net.minecraft.block.Block;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
-import util.MultiBlockTooltipBuilder;
public class GTMTE_ModularNuclearReactor extends GT_MetaTileEntity_MultiBlockBase {
@@ -47,6 +46,8 @@ public class GTMTE_ModularNuclearReactor extends GT_MetaTileEntity_MultiBlockBas
@Override
public String[] getDescription() {
+ return new String[]{"Disabled"};
+ /*
final MultiBlockTooltipBuilder b = new MultiBlockTooltipBuilder();
b.addInfo("Can be built, BUT DOES NOT WORK")
.addInfo("Converts fissile material and outputs power or heat")
@@ -75,18 +76,18 @@ public class GTMTE_ModularNuclearReactor extends GT_MetaTileEntity_MultiBlockBas
return b.getInformation();
} else {
return b.getStructureInformation();
- }
+ }*/
}
@Override
public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
return aSide == aFacing
- ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[CASING_TEXTURE_ID],
+ ? new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_TEXTURE_ID),
new GT_RenderedTexture(aActive ?
Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE
: Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER)}
- : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[CASING_TEXTURE_ID]};
+ : new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_TEXTURE_ID)};
}
// TODO: Opening UI crashes server. Controller isn't craftable right now.
diff --git a/src/main/java/common/tileentities/GTMTE_SOFuelCellMK1.java b/src/main/java/common/tileentities/GTMTE_SOFuelCellMK1.java
index 76536f0e50..0bc05927aa 100644
--- a/src/main/java/common/tileentities/GTMTE_SOFuelCellMK1.java
+++ b/src/main/java/common/tileentities/GTMTE_SOFuelCellMK1.java
@@ -17,6 +17,7 @@ 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_ModHandler;
+import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
@@ -25,7 +26,6 @@ import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
-import util.MultiBlockTooltipBuilder;
import util.Vector3i;
import util.Vector3ic;
@@ -56,26 +56,29 @@ public class GTMTE_SOFuelCellMK1 extends GT_MetaTileEntity_MultiBlockBase {
@Override
public String[] getDescription() {
- final MultiBlockTooltipBuilder b = new MultiBlockTooltipBuilder();
- b.addInfo("Oxidizes gas fuels to generate electricity without polluting the environment")
- .addInfo("Consumes 29,480EU worth of fuel with up to 97% efficiency each second")
- .addInfo("Steam production requires the SOFC to heat up completely first")
- .addInfo("Outputs " + EU_PER_TICK + "EU/t and " + STEAM_PER_SEC + "L/s Steam")
- .addInfo("Additionally requires " + OXYGEN_PER_SEC + "L/s Oxygen gas")
- .addSeparator()
- .beginStructureBlock(3, 3, 5)
- .addController("Front Center")
- .addDynamoHatch("Back Center")
- .addOtherStructurePart("YSZ Ceramic Electrolyte Unit", "3x, Center 1x1x3")
- .addOtherStructurePart("Reinforced Glass", "6x, touching the electrolyte units on the horizontal sides")
- .addCasingInfo("Clean Stainless Steel Casing", 12)
- .addMaintenanceHatch("Instead of any casing")
- .addIOHatches("Instead of any casing")
- .signAndFinalize("Kekzdealer");
+ final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType("Gas Turbine")
+ .addInfo("Oxidizes gas fuels to generate electricity without polluting the environment")
+ .addInfo("Consumes 29,480EU worth of fuel with up to 97% efficiency each second")
+ .addInfo("Steam production requires the SOFC to heat up completely first")
+ .addInfo("Outputs " + EU_PER_TICK + "EU/t and " + STEAM_PER_SEC + "L/s Steam")
+ .addInfo("Additionally, requires " + OXYGEN_PER_SEC + "L/s Oxygen gas")
+ .addSeparator()
+ .beginStructureBlock(3, 3, 5, false)
+ .addController("Front center")
+ .addCasingInfo("Clean Stainless Steel Casing", 12)
+ .addOtherStructurePart("YSZ Ceramic Electrolyte Unit", "3x, Center 1x1x3")
+ .addOtherStructurePart("Reinforced Glass", "6x, touching the electrolyte units on the horizontal sides")
+ .addDynamoHatch("Back center")
+ .addMaintenanceHatch("Any casing")
+ .addInputHatch("Fuel, any casing")
+ .addInputHatch("Oxygen, any casing")
+ .addOutputHatch("Steam, any casing")
+ .toolTipFinisher("KekzTech");
if(!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
- return b.getInformation();
+ return tt.getInformation();
} else {
- return b.getStructureInformation();
+ return tt.getStructureInformation();
}
}
@@ -83,11 +86,11 @@ public class GTMTE_SOFuelCellMK1 extends GT_MetaTileEntity_MultiBlockBase {
public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
return aSide == aFacing
- ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[CASING_TEXTURE_ID],
+ ? new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_TEXTURE_ID),
new GT_RenderedTexture(aActive ?
Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE
: Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER)}
- : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[CASING_TEXTURE_ID]};
+ : new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_TEXTURE_ID)};
}
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
diff --git a/src/main/java/common/tileentities/GTMTE_SOFuelCellMK2.java b/src/main/java/common/tileentities/GTMTE_SOFuelCellMK2.java
index fb3fb7e9c7..a015887350 100644
--- a/src/main/java/common/tileentities/GTMTE_SOFuelCellMK2.java
+++ b/src/main/java/common/tileentities/GTMTE_SOFuelCellMK2.java
@@ -16,6 +16,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
@@ -25,7 +26,7 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
-import util.MultiBlockTooltipBuilder;
+
import util.Vector3i;
import util.Vector3ic;
@@ -56,26 +57,29 @@ public class GTMTE_SOFuelCellMK2 extends GT_MetaTileEntity_MultiBlockBase {
@Override
public String[] getDescription() {
- final MultiBlockTooltipBuilder b = new MultiBlockTooltipBuilder();
- b.addInfo("Oxidizes gas fuels to generate electricity without polluting the environment")
- .addInfo("Consumes 442,200EU worth of fuel with up to 97% efficiency each second")
- .addInfo("Steam production requires the SOFC to heat up completely first")
- .addInfo("Outputs " + EU_PER_TICK + "EU/t and " + STEAM_PER_SEC + "L/s Steam")
- .addInfo("Additionally requires " + OXYGEN_PER_SEC + "L/s Oxygen gas")
- .addSeparator()
- .beginStructureBlock(3, 3, 5)
- .addController("Front Center")
- .addDynamoHatch("Back Center")
- .addOtherStructurePart("GDC Ceramic Electrolyte Unit", "3x, Center 1x1x3")
- .addOtherStructurePart("Reinforced Glass", "6x, touching the electrolyte units on the horizontal sides")
- .addCasingInfo("Robust Tungstensteel Machine Casing", 12)
- .addMaintenanceHatch("Instead of any casing")
- .addIOHatches("Instead of any casing")
- .signAndFinalize("Kekzdealer");
+ final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
+ tt.addMachineType("Gas Turbine")
+ .addInfo("Oxidizes gas fuels to generate electricity without polluting the environment")
+ .addInfo("Consumes 442,200EU worth of fuel with up to 97% efficiency each second")
+ .addInfo("Steam production requires the SOFC to heat up completely first")
+ .addInfo("Outputs " + EU_PER_TICK + "EU/t and " + STEAM_PER_SEC + "L/s Steam")
+ .addInfo("Additionally, requires " + OXYGEN_PER_SEC + "L/s Oxygen gas")
+ .addSeparator()
+ .beginStructureBlock(3, 3, 5, false)
+ .addController("Front center")
+ .addCasingInfo("Robust Tungstensteel Machine Casing", 12)
+ .addOtherStructurePart("GDC Ceramic Electrolyte Unit", "3x, Center 1x1x3")
+ .addOtherStructurePart("Reinforced Glass", "6x, touching the electrolyte units on the horizontal sides")
+ .addDynamoHatch("Back center")
+ .addMaintenanceHatch("Any casing")
+ .addInputHatch("Fuel, any casing")
+ .addInputHatch("Oxygen, any casing")
+ .addOutputHatch("Superheated Steam, any casing")
+ .toolTipFinisher("KekzTech");
if(!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
- return b.getInformation();
+ return tt.getInformation();
} else {
- return b.getStructureInformation();
+ return tt.getStructureInformation();
}
}
@@ -83,11 +87,11 @@ public class GTMTE_SOFuelCellMK2 extends GT_MetaTileEntity_MultiBlockBase {
public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
return aSide == aFacing
- ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[CASING_TEXTURE_ID],
+ ? new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_TEXTURE_ID),
new GT_RenderedTexture(aActive ?
Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE
: Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER)}
- : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[CASING_TEXTURE_ID]};
+ : new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_TEXTURE_ID)};
}
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
diff --git a/src/main/java/common/tileentities/GTMTE_SpaceElevator.java b/src/main/java/common/tileentities/GTMTE_SpaceElevator.java
index 8f7827f4be..3469528f78 100644
--- a/src/main/java/common/tileentities/GTMTE_SpaceElevator.java
+++ b/src/main/java/common/tileentities/GTMTE_SpaceElevator.java
@@ -12,12 +12,10 @@ import gregtech.api.objects.GT_RenderedTexture;
import net.minecraft.block.Block;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.input.Keyboard;
-import util.MultiBlockTooltipBuilder;
import util.Vector3i;
import util.Vector3ic;
@@ -58,6 +56,8 @@ public class GTMTE_SpaceElevator extends GT_MetaTileEntity_MultiBlockBase {
@Override
public String[] getDescription() {
+ return new String[]{"Disabled"};
+ /*
final MultiBlockTooltipBuilder b = new MultiBlockTooltipBuilder();
b.addInfo("Access for your Space Station!")
.addInfo("Check out the wiki on my github if you are having trouble with the structure")
@@ -78,7 +78,7 @@ public class GTMTE_SpaceElevator extends GT_MetaTileEntity_MultiBlockBase {
return b.getInformation();
} else {
return b.getStructureInformation();
- }
+ }*/
}
@Override
@@ -140,6 +140,7 @@ public class GTMTE_SpaceElevator extends GT_MetaTileEntity_MultiBlockBase {
boolean formationChecklist = true;
int minCasingAmount = 320;
int firstCoilMeta = -1;
+ capacitors.clear();
// Base floor
for(int X = -7; X <= 7; X++){
@@ -215,6 +216,10 @@ public class GTMTE_SpaceElevator extends GT_MetaTileEntity_MultiBlockBase {
formationChecklist = false;
}
+ for(TE_SpaceElevatorCapacitor cap : capacitors){
+ cap.setIsDamaged(false);
+ }
+
return formationChecklist;
}
@@ -233,20 +238,6 @@ public class GTMTE_SpaceElevator extends GT_MetaTileEntity_MultiBlockBase {
}
@Override
- public void saveNBTData(NBTTagCompound nbt) {
- nbt = (nbt == null) ? new NBTTagCompound() : nbt;
-
- super.saveNBTData(nbt);
- }
-
- @Override
- public void loadNBTData(NBTTagCompound nbt) {
- nbt = (nbt == null) ? new NBTTagCompound() : nbt;
-
- super.loadNBTData(nbt);
- }
-
- @Override
public boolean isGivingInformation() {
return true;
}
diff --git a/src/main/java/common/tileentities/GTMTE_TFFTMultiHatch.java b/src/main/java/common/tileentities/GTMTE_TFFTMultiHatch.java
new file mode 100644
index 0000000000..fc2579604a
--- /dev/null
+++ b/src/main/java/common/tileentities/GTMTE_TFFTMultiHatch.java
@@ -0,0 +1,217 @@
+package common.tileentities;
+
+import client.GTTexture;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Utility;
+import kekztech.MultiFluidHandler;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.FluidTankInfo;
+import net.minecraftforge.fluids.IFluidHandler;
+
+import java.util.HashMap;
+
+public class GTMTE_TFFTMultiHatch extends GT_MetaTileEntity_Hatch {
+
+ private static final HashMap<Integer, Integer> vals = new HashMap<>();
+ static {
+ vals.put(3, 2000);
+ vals.put(5, 20000);
+ vals.put(7, 200000);
+ }
+ private static final int INV_SLOT_COUNT = 2;
+
+ private MultiFluidHandler mfh;
+ private boolean outputting = false;
+
+ public GTMTE_TFFTMultiHatch(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, INV_SLOT_COUNT, new String[] {
+ "All-in-one access for the T.F.F.T",
+ "Right-click with a screwdriver to toggle auto-output",
+ "Throughput: " + vals.get(aTier) + "L/s per fluid"}
+ );
+ }
+
+ public GTMTE_TFFTMultiHatch(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, INV_SLOT_COUNT, aDescription, aTextures);
+ }
+
+ public GTMTE_TFFTMultiHatch(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, INV_SLOT_COUNT, aDescription, aTextures);
+ }
+
+ public void setMultiFluidHandler(MultiFluidHandler mfh) {
+ this.mfh = mfh;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setBoolean("outputting", outputting);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ outputting = aNBT.getBoolean("outputting");
+ }
+
+ @Override
+ public ITexture[] getTexturesActive(ITexture aBaseTexture) {
+ //return new ITexture[]{aBaseTexture, new GT_RenderedTexture(GTTexture.MULTI_HATCH_ON)};
+ return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_PIPE_STEEL)};
+ }
+
+ @Override
+ public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
+ //return new ITexture[]{aBaseTexture, new GT_RenderedTexture(GTTexture.MULTI_HATCH_OFF)};
+ return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_PIPE_POLYTETRAFLUOROETHYLENE)};
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) {
+ return new GTMTE_TFFTMultiHatch(super.mName, super.mTier, super.mDescriptionArray, super.mTextures);
+ }
+
+ @Override
+ public boolean isMachineBlockUpdateRecursive() {
+ return false;
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ outputting = !outputting;
+ GT_Utility.sendChatToPlayer(aPlayer, outputting ? "Auto-output enabled" : "Auto-output disabled");
+ }
+
+ @Override
+ public int getCapacity() {
+ return (mfh != null) ? mfh.getCapacity() : 0;
+ }
+
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ if (aBaseMetaTileEntity.isServerSide() && mfh != null) {
+ if(outputting && (aTick % 20 == 0)) {
+ doAutoOutputPerSecond(aBaseMetaTileEntity);
+ }
+ }
+ }
+
+ /**
+ * Handle the Multi Hatch's auto-output feature. Should be called once per second only.
+ * @param aBaseMetaTileEntity
+ * this MetaTileEntity
+ */
+ private void doAutoOutputPerSecond(IGregTechTileEntity aBaseMetaTileEntity) {
+ final ForgeDirection outSide = ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing());
+ final TileEntity adjacentTE = aBaseMetaTileEntity.getTileEntityOffset(outSide.offsetX, outSide.offsetY, outSide.offsetZ);
+ if(adjacentTE instanceof IFluidHandler) {
+ final IFluidHandler adjFH = (IFluidHandler) adjacentTE;
+ // Cycle through fluids
+ for(int i = 0; i < mfh.getDistinctFluids(); i++) {
+ final FluidStack fluidCopy = mfh.getFluidCopy(i);
+ // Make sure the adjacent IFluidHandler can accept this fluid
+ if(adjFH.canFill(outSide.getOpposite(), fluidCopy.getFluid())) {
+
+ // Limit to output rate
+ fluidCopy.amount = Math.min(fluidCopy.amount, vals.get(super.mTier));
+
+ // Test how much can be drawn
+ fluidCopy.amount = mfh.pullFluid(fluidCopy, false);
+
+ // Test how much can be filled (and fill if possible)
+ fluidCopy.amount = adjFH.fill(outSide.getOpposite(), fluidCopy, true);
+
+ // Actually deplete storage
+ mfh.pullFluid(fluidCopy, true);
+ }
+ }
+
+ }
+ }
+
+ @Override
+ public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
+ return (mfh != null) ? mfh.pushFluid(resource, doFill) : 0;
+ }
+
+ @Override
+ public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) {
+ return (mfh != null) ? new FluidStack(resource.getFluid(), mfh.pullFluid(resource, doDrain)) : null;
+ }
+
+ /**
+ * Drains fluid out of 0th internal tank.
+ * If the TFFT Controller contains an Integrated Circuit, drain fluid
+ * from the slot equal to the circuit configuration.
+ *
+ * @param from
+ * Orientation the fluid is drained to.
+ * @param maxDrain
+ * Maximum amount of fluid to drain.
+ * @param doDrain
+ * If false, drain will only be simulated.
+ * @return FluidStack representing the Fluid and amount that was (or would have been, if
+ * simulated) drained.
+ */
+ @Override
+ public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
+ if(mfh != null) {
+ final FluidStack drain = mfh.getFluidCopy(0);
+ if(drain != null) {
+ // If there's no integrated circuit in the T.F.F.T. controller, output slot 0
+ final byte selectedSlot = (mfh.getSelectedFluid() == -1) ? 0 : mfh.getSelectedFluid();
+
+ return new FluidStack(
+ drain.getFluid(),
+ mfh.pullFluid(new FluidStack(drain.getFluid(), maxDrain), selectedSlot, doDrain)
+ );
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public FluidTankInfo[] getTankInfo(ForgeDirection from) {
+ if (mfh == null)
+ return null;
+ FluidStack[] fluids = mfh.getAllFluids();
+ int length = fluids.length;
+ int maxCapcity = mfh.getCapacity();
+ FluidTankInfo[] tankInfo = new FluidTankInfo[length];
+ for (int i = 0; i < length; i++) {
+ tankInfo[i] = new FluidTankInfo(fluids[i],maxCapcity);
+ }
+ return tankInfo;
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean canTankBeFilled() {
+ return true;
+ }
+
+ @Override
+ public boolean canTankBeEmptied() {
+ return true;
+ }
+}
diff --git a/src/main/java/common/tileentities/TE_BeamTransmitter.java b/src/main/java/common/tileentities/TE_BeamTransmitter.java
new file mode 100644
index 0000000000..74cb845fc4
--- /dev/null
+++ b/src/main/java/common/tileentities/TE_BeamTransmitter.java
@@ -0,0 +1,47 @@
+package common.tileentities;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.AxisAlignedBB;
+import org.joml.Vector3i;
+import org.joml.Vector3ic;
+
+public class TE_BeamTransmitter extends TileEntity {
+
+ private final Vector3ic position;
+
+ private Vector3ic target = new Vector3i(10, 20, 10);
+ private double distanceCache;
+ private boolean distanceCacheValid = false;
+
+ public TE_BeamTransmitter() {
+ position = new Vector3i(super.xCoord, super.yCoord, super.zCoord);
+ }
+
+ public Vector3ic getTargetPosition() {
+ return target;
+ }
+
+ public double getDistanceFromTarget() {
+ if (!distanceCacheValid) {
+ distanceCache = position.distance(target);
+ distanceCacheValid = true;
+ }
+ return distanceCache;
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public double getMaxRenderDistanceSquared() {
+ // 4k is standard, 65k is what the vanilla beacon uses
+ return 65536.0D;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public AxisAlignedBB getRenderBoundingBox() {
+ // Make it so the beam is still rendered even when the source block is out of sight
+ return INFINITE_EXTENT_AABB;
+ }
+}
diff --git a/src/main/java/common/tileentities/TE_ItemServerIOPort.java b/src/main/java/common/tileentities/TE_ItemServerIOPort.java
deleted file mode 100644
index 0e96ff75b9..0000000000
--- a/src/main/java/common/tileentities/TE_ItemServerIOPort.java
+++ /dev/null
@@ -1,145 +0,0 @@
-package common.tileentities;
-
-import kekztech.MultiItemHandler;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.ISidedInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-
-public class TE_ItemServerIOPort extends TileEntity implements ISidedInventory {
-
- private MultiItemHandler mih;
-
- private int tickCounter = 0;
-
- public void setMultiItemHandler(MultiItemHandler mih) {
- this.mih = mih;
- }
-
- @Override
- public void updateEntity() {
- if(mih != null) {
-
- tickCounter++;
- if(tickCounter >= 40) {
- mih.debugPrint();
- tickCounter = 0;
- }
- }
- }
-
- @Override
- public int getSizeInventory() {
- return (mih != null) ? mih.getItemTypeCapacity() : 0;
- }
-
- @Override
- public ItemStack getStackInSlot(int slot) {
- return (mih != null) ? mih.getStackInSlot(slot) : null;
- }
-
- @Override
- public ItemStack decrStackSize(int slot, int amount) {
- if(mih != null) {
- if(mih.getStackInSlot(slot) != null) {
- final ItemStack obtained = mih.getStackInSlot(slot).copy();
- obtained.stackSize = mih.reduceStackInSlot(slot, amount);
- super.markDirty();
- return obtained;
- } else {
- return null;
- }
- } else {
- return null;
- }
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(int slot) {
- return null;
- }
-
- @Override
- public void setInventorySlotContents(int slot, ItemStack itemStack) {
- System.out.println("Set slot: " + slot);
- if(mih != null) {
- if(itemStack == null) {
- return;
- } else {
- if(!mih.insertStackInSlot(slot, itemStack)) {
- final int delta = itemStack.stackSize - mih.getStackInSlot(slot).stackSize;
- if(delta < 0) {
- System.out.println("Set slot reduce: " + itemStack.getDisplayName());
- mih.reduceStackInSlot(slot, delta);
- } else {
- System.out.println("Set slot increase: " + itemStack.getDisplayName());
- mih.increaseStackInSlot(slot, delta);
- }
-
- } else {
- System.out.println("Allocated new slot for: " + itemStack.getDisplayName());
- }
- super.markDirty();
- }
- }
- }
-
- @Override
- public String getInventoryName() {
- return "Item Server IO Port";
- }
-
- @Override
- public boolean hasCustomInventoryName() {
- return true;
- }
-
- @Override
- public int getInventoryStackLimit() {
- return (mih != null) ? mih.getPerTypeCapacity() : 0;
- }
-
- @Override
- public boolean isUseableByPlayer(EntityPlayer player) {
- return true;
- }
-
- @Override
- public void openInventory() {
-
- }
-
- @Override
- public void closeInventory() {
-
- }
-
- @Override
- public boolean isItemValidForSlot(int slot, ItemStack itemStack) {
- return (mih != null) ? (mih.getStackInSlot(slot).isItemEqual(itemStack) || mih.getStackInSlot(slot) == null) : false;
- }
-
- @Override
- public int[] getAccessibleSlotsFromSide(int side) {
- if(mih != null) {
- final int[] as = new int[mih.getItemTypeCapacity()];
- for(int i = 0; i < mih.getItemTypeCapacity(); i++) {
- as[i] = i;
- }
- return as;
- } else {
- return new int[1];
- }
- }
-
- @Override
- public boolean canInsertItem(int slot, ItemStack itemStack, int side) {
- return isItemValidForSlot(slot, itemStack);
- }
-
- @Override
- public boolean canExtractItem(int slot, ItemStack itemStack, int side) {
- return (mih != null) ? true : false;
- }
-
-}
diff --git a/src/main/java/common/tileentities/TE_TFFTMultiHatch.java b/src/main/java/common/tileentities/TE_TFFTMultiHatch.java
index c4f9451478..de274bb15e 100644
--- a/src/main/java/common/tileentities/TE_TFFTMultiHatch.java
+++ b/src/main/java/common/tileentities/TE_TFFTMultiHatch.java
@@ -1,11 +1,6 @@
package common.tileentities;
-import java.util.Iterator;
-import java.util.List;
-
-import common.Blocks;
import kekztech.MultiFluidHandler;
-import net.minecraft.block.Block;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
@@ -14,14 +9,26 @@ import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
+@Deprecated
public class TE_TFFTMultiHatch extends TileEntity implements IFluidHandler {
- private static final int OUTPUT_PER_SECOND = 1000; // L/s
-
+ public static final int BASE_OUTPUT_PER_SECOND = 2000; // L/s
+
+ private byte facings = 0x0;
+
private MultiFluidHandler mfh;
private int tickCounter = 0;
private boolean autoOutput = false;
-
+
+ public boolean hasFacingOnSide(byte side) {
+ final byte key = (byte) Math.pow(0x2, side);
+ return (facings & key) == key;
+ }
+
+ public void setFacingToSide(byte side) {
+ facings = (byte) Math.pow(0x2, side);
+ }
+
public void setMultiFluidHandler(MultiFluidHandler mfh) {
this.mfh = mfh;
}
@@ -36,90 +43,19 @@ public class TE_TFFTMultiHatch extends TileEntity implements IFluidHandler {
@Override
public void updateEntity() {
- if(!autoOutput || mfh == null) {
- return;
- }
-
- tickCounter++;
- if(tickCounter >= 20) {
-
- final ForgeDirection d = getOutwardsFacingDirection();
- if(d == ForgeDirection.UNKNOWN) {
- return;
- }
- final TileEntity t = this.getWorldObj().getTileEntity(
- this.xCoord + d.offsetX,
- this.yCoord + d.offsetY,
- this.zCoord + d.offsetZ);
-
- if(t instanceof IFluidHandler) {
-
- final IFluidHandler fh = (IFluidHandler) t;
-
- // Cycle through fluids
- final Iterator<FluidStack> volumes = mfh.getFluids().iterator();
- while(volumes.hasNext()) {
- final FluidStack volume = volumes.next();
-
- // Remember for later
- final int oVolume = volume.amount;
-
- // Use API methods
- if(fh.canFill(d.getOpposite(), volume.getFluid())) {
-
- // Test how much can be output
- final FluidStack copy = volume.copy();
- copy.amount = Math.min(copy.amount, OUTPUT_PER_SECOND);
-
- // How much is drawn
- copy.amount = mfh.pullFluid(copy, false);
-
- // Test how much can be filled (and fill if possible)
- copy.amount = fh.fill(d.getOpposite(), copy, true);
-
- // Actually deplete storage
- mfh.pullFluid(copy, true);
-
- // Prevent ConcurrentModificationException
- if(copy.amount >= oVolume) {
- break;
- }
- }
- }
- }
-
- tickCounter = 0;
- }
- }
-
- private ForgeDirection getOutwardsFacingDirection() {
- // TODO Revisit this once the hatch has a facing side
- // Look up which side has the storage field block and choose the other side.
- // This is important so the tank doesn't output into itself in case
- // there is another hatch next to this one.
- for(ForgeDirection direction : ForgeDirection.values()) {
-
- final Block b = this.getWorldObj().getBlock(this.xCoord + direction.offsetX, this.yCoord + direction.offsetY, this.zCoord + direction.offsetZ);
- if(b != null && (
- b.equals(Blocks.tfftStorageField1)
- || b.equals(Blocks.tfftStorageField2)
- || b.equals(Blocks.tfftStorageField3)
- || b.equals(Blocks.tfftStorageField4)
- || b.equals(Blocks.tfftStorageField5))) {
- return direction.getOpposite();
- }
- }
- return ForgeDirection.UNKNOWN;
+ // Removed deprecated code
}
@Override
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
- return (mfh != null) ? mfh.pushFluid(resource, doFill) : 0;
+ // Removed deprecated code
+ return 0;
}
@Override
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) {
- return (mfh != null) ? new FluidStack(resource.getFluid(), mfh.pullFluid(resource, doDrain)) : null;
+ // Removed deprecated code
+ return null;
}
/**
@@ -138,60 +74,40 @@ public class TE_TFFTMultiHatch extends TileEntity implements IFluidHandler {
*/
@Override
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
- if(mfh != null) {
- final FluidStack drain = mfh.getFluid(0);
- if(drain != null) {
- // If there's no integrated circuit in the T.F.F.T. controller, output slot 0
- final byte selectedSlot = (mfh.getSelectedFluid() == -1) ? 0 : mfh.getSelectedFluid();
-
- return new FluidStack(
- drain.getFluid(),
- mfh.pullFluid(new FluidStack(drain.getFluid(), maxDrain), selectedSlot, doDrain)
- );
- }
- }
+ // Removed deprecated code
return null;
}
@Override
public boolean canFill(ForgeDirection from, Fluid fluid) {
- return (mfh != null) && mfh.couldPush(new FluidStack(fluid, 1));
+ // Removed deprecated code
+ return false;
}
@Override
public boolean canDrain(ForgeDirection from, Fluid fluid) {
- return (mfh != null) && mfh.contains(new FluidStack(fluid, 1));
+ // Removed deprecated code
+ return false;
}
@Override
public FluidTankInfo[] getTankInfo(ForgeDirection from) {
- if(mfh == null) {
- return null;
- }
- final List<FluidStack> fluids = mfh.getFluids();
- final FluidTankInfo[] tankInfo = new FluidTankInfo[fluids.size()];
- for(int i = 0; i < tankInfo.length; i++) {
- tankInfo[i] = new FluidTankInfo(fluids.get(i), mfh.getCapacity());
- }
- return tankInfo;
+ // Removed deprecated code
+ return null;
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
- nbt = (nbt == null) ? new NBTTagCompound() : nbt;
-
- nbt.setBoolean("autoOutput", autoOutput);
-
super.writeToNBT(nbt);
+ nbt.setBoolean("autoOutput", autoOutput);
+ nbt.setByte("facings", facings);
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
- nbt = (nbt == null) ? new NBTTagCompound() : nbt;
-
- autoOutput = nbt.getBoolean("autoOutput");
-
super.readFromNBT(nbt);
+ autoOutput = nbt.getBoolean("autoOutput");
+ facings = nbt.getByte("facings");
}