aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2016-10-17 01:39:50 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2016-10-17 01:39:50 +1000
commitd6bf108b40f0b281ff7c3c2bc91e43ed2b9883f7 (patch)
tree0f00f90ad75043f47aac4cf68431f038adc5071d
parentb1aa7032fe9e6bfedccf1bb08952c68100002489 (diff)
downloadGT5-Unofficial-d6bf108b40f0b281ff7c3c2bc91e43ed2b9883f7.tar.gz
GT5-Unofficial-d6bf108b40f0b281ff7c3c2bc91e43ed2b9883f7.tar.bz2
GT5-Unofficial-d6bf108b40f0b281ff7c3c2bc91e43ed2b9883f7.zip
+ Added Tesseract Generators and Terminals.
+ Added a handful of new, old textures from GT4. % Rewrote portions of the Blueprint item again, to try make it work better with NBT. + Added an Example NBT item for myself~ because I am a derp. + Added some custom textures for the Industrial Centrifuge. % Moved all the GT4 Tile Entities to their own loading class.
-rw-r--r--src/Java/gtPlusPlus/GTplusplus.java5
-rw-r--r--src/Java/gtPlusPlus/core/container/Container_Workbench.java23
-rw-r--r--src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java4
-rw-r--r--src/Java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java2
-rw-r--r--src/Java/gtPlusPlus/core/interfaces/IItemBlueprint.java4
-rw-r--r--src/Java/gtPlusPlus/core/item/base/BaseItemBrain.java108
-rw-r--r--src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java225
-rw-r--r--src/Java/gtPlusPlus/core/lib/CORE.java5
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_General.java49
-rw-r--r--src/Java/gtPlusPlus/core/util/item/UtilsItems.java11
-rw-r--r--src/Java/gtPlusPlus/core/util/recipe/UtilsRecipe.java11
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java5
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_AdvancedWorkbench.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_AdvancedWorkbench.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java11
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java441
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlocks.java75
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java602
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java504
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java13
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java37
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechWorkbenches.java29
-rw-r--r--src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_dimensional.pngbin0 -> 1660 bytes
-rw-r--r--src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_dimensional.png.mcmeta5
-rw-r--r--src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_frequency.pngbin0 -> 822 bytes
-rw-r--r--src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random1.pngbin0 -> 12342 bytes
-rw-r--r--src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random1.png.mcmeta5
-rw-r--r--src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random2.pngbin0 -> 12342 bytes
-rw-r--r--src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random2.png.mcmeta5
-rw-r--r--src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random3.pngbin0 -> 12342 bytes
-rw-r--r--src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random3.png.mcmeta5
-rw-r--r--src/resources/assets/miscutils/textures/blocks/TileEntities/high_adv_machine_dimensional.pngbin0 -> 1713 bytes
-rw-r--r--src/resources/assets/miscutils/textures/blocks/TileEntities/high_adv_machine_dimensional.png.mcmeta5
33 files changed, 2085 insertions, 112 deletions
diff --git a/src/Java/gtPlusPlus/GTplusplus.java b/src/Java/gtPlusPlus/GTplusplus.java
index 89988a1248..3fb57d064c 100644
--- a/src/Java/gtPlusPlus/GTplusplus.java
+++ b/src/Java/gtPlusPlus/GTplusplus.java
@@ -24,6 +24,7 @@ import gtPlusPlus.core.util.item.UtilsItems;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.xmod.gregtech.HANDLER_GT;
import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
+import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlocks;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools;
import java.awt.event.ActionEvent;
@@ -120,7 +121,11 @@ implements ActionListener
@SideOnly(value=Side.CLIENT)
public static void loadTextures(){
Utils.LOG_INFO("Loading some textures on the client.");
+ //Tools
Utils.LOG_WARNING("Processing texture: "+TexturesGtTools.SKOOKUM_CHOOCHER.getTextureFile().getResourcePath());
+
+ //Blocks
+ Utils.LOG_WARNING("Processing texture: "+TexturesGtBlocks.Casing_Machine_Dimensional.getTextureFile().getResourcePath());
}
diff --git a/src/Java/gtPlusPlus/core/container/Container_Workbench.java b/src/Java/gtPlusPlus/core/container/Container_Workbench.java
index 5ce6d0e1a2..b3b024f52c 100644
--- a/src/Java/gtPlusPlus/core/container/Container_Workbench.java
+++ b/src/Java/gtPlusPlus/core/container/Container_Workbench.java
@@ -188,8 +188,9 @@ public class Container_Workbench extends Container {
@Override
public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer){
+ if (!aPlayer.worldObj.isRemote){
if (aSlotIndex == 999 || aSlotIndex == -999){
- Utils.LOG_INFO("??? - "+aSlotIndex);
+ //Utils.LOG_INFO("??? - "+aSlotIndex);
}
if (aSlotIndex == slotOutput){
@@ -210,7 +211,7 @@ public class Container_Workbench extends Container {
Utils.LOG_INFO("Found a blueprint.");
ItemStack tempBlueprint = inventoryHolo.getStackInSlot(1);
ItemBlueprint tempItemBlueprint = (ItemBlueprint) tempBlueprint.getItem();
- if (inventoryHolo.getStackInSlot(0) != null){
+ if (inventoryHolo.getStackInSlot(0) != null && !tempItemBlueprint.hasBlueprint(tempBlueprint)){
Utils.LOG_INFO("Output slot was not empty.");
Utils.LOG_INFO("Trying to manipulate NBT data on the blueprint stack, then replace it with the new one.");
tempItemBlueprint.setBlueprint(inventoryHolo.getStackInSlot(1), craftMatrix, inventoryHolo.getStackInSlot(0));
@@ -219,7 +220,12 @@ public class Container_Workbench extends Container {
Utils.LOG_INFO(UtilsItems.getArrayStackNames(tempItemBlueprint.getBlueprint(newTempBlueprint)));
}
else {
- Utils.LOG_INFO("Output slot was empty.");
+ if (tempItemBlueprint.hasBlueprint(tempBlueprint)){
+ Utils.LOG_INFO("Blueprint already holds a recipe.");
+ }
+ else {
+ Utils.LOG_INFO("Output slot was empty.");
+ }
}
}
else {
@@ -257,6 +263,7 @@ public class Container_Workbench extends Container {
Utils.LOG_INFO("Player Clicked slot "+aSlotIndex+" in the tool Grid");
}
}
+ }
//Utils.LOG_INFO("Player Clicked slot "+aSlotIndex+" in the Grid");
return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
}
@@ -267,7 +274,15 @@ public class Container_Workbench extends Container {
//craftResult.setInventorySlotContents(0, Workbench_CraftingHandler.getInstance().findMatchingRecipe(craftMatrix, worldObj));
//Vanilla CraftingManager
- craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(craftMatrix, worldObj));
+ Utils.LOG_INFO("checking crafting grid for a valid output.");
+ ItemStack temp = CraftingManager.getInstance().findMatchingRecipe(craftMatrix, worldObj);
+ if (temp != null){
+ Utils.LOG_INFO("Output found. "+temp.getDisplayName()+" x"+temp.stackSize);
+ inventoryHolo.setInventorySlotContents(slotOutput, temp);
+ }
+ else {
+ Utils.LOG_INFO("No Valid output found.");
+ }
}
diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
index fd7fbf9645..e51dc157c6 100644
--- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
+++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
@@ -42,7 +42,7 @@ import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSolarGenerators;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSteamCondenser;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSuperConductionPoint;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechTieredFluidTanks;
-import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechWorkbenches;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.Gregtech4Content;
import java.util.LinkedList;
import java.util.Queue;
@@ -91,7 +91,7 @@ public class COMPAT_HANDLER {
GregtechDehydrator.run();
GregtechTieredFluidTanks.run();
GregtechIndustrialMultiTank.run();
- GregtechWorkbenches.run();
+ Gregtech4Content.run();
GregtechGeothermalThermalGenerator.run();
}
diff --git a/src/Java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java b/src/Java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java
index affb56566d..275a67f571 100644
--- a/src/Java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java
+++ b/src/Java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java
@@ -1,6 +1,7 @@
package gtPlusPlus.core.handler.Recipes;
import gtPlusPlus.core.handler.COMPAT_HANDLER;
+import gtPlusPlus.core.recipe.RECIPES_General;
import gtPlusPlus.core.recipe.RECIPES_MachineComponents;
import gtPlusPlus.core.recipe.RECIPES_Machines;
import gtPlusPlus.core.recipe.RECIPES_Shapeless;
@@ -23,6 +24,7 @@ public class RegistrationHandler {
RECIPES_Shapeless.RECIPES_LOAD();
RECIPES_MachineComponents.RECIPES_LOAD();
RECIPE_Batteries.RECIPES_LOAD();
+ RECIPES_General.RECIPES_LOAD();
//RECIPES_MTWRAPPER.run();
Utils.LOG_INFO("Loaded: "+recipesSuccess+" Failed: "+recipesFailed);
COMPAT_HANDLER.areInitItemsLoaded = true;
diff --git a/src/Java/gtPlusPlus/core/interfaces/IItemBlueprint.java b/src/Java/gtPlusPlus/core/interfaces/IItemBlueprint.java
index f3f4e40b66..90126b1e82 100644
--- a/src/Java/gtPlusPlus/core/interfaces/IItemBlueprint.java
+++ b/src/Java/gtPlusPlus/core/interfaces/IItemBlueprint.java
@@ -29,7 +29,7 @@ public interface IItemBlueprint {
* @param String Blueprint Name
* @return N/A
*/
- public void setBlueprintName(String name);
+ public void setBlueprintName(ItemStack stack, String name);
/**
* Does this itemstack hold a blueprint?
@@ -43,6 +43,6 @@ public interface IItemBlueprint {
* @param stack yourMetaItem
* @return the blueprints contents
*/
- public ItemStack[] getBlueprint(ItemStack stack);
+ public ItemStack[] getBlueprint(ItemStack stack);
}
diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemBrain.java b/src/Java/gtPlusPlus/core/item/base/BaseItemBrain.java
new file mode 100644
index 0000000000..86cd1c8046
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/BaseItemBrain.java
@@ -0,0 +1,108 @@
+package gtPlusPlus.core.item.base;
+
+import java.util.List;
+
+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.StatCollector;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+/*
+ *
+ *
+ Key Point: You can access the NBT compound data from the Item class (in those methods that pass an ItemStack), but the NBT compound can only be set on an ItemStack.
+
+ The steps to add NBT data to an ItemStack:
+ Create or otherwise get an ItemStack of the desired item
+ Create an NBTTagCompound and fill it with the appropriate data
+ Call ItemStack#setTagCompound() method to set it.
+
+ *
+ */
+
+public class BaseItemBrain extends Item{
+ // This is an array of all the types I am going to be adding.
+ String[] brainTypes = { "dead", "preserved", "fresh", "tasty" };
+
+ // This method allows us to have different language translation keys for
+ // each item we add.
+ @Override
+ public String getUnlocalizedName(ItemStack stack)
+ {
+ // This makes sure that the stack has a tag compound. This is how data
+ // is stored on items.
+ if (stack.hasTagCompound())
+ {
+ // This is the object holding all of the item data.
+ NBTTagCompound itemData = stack.getTagCompound();
+ // This checks to see if the item has data stored under the
+ // brainType key.
+ if (itemData.hasKey("brainType"))
+ {
+ // This retrieves data from the brainType key and uses it in
+ // the return value
+ return "item." + itemData.getString("brainType");
+ }
+ }
+ // This will be used if the item is obtained without nbt data on it.
+ return "item.nullBrain";
+ }
+
+
+ // This is a fun method which allows us to run some code when our item is
+ // shown in a creative tab. I am going to use it to add all the brain
+ // types.
+ @SuppressWarnings("unchecked")
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void getSubItems(Item item, CreativeTabs tab, List itemList)
+ {
+ // This creates a loop with a counter. It will go through once for
+ // every listing in brainTypes, and gives us a number associated
+ // with each listing.
+ for (int pos = 0; pos < brainTypes.length; pos++)
+ {
+ // This creates a new ItemStack instance. The item parameter
+ // supplied is this item.
+ ItemStack brainStack = new ItemStack(item);
+ // By default, a new ItemStack does not have any nbt compound data.
+ // We need to give it some.
+ brainStack.setTagCompound(new NBTTagCompound());
+ // Now we set the type of the item, brainType is the key, and
+ // brainTypes[pos] is grabbing a
+ // entry from the brainTypes array.
+ brainStack.getTagCompound().setString("brainType",
+ brainTypes[pos]);
+ // And this adds it to the itemList, which is a list of all items
+ // in the creative tab.
+ itemList.add(brainStack);
+ }
+ }
+
+ // This code will allow us to tell the items apart in game. You can change
+ @SuppressWarnings("unchecked")
+ // texture based on nbt data, but I won't be covering that.
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean isAdvanced){
+ if ( stack.hasTagCompound()
+ && stack.getTagCompound().hasKey("brainType"))
+ {
+ // StatCollector is a class which allows us to handle string
+ // language translation. This requires that you fill out the
+ // translation in you language class.
+ tooltip.add(StatCollector.translateToLocal("tooltip.yourmod."
+ + stack.getTagCompound().getString("brainType") + ".desc"));
+ }
+ else // If the brain does not have valid tag data, a default message
+ {
+ tooltip.add(StatCollector.translateToLocal(
+ "tooltip.yourmod.nullbrain.desc"));
+ }
+ }
+}
+
diff --git a/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java b/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java
index a15616711d..b721672aa4 100644
--- a/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java
+++ b/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java
@@ -4,6 +4,7 @@ import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.interfaces.IItemBlueprint;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.item.UtilsItems;
import gtPlusPlus.core.util.math.MathUtils;
import java.util.List;
@@ -21,49 +22,59 @@ import cpw.mods.fml.common.registry.GameRegistry;
public class ItemBlueprint extends Item implements IItemBlueprint{
- protected String mName = "";
- protected boolean mHasBlueprint = false;
- private final int bpID;
-
- /**
- * The inventory of items the blueprint holds~
- */
- protected ItemStack[] blueprint = new ItemStack[9];
-
public ItemBlueprint(String unlocalizedName) {
this.setUnlocalizedName(unlocalizedName);
this.setTextureName(CORE.MODID + ":" + unlocalizedName);
this.setMaxStackSize(1);
this.setCreativeTab(AddToCreativeTab.tabMachines);
- this.bpID = MathUtils.randInt(0, 1000);
+ //this.bpID = MathUtils.randInt(0, 1000);
GameRegistry.registerItem(this, unlocalizedName);
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
- public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
- if (bpID >= 0){
- list.add(EnumChatFormatting.GRAY+"Technical Document No. "+bpID);
+ public void addInformation(ItemStack itemStack, EntityPlayer aPlayer, List list, boolean bool) {
+ //Create some NBT if it's not there, otherwise this does nothing.
+ if (!itemStack.hasTagCompound()){
+ createNBT(itemStack);
}
- if(mHasBlueprint){
- list.add(EnumChatFormatting.BLUE+"Currently holding a blueprint for "+mName);
+ //Set up some default variables.
+ int id = -1;
+ String name = "";
+ boolean blueprint = false;
+ //Get proper display vars from NBT if it's there
+ if (itemStack.hasTagCompound()){
+ //Utils.LOG_INFO("Found TagCompound");
+ id = (int) getNBT(itemStack, "mID");
+ name = (String) getNBT(itemStack, "mName");
+ blueprint = (boolean) getNBT(itemStack, "mBlueprint");
}
+ //Write to tooltip list for each viable setting.
+ if (itemStack.hasTagCompound()) {
+ if (id != -1){
+ list.add(EnumChatFormatting.GRAY+"Technical Document No. "+id);
+ }
+ if(blueprint){
+ list.add(EnumChatFormatting.BLUE+"Currently holding a blueprint for "+name);
+ }
+ else {
+ list.add(EnumChatFormatting.RED+"Currently not holding a blueprint for anything.");
+ }
+ }
else {
list.add(EnumChatFormatting.RED+"Currently not holding a blueprint for anything.");
}
- super.addInformation(stack, aPlayer, list, bool);
+ super.addInformation(itemStack, aPlayer, list, bool);
}
-
+
@Override
public String getItemStackDisplayName(ItemStack p_77653_1_) {
- return "Blueprint";
+ return "Blueprint";
}
@Override
- public void onCreated(ItemStack itemStack, World world, EntityPlayer player) {
- itemStack.stackTagCompound = new NBTTagCompound();
- //this.inventory = null;
- //itemStack.stackTagCompound.set("pos_x", bed_X); TODO
+ public void onCreated(ItemStack itemStack, World world, EntityPlayer player) {
+ createNBT(itemStack);
}
@Override
@@ -74,38 +85,59 @@ public class ItemBlueprint extends Item implements IItemBlueprint{
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer par3Entity) {
//Let the player know what blueprint is held
- Utils.messagePlayer(par3Entity, "This is a placeholder.");
+ if (itemStack.hasTagCompound()) {
+ Utils.messagePlayer(par3Entity, "This Blueprint holds NBT data. "+"|"+getNBT(itemStack, "mID")+"|"+getNBT(itemStack, "mBlueprint")+"|"+getNBT(itemStack, "mName")+"|"+UtilsItems.getArrayStackNames(readItemsFromNBT(itemStack)));
+ }
+ else {
+ createNBT(itemStack);
+ Utils.messagePlayer(par3Entity, "This is a placeholder. "+getNBT(itemStack, "mID"));
+ }
+
+
return super.onItemRightClick(itemStack, world, par3Entity);
}
- public void readFromNBT(NBTTagCompound nbt){
- NBTTagList list = nbt.getTagList("Items", 10);
- blueprint = new ItemStack[INV_SIZE];
- for(int i = 0;i<list.tagCount();i++)
- {
- NBTTagCompound data = list.getCompoundTagAt(i);
- int slot = data.getInteger("Slot");
- if(slot >= 0 && slot < INV_SIZE)
+ public ItemStack[] readItemsFromNBT(ItemStack itemStack){
+ ItemStack[] blueprint = new ItemStack[9];
+ if (itemStack.hasTagCompound()){
+ NBTTagCompound nbt = itemStack.getTagCompound();
+ NBTTagList list = nbt.getTagList("Items", 10);
+ blueprint = new ItemStack[INV_SIZE];
+ for(int i = 0;i<list.tagCount();i++)
{
- blueprint[slot] = ItemStack.loadItemStackFromNBT(data);
+ NBTTagCompound data = list.getCompoundTagAt(i);
+ int slot = data.getInteger("Slot");
+ if(slot >= 0 && slot < INV_SIZE)
+ {
+ blueprint[slot] = ItemStack.loadItemStackFromNBT(data);
+ }
}
+ return blueprint;
}
+ return null;
}
- public void writeToNBT(NBTTagCompound nbt){
- NBTTagList list = new NBTTagList();
- for(int i = 0;i<INV_SIZE;i++)
- {
- ItemStack stack = blueprint[i];
- if(stack != null)
+ public ItemStack writeItemsToNBT(ItemStack itemStack, ItemStack[] craftingGrid){
+ ItemStack[] blueprint = craftingGrid;
+ if (itemStack.hasTagCompound()){
+ NBTTagCompound nbt = itemStack.getTagCompound();
+ NBTTagList list = new NBTTagList();
+ for(int i = 0;i<INV_SIZE;i++)
{
- NBTTagCompound data = new NBTTagCompound();
- stack.writeToNBT(data);
- data.setInteger("Slot", i);
- list.appendTag(data);
+ ItemStack stack = blueprint[i];
+ if(stack != null)
+ {
+ NBTTagCompound data = new NBTTagCompound();
+ stack.writeToNBT(data);
+ data.setInteger("Slot", i);
+ list.appendTag(data);
+ }
}
+ nbt.setTag("Items", list);
+ itemStack.setTagCompound(nbt);
+ return itemStack;
}
- nbt.setTag("Items", list);
+ return null;
}
@Override
@@ -115,7 +147,15 @@ public class ItemBlueprint extends Item implements IItemBlueprint{
@Override
public boolean setBlueprint(ItemStack stack, IInventory craftingTable, ItemStack output) {
- if (!mHasBlueprint){
+ boolean hasBP = false;
+ ItemStack[] blueprint = new ItemStack[9];
+
+ if (stack.hasTagCompound()){
+ hasBP = (boolean) getNBT(stack, "mBlueprint");
+ blueprint = readItemsFromNBT(stack);
+ }
+
+ if (!hasBP){
try {
for (int o=0; o<craftingTable.getSizeInventory(); o++){
blueprint[o] = craftingTable.getStackInSlot(o);
@@ -123,9 +163,20 @@ public class ItemBlueprint extends Item implements IItemBlueprint{
blueprint[0].stackSize = 0;
}
}
+ writeItemsToNBT(stack, blueprint);
+ if (stack.hasTagCompound()){
+ if(stack.getTagCompound().getCompoundTag("Items") != null){
+ stack.stackTagCompound.setBoolean("mBlueprint", true);
+ }
+ else {
+ //Invalid BP saved?
+ }
+ hasBP = (boolean) getNBT(stack, "mBlueprint");
+ }
+
if (output != null){
- setBlueprintName(output.getDisplayName());
- return (mHasBlueprint = true);
+ setBlueprintName(stack, output.getDisplayName());
+ return (hasBP = true);
}
return false;
} catch (Throwable t){
@@ -136,17 +187,24 @@ public class ItemBlueprint extends Item implements IItemBlueprint{
}
@Override
- public void setBlueprintName(String name) {
- this.mName = name;
+ public void setBlueprintName(ItemStack stack, String name) {
+ stack.stackTagCompound.setString("mName", name);
}
@Override
public boolean hasBlueprint(ItemStack stack) {
- return mHasBlueprint;
+ if (stack.hasTagCompound()){
+ return (boolean) getNBT(stack, "mBlueprint");
+ }
+ return false;
}
@Override
public ItemStack[] getBlueprint(ItemStack stack) {
+ ItemStack[] blueprint = new ItemStack[9];
+ if (stack.hasTagCompound()){
+ blueprint = readItemsFromNBT(stack);
+ }
try {
ItemStack[] returnStack = new ItemStack[9];
for (int o=0; o<blueprint.length; o++){
@@ -161,4 +219,73 @@ public class ItemBlueprint extends Item implements IItemBlueprint{
}
}
+ public boolean createNBT(ItemStack itemStack){
+ if (itemStack.hasTagCompound()){
+ if (!itemStack.stackTagCompound.getBoolean("mBlueprint") && !itemStack.stackTagCompound.getString("mName").equals("")){
+ //No Blueprint and no name Set
+ Utils.LOG_INFO("No Blueprint and no name Set");
+ return false;
+ }
+ else if (itemStack.stackTagCompound.getBoolean("mBlueprint") && !itemStack.stackTagCompound.getString("mName").equals("")){
+ //Has Blueprint but invalid name set
+ Utils.LOG_INFO("Has Blueprint but invalid name set");
+ //itemStack.stackTagCompound = null;
+ //createNBT(itemStack);
+ return false;
+ }
+ else if (!itemStack.stackTagCompound.getBoolean("mBlueprint") && itemStack.stackTagCompound.getString("mName").equals("")){
+ //Has no Blueprint, but strangely has a name
+ Utils.LOG_INFO("Has no Blueprint, but strangely has a name");
+ //itemStack.stackTagCompound = null;
+ //createNBT(itemStack);
+ return false;
+ }
+ return false;
+ }
+ else if(!itemStack.hasTagCompound()){
+ int bpID = MathUtils.randInt(0, 1000);
+ boolean hasRecipe = false;
+ String recipeName = "";
+ Utils.LOG_INFO("Creating Blueprint, setting up it's NBT data. "+bpID);
+ itemStack.stackTagCompound = new NBTTagCompound();
+ itemStack.stackTagCompound.setInteger("mID", bpID);
+ itemStack.stackTagCompound.setBoolean("mBlueprint", hasRecipe);
+ itemStack.stackTagCompound.setString("mName", recipeName);
+ return true;
+ }
+ else {
+ int bpID = MathUtils.randInt(0, 1000);
+ boolean hasRecipe = false;
+ String recipeName = "";
+ Utils.LOG_INFO("Creating a Blueprint, setting up it's NBT data. "+bpID);
+ itemStack.stackTagCompound = new NBTTagCompound();
+ itemStack.stackTagCompound.setInteger("mID", bpID);
+ itemStack.stackTagCompound.setBoolean("mBlueprint", hasRecipe);
+ itemStack.stackTagCompound.setString("mName", recipeName);
+ return true;
+ }
+ }
+
+ public Object getNBT(ItemStack itemStack, String tagNBT){
+ if (!itemStack.hasTagCompound()){
+ return null;
+ }
+ Object o = null;
+ if (tagNBT.equals("mID")){
+ o = itemStack.stackTagCompound.getInteger(tagNBT);
+ }
+ else if (tagNBT.equals("mBlueprint")){
+ o = itemStack.stackTagCompound.getBoolean(tagNBT);
+ }
+ else if (tagNBT.equals("mName")){
+ o = itemStack.stackTagCompound.getString(tagNBT);
+ }
+ else if (tagNBT.equals("")){
+ //For More Tag Support
+ //o = itemStack.stackTagCompound.getInteger(tagNBT);
+ }
+ if (o != null)
+ return o;
+ return null; }
+
}
diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java
index 777bf16dc0..390071b539 100644
--- a/src/Java/gtPlusPlus/core/lib/CORE.java
+++ b/src/Java/gtPlusPlus/core/lib/CORE.java
@@ -6,7 +6,9 @@ import gtPlusPlus.core.util.networking.NetworkUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
import gtPlusPlus.xmod.gregtech.api.interfaces.internal.IGregtech_RecipeAdder;
import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
+import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_TesseractGenerator;
+import java.util.HashMap;
import java.util.Map;
import net.minecraft.util.EnumChatFormatting;
@@ -39,6 +41,9 @@ public class CORE {
* A List containing all the Materials, which are somehow in use by GT and therefor receive a specific Set of Items.
*/
public static final GT_Materials[] sMU_GeneratedMaterials = new GT_Materials[1000];
+
+ //Tesseract map
+ public static final Map<Integer, GT_MetaTileEntity_TesseractGenerator> sTesseractGenerators = new HashMap<Integer, GT_MetaTileEntity_TesseractGenerator>();
//GUIS
public enum GUI_ENUM
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java
new file mode 100644
index 0000000000..9a396334d4
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java
@@ -0,0 +1,49 @@
+package gtPlusPlus.core.recipe;
+
+import gregtech.api.enums.ItemList;
+import gtPlusPlus.core.block.ModBlocks;
+import gtPlusPlus.core.item.ModItems;
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.core.util.recipe.UtilsRecipe;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+
+public class RECIPES_General {
+
+ static ItemStack RECIPE_Paper = UtilsItems.getSimpleStack(Items.paper);
+ static ItemStack RECIPE_LapisDust = UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dustLazurite", 2);
+ static ItemStack OUTPUT_Blueprint = UtilsItems.getSimpleStack(ModItems.itemBlueprintBase);
+ static ItemStack RECIPE_CraftingTable = UtilsItems.getSimpleStack(Item.getItemFromBlock(Blocks.crafting_table));
+ static ItemStack RECIPE_BronzePlate = UtilsItems.getItemStackOfAmountFromOreDictNoBroken("plateBronze", 1);
+ static ItemStack RECIPE_BasicCasingIC2;
+ static ItemStack OUTPUT_Workbench_Bronze = UtilsItems.getSimpleStack(Item.getItemFromBlock(ModBlocks.blockWorkbench));
+ static ItemStack NULL = null;
+
+ public static void RECIPES_LOAD(){
+
+ if (LoadedMods.Gregtech){
+ RECIPE_BasicCasingIC2 = ItemList.Casing_Gearbox_Bronze.get(1);
+ run();
+ }
+ }
+
+ private static void run(){
+
+
+ UtilsRecipe.recipeBuilder(
+ RECIPE_Paper, RECIPE_LapisDust, NULL,
+ RECIPE_Paper, RECIPE_LapisDust, NULL,
+ RECIPE_LapisDust, RECIPE_LapisDust, NULL,
+ OUTPUT_Blueprint);
+
+ UtilsRecipe.recipeBuilder(
+ RECIPE_BronzePlate, RECIPE_CraftingTable, RECIPE_BronzePlate,
+ RECIPE_BronzePlate, RECIPE_BasicCasingIC2, RECIPE_BronzePlate,
+ RECIPE_BronzePlate, RECIPE_BronzePlate, RECIPE_BronzePlate,
+ OUTPUT_Workbench_Bronze);
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/util/item/UtilsItems.java b/src/Java/gtPlusPlus/core/util/item/UtilsItems.java
index ec4e457489..64f06a078c 100644
--- a/src/Java/gtPlusPlus/core/util/item/UtilsItems.java
+++ b/src/Java/gtPlusPlus/core/util/item/UtilsItems.java
@@ -467,8 +467,15 @@ public class UtilsItems {
public static String getArrayStackNames(ItemStack[] aStack){
String itemNames = "Item Array: ";
for (ItemStack alph : aStack){
- String temp = itemNames;
- itemNames = temp + ", " + alph.getDisplayName() + " x" + alph.stackSize;
+
+ if (alph != null){
+ String temp = itemNames;
+ itemNames = temp + ", " + alph.getDisplayName() + " x" + alph.stackSize;
+ }
+ else {
+ String temp = itemNames;
+ itemNames = temp + ", " + "null" + " x" + "0";
+ }
}
return itemNames;
diff --git a/src/Java/gtPlusPlus/core/util/recipe/UtilsRecipe.java b/src/Java/gtPlusPlus/core/util/recipe/UtilsRecipe.java
index 997aaa95c9..727e40f570 100644
--- a/src/Java/gtPlusPlus/core/util/recipe/UtilsRecipe.java
+++ b/src/Java/gtPlusPlus/core/util/recipe/UtilsRecipe.java
@@ -101,7 +101,7 @@ public class UtilsRecipe {
try {
GameRegistry.addRecipe(new ShapedOreRecipe(resultItem.copy(), (Object[]) validSlots.toArray()));
- Utils.LOG_INFO("Success! Added a recipe for "+resultItem.toString());
+ Utils.LOG_INFO("Success! Added a recipe for "+resultItem.getDisplayName());
if (!COMPAT_HANDLER.areInitItemsLoaded){
RegistrationHandler.recipesSuccess++;
}
@@ -173,7 +173,7 @@ public class UtilsRecipe {
//GameRegistry.addRecipe(new ShapelessOreRecipe(Output, outputAmount), (Object[]) validSlots.toArray());
GameRegistry.addRecipe(new ShapelessOreRecipe(Output, (Object[]) validSlots.toArray()));
//GameRegistry.addShapelessRecipe(new ItemStack(output_ITEM, 1), new Object[] {slot_1, slot_2});
- Utils.LOG_INFO("Success! Added a recipe for "+Output.toString());
+ Utils.LOG_INFO("Success! Added a recipe for "+Output.getDisplayName());
RegistrationHandler.recipesSuccess++;
}
catch(RuntimeException k){
@@ -333,7 +333,7 @@ public class UtilsRecipe {
return;
}
- GT_ModHandler.addCraftingRecipe(OutputItem,
+ if (GT_ModHandler.addCraftingRecipe(OutputItem,
GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE |
GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
new Object[]{"ABC", "DEF", "GHI",
@@ -345,7 +345,10 @@ public class UtilsRecipe {
'F', InputItem6,
'G', InputItem7,
'H', InputItem8,
- 'I', InputItem9});
+ 'I', InputItem9})){
+ Utils.LOG_INFO("Success! Added a recipe for "+OutputItem.getDisplayName());
+ RegistrationHandler.recipesSuccess++;
+ }
}
public static void addShapelessGregtechRecipe(ItemStack OutputItem, Object... inputItems){
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
index 346b239932..6576e1c0d9 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
@@ -128,7 +128,10 @@ public enum GregtechItemList implements GregtechItemContainer {
GT4_Workbench_Bronze, GT4_Workbench_Advanced,
//Geothermal Engines
- Geothermal_Engine_EV, Geothermal_Engine_IV, Geothermal_Engine_LuV;
+ Geothermal_Engine_EV, Geothermal_Engine_IV, Geothermal_Engine_LuV,
+
+ //Tesseracts
+ GT4_Tesseract_Generator, GT4_Tesseract_Terminal;
public static final GregtechItemList[]
DYE_ONLY_ITEMS = {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_AdvancedWorkbench.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_AdvancedWorkbench.java
index c5bfc4ac7b..47c8aedb98 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_AdvancedWorkbench.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_AdvancedWorkbench.java
@@ -1,19 +1,19 @@
package gtPlusPlus.xmod.gregtech.api.gui;
+import gregtech.api.gui.GT_ContainerMetaTile_Machine;
import gregtech.api.gui.GT_Slot_Holo;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Log;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.slots.SlotGtTool;
import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.xmod.gregtech.api.gui.dev.GT_ContainerMetaTile_MachineEx;
import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_AdvancedCraftingTable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-public class CONTAINER_AdvancedWorkbench extends GT_ContainerMetaTile_MachineEx {
+public class CONTAINER_AdvancedWorkbench extends GT_ContainerMetaTile_Machine {
public CONTAINER_AdvancedWorkbench(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
super(aInventoryPlayer, aTileEntity);
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_AdvancedWorkbench.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_AdvancedWorkbench.java
index c52d50d674..7da9238bd5 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_AdvancedWorkbench.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_AdvancedWorkbench.java
@@ -1,12 +1,12 @@
package gtPlusPlus.xmod.gregtech.api.gui;
+import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.xmod.gregtech.api.gui.dev.GT_GUIContainerMetaTile_MachineEx;
import net.minecraft.entity.player.InventoryPlayer;
public class GUI_AdvancedWorkbench
-extends GT_GUIContainerMetaTile_MachineEx
+extends GT_GUIContainerMetaTile_Machine
{
public GUI_AdvancedWorkbench(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity)
{
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java
index 19210eea8a..a638baf5a2 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java
@@ -1,15 +1,15 @@
package gtPlusPlus.xmod.gregtech.common.blocks.textures;
import gregtech.api.enums.Textures;
-import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
public class CasingTextureHandler {
- private static final TexturesGregtech59 gregtech59 = new TexturesGregtech59();
- private static final TexturesGregtech58 gregtech58 = new TexturesGregtech58();
+ //private static final TexturesGregtech59 gregtech59 = new TexturesGregtech59();
+ //private static final TexturesGregtech58 gregtech58 = new TexturesGregtech58();
+ private static final TexturesCentrifugeMultiblock gregtechX = new TexturesCentrifugeMultiblock();
public static IIcon getIcon(int aSide, int aMeta) { //Texture ID's. case 0 == ID[57]
if ((aMeta >= 0) && (aMeta < 16)) {
@@ -67,9 +67,10 @@ public class CasingTextureHandler {
public static IIcon handleCasingsGT(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide, GregtechMetaCasingBlocks thisBlock) {
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
+ /*if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
return gregtech59.handleCasingsGT59(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);
}
- return gregtech58.handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);
+ return gregtech58.handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);*/
+ return gregtechX.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java
new file mode 100644
index 0000000000..bc7827916e
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java
@@ -0,0 +1,441 @@
+package gtPlusPlus.xmod.gregtech.common.blocks.textures;
+
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks;
+import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlocks.CustomIcon;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntityIndustrialCentrifuge;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
+
+public class TexturesCentrifugeMultiblock {
+
+ private static CustomIcon GT8_1_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE1");
+ private static CustomIcon GT8_1 = new CustomIcon("iconsets/LARGECENTRIFUGE1");
+ private static CustomIcon GT8_2_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE2");
+ private static CustomIcon GT8_2 = new CustomIcon("iconsets/LARGECENTRIFUGE2");
+ private static CustomIcon GT8_3_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE3");
+ private static CustomIcon GT8_3 = new CustomIcon("iconsets/LARGECENTRIFUGE3");
+ private static CustomIcon GT8_4_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE4");
+ private static CustomIcon GT8_4 = new CustomIcon("iconsets/LARGECENTRIFUGE4");
+ private static CustomIcon GT8_5_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE5");
+ private static CustomIcon GT8_5 = new CustomIcon("iconsets/LARGECENTRIFUGE5");
+ private static CustomIcon GT8_6_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE6");
+ private static CustomIcon GT8_6 = new CustomIcon("iconsets/LARGECENTRIFUGE6");
+ private static CustomIcon GT8_7_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE7");
+ private static CustomIcon GT8_7 = new CustomIcon("iconsets/LARGECENTRIFUGE7");
+ private static CustomIcon GT8_8_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE8");
+ private static CustomIcon GT8_8 = new CustomIcon("iconsets/LARGECENTRIFUGE8");
+ private static CustomIcon GT8_9_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE9");
+ private static CustomIcon GT8_9 = new CustomIcon("iconsets/LARGECENTRIFUGE9");
+
+ private static CustomIcon frontFace_0 = (GT8_1);
+ private static CustomIcon frontFaceActive_0 = (GT8_1_Active);
+ private static CustomIcon frontFace_1 = (GT8_2);
+ private static CustomIcon frontFaceActive_1 = (GT8_2_Active);
+ private static CustomIcon frontFace_2 = (GT8_3);
+ private static CustomIcon frontFaceActive_2 = (GT8_3_Active);
+ private static CustomIcon frontFace_3 = (GT8_4);
+ private static CustomIcon frontFaceActive_3 = (GT8_4_Active);
+ private static CustomIcon frontFace_4 = (GT8_5);
+ private static CustomIcon frontFaceActive_4 = (GT8_5_Active);
+ private static CustomIcon frontFace_5 = (GT8_6);
+ private static CustomIcon frontFaceActive_5 = (GT8_6_Active);
+ private static CustomIcon frontFace_6 = (GT8_7);
+ private static CustomIcon frontFaceActive_6 = (GT8_7_Active);
+ private static CustomIcon frontFace_7 = (GT8_8);
+ private static CustomIcon frontFaceActive_7 = (GT8_8_Active);
+ private static CustomIcon frontFace_8 = (GT8_9);
+ private static CustomIcon frontFaceActive_8 = (GT8_9_Active);
+
+ CustomIcon[] CENTRIFUGE = new CustomIcon[]{
+ frontFace_0,
+ frontFace_1,
+ frontFace_2,
+ frontFace_3,
+ frontFace_4,
+ frontFace_5,
+ frontFace_6,
+ frontFace_7,
+ frontFace_8
+ };
+
+ CustomIcon[] CENTRIFUGE_ACTIVE = new CustomIcon[]{
+ frontFaceActive_0,
+ frontFaceActive_1,
+ frontFaceActive_2,
+ frontFaceActive_3,
+ frontFaceActive_4,
+ frontFaceActive_5,
+ frontFaceActive_6,
+ frontFaceActive_7,
+ frontFaceActive_8
+ };
+
+ public IIcon handleCasingsGT(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide, GregtechMetaCasingBlocks thisBlock) {
+ return handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);
+ }
+
+
+ public IIcon handleCasingsGT58(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide, GregtechMetaCasingBlocks thisBlock) {
+ int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord);
+ if (((tMeta != 6) && (tMeta != 8) && (tMeta != 0))) {
+ return CasingTextureHandler.getIcon(aSide, tMeta);
+ }
+ int tStartIndex = tMeta == 6 ? 1 : 13;
+ if (tMeta == 0) {
+ if ((aSide == 2) || (aSide == 3)) {
+ TileEntity tTileEntity;
+ IMetaTileEntity tMetaTileEntity;
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return CENTRIFUGE_ACTIVE[0].getIcon();
+ }
+ return CENTRIFUGE[0].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return CENTRIFUGE_ACTIVE[3].getIcon();
+ }
+ return CENTRIFUGE[3].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return CENTRIFUGE_ACTIVE[6].getIcon();
+ }
+ return CENTRIFUGE[6].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return CENTRIFUGE_ACTIVE[1].getIcon();
+ }
+ return CENTRIFUGE[1].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return CENTRIFUGE_ACTIVE[7].getIcon();
+ }
+ return CENTRIFUGE[7].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return CENTRIFUGE_ACTIVE[8].getIcon();
+ }
+ return CENTRIFUGE[8].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return CENTRIFUGE_ACTIVE[5].getIcon();
+ }
+ return CENTRIFUGE[5].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return CENTRIFUGE_ACTIVE[2].getIcon();
+ }
+ return CENTRIFUGE[2].getIcon();
+ }
+ } else if ((aSide == 4) || (aSide == 5)) {
+ TileEntity tTileEntity;
+ Object tMetaTileEntity;
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return CENTRIFUGE_ACTIVE[0].getIcon();
+ }
+ return CENTRIFUGE[0].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return CENTRIFUGE_ACTIVE[3].getIcon();
+ }
+ return CENTRIFUGE[3].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return CENTRIFUGE_ACTIVE[6].getIcon();
+ }
+ return CENTRIFUGE[6].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return CENTRIFUGE_ACTIVE[1].getIcon();
+ }
+ return CENTRIFUGE[1].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return CENTRIFUGE_ACTIVE[7].getIcon();
+ }
+ return CENTRIFUGE[7].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return CENTRIFUGE_ACTIVE[8].getIcon();
+ }
+ return CENTRIFUGE[8].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return CENTRIFUGE_ACTIVE[5].getIcon();
+ }
+ return CENTRIFUGE[5].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return CENTRIFUGE_ACTIVE[2].getIcon();
+ }
+ return CENTRIFUGE[2].getIcon();
+ }
+ }
+ return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon();
+ }
+ boolean[] tConnectedSides = {(aWorld.getBlock(xCoord, yCoord - 1, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord + 1, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta), (aWorld.getBlock(xCoord + 1, yCoord, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord, zCoord + 1) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta), (aWorld.getBlock(xCoord - 1, yCoord, zCoord) == thisBlock) && (aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord, zCoord - 1) == thisBlock) && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta)};
+ switch (aSide) {
+ case 0:
+ if (tConnectedSides[0]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[2])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ if ((!tConnectedSides[5]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ case 1:
+ if (tConnectedSides[1]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[4])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ if ((!tConnectedSides[3]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ case 2:
+ if (tConnectedSides[5]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[4])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ case 3:
+ if (tConnectedSides[3]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[4])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ case 4:
+ if (tConnectedSides[4]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ if ((!tConnectedSides[3]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ case 5:
+ if (tConnectedSides[2]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ if ((!tConnectedSides[3]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ break;
+ }
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlocks.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlocks.java
new file mode 100644
index 0000000000..5044f958c8
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlocks.java
@@ -0,0 +1,75 @@
+package gtPlusPlus.xmod.gregtech.common.blocks.textures;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.interfaces.IIconContainer;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import net.minecraft.client.renderer.texture.TextureMap;
+import net.minecraft.util.IIcon;
+import net.minecraft.util.ResourceLocation;
+
+public class TexturesGtBlocks {
+
+ /*
+ * Handles Custom Textures.
+ */
+
+ public static class CustomIcon implements IIconContainer, Runnable {
+ protected IIcon mIcon;
+ protected String mIconName;
+
+ public CustomIcon(String aIconName) {
+ mIconName = aIconName;
+ Utils.LOG_INFO("Constructing a Custom Texture. " + mIconName);
+ GregTech_API.sGTBlockIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return null;
+ }
+
+ @Override
+ public void run() {
+ mIcon = GregTech_API.sBlockIcons.registerIcon(CORE.MODID + ":" + mIconName);
+ Utils.LOG_INFO("FIND ME _ Processing texture: "+this.getTextureFile().getResourcePath());
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationBlocksTexture;
+ }
+ }
+
+
+ /*
+ * Add Some Custom Textures below.
+ * I am not sure whether or not I need to declare them as such, but better to be safe than sorry.
+ * Right?
+ */
+
+
+
+ //Machine Casings
+ private static final CustomIcon Internal_Casing_Machine_Dimensional = new CustomIcon("TileEntities/adv_machine_dimensional");
+ public static final CustomIcon Casing_Machine_Dimensional = Internal_Casing_Machine_Dimensional;
+ private static final CustomIcon Internal_Casing_Machine_Dimensional_Adv = new CustomIcon("TileEntities/high_adv_machine_dimensional");
+ public static final CustomIcon Casing_Machine_Dimensional_Adv = Internal_Casing_Machine_Dimensional_Adv;
+
+ //Computer Screens
+ private static final CustomIcon Internal_Casing_Machine_Screen_1 = new CustomIcon("TileEntities/adv_machine_screen_random1");
+ public static final CustomIcon Casing_Machine_Screen_1 = Internal_Casing_Machine_Screen_1;
+ private static final CustomIcon Internal_Casing_Machine_Screen_2 = new CustomIcon("TileEntities/adv_machine_screen_random2");
+ public static final CustomIcon Casing_Machine_Screen_2 = Internal_Casing_Machine_Screen_2;
+ private static final CustomIcon Internal_Casing_Machine_Screen_3 = new CustomIcon("TileEntities/adv_machine_screen_random3");
+ public static final CustomIcon Casing_Machine_Screen_3 = Internal_Casing_Machine_Screen_3;
+ private static final CustomIcon Internal_Casing_Machine_Screen_Frequency = new CustomIcon("TileEntities/adv_machine_screen_frequency");
+ public static final CustomIcon Casing_Machine_Screen_Frequency = Internal_Casing_Machine_Screen_Frequency;
+
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java
new file mode 100644
index 0000000000..dde2c6927c
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java
@@ -0,0 +1,602 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.automation;
+
+import static gtPlusPlus.core.lib.CORE.sTesseractGenerators;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IDigitalChest;
+import gregtech.api.interfaces.tileentity.IGregTechDeviceInformation;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Config;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlocks;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.ISidedInventory;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.FluidTankInfo;
+import net.minecraftforge.fluids.IFluidHandler;
+
+public class GT_MetaTileEntity_TesseractGenerator
+extends GT_MetaTileEntity_BasicTank
+{
+ public static int TESSERACT_ENERGY_COST_DIMENSIONAL = 2048;
+ public static int TESSERACT_ENERGY_COST = 1024;
+ public byte isWorking = 0;
+ public int oFrequency = 0;
+ public int mNeededEnergy = 0;
+ public int mFrequency = 0;
+
+ public GT_MetaTileEntity_TesseractGenerator(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 3, "");
+ }
+
+ public GT_MetaTileEntity_TesseractGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 3, aDescription, aTextures);
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_TesseractGenerator(mName, mTier, mDescription, mTextures);
+ }
+
+ @Override
+ public boolean isTransformerUpgradable()
+ {
+ return true;
+ }
+
+ @Override
+ public boolean isOverclockerUpgradable()
+ {
+ return false;
+ }
+
+ @Override
+ public boolean isSimpleMachine()
+ {
+ return false;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing)
+ {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetInput()
+ {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetOutput()
+ {
+ return false;
+ }
+
+ @Override
+ public boolean isInputFacing(byte aSide)
+ {
+ return true;
+ }
+
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getBackFacing();
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex)
+ {
+ return false;
+ }
+
+ @Override
+ public long getMinimumStoredEU()
+ {
+ return getBaseMetaTileEntity().getEUCapacity() / 2;
+ }
+
+ @Override
+ public long maxEUInput()
+ {
+ return 2048;
+ }
+
+ @Override
+ public long maxEUOutput()
+ {
+ return 0;
+ }
+
+ @Override
+ public long maxEUStore()
+ {
+ return 100000;
+ }
+
+ @Override
+ public long maxSteamStore()
+ {
+ return maxEUStore();
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer)
+ {
+ return true;
+ }
+
+ @Override
+ public boolean ownerControl()
+ {
+ return true;
+ }
+
+ @Override
+ public int getProgresstime()
+ {
+ return (sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) == this) && (this.isWorking >= 20) ? 999 : 0;
+ }
+
+ @Override
+ public int maxProgresstime()
+ {
+ return 1000;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT)
+ {
+ aNBT.setInteger("mFrequency", this.mFrequency);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT)
+ {
+ this.mFrequency = aNBT.getInteger("mFrequency");
+ }
+
+ @Override
+ public void onConfigLoad(GT_Config aConfig)
+ {
+ TESSERACT_ENERGY_COST = 1024;
+ TESSERACT_ENERGY_COST_DIMENSIONAL = 2048;
+ }
+
+ @Override
+ public void onServerStart()
+ {
+ sTesseractGenerators.clear();
+ }
+
+ public void onServerStop()
+ {
+ sTesseractGenerators.clear();
+ }
+
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ){
+ if (aSide == getBaseMetaTileEntity().getFrontFacing()){
+ float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ);
+ switch ((byte)((byte)(int)(tCoords[0] * 2.0F) + 2 * (byte)(int)(tCoords[1] * 2.0F))){
+ case 0:
+ Utils.LOG_INFO("Freq. -1 | " + this.mFrequency);
+ this.mFrequency -= 1;
+ break;
+ case 1:
+ Utils.LOG_INFO("Freq. +1 | " + this.mFrequency);
+ this.mFrequency += 1;
+ default:
+ //Utils.LOG_INFO("Did not click the correct place.");
+ break;
+ }
+ Utils.messagePlayer(aPlayer, "Frequency: " + this.mFrequency);
+ Utils.messagePlayer(aPlayer, ((sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) != null) && (sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) != this) ? EnumChatFormatting.RED + " (Occupied)" : ""));
+ }
+ return true;
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ)
+ {
+ if (aSide == getBaseMetaTileEntity().getFrontFacing())
+ {
+ float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ);
+ switch ((byte)((byte)(int)(tCoords[0] * 2.0F) + 2 * (byte)(int)(tCoords[1] * 2.0F)))
+ {
+ case 0:
+ this.mFrequency -= 64;
+ break;
+ case 1:
+ this.mFrequency += 64;
+ break;
+ case 2:
+ this.mFrequency -= 512;
+ break;
+ case 3:
+ this.mFrequency += 512;
+ }
+ GT_Utility.sendChatToPlayer(aPlayer, "Frequency: " + this.mFrequency + ((sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) != null) && (sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) != this) ? EnumChatFormatting.RED + " (Occupied)" : ""));
+ }
+ }
+
+ public boolean allowCoverOnSide(byte aSide, int aCoverID)
+ {
+ return aSide != getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public String[] getInfoData()
+ {
+ TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IGregTechDeviceInformation)) && (((IGregTechDeviceInformation)tTileEntity).isGivingInformation())) {
+ return ((IGregTechDeviceInformation)tTileEntity).getInfoData();
+ }
+ return new String[] { "Tesseract Generator", "Freqency:", "" + this.mFrequency, (sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) == this) && (this.isWorking >= 20) ? "Active" : "Inactive" };
+ }
+
+ @Override
+ public boolean isGivingInformation()
+ {
+ return true;
+ }
+
+ public boolean isSendingInformation()
+ {
+ TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IGregTechDeviceInformation))) {
+ return ((IGregTechDeviceInformation)tTileEntity).isGivingInformation();
+ }
+ return false;
+ }
+
+ @Override
+ public boolean isDigitalChest()
+ {
+ TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IDigitalChest))) {
+ return ((IDigitalChest)tTileEntity).isDigitalChest();
+ }
+ return false;
+ }
+
+ @Override
+ public ItemStack[] getStoredItemData()
+ {
+ TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IDigitalChest))) {
+ return ((IDigitalChest)tTileEntity).getStoredItemData();
+ }
+ return null;
+ }
+
+ @Override
+ public void setItemCount(int aCount)
+ {
+ TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IDigitalChest))) {
+ ((IDigitalChest)tTileEntity).setItemCount(aCount);
+ }
+ }
+
+ @Override
+ public int getMaxItemCount()
+ {
+ TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IDigitalChest))) {
+ return ((IDigitalChest)tTileEntity).getMaxItemCount();
+ }
+ return 0;
+ }
+
+ @Override
+ public boolean isItemValidForSlot(int aIndex, ItemStack aStack)
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ return tTileEntity.isItemValidForSlot(aIndex, aStack);
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(int aSide)
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return new int[0];
+ }
+ if ((tTileEntity instanceof ISidedInventory)) {
+ return ((ISidedInventory)tTileEntity).getAccessibleSlotsFromSide(aSide);
+ }
+ int[] rArray = new int[getSizeInventory()];
+ for (int i = 0; i < getSizeInventory(); i++) {
+ rArray[i] = i;
+ }
+ return rArray;
+ }
+
+ @Override
+ public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide)
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ if ((tTileEntity instanceof ISidedInventory)) {
+ return ((ISidedInventory)tTileEntity).canInsertItem(aIndex, aStack, aSide);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide)
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ if ((tTileEntity instanceof ISidedInventory)) {
+ return ((ISidedInventory)tTileEntity).canExtractItem(aIndex, aStack, aSide);
+ }
+ return true;
+ }
+
+ @Override
+ public int getSizeInventory()
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return 0;
+ }
+ return tTileEntity.getSizeInventory();
+ }
+
+ @Override
+ public ItemStack getStackInSlot(int aIndex)
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
+ }
+ return tTileEntity.getStackInSlot(aIndex);
+ }
+
+ @Override
+ public void setInventorySlotContents(int aIndex, ItemStack aStack)
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return;
+ }
+ tTileEntity.setInventorySlotContents(aIndex, aStack);
+ }
+
+ @Override
+ public ItemStack decrStackSize(int aIndex, int aAmount)
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
+ }
+ return tTileEntity.decrStackSize(aIndex, aAmount);
+ }
+
+ @Override
+ public String getInventoryName()
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return "";
+ }
+ return tTileEntity.getInventoryName();
+ }
+
+ @Override
+ public int getInventoryStackLimit()
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return 0;
+ }
+ return tTileEntity.getInventoryStackLimit();
+ }
+
+ @Override
+ public boolean canFill(ForgeDirection aSide, Fluid aFluid)
+ {
+ IFluidHandler tTileEntity = getBaseMetaTileEntity().getITankContainerAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ return tTileEntity.canFill(aSide, aFluid);
+ }
+
+ @Override
+ public boolean canDrain(ForgeDirection aSide, Fluid aFluid)
+ {
+ IFluidHandler tTileEntity = getBaseMetaTileEntity().getITankContainerAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ return tTileEntity.canDrain(aSide, aFluid);
+ }
+
+ @Override
+ public FluidTankInfo[] getTankInfo(ForgeDirection aSide)
+ {
+ IFluidHandler tTileEntity = getBaseMetaTileEntity().getITankContainerAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return new FluidTankInfo[0];
+ }
+ return tTileEntity.getTankInfo(aSide);
+ }
+
+ @Override
+ public int fill_default(ForgeDirection aDirection, FluidStack aFluid, boolean doFill)
+ {
+ IFluidHandler tTileEntity = getBaseMetaTileEntity().getITankContainerAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return 0;
+ }
+ return tTileEntity.fill(aDirection, aFluid, doFill);
+ }
+
+ @Override
+ public FluidStack drain(ForgeDirection aDirection, int maxDrain, boolean doDrain)
+ {
+ IFluidHandler tTileEntity = getBaseMetaTileEntity().getITankContainerAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
+ }
+ return tTileEntity.drain(aDirection, maxDrain, doDrain);
+ }
+
+ @Override
+ public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain)
+ {
+ IFluidHandler tTileEntity = getBaseMetaTileEntity().getITankContainerAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
+ }
+ return tTileEntity.drain(aSide, aFluid, doDrain);
+ }
+
+ public boolean addEnergyConsumption(GT_MetaTileEntity_TesseractTerminal aTerminal)
+ {
+ if (!getBaseMetaTileEntity().isAllowedToWork()) {
+ return false;
+ }
+ this.mNeededEnergy += (aTerminal.getBaseMetaTileEntity().getWorld() == getBaseMetaTileEntity().getWorld() ? TESSERACT_ENERGY_COST : TESSERACT_ENERGY_COST_DIMENSIONAL);
+ return true;
+ }
+
+ public boolean isValidTesseractGenerator(String aOwnerName, boolean aWorkIrrelevant)
+ {
+ return (getBaseMetaTileEntity() != null) && (!getBaseMetaTileEntity().isInvalidTileEntity()) && (getBaseMetaTileEntity().isAllowedToWork()) && ((aOwnerName == null) || (getBaseMetaTileEntity().getOwnerName().equals(aOwnerName))) && ((aWorkIrrelevant) || (this.isWorking >= 20));
+ }
+
+ public void onPostTick()
+ {
+ if (getBaseMetaTileEntity().isServerSide()){
+ if (this.mFrequency != this.oFrequency){
+
+ Utils.LOG_INFO("mFreq != oFreq");
+
+ if (sTesseractGenerators.get(Integer.valueOf(this.oFrequency)) == this)
+ {
+ sTesseractGenerators.remove(Integer.valueOf(this.oFrequency));
+ getBaseMetaTileEntity().issueBlockUpdate();
+ Utils.LOG_INFO("this Gen == oFreq on map - do block update");
+ }
+ Utils.LOG_INFO("mFreq will be set to oFreq");
+ this.oFrequency = this.mFrequency;
+ }
+ if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().decreaseStoredEnergyUnits(this.mNeededEnergy, false)))
+ {
+ Utils.LOG_INFO("Can Work & Has Energy");
+ if ((sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) == null) || (!((GT_MetaTileEntity_TesseractGenerator)sTesseractGenerators.get(Integer.valueOf(this.mFrequency))).isValidTesseractGenerator(null, true))) {
+ Utils.LOG_INFO("storing TE I think to mFreq map?");
+ sTesseractGenerators.put(Integer.valueOf(this.mFrequency), this);
+ }
+ }
+ else
+ {
+ if (sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) == this)
+ {
+ Utils.LOG_INFO("this gen == mFreq on map - do block update");
+ sTesseractGenerators.remove(Integer.valueOf(this.mFrequency));
+ getBaseMetaTileEntity().issueBlockUpdate();
+ }
+ this.isWorking = 0;
+ }
+ if (sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) == this)
+ {
+ Utils.LOG_INFO("mFreq == this - do work related things");
+ if (this.isWorking < 20) {
+ this.isWorking = ((byte)(this.isWorking + 1));
+ }
+ if (this.isWorking == 20)
+ {
+ getBaseMetaTileEntity().issueBlockUpdate();
+ this.isWorking = ((byte)(this.isWorking + 1));
+ }
+ }
+ else
+ {
+ this.isWorking = 0;
+ }
+ this.mNeededEnergy = 0;
+ }
+ }
+
+ @Override
+ public String[] getDescription()
+ {
+ return new String[] {"Generates a Tesseract for the attached Inventory"};
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ return new ITexture[0][0][0];
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return aSide == aFacing ? new ITexture[]{ new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Dimensional), new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Screen_Frequency)} : new ITexture[]{new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Dimensional), new GT_RenderedTexture(Textures.BlockIcons.VOID)};
+ }
+
+
+ //To-Do?
+ @Override
+ public boolean doesFillContainers() {
+ return false;
+ }
+
+ @Override
+ public boolean doesEmptyContainers() {
+ return false;
+ }
+
+ @Override
+ public boolean canTankBeFilled() {
+ return false;
+ }
+
+ @Override
+ public boolean canTankBeEmptied() {
+ return false;
+ }
+
+ @Override
+ public boolean displaysItemStack() {
+ return false;
+ }
+
+ @Override
+ public boolean displaysStackSize() {
+ return false;
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java
new file mode 100644
index 0000000000..8c22b49260
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java
@@ -0,0 +1,504 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.automation;
+
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Config;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlocks;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.FluidTankInfo;
+
+public class GT_MetaTileEntity_TesseractTerminal
+extends GT_MetaTileEntity_BasicTank
+{
+ public int mFrequency = 0;
+ public boolean mDidWork = false;
+ public static boolean sInterDimensionalTesseractAllowed = true;
+
+ public GT_MetaTileEntity_TesseractTerminal(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 3, "");
+ }
+
+ public GT_MetaTileEntity_TesseractTerminal(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 3, aDescription, aTextures);
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_TesseractTerminal(mName, mTier, mDescription, mTextures);
+ }
+
+ @Override
+ public boolean isTransformerUpgradable()
+ {
+ return false;
+ }
+
+ @Override
+ public boolean isOverclockerUpgradable()
+ {
+ return false;
+ }
+
+ @Override
+ public boolean isSimpleMachine()
+ {
+ return false;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing)
+ {
+ return true;
+ }
+
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getBackFacing();
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex)
+ {
+ return false;
+ }
+
+ @Override
+ public long getMinimumStoredEU()
+ {
+ return getBaseMetaTileEntity().getEUCapacity() / 2;
+ }
+
+ @Override
+ public long maxEUInput()
+ {
+ return 2048;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer)
+ {
+ return true;
+ }
+
+ @Override
+ public long maxEUStore()
+ {
+ return 100000;
+ }
+
+ @Override
+ public long maxSteamStore()
+ {
+ return maxEUStore();
+ }
+
+ @Override
+ public boolean ownerControl()
+ {
+ return true;
+ }
+
+ @Override
+ public int getProgresstime()
+ {
+ return getTesseract(this.mFrequency, false) != null ? 999 : 0;
+ }
+
+ @Override
+ public int maxProgresstime()
+ {
+ return 1000;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT)
+ {
+ aNBT.setInteger("mFrequency", this.mFrequency);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT)
+ {
+ this.mFrequency = aNBT.getInteger("mFrequency");
+ }
+
+ @Override
+ public void onConfigLoad(GT_Config aConfig)
+ {
+ sInterDimensionalTesseractAllowed = true;
+ }
+
+ public boolean onRightclick(EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ)
+ {
+ if (aSide == getBaseMetaTileEntity().getFrontFacing())
+ {
+ float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ);
+ switch ((byte)((byte)(int)(tCoords[0] * 2.0F) + 2 * (byte)(int)(tCoords[1] * 2.0F)))
+ {
+ case 0:
+ this.mFrequency -= 1;
+ break;
+ case 1:
+ this.mFrequency += 1;
+ }
+ GT_Utility.sendChatToPlayer(aPlayer, "Frequency: " + this.mFrequency + (getTesseract(this.mFrequency, false) == null ? "" : new StringBuilder().append(EnumChatFormatting.GREEN).append(" (Connected)").toString()));
+ }
+ return true;
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ)
+ {
+ if (aSide == getBaseMetaTileEntity().getFrontFacing())
+ {
+ float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ);
+ switch ((byte)((byte)(int)(tCoords[0] * 2.0F) + 2 * (byte)(int)(tCoords[1] * 2.0F)))
+ {
+ case 0:
+ this.mFrequency -= 64;
+ break;
+ case 1:
+ this.mFrequency += 64;
+ break;
+ case 2:
+ this.mFrequency -= 512;
+ break;
+ case 3:
+ this.mFrequency += 512;
+ }
+ GT_Utility.sendChatToPlayer(aPlayer, "Frequency: " + this.mFrequency + (getTesseract(this.mFrequency, false) == null ? "" : new StringBuilder().append(EnumChatFormatting.GREEN).append(" (Connected)").toString()));
+ }
+ }
+
+ public boolean allowCoverOnSide(byte aSide, int aCoverID)
+ {
+ return aSide != getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ public GT_MetaTileEntity_TesseractGenerator getTesseract(int aFrequency, boolean aWorkIrrelevant)
+ {
+ GT_MetaTileEntity_TesseractGenerator rTesseract = (GT_MetaTileEntity_TesseractGenerator)CORE.sTesseractGenerators.get(Integer.valueOf(aFrequency));
+ if (rTesseract == null) {
+ return null;
+ }
+ if (rTesseract.mFrequency != aFrequency)
+ {
+ CORE.sTesseractGenerators.put(Integer.valueOf(aFrequency), null);return null;
+ }
+ if (!rTesseract.isValidTesseractGenerator(getBaseMetaTileEntity().getOwnerName(), aWorkIrrelevant)) {
+ return null;
+ }
+ if ((!sInterDimensionalTesseractAllowed) && (rTesseract.getBaseMetaTileEntity().getWorld() != getBaseMetaTileEntity().getWorld())) {
+ return null;
+ }
+ return rTesseract;
+ }
+
+ @Override
+ public String[] getInfoData()
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && (tTileEntity.isSendingInformation())) {
+ return tTileEntity.getInfoData();
+ }
+ return new String[] { "Tesseract Generator", "Freqency:", "" + this.mFrequency, getTesseract(this.mFrequency, false) != null ? "Active" : "Inactive" };
+ }
+
+ @Override
+ public boolean isGivingInformation()
+ {
+ return true;
+ }
+
+ @Override
+ public boolean isDigitalChest()
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ return tTileEntity.isDigitalChest();
+ }
+
+ @Override
+ public ItemStack[] getStoredItemData()
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
+ }
+ return tTileEntity.getStoredItemData();
+ }
+
+ @Override
+ public void setItemCount(int aCount)
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return;
+ }
+ tTileEntity.setItemCount(aCount);
+ }
+
+ @Override
+ public int getMaxItemCount()
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return 0;
+ }
+ return tTileEntity.getMaxItemCount();
+ }
+
+ @Override
+ public boolean isItemValidForSlot(int aIndex, ItemStack aStack)
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ return tTileEntity.isItemValidForSlot(aIndex, aStack);
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(int aSide)
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return new int[0];
+ }
+ return tTileEntity.getAccessibleSlotsFromSide(aSide);
+ }
+
+ @Override
+ public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide)
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ return tTileEntity.canInsertItem(aIndex, aStack, aSide);
+ }
+
+ @Override
+ public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide)
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ return tTileEntity.canExtractItem(aIndex, aStack, aSide);
+ }
+
+ @Override
+ public int getSizeInventory()
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return 0;
+ }
+ return tTileEntity.getSizeInventory();
+ }
+
+ @Override
+ public ItemStack getStackInSlot(int aIndex)
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
+ }
+ return tTileEntity.getStackInSlot(aIndex);
+ }
+
+ @Override
+ public void setInventorySlotContents(int aIndex, ItemStack aStack)
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return;
+ }
+ tTileEntity.setInventorySlotContents(aIndex, aStack);
+ }
+
+ @Override
+ public ItemStack decrStackSize(int aIndex, int aAmount)
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
+ }
+ return tTileEntity.decrStackSize(aIndex, aAmount);
+ }
+
+ @Override
+ public String getInventoryName()
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return "";
+ }
+ return tTileEntity.getInventoryName();
+ }
+
+ @Override
+ public int getInventoryStackLimit()
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return 0;
+ }
+ return tTileEntity.getInventoryStackLimit();
+ }
+
+ @Override
+ public boolean canFill(ForgeDirection aSide, Fluid aFluid)
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ return tTileEntity.canFill(aSide, aFluid);
+ }
+
+ @Override
+ public boolean canDrain(ForgeDirection aSide, Fluid aFluid)
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ return tTileEntity.canDrain(aSide, aFluid);
+ }
+
+ @Override
+ public FluidTankInfo[] getTankInfo(ForgeDirection aSide)
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return new FluidTankInfo[0];
+ }
+ return tTileEntity.getTankInfo(aSide);
+ }
+
+ @Override
+ public int fill_default(ForgeDirection aDirection, FluidStack aFluid, boolean doFill)
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return 0;
+ }
+ return tTileEntity.fill(aDirection, aFluid, doFill);
+ }
+
+ @Override
+ public FluidStack drain(ForgeDirection aDirection, int maxDrain, boolean doDrain)
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
+ }
+ return tTileEntity.drain(aDirection, maxDrain, doDrain);
+ }
+
+ @Override
+ public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain)
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, false);
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
+ }
+ return tTileEntity.drain(aSide, aFluid, doDrain);
+ }
+
+ public void onPostTick()
+ {
+ if ((getBaseMetaTileEntity().isServerSide()) && (getBaseMetaTileEntity().isAllowedToWork()))
+ {
+ GT_MetaTileEntity_TesseractGenerator tTileEntity = getTesseract(this.mFrequency, true);
+ if (tTileEntity != null)
+ {
+ tTileEntity.addEnergyConsumption(this);
+ if ((!this.mDidWork) && (getTesseract(this.mFrequency, false) != null))
+ {
+ this.mDidWork = true;
+ getBaseMetaTileEntity().issueBlockUpdate();
+ }
+ }
+ else if (this.mDidWork == true)
+ {
+ this.mDidWork = false;
+ getBaseMetaTileEntity().issueBlockUpdate();
+ }
+ }
+ }
+
+ @Override
+ public String[] getDescription()
+ {
+ return new String[] {"Accesses Tesseracts remotely"};
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ return new ITexture[0][0][0];
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return aSide == aFacing ? new ITexture[]{new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Dimensional), new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Screen_Frequency)} : new ITexture[]{new GT_RenderedTexture(TexturesGtBlocks.Casing_Machine_Dimensional), new GT_RenderedTexture(Textures.BlockIcons.VOID)};
+ }
+
+ //To-Do?
+ @Override
+ public boolean doesFillContainers() {
+ return false;
+ }
+
+ @Override
+ public boolean doesEmptyContainers() {
+ return false;
+ }
+
+ @Override
+ public boolean canTankBeFilled() {
+ return false;
+ }
+
+ @Override
+ public boolean canTankBeEmptied() {
+ return false;
+ }
+
+ @Override
+ public boolean displaysItemStack() {
+ return false;
+ }
+
+ @Override
+ public boolean displaysStackSize() {
+ return false;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java
index 13ae8e424f..c76afc23be 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java
@@ -16,6 +16,7 @@ import gtPlusPlus.core.lib.CORE.configSwitches;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
+import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlocks.CustomIcon;
import java.util.ArrayList;
import java.util.List;
@@ -36,22 +37,14 @@ extends GregtechMeta_MultiBlockBase {
private static boolean isDisabled = false;
private static ITexture frontFace;
private static ITexture frontFaceActive;
- private static Textures.BlockIcons.CustomIcon GT9_5_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE5");
- private static Textures.BlockIcons.CustomIcon GT9_5 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST5");
- private static Textures.BlockIcons.CustomIcon GT8_5_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE5");
- private static Textures.BlockIcons.CustomIcon GT8_5 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE5");
+ private static CustomIcon GT9_5_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE5");
+ private static CustomIcon GT9_5 = new CustomIcon("iconsets/LARGECENTRIFUGE5");
//public static double recipesComplete = 0;
public GregtechMetaTileEntityIndustrialCentrifuge(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
frontFaceActive = new GT_RenderedTexture(GT9_5_Active);
frontFace = new GT_RenderedTexture(GT9_5);
- }
- else{
- frontFaceActive = new GT_RenderedTexture(GT8_5_Active);
- frontFace = new GT_RenderedTexture(GT8_5);
- }
}
public GregtechMetaTileEntityIndustrialCentrifuge(String aName) {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java
new file mode 100644
index 0000000000..3d8f8ce61c
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java
@@ -0,0 +1,37 @@
+package gtPlusPlus.xmod.gregtech.registration.gregtech;
+
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_TesseractGenerator;
+import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_TesseractTerminal;
+import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_AdvancedCraftingTable;
+import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_BronzeCraftingTable;
+
+public class Gregtech4Content
+{
+
+ //ID Range 828, 829, 833 - 850
+
+ public static void run()
+ {
+ if (LoadedMods.Gregtech){
+ workbenches();
+ tesseracts();
+ }
+ }
+
+ private static void workbenches(){
+ //Gregtech 4 Workbenches
+ Utils.LOG_INFO("Gregtech 4 Content | Registering Workbenches.");
+ GregtechItemList.GT4_Workbench_Bronze.set(new GT_MetaTileEntity_BronzeCraftingTable(828, "workbench.bronze", "Bronze Workbench", 0).getStackForm(1L));
+ GregtechItemList.GT4_Workbench_Advanced.set(new GT_MetaTileEntity_AdvancedCraftingTable(829, "workbench.advanced", "Advanced Workbench", 1).getStackForm(1L));
+ }
+
+ private static void tesseracts(){
+ //Gregtech 4 Workbenches
+ Utils.LOG_INFO("Gregtech 4 Content | Registering Tesseracts.");
+ GregtechItemList.GT4_Tesseract_Generator.set(new GT_MetaTileEntity_TesseractGenerator(833, "tesseract.generator", "Tesseract Generator", 4).getStackForm(1L));
+ GregtechItemList.GT4_Tesseract_Terminal.set(new GT_MetaTileEntity_TesseractTerminal(834, "tesseract.terminal", "Tesseract Terminal", 4).getStackForm(1L));
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechWorkbenches.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechWorkbenches.java
deleted file mode 100644
index 4486bc5cd5..0000000000
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechWorkbenches.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package gtPlusPlus.xmod.gregtech.registration.gregtech;
-
-import gtPlusPlus.core.lib.LoadedMods;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
-import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_AdvancedCraftingTable;
-import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_BronzeCraftingTable;
-
-public class GregtechWorkbenches
-{
- public static void run()
- {
- if (LoadedMods.Gregtech){
- Utils.LOG_INFO("Gregtech5u Content | Registering Workbenches.");
- run1();
- //run2();
- }
-
- }
-
- private static void run1()
- {
- //Gregtech 4 Workbenches
- GregtechItemList.GT4_Workbench_Bronze.set(new GT_MetaTileEntity_BronzeCraftingTable(828, "workbench.bronze", "Bronze Workbench", 0).getStackForm(1L));
- GregtechItemList.GT4_Workbench_Advanced.set(new GT_MetaTileEntity_AdvancedCraftingTable(829, "workbench.advanced", "Advanced Workbench", 1).getStackForm(1L));
-
-
- }
-}
diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_dimensional.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_dimensional.png
new file mode 100644
index 0000000000..d391da4eaf
--- /dev/null
+++ b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_dimensional.png
Binary files differ
diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_dimensional.png.mcmeta b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_dimensional.png.mcmeta
new file mode 100644
index 0000000000..60af678259
--- /dev/null
+++ b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_dimensional.png.mcmeta
@@ -0,0 +1,5 @@
+{
+ "animation":{
+ "frametime":4
+ }
+} \ No newline at end of file
diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_frequency.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_frequency.png
new file mode 100644
index 0000000000..0db2d5da9b
--- /dev/null
+++ b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_frequency.png
Binary files differ
diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random1.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random1.png
new file mode 100644
index 0000000000..7157b7541d
--- /dev/null
+++ b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random1.png
Binary files differ
diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random1.png.mcmeta b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random1.png.mcmeta
new file mode 100644
index 0000000000..60af678259
--- /dev/null
+++ b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random1.png.mcmeta
@@ -0,0 +1,5 @@
+{
+ "animation":{
+ "frametime":4
+ }
+} \ No newline at end of file
diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random2.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random2.png
new file mode 100644
index 0000000000..7157b7541d
--- /dev/null
+++ b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random2.png
Binary files differ
diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random2.png.mcmeta b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random2.png.mcmeta
new file mode 100644
index 0000000000..97596ba817
--- /dev/null
+++ b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random2.png.mcmeta
@@ -0,0 +1,5 @@
+{
+ "animation":{
+ "frametime":2
+ }
+} \ No newline at end of file
diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random3.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random3.png
new file mode 100644
index 0000000000..7157b7541d
--- /dev/null
+++ b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random3.png
Binary files differ
diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random3.png.mcmeta b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random3.png.mcmeta
new file mode 100644
index 0000000000..dfae8cae16
--- /dev/null
+++ b/src/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_screen_random3.png.mcmeta
@@ -0,0 +1,5 @@
+{
+ "animation":{
+ "frametime":1
+ }
+} \ No newline at end of file
diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/high_adv_machine_dimensional.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/high_adv_machine_dimensional.png
new file mode 100644
index 0000000000..fe779e8a9e
--- /dev/null
+++ b/src/resources/assets/miscutils/textures/blocks/TileEntities/high_adv_machine_dimensional.png
Binary files differ
diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/high_adv_machine_dimensional.png.mcmeta b/src/resources/assets/miscutils/textures/blocks/TileEntities/high_adv_machine_dimensional.png.mcmeta
new file mode 100644
index 0000000000..60af678259
--- /dev/null
+++ b/src/resources/assets/miscutils/textures/blocks/TileEntities/high_adv_machine_dimensional.png.mcmeta
@@ -0,0 +1,5 @@
+{
+ "animation":{
+ "frametime":4
+ }
+} \ No newline at end of file