diff options
author | kekzdealer <kekzdealer@gmail.com> | 2019-10-09 02:43:07 +0200 |
---|---|---|
committer | kekzdealer <kekzdealer@gmail.com> | 2019-10-09 02:43:07 +0200 |
commit | 820ca984d2dea005a126ef585661503f8cc992f5 (patch) | |
tree | bca38b81b17c435e493bf8030fad31ffe5d6d9bc /src | |
parent | 187fbf985078ee89f12a287a6754f2023c5e16be (diff) | |
download | GT5-Unofficial-820ca984d2dea005a126ef585661503f8cc992f5.tar.gz GT5-Unofficial-820ca984d2dea005a126ef585661503f8cc992f5.tar.bz2 GT5-Unofficial-820ca984d2dea005a126ef585661503f8cc992f5.zip |
improved T.F.F.T code; Prepared for MultiHatch
Diffstat (limited to 'src')
40 files changed, 3514 insertions, 3254 deletions
diff --git a/src/main/java/blocks/Block_GDCUnit.java b/src/main/java/blocks/Block_GDCUnit.java index d11681b1d6..ed778b5e8d 100644 --- a/src/main/java/blocks/Block_GDCUnit.java +++ b/src/main/java/blocks/Block_GDCUnit.java @@ -1,29 +1,31 @@ -package blocks; - -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_GDCUnit extends Block { - - private static Block_GDCUnit instance = new Block_GDCUnit(); - - private Block_GDCUnit() { - // I am a singleton - super(Material.iron); - } - - public static Block_GDCUnit getInstance() { - return instance; - } - - public void registerBlock() { - final String blockName = "kekztech_gdcceramicelectrolyteunit_block"; - super.setBlockName(blockName); - super.setCreativeTab(CreativeTabs.tabMisc); - super.setBlockTextureName(KekzCore.MODID + ":" + "GDCCeramicElectrolyteUnit"); - GameRegistry.registerBlock(getInstance(), blockName); - } -} +package blocks;
+
+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_GDCUnit extends Block {
+
+ private static Block_GDCUnit instance = new Block_GDCUnit();
+
+ private Block_GDCUnit() {
+ // I am a singleton
+ super(Material.iron);
+ }
+
+ public static Block_GDCUnit getInstance() {
+ return instance;
+ }
+
+ public void registerBlock() {
+ final String blockName = "kekztech_gdcceramicelectrolyteunit_block";
+ super.setBlockName(blockName);
+ super.setCreativeTab(CreativeTabs.tabMisc);
+ super.setBlockTextureName(KekzCore.MODID + ":" + "GDCCeramicElectrolyteUnit");
+ super.setHardness(5.0f);
+ super.setResistance(6.0f);
+ GameRegistry.registerBlock(getInstance(), blockName);
+ }
+}
diff --git a/src/main/java/blocks/Block_TFFTCasing.java b/src/main/java/blocks/Block_TFFTCasing.java index eb47860418..f2011a8bae 100644 --- a/src/main/java/blocks/Block_TFFTCasing.java +++ b/src/main/java/blocks/Block_TFFTCasing.java @@ -1,29 +1,31 @@ -package blocks; - -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_TFFTCasing extends Block { - - private static Block_TFFTCasing instance = new Block_TFFTCasing(); - - private Block_TFFTCasing() { - // I am a singleton - super(Material.iron); - } - - public static Block_TFFTCasing getInstance() { - return instance; - } - - public void registerBlock() { - final String blockName = "kekztech_tfftcasing_block"; - super.setBlockName(blockName); - super.setCreativeTab(CreativeTabs.tabMisc); - super.setBlockTextureName(KekzCore.MODID + ":" + "TFFTCasing"); - GameRegistry.registerBlock(getInstance(), blockName); - } -} +package blocks;
+
+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_TFFTCasing extends Block {
+
+ private static Block_TFFTCasing instance = new Block_TFFTCasing();
+
+ private Block_TFFTCasing() {
+ // I am a singleton
+ super(Material.iron);
+ }
+
+ public static Block_TFFTCasing getInstance() {
+ return instance;
+ }
+
+ public void registerBlock() {
+ final String blockName = "kekztech_tfftcasing_block";
+ super.setBlockName(blockName);
+ super.setCreativeTab(CreativeTabs.tabMisc);
+ super.setBlockTextureName(KekzCore.MODID + ":" + "TFFTCasing");
+ super.setHardness(5.0f);
+ super.setResistance(6.0f);
+ GameRegistry.registerBlock(getInstance(), blockName);
+ }
+}
diff --git a/src/main/java/blocks/Block_TFFTStorageFieldBlockT1.java b/src/main/java/blocks/Block_TFFTStorageFieldBlockT1.java index 9a94f06121..28d23eec73 100644 --- a/src/main/java/blocks/Block_TFFTStorageFieldBlockT1.java +++ b/src/main/java/blocks/Block_TFFTStorageFieldBlockT1.java @@ -1,31 +1,33 @@ -package blocks; - -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_TFFTStorageFieldBlockT1 extends Block { - - private static Block_TFFTStorageFieldBlockT1 instance = new Block_TFFTStorageFieldBlockT1(); - - private Block_TFFTStorageFieldBlockT1() { - // I am a singleton - super(Material.iron); - } - - public static Block_TFFTStorageFieldBlockT1 getInstance() { - return instance; - } - - public void registerBlock() { - final String blockName = "kekztech_tfftstoragefieldblock1_block"; - super.setBlockName(blockName); - super.setCreativeTab(CreativeTabs.tabMisc); - super.setBlockTextureName(KekzCore.MODID + ":" + "TFFTStorageFieldBlock1"); - GameRegistry.registerBlock(getInstance(), blockName); - } - - -} +package blocks;
+
+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_TFFTStorageFieldBlockT1 extends Block {
+
+ private static Block_TFFTStorageFieldBlockT1 instance = new Block_TFFTStorageFieldBlockT1();
+
+ private Block_TFFTStorageFieldBlockT1() {
+ // I am a singleton
+ super(Material.iron);
+ }
+
+ public static Block_TFFTStorageFieldBlockT1 getInstance() {
+ return instance;
+ }
+
+ public void registerBlock() {
+ final String blockName = "kekztech_tfftstoragefieldblock1_block";
+ super.setBlockName(blockName);
+ super.setCreativeTab(CreativeTabs.tabMisc);
+ super.setBlockTextureName(KekzCore.MODID + ":" + "TFFTStorageFieldBlock1");
+ super.setHardness(5.0f);
+ super.setResistance(6.0f);
+ GameRegistry.registerBlock(getInstance(), blockName);
+ }
+
+
+}
diff --git a/src/main/java/blocks/Block_TFFTStorageFieldBlockT2.java b/src/main/java/blocks/Block_TFFTStorageFieldBlockT2.java index 965e06dc54..51ddd93a7b 100644 --- a/src/main/java/blocks/Block_TFFTStorageFieldBlockT2.java +++ b/src/main/java/blocks/Block_TFFTStorageFieldBlockT2.java @@ -1,29 +1,31 @@ -package blocks; - -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_TFFTStorageFieldBlockT2 extends Block { - - private static Block_TFFTStorageFieldBlockT2 instance = new Block_TFFTStorageFieldBlockT2(); - - private Block_TFFTStorageFieldBlockT2() { - // I am a singleton - super(Material.iron); - } - - public static Block_TFFTStorageFieldBlockT2 getInstance() { - return instance; - } - - public void registerBlock() { - final String blockName = "kekztech_tfftstoragefieldblock2_block"; - super.setBlockName(blockName); - super.setCreativeTab(CreativeTabs.tabMisc); - super.setBlockTextureName(KekzCore.MODID + ":" + "TFFTStorageFieldBlock2"); - GameRegistry.registerBlock(getInstance(), blockName); - } -} +package blocks;
+
+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_TFFTStorageFieldBlockT2 extends Block {
+
+ private static Block_TFFTStorageFieldBlockT2 instance = new Block_TFFTStorageFieldBlockT2();
+
+ private Block_TFFTStorageFieldBlockT2() {
+ // I am a singleton
+ super(Material.iron);
+ }
+
+ public static Block_TFFTStorageFieldBlockT2 getInstance() {
+ return instance;
+ }
+
+ public void registerBlock() {
+ final String blockName = "kekztech_tfftstoragefieldblock2_block";
+ super.setBlockName(blockName);
+ super.setCreativeTab(CreativeTabs.tabMisc);
+ super.setBlockTextureName(KekzCore.MODID + ":" + "TFFTStorageFieldBlock2");
+ super.setHardness(5.0f);
+ super.setResistance(6.0f);
+ GameRegistry.registerBlock(getInstance(), blockName);
+ }
+}
diff --git a/src/main/java/blocks/Block_TFFTStorageFieldBlockT3.java b/src/main/java/blocks/Block_TFFTStorageFieldBlockT3.java index 79647c99b7..174812bc48 100644 --- a/src/main/java/blocks/Block_TFFTStorageFieldBlockT3.java +++ b/src/main/java/blocks/Block_TFFTStorageFieldBlockT3.java @@ -1,29 +1,31 @@ -package blocks; - -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_TFFTStorageFieldBlockT3 extends Block { - - private static Block_TFFTStorageFieldBlockT3 instance = new Block_TFFTStorageFieldBlockT3(); - - private Block_TFFTStorageFieldBlockT3() { - // I am a singleton - super(Material.iron); - } - - public static Block_TFFTStorageFieldBlockT3 getInstance() { - return instance; - } - - public void registerBlock() { - final String blockName = "kekztech_tfftstoragefieldblock3_block"; - super.setBlockName(blockName); - super.setCreativeTab(CreativeTabs.tabMisc); - super.setBlockTextureName(KekzCore.MODID + ":" + "TFFTStorageFieldBlock3"); - GameRegistry.registerBlock(getInstance(), blockName); - } -} +package blocks;
+
+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_TFFTStorageFieldBlockT3 extends Block {
+
+ private static Block_TFFTStorageFieldBlockT3 instance = new Block_TFFTStorageFieldBlockT3();
+
+ private Block_TFFTStorageFieldBlockT3() {
+ // I am a singleton
+ super(Material.iron);
+ }
+
+ public static Block_TFFTStorageFieldBlockT3 getInstance() {
+ return instance;
+ }
+
+ public void registerBlock() {
+ final String blockName = "kekztech_tfftstoragefieldblock3_block";
+ super.setBlockName(blockName);
+ super.setCreativeTab(CreativeTabs.tabMisc);
+ super.setBlockTextureName(KekzCore.MODID + ":" + "TFFTStorageFieldBlock3");
+ super.setHardness(5.0f);
+ super.setResistance(6.0f);
+ GameRegistry.registerBlock(getInstance(), blockName);
+ }
+}
diff --git a/src/main/java/blocks/Block_TFFTStorageFieldBlockT4.java b/src/main/java/blocks/Block_TFFTStorageFieldBlockT4.java index 5dd20cabcf..0ea69237e6 100644 --- a/src/main/java/blocks/Block_TFFTStorageFieldBlockT4.java +++ b/src/main/java/blocks/Block_TFFTStorageFieldBlockT4.java @@ -1,29 +1,31 @@ -package blocks; - -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_TFFTStorageFieldBlockT4 extends Block { - - private static Block_TFFTStorageFieldBlockT4 instance = new Block_TFFTStorageFieldBlockT4(); - - private Block_TFFTStorageFieldBlockT4() { - // I am a singleton - super(Material.iron); - } - - public static Block_TFFTStorageFieldBlockT4 getInstance() { - return instance; - } - - public void registerBlock() { - final String blockName = "kekztech_tfftstoragefieldblock4_block"; - super.setBlockName(blockName); - super.setCreativeTab(CreativeTabs.tabMisc); - super.setBlockTextureName(KekzCore.MODID + ":" + "TFFTStorageFieldBlock4"); - GameRegistry.registerBlock(getInstance(), blockName); - } -} +package blocks;
+
+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_TFFTStorageFieldBlockT4 extends Block {
+
+ private static Block_TFFTStorageFieldBlockT4 instance = new Block_TFFTStorageFieldBlockT4();
+
+ private Block_TFFTStorageFieldBlockT4() {
+ // I am a singleton
+ super(Material.iron);
+ }
+
+ public static Block_TFFTStorageFieldBlockT4 getInstance() {
+ return instance;
+ }
+
+ public void registerBlock() {
+ final String blockName = "kekztech_tfftstoragefieldblock4_block";
+ super.setBlockName(blockName);
+ super.setCreativeTab(CreativeTabs.tabMisc);
+ super.setBlockTextureName(KekzCore.MODID + ":" + "TFFTStorageFieldBlock4");
+ super.setHardness(5.0f);
+ super.setResistance(6.0f);
+ GameRegistry.registerBlock(getInstance(), blockName);
+ }
+}
diff --git a/src/main/java/blocks/Block_YSZUnit.java b/src/main/java/blocks/Block_YSZUnit.java index 1e4df40c67..a32b28e94d 100644 --- a/src/main/java/blocks/Block_YSZUnit.java +++ b/src/main/java/blocks/Block_YSZUnit.java @@ -1,29 +1,31 @@ -package blocks; - -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_YSZUnit extends Block { - - private static Block_YSZUnit instance = new Block_YSZUnit(); - - private Block_YSZUnit() { - // I am a singleton - super(Material.iron); - } - - public static Block_YSZUnit getInstance() { - return instance; - } - - public void registerBlock() { - final String blockName = "kekztech_yszceramicelectrolyteunit_block"; - super.setBlockName(blockName); - super.setCreativeTab(CreativeTabs.tabMisc); - super.setBlockTextureName(KekzCore.MODID + ":" + "YSZCeramicElectrolyteUnit"); - GameRegistry.registerBlock(getInstance(), blockName); - } -} +package blocks;
+
+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_YSZUnit extends Block {
+
+ private static Block_YSZUnit instance = new Block_YSZUnit();
+
+ private Block_YSZUnit() {
+ // I am a singleton
+ super(Material.iron);
+ }
+
+ public static Block_YSZUnit getInstance() {
+ return instance;
+ }
+
+ public void registerBlock() {
+ final String blockName = "kekztech_yszceramicelectrolyteunit_block";
+ super.setBlockName(blockName);
+ super.setCreativeTab(CreativeTabs.tabMisc);
+ super.setBlockTextureName(KekzCore.MODID + ":" + "YSZCeramicElectrolyteUnit");
+ super.setHardness(5.0f);
+ super.setResistance(6.0f);
+ GameRegistry.registerBlock(getInstance(), blockName);
+ }
+}
diff --git a/src/main/java/container/Container_ModularNuclearReactor.java b/src/main/java/container/Container_ModularNuclearReactor.java index 41b686c901..a8fdd5f25a 100644 --- a/src/main/java/container/Container_ModularNuclearReactor.java +++ b/src/main/java/container/Container_ModularNuclearReactor.java @@ -1,70 +1,70 @@ -package container; - -import gregtech.api.gui.GT_Container_MultiMachine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import reactor.ButtonSlot; -import tileentities.GTMTE_ModularNuclearReactor; - -public class Container_ModularNuclearReactor extends GT_Container_MultiMachine { - - private final GTMTE_ModularNuclearReactor REACTOR_TILE; - private final IInventory PLAYER_INVENTORY; - - private int nextSlotID = 0; - private final Slot[] REACTOR_SLOTS = new Slot[54]; - private final Slot SLOT_CONFIGURATION; - private final Slot BUTTON_EU_MODE; - private final Slot BUTTON_FLUID_MODE; - private final Slot BUTTON_CONDITION; - private final Slot BUTTON_CONFIGURE; - private final Slot BUTTON_RESET; - - - public Container_ModularNuclearReactor(InventoryPlayer inventoryPlayer, IGregTechTileEntity reactorTile) { - - super(inventoryPlayer, reactorTile); - - this.REACTOR_TILE = (GTMTE_ModularNuclearReactor) reactorTile; - this.PLAYER_INVENTORY = inventoryPlayer; - - // Add the reactor chamber - for(int x = 0; x < 9; x++) { - for(int y = 0; y < 6; y++){ - REACTOR_SLOTS[nextSlotID] = super.addSlotToContainer(new Slot(PLAYER_INVENTORY, getNextSlotID(), (16 + 67 * x), (16 + 67 * y))); - } - } - // Add the configuration slot - SLOT_CONFIGURATION = super.addSlotToContainer(new Slot(PLAYER_INVENTORY, getNextSlotID(), 0, 0)); - - // Add buttons (they're also slots) - BUTTON_EU_MODE = super.addSlotToContainer(new ButtonSlot(PLAYER_INVENTORY, getNextSlotID(), 0, 0)); - BUTTON_FLUID_MODE = super.addSlotToContainer(new ButtonSlot(PLAYER_INVENTORY, getNextSlotID(), 0, 0)); - BUTTON_CONDITION = super.addSlotToContainer(new ButtonSlot(PLAYER_INVENTORY, getNextSlotID(), 0, 0)); - BUTTON_CONFIGURE = super.addSlotToContainer(new ButtonSlot(PLAYER_INVENTORY, getNextSlotID(), 0, 0)); - BUTTON_RESET = super.addSlotToContainer(new ButtonSlot(PLAYER_INVENTORY, getNextSlotID(), 0, 0)); - - } - - private int getNextSlotID() { - nextSlotID++; - return nextSlotID - 1; - } - - @Override - public boolean canInteractWith(EntityPlayer p_75145_1_) { - return true; - } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - if (REACTOR_TILE.getBaseMetaTileEntity().isServerSide() == false) { - return; - } - } - -} +package container;
+
+import gregtech.api.gui.GT_Container_MultiMachine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import reactor.ButtonSlot;
+import tileentities.GTMTE_ModularNuclearReactor;
+
+public class Container_ModularNuclearReactor extends GT_Container_MultiMachine {
+
+ private final GTMTE_ModularNuclearReactor REACTOR_TILE;
+ private final IInventory PLAYER_INVENTORY;
+
+ private int nextSlotID = 0;
+ private final Slot[] REACTOR_SLOTS = new Slot[54];
+ private final Slot SLOT_CONFIGURATION;
+ private final Slot BUTTON_EU_MODE;
+ private final Slot BUTTON_FLUID_MODE;
+ private final Slot BUTTON_CONDITION;
+ private final Slot BUTTON_CONFIGURE;
+ private final Slot BUTTON_RESET;
+
+
+ public Container_ModularNuclearReactor(InventoryPlayer inventoryPlayer, IGregTechTileEntity reactorTile) {
+
+ super(inventoryPlayer, reactorTile);
+
+ this.REACTOR_TILE = (GTMTE_ModularNuclearReactor) reactorTile;
+ this.PLAYER_INVENTORY = inventoryPlayer;
+
+ // Add the reactor chamber
+ for(int x = 0; x < 9; x++) {
+ for(int y = 0; y < 6; y++){
+ REACTOR_SLOTS[nextSlotID] = super.addSlotToContainer(new Slot(PLAYER_INVENTORY, getNextSlotID(), (16 + 67 * x), (16 + 67 * y)));
+ }
+ }
+ // Add the configuration slot
+ SLOT_CONFIGURATION = super.addSlotToContainer(new Slot(PLAYER_INVENTORY, getNextSlotID(), 0, 0));
+
+ // Add buttons (they're also slots)
+ BUTTON_EU_MODE = super.addSlotToContainer(new ButtonSlot(PLAYER_INVENTORY, getNextSlotID(), 0, 0));
+ BUTTON_FLUID_MODE = super.addSlotToContainer(new ButtonSlot(PLAYER_INVENTORY, getNextSlotID(), 0, 0));
+ BUTTON_CONDITION = super.addSlotToContainer(new ButtonSlot(PLAYER_INVENTORY, getNextSlotID(), 0, 0));
+ BUTTON_CONFIGURE = super.addSlotToContainer(new ButtonSlot(PLAYER_INVENTORY, getNextSlotID(), 0, 0));
+ BUTTON_RESET = super.addSlotToContainer(new ButtonSlot(PLAYER_INVENTORY, getNextSlotID(), 0, 0));
+
+ }
+
+ private int getNextSlotID() {
+ nextSlotID++;
+ return nextSlotID - 1;
+ }
+
+ @Override
+ public boolean canInteractWith(EntityPlayer p_75145_1_) {
+ return true;
+ }
+
+ @Override
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ if (REACTOR_TILE.getBaseMetaTileEntity().isServerSide() == false) {
+ return;
+ }
+ }
+
+}
diff --git a/src/main/java/container/GUIContainer_ModularNuclearReactor.java b/src/main/java/container/GUIContainer_ModularNuclearReactor.java index 58a9ff6caf..9bea52badc 100644 --- a/src/main/java/container/GUIContainer_ModularNuclearReactor.java +++ b/src/main/java/container/GUIContainer_ModularNuclearReactor.java @@ -1,53 +1,53 @@ -package container; - -import org.lwjgl.opengl.GL11; - -import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import kekztech.KekzCore; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; - -public class GUIContainer_ModularNuclearReactor extends GT_GUIContainerMetaTile_Machine { - - private final String resourceName; - private final ResourceLocation texture; - - public GUIContainer_ModularNuclearReactor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, - String aName, String aTextureFile) { - - super(new Container_ModularNuclearReactor(aInventoryPlayer, aTileEntity), aTextureFile); - - this.resourceName = aTextureFile; - this.texture = new ResourceLocation(KekzCore.MODID, "textures/gui/" + resourceName); - } - - @SuppressWarnings("unchecked") - @Override - public void initGui() { - super.initGui(); - - // The parameters of GuiButton are (id, x, y, width, height, text) - super.buttonList.add(new GuiButton(1, 100, 200, 100, 20, "Hello")); - } - - @Override - protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) { - - Minecraft.getMinecraft().renderEngine.bindTexture(texture); - GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); - - final int x = (super.width - super.xSize); - final int y = (super.height - super.ySize); - - super.drawTexturedModalRect(x, y, 0, 0, super.xSize, super.ySize); - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - - } - -} +package container;
+
+import org.lwjgl.opengl.GL11;
+
+import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import kekztech.KekzCore;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.GuiButton;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.util.ResourceLocation;
+
+public class GUIContainer_ModularNuclearReactor extends GT_GUIContainerMetaTile_Machine {
+
+ private final String resourceName;
+ private final ResourceLocation texture;
+
+ public GUIContainer_ModularNuclearReactor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity,
+ String aName, String aTextureFile) {
+
+ super(new Container_ModularNuclearReactor(aInventoryPlayer, aTileEntity), aTextureFile);
+
+ this.resourceName = aTextureFile;
+ this.texture = new ResourceLocation(KekzCore.MODID, "textures/gui/" + resourceName);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void initGui() {
+ super.initGui();
+
+ // The parameters of GuiButton are (id, x, y, width, height, text)
+ super.buttonList.add(new GuiButton(1, 100, 200, 100, 20, "Hello"));
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
+
+ Minecraft.getMinecraft().renderEngine.bindTexture(texture);
+ GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
+
+ final int x = (super.width - super.xSize);
+ final int y = (super.height - super.ySize);
+
+ super.drawTexturedModalRect(x, y, 0, 0, super.xSize, super.ySize);
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+
+ }
+
+}
diff --git a/src/main/java/items/ErrorItem.java b/src/main/java/items/ErrorItem.java index e622197565..0ab41873f1 100644 --- a/src/main/java/items/ErrorItem.java +++ b/src/main/java/items/ErrorItem.java @@ -1,43 +1,50 @@ -package 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; - -public class ErrorItem extends Item { - - private static final ErrorItem instance = new ErrorItem(); - - private ErrorItem() { - // I am a singleton - } - - 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", "rawtypes"}) - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean b) { - list.add("REMINDER: KekzTech recipes are only confirmed 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"); - } - -} +package 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() {
+ // I am a singleton
+ }
+
+ 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", "rawtypes"})
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean b) {
+ list.add("REMINDER: KekzTech recipes are only confirmed 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/items/MetaItem_CraftingComponent.java b/src/main/java/items/MetaItem_CraftingComponent.java index 29b8e8ac1f..0d6a1897f0 100644 --- a/src/main/java/items/MetaItem_CraftingComponent.java +++ b/src/main/java/items/MetaItem_CraftingComponent.java @@ -1,103 +1,103 @@ -package 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 MetaItem_CraftingComponent instance = new MetaItem_CraftingComponent(); - private final IIcon[] icons = new IIcon[16]; - - private MetaItem_CraftingComponent() { - // I am a singleton - } - - 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 = 0; - // 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", "rawtypes"}) - @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", "rawtypes"}) - @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); - } - -} +package 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 MetaItem_CraftingComponent instance = new MetaItem_CraftingComponent();
+ private final IIcon[] icons = new IIcon[16];
+
+ private MetaItem_CraftingComponent() {
+ // I am a singleton
+ }
+
+ 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 = 0;
+ // 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", "rawtypes"})
+ @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", "rawtypes"})
+ @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/items/MetaItem_ReactorComponent.java b/src/main/java/items/MetaItem_ReactorComponent.java index 458de48a00..9a8d668a40 100644 --- a/src/main/java/items/MetaItem_ReactorComponent.java +++ b/src/main/java/items/MetaItem_ReactorComponent.java @@ -1,140 +1,140 @@ -package 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.nbt.NBTTagCompound; -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 MetaItem_ReactorComponent instance = new MetaItem_ReactorComponent(); - private final IIcon[] icons = new IIcon[50]; - - private MetaItem_ReactorComponent() { - // I am a singleton - } - - 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", "rawtypes"}) - @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", "rawtypes"}) - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean b) { - list.add("Part for the Modular Nuclear Reactor"); - } - - @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(); - if(meta >= 31 && meta <= 45) { - return false; - } else { - return true; - } - } - - public ItemStack getStackFromDamage(int meta) { - return new ItemStack(getInstance(), 1, meta); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} +package 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.nbt.NBTTagCompound;
+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 MetaItem_ReactorComponent instance = new MetaItem_ReactorComponent();
+ private final IIcon[] icons = new IIcon[50];
+
+ private MetaItem_ReactorComponent() {
+ // I am a singleton
+ }
+
+ 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", "rawtypes"})
+ @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", "rawtypes"})
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean b) {
+ list.add("Part for the Modular Nuclear Reactor");
+ }
+
+ @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();
+ if(meta >= 31 && meta <= 45) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+ public ItemStack getStackFromDamage(int meta) {
+ return new ItemStack(getInstance(), 1, meta);
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
diff --git a/src/main/java/kekztech/GTMultiController.java b/src/main/java/kekztech/GTMultiController.java index d824077201..2138907faa 100644 --- a/src/main/java/kekztech/GTMultiController.java +++ b/src/main/java/kekztech/GTMultiController.java @@ -1,305 +1,305 @@ -package kekztech; - -import java.util.ArrayList; - -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; -import gregtech.api.util.GT_Utility; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; - -/** - * Only purpose of this class is to make me learn about GT multis :) - * @author Kekzdealer - * - */ -public abstract class GTMultiController { - - private final GTRecipe GT_RECIPE = new GTRecipe(); - - private boolean running = false; - private boolean structureValid = false; - - public final ArrayList<GT_MetaTileEntity_Hatch_Dynamo> mDynamoHatches = new ArrayList<>(); - public final ArrayList<GT_MetaTileEntity_Hatch_Energy> mEnergyHatches = new ArrayList<>(); - public final ArrayList<GT_MetaTileEntity_Hatch_Input> mInputHatches = new ArrayList<>(); - public final ArrayList<GT_MetaTileEntity_Hatch_Output> mOutputHatches = new ArrayList<>(); - public final ArrayList<GT_MetaTileEntity_Hatch_InputBus> mInputBusses = new ArrayList<>(); - public final ArrayList<GT_MetaTileEntity_Hatch_OutputBus> mOutputBusses = new ArrayList<>(); - public final ArrayList<GT_MetaTileEntity_Hatch_Muffler> mMufflerHatches = new ArrayList<>(); - public final ArrayList<GT_MetaTileEntity_Hatch_Maintenance> mMaintenanceHatches = new ArrayList<>(); - - protected GTRecipe getGT_RECIPE() { - return GT_RECIPE; - } - - protected abstract boolean checkStructure(); - protected abstract String[] getDescription(); - - protected long getMaxInputVoltage() { - long voltage = 0L; - for(GT_MetaTileEntity_Hatch_Energy energyHatch : mEnergyHatches) { - voltage += energyHatch.getBaseMetaTileEntity().getInputVoltage(); - } - return voltage; - } - - private void updateDynamoHatches() { - if(GT_RECIPE.getEuPerTick() > 0) { - long remOutput = GT_RECIPE.getEuPerTick(); - for(GT_MetaTileEntity_Hatch_Dynamo dynamoHatch : mDynamoHatches) { - final long deltaCapacity = dynamoHatch.getBaseMetaTileEntity().getEUCapacity() - - dynamoHatch.getBaseMetaTileEntity().getStoredEU(); - final long toOutput = Math.min(deltaCapacity, GT_RECIPE.getEuPerTick()); - dynamoHatch.getBaseMetaTileEntity().increaseStoredEnergyUnits(toOutput, false); - remOutput -= toOutput; - } - } - } - - private void updateEnergyHatches() { - if(GT_RECIPE.getEuPerTick() < 0) { - long remConsumption = GT_RECIPE.getEuPerTick(); - for(GT_MetaTileEntity_Hatch_Energy energyHatch : mEnergyHatches) { - if(remConsumption > 0) { - final long toConsume = Math.min(remConsumption, energyHatch.getBaseMetaTileEntity().getStoredEU()); - energyHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(toConsume, false); - remConsumption -= toConsume; - } - } - } - } - - private void updateInputBusses() { - if(GT_RECIPE.getInputItems() != null) { - // Check for each input stack... - for(ItemStack inputStack : GT_RECIPE.getInputItems()) { - int remainingRequired = inputStack.stackSize; - // ...Each slot in each input bus... - for(GT_MetaTileEntity_Hatch_InputBus inputBus : mInputBusses) { - for(int slot = 0; slot <= inputBus.getBaseMetaTileEntity().getSizeInventory(); slot++) { - - final ItemStack slotStack = inputBus.getBaseMetaTileEntity().getStackInSlot(slot); - if(GT_Utility.isStackValid(slotStack)) { - if(GT_Utility.areStacksEqual(inputStack, slotStack)) { - // Found correct slot - final int toConsume = Math.min(slotStack.stackSize, inputStack.stackSize); - final ItemStack retrievedStack = inputBus.getBaseMetaTileEntity().decrStackSize(slot, toConsume); - } - } - } - } - } - } - } - - private void updateInputHatches() { - if(GT_RECIPE.getInputFluids() != null) { - // Check for each input stack - for(FluidStack inputStack : GT_RECIPE.getInputFluids()) { - int remainingRequired = inputStack.amount; - // ...In each input hatch... - for(GT_MetaTileEntity_Hatch_Input inputHatch : mInputHatches) { - - FluidStack slotStack = inputHatch.getFluid(); - if(slotStack.amount > 0 && slotStack.isFluidEqual(inputStack)) { - // Found correct hatch - final int toConsume = Math.min(slotStack.amount, remainingRequired); - inputHatch.drain(toConsume, true); - remainingRequired -= toConsume; - } - } - } - } - } - - private void updateOutputBusses() { - if(GT_RECIPE.getOutputItems() != null) { - - } - } - - private void updateOutputHatches() { - if(GT_RECIPE.getOutputFluids() != null) { - // Find for each output stack... - for(FluidStack outputStack : GT_RECIPE.getOutputFluids()) { - // ...an output hatch that can accept the stack - for(GT_MetaTileEntity_Hatch_Output outputHatch : mOutputHatches) { - - } - } - } - } - - protected boolean tryAddHatch(IGregTechTileEntity hatch, int aBaseCasingIndex) { - if (hatch == null) { - return false; - } else { - final IMetaTileEntity aMetaTileEntity = hatch.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } else { - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - } - - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) { - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) { - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) { - return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) { - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); - } else { - return aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler - ? this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity) - : false; - } - } - } - } - - protected boolean tryAddMaintenanceHatch(IGregTechTileEntity hatch, int aBaseCasingIndex) { - if (hatch == null) { - return false; - } else { - IMetaTileEntity aMetaTileEntity = hatch.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity); - } else { - return false; - } - } - } - - protected boolean tryAddEnergyHatch(IGregTechTileEntity hatch, int aBaseCasingIndex) { - if (hatch == null) { - return false; - } else { - IMetaTileEntity aMetaTileEntity = hatch.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); - } else { - return false; - } - } - } - - protected boolean tryAddDynamoHatch(IGregTechTileEntity hatch, int aBaseCasingIndex) { - if (hatch == null) { - return false; - } else { - IMetaTileEntity aMetaTileEntity = hatch.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity); - } else { - return false; - } - } - } - - protected boolean tryAddMufflerHatch(IGregTechTileEntity hatch, int aBaseCasingIndex) { - if (hatch == null) { - return false; - } else { - IMetaTileEntity aMetaTileEntity = hatch.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); - } else { - return false; - } - } - } - - protected boolean tryAddInputBus(IGregTechTileEntity hatch, int aBaseCasingIndex) { - if (hatch == null) { - return false; - } else { - IMetaTileEntity aMetaTileEntity = hatch.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); - } else { - return false; - } - } - } - - protected boolean tryAddInputHatch(IGregTechTileEntity hatch, int aBaseCasingIndex) { - if (hatch == null) { - return false; - } else { - IMetaTileEntity aMetaTileEntity = hatch.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); - } else { - return false; - } - } - } - - protected boolean tryAddOutputBus(IGregTechTileEntity hatch, int aBaseCasingIndex) { - if (hatch == null) { - return false; - } else { - IMetaTileEntity aMetaTileEntity = hatch.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); - } else { - return false; - } - } - } - - protected boolean tryAddOutputHatch(IGregTechTileEntity hatch, int aBaseCasingIndex) { - if (hatch == null) { - return false; - } else { - IMetaTileEntity aMetaTileEntity = hatch.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); - } else { - return false; - } - } - } -} +package kekztech;
+
+import java.util.ArrayList;
+
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+
+/**
+ * Only purpose of this class is to make me learn about GT multis :)
+ * @author Kekzdealer
+ *
+ */
+public abstract class GTMultiController {
+
+ private final GTRecipe GT_RECIPE = new GTRecipe();
+
+ private boolean running = false;
+ private boolean structureValid = false;
+
+ public final ArrayList<GT_MetaTileEntity_Hatch_Dynamo> mDynamoHatches = new ArrayList<>();
+ public final ArrayList<GT_MetaTileEntity_Hatch_Energy> mEnergyHatches = new ArrayList<>();
+ public final ArrayList<GT_MetaTileEntity_Hatch_Input> mInputHatches = new ArrayList<>();
+ public final ArrayList<GT_MetaTileEntity_Hatch_Output> mOutputHatches = new ArrayList<>();
+ public final ArrayList<GT_MetaTileEntity_Hatch_InputBus> mInputBusses = new ArrayList<>();
+ public final ArrayList<GT_MetaTileEntity_Hatch_OutputBus> mOutputBusses = new ArrayList<>();
+ public final ArrayList<GT_MetaTileEntity_Hatch_Muffler> mMufflerHatches = new ArrayList<>();
+ public final ArrayList<GT_MetaTileEntity_Hatch_Maintenance> mMaintenanceHatches = new ArrayList<>();
+
+ protected GTRecipe getGT_RECIPE() {
+ return GT_RECIPE;
+ }
+
+ protected abstract boolean checkStructure();
+ protected abstract String[] getDescription();
+
+ protected long getMaxInputVoltage() {
+ long voltage = 0L;
+ for(GT_MetaTileEntity_Hatch_Energy energyHatch : mEnergyHatches) {
+ voltage += energyHatch.getBaseMetaTileEntity().getInputVoltage();
+ }
+ return voltage;
+ }
+
+ private void updateDynamoHatches() {
+ if(GT_RECIPE.getEuPerTick() > 0) {
+ long remOutput = GT_RECIPE.getEuPerTick();
+ for(GT_MetaTileEntity_Hatch_Dynamo dynamoHatch : mDynamoHatches) {
+ final long deltaCapacity = dynamoHatch.getBaseMetaTileEntity().getEUCapacity()
+ - dynamoHatch.getBaseMetaTileEntity().getStoredEU();
+ final long toOutput = Math.min(deltaCapacity, GT_RECIPE.getEuPerTick());
+ dynamoHatch.getBaseMetaTileEntity().increaseStoredEnergyUnits(toOutput, false);
+ remOutput -= toOutput;
+ }
+ }
+ }
+
+ private void updateEnergyHatches() {
+ if(GT_RECIPE.getEuPerTick() < 0) {
+ long remConsumption = GT_RECIPE.getEuPerTick();
+ for(GT_MetaTileEntity_Hatch_Energy energyHatch : mEnergyHatches) {
+ if(remConsumption > 0) {
+ final long toConsume = Math.min(remConsumption, energyHatch.getBaseMetaTileEntity().getStoredEU());
+ energyHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(toConsume, false);
+ remConsumption -= toConsume;
+ }
+ }
+ }
+ }
+
+ private void updateInputBusses() {
+ if(GT_RECIPE.getInputItems() != null) {
+ // Check for each input stack...
+ for(ItemStack inputStack : GT_RECIPE.getInputItems()) {
+ int remainingRequired = inputStack.stackSize;
+ // ...Each slot in each input bus...
+ for(GT_MetaTileEntity_Hatch_InputBus inputBus : mInputBusses) {
+ for(int slot = 0; slot <= inputBus.getBaseMetaTileEntity().getSizeInventory(); slot++) {
+
+ final ItemStack slotStack = inputBus.getBaseMetaTileEntity().getStackInSlot(slot);
+ if(GT_Utility.isStackValid(slotStack)) {
+ if(GT_Utility.areStacksEqual(inputStack, slotStack)) {
+ // Found correct slot
+ final int toConsume = Math.min(slotStack.stackSize, inputStack.stackSize);
+ final ItemStack retrievedStack = inputBus.getBaseMetaTileEntity().decrStackSize(slot, toConsume);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private void updateInputHatches() {
+ if(GT_RECIPE.getInputFluids() != null) {
+ // Check for each input stack
+ for(FluidStack inputStack : GT_RECIPE.getInputFluids()) {
+ int remainingRequired = inputStack.amount;
+ // ...In each input hatch...
+ for(GT_MetaTileEntity_Hatch_Input inputHatch : mInputHatches) {
+
+ FluidStack slotStack = inputHatch.getFluid();
+ if(slotStack.amount > 0 && slotStack.isFluidEqual(inputStack)) {
+ // Found correct hatch
+ final int toConsume = Math.min(slotStack.amount, remainingRequired);
+ inputHatch.drain(toConsume, true);
+ remainingRequired -= toConsume;
+ }
+ }
+ }
+ }
+ }
+
+ private void updateOutputBusses() {
+ if(GT_RECIPE.getOutputItems() != null) {
+
+ }
+ }
+
+ private void updateOutputHatches() {
+ if(GT_RECIPE.getOutputFluids() != null) {
+ // Find for each output stack...
+ for(FluidStack outputStack : GT_RECIPE.getOutputFluids()) {
+ // ...an output hatch that can accept the stack
+ for(GT_MetaTileEntity_Hatch_Output outputHatch : mOutputHatches) {
+
+ }
+ }
+ }
+ }
+
+ protected boolean tryAddHatch(IGregTechTileEntity hatch, int aBaseCasingIndex) {
+ if (hatch == null) {
+ return false;
+ } else {
+ final IMetaTileEntity aMetaTileEntity = hatch.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ } else {
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
+ }
+
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
+ return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
+ return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) {
+ return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) {
+ return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) {
+ return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) {
+ return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) {
+ return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity);
+ } else {
+ return aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler
+ ? this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity)
+ : false;
+ }
+ }
+ }
+ }
+
+ protected boolean tryAddMaintenanceHatch(IGregTechTileEntity hatch, int aBaseCasingIndex) {
+ if (hatch == null) {
+ return false;
+ } else {
+ IMetaTileEntity aMetaTileEntity = hatch.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
+ return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity);
+ } else {
+ return false;
+ }
+ }
+ }
+
+ protected boolean tryAddEnergyHatch(IGregTechTileEntity hatch, int aBaseCasingIndex) {
+ if (hatch == null) {
+ return false;
+ } else {
+ IMetaTileEntity aMetaTileEntity = hatch.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
+ return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity);
+ } else {
+ return false;
+ }
+ }
+ }
+
+ protected boolean tryAddDynamoHatch(IGregTechTileEntity hatch, int aBaseCasingIndex) {
+ if (hatch == null) {
+ return false;
+ } else {
+ IMetaTileEntity aMetaTileEntity = hatch.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
+ return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity);
+ } else {
+ return false;
+ }
+ }
+ }
+
+ protected boolean tryAddMufflerHatch(IGregTechTileEntity hatch, int aBaseCasingIndex) {
+ if (hatch == null) {
+ return false;
+ } else {
+ IMetaTileEntity aMetaTileEntity = hatch.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
+ return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity);
+ } else {
+ return false;
+ }
+ }
+ }
+
+ protected boolean tryAddInputBus(IGregTechTileEntity hatch, int aBaseCasingIndex) {
+ if (hatch == null) {
+ return false;
+ } else {
+ IMetaTileEntity aMetaTileEntity = hatch.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
+ return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity);
+ } else {
+ return false;
+ }
+ }
+ }
+
+ protected boolean tryAddInputHatch(IGregTechTileEntity hatch, int aBaseCasingIndex) {
+ if (hatch == null) {
+ return false;
+ } else {
+ IMetaTileEntity aMetaTileEntity = hatch.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
+ return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity);
+ } else {
+ return false;
+ }
+ }
+ }
+
+ protected boolean tryAddOutputBus(IGregTechTileEntity hatch, int aBaseCasingIndex) {
+ if (hatch == null) {
+ return false;
+ } else {
+ IMetaTileEntity aMetaTileEntity = hatch.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
+ return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity);
+ } else {
+ return false;
+ }
+ }
+ }
+
+ protected boolean tryAddOutputHatch(IGregTechTileEntity hatch, int aBaseCasingIndex) {
+ if (hatch == null) {
+ return false;
+ } else {
+ IMetaTileEntity aMetaTileEntity = hatch.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
+ return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity);
+ } else {
+ return false;
+ }
+ }
+ }
+}
diff --git a/src/main/java/kekztech/GTRecipe.java b/src/main/java/kekztech/GTRecipe.java index 2add4d3c0e..1939afc8ff 100644 --- a/src/main/java/kekztech/GTRecipe.java +++ b/src/main/java/kekztech/GTRecipe.java @@ -1,104 +1,104 @@ -package kekztech; - -import java.util.ArrayList; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; -import util.Util; - -public class GTRecipe { - - private int euPerTick = 0; - private int duration = 0; - - private ArrayList<ItemStack> inputItems; - private ArrayList<FluidStack> inputFluids; - private ArrayList<ItemStack> outputItems; - private ArrayList<FluidStack> outputFluids; - - public int getEuPerTick() { - return euPerTick; - } - public int getDuration() { - return duration; - } - public ItemStack[] getInputItems() { - return Util.toItemStackArray(inputItems); - } - public FluidStack[] getInputFluids() { - return Util.toFluidStackArray(inputFluids); - } - public ItemStack[] getOutputItems() { - return Util.toItemStackArray(outputItems); - } - public FluidStack[] getOutputFluids() { - return Util.toFluidStackArray(outputFluids); - } - public ItemStack getInputItem() { - final ItemStack[] s = Util.toItemStackArray(inputItems); - return s[0]; - } - public FluidStack getInputFluid() { - final FluidStack[] s = Util.toFluidStackArray(inputFluids); - return s[0]; - } - public ItemStack getOutputItem() { - final ItemStack[] s = Util.toItemStackArray(outputItems); - return s[0]; - } - public FluidStack getOutputFluid() { - final FluidStack[] s = Util.toFluidStackArray(outputFluids); - return s[0]; - } - - public GTRecipe addInputItem(ItemStack inputItem) { - if(inputItems == null) { - inputItems = new ArrayList<ItemStack>(); - inputItems.add(inputItem); - } else { - inputItems.add(inputItem); - } - return this; - } - - public GTRecipe addOutputItem(ItemStack outputItem) { - if(outputItems == null) { - outputItems = new ArrayList<ItemStack>(); - outputItems.add(outputItem); - } else { - outputItems.add(outputItem); - } - return this; - } - - public GTRecipe addInputFluid(FluidStack inputFluid) { - if(inputFluids == null) { - inputFluids = new ArrayList<FluidStack>(); - inputFluids.add(inputFluid); - } else { - inputFluids.add(inputFluid); - } - return this; - } - - public GTRecipe addOutputFluid(FluidStack outputFluid) { - if(outputFluids == null) { - outputFluids = new ArrayList<FluidStack>(); - outputFluids.add(outputFluid); - } else { - outputFluids.add(outputFluid); - } - return this; - } - - public GTRecipe setEUPerTick(int euPerTick) { - this.euPerTick = euPerTick; - return this; - } - - public GTRecipe setDuration(int duration) { - this.duration = duration; - return this; - } - -} +package kekztech;
+
+import java.util.ArrayList;
+
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+import util.Util;
+
+public class GTRecipe {
+
+ private int euPerTick = 0;
+ private int duration = 0;
+
+ private ArrayList<ItemStack> inputItems;
+ private ArrayList<FluidStack> inputFluids;
+ private ArrayList<ItemStack> outputItems;
+ private ArrayList<FluidStack> outputFluids;
+
+ public int getEuPerTick() {
+ return euPerTick;
+ }
+ public int getDuration() {
+ return duration;
+ }
+ public ItemStack[] getInputItems() {
+ return Util.toItemStackArray(inputItems);
+ }
+ public FluidStack[] getInputFluids() {
+ return Util.toFluidStackArray(inputFluids);
+ }
+ public ItemStack[] getOutputItems() {
+ return Util.toItemStackArray(outputItems);
+ }
+ public FluidStack[] getOutputFluids() {
+ return Util.toFluidStackArray(outputFluids);
+ }
+ public ItemStack getInputItem() {
+ final ItemStack[] s = Util.toItemStackArray(inputItems);
+ return s[0];
+ }
+ public FluidStack getInputFluid() {
+ final FluidStack[] s = Util.toFluidStackArray(inputFluids);
+ return s[0];
+ }
+ public ItemStack getOutputItem() {
+ final ItemStack[] s = Util.toItemStackArray(outputItems);
+ return s[0];
+ }
+ public FluidStack getOutputFluid() {
+ final FluidStack[] s = Util.toFluidStackArray(outputFluids);
+ return s[0];
+ }
+
+ public GTRecipe addInputItem(ItemStack inputItem) {
+ if(inputItems == null) {
+ inputItems = new ArrayList<ItemStack>();
+ inputItems.add(inputItem);
+ } else {
+ inputItems.add(inputItem);
+ }
+ return this;
+ }
+
+ public GTRecipe addOutputItem(ItemStack outputItem) {
+ if(outputItems == null) {
+ outputItems = new ArrayList<ItemStack>();
+ outputItems.add(outputItem);
+ } else {
+ outputItems.add(outputItem);
+ }
+ return this;
+ }
+
+ public GTRecipe addInputFluid(FluidStack inputFluid) {
+ if(inputFluids == null) {
+ inputFluids = new ArrayList<FluidStack>();
+ inputFluids.add(inputFluid);
+ } else {
+ inputFluids.add(inputFluid);
+ }
+ return this;
+ }
+
+ public GTRecipe addOutputFluid(FluidStack outputFluid) {
+ if(outputFluids == null) {
+ outputFluids = new ArrayList<FluidStack>();
+ outputFluids.add(outputFluid);
+ } else {
+ outputFluids.add(outputFluid);
+ }
+ return this;
+ }
+
+ public GTRecipe setEUPerTick(int euPerTick) {
+ this.euPerTick = euPerTick;
+ return this;
+ }
+
+ public GTRecipe setDuration(int duration) {
+ this.duration = duration;
+ return this;
+ }
+
+}
diff --git a/src/main/java/kekztech/Items.java b/src/main/java/kekztech/Items.java index 47708971c7..52539222e7 100644 --- a/src/main/java/kekztech/Items.java +++ b/src/main/java/kekztech/Items.java @@ -1,48 +1,48 @@ -package kekztech; - -public enum Items { - // Heat Vents - T1HeatVent(0), T2HeatVent(1), T3HeatVent(2), T4HeatVent(3), - T1ComponentHeatVent(4), T2ComponentHeatVent(5), T3ComponentHeatVent(6), T4ComponentHeatVent(7), - T1OverclockedHeatVent(8), T2OverclockedHeatVent(9), T3OverclockedHeatVent(10), T4OverclockedHeatVent(11), - // Heat Exchanger - T1HeatExchanger(12), T2HeatExchanger(13), T3HeatExchanger(14), T4HeatExchanger(15), - // Fuel Rods - UraniumFuelRod(16), UraniumDualFuelRod(17), UraniumQuadFuelRod(18), - ThoriumFuelRod(19), ThoriumDualFuelRod(20), ThoriumQuadFuelRod(21), - MOXFuelRod(22), MOXDualFuelRod(23), MOXQuadFuelRod(24), - NaquadahFuelRod(25), NaquadahDualFuelRod(26), NaquadahQuadFuelRod(27), - Th_MOXFuelRod(28), Th_MOXDualFuelRod(29), Th_MOXQuadFuelRod(30), - // Depleted Fuel Rods - DepletedUraniumFuelRod(31), DepletedUraniumDualFuelRod(32), DepletedUraniumQuadFuelRod(33), - DepletedThoriumFuelRod(34), DepletedThoriumDualFuelRod(35), DepletedThoriumQuadFuelRod(36), - DepletedMOXFuelRod(37), DepletedMOXDualFuelRod(38), DepletedMOXQuadFuelRod(39), - DepletedNaquadahFuelRod(40), DepletedNaquadahDualFuelRod(41), DepletedNaquadahQuadFuelRod(42), - Th_DepletedMOXFuelRod(43), Th_DepletedMOXDualFuelRod(44), Th_DepletedMOXQuadFuelRod(45), - // Neutron Reflectors - T1NeutronReflector(46), T2NeutronReflector(47), - // Coolant Cells - HeliumCoolantCell360k(48), NaKCoolantCell360k(49), - - // Heat Pipes - CopperHeatPipe(0), SilverHeatPipe(1), BoronArsenideHeatPipe(2), DiamondHeatPipe(3), - BoronArsenideDust(4), IsotopicallyPureDiamondDust(5), AmineCarbamiteDust(6), - BoronArsenideCrystal(7), IsotopicallyPureDiamondCrystal(8), - // Ceramics - YSZCeramicDust(9), GDCCeramicDust(10), - YttriaDust(11), ZirconiaDust(12), CeriaDust(13), - YSZCeramicPlate(14), GDCCeramicPlate(15), - // Error Item - Error(0); - - private final int metaID; - - private Items(int metaID) { - this.metaID = metaID; - } - - public int getMetaID() { - return metaID; - } - -} +package kekztech;
+
+public enum Items {
+ // Heat Vents
+ T1HeatVent(0), T2HeatVent(1), T3HeatVent(2), T4HeatVent(3),
+ T1ComponentHeatVent(4), T2ComponentHeatVent(5), T3ComponentHeatVent(6), T4ComponentHeatVent(7),
+ T1OverclockedHeatVent(8), T2OverclockedHeatVent(9), T3OverclockedHeatVent(10), T4OverclockedHeatVent(11),
+ // Heat Exchanger
+ T1HeatExchanger(12), T2HeatExchanger(13), T3HeatExchanger(14), T4HeatExchanger(15),
+ // Fuel Rods
+ UraniumFuelRod(16), UraniumDualFuelRod(17), UraniumQuadFuelRod(18),
+ ThoriumFuelRod(19), ThoriumDualFuelRod(20), ThoriumQuadFuelRod(21),
+ MOXFuelRod(22), MOXDualFuelRod(23), MOXQuadFuelRod(24),
+ NaquadahFuelRod(25), NaquadahDualFuelRod(26), NaquadahQuadFuelRod(27),
+ Th_MOXFuelRod(28), Th_MOXDualFuelRod(29), Th_MOXQuadFuelRod(30),
+ // Depleted Fuel Rods
+ DepletedUraniumFuelRod(31), DepletedUraniumDualFuelRod(32), DepletedUraniumQuadFuelRod(33),
+ DepletedThoriumFuelRod(34), DepletedThoriumDualFuelRod(35), DepletedThoriumQuadFuelRod(36),
+ DepletedMOXFuelRod(37), DepletedMOXDualFuelRod(38), DepletedMOXQuadFuelRod(39),
+ DepletedNaquadahFuelRod(40), DepletedNaquadahDualFuelRod(41), DepletedNaquadahQuadFuelRod(42),
+ Th_DepletedMOXFuelRod(43), Th_DepletedMOXDualFuelRod(44), Th_DepletedMOXQuadFuelRod(45),
+ // Neutron Reflectors
+ T1NeutronReflector(46), T2NeutronReflector(47),
+ // Coolant Cells
+ HeliumCoolantCell360k(48), NaKCoolantCell360k(49),
+
+ // Heat Pipes
+ CopperHeatPipe(0), SilverHeatPipe(1), BoronArsenideHeatPipe(2), DiamondHeatPipe(3),
+ BoronArsenideDust(4), IsotopicallyPureDiamondDust(5), AmineCarbamiteDust(6),
+ BoronArsenideCrystal(7), IsotopicallyPureDiamondCrystal(8),
+ // Ceramics
+ YSZCeramicDust(9), GDCCeramicDust(10),
+ YttriaDust(11), ZirconiaDust(12), CeriaDust(13),
+ YSZCeramicPlate(14), GDCCeramicPlate(15),
+ // Error Item
+ Error(0);
+
+ private final int metaID;
+
+ private Items(int metaID) {
+ this.metaID = metaID;
+ }
+
+ public int getMetaID() {
+ return metaID;
+ }
+
+}
diff --git a/src/main/java/kekztech/KekzCore.java b/src/main/java/kekztech/KekzCore.java index e84b428219..5eb2916e02 100644 --- a/src/main/java/kekztech/KekzCore.java +++ b/src/main/java/kekztech/KekzCore.java @@ -1,355 +1,333 @@ -package kekztech; - -import blocks.Block_GDCUnit; -import blocks.Block_TFFTCasing; -import blocks.Block_TFFTStorageFieldBlockT1; -import blocks.Block_TFFTStorageFieldBlockT2; -import blocks.Block_TFFTStorageFieldBlockT3; -import blocks.Block_TFFTStorageFieldBlockT4; -import blocks.Block_YSZUnit; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; -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_Utility; -import items.ErrorItem; -import items.MetaItem_CraftingComponent; -import items.MetaItem_ReactorComponent; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidRegistry; -import tileentities.GTMTE_FluidMultiStorage; -import tileentities.GTMTE_ModularNuclearReactor; -import tileentities.GTMTE_SOFuelCellMK1; -import tileentities.GTMTE_SOFuelCellMK2; -import util.Util; - -@Mod(modid = KekzCore.MODID, name = KekzCore.NAME, version = KekzCore.VERSION, - dependencies = "required-after:IC2; " - + "required-after:gregtech" - ) -public class KekzCore { - - public static final String NAME = "KekzTech"; - public static final String MODID = "kekztech"; - public static final String VERSION = "0.1a"; - - private GTMTE_SOFuelCellMK1 sofc1; - private GTMTE_SOFuelCellMK2 sofc2; - private GTMTE_ModularNuclearReactor mdr; - private GTMTE_FluidMultiStorage fms; - - @Mod.Instance("kekztech") - public static KekzCore instance; - - @Mod.EventHandler - public void preInit(FMLPreInitializationEvent event) { - // Items - ErrorItem.getInstance().registerItem(); - MetaItem_ReactorComponent.getInstance().registerItem(); - MetaItem_CraftingComponent.getInstance().registerItem(); - // Blocks - Block_YSZUnit.getInstance().registerBlock(); - Block_GDCUnit.getInstance().registerBlock(); - Block_TFFTCasing.getInstance().registerBlock(); - Block_TFFTStorageFieldBlockT1.getInstance().registerBlock(); - Block_TFFTStorageFieldBlockT2.getInstance().registerBlock(); - Block_TFFTStorageFieldBlockT3.getInstance().registerBlock(); - Block_TFFTStorageFieldBlockT4.getInstance().registerBlock(); - } - - @Mod.EventHandler - public void init(FMLInitializationEvent event ) { - sofc1 = new GTMTE_SOFuelCellMK1(5000, "multimachine.fuelcellmk1", "Solid-Oxide Fuel Cell Mk I"); - sofc2 = new GTMTE_SOFuelCellMK2(5001, "multimachine.fuelcellmk2", "Solid-Oxide Fuel Cell Mk II"); - mdr = new GTMTE_ModularNuclearReactor(5002, "multimachine.nuclearreactor", "Nuclear Reactor"); - fms = new GTMTE_FluidMultiStorage(5003, "multimachine.tf_fluidtank", "T.F.F.T"); - - } - - @Mod.EventHandler - public void postInit(FMLPostInitializationEvent event) { - System.out.println("Registering KekzTech recipes..."); - - final MetaItem_CraftingComponent craftingItem = MetaItem_CraftingComponent.getInstance(); - final MetaItem_ReactorComponent reactorItem = MetaItem_ReactorComponent.getInstance(); - - // Multiblock Controllers - final Object[] mk1_recipe = { - "CCC", "PHP", "FBL", - 'C', OrePrefixes.circuit.get(Materials.Advanced), - 'P', ItemList.Electric_Pump_HV.get(1L, (Object[]) null), - 'H', ItemList.Hull_HV.get(1L, (Object[]) null), - 'F', GT_OreDictUnificator.get(OrePrefixes.pipeSmall, Materials.StainlessSteel, 1), - 'B', GT_OreDictUnificator.get(OrePrefixes.cableGt02, Materials.Gold, 1), - 'L', GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.StainlessSteel, 1) - }; - GT_ModHandler.addCraftingRecipe(sofc1.getStackForm(1), mk1_recipe); - final Object[] mk2_recipe = { - "CCC", "PHP", "FBL", - 'C', OrePrefixes.circuit.get(Materials.Master), - 'P', ItemList.Electric_Pump_IV.get(1L, (Object[]) null), - 'H', ItemList.Hull_IV.get(1L, (Object[]) null), - 'F', GT_OreDictUnificator.get(OrePrefixes.pipeSmall, Materials.Ultimate, 1), - 'B', Util.getStackofAmountFromOreDict("wireGt04SuperconductorEV", 1), - 'L', GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Ultimate, 1) - }; - GT_ModHandler.addCraftingRecipe(sofc2.getStackForm(1), mk2_recipe); - final Object[] tfft_recipe = { - "HFH", "PVP", "CFC", - 'H', OrePrefixes.pipeMedium.get(Materials.StainlessSteel), - 'F', ItemList.Field_Generator_LV.get(1L, (Object[]) null), - 'P', ItemList.Electric_Pump_HV.get(1L, (Object[]) null), - 'V', OrePrefixes.rotor.get(Materials.VibrantAlloy), - 'C', OrePrefixes.circuit.get(Materials.Advanced) - }; - GT_ModHandler.addCraftingRecipe(fms.getStackForm(1), tfft_recipe); - - // Ceramic Electrolyte Units - final ItemStack[] yszUnit = { - GT_Utility.getIntegratedCircuit(6), - craftingItem.getStackOfAmountFromDamage(Items.YSZCeramicPlate.getMetaID(), 4), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Yttrium, 1), - GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.StainlessSteel, 1), - ItemList.Electric_Motor_HV.get(1L, (Object[]) null), - }; - GT_Values.RA.addAssemblerRecipe( - yszUnit, - Materials.Hydrogen.getGas(4000), - new ItemStack(Block_YSZUnit.getInstance(), 1), - 1200, 480); - final ItemStack[] gdcUnit = { - GT_Utility.getIntegratedCircuit(6), - craftingItem.getStackOfAmountFromDamage(Items.GDCCeramicPlate.getMetaID(), 8), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Gadolinium, new ItemStack(ErrorItem.getInstance(), 1), 1), - GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.Desh, new ItemStack(ErrorItem.getInstance(), 1), 1), - ItemList.Electric_Motor_IV.get(1L, (Object[]) null), - }; - GT_Values.RA.addAssemblerRecipe( - gdcUnit, - Materials.Hydrogen.getGas(16000), - new ItemStack(Block_GDCUnit.getInstance(), 1), - 2400, 1920); - - // T.F.F.T Structure blocks - final ItemStack[] tfftcasing = { - GT_Utility.getIntegratedCircuit(6), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.DarkSteel, 3), - 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(Block_TFFTCasing.getInstance(), 1), - 200, 256); - final ItemStack[] tfftstoragefield1 = { - GT_Utility.getIntegratedCircuit(6), - GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 4), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.PulsatingIron, 1), - GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Steel, 1), - ItemList.Electric_Pump_LV.get(1L, (Object[]) null) - }; - GT_Values.RA.addAssemblerRecipe( - tfftstoragefield1, - FluidRegistry.getFluidStack("molten.glass", 144), - new ItemStack(Block_TFFTStorageFieldBlockT1.getInstance(), 1), - 200, 256); - final ItemStack[] tfftstoragefield2 = { - GT_Utility.getIntegratedCircuit(6), - GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Good, 4), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.PulsatingIron, 4), - GT_OreDictUnificator.get(OrePrefixes.pipeHuge, Materials.StainlessSteel, 1), - ItemList.Electric_Pump_MV.get(1L, (Object[]) null) - }; - GT_Values.RA.addAssemblerRecipe( - tfftstoragefield2, - FluidRegistry.getFluidStack("molten.plastic", 144), - new ItemStack(Block_TFFTStorageFieldBlockT2.getInstance(), 1), - 200, 480); - final ItemStack[] tfftstoragefield3 = { - GT_Utility.getIntegratedCircuit(6), - GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 4), - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.VibrantAlloy, 2), - GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Titanium, 1), - ItemList.Field_Generator_LV.get(1L, (Object[]) null), - ItemList.Electric_Pump_HV.get(1L, (Object[]) null) - }; - GT_Values.RA.addAssemblerRecipe( - tfftstoragefield3, - FluidRegistry.getFluidStack("molten.epoxid", 576), - new ItemStack(Block_TFFTStorageFieldBlockT3.getInstance(), 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, (Object[]) null), - ItemList.Electric_Pump_EV.get(1L, (Object[]) null) - }; - GT_Values.RA.addAssemblerRecipe( - tfftstoragefield4, - FluidRegistry.getFluidStack("molten.epoxid", 1152), - new ItemStack(Block_TFFTStorageFieldBlockT4.getInstance(), 1), - 400, 4098); - - // Ceramic plates - GT_Values.RA.addAlloySmelterRecipe( - craftingItem.getStackOfAmountFromDamage(Items.YSZCeramicDust.getMetaID(), 10), - ItemList.Shape_Mold_Plate.get(1, (Object[]) null), - craftingItem.getStackOfAmountFromDamage(Items.YSZCeramicPlate.getMetaID(), 1), - 400, 480); - GT_Values.RA.addFormingPressRecipe( - craftingItem.getStackOfAmountFromDamage(Items.GDCCeramicDust.getMetaID(), 10), - ItemList.Shape_Mold_Plate.get(1, (Object[]) null), - craftingItem.getStackOfAmountFromDamage(Items.GDCCeramicPlate.getMetaID(), 1), - 800, 480); - - // Dusts - GT_Values.RA.addMixerRecipe(Materials.Boron.getDust(1), Materials.Arsenic.getDust(1), GT_Utility.getIntegratedCircuit(6), null, - null, null, craftingItem.getStackOfAmountFromDamage(Items.BoronArsenideDust.getMetaID(), 2), - 100, 1920); - GT_Values.RA.addChemicalRecipe( - Materials.Ammonia.getCells(2), - Materials.CarbonDioxide.getCells(1), - null, - null, - craftingItem.getStackOfAmountFromDamage(Items.AmineCarbamiteDust.getMetaID(), 1), - Util.getStackofAmountFromOreDict("cellEmpty", 3), - 400, 30); - GT_Values.RA.addChemicalRecipe( - craftingItem.getStackOfAmountFromDamage(Items.AmineCarbamiteDust.getMetaID(), 1), - Materials.Diamond.getDust(16), - Materials.CarbonDioxide.getGas(1000), - null, - craftingItem.getStackOfAmountFromDamage(Items.IsotopicallyPureDiamondDust.getMetaID(), 1), - null, 1200, 480); - GT_Values.RA.addChemicalRecipe( - Materials.Yttrium.getDust(1), GT_Utility.getIntegratedCircuit(6), Materials.Oxygen.getGas(3000), - null, craftingItem.getStackOfAmountFromDamage(Items.YttriaDust.getMetaID(), 1), null, - 400, 30); - GT_Values.RA.addChemicalRecipe( - Util.getStackofAmountFromOreDict("dustZirconium", 1), GT_Utility.getIntegratedCircuit(6), Materials.Oxygen.getGas(2000), - null, craftingItem.getStackOfAmountFromDamage(Items.ZirconiaDust.getMetaID(), 1), null, - 400, 30); - GT_Values.RA.addChemicalRecipe( - Materials.Cerium.getDust(2), GT_Utility.getIntegratedCircuit(6), Materials.Oxygen.getGas(3000), - null, craftingItem.getStackOfAmountFromDamage(Items.CeriaDust.getMetaID(), 2), null, - 400, 30); - GT_Values.RA.addMixerRecipe( - craftingItem.getStackOfAmountFromDamage(Items.YttriaDust.getMetaID(), 1), - craftingItem.getStackOfAmountFromDamage(Items.ZirconiaDust.getMetaID(), 5), - GT_Utility.getIntegratedCircuit(6), null, null, null, - craftingItem.getStackOfAmountFromDamage(Items.YSZCeramicDust.getMetaID(), 6), - 400, 96); - GT_Values.RA.addMixerRecipe( - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Gadolinium, new ItemStack(ErrorItem.getInstance(), 1), 1), - craftingItem.getStackOfAmountFromDamage(Items.CeriaDust.getMetaID(), 9), - GT_Utility.getIntegratedCircuit(6), null, null, null, - craftingItem.getStackOfAmountFromDamage(Items.GDCCeramicDust.getMetaID(), 10), - 400, 1920); - - // Crystals - GT_Values.RA.addAutoclaveRecipe( - craftingItem.getStackOfAmountFromDamage(Items.IsotopicallyPureDiamondDust.getMetaID(), 4), - Materials.CarbonDioxide.getGas(16000), - craftingItem.getStackOfAmountFromDamage(Items.IsotopicallyPureDiamondCrystal.getMetaID(), 1), 10000, 2400, 7680); - GT_Values.RA.addAutoclaveRecipe( - craftingItem.getStackOfAmountFromDamage(Items.IsotopicallyPureDiamondDust.getMetaID(), 4), - Materials.CarbonDioxide.getGas(16000), - craftingItem.getStackOfAmountFromDamage(Items.IsotopicallyPureDiamondCrystal.getMetaID(), 1), 10000, 2400, 1920); - - // Heat Pipes - GT_Values.RA.addLatheRecipe( - GT_OreDictUnificator.get(OrePrefixes.stick, Materials.AnnealedCopper, 1), - craftingItem.getStackFromDamage(Items.CopperHeatPipe.getMetaID()), - null, 120, 120); - GT_Values.RA.addLatheRecipe( - GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Silver, 1), - craftingItem.getStackFromDamage(Items.SilverHeatPipe.getMetaID()), - null, 120, 480); - GT_Values.RA.addLatheRecipe( - craftingItem.getStackOfAmountFromDamage(Items.BoronArsenideCrystal.getMetaID(), 4), - craftingItem.getStackFromDamage(Items.BoronArsenideHeatPipe.getMetaID()), - null, 1200, 1920); - GT_Values.RA.addLatheRecipe( - craftingItem.getStackOfAmountFromDamage(Items.IsotopicallyPureDiamondCrystal.getMetaID(), 4), - craftingItem.getStackFromDamage(Items.DiamondHeatPipe.getMetaID()), - null, 1200, 7680); - - // Heat Vents - final ItemStack[] t1HeatVent = { - craftingItem.getStackOfAmountFromDamage(Items.CopperHeatPipe.getMetaID(), 2), - ItemList.Electric_Motor_MV.get(1L, (Object[]) null), - GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.Steel, new ItemStack(ErrorItem.getInstance(), 1), 1), - GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Steel, new ItemStack(ErrorItem.getInstance(), 1), 2), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Steel, new ItemStack(ErrorItem.getInstance(), 1), 8), - GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Good, 1), - GT_Utility.getIntegratedCircuit(6) - }; - GT_Values.RA.addAssemblerRecipe( - t1HeatVent, - FluidRegistry.getFluidStack("molten.copper", 144), - reactorItem.getStackFromDamage(Items.T1HeatVent.getMetaID()), - 200, 120); - final ItemStack[] t2HeatVent = { - craftingItem.getStackOfAmountFromDamage(Items.SilverHeatPipe.getMetaID(), 2), - ItemList.Electric_Motor_HV.get(1L, (Object[]) null), - GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.Aluminium, new ItemStack(ErrorItem.getInstance(), 1), 1), - GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Aluminium, new ItemStack(ErrorItem.getInstance(), 1), 2), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Aluminium, new ItemStack(ErrorItem.getInstance(), 1), 8), - GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 1), - GT_Utility.getIntegratedCircuit(6) - }; - GT_Values.RA.addAssemblerRecipe( - t2HeatVent, - FluidRegistry.getFluidStack("molten.silver", 144), - reactorItem.getStackFromDamage(Items.T2HeatVent.getMetaID()), - 400, 480); - final ItemStack[] t3HeatVent = { - craftingItem.getStackOfAmountFromDamage(Items.BoronArsenideHeatPipe.getMetaID(), 2), - ItemList.Electric_Motor_IV.get(1L, (Object[]) null), - GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.TungstenSteel, new ItemStack(ErrorItem.getInstance(), 1), 1), - GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.TungstenSteel, new ItemStack(ErrorItem.getInstance(), 1), 2), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Tungsten, new ItemStack(ErrorItem.getInstance(), 1), 8), - GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Data, 1), - GT_Utility.getIntegratedCircuit(6) - }; - GT_Values.RA.addAssemblerRecipe( - t3HeatVent, - FluidRegistry.getFluidStack("molten.gallium", 576), - reactorItem.getStackFromDamage(Items.T3HeatVent.getMetaID()), - 800, 7680); - - System.out.println("...done"); - } - - - - - - - - - - - - - - - - - - - - - - - -} +package kekztech;
+
+import blocks.Block_GDCUnit;
+import blocks.Block_TFFTCasing;
+import blocks.Block_TFFTStorageFieldBlockT1;
+import blocks.Block_TFFTStorageFieldBlockT2;
+import blocks.Block_TFFTStorageFieldBlockT3;
+import blocks.Block_TFFTStorageFieldBlockT4;
+import blocks.Block_YSZUnit;
+import cpw.mods.fml.common.Mod;
+import cpw.mods.fml.common.event.FMLInitializationEvent;
+import cpw.mods.fml.common.event.FMLPostInitializationEvent;
+import cpw.mods.fml.common.event.FMLPreInitializationEvent;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.ItemList;
+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_Utility;
+import items.ErrorItem;
+import items.MetaItem_CraftingComponent;
+import items.MetaItem_ReactorComponent;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidRegistry;
+import tileentities.GTMTE_FluidMultiStorage;
+import tileentities.GTMTE_ModularNuclearReactor;
+import tileentities.GTMTE_SOFuelCellMK1;
+import tileentities.GTMTE_SOFuelCellMK2;
+import util.Util;
+
+@Mod(modid = KekzCore.MODID, name = KekzCore.NAME, version = KekzCore.VERSION,
+ dependencies = "required-after:IC2; "
+ + "required-after:gregtech"
+ )
+public class KekzCore {
+
+ public static final String NAME = "KekzTech";
+ public static final String MODID = "kekztech";
+ public static final String VERSION = "0.1a";
+
+ @Mod.Instance("kekztech")
+ public static KekzCore instance;
+
+ private GTMTE_SOFuelCellMK1 sofc1;
+ private GTMTE_SOFuelCellMK2 sofc2;
+ private GTMTE_ModularNuclearReactor mdr;
+ private GTMTE_FluidMultiStorage fms;
+
+ @Mod.EventHandler
+ public void preInit(FMLPreInitializationEvent event) {
+ // Items
+ ErrorItem.getInstance().registerItem();
+ MetaItem_ReactorComponent.getInstance().registerItem();
+ MetaItem_CraftingComponent.getInstance().registerItem();
+ // Blocks
+ Block_YSZUnit.getInstance().registerBlock();
+ Block_GDCUnit.getInstance().registerBlock();
+ Block_TFFTCasing.getInstance().registerBlock();
+ Block_TFFTStorageFieldBlockT1.getInstance().registerBlock();
+ Block_TFFTStorageFieldBlockT2.getInstance().registerBlock();
+ Block_TFFTStorageFieldBlockT3.getInstance().registerBlock();
+ Block_TFFTStorageFieldBlockT4.getInstance().registerBlock();
+ }
+
+ @Mod.EventHandler
+ public void init(FMLInitializationEvent event ) {
+ // Multiblock controllers
+ sofc1 = new GTMTE_SOFuelCellMK1(5000, "multimachine.fuelcellmk1", "Solid-Oxide Fuel Cell Mk I");
+ sofc2 = new GTMTE_SOFuelCellMK2(5001, "multimachine.fuelcellmk2", "Solid-Oxide Fuel Cell Mk II");
+ mdr = new GTMTE_ModularNuclearReactor(5002, "multimachine.nuclearreactor", "Nuclear Reactor");
+ fms = new GTMTE_FluidMultiStorage(5003, "multimachine.tf_fluidtank", "T.F.F.T");
+ }
+
+ @Mod.EventHandler
+ public void postInit(FMLPostInitializationEvent event) {
+ System.out.println("Registering KekzTech recipes...");
+
+ final MetaItem_CraftingComponent craftingItem = MetaItem_CraftingComponent.getInstance();
+ final MetaItem_ReactorComponent reactorItem = MetaItem_ReactorComponent.getInstance();
+
+ // Multiblock Controllers
+ final Object[] mk1_recipe = {
+ "CCC", "PHP", "FBL",
+ 'C', OrePrefixes.circuit.get(Materials.Advanced),
+ 'P', ItemList.Electric_Pump_HV.get(1L, (Object[]) null),
+ 'H', ItemList.Hull_HV.get(1L, (Object[]) null),
+ 'F', GT_OreDictUnificator.get(OrePrefixes.pipeSmall, Materials.StainlessSteel, 1),
+ 'B', GT_OreDictUnificator.get(OrePrefixes.cableGt02, Materials.Gold, 1),
+ 'L', GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.StainlessSteel, 1)
+ };
+ GT_ModHandler.addCraftingRecipe(sofc1.getStackForm(1), mk1_recipe);
+ final Object[] mk2_recipe = {
+ "CCC", "PHP", "FBL",
+ 'C', OrePrefixes.circuit.get(Materials.Master),
+ 'P', ItemList.Electric_Pump_IV.get(1L, (Object[]) null),
+ 'H', ItemList.Hull_IV.get(1L, (Object[]) null),
+ 'F', GT_OreDictUnificator.get(OrePrefixes.pipeSmall, Materials.Ultimate, 1),
+ 'B', Util.getStackofAmountFromOreDict("wireGt04SuperconductorEV", 1),
+ 'L', GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Ultimate, 1)
+ };
+ GT_ModHandler.addCraftingRecipe(sofc2.getStackForm(1), mk2_recipe);
+ final Object[] tfft_recipe = {
+ "HFH", "PVP", "CFC",
+ 'H', OrePrefixes.pipeMedium.get(Materials.StainlessSteel),
+ 'F', ItemList.Field_Generator_LV.get(1L, (Object[]) null),
+ 'P', ItemList.Electric_Pump_HV.get(1L, (Object[]) null),
+ 'V', OrePrefixes.rotor.get(Materials.VibrantAlloy),
+ 'C', OrePrefixes.circuit.get(Materials.Advanced)
+ };
+ GT_ModHandler.addCraftingRecipe(fms.getStackForm(1), tfft_recipe);
+
+ // Ceramic Electrolyte Units
+ final ItemStack[] yszUnit = {
+ GT_Utility.getIntegratedCircuit(6),
+ craftingItem.getStackOfAmountFromDamage(Items.YSZCeramicPlate.getMetaID(), 4),
+ GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Yttrium, 1),
+ GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.StainlessSteel, 1),
+ ItemList.Electric_Motor_HV.get(1L, (Object[]) null),
+ };
+ GT_Values.RA.addAssemblerRecipe(
+ yszUnit,
+ Materials.Hydrogen.getGas(4000),
+ new ItemStack(Block_YSZUnit.getInstance(), 1),
+ 1200, 480);
+ final ItemStack[] gdcUnit = {
+ GT_Utility.getIntegratedCircuit(6),
+ craftingItem.getStackOfAmountFromDamage(Items.GDCCeramicPlate.getMetaID(), 8),
+ GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Gadolinium, new ItemStack(ErrorItem.getInstance(), 1), 1),
+ GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.Desh, new ItemStack(ErrorItem.getInstance(), 1), 1),
+ ItemList.Electric_Motor_IV.get(1L, (Object[]) null),
+ };
+ GT_Values.RA.addAssemblerRecipe(
+ gdcUnit,
+ Materials.Hydrogen.getGas(16000),
+ new ItemStack(Block_GDCUnit.getInstance(), 1),
+ 2400, 1920);
+
+ // T.F.F.T Structure blocks
+ final ItemStack[] tfftcasing = {
+ GT_Utility.getIntegratedCircuit(6),
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.DarkSteel, 3),
+ 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(Block_TFFTCasing.getInstance(), 1),
+ 200, 256);
+ final ItemStack[] tfftstoragefield1 = {
+ GT_Utility.getIntegratedCircuit(6),
+ GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 4),
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.PulsatingIron, 1),
+ GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Steel, 1),
+ ItemList.Electric_Pump_LV.get(1L, (Object[]) null)
+ };
+ GT_Values.RA.addAssemblerRecipe(
+ tfftstoragefield1,
+ FluidRegistry.getFluidStack("molten.glass", 144),
+ new ItemStack(Block_TFFTStorageFieldBlockT1.getInstance(), 1),
+ 200, 256);
+ final ItemStack[] tfftstoragefield2 = {
+ GT_Utility.getIntegratedCircuit(6),
+ GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Good, 4),
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.PulsatingIron, 4),
+ GT_OreDictUnificator.get(OrePrefixes.pipeHuge, Materials.StainlessSteel, 1),
+ ItemList.Electric_Pump_MV.get(1L, (Object[]) null)
+ };
+ GT_Values.RA.addAssemblerRecipe(
+ tfftstoragefield2,
+ FluidRegistry.getFluidStack("molten.plastic", 144),
+ new ItemStack(Block_TFFTStorageFieldBlockT2.getInstance(), 1),
+ 200, 480);
+ final ItemStack[] tfftstoragefield3 = {
+ GT_Utility.getIntegratedCircuit(6),
+ GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 4),
+ GT_OreDictUnificator.get(OrePrefixes.plate, Materials.VibrantAlloy, 2),
+ GT_OreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Titanium, 1),
+ ItemList.Field_Generator_LV.get(1L, (Object[]) null),
+ ItemList.Electric_Pump_HV.get(1L, (Object[]) null)
+ };
+ GT_Values.RA.addAssemblerRecipe(
+ tfftstoragefield3,
+ FluidRegistry.getFluidStack("molten.epoxid", 576),
+ new ItemStack(Block_TFFTStorageFieldBlockT3.getInstance(), 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, (Object[]) null),
+ ItemList.Electric_Pump_EV.get(1L, (Object[]) null)
+ };
+ GT_Values.RA.addAssemblerRecipe(
+ tfftstoragefield4,
+ FluidRegistry.getFluidStack("molten.epoxid", 1152),
+ new ItemStack(Block_TFFTStorageFieldBlockT4.getInstance(), 1),
+ 400, 4098);
+
+ // Ceramic plates
+ GT_Values.RA.addAlloySmelterRecipe(
+ craftingItem.getStackOfAmountFromDamage(Items.YSZCeramicDust.getMetaID(), 10),
+ ItemList.Shape_Mold_Plate.get(1, (Object[]) null),
+ craftingItem.getStackOfAmountFromDamage(Items.YSZCeramicPlate.getMetaID(), 1),
+ 400, 480);
+ GT_Values.RA.addFormingPressRecipe(
+ craftingItem.getStackOfAmountFromDamage(Items.GDCCeramicDust.getMetaID(), 10),
+ ItemList.Shape_Mold_Plate.get(1, (Object[]) null),
+ craftingItem.getStackOfAmountFromDamage(Items.GDCCeramicPlate.getMetaID(), 1),
+ 800, 480);
+
+ // Dusts
+ GT_Values.RA.addMixerRecipe(Materials.Boron.getDust(1), Materials.Arsenic.getDust(1), GT_Utility.getIntegratedCircuit(6), null,
+ null, null, craftingItem.getStackOfAmountFromDamage(Items.BoronArsenideDust.getMetaID(), 2),
+ 100, 1920);
+ GT_Values.RA.addChemicalRecipe(
+ Materials.Ammonia.getCells(2),
+ Materials.CarbonDioxide.getCells(1),
+ null,
+ null,
+ craftingItem.getStackOfAmountFromDamage(Items.AmineCarbamiteDust.getMetaID(), 1),
+ Util.getStackofAmountFromOreDict("cellEmpty", 3),
+ 400, 30);
+ GT_Values.RA.addChemicalRecipe(
+ craftingItem.getStackOfAmountFromDamage(Items.AmineCarbamiteDust.getMetaID(), 1),
+ Materials.Diamond.getDust(16),
+ Materials.CarbonDioxide.getGas(1000),
+ null,
+ craftingItem.getStackOfAmountFromDamage(Items.IsotopicallyPureDiamondDust.getMetaID(), 1),
+ null, 1200, 480);
+ GT_Values.RA.addChemicalRecipe(
+ Materials.Yttrium.getDust(1), GT_Utility.getIntegratedCircuit(6), Materials.Oxygen.getGas(3000),
+ null, craftingItem.getStackOfAmountFromDamage(Items.YttriaDust.getMetaID(), 1), null,
+ 400, 30);
+ GT_Values.RA.addChemicalRecipe(
+ Util.getStackofAmountFromOreDict("dustZirconium", 1), GT_Utility.getIntegratedCircuit(6), Materials.Oxygen.getGas(2000),
+ null, craftingItem.getStackOfAmountFromDamage(Items.ZirconiaDust.getMetaID(), 1), null,
+ 400, 30);
+ GT_Values.RA.addChemicalRecipe(
+ Materials.Cerium.getDust(2), GT_Utility.getIntegratedCircuit(6), Materials.Oxygen.getGas(3000),
+ null, craftingItem.getStackOfAmountFromDamage(Items.CeriaDust.getMetaID(), 2), null,
+ 400, 30);
+ GT_Values.RA.addMixerRecipe(
+ craftingItem.getStackOfAmountFromDamage(Items.YttriaDust.getMetaID(), 1),
+ craftingItem.getStackOfAmountFromDamage(Items.ZirconiaDust.getMetaID(), 5),
+ GT_Utility.getIntegratedCircuit(6), null, null, null,
+ craftingItem.getStackOfAmountFromDamage(Items.YSZCeramicDust.getMetaID(), 6),
+ 400, 96);
+ GT_Values.RA.addMixerRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Gadolinium, new ItemStack(ErrorItem.getInstance(), 1), 1),
+ craftingItem.getStackOfAmountFromDamage(Items.CeriaDust.getMetaID(), 9),
+ GT_Utility.getIntegratedCircuit(6), null, null, null,
+ craftingItem.getStackOfAmountFromDamage(Items.GDCCeramicDust.getMetaID(), 10),
+ 400, 1920);
+
+ // Crystals
+ GT_Values.RA.addAutoclaveRecipe(
+ craftingItem.getStackOfAmountFromDamage(Items.IsotopicallyPureDiamondDust.getMetaID(), 4),
+ Materials.CarbonDioxide.getGas(16000),
+ craftingItem.getStackOfAmountFromDamage(Items.IsotopicallyPureDiamondCrystal.getMetaID(), 1), 10000, 2400, 7680);
+ GT_Values.RA.addAutoclaveRecipe(
+ craftingItem.getStackOfAmountFromDamage(Items.IsotopicallyPureDiamondDust.getMetaID(), 4),
+ Materials.CarbonDioxide.getGas(16000),
+ craftingItem.getStackOfAmountFromDamage(Items.IsotopicallyPureDiamondCrystal.getMetaID(), 1), 10000, 2400, 1920);
+
+ // Heat Pipes
+ GT_Values.RA.addLatheRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.stick, Materials.AnnealedCopper, 1),
+ craftingItem.getStackFromDamage(Items.CopperHeatPipe.getMetaID()),
+ null, 120, 120);
+ GT_Values.RA.addLatheRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Silver, 1),
+ craftingItem.getStackFromDamage(Items.SilverHeatPipe.getMetaID()),
+ null, 120, 480);
+ GT_Values.RA.addLatheRecipe(
+ craftingItem.getStackOfAmountFromDamage(Items.BoronArsenideCrystal.getMetaID(), 4),
+ craftingItem.getStackFromDamage(Items.BoronArsenideHeatPipe.getMetaID()),
+ null, 1200, 1920);
+ GT_Values.RA.addLatheRecipe(
+ craftingItem.getStackOfAmountFromDamage(Items.IsotopicallyPureDiamondCrystal.getMetaID(), 4),
+ craftingItem.getStackFromDamage(Items.DiamondHeatPipe.getMetaID()),
+ null, 1200, 7680);
+
+ // Heat Vents
+ final ItemStack[] t1HeatVent = {
+ craftingItem.getStackOfAmountFromDamage(Items.CopperHeatPipe.getMetaID(), 2),
+ ItemList.Electric_Motor_MV.get(1L, (Object[]) null),
+ GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.Steel, new ItemStack(ErrorItem.getInstance(), 1), 1),
+ GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Steel, new ItemStack(ErrorItem.getInstance(), 1), 2),
+ GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Steel, new ItemStack(ErrorItem.getInstance(), 1), 8),
+ GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Good, 1),
+ GT_Utility.getIntegratedCircuit(6)
+ };
+ GT_Values.RA.addAssemblerRecipe(
+ t1HeatVent,
+ FluidRegistry.getFluidStack("molten.copper", 144),
+ reactorItem.getStackFromDamage(Items.T1HeatVent.getMetaID()),
+ 200, 120);
+ final ItemStack[] t2HeatVent = {
+ craftingItem.getStackOfAmountFromDamage(Items.SilverHeatPipe.getMetaID(), 2),
+ ItemList.Electric_Motor_HV.get(1L, (Object[]) null),
+ GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.Aluminium, new ItemStack(ErrorItem.getInstance(), 1), 1),
+ GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Aluminium, new ItemStack(ErrorItem.getInstance(), 1), 2),
+ GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Aluminium, new ItemStack(ErrorItem.getInstance(), 1), 8),
+ GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 1),
+ GT_Utility.getIntegratedCircuit(6)
+ };
+ GT_Values.RA.addAssemblerRecipe(
+ t2HeatVent,
+ FluidRegistry.getFluidStack("molten.silver", 144),
+ reactorItem.getStackFromDamage(Items.T2HeatVent.getMetaID()),
+ 400, 480);
+ final ItemStack[] t3HeatVent = {
+ craftingItem.getStackOfAmountFromDamage(Items.BoronArsenideHeatPipe.getMetaID(), 2),
+ ItemList.Electric_Motor_IV.get(1L, (Object[]) null),
+ GT_OreDictUnificator.get(OrePrefixes.rotor, Materials.TungstenSteel, new ItemStack(ErrorItem.getInstance(), 1), 1),
+ GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.TungstenSteel, new ItemStack(ErrorItem.getInstance(), 1), 2),
+ GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Tungsten, new ItemStack(ErrorItem.getInstance(), 1), 8),
+ GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Data, 1),
+ GT_Utility.getIntegratedCircuit(6)
+ };
+ GT_Values.RA.addAssemblerRecipe(
+ t3HeatVent,
+ FluidRegistry.getFluidStack("molten.gallium", 576),
+ reactorItem.getStackFromDamage(Items.T3HeatVent.getMetaID()),
+ 800, 7680);
+
+ System.out.println("...done");
+ }
+
+}
diff --git a/src/main/java/kekztech/MultiFluidHandler.java b/src/main/java/kekztech/MultiFluidHandler.java new file mode 100644 index 0000000000..9b4d8b1bc4 --- /dev/null +++ b/src/main/java/kekztech/MultiFluidHandler.java @@ -0,0 +1,138 @@ +package kekztech; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.fluids.FluidStack; + +public class MultiFluidHandler { + + private static final int MAX_DISTINCT_FLUIDS = 25; + + private final List<FluidStack> fluids = new ArrayList<>(); + private final int capacityPerFluid; + + public MultiFluidHandler(int capacityPerFluid) { + this.capacityPerFluid = capacityPerFluid; + } + + public MultiFluidHandler(int capacityPerFluid, List<FluidStack> fluids) { + this.capacityPerFluid = capacityPerFluid; + this.fluids.addAll(fluids); + } + + public boolean contains(FluidStack fluid) { + return fluids.contains(fluid); + } + + public int getCapacity() { + return capacityPerFluid; + } + + public List<FluidStack> getFluids(){ + return fluids; + } + + public FluidStack getFluid(int slot) { + return fluids.get(slot); + } + + public NBTTagCompound getAsNBTTag(NBTTagCompound nbt) { + nbt = (nbt == null) ? new NBTTagCompound() : nbt; + int c = 0; + for(FluidStack f : fluids) { + nbt.setTag("" + c, f.writeToNBT(new NBTTagCompound())); + } + return nbt; + } + + public ArrayList<String> getInfoData() { + final ArrayList<String> lines = new ArrayList<>(fluids.size() + 1); + lines.add(EnumChatFormatting.YELLOW + "Stored Fluids:" + EnumChatFormatting.RESET); + for(int i = 0; i < fluids.size(); i++) { + lines.add(i + " - " + fluids.get(i).getLocalizedName() + ": " + + fluids.get(i).amount + "L (" + + (Math.round(100.0f * fluids.get(i).amount / getCapacity())) + "%)"); + } + lines.add(EnumChatFormatting.YELLOW + "Operational Data:" + EnumChatFormatting.RESET); + + return lines; + } + + public int pushFluid(FluidStack push) { + if(fluids.size() == MAX_DISTINCT_FLUIDS && !contains(push)) { + return 0; + } else if (fluids.size() < MAX_DISTINCT_FLUIDS && !contains(push)) { + final int fit = Math.min(getCapacity(), push.amount); + fluids.add(new FluidStack(push.getFluid(), fit)); + return fit; + } else { + final FluidStack fs = fluids.get(fluids.indexOf(push)); + final int remcap = getCapacity() - fs.amount; + final int fit = Math.min(remcap, push.amount); + fs.amount += fit; + return fit; + } + } + + public int pushFluid(FluidStack push, int slot) { + if(slot < 0 || slot >= MAX_DISTINCT_FLUIDS) { + return 0; + } + if(!fluids.get(slot).equals(push)) { + return 0; + } else { + final FluidStack fs = fluids.get(slot); + final int remcap = getCapacity() - fs.amount; + final int fit = Math.min(remcap, push.amount); + fs.amount += fit; + return fit; + } + } + + public int pullFluid(FluidStack pull) { + if(!contains(pull)) { + return 0; + } else { + final FluidStack pulled = fluids.get(fluids.indexOf(pull)); + final int rec = Math.min(pull.amount, pulled.amount); + if(pulled.amount <= rec) { + fluids.remove(pulled); + } else { + pulled.amount -= rec; + } + return rec; + } + } + + public int pullFluid(FluidStack pull, int slot) { + if(slot < 0 || slot >= MAX_DISTINCT_FLUIDS) { + return 0; + } + if(!fluids.get(slot).equals(pull)) { + return 0; + } else { + final FluidStack pulled = fluids.get(slot); + final int rec = Math.min(pull.amount, pulled.amount); + if(pulled.amount <= rec) { + fluids.remove(pulled); + } else { + pulled.amount -= rec; + } + return rec; + } + } + + public boolean couldPush(FluidStack push) { + if(fluids.size() == MAX_DISTINCT_FLUIDS && !contains(push)) { + return false; + } else if (fluids.size() < MAX_DISTINCT_FLUIDS && !contains(push)) { + return Math.min(getCapacity(), push.amount) > 0; + } else { + final int remcap = getCapacity() - fluids.get(fluids.indexOf(push)).amount; + return Math.min(remcap, push.amount) > 0; + } + } +} diff --git a/src/main/java/reactor/ButtonSlot.java b/src/main/java/reactor/ButtonSlot.java index 6d777ca280..94c259d403 100644 --- a/src/main/java/reactor/ButtonSlot.java +++ b/src/main/java/reactor/ButtonSlot.java @@ -1,14 +1,14 @@ -package reactor; - -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; - -public class ButtonSlot extends Slot { - - public ButtonSlot(IInventory playerIventory, int slotID, int posX, int posY) { - super(playerIventory, slotID, posX, posY); - - - } - -} +package reactor;
+
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+
+public class ButtonSlot extends Slot {
+
+ public ButtonSlot(IInventory playerIventory, int slotID, int posX, int posY) {
+ super(playerIventory, slotID, posX, posY);
+
+
+ }
+
+}
diff --git a/src/main/java/reactor/items/CoolantCell.java b/src/main/java/reactor/items/CoolantCell.java index 04122fef33..b166b3fc3d 100644 --- a/src/main/java/reactor/items/CoolantCell.java +++ b/src/main/java/reactor/items/CoolantCell.java @@ -1,26 +1,26 @@ -package reactor.items; - -import items.MetaItem_ReactorComponent; -import kekztech.GTRecipe; -import kekztech.Items; - -public class CoolantCell { - - public static String TYPE = "CoolantCell"; - - public static String[] RESOURCE_NAME = { - "HeliumCoolantCell360k", "NaKCoolantCell360k" - }; - - public static int[] HEAT_CAPACITY = { - 360000, 360000 - }; - - public static GTRecipe[] RECIPE = { - new GTRecipe().setDuration(1200).setEUPerTick(480) - .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.HeliumCoolantCell360k.getMetaID())), - new GTRecipe().setDuration(1200).setEUPerTick(480) - .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.NaKCoolantCell360k.getMetaID())) - }; - -} +package reactor.items;
+
+import items.MetaItem_ReactorComponent;
+import kekztech.GTRecipe;
+import kekztech.Items;
+
+public class CoolantCell {
+
+ public static String TYPE = "CoolantCell";
+
+ public static String[] RESOURCE_NAME = {
+ "HeliumCoolantCell360k", "NaKCoolantCell360k"
+ };
+
+ public static int[] HEAT_CAPACITY = {
+ 360000, 360000
+ };
+
+ public static GTRecipe[] RECIPE = {
+ new GTRecipe().setDuration(1200).setEUPerTick(480)
+ .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.HeliumCoolantCell360k.getMetaID())),
+ new GTRecipe().setDuration(1200).setEUPerTick(480)
+ .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.NaKCoolantCell360k.getMetaID()))
+ };
+
+}
diff --git a/src/main/java/reactor/items/FuelRod.java b/src/main/java/reactor/items/FuelRod.java index d0f9cb5e17..9cb697a373 100644 --- a/src/main/java/reactor/items/FuelRod.java +++ b/src/main/java/reactor/items/FuelRod.java @@ -1,114 +1,114 @@ -package reactor.items; - -import items.MetaItem_ReactorComponent; -import kekztech.GTRecipe; -import kekztech.Items; - -public class FuelRod { - - public static final int METAOFFSET = 17; - public static final int METAOFFSET_DEPLETED = 29; - - public static final String TYPE = "FuelRod"; - public static final String TYPE_DEPLETED = "DepletedFuelRod"; - public static final String LIFETIME = "LIFETIME"; - public static final String PULSES = "PULSES"; - public static final String HEAT_PER_SECOND = "HEAT_PER_SECOND"; - public static final String HEAT_PER_PULSE = "HEAT_PER_PULSE"; - public static final String HEAT_BOOST_RATE = "HEAT_BOOST_RATE"; - public static final String EU_PER_TICK = "EU_PER_TICK"; - public static final String EU_PER_PULSE = "EU_PER_PULSE"; - - - public static final String[] RESOURCE_NAME = { - "UraniumFuelRod", "UraniumDualFuelRod", "UraniumQuadFuelRod", - "ThoriumFuelRod", "ThoriumDualFuelRod", "ThoriumQuadFuelRod", - "MOXFuelRod", "MOXDualFuelRod", "MOXQuadFuelRod", - "NaquadahFuelRod", "NaquadahDualFuelRod", "NaquadahQuadFuelRod", - "Th_MOXFuelRod", "Th_MOXDualFuelRod", "Th_MOXQuadFuelRod" - }; - - public static final String[] RESOURCE_NAME_DEPLETED = { - "DepletedUraniumFuelRod", "DepletedUraniumDualFuelRod", "DepletedUraniumQuadFuelRod", - "DepletedThoriumFuelRod", "DepletedThoriumDualFuelRod", "DepletedThoriumQuadFuelRod", - "DepletedMOXFuelRod", "DepletedMOXDualFuelRod", "DepletedMOXQuadFuelRod", - "DepletedNaquadahFuelRod", "DepletedNaquadahDualFuelRod", "DepletedNaquadahQuadFuelRod", - "Th_DepletedMOXFuelRod", "Th_DepletedMOXDualFuelRod", "Th_DepletedMOXQuadFuelRod" - }; - - public static final int[] VALUES_LIFETIME = { - 20000, 20000, 20000, 100000, 100000, 100000, - 10000, 10000, 10000, 100000, 100000, 100000, - 50000, 50000, 50000 - }; - - public static final int[] VALUES_PULSES = { - 1, 2, 4, 1, 2, 4, - 1, 2, 4, 1, 2, 4, - 1, 2, 4 - }; - - public static final int[] VALUES_HEAT_PER_SECOND = { - 4, 24, 96, 1, 6, 24, - 4, 24, 96, 80, 480, 1920, - 1, 6, 24 - }; - - public static final int[] VALUES_HEAT_PER_PULSE = { - 4, 4, 4, 1, 1, 1, - 4, 4, 4, 80, 80, 80, - 1, 1, 1 - - }; - - public static final double[] VALUES_HEAT_BOOST_RATE = { - 1, 1, 1, 1, 1, 1, - 5, 5, 5, 1, 1, 1, - 2, 2, 2 - }; - - public static final int[] VALUES_EU_PER_TICK = { - 50, 200, 600, 10, 40, 120, - 50, 200, 600, 100, 400, 1200, - 10, 40, 120 - }; - - public static final int[] VALUES_EU_PER_PULSE = { - 50, 50, 50, 10, 10, 10, - 50, 50, 50, 100, 100, 100, - 10, 10, 10 - }; - - public static final GTRecipe[] RECIPE = { - // Uranium Fuel Rod - new GTRecipe().setDuration(600).setEUPerTick(480) - .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.UraniumFuelRod.getMetaID())), - new GTRecipe().setDuration(800).setEUPerTick(480) - .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.UraniumDualFuelRod.getMetaID())), - new GTRecipe().setDuration(1000).setEUPerTick(480) - .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.UraniumQuadFuelRod.getMetaID())), - // Thorium Fuel Rod - new GTRecipe().setDuration(600).setEUPerTick(480) - .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.ThoriumFuelRod.getMetaID())), - new GTRecipe().setDuration(800).setEUPerTick(480) - .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.ThoriumDualFuelRod.getMetaID())), - new GTRecipe().setDuration(1000).setEUPerTick(480) - .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.ThoriumQuadFuelRod.getMetaID())), - // MOX Fuel Rod - new GTRecipe().setDuration(600).setEUPerTick(1920) - .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.MOXFuelRod.getMetaID())), - new GTRecipe().setDuration(800).setEUPerTick(1920) - .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.MOXDualFuelRod.getMetaID())), - new GTRecipe().setDuration(1000).setEUPerTick(1920) - .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.MOXQuadFuelRod.getMetaID())), - // Naquadah Fuel Rod - new GTRecipe().setDuration(600).setEUPerTick(7680) - .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.NaquadahFuelRod.getMetaID())), - new GTRecipe().setDuration(800).setEUPerTick(7680) - .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.NaquadahDualFuelRod.getMetaID())), - new GTRecipe().setDuration(1000).setEUPerTick(7680) - .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.NaquadahQuadFuelRod.getMetaID())), - // Thorium MOX Fuel Rod - }; - -} +package reactor.items;
+
+import items.MetaItem_ReactorComponent;
+import kekztech.GTRecipe;
+import kekztech.Items;
+
+public class FuelRod {
+
+ public static final int METAOFFSET = 17;
+ public static final int METAOFFSET_DEPLETED = 29;
+
+ public static final String TYPE = "FuelRod";
+ public static final String TYPE_DEPLETED = "DepletedFuelRod";
+ public static final String LIFETIME = "LIFETIME";
+ public static final String PULSES = "PULSES";
+ public static final String HEAT_PER_SECOND = "HEAT_PER_SECOND";
+ public static final String HEAT_PER_PULSE = "HEAT_PER_PULSE";
+ public static final String HEAT_BOOST_RATE = "HEAT_BOOST_RATE";
+ public static final String EU_PER_TICK = "EU_PER_TICK";
+ public static final String EU_PER_PULSE = "EU_PER_PULSE";
+
+
+ public static final String[] RESOURCE_NAME = {
+ "UraniumFuelRod", "UraniumDualFuelRod", "UraniumQuadFuelRod",
+ "ThoriumFuelRod", "ThoriumDualFuelRod", "ThoriumQuadFuelRod",
+ "MOXFuelRod", "MOXDualFuelRod", "MOXQuadFuelRod",
+ "NaquadahFuelRod", "NaquadahDualFuelRod", "NaquadahQuadFuelRod",
+ "Th_MOXFuelRod", "Th_MOXDualFuelRod", "Th_MOXQuadFuelRod"
+ };
+
+ public static final String[] RESOURCE_NAME_DEPLETED = {
+ "DepletedUraniumFuelRod", "DepletedUraniumDualFuelRod", "DepletedUraniumQuadFuelRod",
+ "DepletedThoriumFuelRod", "DepletedThoriumDualFuelRod", "DepletedThoriumQuadFuelRod",
+ "DepletedMOXFuelRod", "DepletedMOXDualFuelRod", "DepletedMOXQuadFuelRod",
+ "DepletedNaquadahFuelRod", "DepletedNaquadahDualFuelRod", "DepletedNaquadahQuadFuelRod",
+ "Th_DepletedMOXFuelRod", "Th_DepletedMOXDualFuelRod", "Th_DepletedMOXQuadFuelRod"
+ };
+
+ public static final int[] VALUES_LIFETIME = {
+ 20000, 20000, 20000, 100000, 100000, 100000,
+ 10000, 10000, 10000, 100000, 100000, 100000,
+ 50000, 50000, 50000
+ };
+
+ public static final int[] VALUES_PULSES = {
+ 1, 2, 4, 1, 2, 4,
+ 1, 2, 4, 1, 2, 4,
+ 1, 2, 4
+ };
+
+ public static final int[] VALUES_HEAT_PER_SECOND = {
+ 4, 24, 96, 1, 6, 24,
+ 4, 24, 96, 80, 480, 1920,
+ 1, 6, 24
+ };
+
+ public static final int[] VALUES_HEAT_PER_PULSE = {
+ 4, 4, 4, 1, 1, 1,
+ 4, 4, 4, 80, 80, 80,
+ 1, 1, 1
+
+ };
+
+ public static final double[] VALUES_HEAT_BOOST_RATE = {
+ 1, 1, 1, 1, 1, 1,
+ 5, 5, 5, 1, 1, 1,
+ 2, 2, 2
+ };
+
+ public static final int[] VALUES_EU_PER_TICK = {
+ 50, 200, 600, 10, 40, 120,
+ 50, 200, 600, 100, 400, 1200,
+ 10, 40, 120
+ };
+
+ public static final int[] VALUES_EU_PER_PULSE = {
+ 50, 50, 50, 10, 10, 10,
+ 50, 50, 50, 100, 100, 100,
+ 10, 10, 10
+ };
+
+ public static final GTRecipe[] RECIPE = {
+ // Uranium Fuel Rod
+ new GTRecipe().setDuration(600).setEUPerTick(480)
+ .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.UraniumFuelRod.getMetaID())),
+ new GTRecipe().setDuration(800).setEUPerTick(480)
+ .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.UraniumDualFuelRod.getMetaID())),
+ new GTRecipe().setDuration(1000).setEUPerTick(480)
+ .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.UraniumQuadFuelRod.getMetaID())),
+ // Thorium Fuel Rod
+ new GTRecipe().setDuration(600).setEUPerTick(480)
+ .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.ThoriumFuelRod.getMetaID())),
+ new GTRecipe().setDuration(800).setEUPerTick(480)
+ .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.ThoriumDualFuelRod.getMetaID())),
+ new GTRecipe().setDuration(1000).setEUPerTick(480)
+ .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.ThoriumQuadFuelRod.getMetaID())),
+ // MOX Fuel Rod
+ new GTRecipe().setDuration(600).setEUPerTick(1920)
+ .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.MOXFuelRod.getMetaID())),
+ new GTRecipe().setDuration(800).setEUPerTick(1920)
+ .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.MOXDualFuelRod.getMetaID())),
+ new GTRecipe().setDuration(1000).setEUPerTick(1920)
+ .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.MOXQuadFuelRod.getMetaID())),
+ // Naquadah Fuel Rod
+ new GTRecipe().setDuration(600).setEUPerTick(7680)
+ .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.NaquadahFuelRod.getMetaID())),
+ new GTRecipe().setDuration(800).setEUPerTick(7680)
+ .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.NaquadahDualFuelRod.getMetaID())),
+ new GTRecipe().setDuration(1000).setEUPerTick(7680)
+ .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.NaquadahQuadFuelRod.getMetaID())),
+ // Thorium MOX Fuel Rod
+ };
+
+}
diff --git a/src/main/java/reactor/items/HeatExchanger.java b/src/main/java/reactor/items/HeatExchanger.java index 48ca7d9fa5..7018f620ec 100644 --- a/src/main/java/reactor/items/HeatExchanger.java +++ b/src/main/java/reactor/items/HeatExchanger.java @@ -1,60 +1,60 @@ -package reactor.items; - -import items.MetaItem_CraftingComponent; -import items.MetaItem_ReactorComponent; -import kekztech.GTRecipe; -import kekztech.Items; -import net.minecraftforge.fluids.FluidRegistry; -import util.Util; - -public class HeatExchanger { - - public static String TYPE = "HeatExchanger"; - - public static String[] RESOURCE_NAME = { - "T1HeatExchanger", "T2HeatExchanger", "T3HeatExchanger", "T4HeatExchanger" - }; - - public static int[] HEAT_CAPACITY = { - 2000, 8000, 32000, 128000 - }; - - public static int[] COMPONENT_EXCHANGE_RATE = { - 12, 24, 96, 384 - }; - - public static int[] HULL_EXCHANGE_RATE = { - 4, 8, 32, 128 - }; - - public static GTRecipe[] RECIPE = { - new GTRecipe().setDuration(200).setEUPerTick(120) - .addInputItem(MetaItem_CraftingComponent.getInstance().getStackOfAmountFromDamage(Items.CopperHeatPipe.getMetaID(), 4)) - .addInputItem(Util.getStackofAmountFromOreDict("plateDenseCopper", 1)) - .addInputFluid(FluidRegistry.getFluidStack("molten.copper", 576)) - .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.T1HeatExchanger.getMetaID())), - new GTRecipe().setDuration(400).setEUPerTick(480) - .addInputItem(MetaItem_CraftingComponent.getInstance().getStackOfAmountFromDamage(Items.SilverHeatPipe.getMetaID(), 4)) - .addInputItem(Util.getStackofAmountFromOreDict("plateDenseSilver", 1)) - .addInputFluid(FluidRegistry.getFluidStack("molten.silver", 576)) - .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.T2HeatExchanger.getMetaID())), - new GTRecipe().setDuration(800).setEUPerTick(7680) - .addInputItem(MetaItem_CraftingComponent.getInstance().getStackOfAmountFromDamage(Items.BoronArsenideHeatPipe.getMetaID(), 4)) - .addInputItem(Util.getStackofAmountFromOreDict("pipeTinyCopper", 4)) - .addInputItem(Util.getStackofAmountFromOreDict("wireFineSilver", 16)) - //.addInputItem(new ItemStack(ItemList.Pump_EV.getItem(), 1)) - .addInputFluid(FluidRegistry.getFluidStack("ic2coolant", 720)) - .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.T3HeatExchanger.getMetaID())), - new GTRecipe().setDuration(1600).setEUPerTick(30720) - .addInputItem(MetaItem_CraftingComponent.getInstance().getStackOfAmountFromDamage(Items.DiamondHeatPipe.getMetaID(), 4)) - .addInputItem(Util.getStackofAmountFromOreDict("frameGTHSSE", 1)) - .addInputItem(Util.getStackofAmountFromOreDict("plateHSSE", 6)) - .addInputItem(Util.getStackofAmountFromOreDict("screwOsmiridium", 24)) - .addInputItem(Util.getStackofAmountFromOreDict("pipeTinyEnderium", 4)) - //.addInputItem(new ItemStack(ItemList.Pump_LuV.getItem(), 1)) - .addInputFluid(FluidRegistry.getFluidStack("molten.gallium", 1152)) - .addInputFluid(FluidRegistry.getFluidStack("helium", 10000)) - .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.T4HeatExchanger.getMetaID())) - }; - -} +package reactor.items;
+
+import items.MetaItem_CraftingComponent;
+import items.MetaItem_ReactorComponent;
+import kekztech.GTRecipe;
+import kekztech.Items;
+import net.minecraftforge.fluids.FluidRegistry;
+import util.Util;
+
+public class HeatExchanger {
+
+ public static String TYPE = "HeatExchanger";
+
+ public static String[] RESOURCE_NAME = {
+ "T1HeatExchanger", "T2HeatExchanger", "T3HeatExchanger", "T4HeatExchanger"
+ };
+
+ public static int[] HEAT_CAPACITY = {
+ 2000, 8000, 32000, 128000
+ };
+
+ public static int[] COMPONENT_EXCHANGE_RATE = {
+ 12, 24, 96, 384
+ };
+
+ public static int[] HULL_EXCHANGE_RATE = {
+ 4, 8, 32, 128
+ };
+
+ public static GTRecipe[] RECIPE = {
+ new GTRecipe().setDuration(200).setEUPerTick(120)
+ .addInputItem(MetaItem_CraftingComponent.getInstance().getStackOfAmountFromDamage(Items.CopperHeatPipe.getMetaID(), 4))
+ .addInputItem(Util.getStackofAmountFromOreDict("plateDenseCopper", 1))
+ .addInputFluid(FluidRegistry.getFluidStack("molten.copper", 576))
+ .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.T1HeatExchanger.getMetaID())),
+ new GTRecipe().setDuration(400).setEUPerTick(480)
+ .addInputItem(MetaItem_CraftingComponent.getInstance().getStackOfAmountFromDamage(Items.SilverHeatPipe.getMetaID(), 4))
+ .addInputItem(Util.getStackofAmountFromOreDict("plateDenseSilver", 1))
+ .addInputFluid(FluidRegistry.getFluidStack("molten.silver", 576))
+ .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.T2HeatExchanger.getMetaID())),
+ new GTRecipe().setDuration(800).setEUPerTick(7680)
+ .addInputItem(MetaItem_CraftingComponent.getInstance().getStackOfAmountFromDamage(Items.BoronArsenideHeatPipe.getMetaID(), 4))
+ .addInputItem(Util.getStackofAmountFromOreDict("pipeTinyCopper", 4))
+ .addInputItem(Util.getStackofAmountFromOreDict("wireFineSilver", 16))
+ //.addInputItem(new ItemStack(ItemList.Pump_EV.getItem(), 1))
+ .addInputFluid(FluidRegistry.getFluidStack("ic2coolant", 720))
+ .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.T3HeatExchanger.getMetaID())),
+ new GTRecipe().setDuration(1600).setEUPerTick(30720)
+ .addInputItem(MetaItem_CraftingComponent.getInstance().getStackOfAmountFromDamage(Items.DiamondHeatPipe.getMetaID(), 4))
+ .addInputItem(Util.getStackofAmountFromOreDict("frameGTHSSE", 1))
+ .addInputItem(Util.getStackofAmountFromOreDict("plateHSSE", 6))
+ .addInputItem(Util.getStackofAmountFromOreDict("screwOsmiridium", 24))
+ .addInputItem(Util.getStackofAmountFromOreDict("pipeTinyEnderium", 4))
+ //.addInputItem(new ItemStack(ItemList.Pump_LuV.getItem(), 1))
+ .addInputFluid(FluidRegistry.getFluidStack("molten.gallium", 1152))
+ .addInputFluid(FluidRegistry.getFluidStack("helium", 10000))
+ .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.T4HeatExchanger.getMetaID()))
+ };
+
+}
diff --git a/src/main/java/reactor/items/HeatVent.java b/src/main/java/reactor/items/HeatVent.java index 8743876a78..b6c48120b4 100644 --- a/src/main/java/reactor/items/HeatVent.java +++ b/src/main/java/reactor/items/HeatVent.java @@ -1,50 +1,50 @@ -package reactor.items; - -import kekztech.GTRecipe; - -public class HeatVent { - - public static final String TYPE = "HeatVent"; - public static final String HEAT = "HEAT"; - public static final String RESOURCE_NAME = "RESOURCE_NAME"; - public static final String HEAT_CAPACITY = "HEAT_CAPACITY"; - public static final String COMPONENT_VENT_RATE = "COMPONENT_VENT_RATE"; - public static final String HULL_DRAW_RATE = "HULL_DRAW_RATE"; - public static final String SELF_COOL_RATE = "SELF_COOL_RATE"; - - - public static String[] RESOURCE_NAMES = { - "T1HeatVent", "T2HeatVent", "T3HeatVent", "T4HeatVent", - "T1ComponentHeatVent", "T2ComponentHeatVent", "T3ComponentHeatVent", "T4ComponentHeatVent", - "T1OverclockedHeatVent", "T2OverclockedHeatVent", "T3OverclockedHeatVent", "T4OverclockedHeatVent" - }; - - public static int[] HEAT_CAPACITIES = { - 1000, 4000, 8000, 32000, - 1000, 4000, 8000, 32000, - 1000, 4000, 8000, 32000 - }; - - public static int[] COMPONENT_VENT_RATES = { - 0, 0, 0, 0, - 6, 12, 48, 96, - 0, 0, 0, 0 - }; - - public static int[] HULL_DRAW_RATES = { - 0, 0, 0, 0, - 0, 0, 0, 0, - 18, 36, 144, 288 - }; - - public static int[] SELF_COOL_RATES = { - 6, 12, 48, 96, - 0, 0, 0, 0, - 10, 20, 80, 160 - }; - - public static final GTRecipe[] RECIPE = { - - }; - -} +package reactor.items;
+
+import kekztech.GTRecipe;
+
+public class HeatVent {
+
+ public static final String TYPE = "HeatVent";
+ public static final String HEAT = "HEAT";
+ public static final String RESOURCE_NAME = "RESOURCE_NAME";
+ public static final String HEAT_CAPACITY = "HEAT_CAPACITY";
+ public static final String COMPONENT_VENT_RATE = "COMPONENT_VENT_RATE";
+ public static final String HULL_DRAW_RATE = "HULL_DRAW_RATE";
+ public static final String SELF_COOL_RATE = "SELF_COOL_RATE";
+
+
+ public static String[] RESOURCE_NAMES = {
+ "T1HeatVent", "T2HeatVent", "T3HeatVent", "T4HeatVent",
+ "T1ComponentHeatVent", "T2ComponentHeatVent", "T3ComponentHeatVent", "T4ComponentHeatVent",
+ "T1OverclockedHeatVent", "T2OverclockedHeatVent", "T3OverclockedHeatVent", "T4OverclockedHeatVent"
+ };
+
+ public static int[] HEAT_CAPACITIES = {
+ 1000, 4000, 8000, 32000,
+ 1000, 4000, 8000, 32000,
+ 1000, 4000, 8000, 32000
+ };
+
+ public static int[] COMPONENT_VENT_RATES = {
+ 0, 0, 0, 0,
+ 6, 12, 48, 96,
+ 0, 0, 0, 0
+ };
+
+ public static int[] HULL_DRAW_RATES = {
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 18, 36, 144, 288
+ };
+
+ public static int[] SELF_COOL_RATES = {
+ 6, 12, 48, 96,
+ 0, 0, 0, 0,
+ 10, 20, 80, 160
+ };
+
+ public static final GTRecipe[] RECIPE = {
+
+ };
+
+}
diff --git a/src/main/java/reactor/items/NeutronReflector.java b/src/main/java/reactor/items/NeutronReflector.java index 5766cb41e9..9275b860ae 100644 --- a/src/main/java/reactor/items/NeutronReflector.java +++ b/src/main/java/reactor/items/NeutronReflector.java @@ -1,26 +1,26 @@ -package reactor.items; - -import items.MetaItem_ReactorComponent; -import kekztech.GTRecipe; -import kekztech.Items; - -public class NeutronReflector { - - public static String TYPE = "NeutronReflector"; - - public static String[] RESOURCE_NAME = { - "T1NeutronReflector", "T2NeutronReflector" - }; - - public static int[] DURABILITY = { - 512000, 2147483647 - }; - - public static GTRecipe[] RECIPE = { - new GTRecipe().setDuration(1200).setEUPerTick(480) - .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.T1NeutronReflector.getMetaID())), - new GTRecipe().setDuration(4800).setEUPerTick(7680) - .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.T2NeutronReflector.getMetaID())) - }; - -} +package reactor.items;
+
+import items.MetaItem_ReactorComponent;
+import kekztech.GTRecipe;
+import kekztech.Items;
+
+public class NeutronReflector {
+
+ public static String TYPE = "NeutronReflector";
+
+ public static String[] RESOURCE_NAME = {
+ "T1NeutronReflector", "T2NeutronReflector"
+ };
+
+ public static int[] DURABILITY = {
+ 512000, 2147483647
+ };
+
+ public static GTRecipe[] RECIPE = {
+ new GTRecipe().setDuration(1200).setEUPerTick(480)
+ .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.T1NeutronReflector.getMetaID())),
+ new GTRecipe().setDuration(4800).setEUPerTick(7680)
+ .addOutputItem(MetaItem_ReactorComponent.getInstance().getStackFromDamage(Items.T2NeutronReflector.getMetaID()))
+ };
+
+}
diff --git a/src/main/java/tileentities/GTMTE_FluidMultiStorage.java b/src/main/java/tileentities/GTMTE_FluidMultiStorage.java index a11dcdda8a..32d17d1cf5 100644 --- a/src/main/java/tileentities/GTMTE_FluidMultiStorage.java +++ b/src/main/java/tileentities/GTMTE_FluidMultiStorage.java @@ -1,518 +1,503 @@ -package tileentities; - -import java.util.ArrayList; -import blocks.Block_TFFTCasing; -import blocks.Block_TFFTStorageFieldBlockT1; -import blocks.Block_TFFTStorageFieldBlockT2; -import blocks.Block_TFFTStorageFieldBlockT3; -import blocks.Block_TFFTStorageFieldBlockT4; -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 gregtech.api.util.GT_Utility; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.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 util.Vector3i; -import util.Vector3ic; - -public class GTMTE_FluidMultiStorage extends GT_MetaTileEntity_MultiBlockBase { - - private final String glassNameAE2 = "tile.appliedenergistics2.BlockQuartzGlass"; - private final String glassNameStained = "tile.stainedGlass"; - private final Block CASING = Block_TFFTCasing.getInstance(); - private final Block STORAGE_FIELD1 = Block_TFFTStorageFieldBlockT1.getInstance(); - private final Block STORAGE_FIELD2 = Block_TFFTStorageFieldBlockT2.getInstance(); - private final Block STORAGE_FIELD3 = Block_TFFTStorageFieldBlockT3.getInstance(); - private final Block STORAGE_FIELD4 = Block_TFFTStorageFieldBlockT4.getInstance(); - private final int CASING_TEXTURE_ID = 176; - - private final ArrayList<FluidStack> fluidList = new ArrayList<>(); - private int capacityPerFluid = 0; - private int runningCost = 0; - private boolean doVoidExcess = false; - - 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() { - return new String[] { - "High-Tech fluid tank that can hold up to 25 different fluids", - "Has 1/25th of the total capacity as capacity for each fluid", - "Rightclicking the controller with a screwdriver will turn on excess voiding", - "Fluid storage amount and running cost depends on the storage field blocks used", - "Tier I: 500,000L per block, 0.5EU/t", - "Tier II: 4,000,000L per block, 1EU/t", - "Tier III: 16,000,000L per block, 2EU/t", - "Tier IV: 64,000,000L per block, 4EU/t", - "------------------------------------------", - "Note on hatch locking:", - "Use an integrated circuit in the GUI slot to limit which fluid is outputted", - "The number of a stored fluid can be obtained through the Tricorder.", - "------------------------------------------", - "Dimensions: 5x9x5 (WxHxL)", - "Structure:", - " Controller: Top center", - " Energy Hatch: Any top or bottom casing", - " Inner 3x7x3 tube are Storage Field Blocks", - " Outer 5x7x5 glass shell is AE2 Quartz Glass or Vanilla Stained Glass", - " Maintenance Hatch: Any top or bottom casing", - " I/O Hatches: Instead of any casing or glass, have to touch storage field" - }; - } - - @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) { - - this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000; - this.mEfficiencyIncrease = 10000; - this.mEUt = runningCost; - super.mMaxProgresstime = 10; - - // Suck in fluids - final ArrayList<FluidStack> storedFluids = super.getStoredFluids(); - if(storedFluids.size() > 0) { - for(FluidStack fluidStack : storedFluids) { - - // check if fluid is already in the tank - boolean foundFluid = false; - for(FluidStack fs : fluidList) { - if(GT_Utility.areFluidsEqual(fluidStack, fs)) { - // figure out how much can be input - final int possibleInput = Math.min(capacityPerFluid - fs.amount, fluidStack.amount); - fs.amount += possibleInput; - final FluidStack tempStack = fluidStack.copy(); - tempStack.amount = possibleInput; - super.depleteInput(tempStack); - foundFluid = true; - break; - } - } - if(foundFluid) { - continue; - } - // fluid wasn't already in the tank - allocate new - if(fluidList.size() < 25) { - System.out.println("added " + fluidStack.getUnlocalizedName() + " to new stack"); - final FluidStack drainStack = fluidStack.copy(); - drainStack.amount = fluidStack.amount; - super.depleteInput(drainStack); - fluidList.add(drainStack); - } - } - - // void excess if that is turned on - if(doVoidExcess) { - for(GT_MetaTileEntity_Hatch_Input inputHatch : super.mInputHatches) { - inputHatch.setDrainableStack(null); - } - } - } - - // Push out fluids - if(guiSlotItem != null && guiSlotItem.getUnlocalizedName().equals("gt.integrated_circuit")) { - final int config = guiSlotItem.getItemDamage(); - final FluidStack storedFluid = fluidList.get(config); - if(storedFluid == null) { - return true; - } - // figure out how much can be output - 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 - possibleOutput = Math.min(possibleOutput, storedFluid.amount); - final FluidStack tempStack = storedFluid.copy(); - tempStack.amount = possibleOutput; - - super.addOutput(tempStack); - storedFluid.amount -= possibleOutput; - // remove fluid from the tank if it has amount of zero - if(storedFluid.amount < 1) { - fluidList.remove(config); - } - } else { - for(FluidStack storedFluid : fluidList) { - // figure out how much can be output - 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 - possibleOutput = Math.min(possibleOutput, storedFluid.amount); - final FluidStack tempStack = storedFluid.copy(); - tempStack.amount = possibleOutput; - - super.addOutput(tempStack); - storedFluid.amount -= possibleOutput; - // remove fluid from the tank if it has amount of zero - if(storedFluid.amount < 1) { - fluidList.remove(storedFluid); - } - } - } - - return true; - } - - 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; - - // Front slice - for(int X = -2; X <= 2; X++) { - for(int Y = -2; Y <= 2; 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()); - - // 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 { - 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 three slices - 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 += 500000.0f; - } else if(thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName() - .equals(STORAGE_FIELD2.getUnlocalizedName())) { - runningCostAcc += 1.0f; - fluidCapacityAcc += 4000000.0f; - } else if(thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName() - .equals(STORAGE_FIELD3.getUnlocalizedName())) { - runningCostAcc += 2.0f; - fluidCapacityAcc += 16000000.0f; - } else if(thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName() - .equals(STORAGE_FIELD4.getUnlocalizedName())) { - runningCostAcc += 4.0f; - fluidCapacityAcc += 64000000.0f; - } else { - formationChecklist = false; - } - continue; - } - - // Get next TE - IGregTechTileEntity currentTE = - thisController.getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z());// x, y ,z - - // Corner allows only glass or casings - 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(glassNameAE2) - || thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName().equals(glassNameStained) - || thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CASING)) { - formationChecklist = false; // do nothing yet - } - } 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. - 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(glassNameAE2) - || thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName().equals(glassNameStained)) { - // do nothing lol - } else { - formationChecklist = false; - } - } - } - } - } - } - - // Front slice - 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); - 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 { - 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) { - 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."); - } - - if(minCasingAmount > 0) { - formationChecklist = false; - } - - if(formationChecklist) { - runningCost = (int) Math.round(-runningCostAcc); - capacityPerFluid = (int) Math.round(fluidCapacityAcc / 25.0f); - } - - 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 String[] lines = new String[fluidList.size() + 7]; - lines[0] = EnumChatFormatting.YELLOW + "Stored Fluids:" + EnumChatFormatting.RESET; - for(int i = 0; i < fluidList.size(); i++) { - lines[i + 1] = i + " - " + fluidList.get(i).getLocalizedName() + ": " - + fluidList.get(i).amount + "L (" - + (Math.round(100.0f * fluidList.get(i).amount / capacityPerFluid)) + "%)"; - } - lines[fluidList.size() + 1] = EnumChatFormatting.YELLOW + "Operational Data:" + EnumChatFormatting.RESET; - lines[fluidList.size() + 2] = "Auto-voiding: " + doVoidExcess; - lines[fluidList.size() + 3] = "Per-Fluid Capacity: " + capacityPerFluid + "L"; - lines[fluidList.size() + 4] = "Running Cost: " + (-super.mEUt) + "EU/t"; - lines[fluidList.size() + 5] = "Maintenance Status: " + ((super.getRepairStatus() == super.getIdealStatus()) - ? EnumChatFormatting.GREEN + "Working perfectly" + EnumChatFormatting.RESET - : EnumChatFormatting.RED + "Has Problems" + EnumChatFormatting.RESET); - lines[fluidList.size() + 6] = "---------------------------------------------"; - return lines; - } - - @Override - public void saveNBTData(NBTTagCompound nbt) { - nbt = (nbt == null) ? new NBTTagCompound() : nbt; - - nbt.setInteger("capacityPerFluid", capacityPerFluid); - nbt.setInteger("runningCost", runningCost); - nbt.setBoolean("doVoidExcess", doVoidExcess); - for(int i = 0; i < fluidList.size(); i++) { - nbt.setTag("" + i, fluidList.get(i).writeToNBT(new NBTTagCompound())); - } - - super.saveNBTData(nbt); - } - - @Override - public void loadNBTData(NBTTagCompound nbt) { - nbt = (nbt == null) ? new NBTTagCompound() : nbt; - - capacityPerFluid = nbt.getInteger("capacityPerFluid"); - runningCost = nbt.getInteger("runningCost"); - doVoidExcess = nbt.getBoolean("doVoidExcess"); - fluidList.clear(); - for(int i = 0; i < 25; i++) { - final NBTTagCompound fnbt = (NBTTagCompound) nbt.getTag("" + i); - if(fnbt == null) { - break; - } - fluidList.add(FluidStack.loadFluidStackFromNBT(fnbt)); - } - - 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 tileentities;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import blocks.Block_TFFTCasing;
+import blocks.Block_TFFTStorageFieldBlockT1;
+import blocks.Block_TFFTStorageFieldBlockT2;
+import blocks.Block_TFFTStorageFieldBlockT3;
+import blocks.Block_TFFTStorageFieldBlockT4;
+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 util.Vector3i;
+import util.Vector3ic;
+
+public class GTMTE_FluidMultiStorage extends GT_MetaTileEntity_MultiBlockBase {
+
+ private final String glassNameAE2 = "tile.appliedenergistics2.BlockQuartzGlass";
+ private final String glassNameStained = "tile.stainedGlass";
+ private final Block CASING = Block_TFFTCasing.getInstance();
+ private final Block STORAGE_FIELD1 = Block_TFFTStorageFieldBlockT1.getInstance();
+ private final Block STORAGE_FIELD2 = Block_TFFTStorageFieldBlockT2.getInstance();
+ private final Block STORAGE_FIELD3 = Block_TFFTStorageFieldBlockT3.getInstance();
+ private final Block STORAGE_FIELD4 = Block_TFFTStorageFieldBlockT4.getInstance();
+ private final int CASING_TEXTURE_ID = 176;
+
+ private MultiFluidHandler mfh;
+
+ private int runningCost = 0;
+ private boolean doVoidExcess = false;
+
+ 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() {
+ return new String[] {
+ "High-Tech fluid tank that can hold up to 25 different fluids",
+ "Has 1/25th of the total capacity as capacity for each fluid",
+ "Rightclicking the controller with a screwdriver will turn on excess voiding",
+ "Fluid storage amount and running cost depends on the storage field blocks used",
+ "Tier I: 500,000L per block, 0.5EU/t",
+ "Tier II: 4,000,000L per block, 1EU/t",
+ "Tier III: 16,000,000L per block, 2EU/t",
+ "Tier IV: 64,000,000L per block, 4EU/t",
+ "------------------------------------------",
+ "Note on hatch locking:",
+ "Use an integrated circuit in the GUI slot to limit which fluid is outputted",
+ "The number of a stored fluid can be obtained through the Tricorder.",
+ "------------------------------------------",
+ "Dimensions: 5x9x5 (WxHxL)",
+ "Structure:",
+ " Controller: Top center",
+ " Energy Hatch: Any top or bottom casing",
+ " Inner 3x7x3 tube are Storage Field Blocks",
+ " Outer 5x7x5 glass shell is AE2 Quartz Glass or Vanilla Stained Glass",
+ " Maintenance Hatch: Any top or bottom casing",
+ " I/O Hatches: Instead of any casing or glass, have to touch storage field"
+ };
+ }
+
+ @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) {
+
+ this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000;
+ this.mEfficiencyIncrease = 10000;
+ this.mEUt = runningCost;
+ super.mMaxProgresstime = 10;
+
+ // TODO skip all of the currently existing code in here when there are only multi hatches
+
+ // Suck in fluids
+ final ArrayList<FluidStack> inputHatchFluids = super.getStoredFluids();
+ if(inputHatchFluids.size() > 0) {
+
+ for(FluidStack fluidStack : inputHatchFluids) {
+
+ final int pushed = mfh.pushFluid(fluidStack);
+ final FluidStack toDeplete = fluidStack.copy();
+ toDeplete.amount = pushed;
+ super.depleteInput(toDeplete);
+ }
+
+ // Void excess if that is turned on
+ if(doVoidExcess) {
+ for(GT_MetaTileEntity_Hatch_Input inputHatch : super.mInputHatches) {
+ inputHatch.setDrainableStack(null);
+ }
+ }
+ }
+
+ // TODO output seems to ignore circuit
+ // Push out fluids
+ if(guiSlotItem != null && guiSlotItem.getUnlocalizedName().equals("gt.integrated_circuit")) {
+ final int config = guiSlotItem.getItemDamage();
+ final FluidStack storedFluid = mfh.getFluid(config);
+ // 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;
+ possibleOutput = mfh.pullFluid(tempStack, config);
+ super.addOutput(tempStack);
+
+ } else {
+ final Iterator<FluidStack> storageIterator = mfh.getFluids().iterator();
+ while(storageIterator.hasNext()) {
+ FluidStack storedFluid = storageIterator.next();
+ // 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
+ possibleOutput = mfh.pullFluid(tempStack);
+ super.addOutput(tempStack);
+ }
+ }
+
+ return true;
+ }
+
+ 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) {
+ try {
+ // 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;
+
+ // Front slice
+ for(int X = -2; X <= 2; X++) {
+ for(int Y = -2; Y <= 2; 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());
+
+ // 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 {
+ 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 three slices
+ 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 += 500000.0f;
+ } else if(thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName()
+ .equals(STORAGE_FIELD2.getUnlocalizedName())) {
+ runningCostAcc += 1.0f;
+ fluidCapacityAcc += 4000000.0f;
+ } else if(thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName()
+ .equals(STORAGE_FIELD3.getUnlocalizedName())) {
+ runningCostAcc += 2.0f;
+ fluidCapacityAcc += 16000000.0f;
+ } else if(thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName()
+ .equals(STORAGE_FIELD4.getUnlocalizedName())) {
+ runningCostAcc += 4.0f;
+ fluidCapacityAcc += 64000000.0f;
+ } else {
+ formationChecklist = false;
+ }
+ continue;
+ }
+
+ // Get next TE
+ IGregTechTileEntity currentTE =
+ thisController.getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z());// x, y ,z
+
+ // Corner allows only glass or casings
+ 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(glassNameAE2)
+ || thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName().equals(glassNameStained)
+ || thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CASING)) {
+ formationChecklist = false; // do nothing yet
+ }
+ } 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.
+ 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(glassNameAE2)
+ || thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName().equals(glassNameStained)) {
+ // do nothing lol
+ } else {
+ formationChecklist = false;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // Front slice
+ 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);
+ 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 {
+ 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) {
+ 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(minCasingAmount > 0) {
+ formationChecklist = false;
+ }
+
+ if(formationChecklist) {
+ runningCost = (int) Math.round(-runningCostAcc);
+ // Update MultiFluidHandler in case storage cells have been changed
+ // TODO update multihatch refs
+ 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());
+ }
+ }
+ }
+
+ return formationChecklist;
+ } catch (Exception ex) {
+ System.err.println("CAUGHT CHECKMACHINE EXCEPTION");
+ }
+ return false;
+ }
+
+ @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("Auto-voiding: " + doVoidExcess);
+ ll.add("Per-Fluid Capacity: " + mfh.getCapacity() + "L");
+ ll.add("Running Cost: " + (-super.mEUt) + "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("capacityPerFluid", mfh.getCapacity());
+ nbt.setInteger("runningCost", runningCost);
+ nbt.setBoolean("doVoidExcess", doVoidExcess);
+ mfh.getAsNBTTag(nbt);
+
+ super.saveNBTData(nbt);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound nbt) {
+ nbt = (nbt == null) ? new NBTTagCompound() : nbt;
+
+ runningCost = nbt.getInteger("runningCost");
+ doVoidExcess = nbt.getBoolean("doVoidExcess");
+
+ final ArrayList<FluidStack> fluidList = new ArrayList<>();
+ for(int i = 0; i < 25; i++) {
+ final NBTTagCompound fnbt = (NBTTagCompound) nbt.getTag("" + i);
+ if(fnbt == null) {
+ break;
+ }
+ fluidList.add(FluidStack.loadFluidStackFromNBT(fnbt));
+ }
+
+ mfh = new MultiFluidHandler(nbt.getInteger("capacityPerFluid"), fluidList);
+
+ 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/tileentities/GTMTE_ModularNuclearReactor.java b/src/main/java/tileentities/GTMTE_ModularNuclearReactor.java index 8ed2b7d67a..f0d529ee54 100644 --- a/src/main/java/tileentities/GTMTE_ModularNuclearReactor.java +++ b/src/main/java/tileentities/GTMTE_ModularNuclearReactor.java @@ -1,190 +1,190 @@ -package tileentities; - -import container.GUIContainer_ModularNuclearReactor; -import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; -import net.minecraft.block.Block; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; - -public class GTMTE_ModularNuclearReactor extends GT_MetaTileEntity_MultiBlockBase { - - final Block CASING = GregTech_API.sBlockCasings3; - final int CASING_META = 12; - final int CASING_TEXTURE_ID = 44; - - private boolean euMode = true; - - public GTMTE_ModularNuclearReactor(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - - } - - public GTMTE_ModularNuclearReactor(String aName) { - super(aName); - - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity var1) { - return new GTMTE_ModularNuclearReactor(super.mName); - } - - @Override - public String[] getDescription() { - return new String[] { - "DO NOT CHEAT IN THIS MACHINE", - "I'm not quite finished yet", - "------------------------------------------", - "Dimensions: 5x5x5 (WxHxL)", - "Structure:", - " Controller: Front center", - " 80x Radiation Proof Machine Casing (at least)", - " Dynamo Hatch: ONLY in EU-mode, at least one", - " Input Bus, Output Bus: Optional but required for automation", - " Input Hatch, Output Hatch: ONLY in Coolant-Mode, at least one each" - }; - } - - @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 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]}; - } - - // TODO: Opening UI crashes server. Controller isn't craftable right now. - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GUIContainer_ModularNuclearReactor(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), - "MultiblockDisplay.png"); - } - - @Override - public boolean isCorrectMachinePart(ItemStack stack) { - return true; - } - - @Override - public boolean checkRecipe(ItemStack stack) { - return false; - } - - @Override - public boolean checkMachine(IGregTechTileEntity thisController, ItemStack guiSlotItem) { - - final byte SIDE_LENGTH = 5; - final byte MAX_OFFSET = (byte) Math.floor(SIDE_LENGTH / 2); - final int XDIR_BACKFACE = ForgeDirection.getOrientation(thisController.getBackFacing()).offsetX * MAX_OFFSET; - final int ZDIR_BACKFACE = ForgeDirection.getOrientation(thisController.getBackFacing()).offsetZ * MAX_OFFSET; - - int minCasingAmount = 92; - boolean checklist = true; // if this is still true at the end, machine is good to go :) - - for (int leftToRight = -MAX_OFFSET; leftToRight <= MAX_OFFSET; leftToRight++) { - - for (int frontToBack = -MAX_OFFSET; frontToBack <= MAX_OFFSET; frontToBack++) { - - for (int thisY = -MAX_OFFSET; thisY <= MAX_OFFSET; thisY++) { - - // Center 3x3x3 air cube - if((leftToRight > -2 && leftToRight < 2) && (frontToBack > -2 && frontToBack < 2) && (thisY > -2 && thisY < 2)) { - if(!thisController.getAirOffset(XDIR_BACKFACE + leftToRight, thisY, ZDIR_BACKFACE + frontToBack)) { - checklist = false; - } - } else if (!(XDIR_BACKFACE + leftToRight == 0 && ZDIR_BACKFACE + frontToBack == 0 && thisY == 0)) { // Make sure this isn't the controller - // Get next TE - final int THIS_X = XDIR_BACKFACE + leftToRight; - final int THIS_Z = ZDIR_BACKFACE + frontToBack; - IGregTechTileEntity currentTE = - thisController.getIGregTechTileEntityOffset(THIS_X, thisY, THIS_Z);// x, y ,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 (TAE for GT++) - if ( !super.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID) - && !super.addInputToMachineList(currentTE, CASING_TEXTURE_ID) - && !super.addOutputToMachineList(currentTE, CASING_TEXTURE_ID) - && !super.addDynamoToMachineList(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(THIS_X, thisY, THIS_Z) == CASING) && (thisController.getMetaIDOffset(THIS_X, thisY, THIS_Z) == CASING_META)) { - // Seems to be valid casing. Decrement counter. - minCasingAmount--; - } else { - checklist = false; - } - } - } - } - } - } - - if(minCasingAmount > 0) { - checklist = false; - } - - if(euMode) { - if(this.mDynamoHatches.size() == 0) { - System.out.println("Dynamo hatches are required in EU mode!"); - checklist = false; - } - if(this.mInputHatches.size() > 0) { - System.out.println("Input hatches are only allowed in coolant mode!"); - checklist = false; - } - if(this.mOutputHatches.size() > 0) { - System.out.println("Output hatches are only allowed in coolant mode!"); - checklist = false; - } - } else { - if(this.mDynamoHatches.size() > 0) { - System.out.println("Dynamo hatches are only allowed in EU mode!"); - checklist = false; - } - if(this.mInputHatches.size() == 0) { - System.out.println("Coolant input hatches are required in coolant mode!"); - checklist = false; - } - if(this.mOutputHatches.size() == 0) { - System.out.println("Hot coolant output hatches are required in coolant mode!"); - checklist = false; - } - } - - if(this.mMaintenanceHatches.size() < 1) { - System.out.println("You need a maintenance hatch to do maintenance."); - } - - return checklist; - } - - @Override - public int getMaxEfficiency(ItemStack stack) { - return 10000; - } - - @Override - public int getPollutionPerTick(ItemStack stack) { - return 0; - } - - @Override - public int getDamageToComponent(ItemStack stack) { - return 0; - } - - @Override - public boolean explodesOnComponentBreak(ItemStack stack) { - return false; - } - -} +package tileentities;
+
+import container.GUIContainer_ModularNuclearReactor;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+import gregtech.api.objects.GT_RenderedTexture;
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+
+public class GTMTE_ModularNuclearReactor extends GT_MetaTileEntity_MultiBlockBase {
+
+ final Block CASING = GregTech_API.sBlockCasings3;
+ final int CASING_META = 12;
+ final int CASING_TEXTURE_ID = 44;
+
+ private boolean euMode = true;
+
+ public GTMTE_ModularNuclearReactor(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+
+ }
+
+ public GTMTE_ModularNuclearReactor(String aName) {
+ super(aName);
+
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity var1) {
+ return new GTMTE_ModularNuclearReactor(super.mName);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ "DO NOT CHEAT IN THIS MACHINE",
+ "I'm not quite finished yet",
+ "------------------------------------------",
+ "Dimensions: 5x5x5 (WxHxL)",
+ "Structure:",
+ " Controller: Front center",
+ " 80x Radiation Proof Machine Casing (at least)",
+ " Dynamo Hatch: ONLY in EU-mode, at least one",
+ " Input Bus, Output Bus: Optional but required for automation",
+ " Input Hatch, Output Hatch: ONLY in Coolant-Mode, at least one each"
+ };
+ }
+
+ @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 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]};
+ }
+
+ // TODO: Opening UI crashes server. Controller isn't craftable right now.
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUIContainer_ModularNuclearReactor(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(),
+ "MultiblockDisplay.png");
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack stack) {
+ return true;
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack stack) {
+ return false;
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity thisController, ItemStack guiSlotItem) {
+
+ final byte SIDE_LENGTH = 5;
+ final byte MAX_OFFSET = (byte) Math.floor(SIDE_LENGTH / 2);
+ final int XDIR_BACKFACE = ForgeDirection.getOrientation(thisController.getBackFacing()).offsetX * MAX_OFFSET;
+ final int ZDIR_BACKFACE = ForgeDirection.getOrientation(thisController.getBackFacing()).offsetZ * MAX_OFFSET;
+
+ int minCasingAmount = 92;
+ boolean checklist = true; // if this is still true at the end, machine is good to go :)
+
+ for (int leftToRight = -MAX_OFFSET; leftToRight <= MAX_OFFSET; leftToRight++) {
+
+ for (int frontToBack = -MAX_OFFSET; frontToBack <= MAX_OFFSET; frontToBack++) {
+
+ for (int thisY = -MAX_OFFSET; thisY <= MAX_OFFSET; thisY++) {
+
+ // Center 3x3x3 air cube
+ if((leftToRight > -2 && leftToRight < 2) && (frontToBack > -2 && frontToBack < 2) && (thisY > -2 && thisY < 2)) {
+ if(!thisController.getAirOffset(XDIR_BACKFACE + leftToRight, thisY, ZDIR_BACKFACE + frontToBack)) {
+ checklist = false;
+ }
+ } else if (!(XDIR_BACKFACE + leftToRight == 0 && ZDIR_BACKFACE + frontToBack == 0 && thisY == 0)) { // Make sure this isn't the controller
+ // Get next TE
+ final int THIS_X = XDIR_BACKFACE + leftToRight;
+ final int THIS_Z = ZDIR_BACKFACE + frontToBack;
+ IGregTechTileEntity currentTE =
+ thisController.getIGregTechTileEntityOffset(THIS_X, thisY, THIS_Z);// x, y ,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 (TAE for GT++)
+ if ( !super.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID)
+ && !super.addInputToMachineList(currentTE, CASING_TEXTURE_ID)
+ && !super.addOutputToMachineList(currentTE, CASING_TEXTURE_ID)
+ && !super.addDynamoToMachineList(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(THIS_X, thisY, THIS_Z) == CASING) && (thisController.getMetaIDOffset(THIS_X, thisY, THIS_Z) == CASING_META)) {
+ // Seems to be valid casing. Decrement counter.
+ minCasingAmount--;
+ } else {
+ checklist = false;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if(minCasingAmount > 0) {
+ checklist = false;
+ }
+
+ if(euMode) {
+ if(this.mDynamoHatches.size() == 0) {
+ System.out.println("Dynamo hatches are required in EU mode!");
+ checklist = false;
+ }
+ if(this.mInputHatches.size() > 0) {
+ System.out.println("Input hatches are only allowed in coolant mode!");
+ checklist = false;
+ }
+ if(this.mOutputHatches.size() > 0) {
+ System.out.println("Output hatches are only allowed in coolant mode!");
+ checklist = false;
+ }
+ } else {
+ if(this.mDynamoHatches.size() > 0) {
+ System.out.println("Dynamo hatches are only allowed in EU mode!");
+ checklist = false;
+ }
+ if(this.mInputHatches.size() == 0) {
+ System.out.println("Coolant input hatches are required in coolant mode!");
+ checklist = false;
+ }
+ if(this.mOutputHatches.size() == 0) {
+ System.out.println("Hot coolant output hatches are required in coolant mode!");
+ checklist = false;
+ }
+ }
+
+ if(this.mMaintenanceHatches.size() < 1) {
+ System.out.println("You need a maintenance hatch to do maintenance.");
+ }
+
+ return checklist;
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack stack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack stack) {
+ return 0;
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack stack) {
+ return 0;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack stack) {
+ return false;
+ }
+
+}
diff --git a/src/main/java/tileentities/GTMTE_SOFuelCellMK1.java b/src/main/java/tileentities/GTMTE_SOFuelCellMK1.java index 45a86c992a..461046a2c3 100644 --- a/src/main/java/tileentities/GTMTE_SOFuelCellMK1.java +++ b/src/main/java/tileentities/GTMTE_SOFuelCellMK1.java @@ -1,328 +1,328 @@ -package tileentities; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; - -import blocks.Block_YSZUnit; -import gregtech.api.GregTech_API; -import gregtech.api.enums.Materials; -import gregtech.api.enums.Textures; -import gregtech.api.gui.GT_GUIContainer_MultiMachine; -import gregtech.api.interfaces.ITexture; -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_ModHandler; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -import net.minecraft.block.Block; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; -import util.Vector3i; -import util.Vector3ic; - -public class GTMTE_SOFuelCellMK1 extends GT_MetaTileEntity_MultiBlockBase { - - private final Block CASING = GregTech_API.sBlockCasings4; - private final int CASING_META = 1; - private final int CASING_TEXTURE_ID = 49; - - private final int OXYGEN_PER_TICK = 20; - private final int EU_PER_TICK = 1024; - private final int STEAM_PER_TICK = 900; - - public GTMTE_SOFuelCellMK1(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - - } - - public GTMTE_SOFuelCellMK1(String aName) { - super(aName); - - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity var1) { - return new GTMTE_SOFuelCellMK1(super.mName); - } - - @Override - public String[] getDescription() { - return new String[] { - "Oxidizes gas fuels to generate electricity without polluting the environment", - "Consumes 29,480EU worth of fuel with up to 97% efficiency each second", - "Steam production requires the SOFC to heat up completely first", - "Outputs " + EU_PER_TICK + "EU/t and " + STEAM_PER_TICK + "L/t Steam", - "Additionally requires " + OXYGEN_PER_TICK + "L/t Oxygen gas", - "------------------------------------------", - "Dimensions: 3x3x5 (WxHxL)", - "Structure:", - " Controller: Front center", - " Dynamo Hatch: Back center", - " 3x YSZ Ceramic Electrolyte Unit: Center 1x1x3", - " 12x Clean Stainless Steel Machine Casing (at least)", - " 6x Reinforced Glass: Touching the Electrolyte Units on the horizontal sides", - " Maintenance Hatch, I/O Hatches: Instead of any casing" - }; - } - - @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 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]}; - } - - 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 stack) { - return true; - } - - @Override - public boolean checkRecipe(ItemStack stack) { - final ArrayList<FluidStack> storedFluids = super.getStoredFluids(); - Collection<GT_Recipe> recipeList = GT_Recipe_Map.sTurbineFuels.mRecipeList; - - if((storedFluids.size() > 0 && recipeList != null)) { - - final Iterator<FluidStack> fluidsIterator = storedFluids.iterator(); - while(fluidsIterator.hasNext()) { - - final FluidStack hatchFluid = fluidsIterator.next(); - final Iterator<GT_Recipe> recipeIterator = recipeList.iterator(); - while(recipeIterator.hasNext()) { - - final GT_Recipe aFuel = recipeIterator.next(); - FluidStack liquid; - if((liquid = GT_Utility.getFluidForFilledItem(aFuel.getRepresentativeInput(0), true)) != null - && hatchFluid.isFluidEqual(liquid)) { - - liquid.amount = EU_PER_TICK / aFuel.mSpecialValue; - - if(super.depleteInput(liquid)) { - - if(!super.depleteInput(Materials.Oxygen.getGas(OXYGEN_PER_TICK))) { - super.mEUt = 0; - super.mEfficiency = 0; - return false; - } - - super.mEUt = EU_PER_TICK; - super.mProgresstime = 1; - super.mMaxProgresstime = 1; - super.mEfficiencyIncrease = 5; - if(super.mEfficiency == getMaxEfficiency(null)) { - super.addOutput(GT_ModHandler.getSteam(STEAM_PER_TICK)); - } - return true; - } - } - } - } - } - - super.mEUt = 0; - super.mEfficiency = 0; - return false; - } - - 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 = 12; - boolean formationChecklist = true; // if this is still true at the end, machine is good to go :) - - // Front slice - for(int X = -1; X <= 1; X++) { - for(int Y = -1; Y <= 1; 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()); - - // 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.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID) - && !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. - if ((thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CASING) - && (thisController.getMetaIDOffset(offset.x(), offset.y(), offset.z()) == CASING_META)) { - // Seems to be valid casing. Decrement counter. - minCasingAmount--; - } else { - formationChecklist = false; - } - } - } - } - - // Middle three slices - for(int X = -1; X <= 1; X++) { - for(int Y = -1; Y <= 1; Y++) { - for(int Z = -1; Z >= -3; Z--) { - final Vector3ic offset = rotateOffsetVector(forgeDirection, X, Y, Z); - if(X == 0 && Y == 0) { - if(!thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName() - .equals(Block_YSZUnit.getInstance().getUnlocalizedName())) { - formationChecklist = false; - } - continue; - } - if(Y == 0 && (X == -1 || X == 1)) { - if(!thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName() - .equals("blockAlloyGlass")) { - formationChecklist = false; - } - continue; - } - // Get next TE - IGregTechTileEntity currentTE = - thisController.getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z());// x, y ,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 (TAE for GT++) - if ( !super.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID) - && !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. - if ((thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CASING) - && (thisController.getMetaIDOffset(offset.x(), offset.y(), offset.z()) == CASING_META)) { - // Seems to be valid casing. Decrement counter. - minCasingAmount--; - } else { - formationChecklist = false; - } - } - } - } - } - - // Back slice - for(int X = -1; X <= 1; X++) { - for(int Y = -1; Y <= 1; Y++) { - // Get next TE - final Vector3ic offset = rotateOffsetVector(forgeDirection, X, Y, -4); - IGregTechTileEntity currentTE = - thisController.getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z());// x, y ,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 (TAE for GT++) - if ( !super.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID) - && !super.addInputToMachineList(currentTE, CASING_TEXTURE_ID) - && !super.addOutputToMachineList(currentTE, CASING_TEXTURE_ID) - && !super.addDynamoToMachineList(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) - && (thisController.getMetaIDOffset(offset.x(), offset.y(), offset.z()) == CASING_META)) { - // Seems to be valid casing. Decrement counter. - minCasingAmount--; - } else { - formationChecklist = false; - } - } - } - } - - if(minCasingAmount > 0) { - formationChecklist = false; - } - - if(this.mDynamoHatches.size() != 1) { - System.out.println("Exactly one dynamo hatch is required!"); - formationChecklist = false; - } - if(this.mInputHatches.size() < 2) { - System.out.println("At least two input hatches are required!"); - formationChecklist = false; - } - - if(this.mMaintenanceHatches.size() < 1) { - System.out.println("You need a maintenance hatch to do maintenance."); - } - - return formationChecklist; - } - - @Override - public int getMaxEfficiency(ItemStack stack) { - return 10000; - } - - @Override - public int getPollutionPerTick(ItemStack stack) { - return 0; - } - - @Override - public int getDamageToComponent(ItemStack stack) { - return 0; - } - - @Override - public boolean explodesOnComponentBreak(ItemStack stack) { - return false; - } - -} +package tileentities;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
+import blocks.Block_YSZUnit;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.Textures;
+import gregtech.api.gui.GT_GUIContainer_MultiMachine;
+import gregtech.api.interfaces.ITexture;
+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_ModHandler;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+import util.Vector3i;
+import util.Vector3ic;
+
+public class GTMTE_SOFuelCellMK1 extends GT_MetaTileEntity_MultiBlockBase {
+
+ private final Block CASING = GregTech_API.sBlockCasings4;
+ private final int CASING_META = 1;
+ private final int CASING_TEXTURE_ID = 49;
+
+ private final int OXYGEN_PER_TICK = 20;
+ private final int EU_PER_TICK = 1024;
+ private final int STEAM_PER_TICK = 900;
+
+ public GTMTE_SOFuelCellMK1(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+
+ }
+
+ public GTMTE_SOFuelCellMK1(String aName) {
+ super(aName);
+
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity var1) {
+ return new GTMTE_SOFuelCellMK1(super.mName);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ "Oxidizes gas fuels to generate electricity without polluting the environment",
+ "Consumes 29,480EU worth of fuel with up to 97% efficiency each second",
+ "Steam production requires the SOFC to heat up completely first",
+ "Outputs " + EU_PER_TICK + "EU/t and " + STEAM_PER_TICK + "L/t Steam",
+ "Additionally requires " + OXYGEN_PER_TICK + "L/t Oxygen gas",
+ "------------------------------------------",
+ "Dimensions: 3x3x5 (WxHxL)",
+ "Structure:",
+ " Controller: Front center",
+ " Dynamo Hatch: Back center",
+ " 3x YSZ Ceramic Electrolyte Unit: Center 1x1x3",
+ " 12x Clean Stainless Steel Machine Casing (at least)",
+ " 6x Reinforced Glass: Touching the Electrolyte Units on the horizontal sides",
+ " Maintenance Hatch, I/O Hatches: Instead of any casing"
+ };
+ }
+
+ @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 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]};
+ }
+
+ 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 stack) {
+ return true;
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack stack) {
+ final ArrayList<FluidStack> storedFluids = super.getStoredFluids();
+ Collection<GT_Recipe> recipeList = GT_Recipe_Map.sTurbineFuels.mRecipeList;
+
+ if((storedFluids.size() > 0 && recipeList != null)) {
+
+ final Iterator<FluidStack> fluidsIterator = storedFluids.iterator();
+ while(fluidsIterator.hasNext()) {
+
+ final FluidStack hatchFluid = fluidsIterator.next();
+ final Iterator<GT_Recipe> recipeIterator = recipeList.iterator();
+ while(recipeIterator.hasNext()) {
+
+ final GT_Recipe aFuel = recipeIterator.next();
+ FluidStack liquid;
+ if((liquid = GT_Utility.getFluidForFilledItem(aFuel.getRepresentativeInput(0), true)) != null
+ && hatchFluid.isFluidEqual(liquid)) {
+
+ liquid.amount = EU_PER_TICK / aFuel.mSpecialValue;
+
+ if(super.depleteInput(liquid)) {
+
+ if(!super.depleteInput(Materials.Oxygen.getGas(OXYGEN_PER_TICK))) {
+ super.mEUt = 0;
+ super.mEfficiency = 0;
+ return false;
+ }
+
+ super.mEUt = EU_PER_TICK;
+ super.mProgresstime = 1;
+ super.mMaxProgresstime = 1;
+ super.mEfficiencyIncrease = 5;
+ if(super.mEfficiency == getMaxEfficiency(null)) {
+ super.addOutput(GT_ModHandler.getSteam(STEAM_PER_TICK));
+ }
+ return true;
+ }
+ }
+ }
+ }
+ }
+
+ super.mEUt = 0;
+ super.mEfficiency = 0;
+ return false;
+ }
+
+ 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 = 12;
+ boolean formationChecklist = true; // if this is still true at the end, machine is good to go :)
+
+ // Front slice
+ for(int X = -1; X <= 1; X++) {
+ for(int Y = -1; Y <= 1; 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());
+
+ // 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.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID)
+ && !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.
+ if ((thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CASING)
+ && (thisController.getMetaIDOffset(offset.x(), offset.y(), offset.z()) == CASING_META)) {
+ // Seems to be valid casing. Decrement counter.
+ minCasingAmount--;
+ } else {
+ formationChecklist = false;
+ }
+ }
+ }
+ }
+
+ // Middle three slices
+ for(int X = -1; X <= 1; X++) {
+ for(int Y = -1; Y <= 1; Y++) {
+ for(int Z = -1; Z >= -3; Z--) {
+ final Vector3ic offset = rotateOffsetVector(forgeDirection, X, Y, Z);
+ if(X == 0 && Y == 0) {
+ if(!thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName()
+ .equals(Block_YSZUnit.getInstance().getUnlocalizedName())) {
+ formationChecklist = false;
+ }
+ continue;
+ }
+ if(Y == 0 && (X == -1 || X == 1)) {
+ if(!thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName()
+ .equals("blockAlloyGlass")) {
+ formationChecklist = false;
+ }
+ continue;
+ }
+ // Get next TE
+ IGregTechTileEntity currentTE =
+ thisController.getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z());// x, y ,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 (TAE for GT++)
+ if ( !super.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID)
+ && !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.
+ if ((thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CASING)
+ && (thisController.getMetaIDOffset(offset.x(), offset.y(), offset.z()) == CASING_META)) {
+ // Seems to be valid casing. Decrement counter.
+ minCasingAmount--;
+ } else {
+ formationChecklist = false;
+ }
+ }
+ }
+ }
+ }
+
+ // Back slice
+ for(int X = -1; X <= 1; X++) {
+ for(int Y = -1; Y <= 1; Y++) {
+ // Get next TE
+ final Vector3ic offset = rotateOffsetVector(forgeDirection, X, Y, -4);
+ IGregTechTileEntity currentTE =
+ thisController.getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z());// x, y ,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 (TAE for GT++)
+ if ( !super.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID)
+ && !super.addInputToMachineList(currentTE, CASING_TEXTURE_ID)
+ && !super.addOutputToMachineList(currentTE, CASING_TEXTURE_ID)
+ && !super.addDynamoToMachineList(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)
+ && (thisController.getMetaIDOffset(offset.x(), offset.y(), offset.z()) == CASING_META)) {
+ // Seems to be valid casing. Decrement counter.
+ minCasingAmount--;
+ } else {
+ formationChecklist = false;
+ }
+ }
+ }
+ }
+
+ if(minCasingAmount > 0) {
+ formationChecklist = false;
+ }
+
+ if(this.mDynamoHatches.size() != 1) {
+ System.out.println("Exactly one dynamo hatch is required!");
+ formationChecklist = false;
+ }
+ if(this.mInputHatches.size() < 2) {
+ System.out.println("At least two input hatches are required!");
+ formationChecklist = false;
+ }
+
+ if(this.mMaintenanceHatches.size() < 1) {
+ System.out.println("You need a maintenance hatch to do maintenance.");
+ }
+
+ return formationChecklist;
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack stack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack stack) {
+ return 0;
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack stack) {
+ return 0;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack stack) {
+ return false;
+ }
+
+}
diff --git a/src/main/java/tileentities/GTMTE_SOFuelCellMK2.java b/src/main/java/tileentities/GTMTE_SOFuelCellMK2.java index 9b8c9ca7b3..3708ef8cc4 100644 --- a/src/main/java/tileentities/GTMTE_SOFuelCellMK2.java +++ b/src/main/java/tileentities/GTMTE_SOFuelCellMK2.java @@ -1,328 +1,328 @@ -package tileentities; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; - -import blocks.Block_GDCUnit; -import gregtech.api.GregTech_API; -import gregtech.api.enums.Materials; -import gregtech.api.enums.Textures; -import gregtech.api.gui.GT_GUIContainer_MultiMachine; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -import net.minecraft.block.Block; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; -import util.Vector3i; -import util.Vector3ic; - -public class GTMTE_SOFuelCellMK2 extends GT_MetaTileEntity_MultiBlockBase { - - final Block CASING = GregTech_API.sBlockCasings4; - final int CASING_META = 0; - final int CASING_TEXTURE_ID = 48; - - private final int OXYGEN_PER_TICK = 100; - private final int EU_PER_TICK = 24576; // 100% Efficiency, 3A IV - private final int STEAM_PER_TICK = 4800; // SH Steam (10,800EU/t @ 150% Efficiency) - - public GTMTE_SOFuelCellMK2(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - - } - - public GTMTE_SOFuelCellMK2(String aName) { - super(aName); - - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity var1) { - return new GTMTE_SOFuelCellMK2(super.mName); - } - - @Override - public String[] getDescription() { - return new String[] { - "Oxidizes gas fuels to generate electricity without polluting the environment", - "Consumes 442,200EU worth of fuel with up to 160% efficiency each second", - "Steam production requires the SOFC to heat up completely first", - "Outputs " + EU_PER_TICK + "EU/t and " + STEAM_PER_TICK + "L/t Superheated Steam", - "Additionally requires " + OXYGEN_PER_TICK + "L/t Oxygen gas", - "------------------------------------------", - "Dimensions: 3x3x5 (WxHxL)", - "Structure:", - " Controller front center", - " Dynamo Hatch back center", - " 3x GDC Ceramic Electrolyte Unit (center 1x1x3)", - " 12x Robust Tungstensteel Machine Casing (at least)", - " 6x Reinforced Glass: Touching the Electrolyte Units on the horizontal sides", - " Maintenance Hatch, I/O Hatches: Instead of any casing" - }; - } - - @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 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]}; - } - - 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 stack) { - return true; - } - - @Override - public boolean checkRecipe(ItemStack stack) { - final ArrayList<FluidStack> storedFluids = super.getStoredFluids(); - Collection<GT_Recipe> recipeList = GT_Recipe_Map.sTurbineFuels.mRecipeList; - - if((storedFluids.size() > 0 && recipeList != null)) { - - final Iterator<FluidStack> fluidsIterator = storedFluids.iterator(); - while(fluidsIterator.hasNext()) { - - final FluidStack hatchFluid = fluidsIterator.next(); - final Iterator<GT_Recipe> recipeIterator = recipeList.iterator(); - while(recipeIterator.hasNext()) { - - final GT_Recipe aFuel = recipeIterator.next(); - FluidStack liquid; - if((liquid = GT_Utility.getFluidForFilledItem(aFuel.getRepresentativeInput(0), true)) != null - && hatchFluid.isFluidEqual(liquid)) { - - liquid.amount = EU_PER_TICK / aFuel.mSpecialValue; - - if(super.depleteInput(liquid)) { - - if(!super.depleteInput(Materials.Oxygen.getGas(OXYGEN_PER_TICK))) { - super.mEUt = 0; - super.mEfficiency = 0; - return false; - } - - super.mEUt = EU_PER_TICK; - super.mProgresstime = 1; - super.mMaxProgresstime = 1; - super.mEfficiencyIncrease = 20; - if(super.mEfficiency == getMaxEfficiency(null)) { - super.addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", STEAM_PER_TICK)); - } - return true; - } - } - } - } - } - - super.mEUt = 0; - super.mEfficiency = 0; - return false; - } - - 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 = 12; - boolean formationChecklist = true; // if this is still true at the end, machine is good to go :) - - // Front slice - for(int X = -1; X <= 1; X++) { - for(int Y = -1; Y <= 1; 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()); - - // 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.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID) - && !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. - if ((thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CASING) - && (thisController.getMetaIDOffset(offset.x(), offset.y(), offset.z()) == CASING_META)) { - // Seems to be valid casing. Decrement counter. - minCasingAmount--; - } else { - formationChecklist = false; - } - } - } - } - - // Middle three slices - for(int X = -1; X <= 1; X++) { - for(int Y = -1; Y <= 1; Y++) { - for(int Z = -1; Z >= -3; Z--) { - final Vector3ic offset = rotateOffsetVector(forgeDirection, X, Y, Z); - if(X == 0 && Y == 0) { - if(!thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName() - .equals(Block_GDCUnit.getInstance().getUnlocalizedName())) { - formationChecklist = false; - } - continue; - } - if(Y == 0 && (X == -1 || X == 1)) { - if(!thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName() - .equals("blockAlloyGlass")) { - formationChecklist = false; - } - continue; - } - // Get next TE - IGregTechTileEntity currentTE = - thisController.getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z());// x, y ,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 (TAE for GT++) - if ( !super.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID) - && !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. - if ((thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CASING) - && (thisController.getMetaIDOffset(offset.x(), offset.y(), offset.z()) == CASING_META)) { - // Seems to be valid casing. Decrement counter. - minCasingAmount--; - } else { - formationChecklist = false; - } - } - } - } - } - - // Back slice - for(int X = -1; X <= 1; X++) { - for(int Y = -1; Y <= 1; Y++) { - // Get next TE - final Vector3ic offset = rotateOffsetVector(forgeDirection, X, Y, -4); - IGregTechTileEntity currentTE = - thisController.getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z());// x, y ,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 (TAE for GT++) - if ( !super.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID) - && !super.addInputToMachineList(currentTE, CASING_TEXTURE_ID) - && !super.addOutputToMachineList(currentTE, CASING_TEXTURE_ID) - && !super.addDynamoToMachineList(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) - && (thisController.getMetaIDOffset(offset.x(), offset.y(), offset.z()) == CASING_META)) { - // Seems to be valid casing. Decrement counter. - minCasingAmount--; - } else { - formationChecklist = false; - } - } - } - } - - if(minCasingAmount > 0) { - formationChecklist = false; - } - - if(this.mDynamoHatches.size() != 1) { - System.out.println("Exactly one dynamo hatch is required!"); - formationChecklist = false; - } - if(this.mInputHatches.size() < 2) { - System.out.println("At least two input hatches are required!"); - formationChecklist = false; - } - - if(this.mMaintenanceHatches.size() < 1) { - System.out.println("You need a maintenance hatch to do maintenance."); - } - - return formationChecklist; - } - - @Override - public int getMaxEfficiency(ItemStack stack) { - return 10000; - } - - @Override - public int getPollutionPerTick(ItemStack stack) { - return 0; - } - - @Override - public int getDamageToComponent(ItemStack stack) { - return 0; - } - - @Override - public boolean explodesOnComponentBreak(ItemStack stack) { - return false; - } - -} +package tileentities;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
+import blocks.Block_GDCUnit;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.Textures;
+import gregtech.api.gui.GT_GUIContainer_MultiMachine;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fluids.FluidStack;
+import util.Vector3i;
+import util.Vector3ic;
+
+public class GTMTE_SOFuelCellMK2 extends GT_MetaTileEntity_MultiBlockBase {
+
+ final Block CASING = GregTech_API.sBlockCasings4;
+ final int CASING_META = 0;
+ final int CASING_TEXTURE_ID = 48;
+
+ private final int OXYGEN_PER_TICK = 100;
+ private final int EU_PER_TICK = 24576; // 100% Efficiency, 3A IV
+ private final int STEAM_PER_TICK = 4800; // SH Steam (10,800EU/t @ 150% Efficiency)
+
+ public GTMTE_SOFuelCellMK2(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+
+ }
+
+ public GTMTE_SOFuelCellMK2(String aName) {
+ super(aName);
+
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity var1) {
+ return new GTMTE_SOFuelCellMK2(super.mName);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ "Oxidizes gas fuels to generate electricity without polluting the environment",
+ "Consumes 442,200EU worth of fuel with up to 160% efficiency each second",
+ "Steam production requires the SOFC to heat up completely first",
+ "Outputs " + EU_PER_TICK + "EU/t and " + STEAM_PER_TICK + "L/t Superheated Steam",
+ "Additionally requires " + OXYGEN_PER_TICK + "L/t Oxygen gas",
+ "------------------------------------------",
+ "Dimensions: 3x3x5 (WxHxL)",
+ "Structure:",
+ " Controller front center",
+ " Dynamo Hatch back center",
+ " 3x GDC Ceramic Electrolyte Unit (center 1x1x3)",
+ " 12x Robust Tungstensteel Machine Casing (at least)",
+ " 6x Reinforced Glass: Touching the Electrolyte Units on the horizontal sides",
+ " Maintenance Hatch, I/O Hatches: Instead of any casing"
+ };
+ }
+
+ @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 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]};
+ }
+
+ 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 stack) {
+ return true;
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack stack) {
+ final ArrayList<FluidStack> storedFluids = super.getStoredFluids();
+ Collection<GT_Recipe> recipeList = GT_Recipe_Map.sTurbineFuels.mRecipeList;
+
+ if((storedFluids.size() > 0 && recipeList != null)) {
+
+ final Iterator<FluidStack> fluidsIterator = storedFluids.iterator();
+ while(fluidsIterator.hasNext()) {
+
+ final FluidStack hatchFluid = fluidsIterator.next();
+ final Iterator<GT_Recipe> recipeIterator = recipeList.iterator();
+ while(recipeIterator.hasNext()) {
+
+ final GT_Recipe aFuel = recipeIterator.next();
+ FluidStack liquid;
+ if((liquid = GT_Utility.getFluidForFilledItem(aFuel.getRepresentativeInput(0), true)) != null
+ && hatchFluid.isFluidEqual(liquid)) {
+
+ liquid.amount = EU_PER_TICK / aFuel.mSpecialValue;
+
+ if(super.depleteInput(liquid)) {
+
+ if(!super.depleteInput(Materials.Oxygen.getGas(OXYGEN_PER_TICK))) {
+ super.mEUt = 0;
+ super.mEfficiency = 0;
+ return false;
+ }
+
+ super.mEUt = EU_PER_TICK;
+ super.mProgresstime = 1;
+ super.mMaxProgresstime = 1;
+ super.mEfficiencyIncrease = 20;
+ if(super.mEfficiency == getMaxEfficiency(null)) {
+ super.addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", STEAM_PER_TICK));
+ }
+ return true;
+ }
+ }
+ }
+ }
+ }
+
+ super.mEUt = 0;
+ super.mEfficiency = 0;
+ return false;
+ }
+
+ 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 = 12;
+ boolean formationChecklist = true; // if this is still true at the end, machine is good to go :)
+
+ // Front slice
+ for(int X = -1; X <= 1; X++) {
+ for(int Y = -1; Y <= 1; 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());
+
+ // 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.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID)
+ && !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.
+ if ((thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CASING)
+ && (thisController.getMetaIDOffset(offset.x(), offset.y(), offset.z()) == CASING_META)) {
+ // Seems to be valid casing. Decrement counter.
+ minCasingAmount--;
+ } else {
+ formationChecklist = false;
+ }
+ }
+ }
+ }
+
+ // Middle three slices
+ for(int X = -1; X <= 1; X++) {
+ for(int Y = -1; Y <= 1; Y++) {
+ for(int Z = -1; Z >= -3; Z--) {
+ final Vector3ic offset = rotateOffsetVector(forgeDirection, X, Y, Z);
+ if(X == 0 && Y == 0) {
+ if(!thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName()
+ .equals(Block_GDCUnit.getInstance().getUnlocalizedName())) {
+ formationChecklist = false;
+ }
+ continue;
+ }
+ if(Y == 0 && (X == -1 || X == 1)) {
+ if(!thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName()
+ .equals("blockAlloyGlass")) {
+ formationChecklist = false;
+ }
+ continue;
+ }
+ // Get next TE
+ IGregTechTileEntity currentTE =
+ thisController.getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z());// x, y ,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 (TAE for GT++)
+ if ( !super.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID)
+ && !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.
+ if ((thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CASING)
+ && (thisController.getMetaIDOffset(offset.x(), offset.y(), offset.z()) == CASING_META)) {
+ // Seems to be valid casing. Decrement counter.
+ minCasingAmount--;
+ } else {
+ formationChecklist = false;
+ }
+ }
+ }
+ }
+ }
+
+ // Back slice
+ for(int X = -1; X <= 1; X++) {
+ for(int Y = -1; Y <= 1; Y++) {
+ // Get next TE
+ final Vector3ic offset = rotateOffsetVector(forgeDirection, X, Y, -4);
+ IGregTechTileEntity currentTE =
+ thisController.getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z());// x, y ,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 (TAE for GT++)
+ if ( !super.addMaintenanceToMachineList(currentTE, CASING_TEXTURE_ID)
+ && !super.addInputToMachineList(currentTE, CASING_TEXTURE_ID)
+ && !super.addOutputToMachineList(currentTE, CASING_TEXTURE_ID)
+ && !super.addDynamoToMachineList(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)
+ && (thisController.getMetaIDOffset(offset.x(), offset.y(), offset.z()) == CASING_META)) {
+ // Seems to be valid casing. Decrement counter.
+ minCasingAmount--;
+ } else {
+ formationChecklist = false;
+ }
+ }
+ }
+ }
+
+ if(minCasingAmount > 0) {
+ formationChecklist = false;
+ }
+
+ if(this.mDynamoHatches.size() != 1) {
+ System.out.println("Exactly one dynamo hatch is required!");
+ formationChecklist = false;
+ }
+ if(this.mInputHatches.size() < 2) {
+ System.out.println("At least two input hatches are required!");
+ formationChecklist = false;
+ }
+
+ if(this.mMaintenanceHatches.size() < 1) {
+ System.out.println("You need a maintenance hatch to do maintenance.");
+ }
+
+ return formationChecklist;
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack stack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack stack) {
+ return 0;
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack stack) {
+ return 0;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack stack) {
+ return false;
+ }
+
+}
diff --git a/src/main/java/tileentities/TFFTMultiHatch.java b/src/main/java/tileentities/TFFTMultiHatch.java new file mode 100644 index 0000000000..2ce6f6985f --- /dev/null +++ b/src/main/java/tileentities/TFFTMultiHatch.java @@ -0,0 +1,138 @@ +package tileentities; + +import gregtech.api.enums.Textures.BlockIcons; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.objects.GT_RenderedTexture; +import kekztech.MultiFluidHandler; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +public class TFFTMultiHatch extends GT_MetaTileEntity_Hatch { + + private MultiFluidHandler multiFluidHandler; + + public TFFTMultiHatch(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 3, + new String[]{"Exclusive fluid I/O for the T.F.F.T", "Capacity: " + 8000 * (aTier + 1) + "L"}, new ITexture[0]); + } + + public TFFTMultiHatch(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 3, aDescription, aTextures); + } + + public TFFTMultiHatch(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 3, aDescription, aTextures); + } + + public ITexture[] getTexturesActive(ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, new GT_RenderedTexture(BlockIcons.OVERLAY_PIPE_IN)}; + } + + public ITexture[] getTexturesInactive(ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, new GT_RenderedTexture(BlockIcons.OVERLAY_PIPE_IN)}; + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new TFFTMultiHatch(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + } + + public boolean isSimpleMachine() { + return true; + } + + public boolean isFacingValid(byte aFacing) { + return true; + } + + public boolean isAccessAllowed(EntityPlayer aPlayer) { + return true; + } + + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) { + return true; + } else { + return true; + } + } + + public boolean doesFillContainers() { + return false; + } + + public boolean doesEmptyContainers() { + return false; + } + + public boolean canTankBeFilled() { + return true; + } + + public boolean canTankBeEmptied() { + return true; + } + + public boolean displaysItemStack() { + return false; + } + + public boolean displaysStackSize() { + return false; + } + + public boolean isFluidInputAllowed(FluidStack aFluid) { + return (multiFluidHandler != null) ? multiFluidHandler.couldPush(aFluid) : false; + } + + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + public int getCapacity() { + return (multiFluidHandler != null) ? multiFluidHandler.getCapacity() : 0; + } + + public int getTankPressure() { + return -100; + } + + public void setMultiFluidHandler(MultiFluidHandler multiFluidHandler) { + this.multiFluidHandler = multiFluidHandler; + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + +} diff --git a/src/main/java/util/Util.java b/src/main/java/util/Util.java index 76232d6e47..aa362d67d7 100644 --- a/src/main/java/util/Util.java +++ b/src/main/java/util/Util.java @@ -1,51 +1,51 @@ -package util; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import items.ErrorItem; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.OreDictionary; - -public class Util { - - public static ItemStack getStackofAmountFromOreDict(String oredictName, final int amount){ - final ArrayList<ItemStack> list = OreDictionary.getOres(oredictName); - if(!list.isEmpty()) { - final ItemStack ret = list.get(0).copy(); - ret.stackSize = amount; - return ret; - } - System.err.println("Failed to find " + oredictName + " in OreDict"); - return new ItemStack(ErrorItem.getInstance(), amount); - } - - public static ItemStack[] toItemStackArray(List<ItemStack> stacksList) { - if(stacksList.size() == 0) { - return null; - } - - ItemStack[] ret = new ItemStack[stacksList.size()]; - Iterator<ItemStack> iterator = stacksList.iterator(); - for(int i = 0; i < ret.length; i++ ) { - ret[i] = iterator.next(); - } - return ret; - } - - public static FluidStack[] toFluidStackArray(List<FluidStack> stacksList) { - if(stacksList.size() == 0) { - return null; - } - - FluidStack[] ret = new FluidStack[stacksList.size()]; - Iterator<FluidStack> iterator = stacksList.iterator(); - for(int i = 0; i < ret.length; i++ ) { - ret[i] = iterator.next(); - } - return ret; - } - -} +package util;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import items.ErrorItem;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.oredict.OreDictionary;
+
+public class Util {
+
+ public static ItemStack getStackofAmountFromOreDict(String oredictName, final int amount){
+ final ArrayList<ItemStack> list = OreDictionary.getOres(oredictName);
+ if(!list.isEmpty()) {
+ final ItemStack ret = list.get(0).copy();
+ ret.stackSize = amount;
+ return ret;
+ }
+ System.err.println("Failed to find " + oredictName + " in OreDict");
+ return new ItemStack(ErrorItem.getInstance(), amount);
+ }
+
+ public static ItemStack[] toItemStackArray(List<ItemStack> stacksList) {
+ if(stacksList.size() == 0) {
+ return null;
+ }
+
+ ItemStack[] ret = new ItemStack[stacksList.size()];
+ Iterator<ItemStack> iterator = stacksList.iterator();
+ for(int i = 0; i < ret.length; i++ ) {
+ ret[i] = iterator.next();
+ }
+ return ret;
+ }
+
+ public static FluidStack[] toFluidStackArray(List<FluidStack> stacksList) {
+ if(stacksList.size() == 0) {
+ return null;
+ }
+
+ FluidStack[] ret = new FluidStack[stacksList.size()];
+ Iterator<FluidStack> iterator = stacksList.iterator();
+ for(int i = 0; i < ret.length; i++ ) {
+ ret[i] = iterator.next();
+ }
+ return ret;
+ }
+
+}
diff --git a/src/main/java/util/Vector3i.java b/src/main/java/util/Vector3i.java index ff2b017551..5281c2dacc 100644 --- a/src/main/java/util/Vector3i.java +++ b/src/main/java/util/Vector3i.java @@ -1,32 +1,32 @@ -package util; - -public class Vector3i implements Vector3ic { - - public int x, y, z; - - public Vector3i() { - x = 1; - y = 1; - z = 1; - } - - public Vector3i(int x, int y, int z) { - this.x = x; - this.y = y; - this.z = z; - } - - public int x() { - return x; - } - - public int y() { - return y; - } - - public int z() { - return z; - } - - -} +package util;
+
+public class Vector3i implements Vector3ic {
+
+ public int x, y, z;
+
+ public Vector3i() {
+ x = 1;
+ y = 1;
+ z = 1;
+ }
+
+ public Vector3i(int x, int y, int z) {
+ this.x = x;
+ this.y = y;
+ this.z = z;
+ }
+
+ public int x() {
+ return x;
+ }
+
+ public int y() {
+ return y;
+ }
+
+ public int z() {
+ return z;
+ }
+
+
+}
diff --git a/src/main/java/util/Vector3ic.java b/src/main/java/util/Vector3ic.java index 102418bc98..8c73c858a3 100644 --- a/src/main/java/util/Vector3ic.java +++ b/src/main/java/util/Vector3ic.java @@ -1,8 +1,8 @@ -package util; - -public interface Vector3ic { - - public int x(); - public int y(); - public int z(); -} +package util;
+
+public interface Vector3ic {
+
+ public int x();
+ public int y();
+ public int z();
+}
diff --git a/src/main/resources/assets/kekztech/lang/en_US.lang b/src/main/resources/assets/kekztech/lang/en_US.lang index b3b4343b9a..8decb4eefd 100644 --- a/src/main/resources/assets/kekztech/lang/en_US.lang +++ b/src/main/resources/assets/kekztech/lang/en_US.lang @@ -1,83 +1,83 @@ -item.kekztech_error_item.name=KekzTech Error Coin - -item.kekztech_reactor_item.0.name=Weak Heat Vent -item.kekztech_reactor_item.1.name=Basic Heat Vent -item.kekztech_reactor_item.2.name=Advanced Heat Vent -item.kekztech_reactor_item.3.name=High-Tech Heat Vent -item.kekztech_reactor_item.4.name=Weak Component Heat Vent -item.kekztech_reactor_item.5.name=Basic Component Heat Vent -item.kekztech_reactor_item.6.name=Advanced Component Heat Vent -item.kekztech_reactor_item.7.name=High-Tech Component Heat Vent -item.kekztech_reactor_item.8.name=Weak Overclocked Heat Vent -item.kekztech_reactor_item.9.name=Basic Overclocked Heat Vent -item.kekztech_reactor_item.10.name=Advanced Overclocked Heat Vent -item.kekztech_reactor_item.11.name=High-Tech Overclocked Heat Vent - -item.kekztech_reactor_item.12.name=Weak Heat Exchanger -item.kekztech_reactor_item.13.name=Basic Heat Exchanger -item.kekztech_reactor_item.14.name=Advanced Heat Exchanger -item.kekztech_reactor_item.15.name=High-Tech Heat Exchanger - -item.kekztech_reactor_item.16.name=Fuel Rod (Enriched Uranium) -item.kekztech_reactor_item.17.name=Dual Fuel Rod (Enriched Uranium) -item.kekztech_reactor_item.18.name=Quad Fuel Rod (Enriched Uranium) -item.kekztech_reactor_item.19.name=Fuel Rod (Thorium) -item.kekztech_reactor_item.20.name=Dual Fuel Rod (Thorium) -item.kekztech_reactor_item.21.name=Quad Fuel Rod (Thorium) -item.kekztech_reactor_item.22.name=Fuel Rod (Plutonium MOX) -item.kekztech_reactor_item.23.name=Dual Fuel Rod (Plutonium MOX) -item.kekztech_reactor_item.24.name=Quad Fuel Rod (Plutonium MOX) -item.kekztech_reactor_item.25.name=Fuel Rod (Enriched Naquadah) -item.kekztech_reactor_item.26.name=Dual Fuel Rod (Enriched Naquadah) -item.kekztech_reactor_item.27.name=Quad Fuel Rod (Enriched Naquadah) -item.kekztech_reactor_item.28.name=Fuel Rod (Thorium MOX) -item.kekztech_reactor_item.29.name=Dual Fuel Rod (Thorium MOX) -item.kekztech_reactor_item.30.name=Quad Fuel Rod (Thorium MOX) - -item.kekztech_reactor_item.31.name=Depleted Fuel Rod (Enriched Uranium) -item.kekztech_reactor_item.32.name=Depleted Dual Fuel Rod (Enriched Uranium) -item.kekztech_reactor_item.33.name=Depleted Quad Fuel Rod (Enriched Uranium) -item.kekztech_reactor_item.34.name=Depleted Fuel Rod (Thorium) -item.kekztech_reactor_item.35.name=Depleted Dual Fuel Rod (Thorium) -item.kekztech_reactor_item.36.name=Depleted Quad Fuel Rod (Thorium) -item.kekztech_reactor_item.37.name=Depleted Fuel Rod (Plutonium MOX) -item.kekztech_reactor_item.38.name=Depleted Dual Fuel Rod (Plutonium MOX) -item.kekztech_reactor_item.39.name=Depleted Quad Fuel Rod (Plutonium MOX) -item.kekztech_reactor_item.40.name=Depleted Fuel Rod (Enriched Naquadah) -item.kekztech_reactor_item.41.name=Depleted Dual Fuel Rod (Enriched Naquadah) -item.kekztech_reactor_item.42.name=Depleted Quad Fuel Rod (Enriched Naquadah) -item.kekztech_reactor_item.43.name=Depleted Fuel Rod (Thorium MOX) -item.kekztech_reactor_item.44.name=Depleted Fuel Rod (Thorium MOX) -item.kekztech_reactor_item.45.name=Depleted Fuel Rod (Thorium MOX) - -item.kekztech_reactor_item.46.name=Neutron Reflector -item.kekztech_reactor_item.47.name=Neutron Supermirror (Unbreakable) - -item.kekztech_reactor_item.48.name=Helium Coolant Cell -item.kekztech_reactor_item.49.name=NaK Coolant Cell - -item.kekztech_crafting_item.0.name=Copper Heat Pipe -item.kekztech_crafting_item.1.name=Silver Heat Pipe -item.kekztech_crafting_item.2.name=Boron Arsenide Heat Pipe -item.kekztech_crafting_item.3.name=Diamond Heat Pipe -item.kekztech_crafting_item.4.name=Boron Arsenide Dust -item.kekztech_crafting_item.5.name=Isotopically Pure Diamond Dust -item.kekztech_crafting_item.6.name=Amine Carbamate Dust -item.kekztech_crafting_item.7.name=Boron Arsenide Crystal -item.kekztech_crafting_item.8.name=Isotopically Pure Diamond Crystal -item.kekztech_crafting_item.9.name=YSZ Ceramic Dust -item.kekztech_crafting_item.10.name=GDC Ceramic Dust -item.kekztech_crafting_item.11.name=Yttria Dust -item.kekztech_crafting_item.12.name=Zirconia Dust -item.kekztech_crafting_item.13.name=Ceria Dust -item.kekztech_crafting_item.14.name=YSZ Ceramic Plate -item.kekztech_crafting_item.15.name=GDC Ceramic Plate - -tile.kekztech_gdcceramicelectrolyteunit_block.name=GDC Ceramic Electrolyte Unit -tile.kekztech_yszceramicelectrolyteunit_block.name=YSZ Ceramic Electrolyte Unit - -tile.kekztech_tfftcasingblock_block.name=T.F.F.T Casing -tile.kekztech_tfftstoragefieldblock1_block.name=T.F.F.T Storage Field Block (Tier I) -tile.kekztech_tfftstoragefieldblock2_block.name=T.F.F.T Storage Field Block (Tier II) -tile.kekztech_tfftstoragefieldblock3_block.name=T.F.F.T Storage Field Block (Tier III) -tile.kekztech_tfftstoragefieldblock4_block.name=T.F.F.T Storage Field Block (Tier IV) +item.kekztech_error_item.name=KekzTech Error Coin
+
+item.kekztech_reactor_item.0.name=Weak Heat Vent
+item.kekztech_reactor_item.1.name=Basic Heat Vent
+item.kekztech_reactor_item.2.name=Advanced Heat Vent
+item.kekztech_reactor_item.3.name=High-Tech Heat Vent
+item.kekztech_reactor_item.4.name=Weak Component Heat Vent
+item.kekztech_reactor_item.5.name=Basic Component Heat Vent
+item.kekztech_reactor_item.6.name=Advanced Component Heat Vent
+item.kekztech_reactor_item.7.name=High-Tech Component Heat Vent
+item.kekztech_reactor_item.8.name=Weak Overclocked Heat Vent
+item.kekztech_reactor_item.9.name=Basic Overclocked Heat Vent
+item.kekztech_reactor_item.10.name=Advanced Overclocked Heat Vent
+item.kekztech_reactor_item.11.name=High-Tech Overclocked Heat Vent
+
+item.kekztech_reactor_item.12.name=Weak Heat Exchanger
+item.kekztech_reactor_item.13.name=Basic Heat Exchanger
+item.kekztech_reactor_item.14.name=Advanced Heat Exchanger
+item.kekztech_reactor_item.15.name=High-Tech Heat Exchanger
+
+item.kekztech_reactor_item.16.name=Fuel Rod (Enriched Uranium)
+item.kekztech_reactor_item.17.name=Dual Fuel Rod (Enriched Uranium)
+item.kekztech_reactor_item.18.name=Quad Fuel Rod (Enriched Uranium)
+item.kekztech_reactor_item.19.name=Fuel Rod (Thorium)
+item.kekztech_reactor_item.20.name=Dual Fuel Rod (Thorium)
+item.kekztech_reactor_item.21.name=Quad Fuel Rod (Thorium)
+item.kekztech_reactor_item.22.name=Fuel Rod (Plutonium MOX)
+item.kekztech_reactor_item.23.name=Dual Fuel Rod (Plutonium MOX)
+item.kekztech_reactor_item.24.name=Quad Fuel Rod (Plutonium MOX)
+item.kekztech_reactor_item.25.name=Fuel Rod (Enriched Naquadah)
+item.kekztech_reactor_item.26.name=Dual Fuel Rod (Enriched Naquadah)
+item.kekztech_reactor_item.27.name=Quad Fuel Rod (Enriched Naquadah)
+item.kekztech_reactor_item.28.name=Fuel Rod (Thorium MOX)
+item.kekztech_reactor_item.29.name=Dual Fuel Rod (Thorium MOX)
+item.kekztech_reactor_item.30.name=Quad Fuel Rod (Thorium MOX)
+
+item.kekztech_reactor_item.31.name=Depleted Fuel Rod (Enriched Uranium)
+item.kekztech_reactor_item.32.name=Depleted Dual Fuel Rod (Enriched Uranium)
+item.kekztech_reactor_item.33.name=Depleted Quad Fuel Rod (Enriched Uranium)
+item.kekztech_reactor_item.34.name=Depleted Fuel Rod (Thorium)
+item.kekztech_reactor_item.35.name=Depleted Dual Fuel Rod (Thorium)
+item.kekztech_reactor_item.36.name=Depleted Quad Fuel Rod (Thorium)
+item.kekztech_reactor_item.37.name=Depleted Fuel Rod (Plutonium MOX)
+item.kekztech_reactor_item.38.name=Depleted Dual Fuel Rod (Plutonium MOX)
+item.kekztech_reactor_item.39.name=Depleted Quad Fuel Rod (Plutonium MOX)
+item.kekztech_reactor_item.40.name=Depleted Fuel Rod (Enriched Naquadah)
+item.kekztech_reactor_item.41.name=Depleted Dual Fuel Rod (Enriched Naquadah)
+item.kekztech_reactor_item.42.name=Depleted Quad Fuel Rod (Enriched Naquadah)
+item.kekztech_reactor_item.43.name=Depleted Fuel Rod (Thorium MOX)
+item.kekztech_reactor_item.44.name=Depleted Fuel Rod (Thorium MOX)
+item.kekztech_reactor_item.45.name=Depleted Fuel Rod (Thorium MOX)
+
+item.kekztech_reactor_item.46.name=Neutron Reflector
+item.kekztech_reactor_item.47.name=Neutron Supermirror (Unbreakable)
+
+item.kekztech_reactor_item.48.name=Helium Coolant Cell
+item.kekztech_reactor_item.49.name=NaK Coolant Cell
+
+item.kekztech_crafting_item.0.name=Copper Heat Pipe
+item.kekztech_crafting_item.1.name=Silver Heat Pipe
+item.kekztech_crafting_item.2.name=Boron Arsenide Heat Pipe
+item.kekztech_crafting_item.3.name=Diamond Heat Pipe
+item.kekztech_crafting_item.4.name=Boron Arsenide Dust
+item.kekztech_crafting_item.5.name=Isotopically Pure Diamond Dust
+item.kekztech_crafting_item.6.name=Amine Carbamate Dust
+item.kekztech_crafting_item.7.name=Boron Arsenide Crystal
+item.kekztech_crafting_item.8.name=Isotopically Pure Diamond Crystal
+item.kekztech_crafting_item.9.name=YSZ Ceramic Dust
+item.kekztech_crafting_item.10.name=GDC Ceramic Dust
+item.kekztech_crafting_item.11.name=Yttria Dust
+item.kekztech_crafting_item.12.name=Zirconia Dust
+item.kekztech_crafting_item.13.name=Ceria Dust
+item.kekztech_crafting_item.14.name=YSZ Ceramic Plate
+item.kekztech_crafting_item.15.name=GDC Ceramic Plate
+
+tile.kekztech_gdcceramicelectrolyteunit_block.name=GDC Ceramic Electrolyte Unit
+tile.kekztech_yszceramicelectrolyteunit_block.name=YSZ Ceramic Electrolyte Unit
+
+tile.kekztech_tfftcasingblock_block.name=T.F.F.T Casing
+tile.kekztech_tfftstoragefieldblock1_block.name=T.F.F.T Storage Field Block (Tier I)
+tile.kekztech_tfftstoragefieldblock2_block.name=T.F.F.T Storage Field Block (Tier II)
+tile.kekztech_tfftstoragefieldblock3_block.name=T.F.F.T Storage Field Block (Tier III)
+tile.kekztech_tfftstoragefieldblock4_block.name=T.F.F.T Storage Field Block (Tier IV)
diff --git a/src/main/resources/assets/kekztech/textures/blocks/TFFTStorageFieldBlock1.png b/src/main/resources/assets/kekztech/textures/blocks/TFFTStorageFieldBlock1.png Binary files differindex f1abeacd4b..70004c208f 100644 --- a/src/main/resources/assets/kekztech/textures/blocks/TFFTStorageFieldBlock1.png +++ b/src/main/resources/assets/kekztech/textures/blocks/TFFTStorageFieldBlock1.png diff --git a/src/main/resources/assets/kekztech/textures/blocks/TFFTStorageFieldBlock2.png b/src/main/resources/assets/kekztech/textures/blocks/TFFTStorageFieldBlock2.png Binary files differindex cb5b27bc1d..5cac6da447 100644 --- a/src/main/resources/assets/kekztech/textures/blocks/TFFTStorageFieldBlock2.png +++ b/src/main/resources/assets/kekztech/textures/blocks/TFFTStorageFieldBlock2.png diff --git a/src/main/resources/assets/kekztech/textures/blocks/TFFTStorageFieldBlock3.png b/src/main/resources/assets/kekztech/textures/blocks/TFFTStorageFieldBlock3.png Binary files differindex 30185da496..5f4fe29422 100644 --- a/src/main/resources/assets/kekztech/textures/blocks/TFFTStorageFieldBlock3.png +++ b/src/main/resources/assets/kekztech/textures/blocks/TFFTStorageFieldBlock3.png diff --git a/src/main/resources/assets/kekztech/textures/blocks/TFFTStorageFieldBlock4.png b/src/main/resources/assets/kekztech/textures/blocks/TFFTStorageFieldBlock4.png Binary files differindex 638223af9b..681f0bf80f 100644 --- a/src/main/resources/assets/kekztech/textures/blocks/TFFTStorageFieldBlock4.png +++ b/src/main/resources/assets/kekztech/textures/blocks/TFFTStorageFieldBlock4.png diff --git a/src/main/resources/assets/kekztech/textures/items/DemonCore.png b/src/main/resources/assets/kekztech/textures/items/DemonCore.png Binary files differnew file mode 100644 index 0000000000..026b8fdeed --- /dev/null +++ b/src/main/resources/assets/kekztech/textures/items/DemonCore.png diff --git a/src/main/resources/assets/kekztech/textures/items/PlutoniumGalliumDust.png b/src/main/resources/assets/kekztech/textures/items/PlutoniumGalliumDust.png Binary files differnew file mode 100644 index 0000000000..fc978ad329 --- /dev/null +++ b/src/main/resources/assets/kekztech/textures/items/PlutoniumGalliumDust.png diff --git a/src/main/resources/assets/kekztech/textures/items/RawDemonCore.png b/src/main/resources/assets/kekztech/textures/items/RawDemonCore.png Binary files differnew file mode 100644 index 0000000000..94105601d1 --- /dev/null +++ b/src/main/resources/assets/kekztech/textures/items/RawDemonCore.png diff --git a/src/main/resources/assets/kekztech/textures/items/uraniumFuelRod.png b/src/main/resources/assets/kekztech/textures/items/uraniumFuelRod.png Binary files differdeleted file mode 100644 index 96e1fb32bf..0000000000 --- a/src/main/resources/assets/kekztech/textures/items/uraniumFuelRod.png +++ /dev/null |