aboutsummaryrefslogtreecommitdiff
path: root/src/Java/miscutil/gregtech/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/miscutil/gregtech/api')
-rw-r--r--src/Java/miscutil/gregtech/api/energy/IC2ElectricItem.java55
-rw-r--r--src/Java/miscutil/gregtech/api/energy/IC2ElectricItemManager.java95
-rw-r--r--src/Java/miscutil/gregtech/api/enums/AddExtraOreDict.java13
-rw-r--r--src/Java/miscutil/gregtech/api/enums/ExtraOreDictNames.java18
-rw-r--r--src/Java/miscutil/gregtech/api/enums/GregtechItemList.java171
-rw-r--r--src/Java/miscutil/gregtech/api/enums/GregtechTextures.java127
-rw-r--r--src/Java/miscutil/gregtech/api/gui/CONTAINER_IronBlastFurnace.java31
-rw-r--r--src/Java/miscutil/gregtech/api/gui/CONTAINER_SafeBlock.java120
-rw-r--r--src/Java/miscutil/gregtech/api/gui/CONTAINER_SteamCondenser.java97
-rw-r--r--src/Java/miscutil/gregtech/api/gui/GUI_IronBlastFurnace.java30
-rw-r--r--src/Java/miscutil/gregtech/api/gui/GUI_SafeBlock.java49
-rw-r--r--src/Java/miscutil/gregtech/api/gui/GUI_SteamCondenser.java55
-rw-r--r--src/Java/miscutil/gregtech/api/init/InitGregtech.java31
-rw-r--r--src/Java/miscutil/gregtech/api/init/machines/GregtechCobbleGenerator.java51
-rw-r--r--src/Java/miscutil/gregtech/api/init/machines/GregtechConduits.java103
-rw-r--r--src/Java/miscutil/gregtech/api/init/machines/GregtechEnergyBuffer.java83
-rw-r--r--src/Java/miscutil/gregtech/api/init/machines/GregtechIndustrialCentrifuge.java27
-rw-r--r--src/Java/miscutil/gregtech/api/init/machines/GregtechSafeBlock.java53
-rw-r--r--src/Java/miscutil/gregtech/api/init/machines/GregtechSteamCondenser.java36
-rw-r--r--src/Java/miscutil/gregtech/api/interfaces/GregtechItemContainer.java24
-rw-r--r--src/Java/miscutil/gregtech/api/metatileentity/implementations/GregtechMetaCasingBlocks.java88
-rw-r--r--src/Java/miscutil/gregtech/api/metatileentity/implementations/GregtechMetaCondensor.java164
-rw-r--r--src/Java/miscutil/gregtech/api/metatileentity/implementations/GregtechMetaCreativeEnergyBuffer.java261
-rw-r--r--src/Java/miscutil/gregtech/api/metatileentity/implementations/GregtechMetaEnergyBuffer.java446
-rw-r--r--src/Java/miscutil/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java235
-rw-r--r--src/Java/miscutil/gregtech/api/metatileentity/implementations/GregtechMetaSafeBlock.java76
-rw-r--r--src/Java/miscutil/gregtech/api/metatileentity/implementations/GregtechMetaTileEntityIronBlastFurnace.java369
-rw-r--r--src/Java/miscutil/gregtech/api/metatileentity/implementations/base/GregtechMetaBoilerBase.java328
-rw-r--r--src/Java/miscutil/gregtech/api/metatileentity/implementations/base/GregtechMetaSafeBlockBase.java343
-rw-r--r--src/Java/miscutil/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java67
-rw-r--r--src/Java/miscutil/gregtech/api/metatileentity/implementations/base/GregtechSteelBoiler.java290
-rw-r--r--src/Java/miscutil/gregtech/api/util/IMessage.java21
-rw-r--r--src/Java/miscutil/gregtech/api/util/VanillaChatCommandSender.java35
33 files changed, 3992 insertions, 0 deletions
diff --git a/src/Java/miscutil/gregtech/api/energy/IC2ElectricItem.java b/src/Java/miscutil/gregtech/api/energy/IC2ElectricItem.java
new file mode 100644
index 0000000000..eae47b9910
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/energy/IC2ElectricItem.java
@@ -0,0 +1,55 @@
+package miscutil.gregtech.api.energy;
+
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+
+/**
+ * Provides the ability to store energy on the implementing item.
+ *
+ * The item should have a maximum damage of 13.
+ */
+public interface IC2ElectricItem {
+ /**
+ * Determine if the item can be used in a machine or as an armor part to supply energy.
+ *
+ * @return Whether the item can supply energy
+ */
+ boolean canProvideEnergy(ItemStack itemStack);
+
+ /**
+ * Get the item ID to use for a charge energy greater than 0.
+ *
+ * @return Item ID to use
+ */
+ Item getChargedItem(ItemStack itemStack);
+
+ /**
+ * Get the item ID to use for a charge energy of 0.
+ *
+ * @return Item ID to use
+ */
+ Item getEmptyItem(ItemStack itemStack);
+
+ /**
+ * Get the item's maximum charge energy in EU.
+ *
+ * @return Maximum charge energy
+ */
+ double getMaxCharge(ItemStack itemStack);
+
+ /**
+ * Get the item's tier, lower tiers can't send energy to higher ones.
+ * Batteries are Tier 1, Energy Crystals are Tier 2, Lapotron Crystals are Tier 3.
+ *
+ * @return Item's tier
+ */
+ int getTier(ItemStack itemStack);
+
+ /**
+ * Get the item's transfer limit in EU per transfer operation.
+ *
+ * @return Transfer limit
+ */
+ double getTransferLimit(ItemStack itemStack);
+}
+
diff --git a/src/Java/miscutil/gregtech/api/energy/IC2ElectricItemManager.java b/src/Java/miscutil/gregtech/api/energy/IC2ElectricItemManager.java
new file mode 100644
index 0000000000..4b2fcb2fec
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/energy/IC2ElectricItemManager.java
@@ -0,0 +1,95 @@
+package miscutil.gregtech.api.energy;
+
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.item.ItemStack;
+
+/**
+ * This interface specifies a manager to handle the various tasks for electric items.
+ *
+ * The default implementation does the following:
+ * - store and retrieve the charge
+ * - handle charging, taking amount, tier, transfer limit, canProvideEnergy and simulate into account
+ * - replace item IDs if appropriate (getChargedItemId() and getEmptyItemId())
+ * - update and manage the damage value for the visual charge indicator
+ *
+ * @note If you're implementing your own variant (ISpecialElectricItem), you can delegate to the
+ * default implementations through ElectricItem.rawManager. The default implementation is designed
+ * to minimize its dependency on its own constraints/structure and delegates most work back to the
+ * more atomic features in the gateway manager.
+ */
+public interface IC2ElectricItemManager {
+ /**
+ * Charge an item with a specified amount of energy.
+ *
+ * @param itemStack electric item's stack
+ * @param amount amount of energy to charge in EU
+ * @param tier tier of the charging device, has to be at least as high as the item to charge
+ * @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit()
+ * @param simulate don't actually change the item, just determine the return value
+ * @return Energy transferred into the electric item
+ */
+ double charge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean simulate);
+
+ /**
+ * Discharge an item by a specified amount of energy
+ *
+ * @param itemStack electric item's stack
+ * @param amount amount of energy to discharge in EU
+ * @param tier tier of the discharging device, has to be at least as high as the item to discharge
+ * @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit()
+ * @param externally use the supplied item externally, i.e. to power something else as if it was a battery
+ * @param simulate don't actually discharge the item, just determine the return value
+ * @return Energy retrieved from the electric item
+ */
+ double discharge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean externally, boolean simulate);
+
+ /**
+ * Determine the charge level for the specified item.
+ *
+ * @param itemStack ItemStack containing the electric item
+ * @return charge level in EU
+ */
+ double getCharge(ItemStack stack);
+
+ /**
+ * Determine if the specified electric item has at least a specific amount of EU.
+ * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item.
+ * BatPacks are not taken into account.
+ *
+ * @param itemStack electric item's stack
+ * @param amount minimum amount of energy required
+ * @return true if there's enough energy
+ */
+ boolean canUse(ItemStack stack, double amount);
+
+ /**
+ * Try to retrieve a specific amount of energy from an Item, and if applicable, a BatPack.
+ * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item.
+ *
+ * @param itemStack electric item's stack
+ * @param amount amount of energy to discharge in EU
+ * @param entity entity holding the item
+ * @return true if the operation succeeded
+ */
+ boolean use(ItemStack stack, double amount, EntityLivingBase entity);
+
+ /**
+ * Charge an item from the BatPack a player is wearing.
+ * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item.
+ * use() already contains this functionality.
+ *
+ * @param itemStack electric item's stack
+ * @param entity entity holding the item
+ */
+ void chargeFromArmor(ItemStack stack, EntityLivingBase entity);
+
+ /**
+ * Get the tool tip to display for electric items.
+ *
+ * @param itemStack ItemStack to determine the tooltip for
+ * @return tool tip string or null for none
+ */
+ String getToolTip(ItemStack stack);
+
+ // TODO: add tier getter
+}
diff --git a/src/Java/miscutil/gregtech/api/enums/AddExtraOreDict.java b/src/Java/miscutil/gregtech/api/enums/AddExtraOreDict.java
new file mode 100644
index 0000000000..dff0483470
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/enums/AddExtraOreDict.java
@@ -0,0 +1,13 @@
+package miscutil.gregtech.api.enums;
+
+import gregtech.loaders.preload.GT_Loader_OreDictionary;
+
+public class AddExtraOreDict extends GT_Loader_OreDictionary {
+
+ @Override
+ public void run()
+ {
+ //GT_OreDictUnificator.registerOre(ExtraOreDictNames.buffer_core, new ItemStack(GregtechEnergyBuffer.itemBufferCore));
+ }
+
+}
diff --git a/src/Java/miscutil/gregtech/api/enums/ExtraOreDictNames.java b/src/Java/miscutil/gregtech/api/enums/ExtraOreDictNames.java
new file mode 100644
index 0000000000..8ca492c9dd
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/enums/ExtraOreDictNames.java
@@ -0,0 +1,18 @@
+package miscutil.gregtech.api.enums;
+
+/**
+ *
+ *
+ * @author Jordan
+ *Adds in extra names for items (No idea yet why anyone does this in such a fashion..)
+ */
+public enum ExtraOreDictNames {
+ buffer_core, itemGregConduit;
+
+public String unlocalisedName;
+
+private void ModObject() {
+ unlocalisedName = name();
+}
+
+} \ No newline at end of file
diff --git a/src/Java/miscutil/gregtech/api/enums/GregtechItemList.java b/src/Java/miscutil/gregtech/api/enums/GregtechItemList.java
new file mode 100644
index 0000000000..1a95d49441
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/enums/GregtechItemList.java
@@ -0,0 +1,171 @@
+package miscutil.gregtech.api.enums;
+
+import static gregtech.api.enums.GT_Values.W;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
+import miscutil.gregtech.api.interfaces.GregtechItemContainer;
+import net.minecraft.block.Block;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.Fluid;
+
+/**
+ * Class containing all non-OreDict Items of GregTech.
+ */
+public enum GregtechItemList implements GregtechItemContainer {
+
+ Credit_Copper,
+ Credit_Iron,
+ Credit_Silver,
+ Credit_Gold,
+ Credit_Platinum,
+ Credit_Osmium,
+ Credit_Greg_Copper,
+ Credit_Greg_Cupronickel,
+ Credit_Greg_Silver,
+ Credit_Greg_Gold,
+ Credit_Greg_Platinum,
+ Credit_Greg_Osmium,
+ Credit_Greg_Naquadah,
+ Energy_Buffer_CREATIVE,
+
+ //Energy Buffers
+ Energy_Buffer_1by1_ULV, Energy_Buffer_1by1_LV, Energy_Buffer_1by1_MV, Energy_Buffer_1by1_HV, Energy_Buffer_1by1_EV, Energy_Buffer_1by1_IV, Energy_Buffer_1by1_LuV, Energy_Buffer_1by1_ZPM, Energy_Buffer_1by1_UV, Energy_Buffer_1by1_MAX,
+
+ //Cobble Generators
+ Cobble_Generator_ULV, Cobble_Generator_LV, Cobble_Generator_MV, Cobble_Generator_HV, Cobble_Generator_EV, Cobble_Generator_IV, Cobble_Generator_LuV, Cobble_Generator_ZPM, Cobble_Generator_UV, Cobble_Generator_MAX,
+
+ //The max Steam condenser
+ Condensor_MAX,
+
+ //Player owned Safes
+ GT_Safe_ULV, GT_Safe_LV, GT_Safe_MV, GT_Safe_HV, GT_Safe_EV, GT_Safe_IV, GT_Safe_LuV, GT_Safe_ZPM, GT_Safe_UV, GT_Safe_MAX,
+
+ //IronBlastFurnace Machine_Bronze_BlastFurnace
+ Machine_Iron_BlastFurnace, Casing_IronPlatedBricks,
+
+ //Machine Casings
+ Casing_Shielding, Casing_Centrifuge1, Casing_Centrifuge2,
+
+ //Large Centrifuge
+ Industrial_Centrifuge;
+
+ public static final GregtechItemList[]
+ DYE_ONLY_ITEMS = {
+ Energy_Buffer_1by1_EV, Energy_Buffer_1by1_EV };
+ private ItemStack mStack;
+ private boolean mHasNotBeenSet = true;
+
+ public static Fluid sOilExtraHeavy, sOilHeavy, sOilMedium, sOilLight, sNaturalGas;
+
+ @Override
+ public GregtechItemList set(Item aItem) {
+ mHasNotBeenSet = false;
+ if (aItem == null) return this;
+ ItemStack aStack = new ItemStack(aItem, 1, 0);
+ mStack = GT_Utility.copyAmount(1, aStack);
+ return this;
+ }
+
+ @Override
+ public GregtechItemList set(ItemStack aStack) {
+ mHasNotBeenSet = false;
+ mStack = GT_Utility.copyAmount(1, aStack);
+ return this;
+ }
+
+ @Override
+ public Item getItem() {
+ if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
+ if (GT_Utility.isStackInvalid(mStack)) return null;
+ return mStack.getItem();
+ }
+
+ @Override
+ public Block getBlock() {
+ if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
+ return GT_Utility.getBlockFromStack(getItem());
+ }
+
+ @Override
+ public final boolean hasBeenSet() {
+ return !mHasNotBeenSet;
+ }
+
+ @Override
+ public boolean isStackEqual(Object aStack) {
+ return isStackEqual(aStack, false, false);
+ }
+
+ @Override
+ public boolean isStackEqual(Object aStack, boolean aWildcard, boolean aIgnoreNBT) {
+ if (GT_Utility.isStackInvalid(aStack)) return false;
+ return GT_Utility.areUnificationsEqual((ItemStack)aStack, aWildcard?getWildcard(1):get(1), aIgnoreNBT);
+ }
+
+ @Override
+ public ItemStack get(long aAmount, Object... aReplacements) {
+ if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
+ if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
+ return GT_Utility.copyAmount(aAmount, GT_OreDictUnificator.get(mStack));
+ }
+
+ @Override
+ public ItemStack getWildcard(long aAmount, Object... aReplacements) {
+ if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
+ if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
+ return GT_Utility.copyAmountAndMetaData(aAmount, W, GT_OreDictUnificator.get(mStack));
+ }
+
+ @Override
+ public ItemStack getUndamaged(long aAmount, Object... aReplacements) {
+ if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
+ if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
+ return GT_Utility.copyAmountAndMetaData(aAmount, 0, GT_OreDictUnificator.get(mStack));
+ }
+
+ @Override
+ public ItemStack getAlmostBroken(long aAmount, Object... aReplacements) {
+ if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
+ if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
+ return GT_Utility.copyAmountAndMetaData(aAmount, mStack.getMaxDamage()-1, GT_OreDictUnificator.get(mStack));
+ }
+
+ @Override
+ public ItemStack getWithName(long aAmount, String aDisplayName, Object... aReplacements) {
+ ItemStack rStack = get(1, aReplacements);
+ if (GT_Utility.isStackInvalid(rStack)) return null;
+ rStack.setStackDisplayName(aDisplayName);
+ return GT_Utility.copyAmount(aAmount, rStack);
+ }
+
+ @Override
+ public ItemStack getWithCharge(long aAmount, int aEnergy, Object... aReplacements) {
+ ItemStack rStack = get(1, aReplacements);
+ if (GT_Utility.isStackInvalid(rStack)) return null;
+ GT_ModHandler.chargeElectricItem(rStack, aEnergy, Integer.MAX_VALUE, true, false);
+ return GT_Utility.copyAmount(aAmount, rStack);
+ }
+
+ @Override
+ public ItemStack getWithDamage(long aAmount, long aMetaValue, Object... aReplacements) {
+ if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
+ if (GT_Utility.isStackInvalid(mStack)) return GT_Utility.copyAmount(aAmount, aReplacements);
+ return GT_Utility.copyAmountAndMetaData(aAmount, aMetaValue, GT_OreDictUnificator.get(mStack));
+ }
+
+ @Override
+ public GregtechItemList registerOre(Object... aOreNames) {
+ if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
+ for (Object tOreName : aOreNames) GT_OreDictUnificator.registerOre(tOreName, get(1));
+ return this;
+ }
+
+ @Override
+ public GregtechItemList registerWildcardAsOre(Object... aOreNames) {
+ if (mHasNotBeenSet) throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
+ for (Object tOreName : aOreNames) GT_OreDictUnificator.registerOre(tOreName, getWildcard(1));
+ return this;
+ }
+} \ No newline at end of file
diff --git a/src/Java/miscutil/gregtech/api/enums/GregtechTextures.java b/src/Java/miscutil/gregtech/api/enums/GregtechTextures.java
new file mode 100644
index 0000000000..40c3cb7f4e
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/enums/GregtechTextures.java
@@ -0,0 +1,127 @@
+package miscutil.gregtech.api.enums;
+
+import static gregtech.api.enums.GT_Values.RES_PATH_BLOCK;
+import gregtech.api.GregTech_API;
+import gregtech.api.interfaces.IIconContainer;
+import gregtech.api.interfaces.ITexture;
+import net.minecraft.client.renderer.texture.TextureMap;
+import net.minecraft.util.IIcon;
+import net.minecraft.util.ResourceLocation;
+
+public class GregtechTextures {
+ public enum BlockIcons implements IIconContainer, Runnable {
+
+
+ LARGECENTRIFUGE_TI1, LARGECENTRIFUGE_TI2, LARGECENTRIFUGE_TI3, LARGECENTRIFUGE_TI4, LARGECENTRIFUGE_TI5,
+ LARGECENTRIFUGE_TI6, LARGECENTRIFUGE_TI7, LARGECENTRIFUGE_TI8, LARGECENTRIFUGE_TI9,
+ LARGECENTRIFUGE_TI_ACTIVE1, LARGECENTRIFUGE_TI_ACTIVE2, LARGECENTRIFUGE_TI_ACTIVE3, LARGECENTRIFUGE_TI_ACTIVE4,
+ LARGECENTRIFUGE_TI_ACTIVE5, LARGECENTRIFUGE_TI_ACTIVE6, LARGECENTRIFUGE_TI_ACTIVE7, LARGECENTRIFUGE_TI_ACTIVE8, LARGECENTRIFUGE_TI_ACTIVE9,
+
+ LARGECENTRIFUGE_TU1, LARGECENTRIFUGE_TU2, LARGECENTRIFUGE_TU3, LARGECENTRIFUGE_TU4, LARGECENTRIFUGE_TU5,
+ LARGECENTRIFUGE_TU6, LARGECENTRIFUGE_TU7, LARGECENTRIFUGE_TU8, LARGECENTRIFUGE_TU9,
+ LARGECENTRIFUGE_TU_ACTIVE1, LARGECENTRIFUGE_TU_ACTIVE2, LARGECENTRIFUGE_TU_ACTIVE3, LARGECENTRIFUGE_TU_ACTIVE4, LARGECENTRIFUGE_TU_ACTIVE5,
+ LARGECENTRIFUGE_TU_ACTIVE6, LARGECENTRIFUGE_TU_ACTIVE7, LARGECENTRIFUGE_TU_ACTIVE8, LARGECENTRIFUGE_TU_ACTIVE9;
+
+ public static final IIconContainer[]
+
+ CENTRIFUGE1 = new IIconContainer[]{
+ LARGECENTRIFUGE_TI1,
+ LARGECENTRIFUGE_TI2,
+ LARGECENTRIFUGE_TI3,
+ LARGECENTRIFUGE_TI4,
+ LARGECENTRIFUGE_TI5,
+ LARGECENTRIFUGE_TI6,
+ LARGECENTRIFUGE_TI7,
+ LARGECENTRIFUGE_TI8,
+ LARGECENTRIFUGE_TI9
+ },
+ CENTRIFUGE_ACTIVE1 = new IIconContainer[]{
+ LARGECENTRIFUGE_TI_ACTIVE1,
+ LARGECENTRIFUGE_TI_ACTIVE2,
+ LARGECENTRIFUGE_TI_ACTIVE3,
+ LARGECENTRIFUGE_TI_ACTIVE4,
+ LARGECENTRIFUGE_TI_ACTIVE5,
+ LARGECENTRIFUGE_TI_ACTIVE6,
+ LARGECENTRIFUGE_TI_ACTIVE7,
+ LARGECENTRIFUGE_TI_ACTIVE8,
+ LARGECENTRIFUGE_TI_ACTIVE9
+ },
+ CENTRIFUGE2 = new IIconContainer[]{
+ LARGECENTRIFUGE_TU1,
+ LARGECENTRIFUGE_TU2,
+ LARGECENTRIFUGE_TU3,
+ LARGECENTRIFUGE_TU4,
+ LARGECENTRIFUGE_TU5,
+ LARGECENTRIFUGE_TU6,
+ LARGECENTRIFUGE_TU7,
+ LARGECENTRIFUGE_TU8,
+ LARGECENTRIFUGE_TU9
+ },
+ CENTRIFUGE_ACTIVE2 = new IIconContainer[]{
+ LARGECENTRIFUGE_TU_ACTIVE1,
+ LARGECENTRIFUGE_TU_ACTIVE2,
+ LARGECENTRIFUGE_TU_ACTIVE3,
+ LARGECENTRIFUGE_TU_ACTIVE4,
+ LARGECENTRIFUGE_TU_ACTIVE5,
+ LARGECENTRIFUGE_TU_ACTIVE6,
+ LARGECENTRIFUGE_TU_ACTIVE7,
+ LARGECENTRIFUGE_TU_ACTIVE8,
+ LARGECENTRIFUGE_TU_ACTIVE9
+ };
+
+ public static ITexture[]
+ GT_CASING_BLOCKS = new ITexture[64];
+
+ protected IIcon mIcon;
+
+ @Override
+ public IIcon getIcon() {
+ return mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return null;
+ }
+
+ @Override
+ public void run() {
+ mIcon = GregTech_API.sBlockIcons.registerIcon(RES_PATH_BLOCK + "iconsets/" + this);
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationBlocksTexture;
+ }
+
+ public static class CustomIcon implements IIconContainer, Runnable {
+ protected IIcon mIcon;
+ protected String mIconName;
+
+ public CustomIcon(String aIconName) {
+ mIconName = aIconName;
+ 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(RES_PATH_BLOCK + mIconName);
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationBlocksTexture;
+ }
+ }
+}}
+
diff --git a/src/Java/miscutil/gregtech/api/gui/CONTAINER_IronBlastFurnace.java b/src/Java/miscutil/gregtech/api/gui/CONTAINER_IronBlastFurnace.java
new file mode 100644
index 0000000000..3015e43f2a
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/gui/CONTAINER_IronBlastFurnace.java
@@ -0,0 +1,31 @@
+package miscutil.gregtech.api.gui;
+
+import gregtech.api.gui.GT_ContainerMetaTile_Machine;
+import gregtech.api.gui.GT_Slot_Output;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Slot;
+
+public class CONTAINER_IronBlastFurnace extends GT_ContainerMetaTile_Machine {
+ public CONTAINER_IronBlastFurnace(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ @Override
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ addSlotToContainer(new Slot(this.mTileEntity, 0, 34, 16));
+ addSlotToContainer(new Slot(this.mTileEntity, 1, 34, 34));
+ addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 2, 86, 25));
+ addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 3, 104, 25));
+ }
+
+ @Override
+ public int getSlotCount() {
+ return 4;
+ }
+
+ @Override
+ public int getShiftClickSlotCount() {
+ return 2;
+ }
+}
diff --git a/src/Java/miscutil/gregtech/api/gui/CONTAINER_SafeBlock.java b/src/Java/miscutil/gregtech/api/gui/CONTAINER_SafeBlock.java
new file mode 100644
index 0000000000..a805585a49
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/gui/CONTAINER_SafeBlock.java
@@ -0,0 +1,120 @@
+package miscutil.gregtech.api.gui;
+
+import gregtech.api.gui.GT_ContainerMetaTile_Machine;
+import gregtech.api.gui.GT_Slot_Holo;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import miscutil.core.util.PlayerCache;
+import miscutil.gregtech.api.metatileentity.implementations.GregtechMetaSafeBlock;
+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_SafeBlock
+extends GT_ContainerMetaTile_Machine {
+ public CONTAINER_SafeBlock(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ //public String UUID = ((BaseMetaTileEntity)mTileEntity).getMetaTileEntity().getBaseMetaTileEntity().getOwnerName();
+ public String ownerUUID = ((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()).ownerUUID;
+ public String tempPlayer = PlayerCache.lookupPlayerByUUID(ownerUUID);
+ public boolean blockStatus = ((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()).bUnbreakable;
+
+ @Override
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ for (int y = 0; y < 3; y++) {
+ for (int x = 0; x < 9; x++) {
+ addSlotToContainer(new Slot(this.mTileEntity, x + y * 9, 8 + x * 18, 5 + y * 18));
+ }
+ }
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 8, 63, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 26, 63, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 44, 63, false, true, 1));
+ }
+
+ @Override
+ public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
+ int runs = 0;
+ if (aSlotIndex < 27) {
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+ Slot tSlot = (Slot) this.inventorySlots.get(aSlotIndex);
+ if (tSlot != null) {
+ if (this.mTileEntity.getMetaTileEntity() == null) {
+ return null;
+ }
+ if (aSlotIndex == 27) {
+
+
+ /*((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bOutput = (!((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bOutput);
+ if (((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bOutput) {
+ if (aPlayer != null && aPlayer instanceof EntityPlayerMP && (((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()).bOutput != false)) {
+
+ Utils.LOG_INFO(String.valueOf(Sys.is64Bit()));
+ Utils.messagePlayer(aPlayer, "Salmon");
+ }
+
+ GT_Utility.sendChatToPlayer(aPlayer, "Emit Energy to Outputside");
+ } else {
+ GT_Utility.sendChatToPlayer(aPlayer, "Don't emit Energy");
+ }
+ return null;*/
+
+
+ }
+ if (aSlotIndex == 28) {}
+ /* ((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull = (!((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull);
+ if (((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull) {
+ GT_Utility.sendChatToPlayer(aPlayer, "Emit Redstone if no Slot is free");
+ } else {
+ GT_Utility.sendChatToPlayer(aPlayer, "Don't emit Redstone");
+ }
+ return null;
+ }*/
+ if (aSlotIndex == 29) /*{
+ if (((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable) {
+ if (((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable) {
+ makeIndestructible(aPlayer);
+ }
+ else {
+
+ }
+ } else {
+ makeIndestructible(aPlayer);
+ }
+ return null;
+ }*/
+
+ {
+ ((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable = (!((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable);
+ blockStatus = ((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()).bUnbreakable;
+ ownerUUID = ((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()).ownerUUID;
+ //Utils.messagePlayer(aPlayer, "Is the safe locked? "+String.valueOf(((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable).toUpperCase());
+ /*if (aPlayer != null && aPlayer instanceof EntityPlayerMP && (((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()).bUnbreakable != false)) {
+ UnbreakableBlockManager Xasda = new UnbreakableBlockManager();
+ Xasda.setmTileEntity((BaseMetaTileEntity) mTileEntity, aPlayer);
+ }
+ else {
+ UnbreakableBlockManager Xasda = new UnbreakableBlockManager();
+ Xasda.setmTileEntity((BaseMetaTileEntity) mTileEntity, aPlayer);
+ }*/
+ return null;
+ }
+
+
+ }
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+
+ @Override
+ public int getSlotCount() {
+ return 27;
+ }
+
+ @Override
+ public int getShiftClickSlotCount() {
+ return 27;
+ }
+
+}
diff --git a/src/Java/miscutil/gregtech/api/gui/CONTAINER_SteamCondenser.java b/src/Java/miscutil/gregtech/api/gui/CONTAINER_SteamCondenser.java
new file mode 100644
index 0000000000..9a283b8de3
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/gui/CONTAINER_SteamCondenser.java
@@ -0,0 +1,97 @@
+package miscutil.gregtech.api.gui;
+
+import gregtech.api.gui.GT_ContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+
+import java.util.Iterator;
+
+import miscutil.gregtech.api.metatileentity.implementations.base.GregtechMetaBoilerBase;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.ICrafting;
+import net.minecraft.inventory.Slot;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class CONTAINER_SteamCondenser extends GT_ContainerMetaTile_Machine
+{
+ public CONTAINER_SteamCondenser(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, int aSteamCapacity)
+ {
+ super(aInventoryPlayer, aTileEntity);
+ this.mSteamCapacity = aSteamCapacity;
+ }
+
+ @Override
+public void addSlots(InventoryPlayer aInventoryPlayer)
+ {
+ addSlotToContainer(new Slot(this.mTileEntity, 2, 116, 62));
+ addSlotToContainer(new Slot(this.mTileEntity, 0, 44, 26));
+ addSlotToContainer(new Slot(this.mTileEntity, 1, 44, 62));
+ addSlotToContainer(new Slot(this.mTileEntity, 3, 116, 26));
+ }
+
+ @Override
+public int getSlotCount()
+ {
+ return 4;
+ }
+
+ @Override
+public int getShiftClickSlotCount()
+ {
+ return 1;
+ }
+
+ public int mWaterAmount = 0;
+ public int mSteamAmount = 0;
+ public int mProcessingEnergy = 0;
+ public int mTemperature = 2;
+ private final int mSteamCapacity;
+ public long mTickingTime = ((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).RI;
+
+ @Override
+public void detectAndSendChanges()
+ {
+ super.detectAndSendChanges();
+ if ((this.mTileEntity.isClientSide()) || (this.mTileEntity.getMetaTileEntity() == null)) {
+ return;
+ }
+ this.mTemperature = ((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).mTemperature;
+ this.mProcessingEnergy = ((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).mProcessingEnergy;
+ this.mSteamAmount = (((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).mSteam == null ? 0 : ((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).mSteam.amount);
+ this.mWaterAmount = (((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).mFluid == null ? 0 : ((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).mFluid.amount);
+ this.mTickingTime = ((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).RI;
+
+ this.mTemperature = Math.min(54, Math.max(0, this.mTemperature * 54 / (((GregtechMetaBoilerBase)this.mTileEntity.getMetaTileEntity()).maxProgresstime() - 10)));
+ this.mSteamAmount = Math.min(54, Math.max(0, this.mSteamAmount * 54 / (this.mSteamCapacity - 100)));
+ this.mWaterAmount = Math.min(54, Math.max(0, this.mWaterAmount * 54 / 15900));
+ this.mProcessingEnergy = Math.min(14, Math.max(this.mProcessingEnergy > 0 ? 1 : 0, this.mProcessingEnergy * 14 / 1000));
+
+ Iterator var2 = this.crafters.iterator();
+ while (var2.hasNext())
+ {
+ ICrafting var1 = (ICrafting)var2.next();
+ var1.sendProgressBarUpdate(this, 100, this.mTemperature);
+ var1.sendProgressBarUpdate(this, 101, this.mProcessingEnergy);
+ var1.sendProgressBarUpdate(this, 102, this.mSteamAmount);
+ var1.sendProgressBarUpdate(this, 103, this.mWaterAmount);
+ }
+ }
+
+ @Override
+@SideOnly(Side.CLIENT)
+ public void updateProgressBar(int par1, int par2)
+ {
+ super.updateProgressBar(par1, par2);
+ switch (par1)
+ {
+ case 100:
+ this.mTemperature = par2; break;
+ case 101:
+ this.mProcessingEnergy = par2; break;
+ case 102:
+ this.mSteamAmount = par2; break;
+ case 103:
+ this.mWaterAmount = par2;
+ }
+ }
+} \ No newline at end of file
diff --git a/src/Java/miscutil/gregtech/api/gui/GUI_IronBlastFurnace.java b/src/Java/miscutil/gregtech/api/gui/GUI_IronBlastFurnace.java
new file mode 100644
index 0000000000..6f8c42cbaa
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/gui/GUI_IronBlastFurnace.java
@@ -0,0 +1,30 @@
+package miscutil.gregtech.api.gui;
+
+import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import miscutil.core.lib.CORE;
+import net.minecraft.entity.player.InventoryPlayer;
+
+public class GUI_IronBlastFurnace
+ extends GT_GUIContainerMetaTile_Machine {
+ public GUI_IronBlastFurnace(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(new CONTAINER_IronBlastFurnace(aInventoryPlayer, aTileEntity), CORE.MODID+":textures/gui/IronBlastFurnace.png");
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ this.fontRendererObj.drawString("Iron Blast Furnace", 8, 4, 4210752);
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ int x = (this.width - this.xSize) / 2;
+ int y = (this.height - this.ySize) / 2;
+ drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ if ((this.mContainer != null) &&
+ (this.mContainer.mProgressTime > 0)) {
+ drawTexturedModalRect(x + 58, y + 28, 176, 0, Math.max(0, Math.min(20, (this.mContainer.mProgressTime > 0 ? 1 : 0) + this.mContainer.mProgressTime * 20 / (this.mContainer.mMaxProgressTime < 1 ? 1 : this.mContainer.mMaxProgressTime))), 11);
+ }
+ }
+}
diff --git a/src/Java/miscutil/gregtech/api/gui/GUI_SafeBlock.java b/src/Java/miscutil/gregtech/api/gui/GUI_SafeBlock.java
new file mode 100644
index 0000000000..165e4cb6ea
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/gui/GUI_SafeBlock.java
@@ -0,0 +1,49 @@
+package miscutil.gregtech.api.gui;
+
+import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import miscutil.core.lib.CORE;
+import net.minecraft.entity.player.InventoryPlayer;
+
+public class GUI_SafeBlock
+ extends GT_GUIContainerMetaTile_Machine {
+ public GUI_SafeBlock(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(new CONTAINER_SafeBlock(aInventoryPlayer, aTileEntity), CORE.MODID + ":" + "textures/gui/" + "SafeBlock.png");
+ }
+
+ //String UUID = ((CONTAINER_SafeBlock)this.mContainer).ownerUUID.toString();
+ boolean blockStatus = ((CONTAINER_SafeBlock)this.mContainer).blockStatus;
+ //String tempPlayer;
+
+ private void updateVars(){
+ //UUID = ((CONTAINER_SafeBlock)this.mContainer).ownerUUID;
+ blockStatus = ((CONTAINER_SafeBlock)this.mContainer).blockStatus;
+ // tempPlayer = PlayerCache.lookupPlayerByUUID(UUID);
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(int par1, int par2)
+ {
+ updateVars();
+ //this.fontRendererObj.drawString("Owner: "+ tempPlayer, 64, 72, 4210752);
+ //this.fontRendererObj.drawString(": "+ UUID.toLowerCase(), 44, 82, 4210752);
+ this.fontRendererObj.drawString("Safe Status", 76, 61, 4210752);
+ if (blockStatus){
+ this.fontRendererObj.drawString("Locked", 88, 73, 4210752);
+ }
+ else {
+ this.fontRendererObj.drawString("Unlocked", 82, 73, 4210752);
+ }
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ int x = (this.width - this.xSize) / 2;
+ int y = (this.height - this.ySize) / 2;
+ drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ /*String UUID = ((CONTAINER_SafeBlock)this.mContainer).UUID;
+ this.fontRendererObj.drawString("Owner UUID: "+ UUID, 8, 12, 4210752);*/
+
+ }
+}
diff --git a/src/Java/miscutil/gregtech/api/gui/GUI_SteamCondenser.java b/src/Java/miscutil/gregtech/api/gui/GUI_SteamCondenser.java
new file mode 100644
index 0000000000..1c125e86fd
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/gui/GUI_SteamCondenser.java
@@ -0,0 +1,55 @@
+package miscutil.gregtech.api.gui;
+
+import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import miscutil.core.lib.CORE;
+import net.minecraft.entity.player.InventoryPlayer;
+
+public class GUI_SteamCondenser extends GT_GUIContainerMetaTile_Machine
+{
+ long tickTime = 0;
+
+ public GUI_SteamCondenser(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aTextureName, int aSteamCapacity)
+ {
+ super(new CONTAINER_SteamCondenser(aInventoryPlayer, aTileEntity, aSteamCapacity), CORE.MODID + ":" + "textures/gui/" + aTextureName);
+ }
+
+ @Override
+protected void drawGuiContainerForegroundLayer(int par1, int par2)
+ {
+ this.fontRendererObj.drawString("Condenser", 8, 4, 4210752);
+ if (!CORE.DEBUG){
+ tickTime = ((CONTAINER_SteamCondenser)this.mContainer).mTickingTime;
+ this.fontRendererObj.drawString("Tick Time: "+tickTime, 8, 12, 4210752);
+ }
+ }
+
+ @Override
+protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
+ {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ int x = (this.width - this.xSize) / 2;
+ int y = (this.height - this.ySize) / 2;
+ drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ if (this.mContainer != null)
+ {
+
+ int tScale = ((CONTAINER_SteamCondenser)this.mContainer).mSteamAmount;
+ if (tScale > 0) {
+ drawTexturedModalRect(x + 70, y + 25 + 54 - tScale, 194, 54 - tScale, 10, tScale);
+ }
+ tScale = ((CONTAINER_SteamCondenser)this.mContainer).mWaterAmount;
+ if (tScale > 0) {
+ drawTexturedModalRect(x + 83, y + 25 + 54 - tScale, 204, 54 - tScale, 10, tScale);
+ }
+ tScale = ((CONTAINER_SteamCondenser)this.mContainer).mTemperature;
+ if (tScale > 0) {
+ drawTexturedModalRect(x + 96, y + 25 + 54 - tScale, 214, 54 - tScale, 10, tScale);
+ }
+ tScale = ((CONTAINER_SteamCondenser)this.mContainer).mProcessingEnergy;
+ if (tScale > 0) {
+ drawTexturedModalRect(x + 115, y + 44 + 2/* - tScale*/, 177, 14 - tScale, 15, 1+tScale);
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/src/Java/miscutil/gregtech/api/init/InitGregtech.java b/src/Java/miscutil/gregtech/api/init/InitGregtech.java
new file mode 100644
index 0000000000..1507405f0c
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/init/InitGregtech.java
@@ -0,0 +1,31 @@
+package miscutil.gregtech.api.init;
+
+import static miscutil.core.lib.LoadedMods.Gregtech;
+import miscutil.core.util.Utils;
+import miscutil.gregtech.api.init.machines.GregtechConduits;
+import miscutil.gregtech.api.init.machines.GregtechEnergyBuffer;
+import miscutil.gregtech.api.init.machines.GregtechSafeBlock;
+import miscutil.gregtech.api.init.machines.GregtechSteamCondenser;
+
+public class InitGregtech {
+
+ public static void run() {
+ if (Gregtech) {
+ Utils.LOG_INFO("MiscUtils: Gregtech5u Content | Registering Meta-TileEntities.");
+ }
+
+
+
+ /***
+ * Load up Blocks classes
+ ***/
+
+ // Machines
+ // GregtechCobbleGenerator.run(); TODO - Weird Textures
+ GregtechEnergyBuffer.run();
+ GregtechConduits.run();
+ GregtechSteamCondenser.run();
+ GregtechSafeBlock.run();
+
+ }
+}
diff --git a/src/Java/miscutil/gregtech/api/init/machines/GregtechCobbleGenerator.java b/src/Java/miscutil/gregtech/api/init/machines/GregtechCobbleGenerator.java
new file mode 100644
index 0000000000..3b6d0834a1
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/init/machines/GregtechCobbleGenerator.java
@@ -0,0 +1,51 @@
+package miscutil.gregtech.api.init.machines;
+
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OreDictNames;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.util.GT_ModHandler;
+import miscutil.gregtech.api.enums.GregtechItemList;
+import miscutil.gregtech.api.metatileentity.implementations.base.GregtechSteelBoiler;
+import cpw.mods.fml.common.FMLLog;
+
+public class GregtechCobbleGenerator
+{
+ public static void run()
+ {
+ if (miscutil.core.lib.LoadedMods.Gregtech){
+ FMLLog.info("MiscUtils: Registering Cobblestone Powered Engines.");
+ run1();
+ }
+
+ }
+
+ private static void run1()
+ {
+ //Cobble Generators
+ // ItemList.Machine_Steel_Boiler.set(new GT_MetaTileEntity_Boiler_Steel(101, "boiler.steel", "High Pressure Coal Boiler").getStackForm(1L));
+ // GT_ModHandler.addCraftingRecipe(ItemList.Machine_Steel_Boiler.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "PPP", "P P", "BFB", Character.valueOf('F'), OreDictNames.craftingFurnace, Character.valueOf('P'), OrePrefixes.plate.get(Materials.Steel), Character.valueOf('B'), new ItemStack(Blocks.brick_block, 1) });
+
+ GregtechItemList.Cobble_Generator_ULV.set(new GregtechSteelBoiler(760, "CobGen.01.tier.00", "Ultra Low Voltage Cobblestone Generator", 0, "You're shit.").getStackForm(1L));
+ GregtechItemList.Cobble_Generator_LV.set(new GregtechSteelBoiler(761, "CobGen.01.tier.01", "Low Voltage Cobblestone Generator", 1, "Still Pretty garbage, bro.").getStackForm(1L));
+ GregtechItemList.Cobble_Generator_MV.set(new GregtechSteelBoiler(762, "CobGen.01.tier.02", "Medium Voltage Cobblestone Generator", 2, "Testy Test.").getStackForm(1L));
+ GregtechItemList.Cobble_Generator_HV.set(new GregtechSteelBoiler(763, "CobGen.01.tier.03", "High Voltage Cobblestone Generator", 3, "").getStackForm(1L));
+ GregtechItemList.Cobble_Generator_EV.set(new GregtechSteelBoiler(764, "CobGen.01.tier.04", "Extreme Voltage Cobblestone Generator", 4, "").getStackForm(1L));
+ GregtechItemList.Cobble_Generator_IV.set(new GregtechSteelBoiler(765, "CobGen.01.tier.05", "Insane Voltage Cobblestone Generator", 5, "").getStackForm(1L));
+ GregtechItemList.Cobble_Generator_LuV.set(new GregtechSteelBoiler(766, "CobGen.01.tier.06", "Ludicrous Voltage Cobblestone Generator", 6, "").getStackForm(1L));
+ GregtechItemList.Cobble_Generator_ZPM.set(new GregtechSteelBoiler(767, "CobGen.01.tier.07", "ZPM Voltage Cobblestone Generator", 7, "").getStackForm(1L));
+ GregtechItemList.Cobble_Generator_UV.set(new GregtechSteelBoiler(768, "CobGen.01.tier.08", "Ultimate Voltage Cobblestone Generator", 8, "").getStackForm(1L));
+ GregtechItemList.Cobble_Generator_MAX.set(new GregtechSteelBoiler(769, "CobGen.01.tier.09", "MAX Voltage Cobblestone Generator", 9, "").getStackForm(1L));
+
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Cobble_Generator_ULV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_ULV, Character.valueOf('W'), OrePrefixes.wireGt04.get(Materials.Lead), Character.valueOf('T'), OreDictNames.craftingChest });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Cobble_Generator_LV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_LV, Character.valueOf('W'), OrePrefixes.wireGt04.get(Materials.Tin), Character.valueOf('T'), OreDictNames.craftingChest });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Cobble_Generator_MV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_MV, Character.valueOf('W'), OrePrefixes.wireGt04.get(Materials.AnyCopper), Character.valueOf('T'), OreDictNames.craftingChest });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Cobble_Generator_HV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_HV, Character.valueOf('W'), OrePrefixes.wireGt04.get(Materials.Gold), Character.valueOf('T'), OreDictNames.craftingChest });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Cobble_Generator_EV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_EV, Character.valueOf('W'), OrePrefixes.wireGt04.get(Materials.Aluminium), Character.valueOf('T'), OreDictNames.craftingChest });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Cobble_Generator_IV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_IV, Character.valueOf('W'), OrePrefixes.wireGt04.get(Materials.Tungsten), Character.valueOf('T'), OreDictNames.craftingChest });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Cobble_Generator_LuV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_LuV, Character.valueOf('W'), OrePrefixes.wireGt04.get(Materials.Osmium), Character.valueOf('T'), OreDictNames.craftingChest });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Cobble_Generator_ZPM.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_ZPM, Character.valueOf('W'), OrePrefixes.wireGt04.get(Materials.Osmium), Character.valueOf('T'), OreDictNames.craftingChest });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Cobble_Generator_UV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_UV, Character.valueOf('W'), OrePrefixes.wireGt04.get(Materials.Osmium), Character.valueOf('T'), OreDictNames.craftingChest });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Cobble_Generator_MAX.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_MAX, Character.valueOf('W'), OrePrefixes.wireGt04.get(Materials.Superconductor), Character.valueOf('T'), OreDictNames.craftingChest });
+ }
+}
diff --git a/src/Java/miscutil/gregtech/api/init/machines/GregtechConduits.java b/src/Java/miscutil/gregtech/api/init/machines/GregtechConduits.java
new file mode 100644
index 0000000000..318ff5f882
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/init/machines/GregtechConduits.java
@@ -0,0 +1,103 @@
+package miscutil.gregtech.api.init.machines;
+
+import static miscutil.core.lib.LoadedMods.Gregtech;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.util.GT_OreDictUnificator;
+import miscutil.core.lib.LoadedMods;
+import miscutil.core.util.Utils;
+import miscutil.gregtech.api.metatileentity.implementations.GregtechMetaPipeEntity_Cable;
+
+public class GregtechConduits {
+ /**
+ *
+ * The Voltage Tiers. Use this Array instead of the old named Voltage Variables
+ * public static final long[] V = new long[] {0=8, 1=32, 2=128, 3=512, 4=2048, 5=8192, 6=32768, 7=131072, 8=524288, 9=Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE};
+ *
+ */
+
+
+ public static void run()
+ {
+ if (Gregtech){
+ Utils.LOG_INFO("MiscUtils: Gregtech5u Content | Registering Custom Cables/Wire.");
+ run1();
+ }
+
+ }
+
+ private static void run1(){
+ if (LoadedMods.Big_Reactors){
+ wireFactory("Blutonium", 8196, 30600, 8, 32, 2);
+ wireFactory("Cyanite", 512, 30615, 2, 16, 4);
+ wireFactory("Yellorium", 2048, 30630, 4, 16, 2);
+ }
+ if (LoadedMods.EnderIO){
+ wireFactory("RedstoneAlloy", 32, 30645, 1, 4, 1);
+ }
+
+ }
+
+ private static void wireFactory(String Material, int Voltage, int ID, long insulatedLoss, long uninsulatedLoss, long Amps){
+ Materials T = Materials.valueOf(Material);
+ int V = 0;
+ if (Voltage == 8){
+ V = 0;
+ }
+ else if (Voltage == 32){
+ V = 1;
+ }
+ else if (Voltage == 128){
+ V = 2;
+ }
+ else if (Voltage == 512){
+ V = 3;
+ }
+ else if (Voltage == 2048){
+ V = 4;
+ }
+ else if (Voltage == 8196){
+ V = 5;
+ }
+ else if (Voltage == 32768){
+ V = 6;
+ }
+ else if (Voltage == 131072){
+ V = 7;
+ }
+ else if (Voltage == 524288){
+ V = 8;
+ }
+ else if (Voltage == Integer.MAX_VALUE){
+ V = 9;
+ }
+ else {
+ Utils.LOG_ERROR("Failed to set voltage on "+Material+". Invalid voltage of "+Voltage+"V set.");
+ Utils.LOG_ERROR(Material+" has defaulted to 8v.");
+ V = 0;
+ }
+ //makeWires(T, ID, 2L, 4L, 2L, GT_Values.V[V], true, false);
+ makeWires(T, ID, insulatedLoss, uninsulatedLoss, Amps, GT_Values.V[V], true, false);
+ //makeWires(T, ID, bEC ? 2L : 2L, bEC ? 4L : 4L, 2L, gregtech.api.enums.GT_Values.V[V], true, false);
+ }
+
+ private static void makeWires(Materials aMaterial, int aStartID, long aLossInsulated, long aLoss, long aAmperage, long aVoltage, boolean aInsulatable, boolean aAutoInsulated)
+ {
+ Utils.LOG_WARNING("MiscUtils: Gregtech5u Content | Registered "+aMaterial.name() +" as a new material for Wire & Cable.");
+ GT_OreDictUnificator.registerOre(OrePrefixes.wireGt01, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 0, "wire." + aMaterial.name().toLowerCase() + ".01", "1x " + aMaterial.mDefaultLocalName + " Wire", 0.125F, aMaterial, aLoss, 1L * aAmperage, aVoltage, false, !aAutoInsulated).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.wireGt02, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 1, "wire." + aMaterial.name().toLowerCase() + ".02", "2x " + aMaterial.mDefaultLocalName + " Wire", 0.25F, aMaterial, aLoss, 2L * aAmperage, aVoltage, false, !aAutoInsulated).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.wireGt04, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 2, "wire." + aMaterial.name().toLowerCase() + ".04", "4x " + aMaterial.mDefaultLocalName + " Wire", 0.375F, aMaterial, aLoss, 4L * aAmperage, aVoltage, false, !aAutoInsulated).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.wireGt08, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 3, "wire." + aMaterial.name().toLowerCase() + ".08", "8x " + aMaterial.mDefaultLocalName + " Wire", 0.5F, aMaterial, aLoss, 8L * aAmperage, aVoltage, false, !aAutoInsulated).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.wireGt12, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 4, "wire." + aMaterial.name().toLowerCase() + ".12", "12x " + aMaterial.mDefaultLocalName + " Wire", 0.75F, aMaterial, aLoss, 12L * aAmperage, aVoltage, false, !aAutoInsulated).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.wireGt16, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 5, "wire." + aMaterial.name().toLowerCase() + ".16", "16x " + aMaterial.mDefaultLocalName + " Wire", 1.0F, aMaterial, aLoss, 16L * aAmperage, aVoltage, false, !aAutoInsulated).getStackForm(1L));
+ if (aInsulatable)
+ {
+ GT_OreDictUnificator.registerOre(OrePrefixes.cableGt01, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 6, "cable." + aMaterial.name().toLowerCase() + ".01", "1x " + aMaterial.mDefaultLocalName + " Cable", 0.25F, aMaterial, aLossInsulated, 1L * aAmperage, aVoltage, true, false).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.cableGt02, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 7, "cable." + aMaterial.name().toLowerCase() + ".02", "2x " + aMaterial.mDefaultLocalName + " Cable", 0.375F, aMaterial, aLossInsulated, 2L * aAmperage, aVoltage, true, false).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.cableGt04, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 8, "cable." + aMaterial.name().toLowerCase() + ".04", "4x " + aMaterial.mDefaultLocalName + " Cable", 0.5F, aMaterial, aLossInsulated, 4L * aAmperage, aVoltage, true, false).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.cableGt08, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 9, "cable." + aMaterial.name().toLowerCase() + ".08", "8x " + aMaterial.mDefaultLocalName + " Cable", 0.75F, aMaterial, aLossInsulated, 8L * aAmperage, aVoltage, true, false).getStackForm(1L));
+ GT_OreDictUnificator.registerOre(OrePrefixes.cableGt12, aMaterial, new GregtechMetaPipeEntity_Cable(aStartID + 10, "cable." + aMaterial.name().toLowerCase() + ".12", "12x " + aMaterial.mDefaultLocalName + " Cable", 1.0F, aMaterial, aLossInsulated, 12L * aAmperage, aVoltage, true, false).getStackForm(1L));
+ }
+ }
+}
diff --git a/src/Java/miscutil/gregtech/api/init/machines/GregtechEnergyBuffer.java b/src/Java/miscutil/gregtech/api/init/machines/GregtechEnergyBuffer.java
new file mode 100644
index 0000000000..c54e9f9d76
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/init/machines/GregtechEnergyBuffer.java
@@ -0,0 +1,83 @@
+package miscutil.gregtech.api.init.machines;
+
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.util.GT_ModHandler;
+import miscutil.core.util.Utils;
+import miscutil.gregtech.api.enums.ExtraOreDictNames;
+import miscutil.gregtech.api.enums.GregtechItemList;
+import miscutil.gregtech.api.metatileentity.implementations.GregtechMetaCreativeEnergyBuffer;
+import miscutil.gregtech.api.metatileentity.implementations.GregtechMetaEnergyBuffer;
+
+public class GregtechEnergyBuffer
+{
+
+ //Misc Items
+ //public static Item itemBufferCore;
+
+ public static void run()
+ {
+ if (miscutil.core.lib.LoadedMods.Gregtech){
+ Utils.LOG_INFO("MiscUtils: Gregtech5u Content | Registering Energy Buffer Blocks.");
+ run1();
+ }
+
+ }
+
+ @SuppressWarnings("deprecation")
+ private static void run1()
+ {
+
+ //itemBufferCore = new Item().setUnlocalizedName("itemBufferCore").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemBufferCore");
+
+ //Registry
+ //GameRegistry.registerItem(itemBufferCore, "itemBufferCore");
+ //LanguageRegistry.addName(itemBufferCore, "Buffer Core");
+ //OreDictionary.registerOre("itemBufferCore", itemBufferCore);
+
+
+ //Energy Buffers
+ GregtechItemList.Energy_Buffer_1by1_ULV.set(new GregtechMetaEnergyBuffer(770, "energybuffer.01.tier.00", "Ultra Low Voltage Energy Buffer", 0, "", 1).getStackForm(1L));
+ GregtechItemList.Energy_Buffer_1by1_LV.set(new GregtechMetaEnergyBuffer(771, "energybuffer.01.tier.01", "Low Voltage Energy Buffer", 1, "", 1).getStackForm(1L));
+ GregtechItemList.Energy_Buffer_1by1_MV.set(new GregtechMetaEnergyBuffer(772, "energybuffer.01.tier.02", "Medium Voltage Energy Buffer", 2, "", 1).getStackForm(1L));
+ GregtechItemList.Energy_Buffer_1by1_HV.set(new GregtechMetaEnergyBuffer(773, "energybuffer.01.tier.03", "High Voltage Energy Buffer", 3, "", 1).getStackForm(1L));
+ GregtechItemList.Energy_Buffer_1by1_EV.set(new GregtechMetaEnergyBuffer(774, "energybuffer.01.tier.04", "Extreme Voltage Energy Buffer", 4, "", 1).getStackForm(1L));
+ GregtechItemList.Energy_Buffer_1by1_IV.set(new GregtechMetaEnergyBuffer(775, "energybuffer.01.tier.05", "Insane Voltage Energy Buffer", 5, "", 1).getStackForm(1L));
+ GregtechItemList.Energy_Buffer_1by1_LuV.set(new GregtechMetaEnergyBuffer(776, "energybuffer.01.tier.06", "Ludicrous Voltage Energy Buffer", 6, "", 1).getStackForm(1L));
+ GregtechItemList.Energy_Buffer_1by1_ZPM.set(new GregtechMetaEnergyBuffer(777, "energybuffer.01.tier.07", "ZPM Voltage Energy Buffer", 7, "", 1).getStackForm(1L));
+ GregtechItemList.Energy_Buffer_1by1_UV.set(new GregtechMetaEnergyBuffer(778, "energybuffer.01.tier.08", "Ultimate Voltage Energy Buffer", 8, "", 1).getStackForm(1L));
+ GregtechItemList.Energy_Buffer_1by1_MAX.set(new GregtechMetaEnergyBuffer(779, "energybuffer.01.tier.09", "MAX Voltage Energy Buffer", 9, "", 1).getStackForm(1L));
+ // Creative Buffer Has Special ID
+ GregtechItemList.Energy_Buffer_CREATIVE
+ .set(new GregtechMetaCreativeEnergyBuffer(750,
+ "energybuffer.01.tier.xx",
+ "512V Creative Energy Buffer", 3, "", 0)
+ .getStackForm(1L));
+
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_ULV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_ULV, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Lead), Character.valueOf('T'), ExtraOreDictNames.buffer_core });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_LV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_LV, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Tin), Character.valueOf('T'), ExtraOreDictNames.buffer_core });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_MV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_MV, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.AnyCopper), Character.valueOf('T'), ExtraOreDictNames.buffer_core });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_HV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_HV, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Gold), Character.valueOf('T'), ExtraOreDictNames.buffer_core });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_EV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_EV, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Aluminium), Character.valueOf('T'), ExtraOreDictNames.buffer_core });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_IV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_IV, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Tungsten), Character.valueOf('T'), ExtraOreDictNames.buffer_core });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_LuV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_LuV, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Osmium), Character.valueOf('T'), ExtraOreDictNames.buffer_core });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_ZPM.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_ZPM, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Osmium), Character.valueOf('T'), ExtraOreDictNames.buffer_core });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_UV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_UV, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Osmium), Character.valueOf('T'), ExtraOreDictNames.buffer_core });
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_MAX.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_MAX, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Superconductor), Character.valueOf('T'), ExtraOreDictNames.buffer_core });
+ /*GT_ModHandler.addCraftingRecipe(
+ GregtechItemList.Energy_Buffer_1by1_MAX.get(1L, new Object[0]),
+ GT_ModHandler.RecipeBits.DISMANTLEABLE
+ | GT_ModHandler.RecipeBits.NOT_REMOVABLE
+ | GT_ModHandler.RecipeBits.REVERSIBLE
+ | GT_ModHandler.RecipeBits.BUFFERED, new Object[] {
+ "WTW", "WMW", Character.valueOf('M'),
+ ItemList.Hull_MAX, Character.valueOf('W'),
+ OrePrefixes.wireGt08.get(Materials.Superconductor),
+ Character.valueOf('T'), ExtraOreDictNames.buffer_core });*/
+
+
+
+
+ }
+}
diff --git a/src/Java/miscutil/gregtech/api/init/machines/GregtechIndustrialCentrifuge.java b/src/Java/miscutil/gregtech/api/init/machines/GregtechIndustrialCentrifuge.java
new file mode 100644
index 0000000000..c6abfa8642
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/init/machines/GregtechIndustrialCentrifuge.java
@@ -0,0 +1,27 @@
+package miscutil.gregtech.api.init.machines;
+
+import miscutil.core.util.Utils;
+import miscutil.gregtech.api.enums.GregtechItemList;
+import miscutil.gregtech.api.metatileentity.implementations.GregtechMetaCondensor;
+
+public class GregtechIndustrialCentrifuge
+{
+
+
+
+ public static void run()
+ {
+ if (miscutil.core.lib.LoadedMods.Gregtech){
+ Utils.LOG_INFO("MiscUtils: Gregtech5u Content | Registering Industrial Centrifuge Multiblock.");
+ run1();
+ }
+
+ }
+
+ private static void run1()
+ {
+ //Industrial Centrifuge Multiblock
+ GregtechItemList.Industrial_Centrifuge.set(new GregtechMetaCondensor(790, "industrialcentrifuge.controller.tier.single", "Steam Condensor").getStackForm(1L));
+
+ }
+}
diff --git a/src/Java/miscutil/gregtech/api/init/machines/GregtechSafeBlock.java b/src/Java/miscutil/gregtech/api/init/machines/GregtechSafeBlock.java
new file mode 100644
index 0000000000..f580d5da3a
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/init/machines/GregtechSafeBlock.java
@@ -0,0 +1,53 @@
+package miscutil.gregtech.api.init.machines;
+
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OreDictNames;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.util.GT_ModHandler;
+import miscutil.core.util.Utils;
+import miscutil.gregtech.api.enums.GregtechItemList;
+import miscutil.gregtech.api.metatileentity.implementations.GregtechMetaSafeBlock;
+
+public class GregtechSafeBlock
+{
+ public static void run()
+ {
+ if (miscutil.core.lib.LoadedMods.Gregtech){
+ Utils.LOG_INFO("MiscUtils: Gregtech5u Content | Registering Lockable Safe Blocks.");
+ run1();
+ }
+
+ }
+
+ private static void run1()
+ {
+
+ GregtechItemList.GT_Safe_ULV.set(new GregtechMetaSafeBlock(780, "protection.playersafe.tier.00", "Ultra Low Voltage Player Safe", 0).getStackForm(1L));
+ GregtechItemList.GT_Safe_LV.set(new GregtechMetaSafeBlock(781, "protection.playersafe.tier.01", "Low Voltage Player Safe", 1).getStackForm(1L));
+ GregtechItemList.GT_Safe_MV.set(new GregtechMetaSafeBlock(782, "protection.playersafe.tier.02", "Medium Voltage Player Safe", 2).getStackForm(1L));
+ GregtechItemList.GT_Safe_HV.set(new GregtechMetaSafeBlock(783, "protection.playersafe.tier.03", "High Voltage Player Safe", 3).getStackForm(1L));
+ GregtechItemList.GT_Safe_EV.set(new GregtechMetaSafeBlock(784, "protection.playersafe.tier.04", "Extreme Voltage Player Safe", 4).getStackForm(1L));
+ GregtechItemList.GT_Safe_IV.set(new GregtechMetaSafeBlock(785, "protection.playersafe.tier.05", "Insane Voltage Player Safe", 5).getStackForm(1L));
+ GregtechItemList.GT_Safe_LuV.set(new GregtechMetaSafeBlock(786, "protection.playersafe.tier.06", "Ludicrous Voltage Player Safe", 6).getStackForm(1L));
+ GregtechItemList.GT_Safe_ZPM.set(new GregtechMetaSafeBlock(787, "protection.playersafe.tier.07", "ZPM Voltage Player Safe", 7).getStackForm(1L));
+ GregtechItemList.GT_Safe_UV.set(new GregtechMetaSafeBlock(788, "protection.playersafe.tier.08", "Ultimate Voltage Player Safe", 8).getStackForm(1L));
+ GregtechItemList.GT_Safe_MAX.set(new GregtechMetaSafeBlock(789, "protection.playersafe.tier.09", "MAX Voltage Player Safe", 9).getStackForm(1L));
+
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_ULV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"CMV", " X ", Character.valueOf('M'), ItemList.Hull_ULV, Character.valueOf('V'), ItemList.Circuit_Basic, Character.valueOf('C'), OreDictNames.craftingChest, Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Basic)});
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_LV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"CMV", " X ", Character.valueOf('M'), ItemList.Hull_LV, Character.valueOf('V'), ItemList.Circuit_Basic, Character.valueOf('C'), OreDictNames.craftingChest, Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Basic)});
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_MV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"CMV", " X ", Character.valueOf('M'), ItemList.Hull_MV, Character.valueOf('V'), ItemList.Circuit_Good, Character.valueOf('C'), OreDictNames.craftingChest, Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Basic)});
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_HV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"CMV", " X ", Character.valueOf('M'), ItemList.Hull_HV, Character.valueOf('V'), ItemList.Circuit_Good, Character.valueOf('C'), OreDictNames.craftingChest, Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Basic)});
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_EV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"CMV", " X ", Character.valueOf('M'), ItemList.Hull_EV, Character.valueOf('V'), ItemList.Circuit_Advanced, Character.valueOf('C'), OreDictNames.craftingChest, Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Basic)});
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_IV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"CMV", " X ", Character.valueOf('M'), ItemList.Hull_IV, Character.valueOf('V'), ItemList.Circuit_Advanced, Character.valueOf('C'), OreDictNames.craftingChest, Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Advanced)});
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_LuV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"CMV", " X ", Character.valueOf('M'), ItemList.Hull_LuV, Character.valueOf('V'), ItemList.Circuit_Elite, Character.valueOf('C'), OreDictNames.craftingChest, Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Advanced)});
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_ZPM.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"CMV", " X ", Character.valueOf('M'), ItemList.Hull_ZPM, Character.valueOf('V'), ItemList.Circuit_Elite, Character.valueOf('C'), OreDictNames.craftingChest, Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Advanced)});
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_UV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"CMV", " X ", Character.valueOf('M'), ItemList.Hull_UV, Character.valueOf('V'), ItemList.Circuit_Master, Character.valueOf('C'), OreDictNames.craftingChest, Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Advanced)});
+ GT_ModHandler.addCraftingRecipe(GregtechItemList.GT_Safe_MAX.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"CMV", " X ", Character.valueOf('M'), ItemList.Hull_MAX, Character.valueOf('V'), ItemList.Circuit_Master, Character.valueOf('C'), OreDictNames.craftingChest, Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Advanced)});
+
+
+
+
+
+ }
+}
diff --git a/src/Java/miscutil/gregtech/api/init/machines/GregtechSteamCondenser.java b/src/Java/miscutil/gregtech/api/init/machines/GregtechSteamCondenser.java
new file mode 100644
index 0000000000..ea7b8b0219
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/init/machines/GregtechSteamCondenser.java
@@ -0,0 +1,36 @@
+package miscutil.gregtech.api.init.machines;
+
+import miscutil.core.util.Utils;
+import miscutil.gregtech.api.enums.GregtechItemList;
+import miscutil.gregtech.api.metatileentity.implementations.GregtechMetaCondensor;
+import miscutil.gregtech.api.metatileentity.implementations.GregtechMetaTileEntityIronBlastFurnace;
+
+public class GregtechSteamCondenser
+{
+
+
+
+ public static void run()
+ {
+ if (miscutil.core.lib.LoadedMods.Gregtech){
+ Utils.LOG_INFO("MiscUtils: Gregtech5u Content | Registering Steam Condensor.");
+ run1();
+ }
+
+ }
+
+ private static void run1()
+ {
+ //Steam Condensors
+ GregtechItemList.Condensor_MAX.set(new GregtechMetaCondensor(769, "steamcondensor.01.tier.single", "Steam Condensor").getStackForm(1L));
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Condensor_MAX.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_HV, Character.valueOf('W'),OrePrefixes.wireGt04.get(Materials.ElectricalSteel),Character.valueOf('T'), ItemList.Electric_Pump_MV });
+
+
+ GregtechItemList.Machine_Iron_BlastFurnace.set(new GregtechMetaTileEntityIronBlastFurnace(768, "ironmachine.blastfurnace", "Iron Plated Blast Furnace").getStackForm(1L));
+
+ //ItemUtils.recipeBuilder(slot_1, slot_2, slot_3, slot_4, slot_5, slot_6, slot_7, slot_8, slot_9, resultItem);
+
+ //GT_ModHandler.addCraftingRecipe(ItemList.Machine_Bronze_BlastFurnace.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PFP", "FwF", "PFP", Character.valueOf('P'), OrePrefixes.plate.get(Materials.Bronze), Character.valueOf('F'), OreDictNames.craftingFurnace});
+
+ }
+}
diff --git a/src/Java/miscutil/gregtech/api/interfaces/GregtechItemContainer.java b/src/Java/miscutil/gregtech/api/interfaces/GregtechItemContainer.java
new file mode 100644
index 0000000000..2f613006b7
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/interfaces/GregtechItemContainer.java
@@ -0,0 +1,24 @@
+package miscutil.gregtech.api.interfaces;
+
+import net.minecraft.block.Block;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+
+public interface GregtechItemContainer {
+ public Item getItem();
+ public Block getBlock();
+ public boolean isStackEqual(Object aStack);
+ public boolean isStackEqual(Object aStack, boolean aWildcard, boolean aIgnoreNBT);
+ public ItemStack get(long aAmount, Object... aReplacements);
+ public ItemStack getWildcard(long aAmount, Object... aReplacements);
+ public ItemStack getUndamaged(long aAmount, Object... aReplacements);
+ public ItemStack getAlmostBroken(long aAmount, Object... aReplacements);
+ public ItemStack getWithDamage(long aAmount, long aMetaValue, Object... aReplacements);
+ public GregtechItemContainer set(Item aItem);
+ public GregtechItemContainer set(ItemStack aStack);
+ public GregtechItemContainer registerOre(Object... aOreNames);
+ public GregtechItemContainer registerWildcardAsOre(Object... aOreNames);
+ public ItemStack getWithCharge(long aAmount, int aEnergy, Object... aReplacements);
+ public ItemStack getWithName(long aAmount, String aDisplayName, Object... aReplacements);
+ public boolean hasBeenSet();
+} \ No newline at end of file
diff --git a/src/Java/miscutil/gregtech/api/metatileentity/implementations/GregtechMetaCasingBlocks.java b/src/Java/miscutil/gregtech/api/metatileentity/implementations/GregtechMetaCasingBlocks.java
new file mode 100644
index 0000000000..e2587fffef
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/metatileentity/implementations/GregtechMetaCasingBlocks.java
@@ -0,0 +1,88 @@
+package miscutil.gregtech.api.metatileentity.implementations;
+
+import gregtech.api.enums.Textures;
+import gregtech.api.objects.GT_CopiedBlockTexture;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.common.blocks.GT_Block_Casings_Abstract;
+import gregtech.common.blocks.GT_Item_Casings1;
+import gregtech.common.blocks.GT_Material_Casings;
+import miscutil.gregtech.api.enums.GregtechItemList;
+import miscutil.gregtech.api.enums.GregtechTextures;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
+
+public class GregtechMetaCasingBlocks
+extends GT_Block_Casings_Abstract {
+ public GregtechMetaCasingBlocks() {
+ super(GT_Item_Casings1.class, "miscutils.blockcasings", GT_Material_Casings.INSTANCE);
+ for (byte i = 0; i < 16; i = (byte) (i + 1)) {
+ GregtechTextures.BlockIcons.GT_CASING_BLOCKS[i] = new GT_CopiedBlockTexture(this, 6, i);
+ }
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Centrifuge Anti-Vibration Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Centrifuge Casing");
+ //GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "MV Machine Casing");
+ //GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "HV Machine Casing");
+ //GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "EV Machine Casing");
+ //GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "IV Machine Casing");
+ //GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "LuV Machine Casing");
+ //GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "ZPM Machine Casing");
+ //GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "UV Machine Casing");
+ //GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "MAX Machine Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".10.name", "Iron Plated Bricks");
+ //GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Heat Proof Machine Casing");
+ //GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Cupronickel Coil Block");
+ //GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "Kanthal Coil Block");
+ //GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Nichrome Coil Block");
+ //GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "Superconducting Coil Block");
+ GregtechItemList.Casing_Centrifuge1.set(new ItemStack(this, 1, 0));
+ GregtechItemList.Casing_Centrifuge2.set(new ItemStack(this, 1, 1));
+ /*ItemList.Casing_MV.set(new ItemStack(this, 1, 2));
+ ItemList.Casing_HV.set(new ItemStack(this, 1, 3));
+ ItemList.Casing_EV.set(new ItemStack(this, 1, 4));
+ ItemList.Casing_IV.set(new ItemStack(this, 1, 5));
+ ItemList.Casing_LuV.set(new ItemStack(this, 1, 6));
+ ItemList.Casing_ZPM.set(new ItemStack(this, 1, 7));
+ ItemList.Casing_UV.set(new ItemStack(this, 1, 8));
+ ItemList.Casing_MAX.set(new ItemStack(this, 1, 9));*/
+ GregtechItemList.Casing_IronPlatedBricks.set(new ItemStack(this, 1, 10));
+ /*ItemList.Casing_HeatProof.set(new ItemStack(this, 1, 11));
+ ItemList.Casing_Coil_Cupronickel.set(new ItemStack(this, 1, 12));
+ ItemList.Casing_Coil_Kanthal.set(new ItemStack(this, 1, 13));
+ ItemList.Casing_Coil_Nichrome.set(new ItemStack(this, 1, 14));
+ ItemList.Casing_Coil_Superconductor.set(new ItemStack(this, 1, 15));*/
+ }
+
+ public IIcon getIcon(int aSide, int aMeta) {
+ if ((aMeta >= 0) && (aMeta < 16)) {
+ switch (aMeta) {
+ case 1:
+ return Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon();
+ case 2:
+ return Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon();
+ case 11:
+ return Textures.BlockIcons.MACHINE_HEATPROOFCASING.getIcon();
+ case 12:
+ return Textures.BlockIcons.MACHINE_COIL_CUPRONICKEL.getIcon();
+ case 13:
+ return Textures.BlockIcons.MACHINE_COIL_KANTHAL.getIcon();
+ case 14:
+ return Textures.BlockIcons.MACHINE_COIL_NICHROME.getIcon();
+ case 15:
+ return Textures.BlockIcons.MACHINE_COIL_SUPERCONDUCTOR.getIcon();
+ }
+ if (aSide == 0) {
+ return Textures.BlockIcons.MACHINECASINGS_BOTTOM[aMeta].getIcon();
+ }
+ if (aSide == 1) {
+ return Textures.BlockIcons.MACHINECASINGS_TOP[aMeta].getIcon();
+ }
+ return Textures.BlockIcons.MACHINECASINGS_SIDE[aMeta].getIcon();
+ }
+ return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon();
+ }
+
+ public int colorMultiplier(IBlockAccess aWorld, int aX, int aY, int aZ) {
+ return aWorld.getBlockMetadata(aX, aY, aZ) > 9 ? super.colorMultiplier(aWorld, aX, aY, aZ) : gregtech.api.enums.Dyes.MACHINE_METAL.mRGBa[0] << 16 | gregtech.api.enums.Dyes.MACHINE_METAL.mRGBa[1] << 8 | gregtech.api.enums.Dyes.MACHINE_METAL.mRGBa[2];
+ }
+}
diff --git a/src/Java/miscutil/gregtech/api/metatileentity/implementations/GregtechMetaCondensor.java b/src/Java/miscutil/gregtech/api/metatileentity/implementations/GregtechMetaCondensor.java
new file mode 100644
index 0000000000..b05e863241
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/metatileentity/implementations/GregtechMetaCondensor.java
@@ -0,0 +1,164 @@
+package miscutil.gregtech.api.metatileentity.implementations;
+
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_ModHandler;
+import miscutil.core.util.Utils;
+import miscutil.gregtech.api.gui.CONTAINER_SteamCondenser;
+import miscutil.gregtech.api.gui.GUI_SteamCondenser;
+import miscutil.gregtech.api.metatileentity.implementations.base.GregtechMetaBoilerBase;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.IFluidHandler;
+
+public class GregtechMetaCondensor extends GregtechMetaBoilerBase{
+
+ public GregtechMetaCondensor(int aID, String aName, String aNameRegional)
+ {
+ super(aID, aName, aNameRegional, "A Steam condenser - [IC2->Steam]", new ITexture[0]);
+ }
+
+ public GregtechMetaCondensor(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
+ {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {mDescription, "Added by: " + EnumChatFormatting.DARK_GREEN+"Alkalus"};
+ }
+
+ public ITexture[][][] getTextureSet(ITexture[] aTextures)
+ {
+ ITexture[][][] rTextures = new ITexture[5][17][];
+ for (byte i = -1; i < 16; i++){
+ rTextures[0][(i + 1)] = new ITexture [] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_VENT, Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa))};
+ rTextures[1][(i + 1)] = new ITexture [] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_VENT, Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) };
+ rTextures[2][(i + 1)] = new ITexture [] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_VENT, Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) };
+ rTextures[3][(i + 1)] = new ITexture [] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_VENT, Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER) };
+ rTextures[4][(i + 1)] = new ITexture [] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_VENT, Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER_ACTIVE) };
+ }
+ return rTextures;
+ }
+
+ public int maxProgresstime()
+ {
+ return 1000;
+ }
+
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
+ {
+ return new CONTAINER_SteamCondenser(aPlayerInventory, aBaseMetaTileEntity, 32000);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
+ {
+ return new GUI_SteamCondenser(aPlayerInventory, aBaseMetaTileEntity, "SteelBoiler.png", 32000);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GregtechMetaCondensor(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick)
+ {
+ this.RI = Utils.randLong(5L, 30L);
+ if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L))
+ {
+ if (this.mTemperature <= 5)
+ {
+ this.mTemperature = 5;
+ this.mLossTimer = 0;
+ }
+ if (++this.mLossTimer > 10)
+ {
+ this.mTemperature -= 1;
+ this.mLossTimer = 0;
+ }
+ for (byte i = 1; (this.mSteam != null) && (i < 6); i = (byte)(i + 1)) {
+ if (i != aBaseMetaTileEntity.getFrontFacing())
+ {
+ IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i);
+ if (tTileEntity != null)
+ {
+ FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false);
+ if (tDrained != null)
+ {
+ int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false);
+ if (tFilledAmount > 0) {
+ tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true);
+ }
+ }
+ }
+ }
+ }
+ if (aTick % 10L == 0L) {
+ if (this.mTemperature > 5)
+ {
+ if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0))
+ {
+ this.mHadNoWater = true;
+ }
+ else
+ {
+ if (this.mHadNoWater)
+ {
+ aBaseMetaTileEntity.doExplosion(2048L);
+ return;
+ }
+ this.mFluid.amount -= 1;
+ if (this.mSteam == null) {
+ this.mSteam = GT_ModHandler.getSteam(30L);
+ } else if (GT_ModHandler.isSteam(this.mSteam)) {
+ this.mSteam.amount += 30;
+ } else {
+ this.mSteam = GT_ModHandler.getSteam(30L);
+ }
+ }
+ }
+ else {
+ this.mHadNoWater = false;
+ }
+ }
+ if ((this.mSteam != null) &&
+ (this.mSteam.amount > 32000))
+ {
+ sendSound((byte)1);
+ this.mSteam.amount = 24000;
+ }
+ /*if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) &&
+ (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.bucket.get(IC2.getItemFromBlock(p_150898_0_)))))
+ {
+ this.mProcessingEnergy += 1000;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.bucket, Materials.Empty, 1L));
+ }*/
+ if ((this.mTemperature < 1000) && (this.mProcessingEnergy > 0) && (aTick % RI == 0L))
+ {
+ this.mProcessingEnergy -= 40;
+ this.mTemperature += 2;
+ }
+ aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
+ }
+ }
+
+ public final int fill(FluidStack aFluid, boolean doFill)
+ {
+ if ((Utils.isIC2Steam(aFluid)) && (this.mProcessingEnergy < 50))
+ {
+ int tFilledAmount = Math.min(50, aFluid.amount);
+ if (doFill) {
+ this.mProcessingEnergy += tFilledAmount;
+ }
+ return tFilledAmount;
+ }
+ return super.fill(aFluid, doFill);
+ }
+}
diff --git a/src/Java/miscutil/gregtech/api/metatileentity/implementations/GregtechMetaCreativeEnergyBuffer.java b/src/Java/miscutil/gregtech/api/metatileentity/implementations/GregtechMetaCreativeEnergyBuffer.java
new file mode 100644
index 0000000000..0509b0f8e9
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/metatileentity/implementations/GregtechMetaCreativeEnergyBuffer.java
@@ -0,0 +1,261 @@
+package miscutil.gregtech.api.metatileentity.implementations;
+
+import static gregtech.api.enums.GT_Values.V;
+import gregtech.api.enums.Textures;
+import gregtech.api.gui.GT_Container_1by1;
+import gregtech.api.gui.GT_Container_2by2;
+import gregtech.api.gui.GT_Container_3by3;
+import gregtech.api.gui.GT_Container_4by4;
+import gregtech.api.gui.GT_GUIContainer_1by1;
+import gregtech.api.gui.GT_GUIContainer_2by2;
+import gregtech.api.gui.GT_GUIContainer_3by3;
+import gregtech.api.gui.GT_GUIContainer_4by4;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.items.GT_MetaBase_Item;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
+import ic2.api.item.IElectricItem;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+
+/**
+ * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
+ *
+ * This is the main construct for my Basic Machines such as the Automatic Extractor
+ * Extend this class to make a simple Machine
+ */
+public class GregtechMetaCreativeEnergyBuffer extends GregtechMetaEnergyBuffer {
+
+
+ public GregtechMetaCreativeEnergyBuffer(String aName, int aTier,
+ String aDescription, ITexture[][][] aTextures, int aSlotCount) {
+ super(aName, aTier, aDescription, aTextures, aSlotCount);
+ // TODO Auto-generated constructor stub
+ }
+
+ public GregtechMetaCreativeEnergyBuffer(int aID, String aName,
+ String aNameRegional, int aTier, String aDescription, int aSlotCount) {
+ super(aID, aName, aNameRegional, aTier, aDescription, aSlotCount);
+ }
+
+ public boolean mCharge = false, mDecharge = false;
+ public int mBatteryCount = 1, mChargeableCount = 1;
+
+ /*
+ * MACHINE_STEEL_SIDE
+ */
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[2][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = new ITexture[] { new GT_RenderedTexture(
+ Textures.BlockIcons.MACHINE_STEEL_SIDE) };
+ rTextures[1][i + 1] = new ITexture[] {
+ new GT_RenderedTexture(
+ Textures.BlockIcons.MACHINE_STEEL_SIDE),
+ mInventory.length > 4 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]
+ : Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] };
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity,
+ byte aSide, byte aFacing, byte aColorIndex, boolean aActive,
+ boolean aRedstone) {
+ return mTextures[aSide == aFacing ? 1 : 0][aColorIndex + 1];
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaCreativeEnergyBuffer(mName, mTier, mDescription,
+ mTextures, mInventory.length);
+ }
+
+ @Override public boolean isSimpleMachine() {return false;}
+ @Override public boolean isElectric() {return true;}
+ @Override public boolean isValidSlot(int aIndex) {return true;}
+ @Override public boolean isFacingValid(byte aFacing) {return true;}
+ @Override public boolean isEnetInput() {return true;}
+ @Override public boolean isEnetOutput() {return true;}
+ @Override public boolean isInputFacing(byte aSide) {return aSide!=getBaseMetaTileEntity().getFrontFacing();}
+ @Override public boolean isOutputFacing(byte aSide) {return aSide==getBaseMetaTileEntity().getFrontFacing();}
+ @Override public boolean isTeleporterCompatible() {return false;}
+
+ @Override
+ public long getMinimumStoredEU() {
+ return 1;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return Long.MAX_VALUE;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return V[mTier];
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return V[mTier];
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return mChargeableCount * 16;
+ }
+
+ @Override
+ public long maxAmperesOut() {
+ return mChargeableCount * 16;
+ }
+ @Override public int rechargerSlotStartIndex() {return 0;}
+ @Override public int dechargerSlotStartIndex() {return 0;}
+ @Override public int rechargerSlotCount() {return mCharge?mInventory.length:0;}
+ @Override public int dechargerSlotCount() {return mDecharge?mInventory.length:0;}
+ @Override public int getProgresstime() {return Integer.MAX_VALUE;}
+ @Override public int maxProgresstime() {return (int)getBaseMetaTileEntity().getUniversalEnergyCapacity();}
+ @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;}
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ //
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ //
+ }
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory,
+ IGregTechTileEntity aBaseMetaTileEntity) {
+ switch (mInventory.length) {
+ case 1: return new GT_Container_1by1(aPlayerInventory, aBaseMetaTileEntity);
+ case 4: return new GT_Container_2by2(aPlayerInventory, aBaseMetaTileEntity);
+ case 9: return new GT_Container_3by3(aPlayerInventory, aBaseMetaTileEntity);
+ case 16: return new GT_Container_4by4(aPlayerInventory, aBaseMetaTileEntity);
+ }
+ return new GT_Container_1by1(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory,
+ IGregTechTileEntity aBaseMetaTileEntity) {
+ switch (mInventory.length) {
+ case 1: return new GT_GUIContainer_1by1(aPlayerInventory, aBaseMetaTileEntity, getLocalName());
+ case 4: return new GT_GUIContainer_2by2(aPlayerInventory, aBaseMetaTileEntity, getLocalName());
+ case 9: return new GT_GUIContainer_3by3(aPlayerInventory, aBaseMetaTileEntity, getLocalName());
+ case 16: return new GT_GUIContainer_4by4(aPlayerInventory, aBaseMetaTileEntity, getLocalName());
+ }
+ return new GT_GUIContainer_1by1(aPlayerInventory, aBaseMetaTileEntity, getLocalName());
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ this.getBaseMetaTileEntity().increaseStoredEnergyUnits(Integer.MAX_VALUE, true);
+ if (aBaseMetaTileEntity.isServerSide()) {
+ mCharge = aBaseMetaTileEntity.getStoredEU() / 2 > aBaseMetaTileEntity
+ .getEUCapacity() / 3;
+ mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3;
+ mBatteryCount = 1;
+ mChargeableCount = 1;
+ this.getBaseMetaTileEntity().increaseStoredEnergyUnits(mMax, true);
+ for (ItemStack tStack : mInventory) if (GT_ModHandler.isElectricItem(tStack, mTier)) {
+ if (GT_ModHandler.isChargerItem(tStack)) mBatteryCount++;
+ mChargeableCount++;
+ }
+ }
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ if(GT_ModHandler.isElectricItem(aStack)&&aStack.getUnlocalizedName().startsWith("gt.metaitem.01.")){
+ String name = aStack.getUnlocalizedName();
+ if(name.equals("gt.metaitem.01.32510")||
+ name.equals("gt.metaitem.01.32511")||
+ name.equals("gt.metaitem.01.32520")||
+ name.equals("gt.metaitem.01.32521")||
+ name.equals("gt.metaitem.01.32530")||
+ name.equals("gt.metaitem.01.32531")){
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ if(!GT_Utility.isStackValid(aStack)){
+ return false;
+ }
+ if(GT_ModHandler.isElectricItem(aStack, this.mTier)){
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public long[] getStoredEnergy(){
+ long tScale = getBaseMetaTileEntity().getEUCapacity();
+ long tStored = getBaseMetaTileEntity().getStoredEU();
+ if (mInventory != null) {
+ for (ItemStack aStack : mInventory) {
+ if (GT_ModHandler.isElectricItem(aStack)) {
+
+ if (aStack.getItem() instanceof GT_MetaBase_Item) {
+ Long[] stats = ((GT_MetaBase_Item) aStack.getItem())
+ .getElectricStats(aStack);
+ if (stats != null) {
+ tScale = tScale + stats[0];
+ tStored = tStored
+ + ((GT_MetaBase_Item) aStack.getItem())
+ .getRealCharge(aStack);
+ }
+ } else if (aStack.getItem() instanceof IElectricItem) {
+ tStored = tStored
+ + (long) ic2.api.item.ElectricItem.manager
+ .getCharge(aStack);
+ tScale = tScale
+ + (long) ((IElectricItem) aStack.getItem())
+ .getMaxCharge(aStack);
+ }
+ }
+ }
+
+ }
+ return new long[] { tStored, tScale };
+ }
+
+ private long count=0;
+ private long mStored=0;
+ private long mMax=0;
+
+ @Override
+ public String[] getInfoData() {
+ count++;
+ if(mMax==0||count%20==0){
+ long[] tmp = getStoredEnergy();
+ mStored=tmp[0];
+ mMax=tmp[1];
+ }
+
+ return new String[] {
+ getLocalName(),
+ "Stored Items:",
+ GT_Utility.formatNumbers(mStored)+" EU /",
+ GT_Utility.formatNumbers(mMax)+" EU"};
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+} \ No newline at end of file
diff --git a/src/Java/miscutil/gregtech/api/metatileentity/implementations/GregtechMetaEnergyBuffer.java b/src/Java/miscutil/gregtech/api/metatileentity/implementations/GregtechMetaEnergyBuffer.java
new file mode 100644
index 0000000000..57c88c0cd3
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/metatileentity/implementations/GregtechMetaEnergyBuffer.java
@@ -0,0 +1,446 @@
+package miscutil.gregtech.api.metatileentity.implementations;
+
+import static gregtech.api.enums.GT_Values.V;
+import gregtech.api.enums.Textures;
+import gregtech.api.gui.GT_Container_1by1;
+import gregtech.api.gui.GT_Container_2by2;
+import gregtech.api.gui.GT_Container_3by3;
+import gregtech.api.gui.GT_Container_4by4;
+import gregtech.api.gui.GT_GUIContainer_1by1;
+import gregtech.api.gui.GT_GUIContainer_2by2;
+import gregtech.api.gui.GT_GUIContainer_3by3;
+import gregtech.api.gui.GT_GUIContainer_4by4;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.items.GT_MetaBase_Item;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
+import ic2.api.item.IElectricItem;
+
+import java.util.List;
+
+import miscutil.core.handler.GuiHandler;
+import miscutil.core.util.Utils;
+import miscutil.core.waila.IWailaInfoProvider;
+import miscutil.gregtech.api.metatileentity.implementations.base.GregtechMetaTileEntity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+import crazypants.enderio.gui.TooltipAddera;
+import crazypants.util.Lang;
+import crazypants.util.Util;
+
+/**
+ * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
+ *
+ * This is the main construct for my Basic Machines such as the Automatic Extractor
+ * Extend this class to make a simple Machine
+ */
+public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity implements IWailaInfoProvider{
+
+ /*
+ * public GregtechMetaEnergyBuffer() { super.this
+ * setCreativeTab(GregTech_API.TAB_GREGTECH); }
+ */
+
+ public boolean mCharge = false, mDecharge = false;
+ public int mBatteryCount = 1, mChargeableCount = 1;
+
+ public GregtechMetaEnergyBuffer(int aID, String aName, String aNameRegional, int aTier, String aDescription, int aSlotCount) {
+ super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription);
+ //setCreativeTab(AddToCreativeTab.tabMachines);
+ }
+
+ public GregtechMetaEnergyBuffer(String aName, int aTier, String aDescription, ITexture[][][] aTextures, int aSlotCount) {
+ super(aName, aTier, aSlotCount, aDescription, aTextures);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {mDescription, "Added by: " + EnumChatFormatting.DARK_GREEN+"Alkalus"};
+ }
+
+ /*
+ * MACHINE_STEEL_SIDE
+ */
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[2][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = new ITexture[] { new GT_RenderedTexture(
+ Textures.BlockIcons.MACHINE_HEATPROOFCASING) };
+ rTextures[1][i + 1] = new ITexture[] {
+ new GT_RenderedTexture(
+ Textures.BlockIcons.MACHINE_HEATPROOFCASING),
+ mInventory.length > 4 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]
+ : Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] };
+ }
+ return rTextures;
+ }
+
+ /*
+ * @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ * ITexture[][][] rTextures = new ITexture[5][17][]; for (byte i = -1; i <
+ * 16; i = (byte) (i + 1)) { ITexture[] tmp0 = { new GT_RenderedTexture(
+ * Textures.BlockIcons.MACHINE_STEEL_BOTTOM, Dyes.getModulation(i,
+ * Dyes._NULL.mRGBa)) }; rTextures[0][(i + 1)] = tmp0; ITexture[] tmp1 = {
+ * new GT_RenderedTexture( Textures.BlockIcons.MACHINE_STEEL_TOP) };
+ * rTextures[1][(i + 1)] = tmp1; ITexture[] tmp2 = { new GT_RenderedTexture(
+ * Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i,
+ * Dyes._NULL.mRGBa)), new
+ * GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) }; rTextures[2][(i +
+ * 1)] = tmp2; ITexture[] tmp4 = { new GT_RenderedTexture(
+ * Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i,
+ * Dyes._NULL.mRGBa)), new
+ * GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT) }; rTextures[3][(i +
+ * 1)] = tmp4; ITexture[] tmp5 = { new GT_RenderedTexture(
+ * Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i,
+ * Dyes._NULL.mRGBa)), new GT_RenderedTexture(
+ * Textures.BlockIcons.BOILER_FRONT_ACTIVE) }; rTextures[4][(i + 1)] = tmp5;
+ * } return rTextures; }
+ */
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return mTextures[aSide == aFacing ? 1 : 0][aColorIndex+1];
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaEnergyBuffer(mName, mTier, mDescription, mTextures, mInventory.length);
+ }
+
+ @Override public boolean isSimpleMachine() {return false;}
+ @Override public boolean isElectric() {return true;}
+ @Override public boolean isValidSlot(int aIndex) {return true;}
+ @Override public boolean isFacingValid(byte aFacing) {return true;}
+ @Override public boolean isEnetInput() {return true;}
+ @Override public boolean isEnetOutput() {return true;}
+ @Override public boolean isInputFacing(byte aSide) {return aSide!=getBaseMetaTileEntity().getFrontFacing();}
+ @Override public boolean isOutputFacing(byte aSide) {return aSide==getBaseMetaTileEntity().getFrontFacing();}
+ @Override public boolean isTeleporterCompatible() {return false;}
+ @Override public long getMinimumStoredEU() {return V[mTier]*16*mInventory.length;}
+ @Override public long maxEUStore() {return V[mTier]*250000;}
+
+ @Override
+ public long maxEUInput() {
+ return V[mTier];
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return V[mTier];
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return mChargeableCount * 4;
+ }
+
+ @Override
+ public long maxAmperesOut() {
+ return mChargeableCount * 4;
+ }
+ @Override public int rechargerSlotStartIndex() {return 0;}
+ @Override public int dechargerSlotStartIndex() {return 0;}
+ @Override public int rechargerSlotCount() {return mCharge?mInventory.length:0;}
+ @Override public int dechargerSlotCount() {return mDecharge?mInventory.length:0;}
+ @Override public int getProgresstime() {return (int)getBaseMetaTileEntity().getUniversalEnergyStored();}
+ @Override public int maxProgresstime() {return (int)getBaseMetaTileEntity().getUniversalEnergyCapacity();}
+ @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;}
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ //
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ //
+ }
+
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ Utils.LOG_WARNING("Right Click on MTE by Player");
+ if (aBaseMetaTileEntity.isClientSide()) return true;
+ //aBaseMetaTileEntity.openGUI(aPlayer);
+
+ Utils.LOG_WARNING("MTE is Client-side");
+ showEnergy(aPlayer.getEntityWorld(), aPlayer);
+ return true;
+ }
+
+ private void showEnergy(World worldIn, EntityPlayer playerIn){
+ Utils.LOG_WARNING("Begin Show Energy");
+ final double c = ((double) getProgresstime() / maxProgresstime()) * 100;
+ Utils.LOG_WARNING(""+c);
+ final double roundOff = Math.round(c * 100.0) / 100.0;
+ Utils.messagePlayer(playerIn, "Energy: " + getProgresstime() + " EU at "+V[mTier]+"v ("+roundOff+"%)");
+ Utils.LOG_WARNING("Making new instance of Guihandler");
+ GuiHandler block = new GuiHandler();
+ Utils.LOG_WARNING("Guihandler.toString(): "+block.toString());
+ block.getClientGuiElement(1, playerIn, worldIn, (int) playerIn.posX, (int) playerIn.posY, (int) playerIn.posZ);
+
+ }
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory,
+ IGregTechTileEntity aBaseMetaTileEntity) {
+ switch (mInventory.length) {
+ case 1: return new GT_Container_1by1(aPlayerInventory, aBaseMetaTileEntity);
+ case 4: return new GT_Container_2by2(aPlayerInventory, aBaseMetaTileEntity);
+ case 9: return new GT_Container_3by3(aPlayerInventory, aBaseMetaTileEntity);
+ case 16: return new GT_Container_4by4(aPlayerInventory, aBaseMetaTileEntity);
+ }
+ return new GT_Container_1by1(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory,
+ IGregTechTileEntity aBaseMetaTileEntity) {
+ switch (mInventory.length) {
+ case 1: return new GT_GUIContainer_1by1(aPlayerInventory, aBaseMetaTileEntity, getLocalName());
+ case 4: return new GT_GUIContainer_2by2(aPlayerInventory, aBaseMetaTileEntity, getLocalName());
+ case 9: return new GT_GUIContainer_3by3(aPlayerInventory, aBaseMetaTileEntity, getLocalName());
+ case 16: return new GT_GUIContainer_4by4(aPlayerInventory, aBaseMetaTileEntity, getLocalName());
+ }
+ return new GT_GUIContainer_1by1(aPlayerInventory, aBaseMetaTileEntity, getLocalName());
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+ mCharge = aBaseMetaTileEntity.getStoredEU() / 2 > aBaseMetaTileEntity
+ .getEUCapacity() / 3;
+ mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3;
+ mBatteryCount = 1;
+ mChargeableCount = 1;
+ for (ItemStack tStack : mInventory) if (GT_ModHandler.isElectricItem(tStack, mTier)) {
+ if (GT_ModHandler.isChargerItem(tStack)) mBatteryCount++;
+ mChargeableCount++;
+ }
+ }
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ if(GT_ModHandler.isElectricItem(aStack)&&aStack.getUnlocalizedName().startsWith("gt.metaitem.01.")){
+ String name = aStack.getUnlocalizedName();
+ if(name.equals("gt.metaitem.01.32510")||
+ name.equals("gt.metaitem.01.32511")||
+ name.equals("gt.metaitem.01.32520")||
+ name.equals("gt.metaitem.01.32521")||
+ name.equals("gt.metaitem.01.32530")||
+ name.equals("gt.metaitem.01.32531")){
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ if(!GT_Utility.isStackValid(aStack)){
+ return false;
+ }
+ if(GT_ModHandler.isElectricItem(aStack, this.mTier)){
+ return true;
+ }
+ return false;
+ }
+
+ public long[] getStoredEnergy(){
+ long tScale = getBaseMetaTileEntity().getEUCapacity();
+ long tStored = getBaseMetaTileEntity().getStoredEU();
+ if (mInventory != null) {
+ for (ItemStack aStack : mInventory) {
+ if (GT_ModHandler.isElectricItem(aStack)) {
+
+ if (aStack.getItem() instanceof GT_MetaBase_Item) {
+ Long[] stats = ((GT_MetaBase_Item) aStack.getItem())
+ .getElectricStats(aStack);
+ if (stats != null) {
+ tScale = tScale + stats[0];
+ tStored = tStored
+ + ((GT_MetaBase_Item) aStack.getItem())
+ .getRealCharge(aStack);
+ }
+ } else if (aStack.getItem() instanceof IElectricItem) {
+ tStored = tStored
+ + (long) ic2.api.item.ElectricItem.manager
+ .getCharge(aStack);
+ tScale = tScale
+ + (long) ((IElectricItem) aStack.getItem())
+ .getMaxCharge(aStack);
+ }
+ }
+ }
+
+ }
+ return new long[] { tStored, tScale };
+ }
+
+ private long count=0;
+ private long mStored=0;
+ private long mMax=0;
+
+ @Override
+ public String[] getInfoData() {
+ count++;
+ if(mMax==0||count%20==0){
+ long[] tmp = getStoredEnergy();
+ mStored=tmp[0];
+ mMax=tmp[1];
+ }
+
+ return new String[] {
+ getLocalName(),
+ "Stored Items:",
+ GT_Utility.formatNumbers(mStored)+" EU /",
+ GT_Utility.formatNumbers(mMax)+" EU"};
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(int p_94128_1_) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_,
+ int p_102007_3_) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_,
+ int p_102008_3_) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public int getSizeInventory() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(int p_70301_1_) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(int p_70304_1_) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public String getInventoryName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean hasCustomInventoryName() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public void markDirty() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public boolean isUseableByPlayer(EntityPlayer p_70300_1_) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public void openInventory() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void closeInventory() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public void getWailaInfo(List<String> tooltip, EntityPlayer player, World world, int x, int y, int z) {
+ String format = Util.TAB + Util.ALIGNRIGHT + EnumChatFormatting.WHITE;
+ if(TooltipAddera.showAdvancedTooltips()) {
+ tooltip.add(String.format("%s : %s%s%sRF/t ", Lang.localize("capbank.maxIO"), format, fmt.format(this.maxEUStore()), Util.TAB + Util.ALIGNRIGHT));
+ tooltip
+ .add(String.format("%s : %s%s%sRF/t ", Lang.localize("capbank.maxIn"), format, fmt.format(this.maxEUInput()), Util.TAB + Util.ALIGNRIGHT));
+ tooltip
+ .add(String.format("%s : %s%s%sRF/t ", Lang.localize("capbank.maxOut"), format, fmt.format(this.maxEUOutput()), Util.TAB + Util.ALIGNRIGHT));
+
+ tooltip.add("");
+ }
+
+ long stored = this.getProgresstime();
+ long max = this.maxEUStore();
+ tooltip.add(String.format("%s%s%s / %s%s%s RF", EnumChatFormatting.WHITE, fmt.format(stored), EnumChatFormatting.RESET, EnumChatFormatting.WHITE,
+ fmt.format(max),
+ EnumChatFormatting.RESET));
+
+ //int change = Math.round(nw.getAverageChangePerTick());
+ String color = EnumChatFormatting.WHITE.toString();
+ /* if(change > 0) {
+ color = EnumChatFormatting.GREEN.toString() + "+";
+ } else if(change < 0) {
+ color = EnumChatFormatting.RED.toString();
+ }*/
+ tooltip
+ .add(String.format("%s%s%sRF/t ", color, fmt.format("null"), " " + EnumChatFormatting.RESET.toString()));
+
+ }
+
+ @Override
+ public int getDefaultDisplayMask(World paramWorld, int paramInt1, int paramInt2, int paramInt3) {
+ return IWailaInfoProvider.BIT_DETAILED;
+ }
+} \ No newline at end of file
diff --git a/src/Java/miscutil/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java b/src/Java/miscutil/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java
new file mode 100644
index 0000000000..bc9408319e
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java
@@ -0,0 +1,235 @@
+package miscutil.gregtech.api.metatileentity.implementations;
+
+import static gregtech.api.enums.GT_Values.VN;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.TextureSet;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntityCable;
+import gregtech.api.interfaces.tileentity.IColoredTileEntity;
+import gregtech.api.interfaces.tileentity.IEnergyConnected;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.BaseMetaPipeEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Utility;
+import ic2.api.energy.tile.IEnergySink;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.AxisAlignedBB;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+import cofh.api.energy.IEnergyReceiver;
+
+public class GregtechMetaPipeEntity_Cable extends GT_MetaPipeEntity_Cable implements IMetaTileEntityCable {
+ public long mTransferredAmperage = 0, mTransferredAmperageLast20 = 0, mTransferredVoltageLast20 = 0;
+
+ public final float mThickNess;
+ public final Materials mMaterial;
+ public final long mCableLossPerMeter, mAmperage, mVoltage;
+ public final boolean mInsulated, mCanShock;
+ public long mRestRF;
+
+ public GregtechMetaPipeEntity_Cable(int aID, String aName, String aNameRegional, float aThickNess, Materials aMaterial, long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) {
+ super(aID, aName, aNameRegional, 0, aMaterial, aCableLossPerMeter, aAmperage, aVoltage, aInsulated, aCanShock);
+ mThickNess = aThickNess;
+ mMaterial = aMaterial;
+ mAmperage = aAmperage;
+ mVoltage = aVoltage;
+ mInsulated = aInsulated;
+ mCanShock = aCanShock;
+ mCableLossPerMeter = aCableLossPerMeter;
+ }
+
+ public GregtechMetaPipeEntity_Cable(String aName, float aThickNess, Materials aMaterial, long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) {
+ super(aName, 0, aMaterial, aCableLossPerMeter, aAmperage, aVoltage, aInsulated, aCanShock);
+ mThickNess = aThickNess;
+ mMaterial = aMaterial;
+ mAmperage = aAmperage;
+ mVoltage = aVoltage;
+ mInsulated = aInsulated;
+ mCanShock = aCanShock;
+ mCableLossPerMeter = aCableLossPerMeter;
+ }
+
+ @Override
+ public byte getTileEntityBaseType() {
+ return (byte)(mInsulated?9:8);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaPipeEntity_Cable(mName, mThickNess, mMaterial, mCableLossPerMeter, mAmperage, mVoltage, mInsulated, mCanShock);
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) {
+ if (!mInsulated) return new ITexture[] {new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa)};
+ if (aConnected) {
+ float tThickNess = getThickNess();
+ if (tThickNess < 0.37F) return new ITexture[] {new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_TINY , Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ if (tThickNess < 0.49F) return new ITexture[] {new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_SMALL , Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ if (tThickNess < 0.74F) return new ITexture[] {new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_MEDIUM , Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ if (tThickNess < 0.99F) return new ITexture[] {new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_LARGE , Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ return new ITexture[] {new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], mMaterial.mRGBa), new GT_RenderedTexture(Textures.BlockIcons.INSULATION_HUGE , Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ }
+ return new ITexture[] {new GT_RenderedTexture(Textures.BlockIcons.INSULATION_FULL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa))};
+ }
+
+ @Override
+ public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity aEntity) {
+ if (mCanShock && (((BaseMetaPipeEntity)getBaseMetaTileEntity()).mConnections & -128) == 0 && aEntity instanceof EntityLivingBase) GT_Utility.applyElectricityDamage((EntityLivingBase)aEntity, mTransferredVoltageLast20, mTransferredAmperageLast20);
+ }
+
+ @Override
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
+ if (!mCanShock) return super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
+ return AxisAlignedBB.getBoundingBox(aX+0.125D, aY+0.125D, aZ+0.125D, aX+0.875D, aY+0.875D, aZ+0.875D);
+ }
+
+ @Override public boolean isSimpleMachine() {return true;}
+ @Override public boolean isFacingValid(byte aFacing) {return false;}
+ @Override public boolean isValidSlot(int aIndex) {return true;}
+ // @Override public final boolean renderInside(byte aSide) {return false;}
+ @Override public int getProgresstime() {return (int)mTransferredAmperage*64;}
+ @Override public int maxProgresstime() {return (int)mAmperage*64;}
+
+ @Override
+ public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
+ if (!getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).letsEnergyIn(aSide, getBaseMetaTileEntity().getCoverIDAtSide(aSide), getBaseMetaTileEntity().getCoverDataAtSide(aSide), getBaseMetaTileEntity())) return 0;
+ return transferElectricity(aSide, aVoltage, aAmperage, new ArrayList<TileEntity>(Arrays.asList((TileEntity)getBaseMetaTileEntity())));
+ }
+
+ @Override
+ public long transferElectricity(byte aSide, long aVoltage, long aAmperage, ArrayList<TileEntity> aAlreadyPassedTileEntityList) {
+ long rUsedAmperes = 0;
+ aVoltage -= mCableLossPerMeter;
+ if (aVoltage > 0) for (byte i = 0; i < 6 && aAmperage > rUsedAmperes; i++) if (i != aSide && (mConnections & (1<<i)) != 0 && getBaseMetaTileEntity().getCoverBehaviorAtSide(i).letsEnergyOut(i, getBaseMetaTileEntity().getCoverIDAtSide(i), getBaseMetaTileEntity().getCoverDataAtSide(i), getBaseMetaTileEntity())) {
+ TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(i);
+ if (!aAlreadyPassedTileEntityList.contains(tTileEntity)) {
+ aAlreadyPassedTileEntityList.add(tTileEntity);
+ if (tTileEntity instanceof IEnergyConnected) {
+ if (getBaseMetaTileEntity().getColorization() >= 0) {
+ byte tColor = ((IEnergyConnected)tTileEntity).getColorization();
+ if (tColor >= 0 && tColor != getBaseMetaTileEntity().getColorization()) continue;
+ }
+ if (tTileEntity instanceof IGregTechTileEntity && ((IGregTechTileEntity)tTileEntity).getMetaTileEntity() instanceof IMetaTileEntityCable && ((IGregTechTileEntity)tTileEntity).getCoverBehaviorAtSide(GT_Utility.getOppositeSide(i)).letsEnergyIn(GT_Utility.getOppositeSide(i), ((IGregTechTileEntity)tTileEntity).getCoverIDAtSide(GT_Utility.getOppositeSide(i)), ((IGregTechTileEntity)tTileEntity).getCoverDataAtSide(GT_Utility.getOppositeSide(i)), ((IGregTechTileEntity)tTileEntity))) {
+ if (((IGregTechTileEntity)tTileEntity).getTimer() > 50) rUsedAmperes += ((IMetaTileEntityCable)((IGregTechTileEntity)tTileEntity).getMetaTileEntity()).transferElectricity(GT_Utility.getOppositeSide(i), aVoltage, aAmperage-rUsedAmperes, aAlreadyPassedTileEntityList);
+ } else {
+ rUsedAmperes += ((IEnergyConnected)tTileEntity).injectEnergyUnits(GT_Utility.getOppositeSide(i), aVoltage, aAmperage-rUsedAmperes);
+ }
+ // } else if (tTileEntity instanceof IEnergySink) {
+ // ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
+ // if (((IEnergySink)tTileEntity).acceptsEnergyFrom((TileEntity)getBaseMetaTileEntity(), tDirection)) {
+ // if (((IEnergySink)tTileEntity).demandedEnergyUnits() > 0 && ((IEnergySink)tTileEntity).injectEnergyUnits(tDirection, aVoltage) < aVoltage) rUsedAmperes++;
+ // }
+ } else if (tTileEntity instanceof IEnergySink) {
+ ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
+ if (((IEnergySink)tTileEntity).acceptsEnergyFrom((TileEntity)getBaseMetaTileEntity(), tDirection)) {
+ if (((IEnergySink)tTileEntity).getDemandedEnergy() > 0 && ((IEnergySink)tTileEntity).injectEnergy(tDirection, aVoltage, aVoltage) < aVoltage) rUsedAmperes++;
+ }
+ } else if(GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver){
+ ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
+ int rfOut = (int) (aVoltage * GregTech_API.mEUtoRF / 100);
+ if(((IEnergyReceiver)tTileEntity).receiveEnergy(tDirection, rfOut, true)==rfOut){
+ ((IEnergyReceiver)tTileEntity).receiveEnergy(tDirection, rfOut, false); rUsedAmperes++;
+ }else if(((IEnergyReceiver)tTileEntity).receiveEnergy(tDirection, rfOut, true)>0){
+ if(mRestRF==0){
+ int RFtrans = ((IEnergyReceiver)tTileEntity).receiveEnergy(tDirection, (int) rfOut, false);rUsedAmperes++;
+ mRestRF = rfOut - RFtrans;
+ }else{
+ int RFtrans = ((IEnergyReceiver)tTileEntity).receiveEnergy(tDirection, (int) mRestRF, false);
+ mRestRF = mRestRF - RFtrans;
+ }
+ }
+ if(GregTech_API.mRFExplosions && ((IEnergyReceiver)tTileEntity).getMaxEnergyStored(tDirection) < rfOut * 600){
+ if(rfOut > 32 * GregTech_API.mEUtoRF / 100) this.doExplosion(rfOut);
+ }
+ }
+ }
+ }
+ mTransferredAmperage += rUsedAmperes;
+ mTransferredVoltageLast20 = Math.max(mTransferredVoltageLast20, aVoltage);
+ mTransferredAmperageLast20 = Math.max(mTransferredAmperageLast20, mTransferredAmperage);
+ if (aVoltage > mVoltage || mTransferredAmperage > mAmperage) {
+ getBaseMetaTileEntity().setToFire();
+ return aAmperage;
+ }
+ return rUsedAmperes;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+ mTransferredAmperage = 0;
+
+ if (aTick % 20 == 0) {
+ mTransferredVoltageLast20 = 0;
+ mTransferredAmperageLast20 = 0;
+ mConnections = 0;
+ for (byte i = 0, j = 0; i < 6; i++) {
+ j = GT_Utility.getOppositeSide(i);
+ if (aBaseMetaTileEntity.getCoverBehaviorAtSide(i).alwaysLookConnected(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), aBaseMetaTileEntity) || aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsEnergyIn(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), aBaseMetaTileEntity) || aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsEnergyOut(i, aBaseMetaTileEntity.getCoverIDAtSide(i), aBaseMetaTileEntity.getCoverDataAtSide(i), aBaseMetaTileEntity)) {
+ TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(i);
+ if (tTileEntity instanceof IColoredTileEntity) {
+ if (aBaseMetaTileEntity.getColorization() >= 0) {
+ byte tColor = ((IColoredTileEntity)tTileEntity).getColorization();
+ if (tColor >= 0 && tColor != aBaseMetaTileEntity.getColorization()) continue;
+ }
+ }
+ if (tTileEntity instanceof IEnergyConnected && (((IEnergyConnected)tTileEntity).inputEnergyFrom(j) || ((IEnergyConnected)tTileEntity).outputsEnergyTo(j))) {
+ mConnections |= (1<<i);
+ continue;
+ }
+ if (tTileEntity instanceof IGregTechTileEntity && ((IGregTechTileEntity)tTileEntity).getMetaTileEntity() instanceof IMetaTileEntityCable) {
+ if (((IGregTechTileEntity)tTileEntity).getCoverBehaviorAtSide(j).alwaysLookConnected(j, ((IGregTechTileEntity)tTileEntity).getCoverIDAtSide(j), ((IGregTechTileEntity)tTileEntity).getCoverDataAtSide(j), ((IGregTechTileEntity)tTileEntity)) || ((IGregTechTileEntity)tTileEntity).getCoverBehaviorAtSide(j).letsEnergyIn(j, ((IGregTechTileEntity)tTileEntity).getCoverIDAtSide(j), ((IGregTechTileEntity)tTileEntity).getCoverDataAtSide(j), ((IGregTechTileEntity)tTileEntity)) || ((IGregTechTileEntity)tTileEntity).getCoverBehaviorAtSide(j).letsEnergyOut(j, ((IGregTechTileEntity)tTileEntity).getCoverIDAtSide(j), ((IGregTechTileEntity)tTileEntity).getCoverDataAtSide(j), ((IGregTechTileEntity)tTileEntity))) {
+ mConnections |= (1<<i);
+ continue;
+ }
+ }
+ if (tTileEntity instanceof IEnergySink && ((IEnergySink)tTileEntity).acceptsEnergyFrom((TileEntity)aBaseMetaTileEntity, ForgeDirection.getOrientation(j))) {
+ mConnections |= (1<<i);
+ continue;
+ }
+ if(GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver && ((IEnergyReceiver)tTileEntity).canConnectEnergy(ForgeDirection.getOrientation(j))){
+ mConnections |= (1<<i);
+ continue;
+ }
+ /*
+ if (tTileEntity instanceof IEnergyEmitter && ((IEnergyEmitter)tTileEntity).emitsEnergyTo((TileEntity)aBaseMetaTileEntity, ForgeDirection.getOrientation(j))) {
+ mConnections |= (1<<i);
+ continue;
+ }*/
+ }
+ }
+ }
+ }
+ }
+
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {
+ "Max Voltage: " + EnumChatFormatting.GREEN + mVoltage + " (" + VN[GT_Utility.getTier(mVoltage)] + ")" + EnumChatFormatting.GRAY,
+ "Max Amperage: " + EnumChatFormatting.YELLOW + mAmperage + EnumChatFormatting.GRAY,
+ "Loss/Meter/Ampere: " + EnumChatFormatting.RED + mCableLossPerMeter + EnumChatFormatting.GRAY + " EU-Volt",
+ "Added by:" + EnumChatFormatting.DARK_GREEN+" Alkalus"
+ };
+ }
+
+
+ @Override
+ public float getThickNess() {
+ return mThickNess;
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/miscutil/gregtech/api/metatileentity/implementations/GregtechMetaSafeBlock.java b/src/Java/miscutil/gregtech/api/metatileentity/implementations/GregtechMetaSafeBlock.java
new file mode 100644
index 0000000000..b45c698c97
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/metatileentity/implementations/GregtechMetaSafeBlock.java
@@ -0,0 +1,76 @@
+package miscutil.gregtech.api.metatileentity.implementations;
+
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Utility;
+import miscutil.gregtech.api.gui.CONTAINER_SafeBlock;
+import miscutil.gregtech.api.gui.GUI_SafeBlock;
+import miscutil.gregtech.api.metatileentity.implementations.base.GregtechMetaSafeBlockBase;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.util.EnumChatFormatting;
+
+public class GregtechMetaSafeBlock
+ extends GregtechMetaSafeBlockBase {
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {mDescription, "Added by: " + EnumChatFormatting.DARK_GREEN+"Alkalus"};
+ }
+
+ public GregtechMetaSafeBlock(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 28, "Protecting your items from sticky fingers.");
+ }
+
+ public GregtechMetaSafeBlock(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription) {
+ super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription);
+ }
+
+ public GregtechMetaSafeBlock(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aInvSlotCount, aDescription, aTextures);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaSafeBlock(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public ITexture getOverlayIcon() {
+ return new GT_RenderedTexture(Textures.BlockIcons.VOID);
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return aIndex < this.mInventory.length - 1;
+ }
+
+ /*@Override
+ protected void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
+ fillStacksIntoFirstSlots();
+ super.moveItems(aBaseMetaTileEntity, aTimer);
+ fillStacksIntoFirstSlots();
+ }*/
+
+ protected void fillStacksIntoFirstSlots() {
+ for (int i = 0; i < this.mInventory.length - 1; i++) {
+ for (int j = i + 1; j < this.mInventory.length - 1; j++) {
+ if ((this.mInventory[j] != null) && ((this.mInventory[i] == null) || (GT_Utility.areStacksEqual(this.mInventory[i], this.mInventory[j])))) {
+ GT_Utility.moveStackFromSlotAToSlotB(getBaseMetaTileEntity(), getBaseMetaTileEntity(), j, i, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
+ }
+ }
+ }
+ }
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new CONTAINER_SafeBlock(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_SafeBlock(aPlayerInventory, aBaseMetaTileEntity);
+ }
+}
diff --git a/src/Java/miscutil/gregtech/api/metatileentity/implementations/GregtechMetaTileEntityIronBlastFurnace.java b/src/Java/miscutil/gregtech/api/metatileentity/implementations/GregtechMetaTileEntityIronBlastFurnace.java
new file mode 100644
index 0000000000..bcc2030755
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/metatileentity/implementations/GregtechMetaTileEntityIronBlastFurnace.java
@@ -0,0 +1,369 @@
+package miscutil.gregtech.api.metatileentity.implementations;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.objects.GT_ItemStack;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
+import miscutil.core.block.ModBlocks;
+import miscutil.gregtech.api.gui.CONTAINER_IronBlastFurnace;
+import miscutil.gregtech.api.gui.GUI_IronBlastFurnace;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.common.util.ForgeDirection;
+
+public class GregtechMetaTileEntityIronBlastFurnace
+ extends MetaTileEntity {
+ private static final ITexture[] FACING_SIDE = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL)};
+ private static final ITexture[] FACING_FRONT = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT)};
+ private static final ITexture[] FACING_ACTIVE = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT_ACTIVE)};
+ public int mMaxProgresstime = 0;
+ public int mUpdate = 30;
+ public int mProgresstime = 0;
+ public boolean mMachine = false;
+ public ItemStack mOutputItem1;
+ public ItemStack mOutputItem2;
+
+ public GregtechMetaTileEntityIronBlastFurnace(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, 4);
+ }
+
+ public GregtechMetaTileEntityIronBlastFurnace(String aName) {
+ super(aName, 4);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[]{"Slowly, Skip the Bronze age, Get some Steel!", "Multiblock: 3x3x5 hollow with opening on top", "40 Iron Plated Bricks required"};
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return aActive ? FACING_ACTIVE : FACING_FRONT;
+ }
+ return FACING_SIDE;
+ }
+
+ @Override
+ public boolean isSteampowered() {
+ return false;
+ }
+
+ @Override
+ public boolean isElectric() {
+ return false;
+ }
+
+ @Override
+ public boolean isPneumatic() {
+ return false;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return false;
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return false;
+ }
+
+ @Override
+ public boolean isInputFacing(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public boolean isTeleporterCompatible() {
+ return false;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public int getProgresstime() {
+ return this.mProgresstime;
+ }
+
+ @Override
+ public int maxProgresstime() {
+ return this.mMaxProgresstime;
+ }
+
+ @Override
+ public int increaseProgress(int aProgress) {
+ this.mProgresstime += aProgress;
+ return this.mMaxProgresstime - this.mProgresstime;
+ }
+
+ @Override
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) {
+ return (GregTech_API.getCoverBehavior(aCoverID.toStack()).isSimpleCover()) && (super.allowCoverOnSide(aSide, aCoverID));
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntityIronBlastFurnace(this.mName);
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setInteger("mProgresstime", this.mProgresstime);
+ aNBT.setInteger("mMaxProgresstime", this.mMaxProgresstime);
+ if (this.mOutputItem1 != null) {
+ NBTTagCompound tNBT = new NBTTagCompound();
+ this.mOutputItem1.writeToNBT(tNBT);
+ aNBT.setTag("mOutputItem1", tNBT);
+ }
+ if (this.mOutputItem2 != null) {
+ NBTTagCompound tNBT = new NBTTagCompound();
+ this.mOutputItem2.writeToNBT(tNBT);
+ aNBT.setTag("mOutputItem2", tNBT);
+ }
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ this.mUpdate = 30;
+ this.mProgresstime = aNBT.getInteger("mProgresstime");
+ this.mMaxProgresstime = aNBT.getInteger("mMaxProgresstime");
+ this.mOutputItem1 = GT_Utility.loadItem(aNBT, "mOutputItem1");
+ this.mOutputItem2 = GT_Utility.loadItem(aNBT, "mOutputItem2");
+ }
+
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ }
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new CONTAINER_IronBlastFurnace(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_IronBlastFurnace(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ private boolean checkMachine() {
+ int xDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ;
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 4; j++) { //This is height
+ for (int k = -1; k < 2; k++) {
+ if ((xDir + i != 0) || (j != 0) || (zDir + k != 0)) {
+ if ((i != 0) || (j == -1) || (k != 0)) {
+ if ((getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k) != ModBlocks.blockCasingsMisc) || (getBaseMetaTileEntity().getMetaIDOffset(xDir + i, j, zDir + k) != 10)) {
+ return false;
+ }
+ } else if ((!GT_Utility.arrayContains(getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k), new Object[]{Blocks.lava, Blocks.flowing_lava, null})) && (!getBaseMetaTileEntity().getAirOffset(xDir + i, j, zDir + k))) {
+ return false;
+ }
+ }
+ }
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public void onMachineBlockUpdate() {
+ this.mUpdate = 30;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
+ if ((aBaseMetaTileEntity.isClientSide()) &&
+ (aBaseMetaTileEntity.isActive())) {
+ aBaseMetaTileEntity.getWorld().spawnParticle("cloud", aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1) + Math.random(), aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1) + Math.random(), 0.0D, 0.3D, 0.0D);
+ }
+ if (aBaseMetaTileEntity.isServerSide()) {
+ if (this.mUpdate-- == 0) {
+ this.mMachine = checkMachine();
+ }
+ if (this.mMachine) {
+ if (this.mMaxProgresstime > 0) {
+ if (++this.mProgresstime >= this.mMaxProgresstime) {
+ addOutputProducts();
+ this.mOutputItem1 = null;
+ this.mOutputItem2 = null;
+ this.mProgresstime = 0;
+ this.mMaxProgresstime = 0;
+ try {
+ // GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "steel");
+ } catch (Exception e) {
+ }
+ }
+ } else if (aBaseMetaTileEntity.isAllowedToWork()) {
+ checkRecipe();
+ }
+ }
+ aBaseMetaTileEntity.setActive((this.mMaxProgresstime > 0) && (this.mMachine));
+ if (aBaseMetaTileEntity.isActive()) {
+ if (aBaseMetaTileEntity.getAir(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1))) {
+ aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.lava, 1, 2);
+ this.mUpdate = 1;
+ }
+ if (aBaseMetaTileEntity.getAir(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1))) {
+ aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.lava, 1, 2);
+ this.mUpdate = 1;
+ }
+ } else {
+ if (aBaseMetaTileEntity.getBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)) == Blocks.lava) {
+ aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.air, 0, 2);
+ this.mUpdate = 1;
+ }
+ if (aBaseMetaTileEntity.getBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)) == Blocks.lava) {
+ aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.air, 0, 2);
+ this.mUpdate = 1;
+ }
+ }
+ }
+ }
+
+ private void addOutputProducts() {
+ if (this.mOutputItem1 != null) {
+ if (this.mInventory[2] == null) {
+ this.mInventory[2] = GT_Utility.copy(new Object[]{this.mOutputItem1});
+ } else if (GT_Utility.areStacksEqual(this.mInventory[2], this.mOutputItem1)) {
+ this.mInventory[2].stackSize = Math.min(this.mOutputItem1.getMaxStackSize(), this.mOutputItem1.stackSize + this.mInventory[2].stackSize);
+ }
+ }
+ if (this.mOutputItem2 != null) {
+ if (this.mInventory[3] == null) {
+ this.mInventory[3] = GT_Utility.copy(new Object[]{this.mOutputItem2});
+ } else if (GT_Utility.areStacksEqual(this.mInventory[3], this.mOutputItem2)) {
+ this.mInventory[3].stackSize = Math.min(this.mOutputItem2.getMaxStackSize(), this.mOutputItem2.stackSize + this.mInventory[3].stackSize);
+ }
+ }
+ }
+
+ private boolean spaceForOutput(ItemStack aStack1, ItemStack aStack2) {
+ if (((this.mInventory[2] == null) || (aStack1 == null) || ((this.mInventory[2].stackSize + aStack1.stackSize <= this.mInventory[2].getMaxStackSize()) && (GT_Utility.areStacksEqual(this.mInventory[2], aStack1)))) && (
+ (this.mInventory[3] == null) || (aStack2 == null) || ((this.mInventory[3].stackSize + aStack2.stackSize <= this.mInventory[3].getMaxStackSize()) && (GT_Utility.areStacksEqual(this.mInventory[3], aStack2))))) {
+ return true;
+ }
+ return false;
+ }
+
+ private boolean checkRecipe() {
+ if (!this.mMachine) {
+ return false;
+ }
+ if ((this.mInventory[0] != null) && (this.mInventory[1] != null) && (this.mInventory[0].stackSize >= 1)) {
+ if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "dustIron")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "ingotIron"))) {
+ if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 4) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 4L)))) {
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ getBaseMetaTileEntity().decrStackSize(1, 4*3);
+ this.mMaxProgresstime = 36000;
+ return true;
+ }
+ if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 2) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 4L)))) {
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ getBaseMetaTileEntity().decrStackSize(1, 2*3);
+ this.mMaxProgresstime = 4800*5;
+ return true;
+ }
+ if ((this.mInventory[0].stackSize >= 9) && ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 4) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) {
+ getBaseMetaTileEntity().decrStackSize(0, 9);
+ getBaseMetaTileEntity().decrStackSize(1, 4*3);
+ this.mMaxProgresstime = 64800*5;
+ return true;
+ }
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "dustSteel")) {
+ if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 2) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 2L)))) {
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ getBaseMetaTileEntity().decrStackSize(1, 2*3);
+ this.mMaxProgresstime = 3600*5;
+ return true;
+ }
+ if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 1) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 2L)))) {
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ getBaseMetaTileEntity().decrStackSize(1, 1*3);
+ this.mMaxProgresstime = 2400*5;
+ return true;
+ }
+ if ((this.mInventory[0].stackSize >= 9) && ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 2) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 2L)))) {
+ getBaseMetaTileEntity().decrStackSize(0, 9);
+ getBaseMetaTileEntity().decrStackSize(1, 2*3);
+ this.mMaxProgresstime = 32400*5;
+ return true;
+ }
+ } else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "blockIron")) {
+ if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 36) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) {
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ getBaseMetaTileEntity().decrStackSize(1, 64);
+ this.mMaxProgresstime = 64800*9;
+ return true;
+ }
+ if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 18) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Ash, 4L)))) {
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ getBaseMetaTileEntity().decrStackSize(1, 18*3);
+ this.mMaxProgresstime = 43200*5;
+ return true;
+ }
+ if (((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 4) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) {
+ getBaseMetaTileEntity().decrStackSize(0, 1);
+ getBaseMetaTileEntity().decrStackSize(1, 4*3);
+ this.mMaxProgresstime = 64800*5;
+ return true;
+ }
+ }
+ }
+ this.mOutputItem1 = null;
+ this.mOutputItem2 = null;
+ return false;
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return false;
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return aIndex > 1;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ if (aIndex < 2) {
+ }
+ return !GT_Utility.areStacksEqual(aStack, this.mInventory[0]);
+ }
+
+ @Override
+ public byte getTileEntityBaseType() {
+ return 0;
+ }
+}
diff --git a/src/Java/miscutil/gregtech/api/metatileentity/implementations/base/GregtechMetaBoilerBase.java b/src/Java/miscutil/gregtech/api/metatileentity/implementations/base/GregtechMetaBoilerBase.java
new file mode 100644
index 0000000000..12e807bc34
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/metatileentity/implementations/base/GregtechMetaBoilerBase.java
@@ -0,0 +1,328 @@
+package miscutil.gregtech.api.metatileentity.implementations.base;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
+import gregtech.api.objects.GT_ItemStack;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
+import miscutil.core.util.Utils;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.IFluidHandler;
+
+public abstract class GregtechMetaBoilerBase extends GT_MetaTileEntity_BasicTank
+{
+ public int mTemperature = 20;
+ public int mProcessingEnergy = 0;
+ public int mLossTimer = 0;
+ public FluidStack mSteam = null;
+ public boolean mHadNoWater = false;
+ public long RI = Utils.randLong(5L, 30L);
+
+ public GregtechMetaBoilerBase(int aID, String aName, String aNameRegional, String aDescription, ITexture... aTextures)
+ {
+ super(aID, aName, aNameRegional, 0, 4, aDescription, aTextures);
+ }
+
+ public GregtechMetaBoilerBase(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
+ {
+ super(aName, aTier, 4, aDescription, aTextures);
+ }
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone)
+ {
+ ITexture[] tmp = mTextures[aSide >= 2 ? aSide != aFacing ? 2 : ((byte)(aActive ? 4 : 3)) : aSide][aColorIndex + 1];
+ //mTextures[(aSide==aFacing?(aActive?4:3):aSide==GT_Utility.getOppositeSide(aFacing)?2:aSide==0?0:aSide==1?1:2)][aColorIndex+1];
+ if(aSide!=aFacing&&tmp.length==2){
+ tmp = new ITexture[]{tmp[0]};
+ }
+ return tmp;
+ }
+
+ public boolean isElectric()
+ {
+ return false;
+ }
+
+ public boolean isPneumatic()
+ {
+ return false;
+ }
+
+ public boolean isSteampowered()
+ {
+ return false;
+ }
+
+ public boolean isSimpleMachine()
+ {
+ return false;
+ }
+
+ public boolean isFacingValid(byte aFacing)
+ {
+ return aFacing > 1;
+ }
+
+ public boolean isAccessAllowed(EntityPlayer aPlayer)
+ {
+ return true;
+ }
+
+ public boolean isValidSlot(int aIndex)
+ {
+ return true;
+ }
+
+ public int getProgresstime()
+ {
+ return this.mTemperature;
+ }
+
+ public int maxProgresstime()
+ {
+ return 500;
+ }
+
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer)
+ {
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ }
+ if (aPlayer != null) {
+ if (GT_Utility.areStacksEqual(aPlayer.getCurrentEquippedItem(), new ItemStack(Items.water_bucket, 1)))
+ {
+ fill(Materials.Water.getFluid(1000 * aPlayer.getCurrentEquippedItem().stackSize), true);
+ aPlayer.getCurrentEquippedItem().func_150996_a(Items.bucket);
+ }
+ else
+ {
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ }
+ }
+ return true;
+ }
+
+ public boolean doesFillContainers()
+ {
+ return true;
+ }
+
+ public boolean doesEmptyContainers()
+ {
+ return true;
+ }
+
+ public boolean canTankBeFilled()
+ {
+ return true;
+ }
+
+ public boolean canTankBeEmptied()
+ {
+ return true;
+ }
+
+ public boolean displaysItemStack()
+ {
+ return false;
+ }
+
+ public boolean displaysStackSize()
+ {
+ return false;
+ }
+
+ public boolean isFluidInputAllowed(FluidStack aFluid)
+ {
+ return GT_ModHandler.isWater(aFluid);
+ }
+
+ public FluidStack getDrainableStack()
+ {
+ return this.mSteam;
+ }
+
+ public FluidStack setDrainableStack(FluidStack aFluid)
+ {
+ this.mSteam = aFluid;return this.mSteam;
+ }
+
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCover)
+ {
+ return GregTech_API.getCoverBehavior(aCover.toStack()).isSimpleCover();
+ }
+
+ public void saveNBTData(NBTTagCompound aNBT)
+ {
+ super.saveNBTData(aNBT);
+ aNBT.setInteger("mLossTimer", this.mLossTimer);
+ aNBT.setInteger("mTemperature", this.mTemperature);
+ aNBT.setInteger("mProcessingEnergy", this.mProcessingEnergy);
+ if (this.mSteam != null) {
+ try
+ {
+ aNBT.setTag("mSteam", this.mSteam.writeToNBT(new NBTTagCompound()));
+ }
+ catch (Throwable e) {}
+ }
+ }
+
+ public void loadNBTData(NBTTagCompound aNBT)
+ {
+ super.loadNBTData(aNBT);
+ this.mLossTimer = aNBT.getInteger("mLossTimer");
+ this.mTemperature = aNBT.getInteger("mTemperature");
+ this.mProcessingEnergy = aNBT.getInteger("mProcessingEnergy");
+ this.mSteam = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mSteam"));
+ }
+
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick)
+ {
+ if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L))
+ {
+ if (this.mTemperature <= 20)
+ {
+ this.mTemperature = 20;
+ this.mLossTimer = 0;
+ }
+ if (++this.mLossTimer > 40)
+ {
+ this.mTemperature -= 1;
+ this.mLossTimer = 0;
+ }
+ for (byte i = 1; (this.mSteam != null) && (i < 6); i = (byte)(i + 1)) {
+ if (i != aBaseMetaTileEntity.getFrontFacing())
+ {
+ IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i);
+ if (tTileEntity != null)
+ {
+ FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false);
+ if (tDrained != null)
+ {
+ int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false);
+ if (tFilledAmount > 0) {
+ tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true);
+ }
+ }
+ }
+ }
+ }
+ if (aTick % 10L == 0L) {
+ if (this.mTemperature > 100)
+ {
+ if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0))
+ {
+ this.mHadNoWater = true;
+ }
+ else
+ {
+ if (this.mHadNoWater)
+ {
+ aBaseMetaTileEntity.doExplosion(2048L);
+ return;
+ }
+ this.mFluid.amount -= 1;
+ if (this.mSteam == null) {
+ this.mSteam = GT_ModHandler.getSteam(150L);
+ } else if (GT_ModHandler.isSteam(this.mSteam)) {
+ this.mSteam.amount += 150;
+ } else {
+ this.mSteam = GT_ModHandler.getSteam(150L);
+ }
+ }
+ }
+ else {
+ this.mHadNoWater = false;
+ }
+ }
+ if ((this.mSteam != null) &&
+ (this.mSteam.amount > 32000))
+ {
+ sendSound((byte)1);
+ this.mSteam.amount = 24000;
+ }
+ if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) &&
+ (this.mInventory[2] != null)) {
+ if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Coal))))
+ {
+ this.mProcessingEnergy += 160;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ if (aBaseMetaTileEntity.getRandomNumber(3) == 0) {
+ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L));
+ }
+ }
+ else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Charcoal)))
+ {
+ this.mProcessingEnergy += 160;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ if (aBaseMetaTileEntity.getRandomNumber(3) == 0) {
+ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L));
+ }
+ }
+ else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCoke"))
+ {
+ this.mProcessingEnergy += 640;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ if (aBaseMetaTileEntity.getRandomNumber(2) == 0) {
+ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L));
+ }
+ }
+ else if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Lignite))))
+ {
+ this.mProcessingEnergy += 40;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ if (aBaseMetaTileEntity.getRandomNumber(8) == 0) {
+ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L));
+ }
+ }
+ }
+ if ((this.mTemperature < 1000) && (this.mProcessingEnergy > 0) && (aTick % 12L == 0L))
+ {
+ this.mProcessingEnergy -= 2;
+ this.mTemperature += 1;
+ }
+ aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
+ }
+ }
+
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
+ {
+ return (aIndex == 1) || (aIndex == 3);
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack)
+ {
+ return aIndex == 2;
+ }
+
+ public void doSound(byte aIndex, double aX, double aY, double aZ)
+ {
+ if (aIndex == 1)
+ {
+ GT_Utility.doSoundAtClient((String)GregTech_API.sSoundList.get(Integer.valueOf(4)), 2, 1.0F, aX, aY, aZ);
+ for (int l = 0; l < 8; l++) {
+ getBaseMetaTileEntity().getWorld().spawnParticle("largesmoke", aX - 0.5D + Math.random(), aY, aZ - 0.5D + Math.random(), 0.0D, 0.0D, 0.0D);
+ }
+ }
+ }
+
+ public int getCapacity()
+ {
+ return 16000;
+ }
+
+ public int getTankPressure()
+ {
+ return 100;
+ }
+}
diff --git a/src/Java/miscutil/gregtech/api/metatileentity/implementations/base/GregtechMetaSafeBlockBase.java b/src/Java/miscutil/gregtech/api/metatileentity/implementations/base/GregtechMetaSafeBlockBase.java
new file mode 100644
index 0000000000..6914e2d9d4
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/metatileentity/implementations/base/GregtechMetaSafeBlockBase.java
@@ -0,0 +1,343 @@
+package miscutil.gregtech.api.metatileentity.implementations.base;
+
+import static gregtech.api.enums.GT_Values.V;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Utility;
+import miscutil.core.handler.UnbreakableBlockManager;
+import miscutil.core.util.PlayerCache;
+import miscutil.core.util.Utils;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+
+public abstract class GregtechMetaSafeBlockBase extends GT_MetaTileEntity_TieredMachineBlock {
+ public boolean bOutput = false, bRedstoneIfFull = false, bInvert = false, bUnbreakable = false;
+ public int mSuccess = 0, mTargetStackSize = 0;
+ public String ownerUUID = "";
+ UnbreakableBlockManager Xasda = new UnbreakableBlockManager();
+ private boolean value_last = false, value_current = false;
+
+ public GregtechMetaSafeBlockBase(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription) {
+ super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription);
+ }
+
+ public GregtechMetaSafeBlockBase(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aInvSlotCount, aDescription, aTextures);
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[6][17][];
+ ITexture tIcon = getOverlayIcon(), tOut = new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_QCHEST), tUp = new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_VENT), tShitGoesWrong = new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE_ACTIVE);
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], tUp, tIcon}; //Back
+ rTextures[1][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], tIcon}; // Right, Strangely The top side as well when facing East?
+ rTextures[2][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], tIcon}; // Top And Bottom, When Facing South (What the hell?)
+ rTextures[3][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], tIcon}; // Left, Top if facing West and Bottom if facing east?
+ rTextures[4][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], tIcon}; // Top and Bottom when Facing North..
+ rTextures[5][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], tOut}; // Front
+ }
+ return rTextures;
+
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) return mTextures[5][aColorIndex + 1];
+ if (GT_Utility.getOppositeSide(aSide) == aFacing) return mTextures[0][aColorIndex + 1];
+ switch (aFacing) {
+ case 0:
+ return mTextures[4][aColorIndex + 1];
+ case 1:
+ return mTextures[2][aColorIndex + 1];
+ case 2:
+ switch (aSide) {
+ case 0:
+ return mTextures[2][aColorIndex + 1];
+ case 1:
+ return mTextures[2][aColorIndex + 1];
+ case 4:
+ return mTextures[1][aColorIndex + 1];
+ case 5:
+ return mTextures[3][aColorIndex + 1];
+ }
+ case 3:
+ switch (aSide) {
+ case 0:
+ return mTextures[4][aColorIndex + 1];
+ case 1:
+ return mTextures[4][aColorIndex + 1];
+ case 4:
+ return mTextures[3][aColorIndex + 1];
+ case 5:
+ return mTextures[1][aColorIndex + 1];
+ }
+ case 4:
+ switch (aSide) {
+ case 0:
+ return mTextures[3][aColorIndex + 1];
+ case 1:
+ return mTextures[1][aColorIndex + 1];
+ case 2:
+ return mTextures[3][aColorIndex + 1];
+ case 3:
+ return mTextures[1][aColorIndex + 1];
+ }
+ case 5:
+ switch (aSide) {
+ case 0:
+ return mTextures[1][aColorIndex + 1];
+ case 1:
+ return mTextures[3][aColorIndex + 1];
+ case 2:
+ return mTextures[1][aColorIndex + 1];
+ case 3:
+ return mTextures[3][aColorIndex + 1];
+ }
+ }
+ return mTextures[5][aColorIndex + 1];
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return aIndex < mInventory.length - 1;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return true;
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return true;
+ }
+
+ @Override
+ public boolean isInputFacing(byte aSide) {
+ return !isOutputFacing(aSide);
+ }
+
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return getBaseMetaTileEntity().getBackFacing() == aSide;
+ }
+
+ @Override
+ public boolean isTeleporterCompatible() {
+ return false;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return 512;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return 512 + V[mTier] * 50;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return V[mTier];
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return bOutput ? V[mTier] : 0;
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return 1;
+ }
+
+ @Override
+ public long maxAmperesOut() {
+ return 1;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ public abstract ITexture getOverlayIcon();
+
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+
+ if (aBaseMetaTileEntity.isClientSide()) {
+ //Utils.LOG_WARNING("Clicky Clicky.");
+ return true;
+
+ }
+ if (!aPlayer.equals(null)) {
+ String tempUUID = aPlayer.getUniqueID().toString();
+ PlayerCache.appendParamChanges(aPlayer.getDisplayName(), aPlayer.getUniqueID().toString());
+ if (ownerUUID.equals("")){
+ Utils.LOG_WARNING("No owner yet for this block.");
+ }
+ else {
+ Utils.LOG_WARNING("Current Owner: "+PlayerCache.lookupPlayerByUUID(ownerUUID)+" - UUID: "+ownerUUID);
+ }
+ Utils.LOG_WARNING("Is ownerUUID Null");
+ if (ownerUUID.equals("")){
+ Utils.LOG_WARNING("OwnerUUID is Null, let's set it.");
+ Utils.LOG_WARNING("Accessing Players UUID is: "+tempUUID);
+ ownerUUID = tempUUID;
+ //Utils.messagePlayer(aPlayer, "Owner of this safe, now set. Try accessing it again.");
+ Utils.LOG_WARNING("Block Owner is now set to: "+ownerUUID);
+ }
+ Utils.LOG_WARNING("No, it is not.");
+ Utils.LOG_WARNING("Checking ownerUUID.");
+ if (!ownerUUID.equals(null)){
+ Utils.LOG_WARNING("ownerUUID != Null, if accessor == owner.");
+ Utils.LOG_WARNING("Accessing is: "+PlayerCache.lookupPlayerByUUID(tempUUID));
+ if (ownerUUID.equals(tempUUID)){
+ Utils.LOG_WARNING("Owner's UUID: "+ownerUUID);
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ //Utils.LOG_WARNING("GUI should now be open for you sir.");
+ }
+ else {
+ Utils.messagePlayer(aPlayer, "Access Denied, This does not belong to you.");
+ Utils.messagePlayer(aPlayer, "it is owned by: "+PlayerCache.lookupPlayerByUUID(ownerUUID));
+ Utils.LOG_WARNING("Expecting Player : "+PlayerCache.lookupPlayerByUUID(ownerUUID));
+ Utils.LOG_ERROR("Access Denied.");
+ return true;
+ }
+
+ }
+
+ /*else {
+ Utils.LOG_ERROR("This is NOT good. Tell Draknyte1 your safe broke.");
+ }*/
+ /*Utils.LOG_WARNING("Clicky Clicky.");
+ Utils.messagePlayer(aPlayer, "Owner of this safe, now set.");
+ aBaseMetaTileEntity.openGUI(aPlayer); */
+
+ }
+ return true;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setBoolean("bUnbreakable", bUnbreakable);
+ aNBT.setBoolean("bOutput", bOutput);
+ aNBT.setBoolean("bRedstoneIfFull", bRedstoneIfFull);
+ aNBT.setInteger("mTargetStackSize", mTargetStackSize);
+ aNBT.setString("ownerUUID", ownerUUID);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ bUnbreakable = aNBT.getBoolean("bUnbreakable");
+ bOutput = aNBT.getBoolean("bOutput");
+ bRedstoneIfFull = aNBT.getBoolean("bRedstoneIfFull");
+ mTargetStackSize = aNBT.getInteger("mTargetStackSize");
+ ownerUUID = aNBT.getString("ownerUUID");
+ }
+
+ @Override
+ public void setItemNBT(NBTTagCompound aNBT) {
+ super.setItemNBT(aNBT);
+ if (mTargetStackSize > 0) aNBT.setInteger("mTargetStackSize", mTargetStackSize);
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (aSide == getBaseMetaTileEntity().getBackFacing()) {
+ mTargetStackSize = (byte) ((mTargetStackSize + (aPlayer.isSneaking()? -1 : 1)) % 65);
+ if (mTargetStackSize == 0) {
+ GT_Utility.sendChatToPlayer(aPlayer, "Do not regulate Item Stack Size");
+ } else {
+ GT_Utility.sendChatToPlayer(aPlayer, "Regulate Item Stack Size to: " + mTargetStackSize);
+ }
+ }
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
+ /*if (aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isUniversalEnergyStored(getMinimumStoredEU()) && (aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified() || aTimer % 200 == 0 || mSuccess > 0)) {
+ */
+ if (aBaseMetaTileEntity.isServerSide() && (aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified() || aTimer % 200 == 0 || mSuccess > 0)) {
+ value_last = value_current;
+ value_current = bUnbreakable;
+ if (value_last != value_current){
+ Utils.LOG_WARNING("VALUE CHANGE - Ticking for a moment.");
+ if (bUnbreakable == true){
+ //Xasda.setmTileEntity((BaseMetaTileEntity) aBaseMetaTileEntity);
+ //Utils.LOG_ERROR("Safe is Indestructible.");
+ this.getBaseMetaTileEntity().getBlock(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()).setResistance(Float.MAX_VALUE);
+ this.getBaseMetaTileEntity().getBlock(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()).setBlockUnbreakable();
+ }
+ else {
+ //Xasda.setmTileEntity((BaseMetaTileEntity) aBaseMetaTileEntity);
+ //Utils.LOG_ERROR("Safe is not Indestructible.");
+ this.getBaseMetaTileEntity().getBlock(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()).setResistance(1F);
+ this.getBaseMetaTileEntity().getBlock(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()).setHardness(2);
+
+ }
+ }
+ else {
+
+ }
+
+
+
+
+
+
+
+
+ /*mSuccess--;
+ moveItems(aBaseMetaTileEntity, aTimer);
+ aBaseMetaTileEntity.setGenericRedstoneOutput(bInvert);
+ if (bRedstoneIfFull) {
+ aBaseMetaTileEntity.setGenericRedstoneOutput(!bInvert);
+ for (int i = 0; i < mInventory.length; i++)
+ if (isValidSlot(i)) {
+ if (mInventory[i] == null) {
+ aBaseMetaTileEntity.setGenericRedstoneOutput(bInvert);
+ aBaseMetaTileEntity.decreaseStoredEnergyUnits(1, true);
+ break;
+ }
+ }
+ }
+ }*/
+ }
+ }
+
+ /*protected void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
+ int tCost = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getBackFacing()), aBaseMetaTileEntity.getBackFacing(), aBaseMetaTileEntity.getFrontFacing(), null, false, mTargetStackSize == 0 ? 64 : (byte) mTargetStackSize, mTargetStackSize == 0 ? 1 : (byte) mTargetStackSize, (byte) 64, (byte) 1);
+ if (tCost > 0 || aBaseMetaTileEntity.hasInventoryBeenModified()) {
+ mSuccess = 50;
+ aBaseMetaTileEntity.decreaseStoredEnergyUnits(Math.abs(tCost), true);
+ }
+ }*/
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return aSide != aBaseMetaTileEntity.getBackFacing();
+ }
+} \ No newline at end of file
diff --git a/src/Java/miscutil/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java b/src/Java/miscutil/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java
new file mode 100644
index 0000000000..de9a98c644
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java
@@ -0,0 +1,67 @@
+package miscutil.gregtech.api.metatileentity.implementations.base;
+
+import static gregtech.api.enums.GT_Values.GT;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.metatileentity.MetaTileEntity;
+import net.minecraft.util.EnumChatFormatting;
+
+public abstract class GregtechMetaTileEntity extends MetaTileEntity {
+ /**
+ * Value between [0 - 9] to describe the Tier of this Machine.
+ */
+ public final byte mTier;
+
+ /**
+ * A simple Description.
+ */
+ public final String mDescription;
+
+ /**
+ * Contains all Textures used by this Block.
+ */
+ public final ITexture[][][] mTextures;
+
+ public GregtechMetaTileEntity(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription, ITexture... aTextures) {
+ super(aID, aName, aNameRegional, aInvSlotCount);
+ mTier = (byte)Math.max(0, Math.min(aTier, 9));
+ mDescription = aDescription;
+
+ // must always be the last call!
+ if (GT.isClientSide()) mTextures = getTextureSet(aTextures); else mTextures = null;
+ }
+
+ public GregtechMetaTileEntity(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aInvSlotCount);
+ mTier = (byte)aTier;
+ mDescription = aDescription;
+ mTextures = aTextures;
+
+ }
+
+ @Override
+ public byte getTileEntityBaseType() {
+ return (byte)(Math.min(3, mTier<=0?0:1+((mTier-1) / 4)));
+ }
+
+ @Override
+ public long getInputTier() {
+ return mTier;
+ }
+
+ @Override
+ public long getOutputTier() {
+ return mTier;
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {mDescription, "Added by: " + EnumChatFormatting.DARK_GREEN+"Alkalus"};
+ }
+
+ /**
+ * Used Client Side to get a Texture Set for this Block.
+ * Called after setting the Tier and the Description so that those two are accessible.
+ * @param aTextures is the optional Array you can give to the Constructor.
+ */
+ public abstract ITexture[][][] getTextureSet(ITexture[] aTextures);
+} \ No newline at end of file
diff --git a/src/Java/miscutil/gregtech/api/metatileentity/implementations/base/GregtechSteelBoiler.java b/src/Java/miscutil/gregtech/api/metatileentity/implementations/base/GregtechSteelBoiler.java
new file mode 100644
index 0000000000..0a6920c794
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/metatileentity/implementations/base/GregtechSteelBoiler.java
@@ -0,0 +1,290 @@
+package miscutil.gregtech.api.metatileentity.implementations.base;
+
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.common.gui.GT_Container_Boiler;
+import gregtech.common.gui.GT_GUIContainer_Boiler;
+import gregtech.common.tileentities.boilers.GT_MetaTileEntity_Boiler;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.IFluidHandler;
+
+public class GregtechSteelBoiler
+ extends GT_MetaTileEntity_Boiler
+{
+ public GregtechSteelBoiler(int aID, String aName, String aNameRegional, int aTier, String aDescription)
+ {
+ super(aID, aName, aNameRegional, "Put it to good use!", new ITexture[0]);
+ }
+
+ public GregtechSteelBoiler(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
+ {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ public ITexture[][][] getTextureSet(ITexture[] aTextures)
+ {
+ ITexture[][][] rTextures = new ITexture[5][17][];
+ for (byte i = -1; i < 16; i = (byte)(i + 1))
+ {ITexture[] tmp0 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) };
+ rTextures[0][(i + 1)] = tmp0;
+ ITexture[] tmp1 ={ new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_SIDE)};
+rTextures[1][(i + 1)] = tmp1;
+ ITexture[] tmp2 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) };
+rTextures[2][(i + 1)] = tmp2;
+ ITexture[] tmp4 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT) };
+rTextures[3][(i + 1)] = tmp4;
+ ITexture[] tmp5 ={ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE) };
+rTextures[4][(i + 1)] = tmp5;
+ }
+ return rTextures;
+ }
+
+ public int maxProgresstime()
+ {
+ return 1000;
+ }
+
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
+ {
+ return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 32000);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity)
+ {
+ return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SteelBoiler.png", 32000);
+ }
+
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
+ {
+ return new GregtechSteelBoiler(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick)
+ {
+ if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L))
+ {
+ if (this.mTemperature <= 20)
+ {
+ this.mTemperature = 20;
+ this.mLossTimer = 0;
+ }
+ if (++this.mLossTimer > 40)
+ {
+ this.mTemperature -= 1;
+ this.mLossTimer = 0;
+ }
+ for (byte i = 1; (this.mSteam != null) && (i < 6); i = (byte)(i + 1)) {
+ if (i != aBaseMetaTileEntity.getFrontFacing())
+ {
+ IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i);
+ if (tTileEntity != null)
+ {
+ FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false);
+ if (tDrained != null)
+ {
+ int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false);
+ if (tFilledAmount > 0) {
+ tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true);
+ }
+ }
+ }
+ }
+ }
+ if (aTick % 10L == 0L) {
+ if (this.mTemperature > 100)
+ {
+ if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0))
+ {
+ this.mHadNoWater = true;
+ }
+ else
+ {
+ if (this.mHadNoWater)
+ {
+ aBaseMetaTileEntity.doExplosion(2048L);
+ return;
+ }
+ this.mFluid.amount -= 1;
+ if (this.mSteam == null) {
+ this.mSteam = GT_ModHandler.getSteam(150L);
+ } else if (GT_ModHandler.isSteam(this.mSteam)) {
+ this.mSteam.amount += 150;
+ } else {
+ this.mSteam = GT_ModHandler.getSteam(150L);
+ }
+ }
+ }
+ else {
+ this.mHadNoWater = false;
+ }
+ }
+ if ((this.mSteam != null) &&
+ (this.mSteam.amount > 32000))
+ {
+ sendSound((byte)1);
+ this.mSteam.amount = 24000;
+ }
+ if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) &&
+ (this.mInventory[2] != null)) {
+ if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Coal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Coal))))
+ {
+ this.mProcessingEnergy += 160;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ if (aBaseMetaTileEntity.getRandomNumber(3) == 0) {
+ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L));
+ }
+ }
+ else if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Charcoal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Charcoal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Charcoal))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Charcoal))))
+ {
+ this.mProcessingEnergy += 160;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ if (aBaseMetaTileEntity.getRandomNumber(3) == 0) {
+ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L));
+ }
+ }
+ else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCoke"))
+ {
+ this.mProcessingEnergy += 640;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ if (aBaseMetaTileEntity.getRandomNumber(2) == 0) {
+ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L));
+ }
+ }
+ else if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Lignite))))
+ {
+ this.mProcessingEnergy += 40;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ if (aBaseMetaTileEntity.getRandomNumber(8) == 0) {
+ aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L));
+ }
+ }
+ }
+ if ((this.mTemperature < 1000) && (this.mProcessingEnergy > 0) && (aTick % 12L == 0L))
+ {
+ this.mProcessingEnergy -= 2;
+ this.mTemperature += 1;
+ }
+ aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
+ }
+ }
+
+@Override
+public int[] getAccessibleSlotsFromSide(int p_94128_1_) {
+ // TODO Auto-generated method stub
+ return null;
+}
+
+@Override
+public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_,
+ int p_102007_3_) {
+ // TODO Auto-generated method stub
+ return false;
+}
+
+@Override
+public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_,
+ int p_102008_3_) {
+ // TODO Auto-generated method stub
+ return false;
+}
+
+@Override
+public int getSizeInventory() {
+ // TODO Auto-generated method stub
+ return 0;
+}
+
+@Override
+public ItemStack getStackInSlot(int p_70301_1_) {
+ // TODO Auto-generated method stub
+ return null;
+}
+
+@Override
+public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) {
+ // TODO Auto-generated method stub
+ return null;
+}
+
+@Override
+public ItemStack getStackInSlotOnClosing(int p_70304_1_) {
+ // TODO Auto-generated method stub
+ return null;
+}
+
+@Override
+public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) {
+ // TODO Auto-generated method stub
+
+}
+
+@Override
+public String getInventoryName() {
+ // TODO Auto-generated method stub
+ return null;
+}
+
+@Override
+public boolean hasCustomInventoryName() {
+ // TODO Auto-generated method stub
+ return false;
+}
+
+@Override
+public int getInventoryStackLimit() {
+ // TODO Auto-generated method stub
+ return 0;
+}
+
+@Override
+public void markDirty() {
+ // TODO Auto-generated method stub
+
+}
+
+@Override
+public boolean isUseableByPlayer(EntityPlayer p_70300_1_) {
+ // TODO Auto-generated method stub
+ return false;
+}
+
+@Override
+public void openInventory() {
+ // TODO Auto-generated method stub
+
+}
+
+@Override
+public void closeInventory() {
+ // TODO Auto-generated method stub
+
+}
+
+@Override
+public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) {
+ // TODO Auto-generated method stub
+ return false;
+}
+}
+
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+
+ * Qualified Name: gregtech.common.tileentities.boilers.GT_MetaTileEntity_Boiler_Steel
+
+ * JD-Core Version: 0.7.0.1
+
+ */ \ No newline at end of file
diff --git a/src/Java/miscutil/gregtech/api/util/IMessage.java b/src/Java/miscutil/gregtech/api/util/IMessage.java
new file mode 100644
index 0000000000..4a1fa2d684
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/util/IMessage.java
@@ -0,0 +1,21 @@
+package miscutil.gregtech.api.util;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.util.ChatComponentText;
+
+public class IMessage {
+
+ public static void messageThePlayer(String s){
+ if(Minecraft.getMinecraft().thePlayer.worldObj.isRemote){
+ Minecraft.getMinecraft().thePlayer.addChatComponentMessage(new ChatComponentText(s));
+ }
+ else if(!Minecraft.getMinecraft().thePlayer.worldObj.isRemote){
+ Minecraft.getMinecraft().thePlayer.addChatComponentMessage(new ChatComponentText(s));
+ }
+ }
+
+ public void messageOtherPlayer(String s){
+ Minecraft.getMinecraft().thePlayer.addChatComponentMessage(new ChatComponentText(s));
+ }
+
+}
diff --git a/src/Java/miscutil/gregtech/api/util/VanillaChatCommandSender.java b/src/Java/miscutil/gregtech/api/util/VanillaChatCommandSender.java
new file mode 100644
index 0000000000..1971c79aeb
--- /dev/null
+++ b/src/Java/miscutil/gregtech/api/util/VanillaChatCommandSender.java
@@ -0,0 +1,35 @@
+package miscutil.gregtech.api.util;
+
+import net.minecraft.util.ChunkCoordinates;
+import net.minecraft.util.IChatComponent;
+import net.minecraft.world.World;
+
+public interface VanillaChatCommandSender {
+
+ /**
+ * Gets the name of this command sender (usually username, but possibly "Rcon")
+ */
+ String getCommandSenderName();
+
+ IChatComponent func_145748_c_();
+
+ /**
+ * Notifies this sender of some sort of information. This is for messages intended to display to the user. Used
+ * for typical output (like "you asked for whether or not this game rule is set, so here's your answer"), warnings
+ * (like "I fetched this block for you by ID, but I'd like you to know that every time you do this, I die a little
+ * inside"), and errors (like "it's not called iron_pixacke, silly").
+ */
+ void addChatMessage(IChatComponent p_145747_1_);
+
+ /**
+ * Returns true if the command sender is allowed to use the given command.
+ */
+ boolean canCommandSenderUseCommand(int p_70003_1_, String p_70003_2_);
+
+ /**
+ * Return the position for this command sender.
+ */
+ ChunkCoordinates getPlayerCoordinates();
+
+ World getEntityWorld();
+ }