aboutsummaryrefslogtreecommitdiff
path: root/src/Java/miscutil/core/xmod
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/miscutil/core/xmod')
-rw-r--r--src/Java/miscutil/core/xmod/forestry/HANDLER_Forestry.java28
-rw-r--r--src/Java/miscutil/core/xmod/forestry/apiculture/blocks/FR_BlockAlveary.java219
-rw-r--r--src/Java/miscutil/core/xmod/forestry/apiculture/blocks/FR_BlockRegistryApiculture.java41
-rw-r--r--src/Java/miscutil/core/xmod/forestry/apiculture/items/FR_ItemHiveFrame.java67
-rw-r--r--src/Java/miscutil/core/xmod/forestry/apiculture/items/FR_ItemRegistryApiculture.java58
-rw-r--r--src/Java/miscutil/core/xmod/forestry/apiculture/items/magicbees/FR_StringManager.java30
-rw-r--r--src/Java/miscutil/core/xmod/forestry/apiculture/items/magicbees/MB_HiveFrameType.java107
-rw-r--r--src/Java/miscutil/core/xmod/forestry/apiculture/items/magicbees/MB_ItemMagicHiveFrame.java62
-rw-r--r--src/Java/miscutil/core/xmod/forestry/apiculture/multiblock/FR_TileAlveary.java199
-rw-r--r--src/Java/miscutil/core/xmod/forestry/apiculture/multiblock/TileAlvearyMutatron.java232
-rw-r--r--src/Java/miscutil/core/xmod/forestry/apiculture/multiblock/inventory/FR_ContainerAlvearyMutatron.java28
-rw-r--r--src/Java/miscutil/core/xmod/forestry/apiculture/multiblock/inventory/FR_GuiAlvearyMutatron.java26
-rw-r--r--src/Java/miscutil/core/xmod/forestry/apiculture/multiblock/inventory/FR_InventoryMutatron.java29
-rw-r--r--src/Java/miscutil/core/xmod/forestry/apiculture/multiblock/inventory/MutatronHandler.java22
-rw-r--r--src/Java/miscutil/core/xmod/forestry/apiculture/tiles/FR_TileHandler.java14
-rw-r--r--src/Java/miscutil/core/xmod/forestry/core/gui/FR_FontRenderer.java111
-rw-r--r--src/Java/miscutil/core/xmod/forestry/core/gui/FR_GuiForestry.java272
-rw-r--r--src/Java/miscutil/core/xmod/forestry/core/gui/FR_GuiForestryTitled.java33
-rw-r--r--src/Java/miscutil/core/xmod/forestry/core/gui/FR_GuiUtil.java145
-rw-r--r--src/Java/miscutil/core/xmod/forestry/core/gui/FR_WidgetManager.java90
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/HANDLER_Gregtech.java41
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/energy/IC2ElectricItem.java55
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/energy/IC2ElectricItemManager.java95
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechItemList.java203
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechOreDictNames.java39
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechOrePrefixes.java776
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechTextureSet.java144
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechTextures.java200
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/gui/CONTAINER_IronBlastFurnace.java31
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java35
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/gui/CONTAINER_SafeBlock.java120
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/gui/CONTAINER_SteamCondenser.java97
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/gui/GUI_IronBlastFurnace.java30
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/gui/GUI_MultiMachine.java63
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/gui/GUI_SafeBlock.java49
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/gui/GUI_SteamCondenser.java55
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/interfaces/GregtechItemContainer.java24
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java24
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/Interface_ItemBehaviour.java41
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java16
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator_GT.java16
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java155
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/items/Gregtech_Generic_Item.java176
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/items/Gregtech_MetaItem.java323
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/items/Gregtech_MetaItem_Base.java549
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/items/Gregtech_MetaItem_X32.java194
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/items/Gregtech_MetaTool.java605
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/GregtechMetaCondensor.java164
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/GregtechMetaEnergyBuffer.java402
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java235
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/GregtechMetaSafeBlock.java76
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaBoilerBase.java328
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaSafeBlockBase.java343
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java67
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java805
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/base/GregtechRocketFuelGeneratorBase.java263
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/base/GregtechSteelBoiler.java290
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/creative/GregtechMetaCreativeEnergyBuffer.java268
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/objects/GregtechFluid.java27
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/objects/GregtechItemData.java130
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/objects/GregtechMaterialStack.java42
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/objects/GregtechRenderedTexture.java162
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/util/GregtechOreDictUnificator.java366
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/util/GregtechRecipe.java677
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/api/util/GregtechRecipeRegistrator.java339
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/common/GregtechRecipeAdder.java119
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/common/Meta_GT_Proxy.java386
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java457
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java140
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaCasingItems.java11
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java33
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java45
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java36
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java155
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java24
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java119
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityElectricBlastFurnace.java236
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java452
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCokeOven.java267
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialPlatePress.java249
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIronBlastFurnace.java369
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/common/tools/TOOL_Gregtech_Base.java168
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/common/tools/TOOL_Gregtech_BaseMultiblockItem.java49
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/common/tools/TOOL_Gregtech_MaxEfficiencyMultiBlockItem.java27
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/loaders/Processing_Block.java107
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/loaders/Processing_Ingot1.java68
-rw-r--r--src/Java/miscutil/core/xmod/gregtech/loaders/Processing_Plate1.java56
-rw-r--r--src/Java/miscutil/core/xmod/growthcraft/HANDLER_Growthcraft.java65
-rw-r--r--src/Java/miscutil/core/xmod/psychedelicraft/HANDLER_Psychedelicraft.java27
-rw-r--r--src/Java/miscutil/core/xmod/psychedelicraft/fluids/PS_Fluids.java54
-rw-r--r--src/Java/miscutil/core/xmod/thermalfoundation/HANDLER_ThermalFoundation.java37
-rw-r--r--src/Java/miscutil/core/xmod/thermalfoundation/block/TF_Block_Fluid_Cryotheum.java188
-rw-r--r--src/Java/miscutil/core/xmod/thermalfoundation/block/TF_Block_Fluid_Pyrotheum.java181
-rw-r--r--src/Java/miscutil/core/xmod/thermalfoundation/block/TF_Blocks.java26
-rw-r--r--src/Java/miscutil/core/xmod/thermalfoundation/fluid/TF_Fluids.java53
-rw-r--r--src/Java/miscutil/core/xmod/thermalfoundation/item/TF_Items.java79
-rw-r--r--src/Java/miscutil/core/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java62
97 files changed, 15298 insertions, 0 deletions
diff --git a/src/Java/miscutil/core/xmod/forestry/HANDLER_Forestry.java b/src/Java/miscutil/core/xmod/forestry/HANDLER_Forestry.java
new file mode 100644
index 0000000000..94beb5618e
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/forestry/HANDLER_Forestry.java
@@ -0,0 +1,28 @@
+package miscutil.core.xmod.forestry;
+
+import miscutil.core.lib.LoadedMods;
+import miscutil.core.xmod.forestry.apiculture.blocks.FR_BlockRegistryApiculture;
+import miscutil.core.xmod.forestry.apiculture.items.FR_ItemRegistryApiculture;
+import miscutil.core.xmod.forestry.apiculture.tiles.FR_TileHandler;
+
+public class HANDLER_Forestry {
+
+ public static void preInit(){
+ if (LoadedMods.Forestry){
+ FR_ItemRegistryApiculture.RegisterApiculture();
+ FR_BlockRegistryApiculture.RegistryApiculture();
+ }
+ }
+
+ public static void Init(){
+ if (LoadedMods.Forestry){
+ FR_TileHandler.init();
+ }
+ }
+
+ public static void postInit(){
+ if (LoadedMods.Forestry){
+
+ }
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/forestry/apiculture/blocks/FR_BlockAlveary.java b/src/Java/miscutil/core/xmod/forestry/apiculture/blocks/FR_BlockAlveary.java
new file mode 100644
index 0000000000..62669ef8d0
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/forestry/apiculture/blocks/FR_BlockAlveary.java
@@ -0,0 +1,219 @@
+/*******************************************************************************
+ * Copyright (c) 2011-2014 SirSengir.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Lesser Public License v3
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Various Contributors including, but not limited to:
+ * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
+ ******************************************************************************/
+package miscutil.core.xmod.forestry.apiculture.blocks;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import miscutil.core.creative.AddToCreativeTab;
+import miscutil.core.xmod.forestry.apiculture.multiblock.TileAlvearyMutatron;
+import net.minecraft.block.Block;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import forestry.apiculture.MaterialBeehive;
+import forestry.apiculture.multiblock.TileAlveary;
+import forestry.core.blocks.BlockStructure;
+import forestry.core.render.TextureManager;
+
+public class FR_BlockAlveary extends BlockStructure {
+ public enum Type {
+ PLAIN,
+ MUTATRON;
+ public static final Type[] VALUES = values();
+ }
+
+ public FR_BlockAlveary() {
+ super(new MaterialBeehive(false));
+ setHardness(1.0f);
+ setCreativeTab(AddToCreativeTab.tabMisc);
+ setHarvestLevel("axe", 0);
+ }
+
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void getSubBlocks(Item item, CreativeTabs tab, List list) {
+ for (int i = 0; i < 8; i++) {
+ if (i == 1) {
+ continue;
+ }
+ list.add(new ItemStack(item, 1, i));
+ }
+ }
+
+ @Override
+ public int getRenderType() {
+ return 0;
+ }
+
+ @Override
+ public boolean renderAsNormalBlock() {
+ return true;
+ }
+
+ @Override
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
+ ArrayList<ItemStack> drop = new ArrayList<>();
+ drop.add(new ItemStack(this, 1, metadata != 1 ? metadata : 0));
+ return drop;
+ }
+
+ @Override
+ public int getDamageValue(World world, int x, int y, int z) {
+ int meta = world.getBlockMetadata(x, y, z);
+ return meta != 1 ? meta : 0;
+ }
+
+ /* TILE ENTITY CREATION */
+ @Override
+ public TileEntity createTileEntity(World world, int metadata) {
+ if (metadata < 0 || metadata > Type.VALUES.length) {
+ return null;
+ }
+ return new TileAlvearyMutatron();
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(World world, int meta) {
+ return createTileEntity(world, meta);
+ }
+
+ /* ICONS */
+ public static final int PLAIN = 0;
+ public static final int ENTRANCE = 1;
+ public static final int BOTTOM = 2;
+ public static final int LEFT = 3;
+ public static final int RIGHT = 4;
+ public static final int MUTATRON_OFF = 5;
+ public static final int MUTATRON_ON = 6;
+
+ @SideOnly(Side.CLIENT)
+ private IIcon[] icons;
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public void registerBlockIcons(IIconRegister register) {
+ icons = new IIcon[7];
+ icons[0] = TextureManager.registerTex(register, "apiculture/alveary.plain");
+ icons[1] = TextureManager.registerTex(register, "apiculture/alveary.entrance");
+ icons[2] = TextureManager.registerTex(register, "apiculture/alveary.bottom");
+ icons[3] = TextureManager.registerTex(register, "apiculture/alveary.left");
+ icons[4] = TextureManager.registerTex(register, "apiculture/alveary.right");
+ icons[5] = TextureManager.registerTex(register, "apiculture/alveary.mutatron.off");
+ icons[6] = TextureManager.registerTex(register, "apiculture/alveary.mutatron.on");
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public IIcon getIcon(int side, int metadata) {
+ if ((metadata <= 1 /*|| metadata == Type.MUTATRON.ordinal()*/) && (side == 1 || side == 0)) {
+ return icons[BOTTOM];
+ }
+ return icons[MUTATRON_OFF];
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
+ int meta = world.getBlockMetadata(x, y, z);
+
+ if (meta == 1) {
+ return this.getIcon(side, meta);
+ } else if (meta > 1) {
+ return getBlockTextureFromSideAndTile(world, x, y, z, side);
+ }
+
+ Block blockXP = world.getBlock(x + 1, y, z);
+ Block blockXM = world.getBlock(x - 1, y, z);
+
+ if (blockXP == this && blockXM != this) {
+
+ if (world.getBlockMetadata(x + 1, y, z) == 1) {
+
+ if (world.getBlock(x, y, z + 1) != this) {
+ return switchForSide(42, side);
+ } else {
+ return switchForSide(41, side);
+ }
+
+ } else {
+ return this.getIcon(side, meta);
+ }
+
+ } else if (blockXP != this && blockXM == this) {
+ if (world.getBlockMetadata(x - 1, y, z) == 1) {
+
+ if (world.getBlock(x, y, z + 1) != this) {
+ return switchForSide(41, side);
+ } else {
+ return switchForSide(42, side);
+ }
+
+ } else {
+ return this.getIcon(side, meta);
+ }
+ }
+
+ return this.getIcon(side, meta);
+ }
+
+ @SideOnly(Side.CLIENT)
+ private IIcon getBlockTextureFromSideAndTile(IBlockAccess world, int x, int y, int z, int side) {
+ TileEntity tile = world.getTileEntity(x, y, z);
+ if (!(tile instanceof TileAlveary)) {
+ return getIcon(side, 0);
+ }
+
+ return icons[((TileAlveary) tile).getIcon(side)];
+ }
+
+ @SideOnly(Side.CLIENT)
+ private IIcon switchForSide(int textureId, int side) {
+
+ if (side == 4 || side == 5) {
+ if (textureId == 41) {
+ return icons[LEFT];
+ } else {
+ return icons[RIGHT];
+ }
+ } else if (textureId == 41) {
+ return icons[RIGHT];
+ } else {
+ return icons[LEFT];
+ }
+
+ }
+
+ @Override
+ public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
+ super.onNeighborBlockChange(world, x, y, z, block);
+
+ TileEntity tileEntity = world.getTileEntity(x, y, z);
+ if (tileEntity instanceof TileAlveary) {
+ TileAlveary tileAlveary = (TileAlveary) tileEntity;
+
+ // We must check that the slabs on top were not removed
+ tileAlveary.getMultiblockLogic().getController().reassemble();
+ }
+ }
+
+ public ItemStack get(Type type) {
+ return new ItemStack(this, 1, type.ordinal());
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/forestry/apiculture/blocks/FR_BlockRegistryApiculture.java b/src/Java/miscutil/core/xmod/forestry/apiculture/blocks/FR_BlockRegistryApiculture.java
new file mode 100644
index 0000000000..ebde18655f
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/forestry/apiculture/blocks/FR_BlockRegistryApiculture.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2011-2014 SirSengir.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Lesser Public License v3
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Various Contributors including, but not limited to:
+ * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
+ ******************************************************************************/
+package miscutil.core.xmod.forestry.apiculture.blocks;
+
+import miscutil.core.lib.CORE;
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemBlock;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.oredict.OreDictionary;
+import cpw.mods.fml.common.registry.GameRegistry;
+import forestry.core.blocks.BlockRegistry;
+import forestry.core.items.ItemBlockForestry;
+import forestry.core.utils.StringUtil;
+public class FR_BlockRegistryApiculture extends BlockRegistry {
+
+ public static FR_BlockAlveary alveary;
+
+ public static void RegistryApiculture() {
+ if (CORE.DEBUG){
+ alveary = registerBlock2(new FR_BlockAlveary(), ItemBlockForestry.class, "alveary");
+ }
+ }
+
+ protected static <T extends Block> T registerBlock2(T block, Class<? extends ItemBlock> itemClass, String name, Object... itemCtorArgs) {
+ block.setBlockName(name);
+ GameRegistry.registerBlock(block, itemClass, StringUtil.cleanBlockName(block), itemCtorArgs);
+ return block;
+ }
+
+ protected static void registerOreDictWildcard(String oreDictName, Block block) {
+ OreDictionary.registerOre(oreDictName, new ItemStack(block, 1, OreDictionary.WILDCARD_VALUE));
+ }
+} \ No newline at end of file
diff --git a/src/Java/miscutil/core/xmod/forestry/apiculture/items/FR_ItemHiveFrame.java b/src/Java/miscutil/core/xmod/forestry/apiculture/items/FR_ItemHiveFrame.java
new file mode 100644
index 0000000000..cd517fd1ad
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/forestry/apiculture/items/FR_ItemHiveFrame.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2011-2014 SirSengir.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Lesser Public License v3
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Various Contributors including, but not limited to:
+ * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
+ ******************************************************************************/
+package miscutil.core.xmod.forestry.apiculture.items;
+
+import miscutil.core.creative.AddToCreativeTab;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import forestry.api.apiculture.DefaultBeeModifier;
+import forestry.api.apiculture.IBee;
+import forestry.api.apiculture.IBeeGenome;
+import forestry.api.apiculture.IBeeHousing;
+import forestry.api.apiculture.IBeeModifier;
+import forestry.api.apiculture.IHiveFrame;
+
+public class FR_ItemHiveFrame extends Item implements IHiveFrame {
+
+ private final IBeeModifier beeModifier;
+
+ public FR_ItemHiveFrame(int maxDamage, float geneticDecay) {
+ setMaxStackSize(1);
+ setMaxDamage(maxDamage);
+ setCreativeTab(AddToCreativeTab.tabMisc);
+
+ this.beeModifier = new HiveFrameBeeModifier(geneticDecay);
+ }
+
+ @Override
+ public ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear) {
+ frame.setItemDamage(frame.getItemDamage() + wear);
+ if (frame.getItemDamage() >= frame.getMaxDamage()) {
+ return null;
+ } else {
+ return frame;
+ }
+ }
+
+ @Override
+ public IBeeModifier getBeeModifier() {
+ return beeModifier;
+ }
+
+ private static class HiveFrameBeeModifier extends DefaultBeeModifier {
+ private final float geneticDecay;
+
+ public HiveFrameBeeModifier(float geneticDecay) {
+ this.geneticDecay = geneticDecay;
+ }
+
+ @Override
+ public float getProductionModifier(IBeeGenome genome, float currentModifier) {
+ return (currentModifier < 10f) ? 2f : 1f;
+ }
+
+ @Override
+ public float getGeneticDecay(IBeeGenome genome, float currentModifier) {
+ return this.geneticDecay;
+ }
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/forestry/apiculture/items/FR_ItemRegistryApiculture.java b/src/Java/miscutil/core/xmod/forestry/apiculture/items/FR_ItemRegistryApiculture.java
new file mode 100644
index 0000000000..f2a64a9f90
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/forestry/apiculture/items/FR_ItemRegistryApiculture.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2011-2014 SirSengir.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Lesser Public License v3
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Various Contributors including, but not limited to:
+ * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
+ ******************************************************************************/
+package miscutil.core.xmod.forestry.apiculture.items;
+import miscutil.core.xmod.forestry.apiculture.items.magicbees.MB_HiveFrameType;
+import miscutil.core.xmod.forestry.apiculture.items.magicbees.MB_ItemMagicHiveFrame;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.WeightedRandomChestContent;
+import net.minecraftforge.common.ChestGenHooks;
+import cpw.mods.fml.common.registry.GameRegistry;
+import forestry.core.items.ItemRegistry;
+import forestry.core.utils.StringUtil;
+
+public class FR_ItemRegistryApiculture extends ItemRegistry {
+
+
+ //----- Apiary Frames ----------------------
+ public static FR_ItemHiveFrame frameUntreated;
+ public static FR_ItemHiveFrame frameImpregnated;
+ public static FR_ItemHiveFrame frameProven;
+ //Magic Bee Frame Items
+ public static MB_ItemMagicHiveFrame hiveFrameMetabolic;
+ public static MB_ItemMagicHiveFrame hiveFrameOblivion;
+
+ public static void RegisterApiculture() {
+
+ //Forestry Frames
+ //frameUntreated = registerItem(new FR_ItemHiveFrame(80, 0.9f), "frameUntreated");
+ //frameImpregnated = registerItem(new FR_ItemHiveFrame(240, 0.4f), "frameImpregnated");
+ //frameProven = registerItem(new FR_ItemHiveFrame(720, 0.3f), "frameProven");
+
+ //Magic Bee like Frames
+ hiveFrameMetabolic = new MB_ItemMagicHiveFrame(MB_HiveFrameType.ACCELERATED);
+ hiveFrameOblivion = new MB_ItemMagicHiveFrame(MB_HiveFrameType.VOID);
+ ChestGenHooks.addItem(ChestGenHooks.STRONGHOLD_CORRIDOR, new WeightedRandomChestContent(new ItemStack(hiveFrameOblivion), 1, 1, 18));
+ ChestGenHooks.addItem(ChestGenHooks.STRONGHOLD_LIBRARY, new WeightedRandomChestContent(new ItemStack(hiveFrameOblivion), 1, 3, 23));
+
+
+
+
+ }
+
+ protected static <T extends Item> T registerItem(T item, String name) {
+ item.setUnlocalizedName(name);
+ GameRegistry.registerItem(item, StringUtil.cleanItemName(item));
+ return item;
+ }
+}
+
+
diff --git a/src/Java/miscutil/core/xmod/forestry/apiculture/items/magicbees/FR_StringManager.java b/src/Java/miscutil/core/xmod/forestry/apiculture/items/magicbees/FR_StringManager.java
new file mode 100644
index 0000000000..f08f1fd542
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/forestry/apiculture/items/magicbees/FR_StringManager.java
@@ -0,0 +1,30 @@
+package miscutil.core.xmod.forestry.apiculture.items.magicbees;
+
+import net.minecraft.util.StatCollector;
+
+public class FR_StringManager
+{
+ public static String getLocalizedString(String key)
+ {
+ if(StatCollector.canTranslate(key))
+ {
+ return StatCollector.translateToLocal(key);
+ }
+ else
+ {
+ return StatCollector.translateToFallback(key);
+ }
+ }
+
+ public static String getLocalizedString(String key, Object... objects)
+ {
+ if(StatCollector.canTranslate(key))
+ {
+ return String.format(StatCollector.translateToLocal(key), objects);
+ }
+ else
+ {
+ return String.format(StatCollector.translateToFallback(key), objects);
+ }
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/forestry/apiculture/items/magicbees/MB_HiveFrameType.java b/src/Java/miscutil/core/xmod/forestry/apiculture/items/magicbees/MB_HiveFrameType.java
new file mode 100644
index 0000000000..5921867eae
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/forestry/apiculture/items/magicbees/MB_HiveFrameType.java
@@ -0,0 +1,107 @@
+package miscutil.core.xmod.forestry.apiculture.items.magicbees;
+
+import forestry.api.apiculture.IBeeGenome;
+import forestry.api.apiculture.IBeeModifier;
+
+public enum MB_HiveFrameType implements IBeeModifier
+{
+ ACCELERATED("Accelerated", 175, 1f, 2.5f, 0.9f, 1.8f, 1f),
+ VOID("Void", 20, 1f, 1f, 0.0001f, 10f, 1f);
+
+ private final String frameName;
+ public final int maxDamage;
+
+ private final float territoryMod;
+ private final float mutationMod;
+ private final float lifespanMod;
+ private final float productionMod;
+ private final float floweringMod;
+ private final float geneticDecayMod;
+ private final boolean isSealed;
+ private final boolean isLit;
+ private final boolean isSunlit;
+ private final boolean isHellish;
+
+ MB_HiveFrameType(String name, int damage, float territory, float mutation, float lifespan, float production, float geneticDecay) {
+ this(name, damage, territory, mutation, lifespan, production, 1f, geneticDecay, false, false, false, false);
+ }
+
+ MB_HiveFrameType(String name, int damage,
+ float territory, float mutation, float lifespan, float production, float flowering, float geneticDecay,
+ boolean sealed, boolean lit, boolean sunlit, boolean hellish)
+ {
+ this.frameName = name;
+ this.maxDamage = damage;
+
+ this.territoryMod = territory;
+ this.mutationMod = mutation;
+ this.lifespanMod = lifespan;
+ this.productionMod = production;
+ this.floweringMod = flowering;
+ this.geneticDecayMod = geneticDecay;
+ this.isSealed = sealed;
+ this.isLit = lit;
+ this.isSunlit = sunlit;
+ this.isHellish = hellish;
+ }
+
+ public String getName()
+ {
+ return this.frameName;
+ }
+
+ public String getLocalizedName()
+ {
+ return FR_StringManager.getLocalizedString("frame." + this.frameName);
+ }
+
+ @Override
+ public float getTerritoryModifier(IBeeGenome genome, float currentModifier) {
+ return territoryMod;
+ }
+
+ @Override
+ public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
+ return mutationMod;
+ }
+
+ @Override
+ public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
+ return lifespanMod;
+ }
+
+ @Override
+ public float getProductionModifier(IBeeGenome genome, float currentModifier) {
+ return productionMod;
+ }
+
+ @Override
+ public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
+ return floweringMod;
+ }
+
+ @Override
+ public float getGeneticDecay(IBeeGenome genome, float currentModifier) {
+ return geneticDecayMod;
+ }
+
+ @Override
+ public boolean isSealed() {
+ return isSealed;
+ }
+
+ @Override
+ public boolean isSelfLighted() {
+ return isLit;
+ }
+
+ @Override
+ public boolean isSunlightSimulated() {
+ return isSunlit;
+ }
+
+ @Override
+ public boolean isHellish() {
+ return isHellish;
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/forestry/apiculture/items/magicbees/MB_ItemMagicHiveFrame.java b/src/Java/miscutil/core/xmod/forestry/apiculture/items/magicbees/MB_ItemMagicHiveFrame.java
new file mode 100644
index 0000000000..78e0afb55b
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/forestry/apiculture/items/magicbees/MB_ItemMagicHiveFrame.java
@@ -0,0 +1,62 @@
+package miscutil.core.xmod.forestry.apiculture.items.magicbees;
+
+import miscutil.core.creative.AddToCreativeTab;
+import miscutil.core.lib.CORE;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import forestry.api.apiculture.IBee;
+import forestry.api.apiculture.IBeeHousing;
+import forestry.api.apiculture.IBeeModifier;
+import forestry.api.apiculture.IHiveFrame;
+
+public class MB_ItemMagicHiveFrame extends Item implements IHiveFrame
+{
+ private MB_HiveFrameType type;
+
+ public MB_ItemMagicHiveFrame(MB_HiveFrameType frameType)
+ {
+ super();
+ this.type = frameType;
+ this.setMaxDamage(this.type.maxDamage);
+ this.setMaxStackSize(1);
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setUnlocalizedName("frame" + frameType.getName());
+ GameRegistry.registerItem(this, "frame" + frameType.getName());
+ }
+
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister par1IconRegister)
+ {
+ this.itemIcon = par1IconRegister.registerIcon(CORE.MODID + ":frame" + type.getName());
+ }
+
+ // --------- IHiveFrame functions -----------------------------------------
+
+ @Override
+ public ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear) {
+ frame.setItemDamage(frame.getItemDamage() + wear);
+
+ if (frame.getItemDamage() >= frame.getMaxDamage()) {
+ // Break the frame.
+ frame = null;
+ }
+
+ return frame;
+ }
+
+ @Override
+ public IBeeModifier getBeeModifier() {
+ return type;
+ }
+
+ @Override
+ public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2)
+ {
+ return false;
+ }
+
+}
diff --git a/src/Java/miscutil/core/xmod/forestry/apiculture/multiblock/FR_TileAlveary.java b/src/Java/miscutil/core/xmod/forestry/apiculture/multiblock/FR_TileAlveary.java
new file mode 100644
index 0000000000..06633a87cf
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/forestry/apiculture/multiblock/FR_TileAlveary.java
@@ -0,0 +1,199 @@
+/*******************************************************************************
+ * Copyright (c) 2011-2014 SirSengir.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Lesser Public License v3
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Various Contributors including, but not limited to:
+ * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
+ ******************************************************************************/
+package miscutil.core.xmod.forestry.apiculture.multiblock;
+
+import java.io.IOException;
+import java.util.List;
+
+import miscutil.core.xmod.forestry.apiculture.blocks.FR_BlockAlveary;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.util.ChunkCoordinates;
+import net.minecraft.util.Vec3;
+import net.minecraft.world.biome.BiomeGenBase;
+import forestry.api.apiculture.IBeeHousing;
+import forestry.api.apiculture.IBeeHousingInventory;
+import forestry.api.apiculture.IBeeListener;
+import forestry.api.apiculture.IBeeModifier;
+import forestry.api.apiculture.IBeekeepingLogic;
+import forestry.api.core.EnumHumidity;
+import forestry.api.core.EnumTemperature;
+import forestry.api.core.IErrorLogic;
+import forestry.api.multiblock.IAlvearyComponent;
+import forestry.api.multiblock.IMultiblockController;
+import forestry.apiculture.multiblock.MultiblockLogicAlveary;
+import forestry.core.access.EnumAccess;
+import forestry.core.access.IAccessHandler;
+import forestry.core.access.IRestrictedAccess;
+import forestry.core.config.Config;
+import forestry.core.gui.IHintSource;
+import forestry.core.inventory.IInventoryAdapter;
+import forestry.core.multiblock.MultiblockTileEntityForestry;
+import forestry.core.network.DataInputStreamForestry;
+import forestry.core.network.DataOutputStreamForestry;
+import forestry.core.network.IStreamableGui;
+import forestry.core.tiles.IClimatised;
+import forestry.core.tiles.ITitled;
+
+public abstract class FR_TileAlveary extends MultiblockTileEntityForestry<MultiblockLogicAlveary> implements IBeeHousing, IAlvearyComponent, IRestrictedAccess, IStreamableGui, ITitled, IClimatised, IHintSource {
+ private final String unlocalizedTitle;
+
+ protected FR_TileAlveary() {
+ this(FR_BlockAlveary.Type.PLAIN);
+ }
+
+ protected FR_TileAlveary(FR_BlockAlveary.Type type) {
+ super(new MultiblockLogicAlveary());
+ this.unlocalizedTitle = "tile.alveary." + type.ordinal() + ".name";
+ }
+
+ /* TEXTURES */
+ public int getIcon(int side) {
+ return FR_BlockAlveary.PLAIN;
+ }
+
+ @Override
+ public void onMachineAssembled(IMultiblockController multiblockController, ChunkCoordinates minCoord, ChunkCoordinates maxCoord) {
+ // Re-render this block on the client
+ if (worldObj.isRemote) {
+ this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
+ }
+ worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType());
+ markDirty();
+ }
+
+ @Override
+ public void onMachineBroken() {
+ // Re-render this block on the client
+ if (worldObj.isRemote) {
+ this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
+ }
+ worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType());
+ markDirty();
+ }
+
+ /* IHousing */
+ @Override
+ public BiomeGenBase getBiome() {
+ return getMultiblockLogic().getController().getBiome();
+ }
+
+ /* IBeeHousing */
+ @Override
+ public Iterable<IBeeModifier> getBeeModifiers() {
+ return getMultiblockLogic().getController().getBeeModifiers();
+ }
+
+ @Override
+ public Iterable<IBeeListener> getBeeListeners() {
+ return getMultiblockLogic().getController().getBeeListeners();
+ }
+
+ @Override
+ public IBeeHousingInventory getBeeInventory() {
+ return getMultiblockLogic().getController().getBeeInventory();
+ }
+
+ @Override
+ public IBeekeepingLogic getBeekeepingLogic() {
+ return getMultiblockLogic().getController().getBeekeepingLogic();
+ }
+
+ @Override
+ public Vec3 getBeeFXCoordinates() {
+ return getMultiblockLogic().getController().getBeeFXCoordinates();
+ }
+
+ /* IClimatised */
+ @Override
+ public EnumTemperature getTemperature() {
+ return getMultiblockLogic().getController().getTemperature();
+ }
+
+ @Override
+ public EnumHumidity getHumidity() {
+ return getMultiblockLogic().getController().getHumidity();
+ }
+
+ @Override
+ public int getBlockLightValue() {
+ return getMultiblockLogic().getController().getBlockLightValue();
+ }
+
+ @Override
+ public boolean canBlockSeeTheSky() {
+ return getMultiblockLogic().getController().canBlockSeeTheSky();
+ }
+
+ @Override
+ public IErrorLogic getErrorLogic() {
+ return getMultiblockLogic().getController().getErrorLogic();
+ }
+
+ @Override
+ public IAccessHandler getAccessHandler() {
+ return getMultiblockLogic().getController().getAccessHandler();
+ }
+
+ @Override
+ public void onSwitchAccess(EnumAccess oldAccess, EnumAccess newAccess) {
+ getMultiblockLogic().getController().onSwitchAccess(oldAccess, newAccess);
+ }
+
+ @Override
+ public IInventoryAdapter getInternalInventory() {
+ return getMultiblockLogic().getController().getInternalInventory();
+ }
+
+ @Override
+ public String getUnlocalizedTitle() {
+ return unlocalizedTitle;
+ }
+
+ /* IHintSource */
+ @Override
+ public List<String> getHints() {
+ return Config.hints.get("apiary");
+ }
+
+ /* IClimatised */
+ @Override
+ public float getExactTemperature() {
+ return getMultiblockLogic().getController().getExactTemperature();
+ }
+
+ @Override
+ public float getExactHumidity() {
+ return getMultiblockLogic().getController().getExactHumidity();
+ }
+
+ /* IStreamableGui */
+ @Override
+ public void writeGuiData(DataOutputStreamForestry data) throws IOException {
+ getMultiblockLogic().getController().writeGuiData(data);
+ }
+
+ @Override
+ public void readGuiData(DataInputStreamForestry data) throws IOException {
+ getMultiblockLogic().getController().readGuiData(data);
+ }
+
+ @Override
+ public Object getGui(EntityPlayer player, int data) {
+ //return new GuiAlveary(player.inventory, this);
+ return null; //TODO
+ }
+
+ @Override
+ public Object getContainer(EntityPlayer player, int data) {
+ //return new ContainerAlveary(player.inventory, this);
+ return null; //TODO
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/forestry/apiculture/multiblock/TileAlvearyMutatron.java b/src/Java/miscutil/core/xmod/forestry/apiculture/multiblock/TileAlvearyMutatron.java
new file mode 100644
index 0000000000..c784f69ea7
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/forestry/apiculture/multiblock/TileAlvearyMutatron.java
@@ -0,0 +1,232 @@
+/*******************************************************************************
+ * Copyright (c) 2011-2014 SirSengir.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Lesser Public License v3
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Various Contributors including, but not limited to:
+ * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
+ ******************************************************************************/
+package miscutil.core.xmod.forestry.apiculture.multiblock;
+
+import java.util.Map.Entry;
+import java.util.Stack;
+
+import miscutil.core.xmod.forestry.apiculture.blocks.FR_BlockAlveary;
+import miscutil.core.xmod.forestry.apiculture.multiblock.inventory.FR_ContainerAlvearyMutatron;
+import miscutil.core.xmod.forestry.apiculture.multiblock.inventory.FR_GuiAlvearyMutatron;
+import miscutil.core.xmod.forestry.apiculture.multiblock.inventory.FR_InventoryMutatron;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.ISidedInventory;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.nbt.NBTTagList;
+import forestry.api.apiculture.BeeManager;
+import forestry.api.apiculture.EnumBeeType;
+import forestry.api.apiculture.IBee;
+import forestry.api.multiblock.IAlvearyComponent;
+import forestry.apiculture.blocks.BlockAlveary;
+import forestry.apiculture.network.packets.PacketActiveUpdate;
+import forestry.apiculture.worldgen.Hive;
+import forestry.apiculture.worldgen.HiveDecorator;
+import forestry.apiculture.worldgen.HiveDescriptionSwarmer;
+import forestry.core.inventory.IInventoryAdapter;
+import forestry.core.inventory.wrappers.IInvSlot;
+import forestry.core.inventory.wrappers.InventoryIterator;
+import forestry.core.proxy.Proxies;
+import forestry.core.tiles.IActivatable;
+import forestry.core.utils.ItemStackUtil;
+
+public class TileAlvearyMutatron extends FR_TileAlveary implements ISidedInventory, IActivatable, IAlvearyComponent.Active {
+
+ private final FR_InventoryMutatron inventory;
+ private final Stack<ItemStack> pendingSpawns = new Stack<>();
+ private boolean active;
+
+ public TileAlvearyMutatron() {
+ super(FR_BlockAlveary.Type.MUTATRON);
+ this.inventory = new FR_InventoryMutatron(this);
+ }
+
+ @Override
+ public IInventoryAdapter getInternalInventory() {
+ return inventory;
+ }
+
+ @Override
+ public boolean allowsAutomation() {
+ return true;
+ }
+
+ /* UPDATING */
+ @Override
+ public void updateServer(int tickCount) {
+ if (pendingSpawns.size() > 0) {
+ setActive(true);
+ if (tickCount % 1000 == 0) {
+ trySpawnSwarm();
+ }
+ } else {
+ setActive(false);
+ }
+
+ if (tickCount % 500 != 0) {
+ return;
+ }
+
+ ItemStack princessStack = getPrincessStack();
+ if (princessStack == null) {
+ return;
+ }
+
+ int chance = consumeInducerAndGetChance();
+ if (chance == 0) {
+ return;
+ }
+
+ // Try to spawn princess
+ if (worldObj.rand.nextInt(1000) >= chance) {
+ return;
+ }
+
+ // Queue swarm spawn
+ IBee princess = BeeManager.beeRoot.getMember(princessStack);
+ princess.setIsNatural(false);
+ pendingSpawns.push(BeeManager.beeRoot.getMemberStack(princess, EnumBeeType.PRINCESS.ordinal()));
+ }
+
+ @Override
+ public void updateClient(int tickCount) {
+
+ }
+
+ private ItemStack getPrincessStack() {
+ ItemStack princessStack = getMultiblockLogic().getController().getBeeInventory().getQueen();
+
+ if (BeeManager.beeRoot.isMated(princessStack)) {
+ return princessStack;
+ }
+
+ return null;
+ }
+
+ private int consumeInducerAndGetChance() {
+ if (getInternalInventory() == null) {
+ return 0;
+ }
+
+ for (IInvSlot slot : InventoryIterator.getIterable(getInternalInventory())) {
+ ItemStack stack = slot.getStackInSlot();
+ for (Entry<ItemStack, Integer> entry : BeeManager.inducers.entrySet()) {
+ if (ItemStackUtil.isIdenticalItem(entry.getKey(), stack)) {
+ slot.decreaseStackInSlot();
+ return entry.getValue();
+ }
+ }
+ }
+
+ return 0;
+ }
+
+ private void trySpawnSwarm() {
+
+ ItemStack toSpawn = pendingSpawns.peek();
+ HiveDescriptionSwarmer hiveDescription = new HiveDescriptionSwarmer(toSpawn);
+ Hive hive = new Hive(hiveDescription);
+
+ int chunkX = (xCoord + worldObj.rand.nextInt(40 * 2) - 40) / 16;
+ int chunkZ = (zCoord + worldObj.rand.nextInt(40 * 2) - 40) / 16;
+
+ if (HiveDecorator.genHive(worldObj, worldObj.rand, chunkX, chunkZ, hive)) {
+ pendingSpawns.pop();
+ }
+ }
+
+ /* NETWORK */
+
+ @Override
+ protected void encodeDescriptionPacket(NBTTagCompound packetData) {
+ super.encodeDescriptionPacket(packetData);
+ packetData.setBoolean("Active", active);
+ }
+
+ @Override
+ protected void decodeDescriptionPacket(NBTTagCompound packetData) {
+ super.decodeDescriptionPacket(packetData);
+ setActive(packetData.getBoolean("Active"));
+ }
+
+ /* TEXTURES */
+ @Override
+ public int getIcon(int side) {
+ if (side == 0 || side == 1) {
+ return BlockAlveary.BOTTOM;
+ }
+
+ if (active) {
+ return BlockAlveary.ALVEARY_SWARMER_ON;
+ } else {
+ return BlockAlveary.ALVEARY_SWARMER_OFF;
+ }
+ }
+
+ /* SAVING & LOADING */
+ @Override
+ public void readFromNBT(NBTTagCompound nbttagcompound) {
+ super.readFromNBT(nbttagcompound);
+ setActive(nbttagcompound.getBoolean("Active"));
+
+ NBTTagList nbttaglist = nbttagcompound.getTagList("PendingSpawns", 10);
+ for (int i = 0; i < nbttaglist.tagCount(); i++) {
+ NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
+ pendingSpawns.add(ItemStack.loadItemStackFromNBT(nbttagcompound1));
+ }
+ }
+
+ @Override
+ public void writeToNBT(NBTTagCompound nbttagcompound) {
+ super.writeToNBT(nbttagcompound);
+ nbttagcompound.setBoolean("Active", active);
+
+ NBTTagList nbttaglist = new NBTTagList();
+ ItemStack[] offspring = pendingSpawns.toArray(new ItemStack[pendingSpawns.size()]);
+ for (int i = 0; i < offspring.length; i++) {
+ if (offspring[i] != null) {
+ NBTTagCompound nbttagcompound1 = new NBTTagCompound();
+ nbttagcompound1.setByte("Slot", (byte) i);
+ offspring[i].writeToNBT(nbttagcompound1);
+ nbttaglist.appendTag(nbttagcompound1);
+ }
+ }
+ nbttagcompound.setTag("PendingSpawns", nbttaglist);
+ }
+
+ @Override
+ public boolean isActive() {
+ return active;
+ }
+
+ @Override
+ public void setActive(boolean active) {
+ if (this.active == active) {
+ return;
+ }
+
+ this.active = active;
+
+ if (!worldObj.isRemote) {
+ Proxies.net.sendNetworkPacket(new PacketActiveUpdate(this), worldObj);
+ }
+ }
+
+ @Override
+ public Object getGui(EntityPlayer player, int data) {
+ return new FR_GuiAlvearyMutatron(player.inventory, this);
+ }
+
+ @Override
+ public Object getContainer(EntityPlayer player, int data) {
+ return new FR_ContainerAlvearyMutatron(player.inventory, this);
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/forestry/apiculture/multiblock/inventory/FR_ContainerAlvearyMutatron.java b/src/Java/miscutil/core/xmod/forestry/apiculture/multiblock/inventory/FR_ContainerAlvearyMutatron.java
new file mode 100644
index 0000000000..5af0978631
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/forestry/apiculture/multiblock/inventory/FR_ContainerAlvearyMutatron.java
@@ -0,0 +1,28 @@
+package miscutil.core.xmod.forestry.apiculture.multiblock.inventory;
+
+import miscutil.core.xmod.forestry.apiculture.multiblock.TileAlvearyMutatron;
+import net.minecraft.entity.player.InventoryPlayer;
+import forestry.core.gui.ContainerTile;
+import forestry.core.gui.slots.SlotFiltered;
+
+public class FR_ContainerAlvearyMutatron extends ContainerTile<TileAlvearyMutatron> {
+ public FR_ContainerAlvearyMutatron(InventoryPlayer player, TileAlvearyMutatron tile) {
+ super(tile, player, 8, 87);
+ this.addSlotToContainer(new SlotFiltered(tile, 0, 79, 52));
+ this.addSlotToContainer(new SlotFiltered(tile, 1, 100, 39));
+ this.addSlotToContainer(new SlotFiltered(tile, 2, 58, 39));
+ this.addSlotToContainer(new SlotFiltered(tile, 3, 79, 26));
+ }
+}
+
+
+/*******************************************************************************
+ * Copyright (c) 2011-2014 SirSengir.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Lesser Public License v3
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Various Contributors including, but not limited to:
+ * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
+ ******************************************************************************/
diff --git a/src/Java/miscutil/core/xmod/forestry/apiculture/multiblock/inventory/FR_GuiAlvearyMutatron.java b/src/Java/miscutil/core/xmod/forestry/apiculture/multiblock/inventory/FR_GuiAlvearyMutatron.java
new file mode 100644
index 0000000000..b85d5e38a0
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/forestry/apiculture/multiblock/inventory/FR_GuiAlvearyMutatron.java
@@ -0,0 +1,26 @@
+package miscutil.core.xmod.forestry.apiculture.multiblock.inventory;
+
+import miscutil.core.lib.CORE;
+import miscutil.core.xmod.forestry.apiculture.multiblock.TileAlvearyMutatron;
+import miscutil.core.xmod.forestry.core.gui.FR_GuiForestryTitled;
+import net.minecraft.entity.player.InventoryPlayer;
+
+public class FR_GuiAlvearyMutatron extends FR_GuiForestryTitled<FR_ContainerAlvearyMutatron, TileAlvearyMutatron> {
+
+ public FR_GuiAlvearyMutatron(InventoryPlayer inventory, TileAlvearyMutatron tile) {
+ super(CORE.MODID+"/swarmer.png", new FR_ContainerAlvearyMutatron(inventory, tile), tile);
+ }
+
+ }
+
+
+/*******************************************************************************
+ * Copyright (c) 2011-2014 SirSengir.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Lesser Public License v3
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Various Contributors including, but not limited to:
+ * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
+ ******************************************************************************/ \ No newline at end of file
diff --git a/src/Java/miscutil/core/xmod/forestry/apiculture/multiblock/inventory/FR_InventoryMutatron.java b/src/Java/miscutil/core/xmod/forestry/apiculture/multiblock/inventory/FR_InventoryMutatron.java
new file mode 100644
index 0000000000..aa51d3ebb1
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/forestry/apiculture/multiblock/inventory/FR_InventoryMutatron.java
@@ -0,0 +1,29 @@
+package miscutil.core.xmod.forestry.apiculture.multiblock.inventory;
+
+import miscutil.core.xmod.forestry.apiculture.multiblock.TileAlvearyMutatron;
+import net.minecraft.item.ItemStack;
+import forestry.api.apiculture.BeeManager;
+import forestry.core.inventory.InventoryAdapterTile;
+import forestry.core.utils.ItemStackUtil;
+
+public class FR_InventoryMutatron extends InventoryAdapterTile<TileAlvearyMutatron> {
+ public FR_InventoryMutatron(TileAlvearyMutatron alvearyMutatron) {
+ super(alvearyMutatron, 4, "mutatronInv");
+ }
+ @Override
+ public boolean canSlotAccept(int slotIndex, ItemStack itemStack) {
+ return ItemStackUtil.containsItemStack(BeeManager.inducers.keySet(), itemStack);
+ }
+}
+
+
+/*******************************************************************************
+ * Copyright (c) 2011-2014 SirSengir.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Lesser Public License v3
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Various Contributors including, but not limited to:
+ * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
+ ******************************************************************************/ \ No newline at end of file
diff --git a/src/Java/miscutil/core/xmod/forestry/apiculture/multiblock/inventory/MutatronHandler.java b/src/Java/miscutil/core/xmod/forestry/apiculture/multiblock/inventory/MutatronHandler.java
new file mode 100644
index 0000000000..e629eeca51
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/forestry/apiculture/multiblock/inventory/MutatronHandler.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2011-2014 SirSengir.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Lesser Public License v3
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Various Contributors including, but not limited to:
+ * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
+ ******************************************************************************/
+package miscutil.core.xmod.forestry.apiculture.multiblock.inventory;
+
+public class MutatronHandler {
+
+
+
+
+
+
+
+
+} \ No newline at end of file
diff --git a/src/Java/miscutil/core/xmod/forestry/apiculture/tiles/FR_TileHandler.java b/src/Java/miscutil/core/xmod/forestry/apiculture/tiles/FR_TileHandler.java
new file mode 100644
index 0000000000..7ab787052b
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/forestry/apiculture/tiles/FR_TileHandler.java
@@ -0,0 +1,14 @@
+package miscutil.core.xmod.forestry.apiculture.tiles;
+
+import miscutil.core.lib.CORE;
+import miscutil.core.xmod.forestry.apiculture.multiblock.TileAlvearyMutatron;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public class FR_TileHandler {
+
+ public static void init(){
+ if (CORE.DEBUG){
+ GameRegistry.registerTileEntity(TileAlvearyMutatron.class, "MiscUtils.AlvearyMutatron");
+ }
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/forestry/core/gui/FR_FontRenderer.java b/src/Java/miscutil/core/xmod/forestry/core/gui/FR_FontRenderer.java
new file mode 100644
index 0000000000..27de0a712c
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/forestry/core/gui/FR_FontRenderer.java
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * Copyright (c) 2011-2014 SirSengir.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Lesser Public License v3
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Various Contributors including, but not limited to:
+ * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
+ ******************************************************************************/
+package miscutil.core.xmod.forestry.core.gui;
+
+import net.minecraft.client.gui.FontRenderer;
+
+import org.lwjgl.opengl.GL11;
+
+import forestry.core.render.FontColour;
+
+public class FR_FontRenderer {
+ private static final int LINE_HEIGHT = 12;
+
+ private final FR_GuiForestry guiForestry;
+ private final int defaultFontColor;
+ private FontRenderer fontRendererObj;
+
+ public int column0;
+ public int column1;
+ public int column2;
+ public int line;
+
+ public FR_FontRenderer(FR_GuiForestry guiForestry, FontColour fontColour) {
+ this.guiForestry = guiForestry;
+ this.defaultFontColor = fontColour.get("gui.screen");
+ }
+
+ public void setFontRendererObj(FontRenderer fontRendererObj) {
+ this.fontRendererObj = fontRendererObj;
+ }
+
+ public void startPage() {
+ line = LINE_HEIGHT;
+ GL11.glPushMatrix();
+ }
+
+ public void startPage(int column0, int column1, int column2) {
+
+ this.column0 = column0;
+ this.column1 = column1;
+ this.column2 = column2;
+
+ startPage();
+ }
+
+ public int getLineY() {
+ return line;
+ }
+
+ public void newLine() {
+ line += LINE_HEIGHT;
+ }
+
+ public void newLineCompressed() {
+ line += (LINE_HEIGHT - 2);
+ }
+
+ public void newLine(int lineHeight) {
+ line += lineHeight;
+ }
+
+ public void endPage() {
+ GL11.glPopMatrix();
+ }
+
+ public void drawRow(String text0, String text1, String text2, int colour0, int colour1, int colour2) {
+ drawLine(text0, column0, colour0);
+ drawLine(text1, column1, colour1);
+ drawLine(text2, column2, colour2);
+ }
+
+ public void drawLine(String text, int x) {
+ drawLine(text, x, defaultFontColor);
+ }
+
+ public void drawSplitLine(String text, int x, int maxWidth) {
+ drawSplitLine(text, x, maxWidth, defaultFontColor);
+ }
+
+ public void drawCenteredLine(String text, int x, int color) {
+ drawCenteredLine(text, x, guiForestry.getSizeX(), color);
+ }
+
+ public void drawCenteredLine(String text, int x, int width, int color) {
+ fontRendererObj.drawString(text, guiForestry.getGuiLeft() + x + getCenteredOffset(text, width), guiForestry.getGuiTop() + line, color);
+ }
+
+ public void drawLine(String text, int x, int color) {
+ fontRendererObj.drawString(text, guiForestry.getGuiLeft() + x, guiForestry.getGuiTop() + line, color);
+ }
+
+ public void drawSplitLine(String text, int x, int maxWidth, int color) {
+ fontRendererObj.drawSplitString(text, guiForestry.getGuiLeft() + x, guiForestry.getGuiTop() + line, maxWidth, color);
+ }
+
+ public int getCenteredOffset(String string) {
+ return getCenteredOffset(string, guiForestry.getSizeX());
+ }
+
+ public int getCenteredOffset(String string, int xWidth) {
+ return (xWidth - fontRendererObj.getStringWidth(string)) / 2;
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/forestry/core/gui/FR_GuiForestry.java b/src/Java/miscutil/core/xmod/forestry/core/gui/FR_GuiForestry.java
new file mode 100644
index 0000000000..1a2863a528
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/forestry/core/gui/FR_GuiForestry.java
@@ -0,0 +1,272 @@
+/*******************************************************************************
+ * Copyright (c) 2011-2014 SirSengir.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Lesser Public License v3
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Various Contributors including, but not limited to:
+ * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
+ ******************************************************************************/
+package miscutil.core.xmod.forestry.core.gui;
+
+import java.util.List;
+
+import miscutil.core.lib.CORE;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.FontRenderer;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.client.renderer.OpenGlHelper;
+import net.minecraft.client.renderer.RenderHelper;
+import net.minecraft.client.renderer.entity.RenderItem;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.util.ResourceLocation;
+
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+
+import forestry.api.core.IErrorLogicSource;
+import forestry.api.core.IErrorSource;
+import forestry.core.access.IRestrictedAccess;
+import forestry.core.config.Config;
+import forestry.core.gui.IHintSource;
+import forestry.core.gui.ledgers.ClimateLedger;
+import forestry.core.gui.ledgers.HintLedger;
+import forestry.core.gui.ledgers.LedgerManager;
+import forestry.core.gui.ledgers.OwnerLedger;
+import forestry.core.gui.ledgers.PowerLedger;
+import forestry.core.proxy.Proxies;
+import forestry.core.render.FontColour;
+import forestry.core.tiles.IClimatised;
+import forestry.core.tiles.IPowerHandler;
+
+public abstract class FR_GuiForestry<C extends Container, I extends IInventory> extends GuiContainer {
+ protected final I inventory;
+ protected final C container;
+
+ public final ResourceLocation textureFile;
+ protected final FR_WidgetManager widgetManager;
+ protected LedgerManager ledgerManager;
+ protected FR_FontRenderer textLayout;
+ protected FontColour fontColor;
+
+ protected FR_GuiForestry(String texture, C container, I inventory) {
+ this(new ResourceLocation(CORE.MODID, texture), container, inventory);
+ }
+
+ protected FR_GuiForestry(ResourceLocation texture, C container, I inventory) {
+ super(container);
+
+ this.widgetManager = new FR_WidgetManager(this);
+
+ this.textureFile = texture;
+
+ this.inventory = inventory;
+ this.container = container;
+
+ this.fontColor = new FontColour(Proxies.render.getSelectedTexturePack());
+ this.textLayout = new FR_FontRenderer(this, this.fontColor);
+ }
+
+ @Override
+ public void setWorldAndResolution(Minecraft minecraft, int width, int height) {
+ super.setWorldAndResolution(minecraft, width, height);
+ textLayout.setFontRendererObj(fontRendererObj);
+ }
+
+ /* LEDGERS */
+ @Override
+ public void initGui() {
+ super.initGui();
+
+ int maxLedgerWidth = (this.width - this.xSize) / 2;
+ //this.ledgerManager = new LedgerManager(this, maxLedgerWidth);
+
+ addLedgers();
+ }
+
+ protected void addLedgers() {
+ if (inventory instanceof IErrorSource) {
+ ledgerManager.add((IErrorSource) inventory);
+ }
+
+ if (inventory instanceof IErrorLogicSource) {
+ IErrorLogicSource errorLogicSource = (IErrorLogicSource) inventory;
+ ledgerManager.add(errorLogicSource.getErrorLogic());
+ }
+
+ if (inventory instanceof IClimatised) {
+ ledgerManager.add(new ClimateLedger(ledgerManager, (IClimatised) inventory));
+ }
+
+ if (Config.enableEnergyStat && inventory instanceof IPowerHandler && ((IPowerHandler) inventory).getEnergyManager().getMaxEnergyStored() > 0) {
+ ledgerManager.add(new PowerLedger(ledgerManager, (IPowerHandler) inventory));
+ }
+
+ if (Config.enableHints && inventory instanceof IHintSource) {
+ IHintSource hintSource = (IHintSource) inventory;
+ List<String> hints = hintSource.getHints();
+ if (hints != null && hints.size() > 0) {
+ ledgerManager.add(new HintLedger(ledgerManager, hintSource));
+ }
+ }
+
+ if (inventory instanceof IRestrictedAccess) {
+ ledgerManager.add(new OwnerLedger(ledgerManager, (IRestrictedAccess) inventory));
+ }
+ }
+
+ @Override
+ public void onGuiClosed() {
+ super.onGuiClosed();
+ ledgerManager.onGuiClosed();
+ }
+
+ public FontColour getFontColor() {
+ return fontColor;
+ }
+
+ public FontRenderer getFontRenderer() {
+ return fontRendererObj;
+ }
+
+ @Override
+ protected void mouseClicked(int xPos, int yPos, int mouseButton) {
+ super.mouseClicked(xPos, yPos, mouseButton);
+
+ // / Handle ledger clicks
+ ledgerManager.handleMouseClicked(xPos, yPos, mouseButton);
+ widgetManager.handleMouseClicked(xPos, yPos, mouseButton);
+ }
+
+ @Override
+ protected void mouseMovedOrUp(int mouseX, int mouseY, int eventType) {
+ super.mouseMovedOrUp(mouseX, mouseY, eventType);
+
+ widgetManager.handleMouseRelease(mouseX, mouseY, eventType);
+ }
+
+ @Override
+ protected void mouseClickMove(int mouseX, int mouseY, int mouseButton, long time) {
+
+ widgetManager.handleMouseMove(mouseX, mouseY, mouseButton, time);
+
+ super.mouseClickMove(mouseX, mouseY, mouseButton, time);
+ }
+
+ protected Slot getSlotAtPosition(int par1, int par2) {
+ for (int k = 0; k < this.inventorySlots.inventorySlots.size(); ++k) {
+ Slot slot = (Slot) this.inventorySlots.inventorySlots.get(k);
+
+ if (isMouseOverSlot(slot, par1, par2)) {
+ return slot;
+ }
+ }
+
+ return null;
+ }
+
+ private boolean isMouseOverSlot(Slot par1Slot, int par2, int par3) {
+ return this.func_146978_c(par1Slot.xDisplayPosition, par1Slot.yDisplayPosition, 16, 16, par2, par3);
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
+ GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
+ {
+ RenderHelper.enableGUIStandardItemLighting();
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glDisable(GL11.GL_DEPTH_TEST);
+ OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240 / 1.0F, 240 / 1.0F);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+
+ ledgerManager.drawTooltips(mouseX, mouseY);
+
+ InventoryPlayer playerInv = mc.thePlayer.inventory;
+
+ if (playerInv.getItemStack() == null) {
+ FR_GuiUtil.drawToolTips(this, widgetManager.getWidgets(), mouseX, mouseY);
+ FR_GuiUtil.drawToolTips(this, buttonList, mouseX, mouseY);
+ FR_GuiUtil.drawToolTips(this, inventorySlots.inventorySlots, mouseX, mouseY);
+ }
+ }
+ GL11.glPopAttrib();
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
+ bindTexture(textureFile);
+
+ int x = (width - xSize) / 2;
+ int y = (height - ySize) / 2;
+ drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
+
+ GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
+ {
+ RenderHelper.enableGUIStandardItemLighting();
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glDisable(GL11.GL_DEPTH_TEST);
+ GL11.glPushMatrix();
+ {
+ GL11.glTranslatef(guiLeft, guiTop, 0.0F);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240 / 1.0F, 240 / 1.0F);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+
+ drawWidgets();
+ }
+ GL11.glPopMatrix();
+ }
+ GL11.glPopAttrib();
+
+ bindTexture(textureFile);
+ }
+
+ protected void drawWidgets() {
+ ledgerManager.drawLedgers();
+ widgetManager.drawWidgets();
+ }
+
+ protected void bindTexture(ResourceLocation texturePath) {
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ Proxies.render.bindTexture(texturePath);
+ }
+
+ public void setZLevel(float level) {
+ this.zLevel = level;
+ }
+
+ public static RenderItem getItemRenderer() {
+ return itemRender;
+ }
+
+ public int getSizeX() {
+ return xSize;
+ }
+
+ public int getSizeY() {
+ return ySize;
+ }
+
+ public int getGuiLeft() {
+ return guiLeft;
+ }
+
+ public int getGuiTop() {
+ return guiTop;
+ }
+
+ @Override
+ public void drawGradientRect(int par1, int par2, int par3, int par4, int par5, int par6) {
+ super.drawGradientRect(par1, par2, par3, par4, par5, par6);
+ }
+}
+
+
+
+
diff --git a/src/Java/miscutil/core/xmod/forestry/core/gui/FR_GuiForestryTitled.java b/src/Java/miscutil/core/xmod/forestry/core/gui/FR_GuiForestryTitled.java
new file mode 100644
index 0000000000..95a08da1bd
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/forestry/core/gui/FR_GuiForestryTitled.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2011-2014 SirSengir.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Lesser Public License v3
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Various Contributors including, but not limited to:
+ * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
+ ******************************************************************************/
+package miscutil.core.xmod.forestry.core.gui;
+
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.util.StatCollector;
+import forestry.core.tiles.ITitled;
+
+public abstract class FR_GuiForestryTitled<C extends Container, I extends ITitled & IInventory> extends FR_GuiForestry<C, I> {
+
+ protected FR_GuiForestryTitled(String texture, C container, I inventory) {
+ super(texture, container, inventory);
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
+ super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
+
+ String name = StatCollector.translateToLocal(inventory.getUnlocalizedTitle());
+ textLayout.line = 6;
+ textLayout.drawCenteredLine(name, 0, fontColor.get("gui.title"));
+ bindTexture(textureFile);
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/forestry/core/gui/FR_GuiUtil.java b/src/Java/miscutil/core/xmod/forestry/core/gui/FR_GuiUtil.java
new file mode 100644
index 0000000000..d30324041f
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/forestry/core/gui/FR_GuiUtil.java
@@ -0,0 +1,145 @@
+/*******************************************************************************
+ * Copyright (c) 2011-2014 SirSengir.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Lesser Public License v3
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Various Contributors including, but not limited to:
+ * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
+ ******************************************************************************/
+package miscutil.core.xmod.forestry.core.gui;
+
+import java.awt.Color;
+import java.util.Collection;
+
+import net.minecraft.client.gui.FontRenderer;
+import net.minecraft.client.renderer.RenderHelper;
+import net.minecraft.client.renderer.entity.RenderItem;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+
+import org.lwjgl.opengl.GL11;
+
+import forestry.core.gui.tooltips.IToolTipProvider;
+import forestry.core.gui.tooltips.ToolTip;
+import forestry.core.gui.tooltips.ToolTipLine;
+
+public class FR_GuiUtil {
+ public static void drawItemStack(FR_GuiForestry gui, ItemStack stack, int xPos, int yPos) {
+ GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
+ RenderHelper.enableGUIStandardItemLighting();
+
+ RenderItem itemRender = FR_GuiForestry.getItemRenderer();
+
+ GL11.glTranslatef(0.0F, 0.0F, 32.0F);
+ gui.setZLevel(100.0F);
+ itemRender.zLevel = 100.0F;
+ FontRenderer font = null;
+ if (stack != null) {
+ font = stack.getItem().getFontRenderer(stack);
+ }
+ if (font == null) {
+ font = gui.getFontRenderer();
+ }
+ itemRender.renderItemAndEffectIntoGUI(font, gui.mc.getTextureManager(), stack, xPos, yPos);
+ itemRender.renderItemOverlayIntoGUI(font, gui.mc.getTextureManager(), stack, xPos, yPos);
+ gui.setZLevel(0.0F);
+ itemRender.zLevel = 0.0F;
+
+ RenderHelper.disableStandardItemLighting();
+ GL11.glPopAttrib();
+ }
+
+ public static void drawToolTips(FR_GuiForestry gui, ToolTip toolTips, int mouseX, int mouseY) {
+ if (toolTips == null) {
+ return;
+ }
+ if (toolTips.isEmpty()) {
+ return;
+ }
+
+ RenderItem itemRender = FR_GuiForestry.getItemRenderer();
+ FontRenderer fontRendererObj = gui.getFontRenderer();
+
+ int left = gui.getGuiLeft();
+ int top = gui.getGuiTop();
+ int length = 0;
+ int height = 0;
+ int x;
+ int y;
+
+ for (ToolTipLine tip : toolTips) {
+ y = fontRendererObj.getStringWidth(tip.toString());
+
+ height += 10 + tip.getSpacing();
+ if (y > length) {
+ length = y;
+ }
+ }
+
+ x = mouseX - left + 12;
+ y = mouseY - top - 12;
+
+ gui.setZLevel(300.0F);
+ itemRender.zLevel = 300.0F;
+ Color backgroundColor = new Color(16, 0, 16, 240);
+ int backgroundColorInt = backgroundColor.getRGB();
+ gui.drawGradientRect(x - 3, y - 4, x + length + 2, y - 3, backgroundColorInt, backgroundColorInt);
+ gui.drawGradientRect(x - 3, y + height + 1, x + length + 2, y + height + 2, backgroundColorInt, backgroundColorInt);
+ gui.drawGradientRect(x - 3, y - 3, x + length + 2, y + height + 1, backgroundColorInt, backgroundColorInt);
+ gui.drawGradientRect(x - 4, y - 3, x - 3, y + height + 1, backgroundColorInt, backgroundColorInt);
+ gui.drawGradientRect(x + length + 2, y - 3, x + length + 3, y + height + 1, backgroundColorInt, backgroundColorInt);
+
+ Color borderColorTop = new Color(80, 0, 255, 80);
+ int borderColorTopInt = borderColorTop.getRGB();
+ Color borderColorBottom = new Color((borderColorTopInt & 0xfefefe) >> 1 | borderColorTopInt & -0x1000000, true);
+ int borderColorBottomInt = borderColorBottom.getRGB();
+ gui.drawGradientRect(x - 3, y - 3 + 1, x - 3 + 1, y + height, borderColorTopInt, borderColorBottomInt);
+ gui.drawGradientRect(x + length + 1, y - 3 + 1, x + length + 2, y + height, borderColorTopInt, borderColorBottomInt);
+ gui.drawGradientRect(x - 3, y - 3, x + length + 2, y - 3 + 1, borderColorTopInt, borderColorTopInt);
+ gui.drawGradientRect(x - 3, y + height, x + length + 2, y + height + 1, borderColorBottomInt, borderColorBottomInt);
+
+ boolean firstLine = true;
+ for (ToolTipLine tip : toolTips) {
+ String line;
+
+ if (firstLine) {
+ line = tip.toString();
+ } else {
+ line = EnumChatFormatting.GRAY + tip.toString();
+ }
+
+ fontRendererObj.drawStringWithShadow(line, x, y, -1);
+
+ y += 10 + tip.getSpacing();
+
+ firstLine = false;
+ }
+
+ gui.setZLevel(0.0F);
+ itemRender.zLevel = 0.0F;
+ }
+
+ public static void drawToolTips(FR_GuiForestry gui, Collection<?> objects, int mouseX, int mouseY) {
+ for (Object obj : objects) {
+ if (!(obj instanceof IToolTipProvider)) {
+ continue;
+ }
+ IToolTipProvider provider = (IToolTipProvider) obj;
+ if (!provider.isToolTipVisible()) {
+ continue;
+ }
+ ToolTip tips = provider.getToolTip(mouseX - gui.getGuiLeft(), mouseY - gui.getGuiTop());
+ if (tips == null) {
+ continue;
+ }
+ boolean mouseOver = provider.isMouseOver(mouseX - gui.getGuiLeft(), mouseY - gui.getGuiTop());
+ tips.onTick(mouseOver);
+ if (mouseOver && tips.isReady()) {
+ tips.refresh();
+ drawToolTips(gui, tips, mouseX, mouseY);
+ }
+ }
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/forestry/core/gui/FR_WidgetManager.java b/src/Java/miscutil/core/xmod/forestry/core/gui/FR_WidgetManager.java
new file mode 100644
index 0000000000..ce809c1066
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/forestry/core/gui/FR_WidgetManager.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2011-2014 SirSengir.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Lesser Public License v3
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Various Contributors including, but not limited to:
+ * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
+ ******************************************************************************/
+package miscutil.core.xmod.forestry.core.gui;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import net.minecraft.client.Minecraft;
+
+import org.lwjgl.opengl.GL11;
+
+import forestry.core.gui.widgets.Widget;
+import forestry.core.proxy.Proxies;
+
+public class FR_WidgetManager {
+
+ public final FR_GuiForestry gui;
+ public final Minecraft minecraft;
+ protected final List<Widget> widgets = new ArrayList<>();
+
+ public FR_WidgetManager(FR_GuiForestry gui) {
+ this.gui = gui;
+ this.minecraft = Proxies.common.getClientInstance();
+ }
+
+ public void add(Widget slot) {
+ this.widgets.add(slot);
+ }
+
+ public void remove(Widget slot) {
+ this.widgets.remove(slot);
+ }
+
+ public void clear() {
+ this.widgets.clear();
+ }
+
+ public List<Widget> getWidgets() {
+ return widgets;
+ }
+
+ public Widget getAtPosition(int mX, int mY) {
+ for (Widget slot : widgets) {
+ if (slot.isMouseOver(mX, mY)) {
+ return slot;
+ }
+ }
+
+ return null;
+ }
+
+ public void drawWidgets() {
+ gui.setZLevel(100.0F);
+ FR_GuiForestry.getItemRenderer().zLevel = 100.0F;
+ for (Widget slot : widgets) {
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ slot.draw(0, 0);
+ }
+ gui.setZLevel(0.0F);
+ FR_GuiForestry.getItemRenderer().zLevel = 0.0F;
+
+ }
+
+ public void handleMouseClicked(int mouseX, int mouseY, int mouseButton) {
+ Widget slot = getAtPosition(mouseX - gui.getGuiLeft(), mouseY - gui.getGuiTop());
+ if (slot != null) {
+ slot.handleMouseClick(mouseX, mouseY, mouseButton);
+ }
+ }
+
+ public void handleMouseRelease(int mouseX, int mouseY, int eventType) {
+ for (Widget slot : widgets) {
+ slot.handleMouseRelease(mouseX, mouseY, eventType);
+ }
+ }
+
+ public void handleMouseMove(int mouseX, int mouseY, int mouseButton, long time) {
+ for (Widget slot : widgets) {
+ slot.handleMouseMove(mouseX, mouseY, mouseButton, time);
+ }
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/HANDLER_Gregtech.java b/src/Java/miscutil/core/xmod/gregtech/HANDLER_Gregtech.java
new file mode 100644
index 0000000000..3f07b08f9b
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/HANDLER_Gregtech.java
@@ -0,0 +1,41 @@
+package miscutil.core.xmod.gregtech;
+
+import gregtech.api.util.GT_Config;
+import miscutil.core.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+import miscutil.core.xmod.gregtech.common.blocks.fluid.GregtechFluidHandler;
+
+public class HANDLER_Gregtech {
+
+ public static GT_Config mMaterialProperties = null;
+
+ public static void preInit(){
+ if (mMaterialProperties != null){
+ GT_Materials.init(mMaterialProperties);
+ GregtechFluidHandler.run();
+ //new Processing_Ingot1();
+ //new Processing_Plate1();
+ //new Processing_Block();
+ }
+
+ }
+
+ public static void init(){
+ /*if (Meta_GT_Proxy.mSortToTheEnd) {
+ new GT_ItemIterator().run();
+ Meta_GT_Proxy.registerUnificationEntries();
+ new GT_FuelLoader().run();
+ }*/
+ }
+
+ public static void postInit(){
+ /*Meta_GT_Proxy.activateOreDictHandler();
+ if (Meta_GT_Proxy.mSortToTheEnd) {
+ Meta_GT_Proxy.registerUnificationEntries();
+ } else {
+ new GT_ItemIterator().run();
+ Meta_GT_Proxy.registerUnificationEntries();
+ new GT_FuelLoader().run();
+ }*/
+ }
+
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/energy/IC2ElectricItem.java b/src/Java/miscutil/core/xmod/gregtech/api/energy/IC2ElectricItem.java
new file mode 100644
index 0000000000..24b5fa32c8
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/energy/IC2ElectricItem.java
@@ -0,0 +1,55 @@
+package miscutil.core.xmod.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/core/xmod/gregtech/api/energy/IC2ElectricItemManager.java b/src/Java/miscutil/core/xmod/gregtech/api/energy/IC2ElectricItemManager.java
new file mode 100644
index 0000000000..71f31cff46
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/energy/IC2ElectricItemManager.java
@@ -0,0 +1,95 @@
+package miscutil.core.xmod.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/core/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechItemList.java
new file mode 100644
index 0000000000..43b8f53cdb
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechItemList.java
@@ -0,0 +1,203 @@
+package miscutil.core.xmod.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.core.xmod.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,
+
+ //Rocket Engines
+ Rocket_Engine_EV, Rocket_Engine_IV, Rocket_Engine_LuV,
+
+ //IronBlastFurnace Machine_Bronze_BlastFurnace
+ Machine_Iron_BlastFurnace, Casing_IronPlatedBricks,
+
+ //Machine Casings
+ Casing_Shielding,
+
+ //Large Centrifuge
+ Industrial_Centrifuge, Casing_Centrifuge1,
+
+ //Coke Oven
+ Industrial_CokeOven, Casing_CokeOven, Casing_CokeOven_Coil1, Casing_CokeOven_Coil2,
+
+ //Bending Maching // Plate Press // Press
+ Industrial_PlatePress,
+
+ //Gregtech Machine Parts
+ Electric_Motor_LuV, Electric_Motor_ZPM, Electric_Motor_UV, Electric_Motor_MAX,
+ Electric_Pump_LuV, Electric_Pump_ZPM, Electric_Pump_UV, Electric_Pump_MAX,
+ Conveyor_Module_LuV, Conveyor_Module_ZPM, Conveyor_Module_UV, Conveyor_Module_MAX,
+ Electric_Piston_LuV, Electric_Piston_ZPM, Electric_Piston_UV, Electric_Piston_MAX,
+ Robot_Arm_LuV, Robot_Arm_ZPM, Robot_Arm_UV, Robot_Arm_MAX,
+ Field_Generator_LuV, Field_Generator_ZPM, Field_Generator_UV, Field_Generator_MAX,
+ Emitter_LuV, Emitter_ZPM, Emitter_UV, Emitter_MAX,
+ Sensor_LuV, Sensor_ZPM, Sensor_UV, Sensor_MAX,
+
+ //Circuits
+ Circuit_Primitive, Circuit_Basic, Circuit_Good, Circuit_Advanced,
+ Circuit_Data, Circuit_Elite, Circuit_Master, Tool_DataOrb, Circuit_Ultimate, Tool_DataStick,
+ Circuit_IV, Circuit_LuV, Circuit_ZPM,
+ //Circuit Parts
+ Circuit_Board_IV, Circuit_Board_LuV, Circuit_Board_ZPM,
+ Circuit_Parts_Crystal_Chip_IV, Circuit_Parts_Crystal_Chip_LuV, Circuit_Parts_Crystal_Chip_ZPM,
+ Circuit_Parts_IV, Circuit_Parts_LuV, Circuit_Parts_ZPM,
+ Circuit_Parts_Wiring_IV, Circuit_Parts_Wiring_LuV, Circuit_Parts_Wiring_ZPM,
+
+ //Blast Furnace Test
+ Machine_Electric_BlastFurnace;
+
+ 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/core/xmod/gregtech/api/enums/GregtechOreDictNames.java b/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechOreDictNames.java
new file mode 100644
index 0000000000..1e338c70a7
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechOreDictNames.java
@@ -0,0 +1,39 @@
+package miscutil.core.xmod.gregtech.api.enums;
+
+/* Electric Components.
+*
+* usual Materials for this are:
+* Primitive (Tier 1)
+* Basic (Tier 2) as used by UE as well : IC2 Circuit and RE-Battery
+* Good (Tier 3)
+* Advanced (Tier 4) as used by UE as well : Advanced Circuit, Advanced Battery and Lithium Battery
+* Data (Tier 5) : Data Storage Circuit
+* Elite (Tier 6) as used by UE as well : Energy Crystal and Data Control Circuit
+* Master (Tier 7) : Energy Flow Circuit and Lapotron Crystal
+* Ultimate (Tier 8) : Data Orb and Lapotronic Energy Orb
+* Infinite (Cheaty)
+*
+Circuits
+ Circuit_Primitive, Circuit_Basic, Circuit_Good, Circuit_Advanced,
+ Circuit_Data, Circuit_Elite, Circuit_Master, Tool_DataOrb, Circuit_Ultimate, Tool_DataStick,
+ Circuit_IV, Circuit_LuV, Circuit_ZPM,
+Circuit Parts
+ Circuit_Board_IV, Circuit_Board_LuV, Circuit_Board_ZPM,
+ Circuit_Parts_Crystal_Chip_IV, Circuit_Parts_Crystal_Chip_LuV, Circuit_Parts_Crystal_Chip_ZPM,
+ Circuit_Parts_IV, Circuit_Parts_LuV, Circuit_Parts_ZPM,
+ Circuit_Parts_Wiring_IV, Circuit_Parts_Wiring_LuV, Circuit_Parts_Wiring_ZPM;
+*/
+public enum GregtechOreDictNames {
+ buffer_core, itemGregConduit, Circuit_IV, Circuit_LuV, Circuit_ZPM,
+ Circuit_Board_IV, Circuit_Board_LuV, Circuit_Board_ZPM,
+ Circuit_Parts_Crystal_Chip_IV, Circuit_Parts_Crystal_Chip_LuV, Circuit_Parts_Crystal_Chip_ZPM,
+ Circuit_Parts_IV, Circuit_Parts_LuV, Circuit_Parts_ZPM,
+ Circuit_Parts_Wiring_IV, Circuit_Parts_Wiring_LuV, Circuit_Parts_Wiring_ZPM;
+
+ public String unlocalisedName;
+
+ private void ModObject() {
+ unlocalisedName = name();
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechOrePrefixes.java b/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechOrePrefixes.java
new file mode 100644
index 0000000000..29621f7a23
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechOrePrefixes.java
@@ -0,0 +1,776 @@
+package miscutil.core.xmod.gregtech.api.enums;
+
+import static gregtech.api.enums.GT_Values.B;
+import static gregtech.api.enums.GT_Values.D2;
+import static gregtech.api.enums.GT_Values.M;
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.Element;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.SubTag;
+import gregtech.api.enums.TC_Aspects;
+import gregtech.api.enums.TC_Aspects.TC_AspectStack;
+import gregtech.api.enums.TextureSet;
+import gregtech.api.interfaces.IColorModulationContainer;
+import gregtech.api.interfaces.ICondition;
+import gregtech.api.interfaces.ISubTagContainer;
+import gregtech.api.objects.GT_FluidStack;
+import gregtech.api.objects.MaterialStack;
+import gregtech.api.util.GT_Config;
+import gregtech.api.util.GT_Log;
+import gregtech.api.util.GT_Utility;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+
+import miscutil.core.lib.CORE;
+import miscutil.core.xmod.gregtech.api.interfaces.internal.Interface_OreRecipeRegistrator;
+import miscutil.core.xmod.gregtech.api.objects.GregtechItemData;
+import miscutil.core.xmod.gregtech.api.objects.GregtechMaterialStack;
+import net.minecraft.enchantment.Enchantment;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidStack;
+
+public enum GregtechOrePrefixes {
+ /* Electric Components.
+ *
+ * usual Materials for this are:
+ * Primitive (Tier 1)
+ * Basic (Tier 2) as used by UE as well : IC2 Circuit and RE-Battery
+ * Good (Tier 3)
+ * Advanced (Tier 4) as used by UE as well : Advanced Circuit, Advanced Battery and Lithium Battery
+ * Data (Tier 5) : Data Storage Circuit
+ * Elite (Tier 6) as used by UE as well : Energy Crystal and Data Control Circuit
+ * Master (Tier 7) : Energy Flow Circuit and Lapotron Crystal
+ * Ultimate (Tier 8) : Data Orb and Lapotronic Energy Orb
+ * Infinite (Cheaty)
+ */
+
+ ingot("Ingots", "", " Ingot", true, true, false, false, false, false, false, true, false, false, B[1], M * 1, 64, 11), // A regular Ingot. Introduced by Eloraam
+ dustTiny("Tiny Dusts", "Tiny Pile of ", " Dust", true, true, false, false, false, false, false, true, false, false, B[0] | B[1] | B[2] | B[3], M / 9, 64, 0), // 1/9th of a Dust.
+ dustSmall("Small Dusts", "Small Pile of ", " Dust", true, true, false, false, false, false, false, true, false, false, B[0] | B[1] | B[2] | B[3], M / 4, 64, 1), // 1/4th of a Dust.
+ dustImpure("Impure Dusts", "Impure Pile of ", " Dust", true, true, false, false, false, false, false, true, false, true, B[3], M * 1, 64, 3), // Dust with impurities. 1 Unit of Main Material and 1/9 - 1/4 Unit of secondary Material
+ dustRefined("Refined Dusts", "Refined Pile of ", " Dust", true, true, false, false, false, false, false, true, false, true, B[3], M * 1, 64, 2),
+ dustPure("Purified Dusts", "Purified Pile of ", " Dust", true, true, false, false, false, false, false, true, false, true, B[3], M * 1, 64, 4),
+ dust("Dusts", "", " Dust", true, true, false, false, false, false, false, true, false, false, B[0] | B[1] | B[2] | B[3], M * 1, 64, 2), // Pure Dust worth of one Ingot or Gem. Introduced by Alblaka.
+ nugget("Nuggets", "", " Nugget", true, true, false, false, false, false, false, true, false, false, B[1], M / 9, 64, 9), // A Nugget. Introduced by Eloraam
+ plate("Plates", "", " Plate", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M * 1, 64, 17), // Regular Plate made of one Ingot/Dust. Introduced by Calclavia
+ block("Storage Blocks", "Block of ", "", true, true, false, false, false, true, true, false, false, false, 0, M * 9, 64, 71), // Storage Block consisting out of 9 Ingots/Gems/Dusts. Introduced by CovertJaguar
+ gem("Gemstones", "", "", true, true, true, false, false, false, true, true, false, false, B[2], M * 1, 64, 8), // A regular Gem worth one Dust. Introduced by Eloraam
+ gemChipped("Chipped Gemstones", "Chipped ", "", true, true, true, false, false, false, true, true, false, false, B[2], M / 4, 64, 59), // A regular Gem worth one small Dust. Introduced by TerraFirmaCraft
+ gemFlawed("Flawed Gemstones", "Flawed ", "", true, true, true, false, false, false, true, true, false, false, B[2], M / 2, 64, 60), // A regular Gem worth two small Dusts. Introduced by TerraFirmaCraft
+ gemFlawless("Flawless Gemstones", "Flawless ", "", true, true, true, false, false, false, true, true, false, false, B[2], M * 2, 32, 61), // A regular Gem worth two Dusts. Introduced by TerraFirmaCraft
+ gemExquisite("Exquisite Gemstones", "Exquisite ", "", true, true, true, false, false, false, true, true, false, false, B[2], M * 4, 16, 62), // A regular Gem worth four Dusts. Introduced by TerraFirmaCraft
+ stick("Sticks/Rods", "", " Rod", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M / 2, 64, 23), // Stick made of half an Ingot. Introduced by Eloraam
+
+
+ batterySingleuse("Single Use Batteries", "", "", false, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
+ battery("Reusable Batteries", "", "", false, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Calclavia
+ circuit("Circuits", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Calclavia
+ chipset("Chipsets", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Buildcraft
+ computer("Computers", "", "", true, true, false, false, true, false, false, false, false, false, 0, -1, 64, -1); // A whole Computer. "computerMaster" = ComputerCube
+
+ //public static volatile int VERSION = 508;
+
+ public final ArrayList<ItemStack> mPrefixedItems = new ArrayList<ItemStack>();
+ public final short mTextureIndex;
+ public final String mRegularLocalName, mLocalizedMaterialPre, mLocalizedMaterialPost;
+ public final boolean mIsUsedForOreProcessing, mIsEnchantable, mIsUnificatable, mIsMaterialBased, mIsSelfReferencing, mIsContainer, mDontUnificateActively, mIsUsedForBlocks, mAllowNormalRecycling, mGenerateDefaultItem;
+ public final List<TC_AspectStack> mAspects = new ArrayList<TC_AspectStack>();
+ public final Collection<GregtechOrePrefixes> mFamiliarPrefixes = new HashSet<GregtechOrePrefixes>();
+ /**
+ * Used to determine the amount of Material this Prefix contains.
+ * Multiply or Divide GregTech_API.MATERIAL_UNIT to get the Amounts in comparision to one Ingot.
+ * 0 = Null
+ * Negative = Undefined Amount
+ */
+ public final long mMaterialAmount;
+ private final Collection<Materials> mNotGeneratedItems = new HashSet<Materials>(), mIgnoredMaterials = new HashSet<Materials>(), mGeneratedItems = new HashSet<Materials>();
+ private final ArrayList<Interface_OreRecipeRegistrator> mOreProcessing = new ArrayList<Interface_OreRecipeRegistrator>();
+ public ItemStack mContainerItem = null;
+ public ICondition<ISubTagContainer> mCondition = null;
+ public byte mDefaultStackSize = 64;
+ public GregtechMaterialStack mSecondaryMaterial = null;
+ public GregtechOrePrefixes mPrefixInto = this;
+ public float mHeatDamage = 0.0F; // Negative for Frost Damage
+ /**
+ * Yes this Value can be changed to add Bits for the MetaGenerated-Item-Check.
+ */
+ public int mMaterialGenerationBits = 0;
+ private GregtechOrePrefixes(String aRegularLocalName, String aLocalizedMaterialPre, String aLocalizedMaterialPost, boolean aIsUnificatable, boolean aIsMaterialBased, boolean aIsSelfReferencing, boolean aIsContainer, boolean aDontUnificateActively, boolean aIsUsedForBlocks, boolean aAllowNormalRecycling, boolean aGenerateDefaultItem, boolean aIsEnchantable, boolean aIsUsedForOreProcessing, int aMaterialGenerationBits, long aMaterialAmount, int aDefaultStackSize, int aTextureindex) {
+ mIsUnificatable = aIsUnificatable;
+ mIsMaterialBased = aIsMaterialBased;
+ mIsSelfReferencing = aIsSelfReferencing;
+ mIsContainer = aIsContainer;
+ mDontUnificateActively = aDontUnificateActively;
+ mIsUsedForBlocks = aIsUsedForBlocks;
+ mAllowNormalRecycling = aAllowNormalRecycling;
+ mGenerateDefaultItem = aGenerateDefaultItem;
+ mIsEnchantable = aIsEnchantable;
+ mIsUsedForOreProcessing = aIsUsedForOreProcessing;
+ mMaterialGenerationBits = aMaterialGenerationBits;
+ mMaterialAmount = aMaterialAmount;
+ mRegularLocalName = aRegularLocalName;
+ mLocalizedMaterialPre = aLocalizedMaterialPre;
+ mLocalizedMaterialPost = aLocalizedMaterialPost;
+ mDefaultStackSize = (byte) aDefaultStackSize;
+ mTextureIndex = (short) aTextureindex;
+
+ if (name().startsWith("ore")) {
+ new TC_AspectStack(TC_Aspects.TERRA, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("wire") || name().startsWith("cable")) {
+ new TC_AspectStack(TC_Aspects.ELECTRUM, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("dust")) {
+ new TC_AspectStack(TC_Aspects.PERDITIO, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("crushed")) {
+ new TC_AspectStack(TC_Aspects.PERFODIO, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("ingot") || name().startsWith("nugget")) {
+ new TC_AspectStack(TC_Aspects.METALLUM, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("armor")) {
+ new TC_AspectStack(TC_Aspects.TUTAMEN, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("stone")) {
+ new TC_AspectStack(TC_Aspects.TERRA, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("pipe")) {
+ new TC_AspectStack(TC_Aspects.ITER, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("gear")) {
+ new TC_AspectStack(TC_Aspects.MOTUS, 1).addToAspectList(mAspects);
+ new TC_AspectStack(TC_Aspects.MACHINA, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("frame") || name().startsWith("plate")) {
+ new TC_AspectStack(TC_Aspects.FABRICO, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("tool")) {
+ new TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2).addToAspectList(mAspects);
+ } else if (name().startsWith("gem") || name().startsWith("crystal") || name().startsWith("lens")) {
+ new TC_AspectStack(TC_Aspects.VITREUS, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("crate")) {
+ new TC_AspectStack(TC_Aspects.ITER, 2).addToAspectList(mAspects);
+ } else if (name().startsWith("circuit")) {
+ new TC_AspectStack(TC_Aspects.COGNITIO, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("computer")) {
+ new TC_AspectStack(TC_Aspects.COGNITIO, 4).addToAspectList(mAspects);
+ } else if (name().startsWith("battery")) {
+ new TC_AspectStack(TC_Aspects.ELECTRUM, 1).addToAspectList(mAspects);
+ }
+ }
+
+ public static GregtechOrePrefixes getOrePrefix(String aOre) {
+ for (GregtechOrePrefixes tPrefix : values())
+ if (aOre.startsWith(tPrefix.toString())) {
+ return tPrefix;
+ }
+ return null;
+ }
+
+ public static String stripPrefix(String aOre) {
+ for (GregtechOrePrefixes tPrefix : values()) {
+ if (aOre.startsWith(tPrefix.toString())) {
+ return aOre.replaceFirst(tPrefix.toString(), "");
+ }
+ }
+ return aOre;
+ }
+
+ public static String replacePrefix(String aOre, GregtechOrePrefixes aPrefix) {
+ for (GregtechOrePrefixes tPrefix : values()) {
+ if (aOre.startsWith(tPrefix.toString())) {
+ return aOre.replaceFirst(tPrefix.toString(), aPrefix.toString());
+ }
+ }
+ return "";
+ }
+
+ public static GregtechOrePrefixes getPrefix(String aPrefixName) {
+ return getPrefix(aPrefixName, null);
+ }
+
+ public static GregtechOrePrefixes getPrefix(String aPrefixName, GregtechOrePrefixes aReplacement) {
+ Object tObject = GT_Utility.getFieldContent(GregtechOrePrefixes.class, aPrefixName, false, false);
+ if (tObject != null && tObject instanceof GregtechOrePrefixes) return (GregtechOrePrefixes) tObject;
+ return aReplacement;
+ }
+
+ public static Materials getMaterial(String aOre) {
+ return Materials.get(stripPrefix(aOre));
+ }
+
+ public static Materials getMaterial(String aOre, GregtechOrePrefixes aPrefix) {
+ return Materials.get(aOre.replaceFirst(aPrefix.toString(), ""));
+ }
+
+ public static Materials getRealMaterial(String aOre, GregtechOrePrefixes aPrefix) {
+ return Materials.getRealMaterial(aOre.replaceFirst(aPrefix.toString(), ""));
+ }
+
+ public static boolean isInstanceOf(String aName, GregtechOrePrefixes aPrefix) {
+ return aName == null ? false : aName.startsWith(aPrefix.toString());
+ }
+
+ public boolean add(ItemStack aStack) {
+ if (aStack == null) return false;
+ if (!contains(aStack)) mPrefixedItems.add(aStack);
+ while (mPrefixedItems.contains(null)) mPrefixedItems.remove(null);
+ return true;
+ }
+
+ public boolean contains(ItemStack aStack) {
+ if (aStack == null) return false;
+ for (ItemStack tStack : mPrefixedItems)
+ if (GT_Utility.areStacksEqual(aStack, tStack, !tStack.hasTagCompound())) return true;
+ return false;
+ }
+
+ public boolean doGenerateItem(Materials aMaterial) {
+ return aMaterial != null && aMaterial != Materials._NULL && ((aMaterial.mTypes & mMaterialGenerationBits) != 0 || mGeneratedItems.contains(aMaterial)) && !mNotGeneratedItems.contains(aMaterial) && (mCondition == null || mCondition.isTrue(aMaterial));
+ }
+
+ public boolean ignoreMaterials(Materials... aMaterials) {
+ for (Materials tMaterial : aMaterials) if (tMaterial != null) mIgnoredMaterials.add(tMaterial);
+ return true;
+ }
+
+ public boolean isIgnored(GT_Materials aMaterial) {
+ if (aMaterial != null && (!aMaterial.mUnificatable || aMaterial != aMaterial.mMaterialInto)) return true;
+ return mIgnoredMaterials.contains(aMaterial);
+ }
+
+ public boolean addFamiliarPrefix(GregtechOrePrefixes aPrefix) {
+ if (aPrefix == null || mFamiliarPrefixes.contains(aPrefix) || aPrefix == this) return false;
+ return mFamiliarPrefixes.add(aPrefix);
+ }
+
+ public boolean add(Interface_OreRecipeRegistrator aRegistrator) {
+ if (aRegistrator == null) return false;
+ return mOreProcessing.add(aRegistrator);
+ }
+
+ public void processOre(GT_Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
+ if (aMaterial != null && (aMaterial != GT_Materials._NULL || mIsSelfReferencing || !mIsMaterialBased) && GT_Utility.isStackValid(aStack))
+ for (Interface_OreRecipeRegistrator tRegistrator : mOreProcessing) {
+ if (D2)
+ GT_Log.ore.println("Processing '" + aOreDictName + "' with the Prefix '" + name() + "' and the Material '" + aMaterial.name() + "' at " + GT_Utility.getClassName(tRegistrator));
+ tRegistrator.registerOre(this, aMaterial, aOreDictName, aModName, GT_Utility.copyAmount(1, aStack));
+ }
+ }
+
+ public Object get(Object aMaterial) {
+ if (aMaterial instanceof GT_Materials) return new GregtechItemData(this, (GT_Materials) aMaterial);
+ return name() + aMaterial;
+ }
+
+ public String getDefaultLocalNameForItem(Materials aMaterial) {
+
+
+ // Use Standard Localization
+ return mLocalizedMaterialPre + aMaterial.mDefaultLocalName + mLocalizedMaterialPost;
+ }
+
+ public enum GT_Materials implements IColorModulationContainer, ISubTagContainer {
+
+
+
+ /**
+ * This is the Default Material returned in case no Material has been found or a NullPointer has been inserted at a location where it shouldn't happen.
+ * <p/>
+ * Mainly for preventing NullPointer Exceptions and providing Default Values.
+ *
+ * Unknown Material Components. Dead End Section.
+ *
+ * Alkalus Range 730-799 & 970-998
+ * (aMetaItemSubID, TextureSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, R, G, B, Alpha, aLocalName,
+ * aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor
+ * this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, true);
+ *
+ */
+ _NULL(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "NULL", 0, 0, 0, 0, false, false, 1, 1, 1, Dyes._NULL, Element._NULL, Arrays.asList(new TC_AspectStack(TC_Aspects.VACUOS, 1))),
+
+
+ //Lapis(526, TextureSet.SET_LAPIS, 1.0F, 0, 1, 1 | 4 | 8, 70, 70, 220, 0, "Lapis", 0, 0, -1, 0, false, false, 3, 1, 1, Dyes.dyeBlue, 2, Arrays.asList(new MaterialStack(Materials.Lazurite, 12), new MaterialStack(Materials.Sodalite, 2), new MaterialStack(Materials.Pyrite, 1), new MaterialStack(Materials.Calcite, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.SENSUS, 1))),
+ Pyrotheum(20, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 255, 128, 0, 0, "Pyrotheum", 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeYellow, 2, Arrays.asList(new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.PRAECANTATIO, 2), new TC_AspectStack(TC_Aspects.IGNIS, 1))),
+ Cryotheum(21, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 102, 178, 255, 0, "Cryotheum", 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeLightBlue, 2, Arrays.asList(new MaterialStack(Materials.Blizz, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Snow, 1), new MaterialStack(Materials.Niter, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.PRAECANTATIO, 2), new TC_AspectStack(TC_Aspects.GELUM, 1))),
+
+ /**
+ * Circuitry, Batteries and other Technical things
+ */
+ Symbiotic(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "IV Tier", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(new TC_AspectStack(TC_Aspects.ELECTRUM, 4), new TC_AspectStack(TC_Aspects.MACHINA, 4))),
+ Neutronic(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "LuV Tier", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(new TC_AspectStack(TC_Aspects.ELECTRUM, 6), new TC_AspectStack(TC_Aspects.MACHINA, 6))),
+ Quantum(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "ZPM Tier", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(new TC_AspectStack(TC_Aspects.ELECTRUM, 8), new TC_AspectStack(TC_Aspects.MACHINA, 8)));
+
+ /*Advanced(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "Advanced", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(new TC_AspectStack(TC_Aspects.MACHINA, 4))),
+ Data(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "Data", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(new TC_AspectStack(TC_Aspects.MACHINA, 5))),
+ Elite(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "Elite", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(new TC_AspectStack(TC_Aspects.MACHINA, 6))),
+ Master(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "Master", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(new TC_AspectStack(TC_Aspects.MACHINA, 7))),
+ Ultimate(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "Ultimate", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(new TC_AspectStack(TC_Aspects.MACHINA, 8))),
+ Superconductor(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "Superconductor", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(new TC_AspectStack(TC_Aspects.ELECTRUM, 8))),
+ Infinite(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "Infinite", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray);*/
+
+ /**
+ * List of all Materials.
+ */
+ public static final Collection<GT_Materials> VALUES = new HashSet<GT_Materials>(Arrays.asList(values()));
+
+
+ static {
+ /*Primitive.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Basic.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Good.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Advanced.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Data.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Elite.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Master.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Ultimate.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Superconductor.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Infinite.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);*/
+ Symbiotic.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Neutronic.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Quantum.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ }
+
+
+ /**
+ * This Array can be changed dynamically by a Tick Handler in order to get a glowing Effect on all GT Meta Items out of this Material.
+ */
+ public final short[] mRGBa = new short[]{255, 255, 255, 0}, mMoltenRGBa = new short[]{255, 255, 255, 0};
+ public final TextureSet mIconSet;
+ public final int mMetaItemSubID;
+ public final boolean mUnificatable;
+ public final GT_Materials mMaterialInto;
+ public final List<MaterialStack> mMaterialList = new ArrayList<MaterialStack>();
+ public final List<GT_Materials> mOreByProducts = new ArrayList<GT_Materials>(), mOreReRegistrations = new ArrayList<GT_Materials>();
+ public final List<TC_AspectStack> mAspects = new ArrayList<TC_AspectStack>();
+ private final ArrayList<ItemStack> mMaterialItems = new ArrayList<ItemStack>();
+ private final Collection<SubTag> mSubTags = new HashSet<SubTag>();
+ public Enchantment mEnchantmentTools = null, mEnchantmentArmors = null;
+ public byte mEnchantmentToolsLevel = 0, mEnchantmentArmorsLevel = 0;
+ public boolean mBlastFurnaceRequired = false;
+ public float mToolSpeed = 1.0F, mHeatDamage = 0.0F;
+ public String mChemicalFormula = "?", mDefaultLocalName = "null";
+ public Dyes mColor = Dyes._NULL;
+ public short mMeltingPoint = 0, mBlastFurnaceTemp = 0;
+ public int mTypes = 0, mDurability = 16, mFuelPower = 0, mFuelType = 0, mExtraData = 0, mOreValue = 0, mOreMultiplier = 1, mByProductMultiplier = 1, mSmeltingMultiplier = 1;
+ public long mDensity = M;
+ public Element mElement = null;
+ public GT_Materials mDirectSmelting = this, mOreReplacement = this, mMacerateInto = this, mSmeltInto = this, mArcSmeltInto = this, mHandleMaterial = this;
+ public byte mToolQuality = 0;
+ public Fluid mSolid = null, mFluid = null, mGas = null, mPlasma = null;
+ /**
+ * This Fluid is used as standard Unit for Molten Materials. 1296 is a Molten Block, what means 144 is one Material Unit worth
+ */
+ public Fluid mStandardMoltenFluid = null;
+
+ private GT_Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, boolean aUnificatable) {
+ mUnificatable = aUnificatable;
+ mMaterialInto = this;
+ mMetaItemSubID = aMetaItemSubID;
+ mToolQuality = (byte) aToolQuality;
+ mDurability = aToolDurability;
+ mToolSpeed = aToolSpeed;
+ mIconSet = aIconSet;
+ if (aMetaItemSubID >= 0) {
+ if (CORE.sMU_GeneratedMaterials[aMetaItemSubID] == null) {
+ CORE.sMU_GeneratedMaterials[aMetaItemSubID] = this;
+ } else {
+ throw new IllegalArgumentException("The Index " + aMetaItemSubID + " is already used!");
+ }
+ }
+ }
+
+ private GT_Materials(GT_Materials aMaterialInto, boolean aReRegisterIntoThis) {
+ mUnificatable = false;
+ mDefaultLocalName = aMaterialInto.mDefaultLocalName;
+ mMaterialInto = aMaterialInto.mMaterialInto;
+ if (aReRegisterIntoThis) mMaterialInto.mOreReRegistrations.add(this);
+ mChemicalFormula = aMaterialInto.mChemicalFormula;
+ mMetaItemSubID = -1;
+ mIconSet = TextureSet.SET_NONE;
+ }
+
+ /**
+ * @param aMetaItemSubID the Sub-ID used in my own MetaItems. Range 0-1000. -1 for no Material
+ * @param aTypes which kind of Items should be generated. Bitmask as follows:
+ * 1 = Dusts of all kinds.
+ * 2 = Dusts, Ingots, Plates, Rods/Sticks, Machine Components and other Metal specific things.
+ * 4 = Dusts, Gems, Plates, Lenses (if transparent).
+ * 8 = Dusts, Impure Dusts, crushed Ores, purified Ores, centrifuged Ores etc.
+ * 16 = Cells
+ * 32 = Plasma Cells
+ * 64 = Tool Heads
+ * 128 = Gears
+ * @param aR, aG, aB Color of the Material 0-255 each.
+ * @param aA transparency of the Material Texture. 0 = fully visible, 255 = Invisible.
+ * @param aLocalName The Name used as Default for localization.
+ * @param aFuelType Type of Generator to get Energy from this Material.
+ * @param aFuelPower EU generated. Will be multiplied by 1000, also additionally multiplied by 2 for Gems.
+ * @param aAmplificationValue Amount of UUM amplifier gotten from this.
+ * @param aUUMEnergy Amount of EU needed to shape the UUM into this Material.
+ * @param aMeltingPoint Used to determine the smelting Costs in Furnii.
+ * @param aBlastFurnaceTemp Used to determine the needed Heat capactiy Costs in Blast Furnii.
+ * @param aBlastFurnaceRequired If this requires a Blast Furnace.
+ * @param aColor Vanilla MC Wool Color which comes the closest to this.
+ */
+ private GT_Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor) {
+ this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, true);
+ mDefaultLocalName = aLocalName;
+ mMeltingPoint = (short) aMeltingPoint;
+ mBlastFurnaceTemp = (short) aBlastFurnaceTemp;
+ mBlastFurnaceRequired = aBlastFurnaceRequired;
+ if (aTransparent) add(SubTag.TRANSPARENT);
+ mFuelPower = aFuelPower;
+ mFuelType = aFuelType;
+ mOreValue = aOreValue;
+ mDensity = (M * aDensityMultiplier) / aDensityDivider;
+ mColor = aColor == null ? Dyes._NULL : aColor;
+ if (mColor != null) add(SubTag.HAS_COLOR);
+ mRGBa[0] = mMoltenRGBa[0] = (short) aR;
+ mRGBa[1] = mMoltenRGBa[1] = (short) aG;
+ mRGBa[2] = mMoltenRGBa[2] = (short) aB;
+ mRGBa[3] = mMoltenRGBa[3] = (short) aA;
+ mTypes = aTypes;
+ if ((mTypes & 2) != 0) add(SubTag.SMELTING_TO_FLUID);
+ }
+
+ private GT_Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, List<TC_AspectStack> aAspects) {
+ this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA, aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor);
+ mAspects.addAll(aAspects);
+ }
+
+ /**
+ * @param aElement The Element Enum represented by this Material
+ */
+ private GT_Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, Element aElement, List<TC_AspectStack> aAspects) {
+ this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA, aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor);
+ mElement = aElement;
+ //mElement.mLinkedMaterials.add(this);
+ if (aElement == Element._NULL) {
+ mChemicalFormula = "Empty";
+ } else {
+ mChemicalFormula = aElement.toString();
+ mChemicalFormula = mChemicalFormula.replaceAll("_", "-");
+ }
+ mAspects.addAll(aAspects);
+ }
+
+ private GT_Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, int aExtraData, List<MaterialStack> aMaterialList) {
+ this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA, aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor, aExtraData, aMaterialList, null);
+ }
+
+ private GT_Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, int aExtraData, List<MaterialStack> aMaterialList, List<TC_AspectStack> aAspects) {
+ this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA, aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor);
+ mExtraData = aExtraData;
+ mMaterialList.addAll(aMaterialList);
+ mChemicalFormula = "";
+ for (MaterialStack tMaterial : mMaterialList) mChemicalFormula += tMaterial.toString();
+ mChemicalFormula = mChemicalFormula.replaceAll("_", "-");
+
+ int tAmountOfComponents = 0, tMeltingPoint = 0;
+ for (MaterialStack tMaterial : mMaterialList) {
+ tAmountOfComponents += tMaterial.mAmount;
+ if (tMaterial.mMaterial.mMeltingPoint > 0)
+ tMeltingPoint += tMaterial.mMaterial.mMeltingPoint * tMaterial.mAmount;
+ if (aAspects == null)
+ for (TC_AspectStack tAspect : tMaterial.mMaterial.mAspects) tAspect.addToAspectList(mAspects);
+ }
+
+ if (mMeltingPoint < 0) mMeltingPoint = (short) (tMeltingPoint / tAmountOfComponents);
+
+ tAmountOfComponents *= aDensityMultiplier;
+ tAmountOfComponents /= aDensityDivider;
+ if (aAspects == null) for (TC_AspectStack tAspect : mAspects)
+ tAspect.mAmount = Math.max(1, tAspect.mAmount / Math.max(1, tAmountOfComponents));
+ else mAspects.addAll(aAspects);
+ }
+
+ public static GT_Materials get(String aMaterialName) {
+ Object tObject = GT_Utility.getFieldContent(GT_Materials.class, aMaterialName, false, false);
+ if (tObject != null && tObject instanceof Materials) return (GT_Materials) tObject;
+ return _NULL;
+ }
+
+ public static GT_Materials getRealMaterial(String aMaterialName) {
+ return get(aMaterialName).mMaterialInto;
+ }
+
+ /**
+ * Called in preInit with the Config to set Values.
+ *
+ * @param aConfiguration
+ */
+ public static void init(GT_Config aConfiguration) {
+ for (GT_Materials tMaterial : VALUES) {
+ String tString = tMaterial.toString().toLowerCase();
+ tMaterial.mHeatDamage = (float) aConfiguration.get(ConfigCategories.Materials.heatdamage, tString, tMaterial.mHeatDamage);
+ if (tMaterial.mBlastFurnaceRequired)
+ tMaterial.mBlastFurnaceRequired = aConfiguration.get(ConfigCategories.Materials.blastfurnacerequirements, tString, true);
+ if (tMaterial.mBlastFurnaceRequired && aConfiguration.get(ConfigCategories.Materials.blastinductionsmelter, tString, tMaterial.mBlastFurnaceTemp < 1500)){}
+ //GT_ModHandler.ThermalExpansion.addSmelterBlastOre(tMaterial);
+ //tMaterial.mHandleMaterial = (tMaterial == Desh ? tMaterial.mHandleMaterial : tMaterial == Diamond || tMaterial == Thaumium ? Wood : tMaterial.contains(SubTag.BURNING) ? Blaze : tMaterial.contains(SubTag.MAGICAL) && tMaterial.contains(SubTag.CRYSTAL) && Loader.isModLoaded(MOD_ID_TC) ? Thaumium : tMaterial.getMass() > Element.Tc.getMass() * 2 ? TungstenSteel : tMaterial.getMass() > Element.Tc.getMass() ? Steel : Wood);
+ }
+ }
+
+ public boolean isRadioactive() {
+ if (mElement != null) return mElement.mHalfLifeSeconds >= 0;
+ for (MaterialStack tMaterial : mMaterialList) if (tMaterial.mMaterial.isRadioactive()) return true;
+ return false;
+ }
+
+ public long getProtons() {
+ if (mElement != null) return mElement.getProtons();
+ if (mMaterialList.size() <= 0) return Element.Tc.getProtons();
+ long rAmount = 0, tAmount = 0;
+ for (MaterialStack tMaterial : mMaterialList) {
+ tAmount += tMaterial.mAmount;
+ rAmount += tMaterial.mAmount * tMaterial.mMaterial.getProtons();
+ }
+ return (getDensity() * rAmount) / (tAmount * M);
+ }
+
+ public long getNeutrons() {
+ if (mElement != null) return mElement.getNeutrons();
+ if (mMaterialList.size() <= 0) return Element.Tc.getNeutrons();
+ long rAmount = 0, tAmount = 0;
+ for (MaterialStack tMaterial : mMaterialList) {
+ tAmount += tMaterial.mAmount;
+ rAmount += tMaterial.mAmount * tMaterial.mMaterial.getNeutrons();
+ }
+ return (getDensity() * rAmount) / (tAmount * M);
+ }
+
+ public long getMass() {
+ if (mElement != null) return mElement.getMass();
+ if (mMaterialList.size() <= 0) return Element.Tc.getMass();
+ long rAmount = 0, tAmount = 0;
+ for (MaterialStack tMaterial : mMaterialList) {
+ tAmount += tMaterial.mAmount;
+ rAmount += tMaterial.mAmount * tMaterial.mMaterial.getMass();
+ }
+ return (getDensity() * rAmount) / (tAmount * M);
+ }
+
+ public long getDensity() {
+ return mDensity;
+ }
+
+ public String getToolTip() {
+ return getToolTip(1, false);
+ }
+
+ public String getToolTip(boolean aShowQuestionMarks) {
+ return getToolTip(1, aShowQuestionMarks);
+ }
+
+ public String getToolTip(long aMultiplier) {
+ return getToolTip(aMultiplier, false);
+ }
+
+ public String getToolTip(long aMultiplier, boolean aShowQuestionMarks) {
+ if (!aShowQuestionMarks && mChemicalFormula.equals("?")) return "";
+ if (aMultiplier >= M * 2 && !mMaterialList.isEmpty()) {
+ return ((mElement != null || (mMaterialList.size() < 2 && mMaterialList.get(0).mAmount == 1)) ? mChemicalFormula : "(" + mChemicalFormula + ")") + aMultiplier;
+ }
+ return mChemicalFormula;
+ }
+
+ /**
+ * Adds an ItemStack to this Material.
+ */
+ public GT_Materials add(ItemStack aStack) {
+ if (aStack != null && !contains(aStack)) mMaterialItems.add(aStack);
+ return this;
+ }
+
+ /**
+ * This is used to determine if any of the ItemStacks belongs to this Material.
+ */
+ public boolean contains(ItemStack... aStacks) {
+ if (aStacks == null || aStacks.length <= 0) return false;
+ for (ItemStack tStack : mMaterialItems)
+ for (ItemStack aStack : aStacks)
+ if (GT_Utility.areStacksEqual(aStack, tStack, !tStack.hasTagCompound())) return true;
+ return false;
+ }
+
+ /**
+ * This is used to determine if an ItemStack belongs to this Material.
+ */
+ public boolean remove(ItemStack aStack) {
+ if (aStack == null) return false;
+ boolean temp = false;
+ for (int i = 0; i < mMaterialItems.size(); i++)
+ if (GT_Utility.areStacksEqual(aStack, mMaterialItems.get(i))) {
+ mMaterialItems.remove(i--);
+ temp = true;
+ }
+ return temp;
+ }
+
+ /**
+ * Adds a SubTag to this Material
+ */
+ @Override
+ public ISubTagContainer add(SubTag... aTags) {
+ if (aTags != null) for (SubTag aTag : aTags)
+ if (aTag != null && !contains(aTag)) {
+ aTag.addContainerToList(this);
+ mSubTags.add(aTag);
+ }
+ return this;
+ }
+
+ /**
+ * If this Material has this exact SubTag
+ */
+ @Override
+ public boolean contains(SubTag aTag) {
+ return mSubTags.contains(aTag);
+ }
+
+ /**
+ * Removes a SubTag from this Material
+ */
+ @Override
+ public boolean remove(SubTag aTag) {
+ return mSubTags.remove(aTag);
+ }
+
+ /**
+ * Sets the Heat Damage for this Material (negative = frost)
+ */
+ public GT_Materials setHeatDamage(float aHeatDamage) {
+ mHeatDamage = aHeatDamage;
+ return this;
+ }
+
+ /**
+ * Adds a Material to the List of Byproducts when grinding this Ore.
+ * Is used for more precise Ore grinding, so that it is possible to choose between certain kinds of Materials.
+ */
+ public GT_Materials addOreByProduct(GT_Materials aMaterial) {
+ if (!mOreByProducts.contains(aMaterial.mMaterialInto)) mOreByProducts.add(aMaterial.mMaterialInto);
+ return this;
+ }
+
+ /**
+ * Adds multiple Materials to the List of Byproducts when grinding this Ore.
+ * Is used for more precise Ore grinding, so that it is possible to choose between certain kinds of Materials.
+ */
+ public GT_Materials addOreByProducts(GT_Materials... aMaterials) {
+ for (GT_Materials tMaterial : aMaterials) if (tMaterial != null) addOreByProduct(tMaterial);
+ return this;
+ }
+
+ /**
+ * If this Ore gives multiple drops of its Main Material.
+ * Lapis Ore for example gives about 6 drops.
+ */
+ public GT_Materials setOreMultiplier(int aOreMultiplier) {
+ if (aOreMultiplier > 0) mOreMultiplier = aOreMultiplier;
+ return this;
+ }
+
+ /**
+ * If this Ore gives multiple drops of its Byproduct Material.
+ */
+ public GT_Materials setByProductMultiplier(int aByProductMultiplier) {
+ if (aByProductMultiplier > 0) mByProductMultiplier = aByProductMultiplier;
+ return this;
+ }
+
+ /**
+ * If this Ore gives multiple drops of its Main Material.
+ * Lapis Ore for example gives about 6 drops.
+ */
+ public GT_Materials setSmeltingMultiplier(int aSmeltingMultiplier) {
+ if (aSmeltingMultiplier > 0) mSmeltingMultiplier = aSmeltingMultiplier;
+ return this;
+ }
+
+ /**
+ * This Ore should be smolten directly into an Ingot of this Material instead of an Ingot of itself.
+ */
+ public GT_Materials setDirectSmelting(GT_Materials aMaterial) {
+ if (aMaterial != null) mDirectSmelting = aMaterial.mMaterialInto.mDirectSmelting;
+ return this;
+ }
+
+ /**
+ * This Material should be the Main Material this Ore gets ground into.
+ * Example, Chromite giving Chrome or Tungstate giving Tungsten.
+ */
+ public GT_Materials setOreReplacement(GT_Materials aMaterial) {
+ if (aMaterial != null) mOreReplacement = aMaterial.mMaterialInto.mOreReplacement;
+ return this;
+ }
+
+ /**
+ * This Material smelts always into an instance of aMaterial. Used for Magnets.
+ */
+ public GT_Materials setSmeltingInto(GT_Materials aMaterial) {
+ if (aMaterial != null) mSmeltInto = aMaterial.mMaterialInto.mSmeltInto;
+ return this;
+ }
+
+ /**
+ * This Material arc smelts always into an instance of aMaterial. Used for Wrought Iron.
+ */
+ public GT_Materials setArcSmeltingInto(GT_Materials aMaterial) {
+ if (aMaterial != null) mArcSmeltInto = aMaterial.mMaterialInto.mArcSmeltInto;
+ return this;
+ }
+
+ /**
+ * This Material macerates always into an instance of aMaterial.
+ */
+ public GT_Materials setMaceratingInto(GT_Materials aMaterial) {
+ if (aMaterial != null) mMacerateInto = aMaterial.mMaterialInto.mMacerateInto;
+ return this;
+ }
+
+ public GT_Materials setEnchantmentForTools(Enchantment aEnchantment, int aEnchantmentLevel) {
+ mEnchantmentTools = aEnchantment;
+ mEnchantmentToolsLevel = (byte) aEnchantmentLevel;
+ return this;
+ }
+
+ public GT_Materials setEnchantmentForArmors(Enchantment aEnchantment, int aEnchantmentLevel) {
+ mEnchantmentArmors = aEnchantment;
+ mEnchantmentArmorsLevel = (byte) aEnchantmentLevel;
+ return this;
+ }
+
+ public FluidStack getSolid(long aAmount) {
+ if (mSolid == null) return null;
+ return new GT_FluidStack(mSolid, (int) aAmount);
+ }
+
+ public FluidStack getFluid(long aAmount) {
+ if (mFluid == null) return null;
+ return new GT_FluidStack(mFluid, (int) aAmount);
+ }
+
+ public FluidStack getGas(long aAmount) {
+ if (mGas == null) return null;
+ return new GT_FluidStack(mGas, (int) aAmount);
+ }
+
+ public FluidStack getPlasma(long aAmount) {
+ if (mPlasma == null) return null;
+ return new GT_FluidStack(mPlasma, (int) aAmount);
+ }
+
+ public FluidStack getMolten(long aAmount) {
+ if (mStandardMoltenFluid == null) return null;
+ return new GT_FluidStack(mStandardMoltenFluid, (int) aAmount);
+ }
+
+ @Override
+ public short[] getRGBA() {
+ return mRGBa;
+ }
+
+ public static volatile int VERSION = 508;
+
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechTextureSet.java b/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechTextureSet.java
new file mode 100644
index 0000000000..5f2f8b5236
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechTextureSet.java
@@ -0,0 +1,144 @@
+package miscutil.core.xmod.gregtech.api.enums;
+
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.IIconContainer;
+
+public class GregtechTextureSet {
+ public static final GregtechTextureSet
+ SET_NONE = new GregtechTextureSet("NONE"), SET_DULL = new GregtechTextureSet("DULL"), SET_RUBY = new GregtechTextureSet("RUBY"), SET_OPAL = new GregtechTextureSet("OPAL"), SET_LEAF = new GregtechTextureSet("LEAF"), SET_WOOD = new GregtechTextureSet("WOOD"), SET_SAND = new GregtechTextureSet("SAND"), SET_FINE = new GregtechTextureSet("FINE"), SET_FIERY = new GregtechTextureSet("FIERY"), SET_FLUID = new GregtechTextureSet("FLUID"), SET_ROUGH = new GregtechTextureSet("ROUGH"), SET_PAPER = new GregtechTextureSet("PAPER"), SET_GLASS = new GregtechTextureSet("GLASS"), SET_FLINT = new GregtechTextureSet("FLINT"), SET_LAPIS = new GregtechTextureSet("LAPIS"), SET_SHINY = new GregtechTextureSet("SHINY"), SET_SHARDS = new GregtechTextureSet("SHARDS"), SET_POWDER = new GregtechTextureSet("POWDER"), SET_QUARTZ = new GregtechTextureSet("QUARTZ"), SET_EMERALD = new GregtechTextureSet("EMERALD"), SET_DIAMOND = new GregtechTextureSet("DIAMOND"), SET_LIGNITE = new GregtechTextureSet("LIGNITE"), SET_MAGNETIC = new GregtechTextureSet("MAGNETIC"), SET_METALLIC = new GregtechTextureSet("METALLIC"), SET_NETHERSTAR = new GregtechTextureSet("NETHERSTAR"), SET_GEM_VERTICAL = new GregtechTextureSet("GEM_VERTICAL"), SET_GEM_HORIZONTAL = new GregtechTextureSet("GEM_HORIZONTAL");
+
+ public final IIconContainer[] mTextures = new IIconContainer[128];
+ public final String mSetName;
+
+ public GregtechTextureSet(String aSetName) {
+ mSetName = aSetName;
+ mTextures[0] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/turbineBlade");
+ mTextures[1] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[2] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[3] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[4] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[5] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[6] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[7] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[8] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[9] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[10] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[11] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[12] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[13] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[14] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[15] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[16] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[17] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[18] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[19] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[20] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[21] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[22] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[23] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[24] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[25] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[26] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[27] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[28] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[29] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[30] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[31] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[32] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[33] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[34] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[35] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[36] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[37] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[38] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[39] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[40] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[41] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[42] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[43] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[44] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[45] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[46] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[47] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[48] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[49] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[50] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[51] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[52] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[53] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[54] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[55] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[56] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[57] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[58] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[59] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[60] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[61] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[62] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[63] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[64] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[65] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[66] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[67] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[68] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[69] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[70] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[71] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[72] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[73] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[74] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[75] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[76] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[77] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[78] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[79] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[80] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[81] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[82] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[83] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[84] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[85] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[86] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[87] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[88] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[89] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[90] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[91] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[92] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[93] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[94] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[95] = new Textures.BlockIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[96] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[97] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[98] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[99] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[100] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[101] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[102] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[103] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[104] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[105] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[106] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[107] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[108] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[109] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[110] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[111] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[112] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[113] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[114] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[115] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[116] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[117] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[118] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[119] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[120] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[121] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[122] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[123] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[124] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[125] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[126] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ mTextures[127] = new Textures.ItemIcons.CustomIcon("materialicons/" + mSetName + "/void");
+ }
+} \ No newline at end of file
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechTextures.java b/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechTextures.java
new file mode 100644
index 0000000000..3bfe26fe11
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/enums/GregtechTextures.java
@@ -0,0 +1,200 @@
+package miscutil.core.xmod.gregtech.api.enums;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.interfaces.IIconContainer;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.objects.GT_RenderedTexture;
+import miscutil.core.lib.CORE;
+import miscutil.core.util.Utils;
+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 {
+
+
+ LARGECENTRIFUGE1, LARGECENTRIFUGE2, LARGECENTRIFUGE3,
+ LARGECENTRIFUGE4, LARGECENTRIFUGE5, LARGECENTRIFUGE6,
+ LARGECENTRIFUGE7, LARGECENTRIFUGE8, LARGECENTRIFUGE9,
+ LARGECENTRIFUGE_ACTIVE1, LARGECENTRIFUGE_ACTIVE2, LARGECENTRIFUGE_ACTIVE3,
+ LARGECENTRIFUGE_ACTIVE4, LARGECENTRIFUGE_ACTIVE5, LARGECENTRIFUGE_ACTIVE6,
+ LARGECENTRIFUGE_ACTIVE7, LARGECENTRIFUGE_ACTIVE8, LARGECENTRIFUGE_ACTIVE9;
+
+ public static final IIconContainer[]
+
+ CENTRIFUGE = new IIconContainer[]{
+ LARGECENTRIFUGE1,
+ LARGECENTRIFUGE2,
+ LARGECENTRIFUGE3,
+ LARGECENTRIFUGE4,
+ LARGECENTRIFUGE5,
+ LARGECENTRIFUGE6,
+ LARGECENTRIFUGE7,
+ LARGECENTRIFUGE8,
+ LARGECENTRIFUGE9
+ },
+ CENTRIFUGE_ACTIVE = new IIconContainer[]{
+ LARGECENTRIFUGE_ACTIVE1,
+ LARGECENTRIFUGE_ACTIVE2,
+ LARGECENTRIFUGE_ACTIVE3,
+ LARGECENTRIFUGE_ACTIVE4,
+ LARGECENTRIFUGE_ACTIVE5,
+ LARGECENTRIFUGE_ACTIVE6,
+ LARGECENTRIFUGE_ACTIVE7,
+ LARGECENTRIFUGE_ACTIVE8,
+ LARGECENTRIFUGE_ACTIVE9
+ };
+
+ public static ITexture[]
+ GT_CASING_BLOCKS = new ITexture[64];
+
+ protected IIcon mIcon;
+
+ private BlockIcons() {
+ CORE.GT_BlockIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return null;
+ }
+
+ @Override
+ public void run() {
+ mIcon = CORE.GT_BlockIcons.registerIcon(CORE.RES_PATH_BLOCK + "iconsets/" + this);
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationBlocksTexture; //TODO
+ }
+
+ public static class CustomIcon implements IIconContainer, Runnable {
+ protected IIcon mIcon;
+ protected String mIconName;
+
+ public CustomIcon(String aIconName) {
+ mIconName = aIconName;
+ CORE.GT_BlockIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return null;
+ }
+
+ @Override
+ public void run() {
+ mIcon = CORE.GT_BlockIcons.registerIcon(CORE.RES_PATH_BLOCK + mIconName);
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationBlocksTexture;
+ }
+ }
+ }
+
+
+ public enum ItemIcons implements IIconContainer, Runnable {
+ VOID, RENDERING_ERROR, // The Empty Texture
+ TURBINE, TURBINE_SMALL, TURBINE_LARGE, TURBINE_HUGE;
+
+ public static final ITexture[] ERROR_RENDERING = new ITexture[]{new GT_RenderedTexture(RENDERING_ERROR)};
+
+ protected IIcon mIcon, mOverlay;
+
+ private ItemIcons() {
+ GregTech_API.sGTItemIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return mOverlay;
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationItemsTexture;
+ }
+
+ @Override
+ public void run() {
+ mIcon = GregTech_API.sItemIcons.registerIcon(CORE.MODID+":" + "iconsets/" + this);
+ if (mIcon != null){
+ Utils.LOG_INFO("Found Texture at "+CORE.MODID+":" + "iconsets/" + this);
+ }
+ else if (mIcon == null){
+ mIcon = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + "iconsets/" + this);
+ if (mIcon != null){
+ Utils.LOG_INFO("Found Texture at "+CORE.RES_PATH_ITEM + "iconsets/" + this);
+ }
+ else {
+ Utils.LOG_INFO("Did not find Texture at "+CORE.RES_PATH_ITEM + "iconsets/" + this);
+ }
+ }
+ mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.MODID+":" + "iconsets/" + this + "_OVERLAY");
+ if (mOverlay != null){
+ Utils.LOG_INFO("Found Texture at "+CORE.MODID+":" + "iconsets/" + this+ "_OVERLAY");
+ }
+ else if (mOverlay == null){
+ mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.RES_PATH_ITEM + "iconsets/" + this+ "_OVERLAY");
+ if (mOverlay != null){
+ Utils.LOG_INFO("Found Texture at "+CORE.RES_PATH_ITEM + "iconsets/" + this+ "_OVERLAY");
+ }
+ else {
+ Utils.LOG_INFO("Did not find Texture at "+CORE.RES_PATH_ITEM + "iconsets/" + this+ "_OVERLAY");
+ }
+ }
+ }
+
+ public static class CustomIcon implements IIconContainer, Runnable {
+ protected IIcon mIcon, mOverlay;
+ protected String mIconName;
+
+ public CustomIcon(String aIconName) {
+ mIconName = aIconName;
+ GregTech_API.sGTItemIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return mOverlay;
+ }
+
+ @Override
+ public void run() {
+ mIcon = GregTech_API.sItemIcons.registerIcon(CORE.MODID+":" + mIconName);
+ mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.MODID+":" + mIconName + "_OVERLAY");
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationItemsTexture;
+ }
+ }
+ }
+
+}
+
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/gui/CONTAINER_IronBlastFurnace.java b/src/Java/miscutil/core/xmod/gregtech/api/gui/CONTAINER_IronBlastFurnace.java
new file mode 100644
index 0000000000..facc0769cd
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/gui/CONTAINER_IronBlastFurnace.java
@@ -0,0 +1,31 @@
+package miscutil.core.xmod.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/core/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java b/src/Java/miscutil/core/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java
new file mode 100644
index 0000000000..92fbb37af5
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java
@@ -0,0 +1,35 @@
+package miscutil.core.xmod.gregtech.api.gui;
+
+import gregtech.api.gui.GT_ContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
+
+/**
+ * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
+ * <p/>
+ * The Container I use for all my Basic Machines
+ */
+public class CONTAINER_MultiMachine extends GT_ContainerMetaTile_Machine {
+ public CONTAINER_MultiMachine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ public CONTAINER_MultiMachine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, boolean bindInventory) {
+ super(aInventoryPlayer, aTileEntity, bindInventory);
+ }
+
+ /*@Override
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ addSlotToContainer(new Slot(mTileEntity, 1, 152, 5));
+ }
+
+ @Override
+ public int getSlotCount() {
+ return 1;
+ }
+
+ @Override
+ public int getShiftClickSlotCount() {
+ return 1;
+ }*/
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/gui/CONTAINER_SafeBlock.java b/src/Java/miscutil/core/xmod/gregtech/api/gui/CONTAINER_SafeBlock.java
new file mode 100644
index 0000000000..520787e286
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/gui/CONTAINER_SafeBlock.java
@@ -0,0 +1,120 @@
+package miscutil.core.xmod.gregtech.api.gui;
+
+import gregtech.api.gui.GT_ContainerMetaTile_Machine;
+import gregtech.api.gui.GT_Slot_Holo;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import miscutil.core.util.player.PlayerCache;
+import miscutil.core.xmod.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/core/xmod/gregtech/api/gui/CONTAINER_SteamCondenser.java b/src/Java/miscutil/core/xmod/gregtech/api/gui/CONTAINER_SteamCondenser.java
new file mode 100644
index 0000000000..0cc4fc259b
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/gui/CONTAINER_SteamCondenser.java
@@ -0,0 +1,97 @@
+package miscutil.core.xmod.gregtech.api.gui;
+
+import gregtech.api.gui.GT_ContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+
+import java.util.Iterator;
+
+import miscutil.core.xmod.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/core/xmod/gregtech/api/gui/GUI_IronBlastFurnace.java b/src/Java/miscutil/core/xmod/gregtech/api/gui/GUI_IronBlastFurnace.java
new file mode 100644
index 0000000000..fa0f996a63
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/gui/GUI_IronBlastFurnace.java
@@ -0,0 +1,30 @@
+package miscutil.core.xmod.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.RES_PATH_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/core/xmod/gregtech/api/gui/GUI_MultiMachine.java b/src/Java/miscutil/core/xmod/gregtech/api/gui/GUI_MultiMachine.java
new file mode 100644
index 0000000000..2fc2242a60
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/gui/GUI_MultiMachine.java
@@ -0,0 +1,63 @@
+package miscutil.core.xmod.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;
+
+/**
+ * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
+ * <p/>
+ * The GUI-Container I use for all my Basic Machines
+ * <p/>
+ * As the NEI-RecipeTransferRect Handler can't handle one GUI-Class for all GUIs I needed to produce some dummy-classes which extend this class
+ */
+public class GUI_MultiMachine extends GT_GUIContainerMetaTile_Machine {
+
+ String mName = "";
+
+ public GUI_MultiMachine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile) {
+ super(new CONTAINER_MultiMachine(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
+ mName = aName;
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ fontRendererObj.drawString(mName, 10, 8, 16448255);
+
+ if (mContainer != null) {
+ if ((((CONTAINER_MultiMachine) mContainer).mDisplayErrorCode & 1) != 0)
+ fontRendererObj.drawString("Pipe is loose.", 10, 16, 16448255);
+ if ((((CONTAINER_MultiMachine) mContainer).mDisplayErrorCode & 2) != 0)
+ fontRendererObj.drawString("Screws are missing.", 10, 24, 16448255);
+ if ((((CONTAINER_MultiMachine) mContainer).mDisplayErrorCode & 4) != 0)
+ fontRendererObj.drawString("Something is stuck.", 10, 32, 16448255);
+ if ((((CONTAINER_MultiMachine) mContainer).mDisplayErrorCode & 8) != 0)
+ fontRendererObj.drawString("Platings are dented.", 10, 40, 16448255);
+ if ((((CONTAINER_MultiMachine) mContainer).mDisplayErrorCode & 16) != 0)
+ fontRendererObj.drawString("Circuitry burned out.", 10, 48, 16448255);
+ if ((((CONTAINER_MultiMachine) mContainer).mDisplayErrorCode & 32) != 0)
+ fontRendererObj.drawString("That doesn't belong there.", 10, 56, 16448255);
+ if ((((CONTAINER_MultiMachine) mContainer).mDisplayErrorCode & 64) != 0)
+ fontRendererObj.drawString("Incomplete Structure.", 10, 64, 16448255);
+
+ if (((CONTAINER_MultiMachine) mContainer).mDisplayErrorCode == 0) {
+ if (((CONTAINER_MultiMachine) mContainer).mActive == 0) {
+ fontRendererObj.drawString("Hit with Soft Hammer", 10, 16, 16448255);
+ fontRendererObj.drawString("to (re-)start the Machine", 10, 24, 16448255);
+ fontRendererObj.drawString("if it doesn't start.", 10, 32, 16448255);
+ } else {
+ fontRendererObj.drawString("Running perfectly.", 10, 16, 16448255);
+ }
+ }
+ }
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ int x = (width - xSize) / 2;
+ int y = (height - ySize) / 2;
+ drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/gui/GUI_SafeBlock.java b/src/Java/miscutil/core/xmod/gregtech/api/gui/GUI_SafeBlock.java
new file mode 100644
index 0000000000..71b52a1af5
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/gui/GUI_SafeBlock.java
@@ -0,0 +1,49 @@
+package miscutil.core.xmod.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.RES_PATH_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/core/xmod/gregtech/api/gui/GUI_SteamCondenser.java b/src/Java/miscutil/core/xmod/gregtech/api/gui/GUI_SteamCondenser.java
new file mode 100644
index 0000000000..f75e180a12
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/gui/GUI_SteamCondenser.java
@@ -0,0 +1,55 @@
+package miscutil.core.xmod.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.RES_PATH_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/core/xmod/gregtech/api/interfaces/GregtechItemContainer.java b/src/Java/miscutil/core/xmod/gregtech/api/interfaces/GregtechItemContainer.java
new file mode 100644
index 0000000000..e118e414f2
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/interfaces/GregtechItemContainer.java
@@ -0,0 +1,24 @@
+package miscutil.core.xmod.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/core/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java b/src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
new file mode 100644
index 0000000000..3668dd51db
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
@@ -0,0 +1,24 @@
+package miscutil.core.xmod.gregtech.api.interfaces.internal;
+
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+
+public interface IGregtech_RecipeAdder {
+ /**
+ * Adds a Coke Oven Recipe
+ *
+ * @param aInput1 = first Input (not null, and respects StackSize)
+ * @param aInputb = second Input (can be null, and respects StackSize)
+ * @param aFluidOutput = Output of the Creosote (not null, and respects StackSize)
+ * @param aFluidInput = fluid Input (can be null, and respects StackSize)
+ * @param aOutput = Output of the Coal/coke (can be null, and respects StackSize)
+ * @param aDuration = Duration (must be >= 0)
+ * @param aEUt = EU needed for heating up (must be >= 0)
+ * @return true if the Recipe got added, otherwise false.
+ */
+ //public boolean addCokeOvenRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue);
+ public boolean addCokeOvenRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt);
+
+ public boolean addFuel(ItemStack aInput1, ItemStack aOutput1, int aEU, int aType);
+
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/Interface_ItemBehaviour.java b/src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/Interface_ItemBehaviour.java
new file mode 100644
index 0000000000..fd6b953f7b
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/Interface_ItemBehaviour.java
@@ -0,0 +1,41 @@
+package miscutil.core.xmod.gregtech.api.interfaces.internal;
+
+import gregtech.api.enums.SubTag;
+
+import java.util.List;
+
+import miscutil.core.xmod.gregtech.api.items.Gregtech_MetaItem_Base;
+import net.minecraft.dispenser.IBlockSource;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.projectile.EntityArrow;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+
+public interface Interface_ItemBehaviour<E extends Item> {
+ public boolean onLeftClickEntity(E aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity);
+
+ public boolean onItemUse(E aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ);
+
+ public boolean onItemUseFirst(E aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ);
+
+ public ItemStack onItemRightClick(E aItem, ItemStack aStack, World aWorld, EntityPlayer aPlayer);
+
+ public List<String> getAdditionalToolTips(E aItem, List<String> aList, ItemStack aStack);
+
+ public void onUpdate(E aItem, ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand);
+
+ public boolean isItemStackUsable(E aItem, ItemStack aStack);
+
+ public boolean canDispense(E aItem, IBlockSource aSource, ItemStack aStack);
+
+ public ItemStack onDispense(E aItem, IBlockSource aSource, ItemStack aStack);
+
+ public boolean hasProjectile(Gregtech_MetaItem_Base aItem, SubTag aProjectileType, ItemStack aStack);
+
+ public EntityArrow getProjectile(E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ);
+
+ public EntityArrow getProjectile(E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed);
+} \ No newline at end of file
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java b/src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java
new file mode 100644
index 0000000000..a81539df29
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java
@@ -0,0 +1,16 @@
+package miscutil.core.xmod.gregtech.api.interfaces.internal;
+
+import miscutil.core.xmod.gregtech.api.enums.GregtechOrePrefixes;
+import miscutil.core.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+import net.minecraft.item.ItemStack;
+
+public interface Interface_OreRecipeRegistrator {
+ /**
+ * Contains a Code Fragment, used in the OrePrefix to register Recipes. Better than using a switch/case, like I did before.
+ *
+ * @param aPrefix always != null
+ * @param aMaterial always != null, and can be == _NULL if the Prefix is Self Referencing or not Material based!
+ * @param aStack always != null
+ */
+ public void registerOre(GregtechOrePrefixes aPrefix, GT_Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack);
+} \ No newline at end of file
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator_GT.java b/src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator_GT.java
new file mode 100644
index 0000000000..dd9751f4db
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator_GT.java
@@ -0,0 +1,16 @@
+package miscutil.core.xmod.gregtech.api.interfaces.internal;
+
+import gregtech.api.enums.OrePrefixes;
+import miscutil.core.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+import net.minecraft.item.ItemStack;
+
+public interface Interface_OreRecipeRegistrator_GT {
+ /**
+ * Contains a Code Fragment, used in the OrePrefix to register Recipes. Better than using a switch/case, like I did before.
+ *
+ * @param aPrefix always != null
+ * @param aMaterial always != null, and can be == _NULL if the Prefix is Self Referencing or not Material based!
+ * @param aStack always != null
+ */
+ public void registerOre(OrePrefixes aPrefix, GT_Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack);
+} \ No newline at end of file
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java b/src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java
new file mode 100644
index 0000000000..ff3952ba96
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java
@@ -0,0 +1,155 @@
+package miscutil.core.xmod.gregtech.api.interfaces.internal;
+
+import gregtech.api.interfaces.IIconContainer;
+
+import java.util.List;
+
+import miscutil.core.xmod.gregtech.api.items.Gregtech_MetaTool;
+import net.minecraft.block.Block;
+import net.minecraft.enchantment.Enchantment;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.DamageSource;
+import net.minecraftforge.event.world.BlockEvent;
+
+/**
+ * The Stats for GT Tools. Not including any Material Modifiers.
+ * <p/>
+ * And this is supposed to not have any ItemStack Parameters as these are generic Stats.
+ */
+public interface Interface_ToolStats {
+ /**
+ * Called when aPlayer crafts this Tool
+ */
+ public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer);
+
+ /**
+ * Called when this gets added to a Tool Item
+ */
+ public void onStatsAddedToTool(Gregtech_MetaTool gregtech_MetaTool, int aID);
+
+ /**
+ * @return Damage the Tool receives when breaking a Block. 100 is one Damage Point (or 100 EU).
+ */
+ public int getToolDamagePerBlockBreak();
+
+ /**
+ * @return Damage the Tool receives when converting the drops of a Block. 100 is one Damage Point (or 100 EU).
+ */
+ public int getToolDamagePerDropConversion();
+
+ /**
+ * @return Damage the Tool receives when being used as Container Item. 100 is one use, however it is usually 8 times more than normal.
+ */
+ public int getToolDamagePerContainerCraft();
+
+ /**
+ * @return Damage the Tool receives when being used as Weapon, 200 is the normal Value, 100 for actual Weapons.
+ */
+ public int getToolDamagePerEntityAttack();
+
+ /**
+ * @return Basic Quality of the Tool, 0 is normal. If increased, it will increase the general quality of all Tools of this Type. Decreasing is also possible.
+ */
+ public int getBaseQuality();
+
+ /**
+ * @return The Damage Bonus for this Type of Tool against Mobs. 1.0F is normal punch.
+ */
+ public float getBaseDamage();
+
+ /**
+ * @return This gets the Hurt Resistance time for Entities getting hit. (always does 1 as minimum)
+ */
+ public int getHurtResistanceTime(int aOriginalHurtResistance, Entity aEntity);
+
+ /**
+ * @return This is a multiplier for the Tool Speed. 1.0F = no special Speed.
+ */
+ public float getSpeedMultiplier();
+
+ /**
+ * @return This is a multiplier for the Tool Speed. 1.0F = no special Durability.
+ */
+ public float getMaxDurabilityMultiplier();
+
+ public DamageSource getDamageSource(EntityLivingBase aPlayer, Entity aEntity);
+
+ public String getMiningSound();
+
+ public String getCraftingSound();
+
+ public String getEntityHitSound();
+
+ public String getBreakingSound();
+
+ public Enchantment[] getEnchantments(ItemStack aStack);
+
+ public int[] getEnchantmentLevels(ItemStack aStack);
+
+ /**
+ * @return If this Tool can be used for blocking Damage like a Sword.
+ */
+ public boolean canBlock();
+
+ /**
+ * @return If this Tool can be used as an RC Crowbar.
+ */
+ public boolean isCrowbar();
+
+ /**
+ * @return If this Tool can be used as an BC Wrench.
+ */
+ public boolean isWrench();
+
+ /**
+ * @return If this Tool can be used as Weapon i.e. if that is the main purpose.
+ */
+ public boolean isWeapon();
+
+ /**
+ * @return If this Tool is a Ranged Weapon. Return false at isWeapon unless you have a Blade attached to your Bow/Gun or something
+ */
+ public boolean isRangedWeapon();
+
+ /**
+ * @return If this Tool can be used as Weapon i.e. if that is the main purpose.
+ */
+ public boolean isMiningTool();
+
+ /**
+ * aBlock.getHarvestTool(aMetaData) can return the following Values for example.
+ * "axe", "pickaxe", "sword", "shovel", "hoe", "grafter", "saw", "wrench", "crowbar", "file", "hammer", "plow", "plunger", "scoop", "screwdriver", "sense", "scythe", "softhammer", "cutter", "plasmatorch"
+ *
+ * @return If this is a minable Block. Tool Quality checks (like Diamond Tier or something) are separate from this check.
+ */
+ public boolean isMinableBlock(Block aBlock, byte aMetaData);
+
+ /**
+ * This lets you modify the Drop List, when this type of Tool has been used.
+ *
+ * @return the Amount of modified Items.
+ */
+ public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent);
+
+ /**
+ * @return Returns a broken Version of the Item.
+ */
+ public ItemStack getBrokenItem(ItemStack aStack);
+
+ /**
+ * @return the Damage actually done to the Mob.
+ */
+ public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer);
+
+ /**
+ * @return the Damage actually done to the Mob.
+ */
+ public float getMagicDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer);
+
+ public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack);
+
+ public short[] getRGBa(boolean aIsToolHead, ItemStack aStack);
+} \ No newline at end of file
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/items/Gregtech_Generic_Item.java b/src/Java/miscutil/core/xmod/gregtech/api/items/Gregtech_Generic_Item.java
new file mode 100644
index 0000000000..7eaeacf23d
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/items/Gregtech_Generic_Item.java
@@ -0,0 +1,176 @@
+package miscutil.core.xmod.gregtech.api.items;
+
+import gregtech.api.enums.SubTag;
+import gregtech.api.interfaces.IProjectileItem;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
+
+import java.util.List;
+
+import miscutil.core.creative.AddToCreativeTab;
+import miscutil.core.lib.CORE;
+import net.minecraft.block.BlockDispenser;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.dispenser.BehaviorDefaultDispenseItem;
+import net.minecraft.dispenser.BehaviorProjectileDispense;
+import net.minecraft.dispenser.IBlockSource;
+import net.minecraft.dispenser.IPosition;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.IProjectile;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.projectile.EntityArrow;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumFacing;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.World;
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+/**
+ * Extended by most Items, also used as a fallback Item, to prevent the accidental deletion when Errors occur.
+ */
+public class Gregtech_Generic_Item extends Item implements IProjectileItem {
+ private final String mName, mTooltip;
+ protected IIcon mIcon;
+
+ public Gregtech_Generic_Item(String aUnlocalized, String aEnglish, String aEnglishTooltip) {
+ this(aUnlocalized, aEnglish, aEnglishTooltip, true);
+ }
+
+ public Gregtech_Generic_Item(String aUnlocalized, String aEnglish, String aEnglishTooltip, boolean aWriteToolTipIntoLangFile) {
+ super();
+ mName = aUnlocalized;
+ GT_LanguageManager.addStringLocalization(mName + ".name", aEnglish);
+ if (GT_Utility.isStringValid(aEnglishTooltip))
+ GT_LanguageManager.addStringLocalization(mTooltip = mName + ".tooltip_main", aEnglishTooltip, aWriteToolTipIntoLangFile);
+ else mTooltip = null;
+ setCreativeTab(AddToCreativeTab.tabMachines);
+ GameRegistry.registerItem(this, mName, CORE.MODID);
+ BlockDispenser.dispenseBehaviorRegistry.putObject(this, new GT_Item_Dispense());
+ }
+
+ @Override
+ public final Item setUnlocalizedName(String aName) {
+ return this;
+ }
+
+ @Override
+ public final String getUnlocalizedName() {
+ return mName;
+ }
+
+ @Override
+ public String getUnlocalizedName(ItemStack aStack) {
+ return getHasSubtypes() ? mName + "." + getDamage(aStack) : mName;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister aIconRegister) {
+ mIcon = aIconRegister.registerIcon(CORE.MODID+":"+mName);
+ }
+
+ @Override
+ public boolean doesSneakBypassUse(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public IIcon getIconFromDamage(int par1) {
+ return mIcon;
+ }
+
+ public int getTier(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
+ if (getMaxDamage() > 0 && !getHasSubtypes())
+ aList.add((aStack.getMaxDamage() - getDamage(aStack)) + " / " + aStack.getMaxDamage());
+ if (mTooltip != null) aList.add(GT_LanguageManager.getTranslation(mTooltip));
+ if (GT_ModHandler.isElectricItem(aStack)) aList.add("Tier: " + getTier(aStack));
+ addAdditionalToolTips(aList, aStack);
+ }
+
+ protected void addAdditionalToolTips(List aList, ItemStack aStack) {
+ //
+ }
+
+ @Override
+ public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ isItemStackUsable(aStack);
+ }
+
+ public boolean isItemStackUsable(ItemStack aStack) {
+ return true;
+ }
+
+ public ItemStack onDispense(IBlockSource aSource, ItemStack aStack) {
+ EnumFacing enumfacing = BlockDispenser.func_149937_b(aSource.getBlockMetadata());
+ IPosition iposition = BlockDispenser.func_149939_a(aSource);
+ ItemStack itemstack1 = aStack.splitStack(1);
+ BehaviorDefaultDispenseItem.doDispense(aSource.getWorld(), itemstack1, 6, enumfacing, iposition);
+ return aStack;
+ }
+
+ @Override
+ public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) {
+ return null;
+ }
+
+ @Override
+ public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) {
+ return null;
+ }
+
+ @Override
+ public boolean hasProjectile(SubTag aProjectileType, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public ItemStack getContainerItem(ItemStack aStack) {
+ return null;
+ }
+
+ @Override
+ public boolean hasContainerItem(ItemStack aStack) {
+ return getContainerItem(aStack) != null;
+ }
+
+ public static class GT_Item_Dispense extends BehaviorProjectileDispense {
+ @Override
+ public ItemStack dispenseStack(IBlockSource aSource, ItemStack aStack) {
+ return ((Gregtech_Generic_Item) aStack.getItem()).onDispense(aSource, aStack);
+ }
+
+ @Override
+ protected IProjectile getProjectileEntity(World aWorld, IPosition aPosition) {
+ return null;
+ }
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (stack.getDisplayName().contains("LuV")){
+ HEX_OxFFFFFF = 0xffffcc;
+ }
+ else if (stack.getDisplayName().contains("ZPM")){
+ HEX_OxFFFFFF = 0xace600;
+ }
+ else if (stack.getDisplayName().contains("UV")){
+ HEX_OxFFFFFF = 0xffff00;
+ }
+ else if (stack.getDisplayName().contains("MAX")){
+ HEX_OxFFFFFF = 0xff0000;
+ }
+ else {
+ HEX_OxFFFFFF = 0xffffff;
+ }
+ return HEX_OxFFFFFF;
+ }
+} \ No newline at end of file
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/items/Gregtech_MetaItem.java b/src/Java/miscutil/core/xmod/gregtech/api/items/Gregtech_MetaItem.java
new file mode 100644
index 0000000000..37fa2b2a80
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/items/Gregtech_MetaItem.java
@@ -0,0 +1,323 @@
+package miscutil.core.xmod.gregtech.api.items;
+
+import static gregtech.api.enums.GT_Values.D1;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.SubTag;
+import gregtech.api.enums.TC_Aspects.TC_AspectStack;
+import gregtech.api.interfaces.IFoodStat;
+import gregtech.api.interfaces.IIconContainer;
+import gregtech.api.interfaces.IItemContainer;
+import gregtech.api.objects.ItemData;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.BitSet;
+import java.util.HashMap;
+import java.util.List;
+
+import miscutil.core.creative.AddToCreativeTab;
+import miscutil.core.lib.CORE;
+import miscutil.core.xmod.gregtech.api.interfaces.internal.Interface_ItemBehaviour;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.EnumAction;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.World;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public abstract class Gregtech_MetaItem extends Gregtech_MetaItem_Base {
+ /**
+ * All instances of this Item Class are listed here.
+ * This gets used to register the Renderer to all Items of this Type, if useStandardMetaItemRenderer() returns true.
+ * <p/>
+ * You can also use the unlocalized Name gotten from getUnlocalizedName() as Key if you want to get a specific Item.
+ */
+ public static final HashMap<String, Gregtech_MetaItem> sInstances = new HashMap<String, Gregtech_MetaItem>();
+
+ /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
+
+ public final short mOffset, mItemAmount;
+ public final BitSet mEnabledItems;
+ public final BitSet mVisibleItems;
+ public final IIcon[][] mIconList;
+
+ public final HashMap<Short, IFoodStat> mFoodStats = new HashMap<Short, IFoodStat>();
+ public final HashMap<Short, Long[]> mElectricStats = new HashMap<Short, Long[]>();
+ public final HashMap<Short, Long[]> mFluidContainerStats = new HashMap<Short, Long[]>();
+ public final HashMap<Short, Short> mBurnValues = new HashMap<Short, Short>();
+
+ /**
+ * Creates the Item using these Parameters.
+ *
+ * @param aUnlocalized The Unlocalized Name of this Item.
+ */
+ public Gregtech_MetaItem(String aUnlocalized, short aOffset, short aItemAmount) {
+ super(aUnlocalized);
+ setCreativeTab(AddToCreativeTab.tabMachines);
+ setHasSubtypes(true);
+ setMaxDamage(0);
+ mEnabledItems = new BitSet(aItemAmount);
+ mVisibleItems = new BitSet(aItemAmount);
+
+ mOffset = (short) Math.min(32766, aOffset);
+ mItemAmount = (short) Math.min(aItemAmount, 32766 - mOffset);
+ mIconList = new IIcon[aItemAmount][1];
+
+ sInstances.put(getUnlocalizedName(), this);
+ }
+
+ /**
+ * This adds a Custom Item to the ending Range.
+ *
+ * @param aID The Id of the assigned Item [0 - mItemAmount] (The MetaData gets auto-shifted by +mOffset)
+ * @param aEnglish The Default Localized Name of the created Item
+ * @param aToolTip The Default ToolTip of the created Item, you can also insert null for having no ToolTip
+ * @param aFoodBehavior The Food Value of this Item. Can be null aswell. Just a convenience thing.
+ * @param aRandomData The OreDict Names you want to give the Item. Also used for TC Aspects and some other things.
+ * @return An ItemStack containing the newly created Item.
+ */
+ public final ItemStack addItem(int aID, String aEnglish, String aToolTip, Object... aRandomData) {
+ if (aToolTip == null) aToolTip = "";
+ if (aID >= 0 && aID < mItemAmount) {
+ ItemStack rStack = new ItemStack(this, 1, mOffset + aID);
+ mEnabledItems.set(aID);
+ mVisibleItems.set(aID);
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName(rStack) + ".name", aEnglish);
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName(rStack) + ".tooltip", aToolTip);
+ List<TC_AspectStack> tAspects = new ArrayList<TC_AspectStack>();
+ // Important Stuff to do first
+ for (Object tRandomData : aRandomData)
+ if (tRandomData instanceof SubTag) {
+ if (tRandomData == SubTag.INVISIBLE) {
+ mVisibleItems.set(aID, false);
+ continue;
+ }
+ if (tRandomData == SubTag.NO_UNIFICATION) {
+ GT_OreDictUnificator.addToBlacklist(rStack);
+ continue;
+ }
+ }
+ // now check for the rest
+ for (Object tRandomData : aRandomData)
+ if (tRandomData != null) {
+ boolean tUseOreDict = true;
+
+ if (tRandomData instanceof Interface_ItemBehaviour) {
+ addItemBehavior(mOffset + aID, (Interface_ItemBehaviour<Gregtech_MetaItem_Base>) tRandomData);
+ tUseOreDict = false;
+ }
+ if (tRandomData instanceof IItemContainer) {
+ ((IItemContainer) tRandomData).set(rStack);
+ tUseOreDict = false;
+ }
+ if (tRandomData instanceof SubTag) {
+ continue;
+ }
+ if (tRandomData instanceof TC_AspectStack) {
+ ((TC_AspectStack) tRandomData).addToAspectList(tAspects);
+ continue;
+ }
+ if (tRandomData instanceof ItemData) {
+ if (GT_Utility.isStringValid(tRandomData))
+ GT_OreDictUnificator.registerOre(tRandomData, rStack);
+ else GT_OreDictUnificator.addItemData(rStack, (ItemData) tRandomData);
+ continue;
+ }
+ if (tUseOreDict) {
+ GT_OreDictUnificator.registerOre(tRandomData, rStack);
+ continue;
+ }
+ }
+ if (GregTech_API.sThaumcraftCompat != null)
+ GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(rStack, tAspects, false);
+ return rStack;
+ }
+ return null;
+ }
+
+ /**
+ * Sets the Furnace Burn Value for the Item.
+ *
+ * @param aMetaValue the Meta Value of the Item you want to set it to. [0 - 32765]
+ * @param aValue 200 = 1 Burn Process = 500 EU, max = 32767 (that is 81917.5 EU)
+ * @return the Item itself for convenience in constructing.
+ */
+ public final Gregtech_MetaItem setBurnValue(int aMetaValue, int aValue) {
+ if (aMetaValue < 0 || aMetaValue >= mOffset + mEnabledItems.length() || aValue < 0) return this;
+ if (aValue == 0) mBurnValues.remove((short) aMetaValue);
+ else mBurnValues.put((short) aMetaValue, aValue > Short.MAX_VALUE ? Short.MAX_VALUE : (short) aValue);
+ return this;
+ }
+
+ /**
+ * @param aMetaValue the Meta Value of the Item you want to set it to. [0 - 32765]
+ * @param aMaxCharge Maximum Charge. (if this is == 0 it will remove the Electric Behavior)
+ * @param aTransferLimit Transfer Limit.
+ * @param aTier The electric Tier.
+ * @param aSpecialData If this Item has a Fixed Charge, like a SingleUse Battery (if > 0).
+ * Use -1 if you want to make this Battery chargeable (the use and canUse Functions will still discharge if you just use this)
+ * Use -2 if you want to make this Battery dischargeable.
+ * Use -3 if you want to make this Battery charge/discharge-able.
+ * @return the Item itself for convenience in constructing.
+ */
+ public final Gregtech_MetaItem setElectricStats(int aMetaValue, long aMaxCharge, long aTransferLimit, long aTier, long aSpecialData, boolean aUseAnimations) {
+ if (aMetaValue < 0 || aMetaValue >= mOffset + mEnabledItems.length()) return this;
+ if (aMaxCharge == 0) mElectricStats.remove((short) aMetaValue);
+ else {
+ mElectricStats.put((short) aMetaValue, new Long[]{aMaxCharge, Math.max(0, aTransferLimit), Math.max(-1, aTier), aSpecialData});
+ if (aMetaValue >= mOffset && aUseAnimations)
+ mIconList[aMetaValue - mOffset] = Arrays.copyOf(mIconList[aMetaValue - mOffset], Math.max(9, mIconList[aMetaValue - mOffset].length));
+ }
+ return this;
+ }
+
+ /**
+ * @param aMetaValue the Meta Value of the Item you want to set it to. [0 - 32765]
+ * @param aMaxCharge Maximum Charge. (if this is == 0 it will remove the Electric Behavior)
+ * @param aTransferLimit Transfer Limit.
+ * @param aTier The electric Tier.
+ * @param aSpecialData If this Item has a Fixed Charge, like a SingleUse Battery (if > 0).
+ * Use -1 if you want to make this Battery chargeable (the use and canUse Functions will still discharge if you just use this)
+ * Use -2 if you want to make this Battery dischargeable.
+ * Use -3 if you want to make this Battery charge/discharge-able.
+ * @return the Item itself for convenience in constructing.
+ */
+ public final Gregtech_MetaItem setFluidContainerStats(int aMetaValue, long aCapacity, long aStacksize) {
+ if (aMetaValue < 0 || aMetaValue >= mOffset + mEnabledItems.length()) return this;
+ if (aCapacity < 0) mElectricStats.remove((short) aMetaValue);
+ else mFluidContainerStats.put((short) aMetaValue, new Long[]{aCapacity, Math.max(1, aStacksize)});
+ return this;
+ }
+
+ /**
+ * @return if this MetaGenerated Item should use my Default Renderer System.
+ */
+ public boolean useStandardMetaItemRenderer() {
+ return true;
+ }
+
+ /**
+ * @return the Color Modulation the Material is going to be rendered with.
+ */
+ public short[] getRGBa(ItemStack aStack) {
+ return Materials._NULL.getRGBA();
+ }
+
+ /**
+ * @return the Icon the Material is going to be rendered with.
+ */
+ public IIconContainer getIconContainer(int aMetaData) {
+ return null;
+ }
+
+ /* ---------- INTERNAL OVERRIDES ---------- */
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ return super.onItemRightClick(aStack, aWorld, aPlayer);
+ }
+
+ @Override
+ public int getMaxItemUseDuration(ItemStack aStack) {
+ return mFoodStats.get((short) getDamage(aStack)) == null ? 0 : 32;
+ }
+
+ @Override
+ public EnumAction getItemUseAction(ItemStack aStack) {
+ return EnumAction.none;
+ }
+
+ @Override
+ public final ItemStack onEaten(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ IFoodStat tStat = mFoodStats.get((short) getDamage(aStack));
+ if (tStat != null) {
+
+ }
+ return aStack;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) {
+ for (int i = 0, j = mEnabledItems.length(); i < j; i++)
+ if (mVisibleItems.get(i) || (D1 && mEnabledItems.get(i))) {
+ Long[] tStats = mElectricStats.get((short) (mOffset + i));
+ if (tStats != null && tStats[3] < 0) {
+ ItemStack tStack = new ItemStack(this, 1, mOffset + i);
+ setCharge(tStack, Math.abs(tStats[0]));
+ isItemStackUsable(tStack);
+ aList.add(tStack);
+ }
+ if (tStats == null || tStats[3] != -2) {
+ ItemStack tStack = new ItemStack(this, 1, mOffset + i);
+ isItemStackUsable(tStack);
+ aList.add(tStack);
+ }
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public final void registerIcons(IIconRegister aIconRegister) {
+ for (short i = 0, j = (short) mEnabledItems.length(); i < j; i++)
+ if (mEnabledItems.get(i)) {
+ for (byte k = 1; k < mIconList[i].length; k++) {
+ mIconList[i][k] = aIconRegister.registerIcon(CORE.MODID+":"+getUnlocalizedName() + "/" + i + "/" + k);
+ }
+ mIconList[i][0] = aIconRegister.registerIcon(CORE.MODID+":"+getUnlocalizedName() + "/" + i);
+ }
+ }
+
+ @Override
+ public final Long[] getElectricStats(ItemStack aStack) {
+ return mElectricStats.get((short) aStack.getItemDamage());
+ }
+
+ @Override
+ public final Long[] getFluidContainerStats(ItemStack aStack) {
+ return mFluidContainerStats.get((short) aStack.getItemDamage());
+ }
+
+ @Override
+ public int getItemEnchantability() {
+ return 0;
+ }
+
+ @Override
+ public boolean isBookEnchantable(ItemStack aStack, ItemStack aBook) {
+ return false;
+ }
+
+ @Override
+ public boolean getIsRepairable(ItemStack aStack, ItemStack aMaterial) {
+ return false;
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (stack.getDisplayName().contains("LuV")){
+ HEX_OxFFFFFF = 0xffffcc;
+ }
+ else if (stack.getDisplayName().contains("ZPM")){
+ HEX_OxFFFFFF = 0xace600;
+ }
+ else if (stack.getDisplayName().contains("UV")){
+ HEX_OxFFFFFF = 0xffff00;
+ }
+ else if (stack.getDisplayName().contains("MAX")){
+ HEX_OxFFFFFF = 0xff0000;
+ }
+ else {
+ HEX_OxFFFFFF = 0xffffff;
+ }
+ return HEX_OxFFFFFF;
+ }
+} \ No newline at end of file
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/items/Gregtech_MetaItem_Base.java b/src/Java/miscutil/core/xmod/gregtech/api/items/Gregtech_MetaItem_Base.java
new file mode 100644
index 0000000000..f58120e06a
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/items/Gregtech_MetaItem_Base.java
@@ -0,0 +1,549 @@
+package miscutil.core.xmod.gregtech.api.items;
+
+import static gregtech.api.enums.GT_Values.D1;
+import static gregtech.api.enums.GT_Values.V;
+import gregtech.api.enums.SubTag;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_Log;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
+import ic2.api.item.ElectricItem;
+import ic2.api.item.IElectricItem;
+import ic2.api.item.IElectricItemManager;
+import ic2.api.item.ISpecialElectricItem;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import miscutil.core.xmod.gregtech.api.interfaces.internal.Interface_ItemBehaviour;
+import net.minecraft.dispenser.IBlockSource;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.projectile.EntityArrow;
+import net.minecraft.inventory.Container;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.IFluidContainerItem;
+
+public abstract class Gregtech_MetaItem_Base extends Gregtech_Generic_Item implements ISpecialElectricItem, IElectricItemManager, IFluidContainerItem {
+ /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
+ private final HashMap<Short, ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>>> mItemBehaviors = new HashMap<Short, ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>>>();
+
+ /**
+ * Creates the Item using these Parameters.
+ *
+ * @param aUnlocalized The Unlocalized Name of this Item.
+ * @param aGeneratedPrefixList The OreDict Prefixes you want to have generated.
+ */
+ public Gregtech_MetaItem_Base(String aUnlocalized) {
+ super(aUnlocalized, "Generated Item", null, false);
+ setHasSubtypes(true);
+ setMaxDamage(0);
+ }
+
+ /**
+ * Adds a special Item Behaviour to the Item.
+ * <p/>
+ * Note: the boolean Behaviours sometimes won't be executed if another boolean Behaviour returned true before.
+ *
+ * @param aMetaValue the Meta Value of the Item you want to add it to. [0 - 32765]
+ * @param aBehavior the Click Behavior you want to add.
+ * @return the Item itself for convenience in constructing.
+ */
+ public final Gregtech_MetaItem_Base addItemBehavior(int aMetaValue, Interface_ItemBehaviour<Gregtech_MetaItem_Base> aBehavior) {
+ if (aMetaValue < 0 || aMetaValue >= 32766 || aBehavior == null) return this;
+ ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = mItemBehaviors.get((short) aMetaValue);
+ if (tList == null) {
+ tList = new ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>>(1);
+ mItemBehaviors.put((short) aMetaValue, tList);
+ }
+ tList.add(aBehavior);
+ return this;
+ }
+
+ public abstract Long[] getElectricStats(ItemStack aStack);
+
+ public abstract Long[] getFluidContainerStats(ItemStack aStack);
+
+ @Override
+ public boolean hasProjectile(SubTag aProjectileType, ItemStack aStack) {
+ ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList)
+ if (tBehavior.hasProjectile(this, aProjectileType, aStack)) return true;
+ return super.hasProjectile(aProjectileType, aStack);
+ }
+
+ @Override
+ public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) {
+ ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
+ EntityArrow rArrow = tBehavior.getProjectile(this, aProjectileType, aStack, aWorld, aX, aY, aZ);
+ if (rArrow != null) return rArrow;
+ }
+ return super.getProjectile(aProjectileType, aStack, aWorld, aX, aY, aZ);
+ }
+
+ @Override
+ public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) {
+ ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) {
+ EntityArrow rArrow = tBehavior.getProjectile(this, aProjectileType, aStack, aWorld, aEntity, aSpeed);
+ if (rArrow != null) return rArrow;
+ }
+ return super.getProjectile(aProjectileType, aStack, aWorld, aEntity, aSpeed);
+ }
+
+ @Override
+ public ItemStack onDispense(IBlockSource aSource, ItemStack aStack) {
+ ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList)
+ if (tBehavior.canDispense(this, aSource, aStack)) return tBehavior.onDispense(this, aSource, aStack);
+ return super.onDispense(aSource, aStack);
+ }
+
+ @Override
+ public boolean isItemStackUsable(ItemStack aStack) {
+ ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList)
+ if (!tBehavior.isItemStackUsable(this, aStack)) return false;
+ return super.isItemStackUsable(aStack);
+ }
+
+ @Override
+ public boolean onLeftClickEntity(ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) {
+ use(aStack, 0, aPlayer);
+ isItemStackUsable(aStack);
+ ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList)
+ try {
+ if (tBehavior.onLeftClickEntity(this, aStack, aPlayer, aEntity)) {
+ if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem();
+ return true;
+ }
+ if (aStack.stackSize <= 0) {
+ aPlayer.destroyCurrentEquippedItem();
+ return false;
+ }
+ } catch (Throwable e) {
+ if (D1) e.printStackTrace(GT_Log.err);
+ }
+ return false;
+ }
+
+ @Override
+ public boolean onItemUse(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) {
+ use(aStack, 0, aPlayer);
+ isItemStackUsable(aStack);
+ ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList)
+ try {
+ if (tBehavior.onItemUse(this, aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ)) {
+ if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem();
+ return true;
+ }
+ if (aStack.stackSize <= 0) {
+ aPlayer.destroyCurrentEquippedItem();
+ return false;
+ }
+ } catch (Throwable e) {
+ if (D1) e.printStackTrace(GT_Log.err);
+ }
+ return false;
+ }
+
+ @Override
+ public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) {
+ use(aStack, 0, aPlayer);
+ isItemStackUsable(aStack);
+ ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList)
+ try {
+ if (tBehavior.onItemUseFirst(this, aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ)) {
+ if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem();
+ return true;
+ }
+ if (aStack.stackSize <= 0) {
+ aPlayer.destroyCurrentEquippedItem();
+ return false;
+ }
+ } catch (Throwable e) {
+ if (D1) e.printStackTrace(GT_Log.err);
+ }
+ return false;
+ }
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ use(aStack, 0, aPlayer);
+ isItemStackUsable(aStack);
+ ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList)
+ try {
+ aStack = tBehavior.onItemRightClick(this, aStack, aWorld, aPlayer);
+ } catch (Throwable e) {
+ if (D1) e.printStackTrace(GT_Log.err);
+ }
+ return aStack;
+ }
+
+ @Override
+ public final void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
+ String tKey = getUnlocalizedName(aStack) + ".tooltip", tString = GT_LanguageManager.getTranslation(tKey);
+ if (GT_Utility.isStringValid(tString) && !tKey.equals(tString)) aList.add(tString);
+
+ Long[]
+ tStats = getElectricStats(aStack);
+ if (tStats != null) {
+ if (tStats[3] > 0) {
+ aList.add(EnumChatFormatting.AQUA + "Contains " + GT_Utility.formatNumbers(tStats[3]) + " EU Tier: " + (tStats[2] >= 0 ? tStats[2] : 0) + EnumChatFormatting.GRAY);
+ } else {
+ long tCharge = getRealCharge(aStack);
+ if (tStats[3] == -2 && tCharge <= 0) {
+ aList.add(EnumChatFormatting.AQUA + "Empty. You should recycle it properly." + EnumChatFormatting.GRAY);
+ } else {
+ aList.add(EnumChatFormatting.AQUA + "" + GT_Utility.formatNumbers(tCharge) + " / " + GT_Utility.formatNumbers(Math.abs(tStats[0])) + " EU - Voltage: " + V[(int) (tStats[2] >= 0 ? tStats[2] < V.length ? tStats[2] : V.length - 1 : 1)] + EnumChatFormatting.GRAY);
+ }
+ }
+ }
+
+ tStats = getFluidContainerStats(aStack);
+ if (tStats != null && tStats[0] > 0) {
+ FluidStack tFluid = getFluidContent(aStack);
+ aList.add(EnumChatFormatting.BLUE + ((tFluid == null ? "No Fluids Contained" : GT_Utility.getFluidName(tFluid, true))) + EnumChatFormatting.GRAY);
+ aList.add(EnumChatFormatting.BLUE + ((tFluid == null ? 0 : tFluid.amount) + "L / " + tStats[0] + "L") + EnumChatFormatting.GRAY);
+ }
+
+ ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList)
+ aList = tBehavior.getAdditionalToolTips(this, aList, aStack);
+
+ addAdditionalToolTips(aList, aStack);
+ }
+
+ @Override
+ public void onUpdate(ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand) {
+ ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = mItemBehaviors.get((short) getDamage(aStack));
+ if (tList != null) for (Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList)
+ tBehavior.onUpdate(this, aStack, aWorld, aPlayer, aTimer, aIsInHand);
+ }
+
+ @Override
+ public final boolean canProvideEnergy(ItemStack aStack) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null) return false;
+ return tStats[3] > 0 || (aStack.stackSize == 1 && (tStats[3] == -2 || tStats[3] == -3));
+ }
+
+ @Override
+ public final double getMaxCharge(ItemStack aStack) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null) return 0;
+ return Math.abs(tStats[0]);
+ }
+
+ @Override
+ public final double getTransferLimit(ItemStack aStack) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null) return 0;
+ return Math.max(tStats[1], tStats[3]);
+ }
+
+ @Override
+ public final double charge(ItemStack aStack, double aCharge, int aTier, boolean aIgnoreTransferLimit, boolean aSimulate) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null || tStats[2] > aTier || !(tStats[3] == -1 || tStats[3] == -3 || (tStats[3] < 0 && aCharge == Integer.MAX_VALUE)) || aStack.stackSize != 1)
+ return 0;
+ long tChargeBefore = getRealCharge(aStack), tNewCharge = aCharge == Integer.MAX_VALUE ? Long.MAX_VALUE : Math.min(Math.abs(tStats[0]), tChargeBefore + (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge)));
+ if (!aSimulate) setCharge(aStack, tNewCharge);
+ return tNewCharge - tChargeBefore;
+ }
+
+ @Override
+ public final double discharge(ItemStack aStack, double aCharge, int aTier, boolean aIgnoreTransferLimit, boolean aBatteryAlike, boolean aSimulate) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null || tStats[2] > aTier) return 0;
+ if (aBatteryAlike && !canProvideEnergy(aStack)) return 0;
+ if (tStats[3] > 0) {
+ if (aCharge < tStats[3] || aStack.stackSize < 1) return 0;
+ if (!aSimulate) aStack.stackSize--;
+ return tStats[3];
+ }
+ long tChargeBefore = getRealCharge(aStack), tNewCharge = Math.max(0, tChargeBefore - (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge)));
+ if (!aSimulate) setCharge(aStack, tNewCharge);
+ return tChargeBefore - tNewCharge;
+ }
+
+ @Override
+ public final double getCharge(ItemStack aStack) {
+ return getRealCharge(aStack);
+ }
+
+ @Override
+ public final boolean canUse(ItemStack aStack, double aAmount) {
+ return getRealCharge(aStack) >= aAmount;
+ }
+
+ @Override
+ public final boolean use(ItemStack aStack, double aAmount, EntityLivingBase aPlayer) {
+ chargeFromArmor(aStack, aPlayer);
+ if (aPlayer instanceof EntityPlayer && ((EntityPlayer) aPlayer).capabilities.isCreativeMode) return true;
+ double tTransfer = discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, true);
+ if (tTransfer == aAmount) {
+ discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false);
+ chargeFromArmor(aStack, aPlayer);
+ return true;
+ }
+ discharge(aStack, aAmount, Integer.MAX_VALUE, true, false, false);
+ chargeFromArmor(aStack, aPlayer);
+ return false;
+ }
+
+ @Override
+ public final void chargeFromArmor(ItemStack aStack, EntityLivingBase aPlayer) {
+ if (aPlayer == null || aPlayer.worldObj.isRemote) return;
+ for (int i = 1; i < 5; i++) {
+ ItemStack tArmor = aPlayer.getEquipmentInSlot(i);
+ if (GT_ModHandler.isElectricItem(tArmor)) {
+ IElectricItem tArmorItem = (IElectricItem) tArmor.getItem();
+ if (tArmorItem.canProvideEnergy(tArmor) && tArmorItem.getTier(tArmor) >= getTier(aStack)) {
+ double tCharge = ElectricItem.manager.discharge(tArmor, charge(aStack, Integer.MAX_VALUE - 1, Integer.MAX_VALUE, true, true), Integer.MAX_VALUE, true, true, false);
+ if (tCharge > 0) {
+ charge(aStack, tCharge, Integer.MAX_VALUE, true, false);
+ if (aPlayer instanceof EntityPlayer) {
+ Container tContainer = ((EntityPlayer) aPlayer).openContainer;
+ if (tContainer != null) tContainer.detectAndSendChanges();
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public final long getRealCharge(ItemStack aStack) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null) return 0;
+ if (tStats[3] > 0) return (int) (long) tStats[3];
+ NBTTagCompound tNBT = aStack.getTagCompound();
+ return tNBT == null ? 0 : tNBT.getLong("GT.ItemCharge");
+ }
+
+ public final boolean setCharge(ItemStack aStack, long aCharge) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats == null || tStats[3] > 0) return false;
+ NBTTagCompound tNBT = aStack.getTagCompound();
+ if (tNBT == null) tNBT = new NBTTagCompound();
+ tNBT.removeTag("GT.ItemCharge");
+ aCharge = Math.min(tStats[0] < 0 ? Math.abs(tStats[0] / 2) : aCharge, Math.abs(tStats[0]));
+ if (aCharge > 0) {
+ aStack.setItemDamage(getChargedMetaData(aStack));
+ tNBT.setLong("GT.ItemCharge", aCharge);
+ } else {
+ aStack.setItemDamage(getEmptyMetaData(aStack));
+ }
+ if (tNBT.hasNoTags()) aStack.setTagCompound(null);
+ else aStack.setTagCompound(tNBT);
+ isItemStackUsable(aStack);
+ return true;
+ }
+
+ public short getChargedMetaData(ItemStack aStack) {
+ return (short) aStack.getItemDamage();
+ }
+
+ public short getEmptyMetaData(ItemStack aStack) {
+ return (short) aStack.getItemDamage();
+ }
+
+ @Override
+ public FluidStack getFluid(ItemStack aStack) {
+ return getFluidContent(aStack);
+ }
+
+ @Override
+ public int getCapacity(ItemStack aStack) {
+ Long[] tStats = getFluidContainerStats(aStack);
+ return tStats == null ? 0 : (int) Math.max(0, tStats[0]);
+ }
+
+ @Override
+ public int fill(ItemStack aStack, FluidStack aFluid, boolean doFill) {
+ if (aStack == null || aStack.stackSize != 1) return 0;
+
+ ItemStack tStack = GT_Utility.fillFluidContainer(aFluid, aStack, false, false);
+ if (tStack != null) {
+ aStack.setItemDamage(tStack.getItemDamage());
+ aStack.func_150996_a(tStack.getItem());
+ return GT_Utility.getFluidForFilledItem(tStack, false).amount;
+ }
+
+ Long[] tStats = getFluidContainerStats(aStack);
+ if (tStats == null || tStats[0] <= 0 || aFluid == null || aFluid.getFluid().getID() <= 0 || aFluid.amount <= 0)
+ return 0;
+
+ FluidStack tFluid = getFluidContent(aStack);
+
+ if (tFluid == null || tFluid.getFluid().getID() <= 0) {
+ if (aFluid.amount <= tStats[0]) {
+ if (doFill) {
+ setFluidContent(aStack, aFluid);
+ }
+ return aFluid.amount;
+ }
+ if (doFill) {
+ tFluid = aFluid.copy();
+ tFluid.amount = (int) (long) tStats[0];
+ setFluidContent(aStack, tFluid);
+ }
+ return (int) (long) tStats[0];
+ }
+
+ if (!tFluid.isFluidEqual(aFluid)) return 0;
+
+ int space = (int) (long) tStats[0] - tFluid.amount;
+ if (aFluid.amount <= space) {
+ if (doFill) {
+ tFluid.amount += aFluid.amount;
+ setFluidContent(aStack, tFluid);
+ }
+ return aFluid.amount;
+ }
+ if (doFill) {
+ tFluid.amount = (int) (long) tStats[0];
+ setFluidContent(aStack, tFluid);
+ }
+ return space;
+ }
+
+ @Override
+ public FluidStack drain(ItemStack aStack, int maxDrain, boolean doDrain) {
+ if (aStack == null || aStack.stackSize != 1) return null;
+
+ FluidStack tFluid = GT_Utility.getFluidForFilledItem(aStack, false);
+ if (tFluid != null && maxDrain >= tFluid.amount) {
+ ItemStack tStack = GT_Utility.getContainerItem(aStack, false);
+ if (tStack == null) {
+ aStack.stackSize = 0;
+ return tFluid;
+ }
+ aStack.setItemDamage(tStack.getItemDamage());
+ aStack.func_150996_a(tStack.getItem());
+ return tFluid;
+ }
+
+ Long[] tStats = getFluidContainerStats(aStack);
+ if (tStats == null || tStats[0] <= 0) return null;
+
+ tFluid = getFluidContent(aStack);
+ if (tFluid == null) return null;
+
+ int used = maxDrain;
+ if (tFluid.amount < used) used = tFluid.amount;
+ if (doDrain) {
+ tFluid.amount -= used;
+ setFluidContent(aStack, tFluid);
+ }
+
+ FluidStack drained = tFluid.copy();
+ drained.amount = used;
+ return drained;
+ }
+
+ public FluidStack getFluidContent(ItemStack aStack) {
+ Long[] tStats = getFluidContainerStats(aStack);
+ if (tStats == null || tStats[0] <= 0) return GT_Utility.getFluidForFilledItem(aStack, false);
+ NBTTagCompound tNBT = aStack.getTagCompound();
+ return tNBT == null ? null : FluidStack.loadFluidStackFromNBT(tNBT.getCompoundTag("GT.FluidContent"));
+ }
+
+ public void setFluidContent(ItemStack aStack, FluidStack aFluid) {
+ NBTTagCompound tNBT = aStack.getTagCompound();
+ if (tNBT == null) tNBT = new NBTTagCompound();
+ else tNBT.removeTag("GT.FluidContent");
+ if (aFluid != null && aFluid.amount > 0)
+ tNBT.setTag("GT.FluidContent", aFluid.writeToNBT(new NBTTagCompound()));
+ if (tNBT.hasNoTags()) aStack.setTagCompound(null);
+ else aStack.setTagCompound(tNBT);
+ isItemStackUsable(aStack);
+ }
+
+ @Override
+ public int getItemStackLimit(ItemStack aStack) {
+ Long[] tStats = getElectricStats(aStack);
+ if (tStats != null && (tStats[3] == -1 || tStats[3] == -3) && getRealCharge(aStack) > 0) return 1;
+ tStats = getFluidContainerStats(aStack);
+ if (tStats != null) return (int) (long) tStats[1];
+ return 64;
+ }
+
+ @Override
+ public final Item getChargedItem(ItemStack itemStack) {
+ return this;
+ }
+
+ @Override
+ public final Item getEmptyItem(ItemStack itemStack) {
+ return this;
+ }
+
+ @Override
+ public final int getTier(ItemStack aStack) {
+ Long[] tStats = getElectricStats(aStack);
+ return (int) (tStats == null ? Integer.MAX_VALUE : tStats[2]);
+ }
+
+ @Override
+ public final String getToolTip(ItemStack aStack) {
+ return null;
+ } // This has its own ToolTip Handler, no need to let the IC2 Handler screw us up at this Point
+
+ @Override
+ public final IElectricItemManager getManager(ItemStack aStack) {
+ return this;
+ } // We are our own Manager
+
+ @Override
+ public final boolean getShareTag() {
+ return true;
+ } // just to be sure.
+
+ @Override
+ public int getItemEnchantability() {
+ return 0;
+ }
+
+ @Override
+ public boolean isBookEnchantable(ItemStack aStack, ItemStack aBook) {
+ return false;
+ }
+
+ @Override
+ public boolean getIsRepairable(ItemStack aStack, ItemStack aMaterial) {
+ return false;
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (stack.getDisplayName().contains("LuV")){
+ HEX_OxFFFFFF = 0xffffcc;
+ }
+ else if (stack.getDisplayName().contains("ZPM")){
+ HEX_OxFFFFFF = 0xace600;
+ }
+ else if (stack.getDisplayName().contains("UV")){
+ HEX_OxFFFFFF = 0xffff00;
+ }
+ else if (stack.getDisplayName().contains("MAX")){
+ HEX_OxFFFFFF = 0xff0000;
+ }
+ else {
+ HEX_OxFFFFFF = 0xffffff;
+ }
+ return HEX_OxFFFFFF;
+ }
+} \ No newline at end of file
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/items/Gregtech_MetaItem_X32.java b/src/Java/miscutil/core/xmod/gregtech/api/items/Gregtech_MetaItem_X32.java
new file mode 100644
index 0000000000..b66c84bef8
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/items/Gregtech_MetaItem_X32.java
@@ -0,0 +1,194 @@
+package miscutil.core.xmod.gregtech.api.items;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.interfaces.IIconContainer;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
+
+import java.util.Arrays;
+import java.util.List;
+
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+/**
+ * @author Gregorius Techneticies
+ * <p/>
+ * One Item for everything!
+ * <p/>
+ * This brilliant Item Class is used for automatically generating all possible variations of Material Items, like Dusts, Ingots, Gems, Plates and similar.
+ * It saves me a ton of work, when adding Items, because I always have to make a new Item SubType for each OreDict Prefix, when adding a new Material.
+ * <p/>
+ * As you can see, up to 32766 Items can be generated using this Class. And the last 766 Items can be custom defined, just to save space and MetaData.
+ * <p/>
+ * These Items can also have special RightClick abilities, electric Charge or even be set to become a Food alike Item.
+ */
+public abstract class Gregtech_MetaItem_X32 extends Gregtech_MetaItem {
+
+ protected final OrePrefixes[] mGeneratedPrefixList;
+
+ /**
+ * Creates the Item using these Parameters.
+ *
+ * @param aUnlocalized The Unlocalized Name of this Item.
+ * @param aGeneratedPrefixList The OreDict Prefixes you want to have generated.
+ */
+ public Gregtech_MetaItem_X32(String aUnlocalized, OrePrefixes... aGeneratedPrefixList) {
+ super(aUnlocalized, (short) 32000, (short) 766);
+ mGeneratedPrefixList = Arrays.copyOf(aGeneratedPrefixList, 32);
+
+ for (int i = 0; i < 32000; i++) {
+ OrePrefixes tPrefix = mGeneratedPrefixList[i / 1000];
+ if (tPrefix == null) continue;
+ Materials tMaterial = GregTech_API.sGeneratedMaterials[i % 1000];
+ if (tMaterial == null) continue;
+ if (doesMaterialAllowGeneration(tPrefix, tMaterial)) {
+ ItemStack tStack = new ItemStack(this, 1, i);
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName(tStack) + ".name", getDefaultLocalization(tPrefix, tMaterial, i));
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName(tStack) + ".tooltip", tMaterial.getToolTip(tPrefix.mMaterialAmount / GT_Values.M));
+ if (tPrefix.mIsUnificatable) {
+ GT_OreDictUnificator.set(tPrefix, tMaterial, tStack);
+ } else {
+ GT_OreDictUnificator.registerOre(tPrefix.get(tMaterial), tStack);
+ }
+ if ((tPrefix == OrePrefixes.stick || tPrefix == OrePrefixes.wireFine) && (tMaterial == Materials.Lead || tMaterial == Materials.Tin || tMaterial == Materials.SolderingAlloy)) {
+ GregTech_API.sSolderingMetalList.add(tStack);
+ }
+ }
+ }
+ }
+
+ /* ---------- OVERRIDEABLE FUNCTIONS ---------- */
+
+ /**
+ * @return the Color Modulation the Material is going to be rendered with.
+ */
+ @Override
+ public short[] getRGBa(ItemStack aStack) {
+ Materials tMaterial = GregTech_API.sGeneratedMaterials[getDamage(aStack) % 1000];
+ return tMaterial == null ? Materials._NULL.mRGBa : tMaterial.mRGBa;
+ }
+
+ /**
+ * @param aPrefix this can be null, you have to return false in that case
+ * @param aMaterial this can be null, you have to return false in that case
+ * @return if this Item should be generated and visible.
+ */
+ public boolean doesMaterialAllowGeneration(OrePrefixes aPrefix, Materials aMaterial) {
+ // You have to check for at least these Conditions in every Case! So add a super Call like the following for this before executing your Code:
+ // if (!super.doesMaterialAllowGeneration(aPrefix, aMaterial)) return false;
+ return aPrefix != null && aMaterial != null && aPrefix.doGenerateItem(aMaterial);
+ }
+
+ /* ---------- OVERRIDEABLE FUNCTIONS ---------- */
+
+ /**
+ * @param aPrefix the OreDict Prefix
+ * @param aMaterial the Material
+ * @param aMetaData a Index from [0 - 31999]
+ * @return the Localized Name when default LangFiles are used.
+ */
+ public String getDefaultLocalization(OrePrefixes aPrefix, Materials aMaterial, int aMetaData) {
+ return aPrefix.getDefaultLocalNameForItem(aMaterial);
+ }
+
+ /**
+ * @param aMetaData a Index from [0 - 31999]
+ * @param aMaterial the Material
+ * @return an Icon Container for the Item Display.
+ */
+ public final IIconContainer getIconContainer(int aMetaData, Materials aMaterial) {
+ return mGeneratedPrefixList[aMetaData / 1000] != null && mGeneratedPrefixList[aMetaData / 1000].mTextureIndex >= 0 ? aMaterial.mIconSet.mTextures[mGeneratedPrefixList[aMetaData / 1000].mTextureIndex] : null;
+ }
+
+ /**
+ * @param aPrefix always != null
+ * @param aMaterial always != null
+ * @param aDoShowAllItems this is the Configuration Setting of the User, if he wants to see all the Stuff like Tiny Dusts or Crushed Ores as well.
+ * @return if this Item should be visible in NEI or Creative
+ */
+ public boolean doesShowInCreative(OrePrefixes aPrefix, Materials aMaterial, boolean aDoShowAllItems) {
+ return true;
+ }
+
+ /* ---------- INTERNAL OVERRIDES ---------- */
+
+ @Override
+ public ItemStack getContainerItem(ItemStack aStack) {
+ int aDamage = aStack.getItemDamage();
+ if (aDamage < 32000 && aDamage >= 0) {
+ Materials aMaterial = GregTech_API.sGeneratedMaterials[aDamage % 1000];
+ if (aMaterial != null && aMaterial != Materials.Empty && aMaterial != Materials._NULL) {
+ OrePrefixes aPrefix = mGeneratedPrefixList[aDamage / 1000];
+ if (aPrefix != null) return GT_Utility.copyAmount(1, aPrefix.mContainerItem);
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public final IIconContainer getIconContainer(int aMetaData) {
+ return GregTech_API.sGeneratedMaterials[aMetaData % 1000] == null ? null : getIconContainer(aMetaData, GregTech_API.sGeneratedMaterials[aMetaData % 1000]);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public final void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) {
+ for (int i = 0; i < 32000; i++)
+ if (doesMaterialAllowGeneration(mGeneratedPrefixList[i / 1000], GregTech_API.sGeneratedMaterials[i % 1000]) && doesShowInCreative(mGeneratedPrefixList[i / 1000], GregTech_API.sGeneratedMaterials[i % 1000], GregTech_API.sDoShowAllItemsInCreative)) {
+ ItemStack tStack = new ItemStack(this, 1, i);
+ isItemStackUsable(tStack);
+ aList.add(tStack);
+ }
+ super.getSubItems(var1, aCreativeTab, aList);
+ }
+
+ @Override
+ public final IIcon getIconFromDamage(int aMetaData) {
+ if (aMetaData < 0) return null;
+ if (aMetaData < 32000) {
+ Materials tMaterial = GregTech_API.sGeneratedMaterials[aMetaData % 1000];
+ if (tMaterial == null) return null;
+ IIconContainer tIcon = getIconContainer(aMetaData, tMaterial);
+ if (tIcon != null) return tIcon.getIcon();
+ return null;
+ }
+ return aMetaData - 32000 < mIconList.length ? mIconList[aMetaData - 32000][0] : null;
+ }
+
+ @Override
+ public int getItemStackLimit(ItemStack aStack) {
+ int tDamage = getDamage(aStack);
+ if (tDamage < 32000 && mGeneratedPrefixList[tDamage / 1000] != null)
+ return Math.min(super.getItemStackLimit(aStack), mGeneratedPrefixList[tDamage / 1000].mDefaultStackSize);
+ return super.getItemStackLimit(aStack);
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (stack.getDisplayName().contains("LuV")){
+ HEX_OxFFFFFF = 0xffffcc;
+ }
+ else if (stack.getDisplayName().contains("ZPM")){
+ HEX_OxFFFFFF = 0xffe600;
+ }
+ else if (stack.getDisplayName().contains("UV")){
+ HEX_OxFFFFFF = 0xffb300;
+ }
+ else if (stack.getDisplayName().contains("MAX")){
+ HEX_OxFFFFFF = 0xff6500;
+ }
+ else {
+ HEX_OxFFFFFF = 0xffffff;
+ }
+ return HEX_OxFFFFFF;
+ }
+} \ No newline at end of file
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/items/Gregtech_MetaTool.java b/src/Java/miscutil/core/xmod/gregtech/api/items/Gregtech_MetaTool.java
new file mode 100644
index 0000000000..dfc9f3161e
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/items/Gregtech_MetaTool.java
@@ -0,0 +1,605 @@
+package miscutil.core.xmod.gregtech.api.items;
+
+import static gregtech.api.enums.GT_Values.MOD_ID_RC;
+import gregtech.api.GregTech_API;
+import gregtech.api.enchants.Enchantment_Radioactivity;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.TC_Aspects.TC_AspectStack;
+import gregtech.api.interfaces.IDamagableItem;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map.Entry;
+import java.util.Random;
+
+import miscutil.core.creative.AddToCreativeTab;
+import miscutil.core.xmod.gregtech.api.interfaces.internal.Interface_ToolStats;
+import mods.railcraft.api.core.items.IToolCrowbar;
+import net.minecraft.block.Block;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.enchantment.Enchantment;
+import net.minecraft.enchantment.EnchantmentHelper;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.SharedMonsterAttributes;
+import net.minecraft.entity.item.EntityMinecart;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.EnumAction;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.potion.Potion;
+import net.minecraft.stats.AchievementList;
+import net.minecraft.stats.StatList;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.IIcon;
+import net.minecraft.util.MathHelper;
+import net.minecraft.world.World;
+import net.minecraftforge.event.world.BlockEvent;
+import buildcraft.api.tools.IToolWrench;
+import cpw.mods.fml.common.Optional;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+/**
+ * This is an example on how you can create a Tool ItemStack, in this case a Bismuth Wrench:
+ * GT_MetaGenerated_Tool.sInstances.get("gt.metatool.01").getToolWithStats(16, 1, Materials.Bismuth, Materials.Bismuth, null);
+ */
+@Optional.InterfaceList(value = {@Optional.Interface(iface = "mods.railcraft.api.core.items.IToolCrowbar", modid = MOD_ID_RC), @Optional.Interface(iface = "buildcraft.api.tools.IToolWrench", modid = "BuildCraft")})
+public abstract class Gregtech_MetaTool extends Gregtech_MetaItem_Base implements IDamagableItem, IToolCrowbar, IToolWrench {
+ /**
+ * All instances of this Item Class are listed here.
+ * This gets used to register the Renderer to all Items of this Type, if useStandardMetaItemRenderer() returns true.
+ * <p/>
+ * You can also use the unlocalized Name gotten from getUnlocalizedName() as Key if you want to get a specific Item.
+ */
+ public static final HashMap<String, Gregtech_MetaTool> sInstances = new HashMap<String, Gregtech_MetaTool>();
+
+ /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
+
+ public final HashMap<Short, Interface_ToolStats> mToolStats = new HashMap<Short, Interface_ToolStats>();
+
+ /**
+ * Creates the Item using these Parameters.
+ *
+ * @param aUnlocalized The Unlocalized Name of this Item.
+ */
+ public Gregtech_MetaTool(String aUnlocalized) {
+ super(aUnlocalized);
+ GT_ModHandler.registerBoxableItemToToolBox(this);
+ setCreativeTab(AddToCreativeTab.tabMachines);
+ setMaxStackSize(1);
+ sInstances.put(getUnlocalizedName(), this);
+ }
+
+ /* ---------- FOR ADDING CUSTOM ITEMS INTO THE REMAINING 766 RANGE ---------- */
+
+ public static final Materials getPrimaryMaterial(ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("GT.ToolStats");
+ if (aNBT != null) return Materials.getRealMaterial(aNBT.getString("PrimaryMaterial"));
+ }
+ return Materials._NULL;
+ }
+
+ public static final Materials getSecondaryMaterial(ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("GT.ToolStats");
+ if (aNBT != null) return Materials.getRealMaterial(aNBT.getString("SecondaryMaterial"));
+ }
+ return Materials._NULL;
+ }
+
+ /* ---------- INTERNAL OVERRIDES ---------- */
+
+ public static final long getToolMaxDamage(ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("GT.ToolStats");
+ if (aNBT != null) return aNBT.getLong("MaxDamage");
+ }
+ return 0;
+ }
+
+ public static final long getToolDamage(ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("GT.ToolStats");
+ if (aNBT != null) return aNBT.getLong("Damage");
+ }
+ return 0;
+ }
+
+ public static final boolean setToolDamage(ItemStack aStack, long aDamage) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("GT.ToolStats");
+ if (aNBT != null) {
+ aNBT.setLong("Damage", aDamage);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * This adds a Custom Item to the ending Range.
+ *
+ * @param aID The Id of the assigned Tool Class [0 - 32765] (only even Numbers allowed! Uneven ID's are empty electric Items)
+ * @param aEnglish The Default Localized Name of the created Item
+ * @param aToolTip The Default ToolTip of the created Item, you can also insert null for having no ToolTip
+ * @param aToolStats The Food Value of this Item. Can be null as well.
+ * @param aOreDictNamesAndAspects The OreDict Names you want to give the Item. Also used to assign Thaumcraft Aspects.
+ * @return An ItemStack containing the newly created Item, but without specific Stats.
+ */
+ public final ItemStack addTool(int aID, String aEnglish, String aToolTip, Interface_ToolStats aToolStats, Object... aOreDictNamesAndAspects) {
+ if (aToolTip == null) aToolTip = "";
+ if (aID >= 0 && aID < 32766 && aID % 2 == 0) {
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + aID + ".name", aEnglish);
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + aID + ".tooltip", aToolTip);
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (aID + 1) + ".name", aEnglish + " (Empty)");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (aID + 1) + ".tooltip", "You need to recharge it");
+ mToolStats.put((short) aID, aToolStats);
+ mToolStats.put((short) (aID + 1), aToolStats);
+ aToolStats.onStatsAddedToTool(this, aID);
+ ItemStack rStack = new ItemStack(this, 1, aID);
+ List<TC_AspectStack> tAspects = new ArrayList<TC_AspectStack>();
+ for (Object tOreDictNameOrAspect : aOreDictNamesAndAspects) {
+ if (tOreDictNameOrAspect instanceof TC_AspectStack)
+ ((TC_AspectStack) tOreDictNameOrAspect).addToAspectList(tAspects);
+ else
+ GT_OreDictUnificator.registerOre(tOreDictNameOrAspect, rStack);
+ }
+ if (GregTech_API.sThaumcraftCompat != null)
+ GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(rStack, tAspects, false);
+ return rStack;
+ }
+ return null;
+ }
+
+ /**
+ * This Function gets an ItemStack Version of this Tool
+ *
+ * @param aToolID the ID of the Tool Class
+ * @param aAmount Amount of Items (well normally you only need 1)
+ * @param aPrimaryMaterial Primary Material of this Tool
+ * @param aSecondaryMaterial Secondary (Rod/Handle) Material of this Tool
+ * @param aElectricArray The Electric Stats of this Tool (or null if not electric)
+ */
+ public final ItemStack getToolWithStats(int aToolID, int aAmount, Materials aPrimaryMaterial, Materials aSecondaryMaterial, long[] aElectricArray) {
+ ItemStack rStack = new ItemStack(this, aAmount, aToolID);
+ Interface_ToolStats tToolStats = getToolStats(rStack);
+ if (tToolStats != null) {
+ NBTTagCompound tMainNBT = new NBTTagCompound(), tToolNBT = new NBTTagCompound();
+ if (aPrimaryMaterial != null) {
+ tToolNBT.setString("PrimaryMaterial", aPrimaryMaterial.toString());
+ tToolNBT.setLong("MaxDamage", 100L * (long) (aPrimaryMaterial.mDurability * tToolStats.getMaxDurabilityMultiplier()));
+ }
+ if (aSecondaryMaterial != null) tToolNBT.setString("SecondaryMaterial", aSecondaryMaterial.toString());
+
+ if (aElectricArray != null) {
+ tToolNBT.setBoolean("Electric", true);
+ tToolNBT.setLong("MaxCharge", aElectricArray[0]);
+ tToolNBT.setLong("Voltage", aElectricArray[1]);
+ tToolNBT.setLong("Tier", aElectricArray[2]);
+ tToolNBT.setLong("SpecialData", aElectricArray[3]);
+ }
+
+ tMainNBT.setTag("GT.ToolStats", tToolNBT);
+ rStack.setTagCompound(tMainNBT);
+ }
+ isItemStackUsable(rStack);
+ return rStack;
+ }
+
+ /**
+ * Called by the Block Harvesting Event within the GT_Proxy
+ */
+ public void onHarvestBlockEvent(ArrayList<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) {
+ Interface_ToolStats tStats = getToolStats(aStack);
+ if (isItemStackUsable(aStack) && getDigSpeed(aStack, aBlock, aMetaData) > 0.0F)
+ doDamage(aStack, tStats.convertBlockDrops(aDrops, aStack, aPlayer, aBlock, aX, aY, aZ, aMetaData, aFortune, aSilkTouch, aEvent) * tStats.getToolDamagePerDropConversion());
+ }
+
+ @Override
+ public boolean onLeftClickEntity(ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) {
+ Interface_ToolStats tStats = getToolStats(aStack);
+ if (tStats == null || !isItemStackUsable(aStack)) return true;
+ GT_Utility.doSoundAtClient(tStats.getEntityHitSound(), 1, 1.0F);
+ if (super.onLeftClickEntity(aStack, aPlayer, aEntity)) return true;
+ if (aEntity.canAttackWithItem() && !aEntity.hitByEntity(aPlayer)) {
+ float tMagicDamage = tStats.getMagicDamageAgainstEntity(aEntity instanceof EntityLivingBase ? EnchantmentHelper.getEnchantmentModifierLiving(aPlayer, (EntityLivingBase) aEntity) : 0.0F, aEntity, aStack, aPlayer), tDamage = tStats.getNormalDamageAgainstEntity((float) aPlayer.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue() + getToolCombatDamage(aStack), aEntity, aStack, aPlayer);
+ if (tDamage + tMagicDamage > 0.0F) {
+ boolean tCriticalHit = aPlayer.fallDistance > 0.0F && !aPlayer.onGround && !aPlayer.isOnLadder() && !aPlayer.isInWater() && !aPlayer.isPotionActive(Potion.blindness) && aPlayer.ridingEntity == null && aEntity instanceof EntityLivingBase;
+ if (tCriticalHit && tDamage > 0.0F) tDamage *= 1.5F;
+ tDamage += tMagicDamage;
+ if (aEntity.attackEntityFrom(tStats.getDamageSource(aPlayer, aEntity), tDamage)) {
+ if (aEntity instanceof EntityLivingBase)
+ aEntity.setFire(EnchantmentHelper.getFireAspectModifier(aPlayer) * 4);
+ int tKnockcack = (aPlayer.isSprinting() ? 1 : 0) + (aEntity instanceof EntityLivingBase ? EnchantmentHelper.getKnockbackModifier(aPlayer, (EntityLivingBase) aEntity) : 0);
+ if (tKnockcack > 0) {
+ aEntity.addVelocity(-MathHelper.sin(aPlayer.rotationYaw * (float) Math.PI / 180.0F) * tKnockcack * 0.5F, 0.1D, MathHelper.cos(aPlayer.rotationYaw * (float) Math.PI / 180.0F) * tKnockcack * 0.5F);
+ aPlayer.motionX *= 0.6D;
+ aPlayer.motionZ *= 0.6D;
+ aPlayer.setSprinting(false);
+ }
+ if (tCriticalHit) aPlayer.onCriticalHit(aEntity);
+ if (tMagicDamage > 0.0F) aPlayer.onEnchantmentCritical(aEntity);
+ if (tDamage >= 18.0F) aPlayer.triggerAchievement(AchievementList.overkill);
+ aPlayer.setLastAttacker(aEntity);
+ if (aEntity instanceof EntityLivingBase)
+ EnchantmentHelper.func_151384_a((EntityLivingBase) aEntity, aPlayer);
+ EnchantmentHelper.func_151385_b(aPlayer, aEntity);
+ if (aEntity instanceof EntityLivingBase)
+ aPlayer.addStat(StatList.damageDealtStat, Math.round(tDamage * 10.0F));
+ aEntity.hurtResistantTime = Math.max(1, tStats.getHurtResistanceTime(aEntity.hurtResistantTime, aEntity));
+ aPlayer.addExhaustion(0.3F);
+ doDamage(aStack, tStats.getToolDamagePerEntityAttack());
+ }
+ }
+ }
+ if (aStack.stackSize <= 0) aPlayer.destroyCurrentEquippedItem();
+ return true;
+ }
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ Interface_ToolStats tStats = getToolStats(aStack);
+ if (tStats != null && tStats.canBlock()) aPlayer.setItemInUse(aStack, 72000);
+ return super.onItemRightClick(aStack, aWorld, aPlayer);
+ }
+
+ @Override
+ public final int getMaxItemUseDuration(ItemStack aStack) {
+ return 72000;
+ }
+
+ @Override
+ public final EnumAction getItemUseAction(ItemStack aStack) {
+ Interface_ToolStats tStats = getToolStats(aStack);
+ if (tStats != null && tStats.canBlock()) return EnumAction.block;
+ return EnumAction.none;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public final void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) {
+ for (int i = 0; i < 32766; i += 2)
+ if (getToolStats(new ItemStack(this, 1, i)) != null) {
+ ItemStack tStack = new ItemStack(this, 1, i);
+ isItemStackUsable(tStack);
+ aList.add(tStack);
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public final void registerIcons(IIconRegister aIconRegister) {
+ //
+ }
+
+ @Override
+ public final IIcon getIconFromDamage(int aMetaData) {
+ return null;
+ }
+
+ @Override
+ public void addAdditionalToolTips(List aList, ItemStack aStack) {
+ long tMaxDamage = getToolMaxDamage(aStack);
+ Materials tMaterial = getPrimaryMaterial(aStack);
+ Interface_ToolStats tStats = getToolStats(aStack);
+ int tOffset = getElectricStats(aStack) != null ? 2 : 1;
+ if (tStats != null) {
+ String name = aStack.getUnlocalizedName();
+ if (name.equals("gt.metatool.01.170") || name.equals("gt.metatool.01.172") || name.equals("gt.metatool.01.174") || name.equals("gt.metatool.01.176")) {
+ aList.add(tOffset + 0, EnumChatFormatting.WHITE + "Durability: " + EnumChatFormatting.GREEN + (tMaxDamage - getToolDamage(aStack)) + " / " + tMaxDamage + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 1, EnumChatFormatting.WHITE + tMaterial.mDefaultLocalName + EnumChatFormatting.YELLOW + " lvl " + getHarvestLevel(aStack, "") + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 2, EnumChatFormatting.WHITE + "Turbine Efficency: " + EnumChatFormatting.BLUE + (50.0F + (10.0F * getToolCombatDamage(aStack))) + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 3, EnumChatFormatting.WHITE + "Optimal Steam flow: " + EnumChatFormatting.LIGHT_PURPLE + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 1000) + EnumChatFormatting.GRAY + "L/sec");
+ aList.add(tOffset + 3, EnumChatFormatting.WHITE + "Optimal Gas flow(EU burnvalue per tick): " + EnumChatFormatting.LIGHT_PURPLE + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 25) + EnumChatFormatting.GRAY + "EU/t");
+ aList.add(tOffset + 3, EnumChatFormatting.WHITE + "Optimal Plasma flow(Plasma energyvalue per tick): " + EnumChatFormatting.LIGHT_PURPLE + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 1000) + EnumChatFormatting.GRAY + "EU/t");
+
+ } else {
+ aList.add(tOffset + 0, EnumChatFormatting.WHITE + "Durability: " + EnumChatFormatting.GREEN + (tMaxDamage - getToolDamage(aStack)) + " / " + tMaxDamage + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 1, EnumChatFormatting.WHITE + tMaterial.mDefaultLocalName + EnumChatFormatting.YELLOW + " lvl " + getHarvestLevel(aStack, "") + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 2, EnumChatFormatting.WHITE + "Attack Damage: " + EnumChatFormatting.BLUE + getToolCombatDamage(aStack) + EnumChatFormatting.GRAY);
+ aList.add(tOffset + 3, EnumChatFormatting.WHITE + "Mining Speed: " + EnumChatFormatting.LIGHT_PURPLE + Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed) + EnumChatFormatting.GRAY);
+ }
+ }
+ }
+
+ @Override
+ public Long[] getFluidContainerStats(ItemStack aStack) {
+ return null;
+ }
+
+ @Override
+ public Long[] getElectricStats(ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("GT.ToolStats");
+ if (aNBT != null && aNBT.getBoolean("Electric"))
+ return new Long[]{aNBT.getLong("MaxCharge"), aNBT.getLong("Voltage"), aNBT.getLong("Tier"), aNBT.getLong("SpecialData")};
+ }
+ return null;
+ }
+
+ public float getToolCombatDamage(ItemStack aStack) {
+ Interface_ToolStats tStats = getToolStats(aStack);
+ if (tStats == null) return 0;
+ return tStats.getBaseDamage() + getPrimaryMaterial(aStack).mToolQuality;
+ }
+
+ @Override
+ public final boolean doDamageToItem(ItemStack aStack, int aVanillaDamage) {
+ return doDamage(aStack, aVanillaDamage * 100);
+ }
+
+ public final boolean doDamage(ItemStack aStack, long aAmount) {
+ if (!isItemStackUsable(aStack)) return false;
+ Long[] tElectric = getElectricStats(aStack);
+ if (tElectric == null) {
+ long tNewDamage = getToolDamage(aStack) + aAmount;
+ setToolDamage(aStack, tNewDamage);
+ if (tNewDamage >= getToolMaxDamage(aStack)) {
+ Interface_ToolStats tStats = getToolStats(aStack);
+ if (tStats == null || GT_Utility.setStack(aStack, tStats.getBrokenItem(aStack)) == null) {
+ if (tStats != null) /*GT_Utility.doSoundAtClient(tStats.getBreakingSound(), 1, 1.0F);*/
+ if (aStack.stackSize > 0) aStack.stackSize--;
+
+ }
+ }
+ return true;
+ }
+ if (use(aStack, (int) aAmount, null)) {
+ if (new Random().nextInt(25) == 0) {
+ long tNewDamage = getToolDamage(aStack) + aAmount;
+ setToolDamage(aStack, tNewDamage);
+ if (tNewDamage >= getToolMaxDamage(aStack)) {
+ Interface_ToolStats tStats = getToolStats(aStack);
+ if (tStats == null || GT_Utility.setStack(aStack, tStats.getBrokenItem(aStack)) == null) {
+ if (tStats != null) /*GT_Utility.doSoundAtClient(tStats.getBreakingSound(), 1, 1.0F);*/
+ if (aStack.stackSize > 0) aStack.stackSize--;
+ }
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public float getDigSpeed(ItemStack aStack, Block aBlock, int aMetaData) {
+ if (!isItemStackUsable(aStack)) return 0.0F;
+ Interface_ToolStats tStats = getToolStats(aStack);
+ if (tStats == null || Math.max(0, getHarvestLevel(aStack, "")) < aBlock.getHarvestLevel(aMetaData)) return 0.0F;
+ return tStats.isMinableBlock(aBlock, (byte) aMetaData) ? Math.max(Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed) : 0.0F;
+ }
+
+ @Override
+ public final boolean canHarvestBlock(Block aBlock, ItemStack aStack) {
+ return getDigSpeed(aStack, aBlock, (byte) 0) > 0.0F;
+ }
+
+ @Override
+ public final int getHarvestLevel(ItemStack aStack, String aToolClass) {
+ Interface_ToolStats tStats = getToolStats(aStack);
+ return tStats == null ? -1 : tStats.getBaseQuality() + getPrimaryMaterial(aStack).mToolQuality;
+ }
+
+ @Override
+ public boolean onBlockDestroyed(ItemStack aStack, World aWorld, Block aBlock, int aX, int aY, int aZ, EntityLivingBase aPlayer) {
+ if (!isItemStackUsable(aStack)) return false;
+ Interface_ToolStats tStats = getToolStats(aStack);
+ if (tStats == null) return false;
+ GT_Utility.doSoundAtClient(tStats.getMiningSound(), 1, 1.0F);
+ doDamage(aStack, (int) Math.max(1, aBlock.getBlockHardness(aWorld, aX, aY, aZ) * tStats.getToolDamagePerBlockBreak()));
+ return getDigSpeed(aStack, aBlock, aWorld.getBlockMetadata(aX, aY, aZ)) > 0.0F;
+ }
+
+ @Override
+ public final ItemStack getContainerItem(ItemStack aStack) {
+ return getContainerItem(aStack, true);
+ }
+
+ @Override
+ public final boolean hasContainerItem(ItemStack aStack) {
+ return getContainerItem(aStack, false) != null;
+ }
+
+ private ItemStack getContainerItem(ItemStack aStack, boolean playSound) {
+ if (!isItemStackUsable(aStack)) return null;
+ aStack = GT_Utility.copyAmount(1, aStack);
+ Interface_ToolStats tStats = getToolStats(aStack);
+ if (tStats == null) return null;
+ doDamage(aStack, tStats.getToolDamagePerContainerCraft());
+ aStack = aStack.stackSize > 0 ? aStack : null;
+ if (playSound) {
+ //String sound = (aStack == null) ? tStats.getBreakingSound() : tStats.getCraftingSound();
+ //GT_Utility.doSoundAtClient(sound, 1, 1.0F);
+ }
+ return aStack;
+ }
+
+ public Interface_ToolStats getToolStats(ItemStack aStack) {
+ isItemStackUsable(aStack);
+ return getToolStatsInternal(aStack);
+ }
+
+ private Interface_ToolStats getToolStatsInternal(ItemStack aStack) {
+ return aStack == null ? null : mToolStats.get((short) aStack.getItemDamage());
+ }
+
+ @Override
+ public boolean canWhack(EntityPlayer aPlayer, ItemStack aStack, int aX, int aY, int aZ) {
+ if (!isItemStackUsable(aStack)) return false;
+ Interface_ToolStats tStats = getToolStats(aStack);
+ return tStats != null && tStats.isCrowbar();
+ }
+
+ @Override
+ public void onWhack(EntityPlayer aPlayer, ItemStack aStack, int aX, int aY, int aZ) {
+ Interface_ToolStats tStats = getToolStats(aStack);
+ if (tStats != null) doDamage(aStack, tStats.getToolDamagePerEntityAttack());
+ }
+
+ @Override
+ public boolean canWrench(EntityPlayer player, int x, int y, int z) {
+ System.out.println("canWrench");
+ if(player==null)return false;
+ if(player.getCurrentEquippedItem()==null)return false;
+ if (!isItemStackUsable(player.getCurrentEquippedItem())) return false;
+ Interface_ToolStats tStats = getToolStats(player.getCurrentEquippedItem());
+ return tStats != null && tStats.isWrench();
+ }
+
+ @Override
+ public void wrenchUsed(EntityPlayer player, int x, int y, int z) {
+ if(player==null)return;
+ if(player.getCurrentEquippedItem()==null)return;
+ Interface_ToolStats tStats = getToolStats(player.getCurrentEquippedItem());
+ if (tStats != null) doDamage(player.getCurrentEquippedItem(), tStats.getToolDamagePerEntityAttack());
+ }
+
+ @Override
+ public boolean canLink(EntityPlayer aPlayer, ItemStack aStack, EntityMinecart cart) {
+ if (!isItemStackUsable(aStack)) return false;
+ Interface_ToolStats tStats = getToolStats(aStack);
+ return tStats != null && tStats.isCrowbar();
+ }
+
+ @Override
+ public void onLink(EntityPlayer aPlayer, ItemStack aStack, EntityMinecart cart) {
+ Interface_ToolStats tStats = getToolStats(aStack);
+ if (tStats != null) doDamage(aStack, tStats.getToolDamagePerEntityAttack());
+ }
+
+ @Override
+ public boolean canBoost(EntityPlayer aPlayer, ItemStack aStack, EntityMinecart cart) {
+ if (!isItemStackUsable(aStack)) return false;
+ Interface_ToolStats tStats = getToolStats(aStack);
+ return tStats != null && tStats.isCrowbar();
+ }
+
+ @Override
+ public void onBoost(EntityPlayer aPlayer, ItemStack aStack, EntityMinecart cart) {
+ Interface_ToolStats tStats = getToolStats(aStack);
+ if (tStats != null) doDamage(aStack, tStats.getToolDamagePerEntityAttack());
+ }
+
+ @Override
+ public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ Interface_ToolStats tStats = getToolStats(aStack);
+ if (tStats != null && aPlayer != null) tStats.onToolCrafted(aStack, aPlayer);
+ super.onCreated(aStack, aWorld, aPlayer);
+ }
+
+ @Override
+ public final boolean doesContainerItemLeaveCraftingGrid(ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public final int getItemStackLimit(ItemStack aStack) {
+ return 1;
+ }
+
+ @Override
+ public boolean isFull3D() {
+ return true;
+ }
+
+ @Override
+ public boolean isItemStackUsable(ItemStack aStack) {
+ Interface_ToolStats tStats = getToolStatsInternal(aStack);
+ if (aStack.getItemDamage() % 2 == 1 || tStats == null) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) aNBT.removeTag("ench");
+ return false;
+ }
+ Materials aMaterial = getPrimaryMaterial(aStack);
+ HashMap<Integer, Integer> tMap = new HashMap<Integer, Integer>(), tResult = new HashMap<Integer, Integer>();
+ if (aMaterial.mEnchantmentTools != null) {
+ tMap.put(aMaterial.mEnchantmentTools.effectId, (int) aMaterial.mEnchantmentToolsLevel);
+ if (aMaterial.mEnchantmentTools == Enchantment.fortune)
+ tMap.put(Enchantment.looting.effectId, (int) aMaterial.mEnchantmentToolsLevel);
+ if (aMaterial.mEnchantmentTools == Enchantment.knockback)
+ tMap.put(Enchantment.power.effectId, (int) aMaterial.mEnchantmentToolsLevel);
+ if (aMaterial.mEnchantmentTools == Enchantment.fireAspect)
+ tMap.put(Enchantment.flame.effectId, (int) aMaterial.mEnchantmentToolsLevel);
+ }
+ Enchantment[] tEnchants = tStats.getEnchantments(aStack);
+ int[] tLevels = tStats.getEnchantmentLevels(aStack);
+ for (int i = 0; i < tEnchants.length; i++)
+ if (tLevels[i] > 0) {
+ Integer tLevel = tMap.get(tEnchants[i].effectId);
+ tMap.put(tEnchants[i].effectId, tLevel == null ? tLevels[i] : tLevel == tLevels[i] ? tLevel + 1 : Math.max(tLevel, tLevels[i]));
+ }
+ for (Entry<Integer, Integer> tEntry : tMap.entrySet()) {
+ if (tEntry.getKey() == 33 || (tEntry.getKey() == 20 && tEntry.getValue() > 2) || tEntry.getKey() == Enchantment_Radioactivity.INSTANCE.effectId)
+ tResult.put(tEntry.getKey(), tEntry.getValue());
+ else
+ switch (Enchantment.enchantmentsList[tEntry.getKey()].type) {
+ case weapon:
+ if (tStats.isWeapon()) tResult.put(tEntry.getKey(), tEntry.getValue());
+ break;
+ case all:
+ tResult.put(tEntry.getKey(), tEntry.getValue());
+ break;
+ case armor:
+ case armor_feet:
+ case armor_head:
+ case armor_legs:
+ case armor_torso:
+ break;
+ case bow:
+ if (tStats.isRangedWeapon()) tResult.put(tEntry.getKey(), tEntry.getValue());
+ break;
+ case breakable:
+ break;
+ case fishing_rod:
+ break;
+ case digger:
+ if (tStats.isMiningTool()) tResult.put(tEntry.getKey(), tEntry.getValue());
+ break;
+ }
+ }
+ EnchantmentHelper.setEnchantments(tResult, aStack);
+ return true;
+ }
+
+ @Override
+ public short getChargedMetaData(ItemStack aStack) {
+ return (short) (aStack.getItemDamage() - (aStack.getItemDamage() % 2));
+ }
+
+ @Override
+ public short getEmptyMetaData(ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) aNBT.removeTag("ench");
+ return (short) (aStack.getItemDamage() + 1 - (aStack.getItemDamage() % 2));
+ }
+
+ @Override
+ public int getItemEnchantability() {
+ return 0;
+ }
+
+ @Override
+ public boolean isBookEnchantable(ItemStack aStack, ItemStack aBook) {
+ return false;
+ }
+
+ @Override
+ public boolean getIsRepairable(ItemStack aStack, ItemStack aMaterial) {
+ return false;
+ }
+} \ No newline at end of file
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/GregtechMetaCondensor.java b/src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/GregtechMetaCondensor.java
new file mode 100644
index 0000000000..9b7d23d5bf
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/GregtechMetaCondensor.java
@@ -0,0 +1,164 @@
+package miscutil.core.xmod.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.core.xmod.gregtech.api.gui.CONTAINER_SteamCondenser;
+import miscutil.core.xmod.gregtech.api.gui.GUI_SteamCondenser;
+import miscutil.core.xmod.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/core/xmod/gregtech/api/metatileentity/implementations/GregtechMetaEnergyBuffer.java b/src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/GregtechMetaEnergyBuffer.java
new file mode 100644
index 0000000000..361a2682ec
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/GregtechMetaEnergyBuffer.java
@@ -0,0 +1,402 @@
+package miscutil.core.xmod.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 miscutil.core.util.Utils;
+import miscutil.core.xmod.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;
+
+/**
+ * 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 {
+
+ /*
+ * 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(),
+ 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;
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java b/src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java
new file mode 100644
index 0000000000..4bcfbf7949
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java
@@ -0,0 +1,235 @@
+package miscutil.core.xmod.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/core/xmod/gregtech/api/metatileentity/implementations/GregtechMetaSafeBlock.java b/src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/GregtechMetaSafeBlock.java
new file mode 100644
index 0000000000..d2a1a8e230
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/GregtechMetaSafeBlock.java
@@ -0,0 +1,76 @@
+package miscutil.core.xmod.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.core.xmod.gregtech.api.gui.CONTAINER_SafeBlock;
+import miscutil.core.xmod.gregtech.api.gui.GUI_SafeBlock;
+import miscutil.core.xmod.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/core/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaBoilerBase.java b/src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaBoilerBase.java
new file mode 100644
index 0000000000..e3ae40a45d
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaBoilerBase.java
@@ -0,0 +1,328 @@
+package miscutil.core.xmod.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/core/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaSafeBlockBase.java b/src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaSafeBlockBase.java
new file mode 100644
index 0000000000..e9793f3c32
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaSafeBlockBase.java
@@ -0,0 +1,343 @@
+package miscutil.core.xmod.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.events.UnbreakableBlockManager;
+import miscutil.core.util.Utils;
+import miscutil.core.util.player.PlayerCache;
+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/core/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java b/src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java
new file mode 100644
index 0000000000..02962a6dcb
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java
@@ -0,0 +1,67 @@
+package miscutil.core.xmod.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/core/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
new file mode 100644
index 0000000000..fe81a22c51
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
@@ -0,0 +1,805 @@
+package miscutil.core.xmod.gregtech.api.metatileentity.implementations.base;
+
+import static gregtech.api.enums.GT_Values.V;
+import gregtech.GT_Mod;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.items.GT_MetaGenerated_Tool;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus;
+import gregtech.api.objects.GT_ItemStack;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gregtech.api.util.GT_Utility;
+import gregtech.common.items.GT_MetaGenerated_Tool_01;
+
+import java.util.ArrayList;
+
+import miscutil.core.xmod.gregtech.api.gui.CONTAINER_MultiMachine;
+import miscutil.core.xmod.gregtech.api.gui.GUI_MultiMachine;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.fluids.FluidStack;
+
+public abstract class GregtechMeta_MultiBlockBase extends MetaTileEntity {
+
+ public static boolean disableMaintenance;
+ public boolean mMachine = false, mWrench = false, mScrewdriver = false, mSoftHammer = false, mHardHammer = false, mSolderingTool = true, mCrowbar = false, mRunningOnLoad = false;
+ public int mPollution = 0, mProgresstime = 0, mMaxProgresstime = 0, mEUt = 0, mEfficiencyIncrease = 0, mUpdate = 0, mStartUpCheck = 100, mRuntime = 0, mEfficiency = 0;
+ public ItemStack[] mOutputItems = null;
+ public FluidStack[] mOutputFluids = null;
+ public ArrayList<GT_MetaTileEntity_Hatch_Input> mInputHatches = new ArrayList<GT_MetaTileEntity_Hatch_Input>();
+ public ArrayList<GT_MetaTileEntity_Hatch_Output> mOutputHatches = new ArrayList<GT_MetaTileEntity_Hatch_Output>();
+ public ArrayList<GT_MetaTileEntity_Hatch_InputBus> mInputBusses = new ArrayList<GT_MetaTileEntity_Hatch_InputBus>();
+ public ArrayList<GT_MetaTileEntity_Hatch_OutputBus> mOutputBusses = new ArrayList<GT_MetaTileEntity_Hatch_OutputBus>();
+ public ArrayList<GT_MetaTileEntity_Hatch_Dynamo> mDynamoHatches = new ArrayList<GT_MetaTileEntity_Hatch_Dynamo>();
+ public ArrayList<GT_MetaTileEntity_Hatch_Muffler> mMufflerHatches = new ArrayList<GT_MetaTileEntity_Hatch_Muffler>();
+ public ArrayList<GT_MetaTileEntity_Hatch_Energy> mEnergyHatches = new ArrayList<GT_MetaTileEntity_Hatch_Energy>();
+ public ArrayList<GT_MetaTileEntity_Hatch_Maintenance> mMaintenanceHatches = new ArrayList<GT_MetaTileEntity_Hatch_Maintenance>();
+
+ public GregtechMeta_MultiBlockBase(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, 2);
+ this.disableMaintenance = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MultiBlockMachines.disableMaintenance", false);
+ }
+
+ public GregtechMeta_MultiBlockBase(String aName) {
+ super(aName, 2);
+ this.disableMaintenance = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MultiBlockMachines.disableMaintenance", false);
+ }
+
+ public static boolean isValidMetaTileEntity(MetaTileEntity aMetaTileEntity) {
+ return aMetaTileEntity.getBaseMetaTileEntity() != null && aMetaTileEntity.getBaseMetaTileEntity().getMetaTileEntity() == aMetaTileEntity && !aMetaTileEntity.getBaseMetaTileEntity().isDead();
+ }
+
+ @Override
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) {
+ return aSide != getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return true;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return aIndex > 0;
+ }
+
+ @Override
+ public int getProgresstime() {
+ return mProgresstime;
+ }
+
+ @Override
+ public int maxProgresstime() {
+ return mMaxProgresstime;
+ }
+
+ @Override
+ public int increaseProgress(int aProgress) {
+ return aProgress;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setInteger("mEUt", mEUt);
+ aNBT.setInteger("mProgresstime", mProgresstime);
+ aNBT.setInteger("mMaxProgresstime", mMaxProgresstime);
+ aNBT.setInteger("mEfficiencyIncrease", mEfficiencyIncrease);
+ aNBT.setInteger("mEfficiency", mEfficiency);
+ aNBT.setInteger("mPollution", mPollution);
+ aNBT.setInteger("mRuntime", mRuntime);
+
+ if (mOutputItems != null) for (int i = 0; i < mOutputItems.length; i++)
+ if (mOutputItems[i] != null) {
+ NBTTagCompound tNBT = new NBTTagCompound();
+ mOutputItems[i].writeToNBT(tNBT);
+ aNBT.setTag("mOutputItem" + i, tNBT);
+ }
+ if (mOutputFluids != null) for (int i = 0; i < mOutputFluids.length; i++)
+ if (mOutputFluids[i] != null) {
+ NBTTagCompound tNBT = new NBTTagCompound();
+ mOutputFluids[i].writeToNBT(tNBT);
+ aNBT.setTag("mOutputFluids" + i, tNBT);
+ }
+
+ aNBT.setBoolean("mWrench", mWrench);
+ aNBT.setBoolean("mScrewdriver", mScrewdriver);
+ aNBT.setBoolean("mSoftHammer", mSoftHammer);
+ aNBT.setBoolean("mHardHammer", mHardHammer);
+ aNBT.setBoolean("mSolderingTool", mSolderingTool);
+ aNBT.setBoolean("mCrowbar", mCrowbar);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ mEUt = aNBT.getInteger("mEUt");
+ mProgresstime = aNBT.getInteger("mProgresstime");
+ mMaxProgresstime = aNBT.getInteger("mMaxProgresstime");
+ if (mMaxProgresstime > 0) mRunningOnLoad = true;
+ mEfficiencyIncrease = aNBT.getInteger("mEfficiencyIncrease");
+ mEfficiency = aNBT.getInteger("mEfficiency");
+ mPollution = aNBT.getInteger("mPollution");
+ mRuntime = aNBT.getInteger("mRuntime");
+ mOutputItems = new ItemStack[getAmountOfOutputs()];
+ for (int i = 0; i < mOutputItems.length; i++) mOutputItems[i] = GT_Utility.loadItem(aNBT, "mOutputItem" + i);
+ mOutputFluids = new FluidStack[getAmountOfOutputs()];
+ for (int i = 0; i < mOutputFluids.length; i++)
+ mOutputFluids[i] = GT_Utility.loadFluid(aNBT, "mOutputFluids" + i);
+ mWrench = aNBT.getBoolean("mWrench");
+ mScrewdriver = aNBT.getBoolean("mScrewdriver");
+ mSoftHammer = aNBT.getBoolean("mSoftHammer");
+ mHardHammer = aNBT.getBoolean("mHardHammer");
+ mSolderingTool = aNBT.getBoolean("mSolderingTool");
+ mCrowbar = aNBT.getBoolean("mCrowbar");
+ }
+
+ @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_MultiMachine(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MultiblockDisplay.png");
+ }
+
+ @Override
+ public byte getTileEntityBaseType() {
+ return 2;
+ }
+
+ @Override
+ public void onMachineBlockUpdate() {
+ mUpdate = 50;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+ if (mEfficiency < 0) mEfficiency = 0;
+ if (--mUpdate == 0 || --mStartUpCheck == 0) {
+ mInputHatches.clear();
+ mInputBusses.clear();
+ mOutputHatches.clear();
+ mOutputBusses.clear();
+ mDynamoHatches.clear();
+ mEnergyHatches.clear();
+ mMufflerHatches.clear();
+ mMaintenanceHatches.clear();
+ mMachine = checkMachine(aBaseMetaTileEntity, mInventory[1]);
+ }
+ if (mStartUpCheck < 0) {
+ if (mMachine) {
+ for (GT_MetaTileEntity_Hatch_Maintenance tHatch : mMaintenanceHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ if (!this.disableMaintenance) {
+ if (tHatch.mWrench) mWrench = true;
+ if (tHatch.mScrewdriver) mScrewdriver = true;
+ if (tHatch.mSoftHammer) mSoftHammer = true;
+ if (tHatch.mHardHammer) mHardHammer = true;
+ if (tHatch.mSolderingTool) mSolderingTool = true;
+ if (tHatch.mCrowbar) mCrowbar = true;
+ } else {
+ mWrench = true;
+ mScrewdriver = true;
+ mSoftHammer = true;
+ mHardHammer = true;
+ mSolderingTool = true;
+ mCrowbar = true;
+ }
+
+ tHatch.mWrench = false;
+ tHatch.mScrewdriver = false;
+ tHatch.mSoftHammer = false;
+ tHatch.mHardHammer = false;
+ tHatch.mSolderingTool = true;
+ tHatch.mCrowbar = false;
+ }
+ }
+ if (getRepairStatus() > 0) {
+ if (mMaxProgresstime > 0 && doRandomMaintenanceDamage()) {
+ if (onRunningTick(mInventory[1])) {
+ if (!polluteEnvironment(getPollutionPerTick(mInventory[1]))) {
+ stopMachine();
+ }
+ if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime) {
+ if (mOutputItems != null) for (ItemStack tStack : mOutputItems)
+ if (tStack != null) {
+ try {
+ GT_Mod.instance.achievements.issueAchivementHatch(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), tStack);
+ } catch (Exception e) {
+ }
+ addOutput(tStack);
+ }
+ if (mOutputFluids != null && mOutputFluids.length == 1) {
+ for (FluidStack tStack : mOutputFluids)
+ if (tStack != null) {
+ addOutput(tStack);
+ }
+ } else if (mOutputFluids != null && mOutputFluids.length > 1) {
+ addFluidOutputs(mOutputFluids);
+ }
+ mEfficiency = Math.max(0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000)));
+ mOutputItems = null;
+ mProgresstime = 0;
+ mMaxProgresstime = 0;
+ mEfficiencyIncrease = 0;
+ if (aBaseMetaTileEntity.isAllowedToWork()) checkRecipe(mInventory[1]);
+ if (mOutputFluids != null && mOutputFluids.length > 0) {
+ if (mOutputFluids.length > 1) {
+ GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "oilplant");
+ }
+ }
+ }
+ }
+ } else {
+ if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified()) {
+
+ if (aBaseMetaTileEntity.isAllowedToWork()) {
+ checkRecipe(mInventory[1]);
+ }
+ if (mMaxProgresstime <= 0) mEfficiency = Math.max(0, mEfficiency - 1000);
+ }
+ }
+ } else {
+ stopMachine();
+ }
+ } else {
+ stopMachine();
+ }
+ }
+ aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mWrench ? 0 : 1) | (mScrewdriver ? 0 : 2) | (mSoftHammer ? 0 : 4) | (mHardHammer ? 0 : 8) | (mSolderingTool ? 0 : 16) | (mCrowbar ? 0 : 32) | (mMachine ? 0 : 64));
+ aBaseMetaTileEntity.setActive(mMaxProgresstime > 0);
+ }
+ }
+
+ public boolean polluteEnvironment(int aPollutionLevel) {
+ mPollution += aPollutionLevel;
+ for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ if (mPollution >= 10000) {
+ if (tHatch.polluteEnvironment()) {
+ mPollution -= 10000;
+ }
+ } else {
+ break;
+ }
+ }
+ }
+ return mPollution < 10000;
+ }
+
+ /**
+ * Called every tick the Machine runs
+ */
+ public boolean onRunningTick(ItemStack aStack) {
+ if (mEUt > 0) {
+ addEnergyOutput(((long) mEUt * mEfficiency) / 10000);
+ return true;
+ }
+ if (mEUt < 0) {
+ if (!drainEnergyInput(((long) -mEUt * 10000) / Math.max(1000, mEfficiency))) {
+ stopMachine();
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Checks if this is a Correct Machine Part for this kind of Machine (Turbine Rotor for example)
+ */
+ //public abstract boolean isCorrectMachinePart(ItemStack aStack);
+
+ /**
+ * Checks the Recipe
+ */
+ public abstract boolean checkRecipe(ItemStack aStack);
+
+ /**
+ * Checks the Machine. You have to assign the MetaTileEntities for the Hatches here.
+ */
+ public abstract boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack);
+
+ /**
+ * Gets the maximum Efficiency that spare Part can get (0 - 10000)
+ */
+ public abstract int getMaxEfficiency(ItemStack aStack);
+
+ /**
+ * Gets the pollution this Device outputs to a Muffler per tick (10000 = one Pullution Block)
+ */
+ public abstract int getPollutionPerTick(ItemStack aStack);
+
+ /**
+ * Gets the damage to the ItemStack, usually 0 or 1.
+ */
+ //public abstract int getDamageToComponent(ItemStack aStack);
+
+ /**
+ * Gets the Amount of possibly outputted Items for loading the Output Stack Array from NBT.
+ * This should be the largest Amount that can ever happen legitimately.
+ */
+ public abstract int getAmountOfOutputs();
+
+ /**
+ * If it explodes when the Component has to be replaced.
+ */
+ public abstract boolean explodesOnComponentBreak(ItemStack aStack);
+
+ public void stopMachine() {
+ mOutputItems = null;
+ mEUt = 0;
+ mEfficiency = 0;
+ mProgresstime = 0;
+ mMaxProgresstime = 0;
+ mEfficiencyIncrease = 0;
+ getBaseMetaTileEntity().disableWorking();
+ }
+
+ public int getRepairStatus() {
+ return (mWrench ? 1 : 0) + (mScrewdriver ? 1 : 0) + (mSoftHammer ? 1 : 0) + (mHardHammer ? 1 : 0) + (mSolderingTool ? 1 : 0) + (mCrowbar ? 1 : 0);
+ }
+
+ public int getIdealStatus() {
+ return 6;
+ }
+
+ public boolean doRandomMaintenanceDamage() {
+ if (getRepairStatus() == 0) {
+ stopMachine();
+ return false;
+ }
+ if (mRuntime++ > 1000) {
+ mRuntime = 0;
+ if (getBaseMetaTileEntity().getRandomNumber(6000) == 0) {
+ switch (getBaseMetaTileEntity().getRandomNumber(6)) {
+ case 0:
+ mWrench = false;
+ break;
+ case 1:
+ mScrewdriver = false;
+ break;
+ case 2:
+ mSoftHammer = false;
+ break;
+ case 3:
+ mHardHammer = false;
+ break;
+ case 4:
+ mSolderingTool = true;
+ break;
+ case 5:
+ mCrowbar = false;
+ break;
+ }
+ }
+ if (mInventory[1] != null && getBaseMetaTileEntity().getRandomNumber(2) == 0 && !mInventory[1].getUnlocalizedName().startsWith("gt.blockmachines.basicmachine.")) {
+ if (mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) {
+ NBTTagCompound tNBT = mInventory[1].getTagCompound();
+ if (tNBT != null) {
+ NBTTagCompound tNBT2 = tNBT.getCompoundTag("GT.CraftingComponents");
+ if (!tNBT.getBoolean("mDis")) {
+ tNBT2 = new NBTTagCompound();
+ Materials tMaterial = GT_MetaGenerated_Tool.getPrimaryMaterial(mInventory[1]);
+ ItemStack tTurbine = GT_OreDictUnificator.get(OrePrefixes.turbineBlade, tMaterial, 1);
+ int i = mInventory[1].getItemDamage();
+ if (i == 170) {
+ ItemStack tStack = GT_Utility.copyAmount(1, tTurbine);
+ tNBT2.setTag("Ingredient.0", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.1", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.2", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.3", tStack.writeToNBT(new NBTTagCompound()));
+ tStack = GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Magnalium, 1);
+ tNBT2.setTag("Ingredient.4", tStack.writeToNBT(new NBTTagCompound()));
+ } else if (i == 172) {
+ ItemStack tStack = GT_Utility.copyAmount(1, tTurbine);
+ tNBT2.setTag("Ingredient.0", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.1", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.2", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.3", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.5", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.6", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.7", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.8", tStack.writeToNBT(new NBTTagCompound()));
+ tStack = GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Titanium, 1);
+ tNBT2.setTag("Ingredient.4", tStack.writeToNBT(new NBTTagCompound()));
+ } else if (i == 174) {
+ ItemStack tStack = GT_Utility.copyAmount(2, tTurbine);
+ tNBT2.setTag("Ingredient.0", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.1", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.2", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.3", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.5", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.6", tStack.writeToNBT(new NBTTagCompound()));
+ tStack = GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.TungstenSteel, 1);
+ tNBT2.setTag("Ingredient.4", tStack.writeToNBT(new NBTTagCompound()));
+ } else if (i == 176) {
+ ItemStack tStack = GT_Utility.copyAmount(2, tTurbine);
+ tNBT2.setTag("Ingredient.0", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.1", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.2", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.3", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.5", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.6", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.7", tStack.writeToNBT(new NBTTagCompound()));
+ tNBT2.setTag("Ingredient.8", tStack.writeToNBT(new NBTTagCompound()));
+ tStack = GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Americium, 1);
+ tNBT2.setTag("Ingredient.4", tStack.writeToNBT(new NBTTagCompound()));
+ }
+ tNBT.setTag("GT.CraftingComponents", tNBT2);
+ tNBT.setBoolean("mDis", true);
+ mInventory[1].setTagCompound(tNBT);
+
+ }
+ }
+
+ ((GT_MetaGenerated_Tool) mInventory[1].getItem()).doDamage(mInventory[1], (long) Math.min(mEUt / 5, Math.pow(mEUt, 0.7)));
+ if (mInventory[1].stackSize == 0) mInventory[1] = null;
+ }
+ }
+ }
+ return true;
+ }
+
+ public void explodeMultiblock() {
+ mInventory[1] = null;
+ for (MetaTileEntity tTileEntity : mInputBusses) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ for (MetaTileEntity tTileEntity : mOutputBusses) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ for (MetaTileEntity tTileEntity : mInputHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ for (MetaTileEntity tTileEntity : mOutputHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ for (MetaTileEntity tTileEntity : mDynamoHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ for (MetaTileEntity tTileEntity : mMufflerHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ for (MetaTileEntity tTileEntity : mEnergyHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ for (MetaTileEntity tTileEntity : mMaintenanceHatches) tTileEntity.getBaseMetaTileEntity().doExplosion(V[8]);
+ getBaseMetaTileEntity().doExplosion(V[8]);
+ }
+
+ public boolean addEnergyOutput(long aEU) {
+ if (aEU <= 0) return true;
+ for (GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ if (tHatch.getBaseMetaTileEntity().increaseStoredEnergyUnits(aEU, false)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public long getMaxInputVoltage() {
+ long rVoltage = 0;
+ for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches)
+ if (isValidMetaTileEntity(tHatch)) rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage();
+ return rVoltage;
+ }
+
+ public boolean drainEnergyInput(long aEU) {
+ if (aEU <= 0) return true;
+ for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches)
+ if (isValidMetaTileEntity(tHatch)) {
+ if (tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)) return true;
+ }
+ return false;
+ }
+
+ public boolean addOutput(FluidStack aLiquid) {
+ if (aLiquid == null) return false;
+ FluidStack tLiquid = aLiquid.copy();
+ for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) {
+ if (isValidMetaTileEntity(tHatch) && GT_ModHandler.isSteam(aLiquid) ? tHatch.outputsSteam() : tHatch.outputsLiquids()) {
+ int tAmount = tHatch.fill(tLiquid, false);
+ if (tAmount >= tLiquid.amount) {
+ return tHatch.fill(tLiquid, true) >= tLiquid.amount;
+ } else if (tAmount > 0) {
+ tLiquid.amount = tLiquid.amount - tHatch.fill(tLiquid, true);
+ }
+ }
+ }
+ return false;
+ }
+
+ private void addFluidOutputs(FluidStack[] mOutputFluids2) {
+ for (int i = 0; i < mOutputFluids2.length; i++) {
+ if (mOutputHatches.size() > i && mOutputHatches.get(i) != null && mOutputFluids2[i] != null && isValidMetaTileEntity(mOutputHatches.get(i))) {
+ mOutputHatches.get(i).fill(mOutputFluids2[i], true);
+ }
+ }
+
+ }
+
+ public boolean depleteInput(FluidStack aLiquid) {
+ if (aLiquid == null) return false;
+ for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) {
+ tHatch.mRecipeMap = getRecipeMap();
+ if (isValidMetaTileEntity(tHatch)) {
+ FluidStack tLiquid = tHatch.getFluid();
+ if (tLiquid != null && tLiquid.isFluidEqual(aLiquid)) {
+ tLiquid = tHatch.drain(aLiquid.amount, false);
+ if (tLiquid != null && tLiquid.amount >= aLiquid.amount) {
+ tLiquid = tHatch.drain(aLiquid.amount, true);
+ return tLiquid != null && tLiquid.amount >= aLiquid.amount;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ public boolean addOutput(ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack)) return false;
+ aStack = GT_Utility.copy(aStack);
+// FluidStack aLiquid = GT_Utility.getFluidForFilledItem(aStack, true);
+// if (aLiquid == null) {
+ for (GT_MetaTileEntity_Hatch_OutputBus tHatch : mOutputBusses) {
+ if (isValidMetaTileEntity(tHatch)) {
+ for (int i = tHatch.getSizeInventory() - 1; i >= 0; i--) {
+ if (tHatch.getBaseMetaTileEntity().addStackToSlot(i, aStack)) return true;
+ }
+ }
+ }
+ for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) {
+ if (isValidMetaTileEntity(tHatch) && tHatch.outputsItems()) {
+ if (tHatch.getBaseMetaTileEntity().addStackToSlot(1, aStack)) return true;
+ }
+ }
+// }else {
+// for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) {
+// if (isValidMetaTileEntity(tHatch) && GT_ModHandler.isSteam(aLiquid)?tHatch.outputsSteam():tHatch.outputsLiquids()) {
+// int tAmount = tHatch.fill(aLiquid, false);
+// if (tAmount >= aLiquid.amount) {
+// return tHatch.fill(aLiquid, true) >= aLiquid.amount;
+// }
+// }
+// }
+// }
+ return false;
+ }
+
+ public boolean depleteInput(ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack)) return false;
+ FluidStack aLiquid = GT_Utility.getFluidForFilledItem(aStack, true);
+ if (aLiquid != null) return depleteInput(aLiquid);
+ for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) {
+ tHatch.mRecipeMap = getRecipeMap();
+ if (isValidMetaTileEntity(tHatch)) {
+ if (GT_Utility.areStacksEqual(aStack, tHatch.getBaseMetaTileEntity().getStackInSlot(0))) {
+ if (tHatch.getBaseMetaTileEntity().getStackInSlot(0).stackSize >= aStack.stackSize) {
+ tHatch.getBaseMetaTileEntity().decrStackSize(0, aStack.stackSize);
+ return true;
+ }
+ }
+ }
+ }
+ for (GT_MetaTileEntity_Hatch_InputBus tHatch : mInputBusses) {
+ tHatch.mRecipeMap = getRecipeMap();
+ if (isValidMetaTileEntity(tHatch)) {
+ for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
+ if (GT_Utility.areStacksEqual(aStack, tHatch.getBaseMetaTileEntity().getStackInSlot(i))) {
+ if (tHatch.getBaseMetaTileEntity().getStackInSlot(0).stackSize >= aStack.stackSize) {
+ tHatch.getBaseMetaTileEntity().decrStackSize(0, aStack.stackSize);
+ return true;
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ public ArrayList<ItemStack> getStoredOutputs() {
+ ArrayList<ItemStack> rList = new ArrayList<ItemStack>();
+ for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) {
+ if (isValidMetaTileEntity(tHatch)) {
+ rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(1));
+ }
+ }
+ for (GT_MetaTileEntity_Hatch_OutputBus tHatch : mOutputBusses) {
+ if (isValidMetaTileEntity(tHatch)) {
+ for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
+ rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i));
+ }
+ }
+ }
+ return rList;
+ }
+
+ public ArrayList<FluidStack> getStoredFluids() {
+ ArrayList<FluidStack> rList = new ArrayList<FluidStack>();
+ for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) {
+ tHatch.mRecipeMap = getRecipeMap();
+ if (isValidMetaTileEntity(tHatch) && tHatch.getFillableStack() != null) {
+ rList.add(tHatch.getFillableStack());
+ }
+ }
+ return rList;
+ }
+
+ public ArrayList<ItemStack> getStoredInputs() {
+ ArrayList<ItemStack> rList = new ArrayList<ItemStack>();
+ for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches) {
+ tHatch.mRecipeMap = getRecipeMap();
+ if (isValidMetaTileEntity(tHatch) && tHatch.getBaseMetaTileEntity().getStackInSlot(0) != null) {
+ rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(0));
+ }
+ }
+ for (GT_MetaTileEntity_Hatch_InputBus tHatch : mInputBusses) {
+ tHatch.mRecipeMap = getRecipeMap();
+ if (isValidMetaTileEntity(tHatch)) {
+ for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
+ if (tHatch.getBaseMetaTileEntity().getStackInSlot(i) != null)
+ rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i));
+ }
+ }
+ }
+ return rList;
+ }
+
+ public GT_Recipe_Map getRecipeMap() {
+ return null;
+ }
+
+ public void updateSlots() {
+ for (GT_MetaTileEntity_Hatch_Input tHatch : mInputHatches)
+ if (isValidMetaTileEntity(tHatch)) tHatch.updateSlots();
+ for (GT_MetaTileEntity_Hatch_InputBus tHatch : mInputBusses)
+ if (isValidMetaTileEntity(tHatch)) tHatch.updateSlots();
+ }
+
+ public boolean addToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) return false;
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch)
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input)
+ return mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity);
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus)
+ return mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity);
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output)
+ return mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity);
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus)
+ return mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity);
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy)
+ return mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity);
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo)
+ return mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity);
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance)
+ return mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity);
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler)
+ return mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity);
+ return false;
+ }
+
+ public boolean addMaintenanceToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) return false;
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ return mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) aMetaTileEntity);
+ }
+ return false;
+ }
+
+ public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ }
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ return mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity);
+ }
+ return false;
+ }
+
+ public boolean addDynamoToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) return false;
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ return mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity);
+ }
+ return false;
+ }
+
+ public boolean addMufflerToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) return false;
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ return mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity);
+ }
+ return false;
+ }
+
+ public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) return false;
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = getRecipeMap();
+ return mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity);
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mRecipeMap = getRecipeMap();
+ return mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity);
+ }
+ return false;
+ }
+
+ public boolean addOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) return false;
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) return false;
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ return mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity);
+ }
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) {
+ ((GT_MetaTileEntity_Hatch) aMetaTileEntity).mMachineBlock = (byte) aBaseCasingIndex;
+ return mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity);
+ }
+ return false;
+ }
+
+ @Override
+ public String[] getInfoData() {
+ return new String[]{"Progress:", (mProgresstime / 20) + "secs", (mMaxProgresstime / 20) + "secs", "Efficiency:", (mEfficiency / 100.0F) + "%", "Problems:", "" + (getIdealStatus() - getRepairStatus())};
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return false;
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/base/GregtechRocketFuelGeneratorBase.java b/src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/base/GregtechRocketFuelGeneratorBase.java
new file mode 100644
index 0000000000..de35f79403
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/base/GregtechRocketFuelGeneratorBase.java
@@ -0,0 +1,263 @@
+package miscutil.core.xmod.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_BasicTank;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gregtech.api.util.GT_Utility;
+
+import java.util.Collection;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraftforge.fluids.FluidStack;
+
+public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_BasicTank {
+ public GregtechRocketFuelGeneratorBase(int aID, String aName, String aNameRegional, int aTier, String aDescription, ITexture... aTextures) {
+ super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures);
+ }
+
+ public GregtechRocketFuelGeneratorBase(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 3, aDescription, aTextures);
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = getFront(i);
+ rTextures[1][i + 1] = getBack(i);
+ rTextures[2][i + 1] = getBottom(i);
+ rTextures[3][i + 1] = getTop(i);
+ rTextures[4][i + 1] = getSides(i);
+ rTextures[5][i + 1] = getFrontActive(i);
+ rTextures[6][i + 1] = getBackActive(i);
+ rTextures[7][i + 1] = getBottomActive(i);
+ rTextures[8][i + 1] = getTopActive(i);
+ rTextures[9][i + 1] = getSidesActive(i);
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1];
+ }
+
+ String formattedName = "Added by: " + EnumChatFormatting.DARK_GREEN+"Alkalus";
+ @Override
+ public String[] getDescription() {
+ return new String[]{mDescription, "Fuel Efficiency: " + getEfficiency() + "%", formattedName};
+ }
+
+
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ if (aBaseMetaTileEntity.isClientSide()) return true;
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+
+ public ITexture[] getFront(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ }
+
+ public ITexture[] getBack(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ }
+
+ public ITexture[] getBottom(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ }
+
+ public ITexture[] getTop(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ }
+
+ public ITexture[] getSides(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ }
+
+ public ITexture[] getFrontActive(byte aColor) {
+ return getFront(aColor);
+ }
+
+ public ITexture[] getBackActive(byte aColor) {
+ return getBack(aColor);
+ }
+
+ public ITexture[] getBottomActive(byte aColor) {
+ return getBottom(aColor);
+ }
+
+ public ITexture[] getTopActive(byte aColor) {
+ return getTop(aColor);
+ }
+
+ public ITexture[] getSidesActive(byte aColor) {
+ return getSides(aColor);
+ }
+
+ @Override
+ public boolean isFacingValid(byte aSide) {
+ return aSide > 1;
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return aIndex < 2;
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return true;
+ }
+
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return true;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return getBaseMetaTileEntity().isAllowedToWork() ? V[mTier] : 0;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return Math.max(getEUVar(), V[mTier] * 80 + getMinimumStoredEU());
+ }
+
+ @Override
+ public boolean doesFillContainers() {
+ return getBaseMetaTileEntity().isAllowedToWork();
+ }
+
+ @Override
+ public boolean doesEmptyContainers() {
+ return getBaseMetaTileEntity().isAllowedToWork();
+ }
+
+ @Override
+ public boolean canTankBeFilled() {
+ return getBaseMetaTileEntity().isAllowedToWork();
+ }
+
+ @Override
+ public boolean canTankBeEmptied() {
+ return getBaseMetaTileEntity().isAllowedToWork();
+ }
+
+ @Override
+ public boolean displaysItemStack() {
+ return true;
+ }
+
+ @Override
+ public boolean displaysStackSize() {
+ return false;
+ }
+
+ @Override
+ public boolean isFluidInputAllowed(FluidStack aFluid) {
+ return getFuelValue(aFluid) > 0;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aTick % 10 == 0) {
+ if (mFluid == null) {
+ if (aBaseMetaTileEntity.getUniversalEnergyStored() < maxEUOutput() + getMinimumStoredEU()) {
+ mInventory[getStackDisplaySlot()] = null;
+ } else {
+ if (mInventory[getStackDisplaySlot()] == null)
+ mInventory[getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1);
+ mInventory[getStackDisplaySlot()].setStackDisplayName("Generating: " + (aBaseMetaTileEntity.getUniversalEnergyStored() - getMinimumStoredEU()) + " EU");
+ }
+ } else {
+ int tFuelValue = getFuelValue(mFluid), tConsumed = consumedFluidPerOperation(mFluid);
+ if (tFuelValue > 0 && tConsumed > 0 && mFluid.amount > tConsumed) {
+ long tFluidAmountToUse = Math.min(mFluid.amount / tConsumed, (maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue);
+ if (tFluidAmountToUse > 0 && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true))
+ mFluid.amount -= tFluidAmountToUse * tConsumed;
+ }
+ }
+ if (mInventory[getInputSlot()] != null && aBaseMetaTileEntity.getUniversalEnergyStored() < (maxEUOutput() * 20 + getMinimumStoredEU()) && GT_Utility.getFluidForFilledItem(mInventory[getInputSlot()], true) == null) {
+ int tFuelValue = getFuelValue(mInventory[getInputSlot()]);
+ if (tFuelValue > 0) {
+ ItemStack tEmptyContainer = getEmptyContainer(mInventory[getInputSlot()]);
+ if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), tEmptyContainer)) {
+ aBaseMetaTileEntity.increaseStoredEnergyUnits(tFuelValue, true);
+ aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1);
+ }
+ }
+ }
+ }
+
+ if (aBaseMetaTileEntity.isServerSide())
+ aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU());
+ }
+
+ public abstract GT_Recipe_Map getRecipes();
+
+ public abstract int getEfficiency();
+
+ public int consumedFluidPerOperation(FluidStack aLiquid) {
+ return 1;
+ }
+
+ public int getFuelValue(FluidStack aLiquid) {
+ if (aLiquid == null || getRecipes() == null) return 0;
+ FluidStack tLiquid;
+ Collection<GT_Recipe> tRecipeList = getRecipes().mRecipeList;
+ if (tRecipeList != null) for (GT_Recipe tFuel : tRecipeList)
+ if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null)
+ if (aLiquid.isFluidEqual(tLiquid))
+ return (int) (((long) tFuel.mSpecialValue * getEfficiency() * consumedFluidPerOperation(tLiquid)) / 100);
+ return 0;
+ }
+
+ public int getFuelValue(ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack) || getRecipes() == null) return 0;
+ GT_Recipe tFuel = getRecipes().findRecipe(getBaseMetaTileEntity(), false, Long.MAX_VALUE, null, aStack);
+ if (tFuel != null) return (int) ((tFuel.mSpecialValue * 1000L * getEfficiency()) / 100);
+ return 0;
+ }
+
+ public ItemStack getEmptyContainer(ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack) || getRecipes() == null) return null;
+ GT_Recipe tFuel = getRecipes().findRecipe(getBaseMetaTileEntity(), false, Long.MAX_VALUE, null, aStack);
+ if (tFuel != null) return GT_Utility.copy(tFuel.getOutput(0));
+ return GT_Utility.getContainerItem(aStack, true);
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) && (getFuelValue(aStack) > 0 || getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true)) > 0);
+ }
+
+ @Override
+ public int getCapacity() {
+ return 32000;
+ }
+
+ @Override
+ public int getTankPressure() {
+ return -100;
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/base/GregtechSteelBoiler.java b/src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/base/GregtechSteelBoiler.java
new file mode 100644
index 0000000000..5d017024e9
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/base/GregtechSteelBoiler.java
@@ -0,0 +1,290 @@
+package miscutil.core.xmod.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/core/xmod/gregtech/api/metatileentity/implementations/creative/GregtechMetaCreativeEnergyBuffer.java b/src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/creative/GregtechMetaCreativeEnergyBuffer.java
new file mode 100644
index 0000000000..701e128ab7
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/metatileentity/implementations/creative/GregtechMetaCreativeEnergyBuffer.java
@@ -0,0 +1,268 @@
+package miscutil.core.xmod.gregtech.api.metatileentity.implementations.creative;
+
+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 miscutil.core.xmod.gregtech.api.metatileentity.implementations.GregtechMetaEnergyBuffer;
+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;
+
+/**
+ * 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;
+
+ @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_CASING_MAGIC_FRONT) };
+ rTextures[1][i + 1] = new ITexture[] {
+ new GT_RenderedTexture(
+ Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT),
+ 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(),
+ "THIS IS A CREATIVE ITEM - FOR TESTING",
+ 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/core/xmod/gregtech/api/objects/GregtechFluid.java b/src/Java/miscutil/core/xmod/gregtech/api/objects/GregtechFluid.java
new file mode 100644
index 0000000000..f894b6e45b
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/objects/GregtechFluid.java
@@ -0,0 +1,27 @@
+package miscutil.core.xmod.gregtech.api.objects;
+
+import gregtech.api.GregTech_API;
+import miscutil.core.lib.CORE;
+import net.minecraftforge.fluids.Fluid;
+
+public class GregtechFluid extends Fluid implements Runnable {
+ public final String mTextureName;
+ private final short[] mRGBa;
+
+ public GregtechFluid(String aName, String aTextureName, short[] aRGBa) {
+ super(aName);
+ mRGBa = aRGBa;
+ mTextureName = aTextureName;
+ GregTech_API.sGTBlockIconload.add(this);
+ }
+
+ @Override
+ public int getColor() {
+ return (Math.max(0, Math.min(255, mRGBa[0])) << 16) | (Math.max(0, Math.min(255, mRGBa[1])) << 8) | Math.max(0, Math.min(255, mRGBa[2]));
+ }
+
+ @Override
+ public void run() {
+ setIcons(GregTech_API.sBlockIcons.registerIcon(CORE.MODID+ ":" + "fluids/fluid." + mTextureName));
+ }
+} \ No newline at end of file
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/objects/GregtechItemData.java b/src/Java/miscutil/core/xmod/gregtech/api/objects/GregtechItemData.java
new file mode 100644
index 0000000000..864cf77c31
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/objects/GregtechItemData.java
@@ -0,0 +1,130 @@
+package miscutil.core.xmod.gregtech.api.objects;
+
+import gregtech.api.objects.GT_ArrayList;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import miscutil.core.xmod.gregtech.api.enums.GregtechOrePrefixes;
+import miscutil.core.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+import net.minecraft.item.ItemStack;
+
+public class GregtechItemData {
+ private static final GregtechMaterialStack[] EMPTY_GT_MaterialStack_ARRAY = new GregtechMaterialStack[0];
+
+ public final List<Object> mExtraData = new GT_ArrayList<Object>(false, 1);
+ public final GregtechOrePrefixes mPrefix;
+ public final GregtechMaterialStack mMaterial;
+ public final GregtechMaterialStack[] mByProducts;
+ public boolean mBlackListed = false;
+ public ItemStack mUnificationTarget = null;
+
+ public GregtechItemData(GregtechOrePrefixes aPrefix, GT_Materials aMaterial, boolean aBlackListed) {
+ mPrefix = aPrefix;
+ mMaterial = aMaterial == null ? null : new GregtechMaterialStack(aMaterial, aPrefix.mMaterialAmount);
+ mBlackListed = aBlackListed;
+ mByProducts = aPrefix.mSecondaryMaterial == null || aPrefix.mSecondaryMaterial.mMaterial == null ? EMPTY_GT_MaterialStack_ARRAY : new GregtechMaterialStack[]{aPrefix.mSecondaryMaterial.clone()};
+ }
+
+ public GregtechItemData(GregtechOrePrefixes aPrefix, GT_Materials aMaterial) {
+ this(aPrefix, aMaterial, false);
+ }
+
+ public GregtechItemData(GregtechMaterialStack aMaterial, GregtechMaterialStack... aByProducts) {
+ mPrefix = null;
+ mMaterial = aMaterial.mMaterial == null ? null : aMaterial.clone();
+ mBlackListed = true;
+ if (aByProducts == null) {
+ mByProducts = EMPTY_GT_MaterialStack_ARRAY;
+ } else {
+ GregtechMaterialStack[] tByProducts = aByProducts.length < 1 ? EMPTY_GT_MaterialStack_ARRAY : new GregtechMaterialStack[aByProducts.length];
+ int j = 0;
+ for (int i = 0; i < aByProducts.length; i++)
+ if (aByProducts[i] != null && aByProducts[i].mMaterial != null)
+ tByProducts[j++] = aByProducts[i].clone();
+ mByProducts = j > 0 ? new GregtechMaterialStack[j] : EMPTY_GT_MaterialStack_ARRAY;
+ for (int i = 0; i < mByProducts.length; i++) mByProducts[i] = tByProducts[i];
+ }
+ }
+
+ public GregtechItemData(GT_Materials aMaterial, long aAmount, GregtechMaterialStack... aByProducts) {
+ this(new GregtechMaterialStack(aMaterial, aAmount), aByProducts);
+ }
+
+ public GregtechItemData(GT_Materials aMaterial, long aAmount, GT_Materials aByProduct, long aByProductAmount) {
+ this(new GregtechMaterialStack(aMaterial, aAmount), new GregtechMaterialStack(aByProduct, aByProductAmount));
+ }
+
+ public GregtechItemData(GregtechItemData... aData) {
+ mPrefix = null;
+ mBlackListed = true;
+
+ ArrayList<GregtechMaterialStack> aList = new ArrayList<GregtechMaterialStack>(), rList = new ArrayList<GregtechMaterialStack>();
+
+ for (GregtechItemData tData : aData)
+ if (tData != null) {
+ if (tData.hasValidMaterialData() && tData.mMaterial.mAmount > 0) aList.add(tData.mMaterial.clone());
+ for (GregtechMaterialStack tMaterial : tData.mByProducts)
+ if (tMaterial.mAmount > 0) aList.add(tMaterial.clone());
+ }
+
+ for (GregtechMaterialStack aMaterial : aList) {
+ boolean temp = true;
+ for (GregtechMaterialStack tMaterial : rList)
+ if (aMaterial.mMaterial == tMaterial.mMaterial) {
+ tMaterial.mAmount += aMaterial.mAmount;
+ temp = false;
+ break;
+ }
+ if (temp) rList.add(aMaterial.clone());
+ }
+
+ Collections.sort(rList, new Comparator<GregtechMaterialStack>() {
+ @Override
+ public int compare(GregtechMaterialStack a, GregtechMaterialStack b) {
+ return a.mAmount == b.mAmount ? 0 : a.mAmount > b.mAmount ? -1 : +1;
+ }
+ });
+
+ if (rList.isEmpty()) {
+ mMaterial = null;
+ } else {
+ mMaterial = rList.get(0);
+ rList.remove(0);
+ }
+
+ mByProducts = rList.toArray(new GregtechMaterialStack[rList.size()]);
+ }
+
+ public boolean hasValidPrefixMaterialData() {
+ return mPrefix != null && mMaterial != null && mMaterial.mMaterial != null;
+ }
+
+ public boolean hasValidPrefixData() {
+ return mPrefix != null;
+ }
+
+ public boolean hasValidMaterialData() {
+ return mMaterial != null && mMaterial.mMaterial != null;
+ }
+
+ public ArrayList<GregtechMaterialStack> getAllGT_MaterialStacks() {
+ ArrayList<GregtechMaterialStack> rList = new ArrayList();
+ if (hasValidMaterialData()) rList.add(mMaterial);
+ rList.addAll(Arrays.asList(mByProducts));
+ return rList;
+ }
+
+ public GregtechMaterialStack getByProduct(int aIndex) {
+ return aIndex >= 0 && aIndex < mByProducts.length ? mByProducts[aIndex] : null;
+ }
+
+ @Override
+ public String toString() {
+ if (mPrefix == null || mMaterial == null || mMaterial.mMaterial == null) return "";
+ return mPrefix.name() + mMaterial.mMaterial.name();
+ }
+} \ No newline at end of file
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/objects/GregtechMaterialStack.java b/src/Java/miscutil/core/xmod/gregtech/api/objects/GregtechMaterialStack.java
new file mode 100644
index 0000000000..56410757f6
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/objects/GregtechMaterialStack.java
@@ -0,0 +1,42 @@
+package miscutil.core.xmod.gregtech.api.objects;
+
+import miscutil.core.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+
+public class GregtechMaterialStack implements Cloneable {
+ public long mAmount;
+ public GT_Materials mMaterial;
+
+ public GregtechMaterialStack(GT_Materials aMaterial, long aAmount) {
+ mMaterial = aMaterial == null ? GT_Materials._NULL : aMaterial;
+ mAmount = aAmount;
+ }
+
+ public GregtechMaterialStack copy(long aAmount) {
+ return new GregtechMaterialStack(mMaterial, aAmount);
+ }
+
+ @Override
+ public GregtechMaterialStack clone() {
+ return new GregtechMaterialStack(mMaterial, mAmount);
+ }
+
+ @Override
+ public boolean equals(Object aObject) {
+ if (aObject == this) return true;
+ if (aObject == null) return false;
+ if (aObject instanceof GT_Materials) return aObject == mMaterial;
+ if (aObject instanceof GregtechMaterialStack)
+ return ((GregtechMaterialStack) aObject).mMaterial == mMaterial && (mAmount < 0 || ((GregtechMaterialStack) aObject).mAmount < 0 || ((GregtechMaterialStack) aObject).mAmount == mAmount);
+ return false;
+ }
+
+ @Override
+ public String toString() {
+ return (mMaterial.mMaterialList.size() > 1 && mAmount > 1 ? "(" : "") + mMaterial.getToolTip(true) + (mMaterial.mMaterialList.size() > 1 && mAmount > 1 ? ")" : "") + (mAmount > 1 ? mAmount : "");
+ }
+
+ @Override
+ public int hashCode() {
+ return mMaterial.hashCode();
+ }
+} \ No newline at end of file
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/objects/GregtechRenderedTexture.java b/src/Java/miscutil/core/xmod/gregtech/api/objects/GregtechRenderedTexture.java
new file mode 100644
index 0000000000..0f56400d0c
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/objects/GregtechRenderedTexture.java
@@ -0,0 +1,162 @@
+package miscutil.core.xmod.gregtech.api.objects;
+
+import gregtech.api.enums.Dyes;
+import gregtech.api.interfaces.IColorModulationContainer;
+import gregtech.api.interfaces.IIconContainer;
+import gregtech.api.interfaces.ITexture;
+import miscutil.core.util.Utils;
+import net.minecraft.block.Block;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.renderer.RenderBlocks;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.util.IIcon;
+
+public class GregtechRenderedTexture implements ITexture, IColorModulationContainer {
+ private final IIconContainer mIconContainer;
+ private final boolean mAllowAlpha;
+ /**
+ * DO NOT MANIPULATE THE VALUES INSIDE THIS ARRAY!!!
+ * <p/>
+ * Just set this variable to another different Array instead.
+ * Otherwise some colored things will get Problems.
+ */
+ public short[] mRGBa;
+
+ public GregtechRenderedTexture(IIconContainer aIcon, short[] aRGBa, boolean aAllowAlpha) {
+ if (aRGBa.length != 4) throw new IllegalArgumentException("RGBa doesn't have 4 Values @ GT_RenderedTexture");
+ mIconContainer = aIcon;
+ mAllowAlpha = aAllowAlpha;
+ mRGBa = aRGBa;
+ }
+
+ public GregtechRenderedTexture(IIconContainer aIcon, short[] aRGBa) {
+ this(aIcon, aRGBa, true);
+ }
+
+ public GregtechRenderedTexture(IIconContainer aIcon) {
+ this(aIcon, Dyes._NULL.mRGBa);
+ }
+
+ @Override
+ public void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) {
+ Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.6F), (int) (mRGBa[1] * 0.6F), (int) (mRGBa[2] * 0.6F), mAllowAlpha ? 255 - mRGBa[3] : 255);
+ aRenderer.renderFaceXPos(aBlock, aX, aY, aZ, mIconContainer.getIcon());
+ if (mIconContainer.getOverlayIcon() != null) {
+ Tessellator.instance.setColorRGBA(153, 153, 153, 255);
+ aRenderer.renderFaceXPos(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon());
+ }
+ }
+
+ @Override
+ public void renderXNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) {
+ Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.6F), (int) (mRGBa[1] * 0.6F), (int) (mRGBa[2] * 0.6F), mAllowAlpha ? 255 - mRGBa[3] : 255);
+ aRenderer.renderFaceXNeg(aBlock, aX, aY, aZ, mIconContainer.getIcon());
+ if (mIconContainer.getOverlayIcon() != null) {
+ Tessellator.instance.setColorRGBA(153, 153, 153, 255);
+ aRenderer.renderFaceXNeg(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon());
+ }
+ }
+
+ @Override
+ public void renderYPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) {
+ Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 1.0F), (int) (mRGBa[1] * 1.0F), (int) (mRGBa[2] * 1.0F), mAllowAlpha ? 255 - mRGBa[3] : 255);
+ aRenderer.renderFaceYPos(aBlock, aX, aY, aZ, mIconContainer.getIcon());
+ if (mIconContainer.getOverlayIcon() != null) {
+ Tessellator.instance.setColorRGBA(255, 255, 255, 255);
+ aRenderer.renderFaceYPos(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon());
+ }
+ }
+
+ @Override
+ public void renderYNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) {
+ Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.5F), (int) (mRGBa[1] * 0.5F), (int) (mRGBa[2] * 0.5F), mAllowAlpha ? 255 - mRGBa[3] : 255);
+ IIcon aIcon = mIconContainer.getIcon();
+
+ double d3 = aIcon.getInterpolatedU(aRenderer.renderMaxX * 16.0D);
+ double d4 = aIcon.getInterpolatedU(aRenderer.renderMinX * 16.0D);
+ double d5 = aIcon.getInterpolatedV(aRenderer.renderMinZ * 16.0D);
+ double d6 = aIcon.getInterpolatedV(aRenderer.renderMaxZ * 16.0D);
+
+ if (aRenderer.renderMinX < 0.0D || aRenderer.renderMaxX > 1.0D) {
+ d3 = aIcon.getMaxU();
+ d4 = aIcon.getMinU();
+ }
+
+ if (aRenderer.renderMinZ < 0.0D || aRenderer.renderMaxZ > 1.0D) {
+ d5 = aIcon.getMinV();
+ d6 = aIcon.getMaxV();
+ }
+
+ double d11 = aX + aRenderer.renderMinX;
+ double d12 = aX + aRenderer.renderMaxX;
+ double d13 = aY + aRenderer.renderMinY;
+ double d14 = aZ + aRenderer.renderMinZ;
+ double d15 = aZ + aRenderer.renderMaxZ;
+
+ Tessellator.instance.addVertexWithUV(d11, d13, d15, d3, d6);
+ Tessellator.instance.addVertexWithUV(d11, d13, d14, d3, d5);
+ Tessellator.instance.addVertexWithUV(d12, d13, d14, d4, d5);
+ Tessellator.instance.addVertexWithUV(d12, d13, d15, d4, d6);
+
+ if ((aIcon = mIconContainer.getOverlayIcon()) != null) {
+ Tessellator.instance.setColorRGBA(128, 128, 128, 255);
+
+ Tessellator.instance.addVertexWithUV(d11, d13, d15, d3, d6);
+ Tessellator.instance.addVertexWithUV(d11, d13, d14, d3, d5);
+ Tessellator.instance.addVertexWithUV(d12, d13, d14, d4, d5);
+ Tessellator.instance.addVertexWithUV(d12, d13, d15, d4, d6);
+ }
+ }
+
+ @Override
+ public void renderZPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) {
+ try {
+ Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.8F), (int) (mRGBa[1] * 0.8F), (int) (mRGBa[2] * 0.8F), mAllowAlpha ? 255 - mRGBa[3] : 255);
+ aRenderer.renderFaceZPos(aBlock, aX, aY, aZ, mIconContainer.getIcon());
+ if (mIconContainer.getOverlayIcon() != null) {
+ Tessellator.instance.setColorRGBA(204, 204, 204, 255);
+ aRenderer.renderFaceZPos(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon());
+ }
+ } catch (NullPointerException e){
+ Utils.LOG_WARNING("renderZPos failed.");
+ }
+ }
+
+ @Override
+ public void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) {
+ try {
+ Utils.LOG_WARNING("renderZNeg Method();.");
+ Utils.LOG_WARNING("Setting RGBA of instance.");
+ Tessellator.instance.setColorRGBA((int) (mRGBa[0] * 0.8F), (int) (mRGBa[1] * 0.8F), (int) (mRGBa[2] * 0.8F), mAllowAlpha ? 255 - mRGBa[3] : 255);
+ aRenderer.renderFaceZNeg(aBlock, aX, aY, aZ, mIconContainer.getIcon());
+ Utils.LOG_WARNING("Is mIconContainer null? "+mIconContainer.toString());
+ Utils.LOG_WARNING("mIconContainer.getIcon.getIconName(): "+mIconContainer.getIcon().getIconName());
+ Utils.LOG_WARNING("mIconContainer.getTextureFile().getResourceDomain()"+mIconContainer.getTextureFile().getResourceDomain());
+ Utils.LOG_WARNING("mIconContainer.getTextureFile().getResourcePath()"+mIconContainer.getTextureFile().getResourcePath());
+ if (mIconContainer.getOverlayIcon() != null) {
+ Tessellator.instance.setColorRGBA(204, 204, 204, 255);
+ aRenderer.renderFaceZNeg(aBlock, aX, aY, aZ, mIconContainer.getOverlayIcon());
+ Utils.LOG_WARNING("Is miconContainer.getOverlayIcon null? "+mIconContainer.getOverlayIcon().toString());
+ Utils.LOG_WARNING("mIconContainer.getIcon.getIconName(): "+mIconContainer.getOverlayIcon().getIconName());
+ Utils.LOG_WARNING("mIconContainer.getTextureFile().getResourceDomain()"+mIconContainer.getTextureFile().getResourceDomain());
+ Utils.LOG_WARNING("mIconContainer.getTextureFile().getResourcePath()"+mIconContainer.getTextureFile().getResourcePath());
+ }
+ } catch (NullPointerException e){
+
+
+ e.printStackTrace();
+ Utils.LOG_WARNING("renderZNeg failed."+e.getMessage()+"|"+e.getClass()+"|"+e.getLocalizedMessage());
+ Minecraft.getMinecraft().shutdown();
+ }
+ }
+
+ @Override
+ public short[] getRGBA() {
+ return mRGBa;
+ }
+
+ @Override
+ public boolean isValidTexture() {
+ return mIconContainer != null;
+ }
+} \ No newline at end of file
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/util/GregtechOreDictUnificator.java b/src/Java/miscutil/core/xmod/gregtech/api/util/GregtechOreDictUnificator.java
new file mode 100644
index 0000000000..bdc01ccdf0
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/util/GregtechOreDictUnificator.java
@@ -0,0 +1,366 @@
+package miscutil.core.xmod.gregtech.api.util;
+
+import static gregtech.api.enums.GT_Values.E;
+import static gregtech.api.enums.GT_Values.M;
+import static gregtech.api.enums.GT_Values.W;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.SubTag;
+import gregtech.api.objects.GT_HashSet;
+import gregtech.api.objects.GT_ItemStack;
+import gregtech.api.util.GT_Log;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
+import gregtech.common.GT_Proxy.OreDictEventContainer;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map.Entry;
+
+import miscutil.core.xmod.gregtech.api.enums.GregtechOrePrefixes;
+import miscutil.core.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+import miscutil.core.xmod.gregtech.api.objects.GregtechItemData;
+import miscutil.core.xmod.gregtech.api.objects.GregtechMaterialStack;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.oredict.OreDictionary;
+
+/**
+ * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
+ * <p/>
+ * This is the Core of my OreDict Unification Code
+ * <p/>
+ * If you just want to use this to unificate your Items, then use the Function in the GregTech_API File
+ * <p/>
+ * P.S. It is intended to be named "Unificator" and not "Unifier", because that sounds more awesome.
+ */
+public class GregtechOreDictUnificator {
+ private static final HashMap<String, ItemStack> sName2StackMap = new HashMap<String, ItemStack>();
+ private static final HashMap<GT_ItemStack, GregtechItemData> sItemStack2DataMap = new HashMap<GT_ItemStack, GregtechItemData>();
+ private static final GT_HashSet<GT_ItemStack> sNoUnificationList = new GT_HashSet<GT_ItemStack>();
+ public static volatile int VERSION = 508;
+ private static int isRegisteringOre = 0, isAddingOre = 0;
+ private static boolean mRunThroughTheList = true;
+
+ static {
+ GregTech_API.sItemStackMappings.add(sItemStack2DataMap);
+ }
+
+ /**
+ * The Blacklist just prevents the Item from being unificated into something else.
+ * Useful if you have things like the Industrial Diamond, which is better than regular Diamond, but also usable in absolutely all Diamond Recipes.
+ */
+ public static void addToBlacklist(ItemStack aStack) {
+ if (GT_Utility.isStackValid(aStack) && !GT_Utility.isStackInList(aStack, sNoUnificationList))
+ sNoUnificationList.add(aStack);
+ }
+
+ public static boolean isBlacklisted(ItemStack aStack) {
+ return GT_Utility.isStackInList(aStack, sNoUnificationList);
+ }
+
+ public static void add(GregtechOrePrefixes aPrefix, GT_Materials aMaterial, ItemStack aStack) {
+ set(aPrefix, aMaterial, aStack, false, false);
+ }
+
+ public static void set(GregtechOrePrefixes aPrefix, GT_Materials aMaterial, ItemStack aStack) {
+ set(aPrefix, aMaterial, aStack, true, false);
+ }
+
+ public static void set(GregtechOrePrefixes aPrefix, GT_Materials aMaterial, ItemStack aStack, boolean aOverwrite, boolean aAlreadyRegistered) {
+ if (aMaterial == null || aPrefix == null || GT_Utility.isStackInvalid(aStack) || Items.feather.getDamage(aStack) == W)
+ return;
+ isAddingOre++;
+ aStack = GT_Utility.copyAmount(1, aStack);
+ if (!aAlreadyRegistered) registerOre(aPrefix.get(aMaterial), aStack);
+ addAssociation(aPrefix, aMaterial, aStack, isBlacklisted(aStack));
+ if (aOverwrite || GT_Utility.isStackInvalid(sName2StackMap.get(aPrefix.get(aMaterial).toString())))
+ sName2StackMap.put(aPrefix.get(aMaterial).toString(), aStack);
+ isAddingOre--;
+ }
+
+ public static ItemStack getFirstOre(Object aName, long aAmount) {
+ if (GT_Utility.isStringInvalid(aName)) return null;
+ ItemStack tStack = sName2StackMap.get(aName.toString());
+ if (GT_Utility.isStackValid(tStack)) return GT_Utility.copyAmount(aAmount, tStack);
+ return GT_Utility.copyAmount(aAmount, getOres(aName).toArray());
+ }
+
+ public static ItemStack get(Object aName, long aAmount) {
+ return get(aName, null, aAmount, true, true);
+ }
+
+ public static ItemStack get(Object aName, ItemStack aReplacement, long aAmount) {
+ return get(aName, aReplacement, aAmount, true, true);
+ }
+
+ public static ItemStack get(GregtechOrePrefixes aPrefix, Object aMaterial, long aAmount) {
+ return get(aPrefix, aMaterial, null, aAmount);
+ }
+
+ public static ItemStack get(GregtechOrePrefixes aPrefix, Object aMaterial, ItemStack aReplacement, long aAmount) {
+ return get(aPrefix.get(aMaterial), aReplacement, aAmount, false, true);
+ }
+
+ public static ItemStack get(Object aName, ItemStack aReplacement, long aAmount, boolean aMentionPossibleTypos, boolean aNoInvalidAmounts) {
+ if (aNoInvalidAmounts && aAmount < 1) return null;
+ if (!sName2StackMap.containsKey(aName.toString()) && aMentionPossibleTypos)
+ GT_Log.err.println("Unknown Key for Unification, Typo? " + aName);
+ return GT_Utility.copyAmount(aAmount, sName2StackMap.get(aName.toString()), getFirstOre(aName, aAmount), aReplacement);
+ }
+
+ public static ItemStack[] setStackArray(boolean aUseBlackList, ItemStack... aStacks) {
+ for (int i = 0; i < aStacks.length; i++) aStacks[i] = get(aUseBlackList, GT_Utility.copy(aStacks[i]));
+ return aStacks;
+ }
+
+ public static ItemStack[] getStackArray(boolean aUseBlackList, Object... aStacks) {
+ ItemStack[] rStacks = new ItemStack[aStacks.length];
+ for (int i = 0; i < aStacks.length; i++) rStacks[i] = get(aUseBlackList, GT_Utility.copy(aStacks[i]));
+ return rStacks;
+ }
+
+ public static ItemStack setStack(ItemStack aStack) {
+ return setStack(true, aStack);
+ }
+
+ public static ItemStack setStack(boolean aUseBlackList, ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack)) return aStack;
+ ItemStack tStack = get(aUseBlackList, aStack);
+ if (GT_Utility.areStacksEqual(aStack, tStack)) return aStack;
+ aStack.func_150996_a(tStack.getItem());
+ Items.feather.setDamage(aStack, Items.feather.getDamage(tStack));
+ return aStack;
+ }
+
+ public static ItemStack get(ItemStack aStack) {
+ return get(true, aStack);
+ }
+
+ public static ItemStack get(boolean aUseBlackList, ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack)) return null;
+ GregtechItemData tPrefixMaterial = getAssociation(aStack);
+ ItemStack rStack = null;
+ if (tPrefixMaterial == null || !tPrefixMaterial.hasValidPrefixMaterialData() || (aUseBlackList && tPrefixMaterial.mBlackListed))
+ return GT_Utility.copy(aStack);
+ if (aUseBlackList && !GregTech_API.sUnificationEntriesRegistered && isBlacklisted(aStack)) {
+ tPrefixMaterial.mBlackListed = true;
+ return GT_Utility.copy(aStack);
+ }
+ if (tPrefixMaterial.mUnificationTarget == null)
+ tPrefixMaterial.mUnificationTarget = sName2StackMap.get(tPrefixMaterial.toString());
+ rStack = tPrefixMaterial.mUnificationTarget;
+ if (GT_Utility.isStackInvalid(rStack)) return GT_Utility.copy(aStack);
+ assert rStack != null;
+ rStack.setTagCompound(aStack.getTagCompound());
+ return GT_Utility.copyAmount(aStack.stackSize, rStack);
+ }
+
+ public static void addItemData(ItemStack aStack, GregtechItemData aData) {
+ if (GT_Utility.isStackValid(aStack) && getItemData(aStack) == null && aData != null) setItemData(aStack, aData);
+ }
+
+ public static void setItemData(ItemStack aStack, GregtechItemData aData) {
+ if (GT_Utility.isStackInvalid(aStack) || aData == null) return;
+ GregtechItemData tData = getItemData(aStack);
+ if (tData == null || !tData.hasValidPrefixMaterialData()) {
+ if (tData != null) for (Object tObject : tData.mExtraData)
+ if (!aData.mExtraData.contains(tObject)) aData.mExtraData.add(tObject);
+ if (aStack.stackSize > 1) {
+ if (aData.mMaterial != null) aData.mMaterial.mAmount /= aStack.stackSize;
+ for (GregtechMaterialStack tMaterial : aData.mByProducts) tMaterial.mAmount /= aStack.stackSize;
+ aStack = GT_Utility.copyAmount(1, aStack);
+ }
+ sItemStack2DataMap.put(new GT_ItemStack(aStack), aData);
+ if (aData.hasValidMaterialData()) {
+ long tValidMaterialAmount = aData.mMaterial.mMaterial.contains(SubTag.NO_RECYCLING) ? 0 : aData.mMaterial.mAmount >= 0 ? aData.mMaterial.mAmount : M;
+ for (GregtechMaterialStack tMaterial : aData.mByProducts)
+ tValidMaterialAmount += tMaterial.mMaterial.contains(SubTag.NO_RECYCLING) ? 0 : tMaterial.mAmount >= 0 ? tMaterial.mAmount : M;
+ if (tValidMaterialAmount < M) GT_ModHandler.addToRecyclerBlackList(aStack);
+ }
+ if (mRunThroughTheList) {
+ if (GregTech_API.sLoadStarted) {
+ mRunThroughTheList = false;
+ for (Entry<GT_ItemStack, GregtechItemData> tEntry : sItemStack2DataMap.entrySet())
+ if (!tEntry.getValue().hasValidPrefixData() || tEntry.getValue().mPrefix.mAllowNormalRecycling)
+ GregtechRecipeRegistrator.registerMaterialRecycling(tEntry.getKey().toStack(), tEntry.getValue());
+ }
+ } else {
+ if (!aData.hasValidPrefixData() || aData.mPrefix.mAllowNormalRecycling)
+ GregtechRecipeRegistrator.registerMaterialRecycling(aStack, aData);
+ }
+ } else {
+ for (Object tObject : aData.mExtraData)
+ if (!tData.mExtraData.contains(tObject)) tData.mExtraData.add(tObject);
+ }
+ }
+
+ public static void addAssociation(GregtechOrePrefixes aPrefix, GT_Materials aMaterial, ItemStack aStack, boolean aBlackListed) {
+ if (aPrefix == null || aMaterial == null || GT_Utility.isStackInvalid(aStack)) return;
+ if (Items.feather.getDamage(aStack) == W) for (byte i = 0; i < 16; i++)
+ setItemData(GT_Utility.copyAmountAndMetaData(1, i, aStack), new GregtechItemData(aPrefix, aMaterial, aBlackListed));
+ setItemData(aStack, new GregtechItemData(aPrefix, aMaterial, aBlackListed));
+ }
+
+ public static GregtechItemData getItemData(ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack)) return null;
+ GregtechItemData rData = sItemStack2DataMap.get(new GT_ItemStack(aStack));
+ if (rData == null) rData = sItemStack2DataMap.get(new GT_ItemStack(GT_Utility.copyMetaData(W, aStack)));
+ return rData;
+ }
+
+ public static GregtechItemData getAssociation(ItemStack aStack) {
+ GregtechItemData rData = getItemData(aStack);
+ return rData != null && rData.hasValidPrefixMaterialData() ? rData : null;
+ }
+
+ public static boolean isItemStackInstanceOf(ItemStack aStack, Object aName) {
+ if (GT_Utility.isStringInvalid(aName) || GT_Utility.isStackInvalid(aStack)) return false;
+ for (ItemStack tOreStack : getOres(aName.toString()))
+ if (GT_Utility.areStacksEqual(tOreStack, aStack, true)) return true;
+ return false;
+ }
+
+ public static boolean isItemStackDye(ItemStack aStack) {
+ if (GT_Utility.isStackInvalid(aStack)) return false;
+ for (Dyes tDye : Dyes.VALUES) if (isItemStackInstanceOf(aStack, tDye.toString())) return true;
+ return false;
+ }
+
+ public static boolean registerOre(GregtechOrePrefixes aPrefix, Object aMaterial, ItemStack aStack) {
+ return registerOre(aPrefix.get(aMaterial), aStack);
+ }
+
+ public static boolean registerOre(Object aName, ItemStack aStack) {
+ if (aName == null || GT_Utility.isStackInvalid(aStack)) return false;
+ String tName = aName.toString();
+ if (GT_Utility.isStringInvalid(tName)) return false;
+ ArrayList<ItemStack> tList = getOres(tName);
+ for (int i = 0; i < tList.size(); i++) if (GT_Utility.areStacksEqual(tList.get(i), aStack, true)) return false;
+ isRegisteringOre++;
+ OreDictionary.registerOre(tName, GT_Utility.copyAmount(1, aStack));
+ isRegisteringOre--;
+ return true;
+ }
+
+ public static boolean isRegisteringOres() {
+ return isRegisteringOre > 0;
+ }
+
+ public static boolean isAddingOres() {
+ return isAddingOre > 0;
+ }
+
+ public static void resetUnificationEntries() {
+ for (GregtechItemData tPrefixMaterial : sItemStack2DataMap.values()) tPrefixMaterial.mUnificationTarget = null;
+ }
+
+ public static ItemStack getGem(GregtechMaterialStack aMaterial) {
+ return aMaterial == null ? null : getGem(aMaterial.mMaterial, aMaterial.mAmount);
+ }
+
+ public static ItemStack getGem(GT_Materials aMaterial, OrePrefixes aPrefix) {
+ return aMaterial == null ? null : getGem(aMaterial, aPrefix.mMaterialAmount);
+ }
+
+ public static ItemStack getGem(GT_Materials aMaterial, long aMaterialAmount) {
+ ItemStack rStack = null;
+ if (((aMaterialAmount >= M) || aMaterialAmount >= M * 32))
+ rStack = get(GregtechOrePrefixes.gem, aMaterial, aMaterialAmount / M);
+ if (rStack == null && (((aMaterialAmount * 2) % M == 0) || aMaterialAmount >= M * 16))
+ rStack = get(GregtechOrePrefixes.gemFlawed, aMaterial, (aMaterialAmount * 2) / M);
+ if (rStack == null && (((aMaterialAmount * 4) >= M)))
+ rStack = get(GregtechOrePrefixes.gemChipped, aMaterial, (aMaterialAmount * 4) / M);
+ return rStack;
+ }
+
+ public static ItemStack getDust(GregtechMaterialStack aMaterial) {
+ return aMaterial == null ? null : getDust(aMaterial.mMaterial, aMaterial.mAmount);
+ }
+
+ public static ItemStack getDust(GT_Materials aMaterial, OrePrefixes aPrefix) {
+ return aMaterial == null ? null : getDust(aMaterial, aPrefix.mMaterialAmount);
+ }
+
+ public static ItemStack getDust(GT_Materials aMaterial, long aMaterialAmount) {
+ if (aMaterialAmount <= 0) return null;
+ ItemStack rStack = null;
+ if (((aMaterialAmount % M == 0) || aMaterialAmount >= M * 16))
+ rStack = get(GregtechOrePrefixes.dust, aMaterial, aMaterialAmount / M);
+ if (rStack == null && (((aMaterialAmount * 4) % M == 0) || aMaterialAmount >= M * 8))
+ rStack = get(GregtechOrePrefixes.dustSmall, aMaterial, (aMaterialAmount * 4) / M);
+ if (rStack == null && (((aMaterialAmount * 9) >= M)))
+ rStack = get(GregtechOrePrefixes.dustTiny, aMaterial, (aMaterialAmount * 9) / M);
+ return rStack;
+ }
+
+ public static ItemStack getIngot(GregtechMaterialStack aMaterial) {
+ return aMaterial == null ? null : getIngot(aMaterial.mMaterial, aMaterial.mAmount);
+ }
+
+ public static ItemStack getIngot(GT_Materials aMaterial, OrePrefixes aPrefix) {
+ return aMaterial == null ? null : getIngot(aMaterial, aPrefix.mMaterialAmount);
+ }
+
+ public static ItemStack getIngot(GT_Materials aMaterial, long aMaterialAmount) {
+ if (aMaterialAmount <= 0) return null;
+ ItemStack rStack = null;
+ if (((aMaterialAmount % (M * 9) == 0 && aMaterialAmount / (M * 9) > 1) || aMaterialAmount >= M * 72))
+ rStack = get(GregtechOrePrefixes.block, aMaterial, aMaterialAmount / (M * 9));
+ if (rStack == null && ((aMaterialAmount % M == 0) || aMaterialAmount >= M * 8))
+ rStack = get(GregtechOrePrefixes.ingot, aMaterial, aMaterialAmount / M);
+ if (rStack == null && (((aMaterialAmount * 9) >= M)))
+ rStack = get(GregtechOrePrefixes.nugget, aMaterial, (aMaterialAmount * 9) / M);
+ return rStack;
+ }
+
+ public static ItemStack getIngotOrDust(GT_Materials aMaterial, long aMaterialAmount) {
+ if (aMaterialAmount <= 0) return null;
+ ItemStack rStack = getIngot(aMaterial, aMaterialAmount);
+ if (rStack == null) rStack = getDust(aMaterial, aMaterialAmount);
+ return rStack;
+ }
+
+ public static ItemStack getIngotOrDust(GregtechMaterialStack aMaterial) {
+ ItemStack rStack = getIngot(aMaterial);
+ if(aMaterial!=null&&aMaterial.mMaterial!=null)rStack = getDust(aMaterial);
+ if (rStack == null) rStack = getDust(aMaterial);
+ return rStack;
+ }
+
+ public static ItemStack getDustOrIngot(GT_Materials aMaterial, long aMaterialAmount) {
+ if (aMaterialAmount <= 0) return null;
+ ItemStack rStack = getDust(aMaterial, aMaterialAmount);
+ if (rStack == null) rStack = getIngot(aMaterial, aMaterialAmount);
+ return rStack;
+ }
+
+ public static ItemStack getDustOrIngot(GregtechMaterialStack aMaterial) {
+ ItemStack rStack = getDust(aMaterial);
+ if (rStack == null) rStack = getIngot(aMaterial);
+ return rStack;
+ }
+
+ /**
+ * @return a Copy of the OreDictionary.getOres() List
+ */
+ public static ArrayList<ItemStack> getOres(OrePrefixes aPrefix, Object aMaterial) {
+ return getOres(aPrefix.get(aMaterial));
+ }
+
+ /**
+ * @return a Copy of the OreDictionary.getOres() List
+ */
+ public static ArrayList<ItemStack> getOres(Object aOreName) {
+ String aName = aOreName == null ? E : aOreName.toString();
+ ArrayList<ItemStack> rList = new ArrayList<ItemStack>();
+ if (GT_Utility.isStringValid(aName)) rList.addAll(OreDictionary.getOres(aName));
+ return rList;
+ }
+
+ public static void registerRecipes(OreDictEventContainer tOre) {
+ // TODO Auto-generated method stub
+
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/util/GregtechRecipe.java b/src/Java/miscutil/core/xmod/gregtech/api/util/GregtechRecipe.java
new file mode 100644
index 0000000000..6d73a94364
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/util/GregtechRecipe.java
@@ -0,0 +1,677 @@
+package miscutil.core.xmod.gregtech.api.util;
+
+import static gregtech.api.enums.GT_Values.E;
+import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
+import static gregtech.api.enums.GT_Values.W;
+import gregtech.api.GregTech_API;
+import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords;
+import gregtech.api.objects.GT_FluidStack;
+import gregtech.api.objects.GT_ItemStack;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_Log;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gregtech.api.util.GT_Utility;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+
+import miscutil.core.util.Utils;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidStack;
+
+/**
+ * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
+ * <p/>
+ * This File contains the functions used for Recipes. Please do not include this File AT ALL in your Moddownload as it ruins compatibility
+ * This is just the Core of my Recipe System, if you just want to GET the Recipes I add, then you can access this File.
+ * Do NOT add Recipes using the Constructors inside this Class, The GregTech_API File calls the correct Functions for these Constructors.
+ * <p/>
+ * I know this File causes some Errors, because of missing Main Functions, but if you just need to compile Stuff, then remove said erroreous Functions.
+ */
+public class GregtechRecipe {
+
+ public static volatile int VERSION = 508;
+ /**
+ * If you want to change the Output, feel free to modify or even replace the whole ItemStack Array, for Inputs, please add a new Recipe, because of the HashMaps.
+ */
+ public ItemStack[] mInputs, mOutputs;
+ /**
+ * If you want to change the Output, feel free to modify or even replace the whole ItemStack Array, for Inputs, please add a new Recipe, because of the HashMaps.
+ */
+ public FluidStack[] mFluidInputs, mFluidOutputs;
+ /**
+ * If you changed the amount of Array-Items inside the Output Array then the length of this Array must be larger or equal to the Output Array. A chance of 10000 equals 100%
+ */
+ public int[] mChances;
+ /**
+ * An Item that needs to be inside the Special Slot, like for example the Copy Slot inside the Printer. This is only useful for Fake Recipes in NEI, since findRecipe() and containsInput() don't give a shit about this Field. Lists are also possible.
+ */
+ public Object mSpecialItems;
+ public int mDuration, mEUt, mSpecialValue;
+ /**
+ * Use this to just disable a specific Recipe, but the Configuration enables that already for every single Recipe.
+ */
+ public boolean mEnabled = true;
+ /**
+ * If this Recipe is hidden from NEI
+ */
+ public boolean mHidden = false;
+ /**
+ * If this Recipe is Fake and therefore doesn't get found by the findRecipe Function (It is still in the HashMaps, so that containsInput does return T on those fake Inputs)
+ */
+ public boolean mFakeRecipe = false;
+ /**
+ * If this Recipe can be stored inside a Machine in order to make Recipe searching more Efficient by trying the previously used Recipe first. In case you have a Recipe Map overriding things and returning one time use Recipes, you have to set this to F.
+ */
+ public boolean mCanBeBuffered = true;
+ /**
+ * If this Recipe needs the Output Slots to be completely empty. Needed in case you have randomised Outputs
+ */
+ public boolean mNeedsEmptyOutput = false;
+ private GregtechRecipe(GregtechRecipe aRecipe) {
+ mInputs = GT_Utility.copyStackArray((Object[]) aRecipe.mInputs);
+ mOutputs = GT_Utility.copyStackArray((Object[]) aRecipe.mOutputs);
+ mSpecialItems = aRecipe.mSpecialItems;
+ mChances = aRecipe.mChances;
+ mFluidInputs = GT_Utility.copyFluidArray(aRecipe.mFluidInputs);
+ mFluidOutputs = GT_Utility.copyFluidArray(aRecipe.mFluidOutputs);
+ mDuration = aRecipe.mDuration;
+ mSpecialValue = aRecipe.mSpecialValue;
+ mEUt = aRecipe.mEUt;
+ mNeedsEmptyOutput = aRecipe.mNeedsEmptyOutput;
+ mCanBeBuffered = aRecipe.mCanBeBuffered;
+ mFakeRecipe = aRecipe.mFakeRecipe;
+ mEnabled = aRecipe.mEnabled;
+ mHidden = aRecipe.mHidden;
+ }
+ protected GregtechRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ if (aInputs == null) aInputs = new ItemStack[0];
+ if (aOutputs == null) aOutputs = new ItemStack[0];
+ if (aFluidInputs == null) aFluidInputs = new FluidStack[0];
+ if (aFluidOutputs == null) aFluidOutputs = new FluidStack[0];
+ if (aChances == null) aChances = new int[aOutputs.length];
+ if (aChances.length < aOutputs.length) aChances = Arrays.copyOf(aChances, aOutputs.length);
+
+ aInputs = GT_Utility.getArrayListWithoutTrailingNulls(aInputs).toArray(new ItemStack[0]);
+ aOutputs = GT_Utility.getArrayListWithoutTrailingNulls(aOutputs).toArray(new ItemStack[0]);
+ aFluidInputs = GT_Utility.getArrayListWithoutNulls(aFluidInputs).toArray(new FluidStack[0]);
+ aFluidOutputs = GT_Utility.getArrayListWithoutNulls(aFluidOutputs).toArray(new FluidStack[0]);
+
+ GT_OreDictUnificator.setStackArray(true, aInputs);
+ GT_OreDictUnificator.setStackArray(true, aOutputs);
+
+ for (ItemStack tStack : aOutputs) GT_Utility.updateItemStack(tStack);
+
+ for (int i = 0; i < aChances.length; i++) if (aChances[i] <= 0) aChances[i] = 10000;
+ for (int i = 0; i < aFluidInputs.length; i++) aFluidInputs[i] = new GT_FluidStack(aFluidInputs[i]);
+ for (int i = 0; i < aFluidOutputs.length; i++) aFluidOutputs[i] = new GT_FluidStack(aFluidOutputs[i]);
+
+ for (int i = 0; i < aInputs.length; i++)
+ if (aInputs[i] != null && Items.feather.getDamage(aInputs[i]) != W)
+ for (int j = 0; j < aOutputs.length; j++) {
+ if (GT_Utility.areStacksEqual(aInputs[i], aOutputs[j])) {
+ if (aInputs[i].stackSize >= aOutputs[j].stackSize) {
+ aInputs[i].stackSize -= aOutputs[j].stackSize;
+ aOutputs[j] = null;
+ } else {
+ aOutputs[j].stackSize -= aInputs[i].stackSize;
+ }
+ }
+ }
+
+ if (aOptimize && aDuration >= 32) {
+ ArrayList<ItemStack> tList = new ArrayList<ItemStack>();
+ tList.addAll(Arrays.asList(aInputs));
+ tList.addAll(Arrays.asList(aOutputs));
+ for (int i = 0; i < tList.size(); i++) if (tList.get(i) == null) tList.remove(i--);
+
+ for (byte i = (byte) Math.min(64, aDuration / 16); i > 1; i--)
+ if (aDuration / i >= 16) {
+ boolean temp = true;
+ for (int j = 0, k = tList.size(); temp && j < k; j++)
+ if (tList.get(j).stackSize % i != 0) temp = false;
+ for (int j = 0; temp && j < aFluidInputs.length; j++)
+ if (aFluidInputs[j].amount % i != 0) temp = false;
+ for (int j = 0; temp && j < aFluidOutputs.length; j++)
+ if (aFluidOutputs[j].amount % i != 0) temp = false;
+ if (temp) {
+ for (int j = 0, k = tList.size(); j < k; j++) tList.get(j).stackSize /= i;
+ for (int j = 0; j < aFluidInputs.length; j++) aFluidInputs[j].amount /= i;
+ for (int j = 0; j < aFluidOutputs.length; j++) aFluidOutputs[j].amount /= i;
+ aDuration /= i;
+ }
+ }
+ }
+
+ mInputs = aInputs;
+ mOutputs = aOutputs;
+ mSpecialItems = aSpecialItems;
+ mChances = aChances;
+ mFluidInputs = aFluidInputs;
+ mFluidOutputs = aFluidOutputs;
+ mDuration = aDuration;
+ mSpecialValue = aSpecialValue;
+ mEUt = aEUt;
+
+ // checkCellBalance();
+ }
+
+ public GregtechRecipe(ItemStack aInput1, ItemStack aOutput1, int aFuelValue, int aType) {
+ this(aInput1, aOutput1, null, null, null, aFuelValue, aType);
+ }
+
+ // aSpecialValue = EU per Liter! If there is no Liquid for this Object, then it gets multiplied with 1000!
+ public GregtechRecipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aSpecialValue, int aType) {
+ this(true, new ItemStack[]{aInput1}, new ItemStack[]{aOutput1, aOutput2, aOutput3, aOutput4}, null, null, null, null, 0, 0, Math.max(1, aSpecialValue));
+
+ Utils.LOG_INFO("Switch case method for adding fuels");
+ if (mInputs.length > 0 && aSpecialValue > 0) {
+ switch (aType) {
+ // Diesel Generator
+ case 0:
+ Utils.LOG_INFO("Added fuel "+aInput1.getDisplayName()+" is ROCKET FUEL - continuing");
+ Gregtech_Recipe_Map.sRocketFuels.addRecipe(this);
+ break;
+ // Gas Turbine
+ case 1:
+ //Gregtech_Recipe_Map.sTurbineFuels.addRecipe(this);
+ break;
+ // Thermal Generator
+ case 2:
+ //Gregtech_Recipe_Map.sHotFuels.addRecipe(this);
+ break;
+ // Plasma Generator
+ case 4:
+ //Gregtech_Recipe_Map.sPlasmaFuels.addRecipe(this);
+ break;
+ // Magic Generator
+ case 5:
+ //Gregtech_Recipe_Map.sMagicFuels.addRecipe(this);
+ break;
+ // Fluid Generator. Usually 3. Every wrong Type ends up in the Semifluid Generator
+ default:
+ //Gregtech_Recipe_Map.sDenseLiquidFuels.addRecipe(this);
+ break;
+ }
+ }
+ }
+
+ public static void reInit() {
+ GT_Log.out.println("GT_Mod: Re-Unificating Recipes.");
+ for (Gregtech_Recipe_Map tMapEntry : Gregtech_Recipe_Map.sMappings) tMapEntry.reInit();
+ }
+
+ public GregtechRecipe copy() {
+ return new GregtechRecipe(this);
+ }
+
+ public boolean isRecipeInputEqual(boolean aDecreaseStacksizeBySuccess, FluidStack[] aFluidInputs, ItemStack... aInputs) {
+ return isRecipeInputEqual(aDecreaseStacksizeBySuccess, false, aFluidInputs, aInputs);
+ }
+
+ public boolean isRecipeInputEqual(boolean aDecreaseStacksizeBySuccess, boolean aDontCheckStackSizes, FluidStack[] aFluidInputs, ItemStack... aInputs) {
+ if (mFluidInputs.length > 0 && aFluidInputs == null) return false;
+ for (FluidStack tFluid : mFluidInputs)
+ if (tFluid != null) {
+ boolean temp = true;
+ for (FluidStack aFluid : aFluidInputs)
+ if (aFluid != null && aFluid.isFluidEqual(tFluid) && (aDontCheckStackSizes || aFluid.amount >= tFluid.amount)) {
+ temp = false;
+ break;
+ }
+ if (temp) return false;
+ }
+
+ if (mInputs.length > 0 && aInputs == null) return false;
+
+ for (ItemStack tStack : mInputs)
+ if (tStack != null) {
+ boolean temp = true;
+ for (ItemStack aStack : aInputs)
+ if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true)) && (aDontCheckStackSizes || aStack.stackSize >= tStack.stackSize)) {
+ temp = false;
+ break;
+ }
+ if (temp) return false;
+ }
+
+ if (aDecreaseStacksizeBySuccess) {
+ if (aFluidInputs != null) {
+ for (FluidStack tFluid : mFluidInputs)
+ if (tFluid != null) {
+ for (FluidStack aFluid : aFluidInputs)
+ if (aFluid != null && aFluid.isFluidEqual(tFluid) && (aDontCheckStackSizes || aFluid.amount >= tFluid.amount)) {
+ aFluid.amount -= tFluid.amount;
+ break;
+ }
+ }
+ }
+
+ if (aInputs != null) {
+ for (ItemStack tStack : mInputs)
+ if (tStack != null) {
+ for (ItemStack aStack : aInputs)
+ if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true)) && (aDontCheckStackSizes || aStack.stackSize >= tStack.stackSize)) {
+ aStack.stackSize -= tStack.stackSize;
+ break;
+ }
+ }
+ }
+ }
+
+ return true;
+ }
+
+ public static class Gregtech_Recipe_Map {
+ /**
+ * Contains all Recipe Maps
+ */
+ public static final Collection<Gregtech_Recipe_Map> sMappings = new ArrayList<Gregtech_Recipe_Map>();
+ //public static final GT_Recipe_Map sChemicalBathRecipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gt.recipe.chemicalbath", "Chemical Bath", null, RES_PATH_GUI + "basicmachines/ChemicalBath", 1, 3, 1, 1, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sCokeOvenRecipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gt.recipe.cokeoven", "Coke Oven", null, RES_PATH_GUI + "basicmachines/ChemicalBath", 1, 3, 1, 1, 1, E, 1, E, true, true);
+ public static final Gregtech_Recipe_Map_Fuel sRocketFuels = new Gregtech_Recipe_Map_Fuel(new HashSet<GregtechRecipe>(10), "gt.recipe.rocketenginefuel", "Rocket Engine Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 3000, " EU", true, true);
+
+
+ /**
+ * HashMap of Recipes based on their Items
+ */
+ public final Map<GT_ItemStack, Collection<GregtechRecipe>> mRecipeItemMap = new HashMap<GT_ItemStack, Collection<GregtechRecipe>>();
+ /**
+ * HashMap of Recipes based on their Fluids
+ */
+ public final Map<Fluid, Collection<GregtechRecipe>> mRecipeFluidMap = new HashMap<Fluid, Collection<GregtechRecipe>>();
+ /**
+ * The List of all Recipes
+ */
+ public final Collection<GregtechRecipe> mRecipeList;
+ /**
+ * String used as an unlocalised Name.
+ */
+ public final String mUnlocalizedName;
+ /**
+ * String used in NEI for the Recipe Lists. If null it will use the unlocalised Name instead
+ */
+ public final String mNEIName;
+ /**
+ * GUI used for NEI Display. Usually the GUI of the Machine itself
+ */
+ public final String mNEIGUIPath;
+ public final String mNEISpecialValuePre, mNEISpecialValuePost;
+ public final int mUsualInputCount, mUsualOutputCount, mNEISpecialValueMultiplier, mMinimalInputItems, mMinimalInputFluids, mAmperage;
+ public final boolean mNEIAllowed, mShowVoltageAmperageInNEI;
+
+ /**
+ * Initialises a new type of Recipe Handler.
+ *
+ * @param aRecipeList a List you specify as Recipe List. Usually just an ArrayList with a pre-initialised Size.
+ * @param aUnlocalizedName the unlocalised Name of this Recipe Handler, used mainly for NEI.
+ * @param aLocalName the displayed Name inside the NEI Recipe GUI.
+ * @param aNEIGUIPath the displayed GUI Texture, usually just a Machine GUI. Auto-Attaches ".png" if forgotten.
+ * @param aUsualInputCount the usual amount of Input Slots this Recipe Class has.
+ * @param aUsualOutputCount the usual amount of Output Slots this Recipe Class has.
+ * @param aNEISpecialValuePre the String in front of the Special Value in NEI.
+ * @param aNEISpecialValueMultiplier the Value the Special Value is getting Multiplied with before displaying
+ * @param aNEISpecialValuePost the String after the Special Value. Usually for a Unit or something.
+ * @param aNEIAllowed if NEI is allowed to display this Recipe Handler in general.
+ */
+ public Gregtech_Recipe_Map(Collection<GregtechRecipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
+ sMappings.add(this);
+ mNEIAllowed = aNEIAllowed;
+ mShowVoltageAmperageInNEI = aShowVoltageAmperageInNEI;
+ mRecipeList = aRecipeList;
+ mNEIName = aNEIName == null ? aUnlocalizedName : aNEIName;
+ mNEIGUIPath = aNEIGUIPath.endsWith(".png") ? aNEIGUIPath : aNEIGUIPath + ".png";
+ mNEISpecialValuePre = aNEISpecialValuePre;
+ mNEISpecialValueMultiplier = aNEISpecialValueMultiplier;
+ mNEISpecialValuePost = aNEISpecialValuePost;
+ mAmperage = aAmperage;
+ mUsualInputCount = aUsualInputCount;
+ mUsualOutputCount = aUsualOutputCount;
+ mMinimalInputItems = aMinimalInputItems;
+ mMinimalInputFluids = aMinimalInputFluids;
+ GregTech_API.sFluidMappings.add(mRecipeFluidMap);
+ GregTech_API.sItemStackMappings.add(mRecipeItemMap);
+ GT_LanguageManager.addStringLocalization(mUnlocalizedName = aUnlocalizedName, aLocalName);
+ }
+
+ public Gregtech_Recipe_Map(HashSet<GregtechRecipe> hashSet,
+ String aUnlocalizedName, String aLocalName, Object aNEIName,
+ String aNEIGUIPath, int aUsualInputCount,
+ int aUsualOutputCount, int aMinimalInputItems,
+ int aMinimalInputFluids, int aAmperage,
+ String aNEISpecialValuePre, int aNEISpecialValueMultiplier,
+ String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI,
+ boolean aNEIAllowed) {
+ sMappings.add(this);
+ mNEIAllowed = aNEIAllowed;
+ mShowVoltageAmperageInNEI = aShowVoltageAmperageInNEI;
+ mRecipeList = hashSet;
+ mNEIName = (String) (aNEIName == null ? aUnlocalizedName : aNEIName);
+ mNEIGUIPath = aNEIGUIPath.endsWith(".png") ? aNEIGUIPath : aNEIGUIPath + ".png";
+ mNEISpecialValuePre = aNEISpecialValuePre;
+ mNEISpecialValueMultiplier = aNEISpecialValueMultiplier;
+ mNEISpecialValuePost = aNEISpecialValuePost;
+ mAmperage = aAmperage;
+ mUsualInputCount = aUsualInputCount;
+ mUsualOutputCount = aUsualOutputCount;
+ mMinimalInputItems = aMinimalInputItems;
+ mMinimalInputFluids = aMinimalInputFluids;
+ GregTech_API.sFluidMappings.add(mRecipeFluidMap);
+ GregTech_API.sItemStackMappings.add(mRecipeItemMap);
+ GT_LanguageManager.addStringLocalization(mUnlocalizedName = aUnlocalizedName, aLocalName);
+ }
+
+ public GregtechRecipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addRecipe(new GregtechRecipe(aOptimize, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
+ }
+
+ public GregtechRecipe addRecipe(int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addRecipe(new GregtechRecipe(false, null, null, null, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue), false, false, false);
+ }
+
+ public GregtechRecipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addRecipe(new GregtechRecipe(aOptimize, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
+ }
+
+ /*public GregtechRecipe addRecipe(boolean aOptimize, FluidStack aInput1, FluidStack aOutput1, ItemStack[] bInput1, ItemStack[] bOutput1, int aDuration, int aEUt, int aSpecialValue) {
+ return addRecipe(new GregtechRecipe(aOptimize, aInput1, aOutput1, bInput1,bOutput1, aDuration, aEUt, aSpecialValue));
+
+ }*/
+
+ public GregtechRecipe addRecipe(GregtechRecipe aRecipe) {
+ Utils.LOG_INFO("Adding Recipe Method 1");
+ return addRecipe(aRecipe, true, false, false);
+ }
+
+ protected GregtechRecipe addRecipe(GregtechRecipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, boolean aHidden) {
+ Utils.LOG_INFO("Adding Recipe Method 2");
+ aRecipe.mHidden = aHidden;
+ aRecipe.mFakeRecipe = aFakeRecipe;
+ if (aRecipe.mFluidInputs.length < mMinimalInputFluids && aRecipe.mInputs.length < mMinimalInputItems){
+ Utils.LOG_INFO("Step 2 failed");
+ return null;}
+ if (aCheckForCollisions && findRecipe(null, false, Long.MAX_VALUE, aRecipe.mFluidInputs, aRecipe.mInputs) != null){
+ Utils.LOG_INFO("Step 2 failed - 2");
+ return null;
+ }
+ return add(aRecipe);
+ }
+
+ /**
+ * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes
+ */
+ public GregtechRecipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addFakeRecipe(aCheckForCollisions, new GregtechRecipe(false, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
+ }
+
+ /**
+ * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes
+ */
+ public GregtechRecipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addFakeRecipe(aCheckForCollisions, new GregtechRecipe(false, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
+ }
+
+ /**
+ * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes
+ */
+ public GregtechRecipe addFakeRecipe(boolean aCheckForCollisions, GregtechRecipe aRecipe) {
+ return addRecipe(aRecipe, aCheckForCollisions, true, false);
+ }
+
+ public GregtechRecipe add(GregtechRecipe aRecipe) {
+ Utils.LOG_INFO("Adding Recipe Method 3");
+ mRecipeList.add(aRecipe);
+ for (FluidStack aFluid : aRecipe.mFluidInputs)
+ if (aFluid != null) {
+ Utils.LOG_INFO("Fluid is valid - getting some kind of fluid instance to add to the recipe hashmap.");
+ Collection<GregtechRecipe> tList = mRecipeFluidMap.get(aFluid.getFluid());
+ if (tList == null) mRecipeFluidMap.put(aFluid.getFluid(), tList = new HashSet<GregtechRecipe>(1));
+ tList.add(aRecipe);
+ }
+ return addToItemMap(aRecipe);
+ }
+
+ public void reInit() {
+ Map<GT_ItemStack, Collection<GregtechRecipe>> tMap = mRecipeItemMap;
+ if (tMap != null) tMap.clear();
+ for (GregtechRecipe tRecipe : mRecipeList) {
+ GT_OreDictUnificator.setStackArray(true, tRecipe.mInputs);
+ GT_OreDictUnificator.setStackArray(true, tRecipe.mOutputs);
+ if (tMap != null) addToItemMap(tRecipe);
+ }
+ }
+
+ /**
+ * @return if this Item is a valid Input for any for the Recipes
+ */
+ public boolean containsInput(ItemStack aStack) {
+ return aStack != null && (mRecipeItemMap.containsKey(new GT_ItemStack(aStack)) || mRecipeItemMap.containsKey(new GT_ItemStack(GT_Utility.copyMetaData(W, aStack))));
+ }
+
+ /**
+ * @return if this Fluid is a valid Input for any for the Recipes
+ */
+ public boolean containsInput(FluidStack aFluid) {
+ return aFluid != null && containsInput(aFluid.getFluid());
+ }
+
+ /**
+ * @return if this Fluid is a valid Input for any for the Recipes
+ */
+ public boolean containsInput(Fluid aFluid) {
+ return aFluid != null && mRecipeFluidMap.containsKey(aFluid);
+ }
+
+ public GregtechRecipe findRecipe(IHasWorldObjectAndCoords aTileEntity, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) {
+ return findRecipe(aTileEntity, null, aNotUnificated, aVoltage, aFluids, null, aInputs);
+ }
+
+ public GregtechRecipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GregtechRecipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) {
+ return findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, null, aInputs);
+ }
+
+ /**
+ * finds a Recipe matching the aFluid and ItemStack Inputs.
+ *
+ * @param aTileEntity an Object representing the current coordinates of the executing Block/Entity/Whatever. This may be null, especially during Startup.
+ * @param aRecipe in case this is != null it will try to use this Recipe first when looking things up.
+ * @param aNotUnificated if this is T the Recipe searcher will unificate the ItemStack Inputs
+ * @param aVoltage Voltage of the Machine or Long.MAX_VALUE if it has no Voltage
+ * @param aFluids the Fluid Inputs
+ * @param aSpecialSlot the content of the Special Slot, the regular Manager doesn't do anything with this, but some custom ones do.
+ * @param aInputs the Item Inputs
+ * @return the Recipe it has found or null for no matching Recipe
+ */
+ public GregtechRecipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GregtechRecipe aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
+ // No Recipes? Well, nothing to be found then.
+ if (mRecipeList.isEmpty()) return null;
+
+ // Some Recipe Classes require a certain amount of Inputs of certain kinds. Like "at least 1 Fluid + 1 Stack" or "at least 2 Stacks" before they start searching for Recipes.
+ // This improves Performance massively, especially if people leave things like Circuits, Molds or Shapes in their Machines to select Sub Recipes.
+ if (GregTech_API.sPostloadFinished) {
+ if (mMinimalInputFluids > 0) {
+ if (aFluids == null) return null;
+ int tAmount = 0;
+ for (FluidStack aFluid : aFluids) if (aFluid != null) tAmount++;
+ if (tAmount < mMinimalInputFluids) return null;
+ }
+ if (mMinimalInputItems > 0) {
+ if (aInputs == null) return null;
+ int tAmount = 0;
+ for (ItemStack aInput : aInputs) if (aInput != null) tAmount++;
+ if (tAmount < mMinimalInputItems) return null;
+ }
+ }
+
+ // Unification happens here in case the Input isn't already unificated.
+ if (aNotUnificated) aInputs = GT_OreDictUnificator.getStackArray(true, (Object[]) aInputs);
+
+ // Check the Recipe which has been used last time in order to not have to search for it again, if possible.
+ if (aRecipe != null)
+ if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
+ return aRecipe.mEnabled && aVoltage * mAmperage >= aRecipe.mEUt ? aRecipe : null;
+
+ // Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items.
+ if (mUsualInputCount > 0 && aInputs != null) for (ItemStack tStack : aInputs)
+ if (tStack != null) {
+ Collection<GregtechRecipe>
+ tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack));
+ if (tRecipes != null) for (GregtechRecipe tRecipe : tRecipes)
+ if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
+ return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
+ tRecipes = mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(W, tStack)));
+ if (tRecipes != null) for (GregtechRecipe tRecipe : tRecipes)
+ if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
+ return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
+ }
+
+ // If the minimal Amount of Items for the Recipe is 0, then it could be a Fluid-Only Recipe, so check that Map too.
+ if (mMinimalInputItems == 0 && aFluids != null) for (FluidStack aFluid : aFluids)
+ if (aFluid != null) {
+ Collection<GregtechRecipe>
+ tRecipes = mRecipeFluidMap.get(aFluid.getFluid());
+ if (tRecipes != null) for (GregtechRecipe tRecipe : tRecipes)
+ if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
+ return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
+ }
+
+ // And nothing has been found.
+ return null;
+ }
+
+ protected GregtechRecipe addToItemMap(GregtechRecipe aRecipe) {
+ Utils.LOG_INFO("Adding Recipe Method 4");
+ for (ItemStack aStack : aRecipe.mInputs)
+ if (aStack != null) {
+ Utils.LOG_INFO("Method 4 - Manipulating "+aStack.getDisplayName());
+ GT_ItemStack tStack = new GT_ItemStack(aStack);
+ Utils.LOG_INFO("Method 4 - Made gt stack of item "+tStack.toStack().getDisplayName());
+ Collection<GregtechRecipe> tList = mRecipeItemMap.get(tStack);
+ if (tList != null){
+ Utils.LOG_INFO("Method 4 - Gt Recipe Hashmap: "+tList.toString());
+ }
+ if (tList == null){
+ Utils.LOG_INFO("Method 4 - brrr list was NUll");
+ mRecipeItemMap.put(tStack, tList = new HashSet<GregtechRecipe>(1));
+ }
+ tList.add(aRecipe);
+ Utils.LOG_INFO("Method 4 - Added recipe to map? I think.");
+ }
+ return aRecipe;
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ // Here are a few Classes I use for Special Cases in some Machines without having to write a separate Machine Class.
+ // -----------------------------------------------------------------------------------------------------------------
+
+ /**
+ * Abstract Class for general Recipe Handling of non GT Recipes
+ */
+ public static abstract class GT_Recipe_Map_NonGTRecipes extends Gregtech_Recipe_Map {
+ public GT_Recipe_Map_NonGTRecipes(Collection<GregtechRecipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
+ super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
+ }
+
+ @Override
+ public boolean containsInput(ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean containsInput(FluidStack aFluid) {
+ return false;
+ }
+
+ @Override
+ public boolean containsInput(Fluid aFluid) {
+ return false;
+ }
+
+ @Override
+ public GregtechRecipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return null;
+ }
+
+ @Override
+ public GregtechRecipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return null;
+ }
+
+ @Override
+ public GregtechRecipe addRecipe(GregtechRecipe aRecipe) {
+ return null;
+ }
+
+ @Override
+ public GregtechRecipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return null;
+ }
+
+ @Override
+ public GregtechRecipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return null;
+ }
+
+ @Override
+ public GregtechRecipe addFakeRecipe(boolean aCheckForCollisions, GregtechRecipe aRecipe) {
+ return null;
+ }
+
+ @Override
+ public GregtechRecipe add(GregtechRecipe aRecipe) {
+ return null;
+ }
+
+ @Override
+ public void reInit() {/**/}
+
+ @Override
+ protected GregtechRecipe addToItemMap(GregtechRecipe aRecipe) {
+ return null;
+ }
+ }
+
+ /**
+ * Just a Recipe Map with Utility specifically for Fuels.
+ */
+ public static class Gregtech_Recipe_Map_Fuel extends Gregtech_Recipe_Map {
+ public Gregtech_Recipe_Map_Fuel(Collection<GregtechRecipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
+ super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
+ }
+
+ public GregtechRecipe addFuel(ItemStack aInput, ItemStack aOutput, int aFuelValueInEU) {
+ Utils.LOG_INFO("Adding Fuel using method 1");
+ return addFuel(aInput, aOutput, null, null, 10000, aFuelValueInEU);
+ }
+
+ public GregtechRecipe addFuel(ItemStack aInput, ItemStack aOutput, int aChance, int aFuelValueInEU) {
+ Utils.LOG_INFO("Adding Fuel using method 2");
+ return addFuel(aInput, aOutput, null, null, aChance, aFuelValueInEU);
+ }
+
+ public GregtechRecipe addFuel(FluidStack aFluidInput, FluidStack aFluidOutput, int aFuelValueInEU) {
+ Utils.LOG_INFO("Adding Fuel using method 3");
+ return addFuel(null, null, aFluidInput, aFluidOutput, 10000, aFuelValueInEU);
+ }
+
+ public GregtechRecipe addFuel(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aFuelValueInEU) {
+ Utils.LOG_INFO("Adding Fuel using method 4");
+ return addFuel(aInput, aOutput, aFluidInput, aFluidOutput, 10000, aFuelValueInEU);
+ }
+
+ public GregtechRecipe addFuel(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aChance, int aFuelValueInEU) {
+ Utils.LOG_INFO("Adding Fuel using method 5");
+ return addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, new int[]{aChance}, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, 0, 0, aFuelValueInEU);
+ }
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/miscutil/core/xmod/gregtech/api/util/GregtechRecipeRegistrator.java b/src/Java/miscutil/core/xmod/gregtech/api/util/GregtechRecipeRegistrator.java
new file mode 100644
index 0000000000..120cef762d
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/api/util/GregtechRecipeRegistrator.java
@@ -0,0 +1,339 @@
+package miscutil.core.xmod.gregtech.api.util;
+
+import static gregtech.api.enums.GT_Values.L;
+import static gregtech.api.enums.GT_Values.M;
+import static gregtech.api.enums.GT_Values.RA;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.SubTag;
+import gregtech.api.enums.TC_Aspects;
+import gregtech.api.enums.TC_Aspects.TC_AspectStack;
+import gregtech.api.interfaces.internal.IThaumcraftCompat;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import miscutil.core.xmod.gregtech.api.enums.GregtechOrePrefixes;
+import miscutil.core.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+import miscutil.core.xmod.gregtech.api.objects.GregtechItemData;
+import miscutil.core.xmod.gregtech.api.objects.GregtechMaterialStack;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+
+/**
+ * Class for Automatic Recipe registering.
+ */
+public class GregtechRecipeRegistrator {
+ /**
+ * List of GT_Materials, which are used in the Creation of Sticks. All Rod GT_Materials are automatically added to this List.
+ */
+ public static final List<GT_Materials> sRodMaterialList = new ArrayList<GT_Materials>();
+ private static final ItemStack sMt1 = new ItemStack(Blocks.dirt, 1, 0), sMt2 = new ItemStack(Blocks.dirt, 1, 0);
+ private static final String s_H = "h", s_F = "f", s_I = "I", s_P = "P", s_R = "R";
+ private static final ItemStack[][]
+ sShapes1 = new ItemStack[][]{
+ {sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1, null},
+ {sMt1, null, sMt1, sMt1, null, sMt1, sMt1, sMt1, sMt1},
+ {null, sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1},
+ {sMt1, sMt1, sMt1, sMt1, null, sMt1, null, null, null},
+ {sMt1, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1},
+ {sMt1, sMt1, sMt1, sMt1, null, sMt1, sMt1, null, sMt1},
+ {null, null, null, sMt1, null, sMt1, sMt1, null, sMt1},
+ {null, sMt1, null, null, sMt1, null, null, sMt2, null},
+ {sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2, null},
+ {null, sMt1, null, null, sMt2, null, null, sMt2, null},
+ {sMt1, sMt1, null, sMt1, sMt2, null, null, sMt2, null},
+ {null, sMt1, sMt1, null, sMt2, sMt1, null, sMt2, null},
+ {sMt1, sMt1, null, null, sMt2, null, null, sMt2, null},
+ {null, sMt1, sMt1, null, sMt2, null, null, sMt2, null},
+ {null, sMt1, null, sMt1, null, null, null, sMt1, sMt2},
+ {null, sMt1, null, null, null, sMt1, sMt2, sMt1, null},
+ {null, sMt1, null, sMt1, null, sMt1, null, null, sMt2},
+ {null, sMt1, null, sMt1, null, sMt1, sMt2, null, null},
+ {null, sMt2, null, null, sMt1, null, null, sMt1, null},
+ {null, sMt2, null, null, sMt2, null, sMt1, sMt1, sMt1},
+ {null, sMt2, null, null, sMt2, null, null, sMt1, null},
+ {null, sMt2, null, sMt1, sMt2, null, sMt1, sMt1, null},
+ {null, sMt2, null, null, sMt2, sMt1, null, sMt1, sMt1},
+ {null, sMt2, null, null, sMt2, null, sMt1, sMt1, null},
+ {sMt1, null, null, null, sMt2, null, null, null, sMt2},
+ {null, null, sMt1, null, sMt2, null, sMt2, null, null},
+ {sMt1, null, null, null, sMt2, null, null, null, null},
+ {null, null, sMt1, null, sMt2, null, null, null, null},
+ {sMt1, sMt2, null, null, null, null, null, null, null},
+ {sMt2, sMt1, null, null, null, null, null, null, null},
+ {sMt1, null, null, sMt2, null, null, null, null, null},
+ {sMt2, null, null, sMt1, null, null, null, null, null},
+ {sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, null, sMt2, null},
+ {sMt1, sMt1, null, sMt1, sMt1, sMt2, sMt1, sMt1, null},
+ {null, sMt1, sMt1, sMt2, sMt1, sMt1, null, sMt1, sMt1},
+ {null, sMt2, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1},
+ {sMt1, sMt1, sMt1, sMt1, sMt2, sMt1, null, sMt2, null},
+ {sMt1, sMt1, null, sMt1, sMt2, sMt2, sMt1, sMt1, null},
+ {null, sMt1, sMt1, sMt2, sMt2, sMt1, null, sMt1, sMt1},
+ {null, sMt2, null, sMt1, sMt2, sMt1, sMt1, sMt1, sMt1},
+ {sMt1, null, null, null, sMt1, null, null, null, null},
+ {null, sMt1, null, sMt1, null, null, null, null, null},
+ {sMt1, sMt1, null, sMt2, null, sMt1, sMt2, null, null},
+ {null, sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2}
+ };
+ private static final String[][] sShapesA = new String[][]{
+ null,
+ null,
+ null,
+ {"Helmet", s_P + s_P + s_P, s_P + s_H + s_P},
+ {"ChestPlate", s_P + s_H + s_P, s_P + s_P + s_P, s_P + s_P + s_P},
+ {"Pants", s_P + s_P + s_P, s_P + s_H + s_P, s_P + " " + s_P},
+ {"Boots", s_P + " " + s_P, s_P + s_H + s_P},
+ {"Sword", " " + s_P + " ", s_F + s_P + s_H, " " + s_R + " "},
+ {"Pickaxe", s_P + s_I + s_I, s_F + s_R + s_H, " " + s_R + " "},
+ {"Shovel", s_F + s_P + s_H, " " + s_R + " ", " " + s_R + " "},
+ {"Axe", s_P + s_I + s_H, s_P + s_R + " ", s_F + s_R + " "},
+ {"Axe", s_P + s_I + s_H, s_P + s_R + " ", s_F + s_R + " "},
+ {"Hoe", s_P + s_I + s_H, s_F + s_R + " ", " " + s_R + " "},
+ {"Hoe", s_P + s_I + s_H, s_F + s_R + " ", " " + s_R + " "},
+ {"Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R},
+ {"Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R},
+ {"Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R},
+ {"Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R},
+ {"Sword", " " + s_R + " ", s_F + s_P + s_H, " " + s_P + " "},
+ {"Pickaxe", " " + s_R + " ", s_F + s_R + s_H, s_P + s_I + s_I},
+ {"Shovel", " " + s_R + " ", " " + s_R + " ", s_F + s_P + s_H},
+ {"Axe", s_F + s_R + " ", s_P + s_R + " ", s_P + s_I + s_H},
+ {"Axe", s_F + s_R + " ", s_P + s_R + " ", s_P + s_I + s_H},
+ {"Hoe", " " + s_R + " ", s_F + s_R + " ", s_P + s_I + s_H},
+ {"Hoe", " " + s_R + " ", s_F + s_R + " ", s_P + s_I + s_H},
+ {"Spear", s_P + s_H + " ", s_F + s_R + " ", " " + " " + s_R},
+ {"Spear", s_P + s_H + " ", s_F + s_R + " ", " " + " " + s_R},
+ {"Knive", s_H + s_P, s_R + s_F},
+ {"Knive", s_F + s_H, s_P + s_R},
+ {"Knive", s_F + s_H, s_P + s_R},
+ {"Knive", s_P + s_F, s_R + s_H},
+ {"Knive", s_P + s_F, s_R + s_H},
+ null,
+ null,
+ null,
+ null,
+ {"WarAxe", s_P + s_P + s_P, s_P + s_R + s_P, s_F + s_R + s_H},
+ null,
+ null,
+ null,
+ {"Shears", s_H + s_P, s_P + s_F},
+ {"Shears", s_H + s_P, s_P + s_F},
+ {"Scythe", s_I + s_P + s_H, s_R + s_F + s_P, s_R + " " + " "},
+ {"Scythe", s_H + s_P + s_I, s_P + s_F + s_R, " " + " " + s_R}
+ };
+ public static volatile int VERSION = 508;
+
+ public static void registerMaterialRecycling(ItemStack aStack, GT_Materials aMaterial, long aMaterialAmount, GregtechMaterialStack aByproduct) {
+ if (GT_Utility.isStackInvalid(aStack)) return;
+ if (aByproduct != null) {
+ aByproduct = aByproduct.clone();
+ aByproduct.mAmount /= aStack.stackSize;
+ }
+ GregtechOreDictUnificator.addItemData(GT_Utility.copyAmount(1, aStack), new GregtechItemData(aMaterial, aMaterialAmount / aStack.stackSize, aByproduct));
+ }
+
+ public static void registerMaterialRecycling(ItemStack aStack, GregtechItemData aData) {
+ if (GT_Utility.isStackInvalid(aStack) || GT_Utility.areStacksEqual(new ItemStack(Items.blaze_rod), aStack) || aData == null || !aData.hasValidMaterialData() || aData.mMaterial.mAmount <= 0 || GT_Utility.getFluidForFilledItem(aStack, false) != null)
+ return;
+ registerReverseMacerating(GT_Utility.copyAmount(1, aStack), aData, aData.mPrefix == null);
+ registerReverseSmelting(GT_Utility.copyAmount(1, aStack), aData.mMaterial.mMaterial, aData.mMaterial.mAmount, true);
+ registerReverseFluidSmelting(GT_Utility.copyAmount(1, aStack), aData.mMaterial.mMaterial, aData.mMaterial.mAmount, aData.getByProduct(0));
+ registerReverseArcSmelting(GT_Utility.copyAmount(1, aStack), aData);
+ }
+
+ /**
+ * @param aStack the stack to be recycled.
+ * @param aMaterial the Material.
+ * @param aMaterialAmount the amount of it in Material Units.
+ */
+ public static void registerReverseFluidSmelting(ItemStack aStack, GT_Materials aMaterial, long aMaterialAmount, GregtechMaterialStack aByproduct) {
+ if (aStack == null || aMaterial == null || aMaterial.mSmeltInto.mStandardMoltenFluid == null || !aMaterial.contains(SubTag.SMELTING_TO_FLUID) || (L * aMaterialAmount) / (M * aStack.stackSize) <= 0)
+ return;
+ RA.addFluidSmelterRecipe(GT_Utility.copyAmount(1, aStack), aByproduct == null ? null : aByproduct.mMaterial.contains(SubTag.NO_SMELTING) || !aByproduct.mMaterial.contains(SubTag.METAL) ? aByproduct.mMaterial.contains(SubTag.FLAMMABLE) ? GregtechOreDictUnificator.getDust(GT_Materials._NULL, aByproduct.mAmount / 2) : aByproduct.mMaterial.contains(SubTag.UNBURNABLE) ? GregtechOreDictUnificator.getDustOrIngot(aByproduct.mMaterial.mSmeltInto, aByproduct.mAmount) : null : GregtechOreDictUnificator.getIngotOrDust(aByproduct.mMaterial.mSmeltInto, aByproduct.mAmount), aMaterial.mSmeltInto.getMolten((L * aMaterialAmount) / (M * aStack.stackSize)), 10000, (int) Math.max(1, (24 * aMaterialAmount) / M), Math.max(8, (int) Math.sqrt(2 * aMaterial.mSmeltInto.mStandardMoltenFluid.getTemperature())));
+ }
+
+ /**
+ * @param aStack the stack to be recycled.
+ * @param aMaterial the Material.
+ * @param aMaterialAmount the amount of it in Material Units.
+ * @param aAllowAlloySmelter if it is allowed to be recycled inside the Alloy Smelter.
+ */
+ public static void registerReverseSmelting(ItemStack aStack, GT_Materials aMaterial, long aMaterialAmount, boolean aAllowAlloySmelter) {
+ if (aStack == null || aMaterial == null || aMaterialAmount <= 0 || aMaterial.contains(SubTag.NO_SMELTING) || (aMaterialAmount > M && aMaterial.contains(SubTag.METAL)))
+ return;
+ aMaterialAmount /= aStack.stackSize;
+
+ if (aAllowAlloySmelter)
+ GT_ModHandler.addSmeltingAndAlloySmeltingRecipe(GT_Utility.copyAmount(1, aStack), GregtechOreDictUnificator.getIngot(aMaterial.mSmeltInto, aMaterialAmount));
+ else
+ GT_ModHandler.addSmeltingRecipe(GT_Utility.copyAmount(1, aStack), GregtechOreDictUnificator.getIngot(aMaterial.mSmeltInto, aMaterialAmount));
+ }
+
+ public static void registerReverseArcSmelting(ItemStack aStack, GT_Materials aMaterial, long aMaterialAmount, GregtechMaterialStack aByProduct01, GregtechMaterialStack aByProduct02, GregtechMaterialStack aByProduct03) {
+ registerReverseArcSmelting(aStack, new GregtechItemData(aMaterial == null ? null : new GregtechMaterialStack(aMaterial, aMaterialAmount), aByProduct01, aByProduct02, aByProduct03));
+ }
+
+ public static void registerReverseArcSmelting(ItemStack aStack, GregtechItemData aData) {
+ if (aStack == null || aData == null) return;
+ aData = new GregtechItemData(aData);
+
+ if (!aData.hasValidMaterialData()) return;
+
+ for (GregtechMaterialStack tMaterial : aData.getAllGT_MaterialStacks()) {
+ if (tMaterial.mMaterial.contains(SubTag.UNBURNABLE)) {
+ tMaterial.mMaterial = tMaterial.mMaterial.mSmeltInto.mArcSmeltInto;
+ continue;
+ }
+ if (tMaterial.mMaterial.contains(SubTag.EXPLOSIVE)) {
+ tMaterial.mAmount /= 4;
+ continue;
+ }
+ if (tMaterial.mMaterial.contains(SubTag.FLAMMABLE)) {
+ tMaterial.mAmount /= 2;
+ continue;
+ }
+ if (tMaterial.mMaterial.contains(SubTag.NO_SMELTING)) {
+ tMaterial.mAmount = 0;
+ continue;
+ }
+ if (tMaterial.mMaterial.contains(SubTag.METAL)) {
+ tMaterial.mMaterial = tMaterial.mMaterial.mSmeltInto.mArcSmeltInto;
+ continue;
+ }
+ tMaterial.mAmount = 0;
+ }
+
+ aData = new GregtechItemData(aData);
+
+ if (aData.mByProducts.length > 3) for (GregtechMaterialStack tMaterial : aData.getAllGT_MaterialStacks())
+
+ aData = new GregtechItemData(aData);
+
+ if (!aData.hasValidMaterialData()) return;
+
+ long tAmount = 0;
+ for (GregtechMaterialStack tMaterial : aData.getAllGT_MaterialStacks())
+ tAmount += tMaterial.mAmount * tMaterial.mMaterial.getMass();
+
+ RA.addArcFurnaceRecipe(aStack, new ItemStack[]{GregtechOreDictUnificator.getIngotOrDust(aData.mMaterial), GregtechOreDictUnificator.getIngotOrDust(aData.getByProduct(0)), GregtechOreDictUnificator.getIngotOrDust(aData.getByProduct(1)), GregtechOreDictUnificator.getIngotOrDust(aData.getByProduct(2))}, null, (int) Math.max(16, tAmount / M), 96);
+ }
+
+ public static void registerReverseMacerating(ItemStack aStack, GT_Materials aMaterial, long aMaterialAmount, GregtechMaterialStack aByProduct01, GregtechMaterialStack aByProduct02, GregtechMaterialStack aByProduct03, boolean aAllowHammer) {
+ registerReverseMacerating(aStack, new GregtechItemData(aMaterial == null ? null : new GregtechMaterialStack(aMaterial, aMaterialAmount), aByProduct01, aByProduct02, aByProduct03), aAllowHammer);
+ }
+
+ public static void registerReverseMacerating(ItemStack aStack, GregtechItemData aData, boolean aAllowHammer) {
+ if (aStack == null || aData == null) return;
+ aData = new GregtechItemData(aData);
+
+ if (!aData.hasValidMaterialData()) return;
+
+ for (GregtechMaterialStack tMaterial : aData.getAllGT_MaterialStacks())
+ tMaterial.mMaterial = tMaterial.mMaterial.mMacerateInto;
+
+ aData = new GregtechItemData(aData);
+
+ if (!aData.hasValidMaterialData()) return;
+
+ long tAmount = 0;
+ for (GregtechMaterialStack tMaterial : aData.getAllGT_MaterialStacks())
+ tAmount += tMaterial.mAmount * tMaterial.mMaterial.getMass();
+
+ RA.addPulveriserRecipe(aStack, new ItemStack[]{GregtechOreDictUnificator.getDust(aData.mMaterial), GregtechOreDictUnificator.getDust(aData.getByProduct(0)), GregtechOreDictUnificator.getDust(aData.getByProduct(1)), GregtechOreDictUnificator.getDust(aData.getByProduct(2))}, null, (int) Math.max(16, tAmount / M), 4);
+
+ if (aAllowHammer) for (GregtechMaterialStack tMaterial : aData.getAllGT_MaterialStacks())
+ if (tMaterial.mMaterial.contains(SubTag.CRYSTAL) && !tMaterial.mMaterial.contains(SubTag.METAL)) {
+ if (RA.addForgeHammerRecipe(GT_Utility.copyAmount(1, aStack), GregtechOreDictUnificator.getDust(aData.mMaterial), 200, 32))
+ break;
+ }
+ ItemStack tDust = GregtechOreDictUnificator.getDust(aData.mMaterial);
+ if (tDust != null && GT_ModHandler.addPulverisationRecipe(GT_Utility.copyAmount(1, aStack), tDust, GregtechOreDictUnificator.getDust(aData.getByProduct(0)), 100, GregtechOreDictUnificator.getDust(aData.getByProduct(1)), 100, true)) {
+ if (GregTech_API.sThaumcraftCompat != null)
+ GregTech_API.sThaumcraftCompat.addCrucibleRecipe(IThaumcraftCompat.ADVANCEDENTROPICPROCESSING, aStack, tDust, Arrays.asList(new TC_AspectStack(TC_Aspects.PERDITIO, Math.max(1, (aData.mMaterial.mAmount * 2) / M))));
+ }
+ }
+
+ /**
+ * You give this Function a Material and it will scan almost everything for adding recycling Recipes
+ *
+ * @param aMat a Material, for example an Ingot or a Gem.
+ * @param aOutput the Dust you usually get from macerating aMat
+ * @param aRecipeReplacing allows to replace the Recipe with a Plate variant
+ */
+ public static synchronized void registerUsagesForGT_Materials(ItemStack aMat, String aPlate, boolean aRecipeReplacing) {
+ if (aMat == null) return;
+ aMat = GT_Utility.copy(aMat);
+ ItemStack tStack;
+ GregtechItemData aItemData = GregtechOreDictUnificator.getItemData(aMat);
+ if (aItemData == null || aItemData.mPrefix != GregtechOrePrefixes.ingot) aPlate = null;
+ if (aPlate != null && GregtechOreDictUnificator.getFirstOre(aPlate, 1) == null) aPlate = null;
+
+ sMt1.func_150996_a(aMat.getItem());
+ sMt1.stackSize = 1;
+ Items.feather.setDamage(sMt1, Items.feather.getDamage(aMat));
+
+ sMt2.func_150996_a(new ItemStack(Blocks.dirt).getItem());
+ sMt2.stackSize = 1;
+ Items.feather.setDamage(sMt2, 0);
+
+ for (ItemStack[] tRecipe : sShapes1) {
+ int tAmount1 = 0;
+ for (ItemStack tMat : tRecipe) {
+ if (tMat == sMt1) tAmount1++;
+ }
+ if (aItemData != null && aItemData.hasValidPrefixMaterialData())
+ for (ItemStack tCrafted : GT_ModHandler.getRecipeOutputs(tRecipe)) {
+ GregtechOreDictUnificator.addItemData(tCrafted, new GregtechItemData(aItemData.mMaterial.mMaterial, aItemData.mMaterial.mAmount * tAmount1));
+ }
+ }
+
+ for (GT_Materials tMaterial : sRodMaterialList) {
+ ItemStack tMt2 = GregtechOreDictUnificator.get(GregtechOrePrefixes.stick, tMaterial, 1);
+ if (tMt2 != null) {
+ sMt2.func_150996_a(tMt2.getItem());
+ sMt2.stackSize = 1;
+ Items.feather.setDamage(sMt2, Items.feather.getDamage(tMt2));
+
+ for (int i = 0; i < sShapes1.length; i++) {
+ ItemStack[] tRecipe = sShapes1[i];
+
+ int tAmount1 = 0, tAmount2 = 0;
+ for (ItemStack tMat : tRecipe) {
+ if (tMat == sMt1) tAmount1++;
+ if (tMat == sMt2) tAmount2++;
+ }
+ for (ItemStack tCrafted : GT_ModHandler.getVanillyToolRecipeOutputs(tRecipe)) {
+ if (aItemData != null && aItemData.hasValidPrefixMaterialData())
+ GregtechOreDictUnificator.addItemData(tCrafted, new GregtechItemData(aItemData.mMaterial.mMaterial, aItemData.mMaterial.mAmount * tAmount1, new GregtechMaterialStack(tMaterial, OrePrefixes.stick.mMaterialAmount * tAmount2)));
+
+ if (aRecipeReplacing && aPlate != null && sShapesA[i] != null && sShapesA[i].length > 1) {
+ assert aItemData != null;
+ if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.recipereplacements, aItemData.mMaterial.mMaterial + "." + sShapesA[i][0], true)) {
+ if (null != (tStack = GT_ModHandler.removeRecipe(tRecipe))) {
+ switch (sShapesA[i].length) {
+ case 2:
+ GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[]{sShapesA[i][1], s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData});
+ break;
+ case 3:
+ GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[]{sShapesA[i][1], sShapesA[i][2], s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData});
+ break;
+ default:
+ GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[]{sShapesA[i][1], sShapesA[i][2], sShapesA[i][3], s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData});
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/common/GregtechRecipeAdder.java b/src/Java/miscutil/core/xmod/gregtech/common/GregtechRecipeAdder.java
new file mode 100644
index 0000000000..076915b633
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/common/GregtechRecipeAdder.java
@@ -0,0 +1,119 @@
+package miscutil.core.xmod.gregtech.common;
+
+import gregtech.api.GregTech_API;
+import miscutil.core.util.Utils;
+import miscutil.core.xmod.gregtech.api.interfaces.internal.IGregtech_RecipeAdder;
+import miscutil.core.xmod.gregtech.api.util.GregtechRecipe;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+
+public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
+
+ @SuppressWarnings("static-method")
+ private void debug1(){
+ Utils.LOG_WARNING("==================================================================================");
+ Utils.LOG_WARNING("==================================================================================");
+ Utils.LOG_WARNING("==================================================================================");
+ Utils.LOG_WARNING("Walking Through CokeOven Recipe Creation.");
+ Utils.LOG_WARNING("My name is Ralph and I will be your humble host.");
+ }
+ @SuppressWarnings("static-method")
+ private void debug2(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt){
+ Utils.LOG_WARNING("==================================================================================");
+ Utils.LOG_WARNING("Taking a step forward.");
+ Utils.LOG_WARNING("aInput1 == null && aFluidInput == null || aOutput == null && aFluidOutput == null");
+ Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
+ Utils.LOG_WARNING("Passed.");
+ }
+ @SuppressWarnings("static-method")
+ private void debug3(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt){
+ Utils.LOG_WARNING("==================================================================================");
+ Utils.LOG_WARNING("Taking a step forward.");
+ Utils.LOG_WARNING("(aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aOutput, aDuration)) <= 0)");
+ Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
+ Utils.LOG_WARNING("Passed.");
+ }
+ @SuppressWarnings("static-method")
+ private void debug4(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt){
+ Utils.LOG_WARNING("==================================================================================");
+ Utils.LOG_WARNING("Taking a step forward.");
+ Utils.LOG_WARNING("(aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aFluidOutput.getFluid().getName(), aDuration)) <= 0)");
+ Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
+ Utils.LOG_WARNING("Passed.");
+ Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
+
+ }
+ @SuppressWarnings("static-method")
+ private void debug5(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt){
+ Utils.LOG_INFO("Successfully added a Coke Oven recipe for: "+aOutput.getDisplayName()+" & "+aFluidOutput.getFluid().getName()+", Using "+aInput1.getDisplayName()+" & "+aInput2.getDisplayName()+" & liquid "+aFluidInput.getFluid().getName()+". This takes "+(aDuration/20)+" seconds for "+aEUt+"eu/t.");
+ Utils.LOG_WARNING("==================================================================================");
+ Utils.LOG_WARNING("==================================================================================");
+ Utils.LOG_WARNING("==================================================================================");
+ }
+
+ @Override
+ public boolean addCokeOvenRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt) {
+ try {
+ try {
+ debug1();
+ if (((aInput1 == null) /*&& (aFluidInput == null)*/) || ((aOutput == null) || (aFluidOutput == null))) {
+ Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
+ Utils.LOG_WARNING("Something was null, returning false");
+ return false;
+ }
+
+ } catch (NullPointerException e){e.getStackTrace();}
+ try {
+ debug2(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aDuration, aEUt);
+ if ((aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("cokeoven", aOutput, aDuration)) <= 0)) {
+ Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
+ Utils.LOG_WARNING("Something was null, returning false");
+ return false;
+ }
+
+ } catch (NullPointerException e){e.getStackTrace();}
+ try {
+
+ debug3(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aDuration, aEUt);
+ if ((aFluidOutput == null) && ((aDuration = GregTech_API.sRecipeFile.get("cokeoven", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) {
+ Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
+ Utils.LOG_WARNING("Something was null, returning false");
+ return false;
+ }
+
+ } catch (NullPointerException e){e.getStackTrace();}
+ try {
+ debug4(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aDuration, aEUt);
+ if (aFluidInput == null){
+ GregtechRecipe.Gregtech_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput}, null, null, null, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
+ }
+ else {
+ GregtechRecipe.Gregtech_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
+ }
+ debug5(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aDuration, aEUt);
+
+ return true;
+
+ } catch (NullPointerException e){
+ return false;
+ }
+ } catch (Throwable e){
+ Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
+ Utils.LOG_WARNING("Failed.");
+ e.getStackTrace();
+ return false;
+ }
+ }
+
+ @Override
+ public boolean addFuel(ItemStack aInput1, ItemStack aOutput1, int aEU, int aType) {
+ if (aInput1 == null) {
+ Utils.LOG_INFO("Fuel Input is Invalid.");
+ return false;
+ }
+ new GregtechRecipe(aInput1, aOutput1, GregTech_API.sRecipeFile.get("fuel_" + aType, aInput1, aEU), aType);
+ return true;
+ }
+
+
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/common/Meta_GT_Proxy.java b/src/Java/miscutil/core/xmod/gregtech/common/Meta_GT_Proxy.java
new file mode 100644
index 0000000000..99aaec4e33
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/common/Meta_GT_Proxy.java
@@ -0,0 +1,386 @@
+package miscutil.core.xmod.gregtech.common;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_Log;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+
+import miscutil.core.lib.CORE;
+import miscutil.core.xmod.gregtech.api.enums.GregtechOrePrefixes;
+import miscutil.core.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+import miscutil.core.xmod.gregtech.api.objects.GregtechFluid;
+import miscutil.core.xmod.gregtech.api.util.GregtechOreDictUnificator;
+import miscutil.core.xmod.gregtech.api.util.GregtechRecipeRegistrator;
+import miscutil.core.xmod.gregtech.common.items.MetaGeneratedGregtechItems;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemBlock;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidContainerRegistry;
+import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.oredict.OreDictionary;
+import cpw.mods.fml.common.Loader;
+import cpw.mods.fml.common.ModContainer;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+
+public class Meta_GT_Proxy {
+
+ //Silly Vars
+ private static final Collection<String> mIgnoredItems = new HashSet(Arrays.asList(new String[]{"itemGhastTear", "itemFlint", "itemClay", "itemBucketSaltWater",
+ "itemBucketFreshWater", "itemBucketWater", "itemRock", "itemReed", "itemArrow", "itemSaw", "itemKnife", "itemHammer", "itemChisel", "itemRubber",
+ "itemEssence", "itemIlluminatedPanel", "itemSkull", "itemRawRubber", "itemBacon", "itemJetpackAccelerator", "itemLazurite", "itemIridium",
+ "itemTear", "itemClaw", "itemFertilizer", "itemTar", "itemSlimeball", "itemCoke", "itemBeeswax", "itemBeeQueen", "itemForcicium", "itemForcillium",
+ "itemRoyalJelly", "itemHoneydew", "itemHoney", "itemPollen", "itemReedTypha", "itemSulfuricAcid", "itemPotash", "itemCompressedCarbon",
+ "itemBitumen", "itemBioFuel", "itemCokeSugar", "itemCokeCactus", "itemCharcoalSugar", "itemCharcoalCactus", "itemSludge", "itemEnrichedAlloy",
+ "itemQuicksilver", "itemMercury", "itemOsmium", "itemUltimateCircuit", "itemEnergizedStar", "itemAntimatterMolecule", "itemAntimatterGlob",
+ "itemCoal", "itemBoat", "itemHerbalMedicineCake", "itemCakeSponge", "itemFishandPumpkinCakeSponge", "itemSoulCleaver", "itemInstantCake",
+ "itemWhippingCream", "itemGlisteningWhippingCream", "itemCleaver", "itemHerbalMedicineWhippingCream", "itemStrangeWhippingCream",
+ "itemBlazeCleaver", "itemBakedCakeSponge", "itemMagmaCake", "itemGlisteningCake", "itemOgreCleaver", "itemFishandPumpkinCake",
+ "itemMagmaWhippingCream", "itemMultimeter", "itemSuperconductor"}));
+ private static final Collection<String> mIgnoredNames = new HashSet(Arrays.asList(new String[]{"grubBee", "chainLink", "candyCane", "bRedString", "bVial",
+ "bFlask", "anorthositeSmooth", "migmatiteSmooth", "slateSmooth", "travertineSmooth", "limestoneSmooth", "orthogneissSmooth", "marbleSmooth",
+ "honeyDrop", "lumpClay", "honeyEqualssugar", "flourEqualswheat", "bluestoneInsulated", "blockWaterstone", "blockSand", "blockTorch",
+ "blockPumpkin", "blockClothRock", "blockStainedHardenedClay", "blockQuartzPillar", "blockQuartzChiselled", "blockSpawner", "blockCloth", "mobHead",
+ "mobEgg", "enderFlower", "enderChest", "clayHardened", "dayGemMaterial", "nightGemMaterial", "snowLayer", "bPlaceholder", "hardenedClay",
+ "eternalLifeEssence", "sandstone", "wheatRice", "transdimBlock", "bambooBasket", "lexicaBotania", "livingwoodTwig", "redstoneCrystal",
+ "pestleAndMortar", "glowstone", "whiteStone", "stoneSlab", "transdimBlock", "clayBowl", "clayPlate", "ceramicBowl", "ceramicPlate", "ovenRack",
+ "clayCup", "ceramicCup", "batteryBox", "transmutationStone", "torchRedstoneActive", "coal", "charcoal", "cloth", "cobblestoneSlab",
+ "stoneBrickSlab", "cobblestoneWall", "stoneBrickWall", "cobblestoneStair", "stoneBrickStair", "blockCloud", "blockDirt", "blockTyrian",
+ "blockCarpet", "blockFft", "blockLavastone", "blockHolystone", "blockConcrete", "sunnariumPart", "brSmallMachineCyaniteProcessor", "meteoriteCoal",
+ "blockCobble", "pressOreProcessor", "crusherOreProcessor", "grinderOreProcessor", "blockRubber", "blockHoney", "blockHoneydew", "blockPeat",
+ "blockRadioactive", "blockSlime", "blockCocoa", "blockSugarCane", "blockLeather", "blockClayBrick", "solarPanelHV", "cableRedNet", "stoneBowl",
+ "crafterWood", "taintedSoil", "brickXyEngineering", "breederUranium", "wireMill", "chunkLazurite", "aluminumNatural", "aluminiumNatural",
+ "naturalAluminum", "naturalAluminium", "antimatterMilligram", "antimatterGram", "strangeMatter", "coalGenerator", "electricFurnace",
+ "unfinishedTank", "valvePart", "aquaRegia", "leatherSeal", "leatherSlimeSeal", "hambone", "slimeball", "clay", "enrichedUranium", "camoPaste",
+ "antiBlock", "burntQuartz", "salmonRaw", "blockHopper", "blockEnderObsidian", "blockIcestone", "blockMagicWood", "blockEnderCore", "blockHeeEndium",
+ "oreHeeEndPowder", "oreHeeStardust", "oreHeeIgneousRock", "oreHeeInstabilityOrb", "crystalPureFluix", "shardNether", "gemFluorite",
+ "stickObsidian", "caveCrystal", "shardCrystal", "dyeCrystal","shardFire","shardWater","shardAir","shardEarth","ingotRefinedIron","blockMarble","ingotUnstable"}));
+ private static final Collection<String> mInvalidNames = new HashSet(Arrays.asList(new String[]{"diamondShard", "redstoneRoot", "obsidianStick", "bloodstoneOre",
+ "universalCable", "bronzeTube", "ironTube", "netherTube", "obbyTube", "infiniteBattery", "eliteBattery", "advancedBattery", "10kEUStore",
+ "blueDye", "MonazitOre", "quartzCrystal", "whiteLuminiteCrystal", "darkStoneIngot", "invisiumIngot", "demoniteOrb", "enderGem", "starconiumGem",
+ "osmoniumIngot", "tapaziteGem", "zectiumIngot", "foolsRubyGem", "rubyGem", "meteoriteGem", "adamiteShard", "sapphireGem", "copperIngot",
+ "ironStick", "goldStick", "diamondStick", "reinforcedStick", "draconicStick", "emeraldStick", "copperStick", "tinStick", "silverStick",
+ "bronzeStick", "steelStick", "leadStick", "manyullynStick", "arditeStick", "cobaltStick", "aluminiumStick", "alumiteStick", "oilsandsOre",
+ "copperWire", "superconductorWire", "sulfuricAcid", "conveyorBelt", "ironWire", "aluminumWire", "aluminiumWire", "silverWire", "tinWire",
+ "dustSiliconSmall", "AluminumOre", "plateHeavyT2", "blockWool", "alloyPlateEnergizedHardened", "gasWood", "alloyPlateEnergized", "SilverOre",
+ "LeadOre", "TinOre", "CopperOre", "silverOre", "leadOre", "tinOre", "copperOre", "bauxiteOre", "HSLivingmetalIngot", "oilMoving", "oilStill",
+ "oilBucket", "petroleumOre", "dieselFuel", "diamondNugget", "planks", "wood", "stick", "sticks", "naquadah", "obsidianRod", "stoneRod",
+ "thaumiumRod", "steelRod", "netherrackRod", "woodRod", "ironRod", "cactusRod", "flintRod", "copperRod", "cobaltRod", "alumiteRod", "blueslimeRod",
+ "arditeRod", "manyullynRod", "bronzeRod", "boneRod", "slimeRod", "redalloyBundled", "bluestoneBundled", "infusedteslatiteInsulated",
+ "redalloyInsulated", "infusedteslatiteBundled"}));
+ public static boolean mOreDictActivated = false;
+ public static boolean mSortToTheEnd = true;
+ public final static HashSet<ItemStack> mRegisteredOres = new HashSet(10000);
+ public final static Collection<GregtechOreDictEventContainer> mEvents = new HashSet();
+
+ public static Fluid addFluid(String aName, String aLocalized, GT_Materials aMaterial, int aState, int aTemperatureK) {
+ return addFluid(aName, aLocalized, aMaterial, aState, aTemperatureK, null, null, 0);
+ }
+
+ public static Fluid addFluid(String aName, String aLocalized, GT_Materials aMaterial, int aState, int aTemperatureK, ItemStack aFullContainer,
+ ItemStack aEmptyContainer, int aFluidAmount) {
+ return addFluid(aName, aName.toLowerCase(), aLocalized, aMaterial, null, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount);
+ }
+
+ public static Fluid addFluid(String aName, String aTexture, String aLocalized, GT_Materials aMaterial, short[] aRGBa, int aState, int aTemperatureK,
+ ItemStack aFullContainer, ItemStack aEmptyContainer, int aFluidAmount) {
+ aName = aName.toLowerCase();
+ Fluid rFluid = new GregtechFluid(aName, aTexture, aRGBa != null ? aRGBa : Dyes._NULL.getRGBA());
+ GT_LanguageManager.addStringLocalization(rFluid.getUnlocalizedName(), aLocalized == null ? aName : aLocalized);
+ if (FluidRegistry.registerFluid(rFluid)) {
+ switch (aState) {
+ case 0:
+ rFluid.setGaseous(false);
+ rFluid.setViscosity(10000);
+ break;
+ case 1:
+ case 4:
+ rFluid.setGaseous(false);
+ rFluid.setViscosity(1000);
+ break;
+ case 2:
+ rFluid.setGaseous(true);
+ rFluid.setDensity(-100);
+ rFluid.setViscosity(200);
+ break;
+ case 3:
+ rFluid.setGaseous(true);
+ rFluid.setDensity(55536);
+ rFluid.setViscosity(10);
+ rFluid.setLuminosity(15);
+ }
+ } else {
+ rFluid = FluidRegistry.getFluid(aName);
+ }
+ if (rFluid.getTemperature() == new Fluid("test").getTemperature()) {
+ rFluid.setTemperature(aTemperatureK);
+ }
+ if (aMaterial != null) {
+ switch (aState) {
+ case 0:
+ aMaterial.mSolid = rFluid;
+ break;
+ case 1:
+ aMaterial.mFluid = rFluid;
+ break;
+ case 2:
+ aMaterial.mGas = rFluid;
+ break;
+ case 3:
+ aMaterial.mPlasma = rFluid;
+ break;
+ case 4:
+ aMaterial.mStandardMoltenFluid = rFluid;
+ }
+ }
+ if ((aFullContainer != null) && (aEmptyContainer != null)
+ && (!FluidContainerRegistry.registerFluidContainer(new FluidStack(rFluid, aFluidAmount), aFullContainer, aEmptyContainer))) {
+ GT_Values.RA.addFluidCannerRecipe(aFullContainer, GT_Utility.getContainerItem(aFullContainer, false), null, new FluidStack(rFluid, aFluidAmount));
+ }
+ return rFluid;
+ }
+
+ @SubscribeEvent
+ public static void registerOre(OreDictionary.OreRegisterEvent aEvent) {
+ ModContainer tContainer = Loader.instance().activeModContainer();
+ String aMod = tContainer == null ? "UNKNOWN" : tContainer.getModId();
+ String aOriginalMod = aMod;
+ if (GregtechOreDictUnificator.isRegisteringOres()) {
+ aMod = CORE.MODID;
+ } else if (aMod.equals(CORE.MODID)) {
+ aMod = "UNKNOWN";
+ }
+ if ((aEvent == null) || (aEvent.Ore == null) || (aEvent.Ore.getItem() == null) || (aEvent.Name == null) || (aEvent.Name.isEmpty())
+ || (aEvent.Name.replaceAll("_", "").length() - aEvent.Name.length() == 9)) {
+ if (aOriginalMod.equals(CORE.MODID)) {
+ aOriginalMod = "UNKNOWN";
+ }
+ GT_Log.ore
+ .println(aOriginalMod
+ + " did something very bad! The registration is too invalid to even be shown properly. This happens only if you register null, invalid Items, empty Strings or even nonexisting Events to the OreDict.");
+ throw new IllegalArgumentException(
+ aOriginalMod
+ + " did something very bad! The registration is too invalid to even be shown properly. This happens only if you register null, invalid Items, empty Strings or even nonexisting Events to the OreDict.");
+ }
+ try {
+ aEvent.Ore.stackSize = 1;
+
+ String tModToName = aMod + " -> " + aEvent.Name;
+ if ((mOreDictActivated) || (GregTech_API.sPostloadStarted) || ((mSortToTheEnd) && (GregTech_API.sLoadFinished))) {
+ tModToName = aOriginalMod + " --Late--> " + aEvent.Name;
+ }
+ if (((aEvent.Ore.getItem() instanceof ItemBlock)) || (GT_Utility.getBlockFromStack(aEvent.Ore) != Blocks.air)) {
+ GregtechOreDictUnificator.addToBlacklist(aEvent.Ore);
+ }
+ mRegisteredOres.add(aEvent.Ore);
+ if (mIgnoredNames.contains(aEvent.Name)) {
+ GT_Log.ore.println(tModToName + " is getting ignored via hardcode.");
+ return;
+ }
+ if ((aEvent.Name.contains("|")) || (aEvent.Name.contains("*")) || (aEvent.Name.contains(":")) || (aEvent.Name.contains("."))
+ || (aEvent.Name.contains("$"))) {
+ GT_Log.ore.println(tModToName + " is using a private Prefix and is therefor getting ignored properly.");
+ return;
+ }
+ if (aEvent.Name.contains(" ")) {
+ GT_Log.ore.println(tModToName + " is getting re-registered because the OreDict Name containing invalid spaces.");
+ GregtechOreDictUnificator.registerOre(aEvent.Name.replaceAll(" ", ""), GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
+ aEvent.Ore.setStackDisplayName("Invalid OreDictionary Tag");
+ return;
+ }
+ if (mInvalidNames.contains(aEvent.Name)) {
+ GT_Log.ore.println(tModToName + " is wrongly registered and therefor getting ignored.");
+
+ return;
+ }
+ GregtechOrePrefixes aPrefix = GregtechOrePrefixes.getOrePrefix(aEvent.Name);
+ GT_Materials aMaterial = GT_Materials._NULL;
+ if (aPrefix == null) {
+ if (aEvent.Name.toLowerCase().equals(aEvent.Name)) {
+ GT_Log.ore.println(tModToName + " is invalid due to being solely lowercased.");
+ return;
+ }
+ if (aEvent.Name.toUpperCase().equals(aEvent.Name)) {
+ GT_Log.ore.println(tModToName + " is invalid due to being solely uppercased.");
+ return;
+ }
+ if (Character.isUpperCase(aEvent.Name.charAt(0))) {
+ GT_Log.ore.println(tModToName + " is invalid due to the first character being uppercased.");
+ }
+ } else {
+ if (aPrefix.mDontUnificateActively) {
+ GregtechOreDictUnificator.addToBlacklist(aEvent.Ore);
+ }
+ if (aPrefix != aPrefix.mPrefixInto) {
+ String tNewName = aEvent.Name.replaceFirst(aPrefix.toString(), aPrefix.mPrefixInto.toString());
+ if (!GregtechOreDictUnificator.isRegisteringOres()) {
+ GT_Log.ore.println(tModToName + " uses a depricated Prefix, and is getting re-registered as " + tNewName);
+ }
+ GregtechOreDictUnificator.registerOre(tNewName, aEvent.Ore);
+ return;
+ }
+ String tName = aEvent.Name.replaceFirst(aPrefix.toString(), "");
+ if (tName.length() > 0) {
+ char firstChar = tName.charAt(0);
+ if (Character.isUpperCase(firstChar) || Character.isLowerCase(firstChar) || firstChar == '_') {
+ if (aPrefix.mIsMaterialBased) {
+ aMaterial = GT_Materials.get(tName);
+ if (aMaterial != aMaterial.mMaterialInto) {
+ GregtechOreDictUnificator.registerOre(aPrefix, aMaterial.mMaterialInto, aEvent.Ore);
+ if (!GregtechOreDictUnificator.isRegisteringOres()) {
+ GT_Log.ore.println(tModToName + " uses a deprecated Material and is getting re-registered as "
+ + aPrefix.get(aMaterial.mMaterialInto));
+ }
+ return;
+ }
+ if (!aPrefix.isIgnored(aMaterial)) {
+ aPrefix.add(GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
+ }
+ if (aMaterial != GT_Materials._NULL) {
+ GT_Materials tReRegisteredMaterial;
+ for (Iterator i$ = aMaterial.mOreReRegistrations.iterator(); i$.hasNext(); GregtechOreDictUnificator.registerOre(aPrefix,
+ tReRegisteredMaterial, aEvent.Ore)) {
+ tReRegisteredMaterial = (GT_Materials) i$.next();
+ }
+ aMaterial.add(GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
+ switch (aPrefix) {
+ case gem:
+ break;
+ case plate:
+ break;
+ case stick:
+ if (!GregtechRecipeRegistrator.sRodMaterialList.contains(aMaterial)) {
+ GregtechRecipeRegistrator.sRodMaterialList.add(aMaterial);
+ }
+ break;
+ case dust:
+ break;
+ case ingot:
+ break;
+ }
+ if (aPrefix.mIsUnificatable && !aMaterial.mUnificatable) {
+ return;
+ }
+ } else {
+ for (Dyes tDye : Dyes.VALUES) {
+ if (aEvent.Name.endsWith(tDye.name().replaceFirst("dye", ""))) {
+ GregtechOreDictUnificator.addToBlacklist(aEvent.Ore);
+ GT_Log.ore.println(tModToName + " Oh man, why the fuck would anyone need a OreDictified Color for this, that is even too much for GregTech... do not report this, this is just a random Comment about how ridiculous this is.");
+ return;
+ }
+ }
+ // System.out.println("Material Name: "+aEvent.Name+ " !!!Unknown Material detected!!! Please report to GregTech Intergalactical for additional compatiblity. This is not an Error, an Issue nor a Lag Source, it is just an Information, which you should pass to me.");
+ // GT_Log.ore.println(tModToName + " uses an unknown Material. Report this to GregTech.");
+ return;
+ }
+ } else {
+ aPrefix.add(GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
+ }
+ }
+ } else if (aPrefix.mIsSelfReferencing) {
+ aPrefix.add(GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
+ } else {
+ GT_Log.ore.println(tModToName + " uses a Prefix as full OreDict Name, and is therefor invalid.");
+ aEvent.Ore.setStackDisplayName("Invalid OreDictionary Tag");
+ return;
+ }
+ }
+ GT_Log.ore.println(tModToName);
+ GregtechOreDictEventContainer tOre = new GregtechOreDictEventContainer(aEvent, aPrefix, aMaterial, aMod);
+ if ((!mOreDictActivated) || (!GregTech_API.sUnificationEntriesRegistered)) {
+ mEvents.add(tOre);
+ } else {
+ mEvents.clear();
+ }
+ if (mOreDictActivated) {
+ registerRecipes(tOre);
+ }
+ } catch (Throwable e) {
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+
+ private static final void registerRecipes(GregtechOreDictEventContainer tOre) {
+ if ((tOre.mEvent.Ore == null) || (tOre.mEvent.Ore.getItem() == null)) {
+ return;
+ }
+ if (tOre.mEvent.Ore.stackSize != 1) {
+ tOre.mEvent.Ore.stackSize = 1;
+ }
+ if (tOre.mPrefix != null) {
+ if (!tOre.mPrefix.isIgnored(tOre.mMaterial)) {
+ tOre.mPrefix.processOre((GT_Materials) (tOre.mMaterial == null ? GT_Materials._NULL : tOre.mMaterial), tOre.mEvent.Name, tOre.mModID,
+ GT_Utility.copyAmount(1L, new Object[]{tOre.mEvent.Ore}));
+ }
+ } else {
+ // System.out.println("Thingy Name: "+ aOre.mEvent.Name+ " !!!Unknown 'Thingy' detected!!! This Object seems to probably not follow a valid OreDictionary Convention, or I missed a Convention. Please report to GregTech Intergalactical for additional compatiblity. This is not an Error, an Issue nor a Lag Source, it is just an Information, which you should pass to me.");
+ }
+ }
+
+ public static void registerUnificationEntries() {
+ GregTech_API.sUnification.mConfig.save();
+ GregTech_API.sUnification.mConfig.load();
+ GregtechOreDictUnificator.resetUnificationEntries();
+ for (GregtechOreDictEventContainer tOre : mEvents) {
+ if ((!(tOre.mEvent.Ore.getItem() instanceof MetaGeneratedGregtechItems)) && (tOre.mPrefix != null) && (tOre.mPrefix.mIsUnificatable)
+ && (tOre.mMaterial != null)) {
+ if (GregtechOreDictUnificator.isBlacklisted(tOre.mEvent.Ore)) {
+ GregtechOreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, true);
+ } else {
+ GregtechOreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
+ GregtechOreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (tOre.mModID != null) && (GregTech_API.sUnification.get(ConfigCategories.specialunificationtargets + "." + tOre.mModID, tOre.mEvent.Name, false)), true);
+ }
+ }
+ }
+ for (GregtechOreDictEventContainer tOre : mEvents) {
+ if (((tOre.mEvent.Ore.getItem() instanceof MetaGeneratedGregtechItems)) && (tOre.mPrefix != null) && (tOre.mPrefix.mIsUnificatable)
+ && (tOre.mMaterial != null)) {
+ if (GregtechOreDictUnificator.isBlacklisted(tOre.mEvent.Ore)) {
+ GregtechOreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, true);
+ } else {
+ GregtechOreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
+ GregtechOreDictUnificator.set(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, (tOre.mModID != null) &&
+ (GregTech_API.sUnification.get(ConfigCategories.specialunificationtargets + "." + tOre.mModID, tOre.mEvent.Name, false)), true);
+ }
+ }
+ }
+ GregTech_API.sUnificationEntriesRegistered = true;
+ GregTech_API.sUnification.mConfig.save();
+ GT_Recipe.reInit();
+ }
+
+ public static void activateOreDictHandler() {
+ mOreDictActivated = true;
+ GregtechOreDictEventContainer tEvent;
+ for (Iterator i$ = mEvents.iterator(); i$.hasNext(); registerRecipes(tEvent)) {
+ tEvent = (GregtechOreDictEventContainer) i$.next();
+ }
+ }
+
+
+ //Dunno
+ public static class GregtechOreDictEventContainer {
+ public final OreDictionary.OreRegisterEvent mEvent;
+ public final GregtechOrePrefixes mPrefix;
+ public final GT_Materials mMaterial;
+ public final String mModID;
+
+ public GregtechOreDictEventContainer(OreDictionary.OreRegisterEvent aEvent, GregtechOrePrefixes aPrefix, GT_Materials aMaterial, String aModID) {
+ this.mEvent = aEvent;
+ this.mPrefix = aPrefix;
+ this.mMaterial = aMaterial;
+ this.mModID = ((aModID == null) || (aModID.equals("UNKNOWN")) ? null : aModID);
+ }
+ }
+
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java b/src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java
new file mode 100644
index 0000000000..20088c8ecd
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java
@@ -0,0 +1,457 @@
+package miscutil.core.xmod.gregtech.common.blocks;
+
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.objects.GT_CopiedBlockTexture;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.common.blocks.GT_Material_Casings;
+import miscutil.core.xmod.gregtech.api.enums.GregtechItemList;
+import miscutil.core.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntityIndustrialCentrifuge;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class GregtechMetaCasingBlocks
+extends GregtechMetaCasingBlocksAbstract {
+ public GregtechMetaCasingBlocks() {
+ super(GregtechMetaCasingItems.class, "miscutils.blockcasings", GT_Material_Casings.INSTANCE);
+ for (byte i = 0; i < 16; i = (byte) (i + 1)) {
+ Textures.BlockIcons.CASING_BLOCKS[63 + i] = new GT_CopiedBlockTexture(this, 6, i);
+ }
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Centrifuge Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Structural Coke Oven Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Heat Resistant Coke Oven Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Heat Proof Coke Oven 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_CokeOven.set(new ItemStack(this, 1, 1));
+ GregtechItemList.Casing_CokeOven_Coil1.set(new ItemStack(this, 1, 2));
+ GregtechItemList.Casing_CokeOven_Coil2.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));*/
+ }
+
+ @Override
+ public IIcon getIcon(int aSide, int aMeta) { //Texture ID's. case 0 == ID[56]
+ if ((aMeta >= 0) && (aMeta < 16)) {
+ switch (aMeta) {
+ case 0: //Centrifuge
+ return Textures.BlockIcons.MACHINE_CASING_TURBINE.getIcon();
+ case 1: //Coke Oven Frame
+ return Textures.BlockIcons.MACHINE_CASING_RADIATIONPROOF.getIcon();
+ case 2: //Coke Oven Casing Tier 1
+ return Textures.BlockIcons.MACHINE_CASING_FIREBOX_BRONZE.getIcon();
+ case 3: //Coke Oven Casing Tier 2
+ return Textures.BlockIcons.MACHINE_CASING_FIREBOX_STEEL.getIcon();
+ case 10:
+ return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.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();
+ }
+ return Textures.BlockIcons.MACHINECASINGS_SIDE[aMeta].getIcon();
+ }
+ return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon();
+ }
+
+ /*@Override
+ 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];
+ }
+ */
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide) {
+ int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord);
+ if (((tMeta != 6) && (tMeta != 8) && (tMeta != 0))/* || (!mConnectedMachineTextures)*/) {
+ return getIcon(aSide, tMeta);
+ }
+ int tStartIndex = tMeta == 6 ? 1 : 13;
+ if (tMeta == 0) {
+ if ((aSide == 2) || (aSide == 3)) {
+ TileEntity tTileEntity;
+ IMetaTileEntity tMetaTileEntity;
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return Textures.BlockIcons.TURBINE_ACTIVE[0].getIcon();
+ }
+ return Textures.BlockIcons.TURBINE[0].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return Textures.BlockIcons.TURBINE_ACTIVE[3].getIcon();
+ }
+ return Textures.BlockIcons.TURBINE[3].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return Textures.BlockIcons.TURBINE_ACTIVE[6].getIcon();
+ }
+ return Textures.BlockIcons.TURBINE[6].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return Textures.BlockIcons.TURBINE_ACTIVE[1].getIcon();
+ }
+ return Textures.BlockIcons.TURBINE[1].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return Textures.BlockIcons.TURBINE_ACTIVE[7].getIcon();
+ }
+ return Textures.BlockIcons.TURBINE[7].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return Textures.BlockIcons.TURBINE_ACTIVE[8].getIcon();
+ }
+ return Textures.BlockIcons.TURBINE[8].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return Textures.BlockIcons.TURBINE_ACTIVE[5].getIcon();
+ }
+ return Textures.BlockIcons.TURBINE[5].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return Textures.BlockIcons.TURBINE_ACTIVE[2].getIcon();
+ }
+ return Textures.BlockIcons.TURBINE[2].getIcon();
+ }
+ } else if ((aSide == 4) || (aSide == 5)) {
+ TileEntity tTileEntity;
+ Object tMetaTileEntity;
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return Textures.BlockIcons.TURBINE_ACTIVE[0].getIcon();
+ }
+ return Textures.BlockIcons.TURBINE[0].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return Textures.BlockIcons.TURBINE_ACTIVE[3].getIcon();
+ }
+ return Textures.BlockIcons.TURBINE[3].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return Textures.BlockIcons.TURBINE_ACTIVE[6].getIcon();
+ }
+ return Textures.BlockIcons.TURBINE[6].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return Textures.BlockIcons.TURBINE_ACTIVE[1].getIcon();
+ }
+ return Textures.BlockIcons.TURBINE[1].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return Textures.BlockIcons.TURBINE_ACTIVE[7].getIcon();
+ }
+ return Textures.BlockIcons.TURBINE[7].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return Textures.BlockIcons.TURBINE_ACTIVE[8].getIcon();
+ }
+ return Textures.BlockIcons.TURBINE[8].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return Textures.BlockIcons.TURBINE_ACTIVE[5].getIcon();
+ }
+ return Textures.BlockIcons.TURBINE[5].getIcon();
+ }
+ if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return Textures.BlockIcons.TURBINE_ACTIVE[2].getIcon();
+ }
+ return Textures.BlockIcons.TURBINE[2].getIcon();
+ }
+ }
+ return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon();
+ }
+ boolean[] tConnectedSides = {(aWorld.getBlock(xCoord, yCoord - 1, zCoord) == this) && (aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord + 1, zCoord) == this) && (aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta), (aWorld.getBlock(xCoord + 1, yCoord, zCoord) == this) && (aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord, zCoord + 1) == this) && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta), (aWorld.getBlock(xCoord - 1, yCoord, zCoord) == this) && (aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta), (aWorld.getBlock(xCoord, yCoord, zCoord - 1) == this) && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta)};
+ switch (aSide) {
+ case 0:
+ if (tConnectedSides[0]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[2])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ if ((!tConnectedSides[5]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ case 1:
+ if (tConnectedSides[1]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[4])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ if ((!tConnectedSides[3]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ case 2:
+ if (tConnectedSides[5]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[4])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ case 3:
+ if (tConnectedSides[3]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[2]) && (!tConnectedSides[4])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ case 4:
+ if (tConnectedSides[4]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ if ((!tConnectedSides[3]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ case 5:
+ if (tConnectedSides[2]) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon();
+ }
+ if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+ if ((!tConnectedSides[0]) && (!tConnectedSides[1])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon();
+ }
+ if ((!tConnectedSides[3]) && (!tConnectedSides[5])) {
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon();
+ }
+ break;
+ }
+ return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon();
+ }
+
+
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java b/src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java
new file mode 100644
index 0000000000..d3ce273bdd
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java
@@ -0,0 +1,140 @@
+package miscutil.core.xmod.gregtech.common.blocks;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.common.blocks.GT_Block_Casings_Abstract;
+
+import java.util.Random;
+
+import miscutil.core.creative.AddToCreativeTab;
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EnumCreatureType;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemBlock;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public abstract class GregtechMetaCasingBlocksAbstract
+ extends GT_Block_Casings_Abstract {
+ public GregtechMetaCasingBlocksAbstract(Class<? extends ItemBlock> aItemClass, String aName, Material aMaterial) {
+ super(aItemClass, aName, aMaterial);
+ setStepSound(soundTypeMetal);
+ setCreativeTab(AddToCreativeTab.tabMachines);
+ GregTech_API.registerMachineBlock(this, -1);
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + 32767 + ".name", "Any Sub Block of this");
+ }
+
+ @Override
+ public String getHarvestTool(int aMeta) {
+ return "wrench";
+ }
+
+ @Override
+ public int getHarvestLevel(int aMeta) {
+ return 2;
+ }
+
+ @Override
+ public float getBlockHardness(World aWorld, int aX, int aY, int aZ) {
+ return Blocks.iron_block.getBlockHardness(aWorld, aX, aY, aZ);
+ }
+
+ @Override
+ public float getExplosionResistance(Entity aTNT) {
+ return Blocks.iron_block.getExplosionResistance(aTNT);
+ }
+
+ @Override
+ protected boolean canSilkHarvest() {
+ return false;
+ }
+
+ @Override
+ public void onBlockAdded(World aWorld, int aX, int aY, int aZ) {
+ if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) {
+ GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ);
+ }
+ }
+
+ @Override
+ public String getUnlocalizedName() {
+ return this.mUnlocalizedName;
+ }
+
+ @Override
+ public String getLocalizedName() {
+ return StatCollector.translateToLocal(this.mUnlocalizedName + ".name");
+ }
+
+ @Override
+ public boolean canBeReplacedByLeaves(IBlockAccess aWorld, int aX, int aY, int aZ) {
+ return false;
+ }
+
+ @Override
+ public boolean isNormalCube(IBlockAccess aWorld, int aX, int aY, int aZ) {
+ return true;
+ }
+
+ @Override
+ public boolean renderAsNormalBlock() {
+ return true;
+ }
+
+ @Override
+ public boolean isOpaqueCube() {
+ return true;
+ }
+
+ @Override
+ public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData) {
+ if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) {
+ GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ);
+ }
+ }
+
+ @Override
+ public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) {
+ return false;
+ }
+
+ @Override
+ public int damageDropped(int par1) {
+ return par1;
+ }
+
+ @Override
+ public int getDamageValue(World par1World, int par2, int par3, int par4) {
+ return par1World.getBlockMetadata(par2, par3, par4);
+ }
+
+ @Override
+ public int quantityDropped(Random par1Random) {
+ return 1;
+ }
+
+ @Override
+ public Item getItemDropped(int par1, Random par2Random, int par3) {
+ return Item.getItemFromBlock(this);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(IIconRegister aIconRegister) {
+ }
+
+ /*@Override
+ @SideOnly(Side.CLIENT)
+ public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) {
+ for (int i = 0; i < 16; i++) {
+ aList.add(new ItemStack(aItem, 1, i));
+ }
+ }*/
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaCasingItems.java b/src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaCasingItems.java
new file mode 100644
index 0000000000..96ef4e2983
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaCasingItems.java
@@ -0,0 +1,11 @@
+package miscutil.core.xmod.gregtech.common.blocks;
+
+import gregtech.common.blocks.GT_Item_Casings_Abstract;
+import net.minecraft.block.Block;
+
+public class GregtechMetaCasingItems
+ extends GT_Item_Casings_Abstract {
+ public GregtechMetaCasingItems(Block par1) {
+ super(par1);
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java b/src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java
new file mode 100644
index 0000000000..17ee8f9853
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java
@@ -0,0 +1,33 @@
+package miscutil.core.xmod.gregtech.common.blocks;
+
+import java.util.List;
+
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+
+public class GregtechMetaItemCasings1
+extends GregtechMetaItemCasingsAbstract {
+ public GregtechMetaItemCasings1(Block par1) {
+ super(par1);
+ }
+
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
+ super.addInformation(aStack, aPlayer, aList, aF3_H);
+ switch (getDamage(aStack)) {
+ case 0:
+ aList.add(this.mCasing_Centrifuge);
+ break;
+ case 1:
+ aList.add(this.mCasing_CokeOven);
+ break;
+ case 2:
+ aList.add(this.mCasing_CokeCoil1);
+ break;
+ case 3:
+ aList.add(this.mCasing_CokeCoil2);
+ break;
+ }
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java b/src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java
new file mode 100644
index 0000000000..ad87cd51f7
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java
@@ -0,0 +1,45 @@
+package miscutil.core.xmod.gregtech.common.blocks;
+
+import gregtech.api.util.GT_LanguageManager;
+
+import java.util.List;
+
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemBlock;
+import net.minecraft.item.ItemStack;
+
+public abstract class GregtechMetaItemCasingsAbstract
+ extends ItemBlock {
+
+ protected final String mCasing_Centrifuge = GT_LanguageManager.addStringLocalization("mu.centrifugecasing", "Warning! Standing in the Centrifuge not recommended");
+ protected final String mCasing_CokeOven = GT_LanguageManager.addStringLocalization("mu.cokeoven", "Sturdy and Strong");
+ protected final String mCasing_CokeCoil1 = GT_LanguageManager.addStringLocalization("mu.coil01tooltip", "Base Heating Capacity = 1350 Kelvin");
+ protected final String mCasing_CokeCoil2 = GT_LanguageManager.addStringLocalization("mu.coil02tooltip", "Base Heating Capacity = 2275 Kelvin");
+ protected final String mNoMobsToolTip = GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block");
+ protected final String mNoTileEntityToolTip = GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!");
+
+ public GregtechMetaItemCasingsAbstract(Block par1) {
+ super(par1);
+ setMaxDamage(0);
+ setHasSubtypes(true);
+ //setCreativeTab(AddToCreativeTab.tabMachines);
+ }
+
+ @Override
+ public int getMetadata(int aMeta) {
+ return aMeta;
+ }
+
+ @Override
+ public String getUnlocalizedName(ItemStack aStack) {
+ return this.field_150939_a.getUnlocalizedName() + "." + getDamage(aStack);
+ }
+
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
+ super.addInformation(aStack, aPlayer, aList, aF3_H);
+ aList.add(this.mNoMobsToolTip);
+ aList.add(this.mNoTileEntityToolTip);
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java b/src/Java/miscutil/core/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java
new file mode 100644
index 0000000000..8d7ea692f8
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java
@@ -0,0 +1,36 @@
+package miscutil.core.xmod.gregtech.common.blocks.fluid;
+
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.util.GT_OreDictUnificator;
+import miscutil.core.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+import miscutil.core.xmod.gregtech.common.Meta_GT_Proxy;
+
+public class GregtechFluidHandler {
+
+ public static void run(){
+ start();
+ }
+
+ private static void start(){
+
+ /* Meta_GT_Proxy.addFluid("lubricant", "Lubricant", Materials.Lubricant, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Lubricant, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ Meta_GT_Proxy.addFluid("creosote", "Creosote Oil", Materials.Creosote, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Creosote, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ Meta_GT_Proxy.addFluid("seedoil", "Seed Oil", Materials.SeedOil, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.SeedOil, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ Meta_GT_Proxy.addFluid("fishoil", "Fish Oil", Materials.FishOil, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.FishOil, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ Meta_GT_Proxy.addFluid("oil", "Oil", Materials.Oil, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Oil, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ Meta_GT_Proxy.addFluid("fuel", "Diesel", Materials.Fuel, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Fuel, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ Meta_GT_Proxy.addFluid("for.honey", "Honey", Materials.Honey, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Honey, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ Meta_GT_Proxy.addFluid("biomass", "Biomass", Materials.Biomass, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Biomass, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ Meta_GT_Proxy.addFluid("bioethanol", "Bio Ethanol", Materials.Ethanol, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Ethanol, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ Meta_GT_Proxy.addFluid("sulfuricacid", "Sulfuric Acid", Materials.SulfuricAcid, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.SulfuricAcid, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ Meta_GT_Proxy.addFluid("milk", "Milk", Materials.Milk, 1, 290, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Milk, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ Meta_GT_Proxy.addFluid("mcguffium", "Mc Guffium 239", Materials.McGuffium239, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.McGuffium239, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ Meta_GT_Proxy.addFluid("glue", "Glue", Materials.Glue, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Glue, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ */
+ Meta_GT_Proxy.addFluid("cryotheum", "Gelid Cryotheum", GT_Materials.Cryotheum, 4, -1200, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Cryotheum, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+ Meta_GT_Proxy.addFluid("pyrotheum", "Blazing Pyrotheum", GT_Materials.Pyrotheum, 4, 1200, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Pyrotheum, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);
+
+ }
+
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java b/src/Java/miscutil/core/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java
new file mode 100644
index 0000000000..20599a500d
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java
@@ -0,0 +1,155 @@
+package miscutil.core.xmod.gregtech.common.items;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.TC_Aspects;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.objects.GT_MultiTexture;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.common.covers.GT_Cover_Arm;
+import gregtech.common.covers.GT_Cover_Conveyor;
+import gregtech.common.covers.GT_Cover_Pump;
+import miscutil.core.xmod.gregtech.api.enums.GregtechItemList;
+import miscutil.core.xmod.gregtech.api.enums.GregtechOrePrefixes;
+import miscutil.core.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+import miscutil.core.xmod.gregtech.api.items.Gregtech_MetaItem_X32;
+
+public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 {
+ public MetaGeneratedGregtechItems INSTANCE;
+
+ public MetaGeneratedGregtechItems() {
+ super("MU-metaitem.01", new OrePrefixes[]{null});
+ INSTANCE = this;
+ int tLastID = 0;
+ GregtechItemList.Electric_Pump_LuV.set(addItem(tLastID = 0, "Electric Pump (LuV)", "163920 L/sec (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L)}));
+ GregtechItemList.Electric_Pump_ZPM.set(addItem(tLastID = 1, "Electric Pump (ZPM)", "655680 L/sec (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L)}));
+ GregtechItemList.Electric_Pump_UV.set(addItem(tLastID = 2, "Electric Pump (UV)", "2622720 L/sec (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 4L)}));
+ GregtechItemList.Electric_Pump_MAX.set(addItem(tLastID = 3, "Electric Pump (MAX)", "10490880 L/sec (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 8L)}));
+ GregTech_API.registerCover(GregtechItemList.Electric_Pump_LuV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_Pump(8196));
+ GregTech_API.registerCover(GregtechItemList.Electric_Pump_ZPM.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[6][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_Pump(32768));
+ GregTech_API.registerCover(GregtechItemList.Electric_Pump_UV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[7][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_Pump(131072));
+ GregTech_API.registerCover(GregtechItemList.Electric_Pump_MAX.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP)}), new GT_Cover_Pump(524288));
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Pump_LuV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", Character.valueOf('M'), GregtechItemList.Electric_Motor_LuV, Character.valueOf('O'), OrePrefixes.ring.get(Materials.Rubber), Character.valueOf('X'), OrePrefixes.rotor.get(Materials.Tin), Character.valueOf('S'), OrePrefixes.screw.get(Materials.Tin), Character.valueOf('W'), OrePrefixes.cableGt01.get(Materials.Tin), Character.valueOf('P'), OrePrefixes.pipeMedium.get(Materials.Bronze)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Pump_ZPM.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", Character.valueOf('M'), GregtechItemList.Electric_Motor_ZPM, Character.valueOf('O'), OrePrefixes.ring.get(Materials.Rubber), Character.valueOf('X'), OrePrefixes.rotor.get(Materials.Bronze), Character.valueOf('S'), OrePrefixes.screw.get(Materials.Bronze), Character.valueOf('W'), OrePrefixes.cableGt01.get(Materials.AnyCopper), Character.valueOf('P'), OrePrefixes.pipeMedium.get(Materials.Steel)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Pump_UV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", Character.valueOf('M'), GregtechItemList.Electric_Motor_UV, Character.valueOf('O'), OrePrefixes.ring.get(Materials.Rubber), Character.valueOf('X'), OrePrefixes.rotor.get(Materials.Steel), Character.valueOf('S'), OrePrefixes.screw.get(Materials.Steel), Character.valueOf('W'), OrePrefixes.cableGt01.get(Materials.Gold), Character.valueOf('P'), OrePrefixes.pipeMedium.get(Materials.StainlessSteel)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Pump_MAX.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SXO", "dPw", "OMW", Character.valueOf('M'), GregtechItemList.Electric_Motor_MAX, Character.valueOf('O'), OrePrefixes.ring.get(Materials.Rubber), Character.valueOf('X'), OrePrefixes.rotor.get(Materials.StainlessSteel), Character.valueOf('S'), OrePrefixes.screw.get(Materials.StainlessSteel), Character.valueOf('W'), OrePrefixes.cableGt01.get(Materials.Aluminium), Character.valueOf('P'), OrePrefixes.pipeMedium.get(Materials.Titanium)});
+ tLastID = 4;
+ GregtechItemList.Electric_Motor_LuV.set(addItem(tLastID = 4, "Electric Motor (LuV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L)}));
+ GregtechItemList.Electric_Motor_ZPM.set(addItem(tLastID = 5, "Electric Motor (ZPM)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L)}));
+ GregtechItemList.Electric_Motor_UV.set(addItem(tLastID = 6, "Electric Motor (UV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 4L)}));
+ GregtechItemList.Electric_Motor_MAX.set(addItem(tLastID = 7, "Electric Motor (MAX)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 8L)}));
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Motor_LuV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", Character.valueOf('I'), OrePrefixes.stick.get(Materials.IronMagnetic), Character.valueOf('R'), OrePrefixes.stick.get(Materials.AnyIron), Character.valueOf('W'), OrePrefixes.wireGt01.get(Materials.AnyCopper), Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Tin)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Motor_ZPM.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", Character.valueOf('I'), OrePrefixes.stick.get(Materials.SteelMagnetic), Character.valueOf('R'), OrePrefixes.stick.get(Materials.Aluminium), Character.valueOf('W'), OrePrefixes.wireGt01.get(Materials.Electrum), Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Silver)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Motor_UV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", Character.valueOf('I'), OrePrefixes.stick.get(Materials.SteelMagnetic), Character.valueOf('R'), OrePrefixes.stick.get(Materials.StainlessSteel), Character.valueOf('W'), OrePrefixes.wireGt02.get(Materials.Cupronickel), Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Gold)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Motor_MAX.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", Character.valueOf('I'), OrePrefixes.stick.get(Materials.NeodymiumMagnetic), Character.valueOf('R'), OrePrefixes.stick.get(Materials.Titanium), Character.valueOf('W'), OrePrefixes.wireGt02.get(Materials.TungstenSteel), Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Nichrome)});
+
+ tLastID = 8;
+ GregtechItemList.Conveyor_Module_LuV.set(addItem(tLastID = 8, "Conveyor Module (LuV)", "1 Stack every 20 secs (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L)}));
+ GregtechItemList.Conveyor_Module_ZPM.set(addItem(tLastID = 9, "Conveyor Module (ZPM)", "1 Stack every 5 secs (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L)}));
+ GregtechItemList.Conveyor_Module_UV.set(addItem(tLastID = 10, "Conveyor Module (UV)", "1 Stack every 1 sec (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 4L)}));
+ GregtechItemList.Conveyor_Module_MAX.set(addItem(tLastID = 11, "Conveyor Module (MAX)", "1 Stack every 1/5 sec (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 8L)}));
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Conveyor_Module_LuV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", Character.valueOf('M'), GregtechItemList.Electric_Motor_LuV, Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Tin), Character.valueOf('R'), OrePrefixes.plate.get(Materials.Rubber)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Conveyor_Module_ZPM.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", Character.valueOf('M'), GregtechItemList.Electric_Motor_ZPM, Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.AnyCopper), Character.valueOf('R'), OrePrefixes.plate.get(Materials.Rubber)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Conveyor_Module_UV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", Character.valueOf('M'), GregtechItemList.Electric_Motor_UV, Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Gold), Character.valueOf('R'), OrePrefixes.plate.get(Materials.Rubber)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Conveyor_Module_MAX.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", Character.valueOf('M'), GregtechItemList.Electric_Motor_MAX, Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Aluminium), Character.valueOf('R'), OrePrefixes.plate.get(Materials.Rubber)});
+ GregTech_API.registerCover(GregtechItemList.Conveyor_Module_LuV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)}), new GT_Cover_Conveyor(400));
+ GregTech_API.registerCover(GregtechItemList.Conveyor_Module_ZPM.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)}), new GT_Cover_Conveyor(100));
+ GregTech_API.registerCover(GregtechItemList.Conveyor_Module_UV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[3][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)}), new GT_Cover_Conveyor(20));
+ GregTech_API.registerCover(GregtechItemList.Conveyor_Module_MAX.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR)}), new GT_Cover_Conveyor(4));
+ tLastID = 12;
+ GregtechItemList.Electric_Piston_LuV.set(addItem(tLastID = 12, "Electric Piston (LuV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L)}));
+ GregtechItemList.Electric_Piston_ZPM.set(addItem(tLastID = 13, "Electric Piston (ZPM)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L)}));
+ GregtechItemList.Electric_Piston_UV.set(addItem(tLastID = 14, "Electric Piston (UV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 4L)}));
+ GregtechItemList.Electric_Piston_MAX.set(addItem(tLastID = 15, "Electric Piston (MAX)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 8L)}));
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Piston_LuV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", Character.valueOf('P'), OrePrefixes.plate.get(Materials.Steel), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Steel), Character.valueOf('G'), OrePrefixes.gearGtSmall.get(Materials.Steel), Character.valueOf('M'), GregtechItemList.Electric_Motor_LuV, Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Tin)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Piston_ZPM.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", Character.valueOf('P'), OrePrefixes.plate.get(Materials.Aluminium), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Aluminium), Character.valueOf('G'), OrePrefixes.gearGtSmall.get(Materials.Aluminium), Character.valueOf('M'), GregtechItemList.Electric_Motor_ZPM, Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.AnyCopper)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Piston_UV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", Character.valueOf('P'), OrePrefixes.plate.get(Materials.StainlessSteel), Character.valueOf('S'), OrePrefixes.stick.get(Materials.StainlessSteel), Character.valueOf('G'), OrePrefixes.gearGtSmall.get(Materials.StainlessSteel), Character.valueOf('M'), GregtechItemList.Electric_Motor_UV, Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Gold)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Piston_MAX.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", Character.valueOf('P'), OrePrefixes.plate.get(Materials.Titanium), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Titanium), Character.valueOf('G'), OrePrefixes.gearGtSmall.get(Materials.Titanium), Character.valueOf('M'), GregtechItemList.Electric_Motor_MAX, Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Aluminium)});
+ tLastID = 16;
+ GregtechItemList.Robot_Arm_LuV.set(addItem(tLastID = 16, "Robot Arm (LuV)", "Inserts into specific Slots (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L)}));
+ GregtechItemList.Robot_Arm_ZPM.set(addItem(tLastID = 17, "Robot Arm (ZPM)", "Inserts into specific Slots (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L)}));
+ GregtechItemList.Robot_Arm_UV.set(addItem(tLastID = 18, "Robot Arm (UV)", "Inserts into specific Slots (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 4L)}));
+ GregtechItemList.Robot_Arm_MAX.set(addItem(tLastID = 19, "Robot Arm (MAX)", "Inserts into specific Slots (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 8L)}));
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Robot_Arm_LuV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", Character.valueOf('S'), OrePrefixes.stick.get(Materials.Steel), Character.valueOf('M'), GregtechItemList.Electric_Motor_LuV, Character.valueOf('P'), GregtechItemList.Electric_Piston_LuV, Character.valueOf('E'), OrePrefixes.circuit.get(Materials.Basic), Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Tin)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Robot_Arm_ZPM.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", Character.valueOf('S'), OrePrefixes.stick.get(Materials.Aluminium), Character.valueOf('M'), GregtechItemList.Electric_Motor_ZPM, Character.valueOf('P'), GregtechItemList.Electric_Piston_ZPM, Character.valueOf('E'), OrePrefixes.circuit.get(Materials.Good), Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.AnyCopper)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Robot_Arm_UV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", Character.valueOf('S'), OrePrefixes.stick.get(Materials.StainlessSteel), Character.valueOf('M'), GregtechItemList.Electric_Motor_UV, Character.valueOf('P'), GregtechItemList.Electric_Piston_UV, Character.valueOf('E'), OrePrefixes.circuit.get(Materials.Advanced), Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Gold)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Robot_Arm_MAX.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", Character.valueOf('S'), OrePrefixes.stick.get(Materials.Titanium), Character.valueOf('M'), GregtechItemList.Electric_Motor_MAX, Character.valueOf('P'), GregtechItemList.Electric_Piston_MAX, Character.valueOf('E'), OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('C'), OrePrefixes.cableGt01.get(Materials.Aluminium)});
+ GregTech_API.registerCover(GregtechItemList.Robot_Arm_LuV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)}), new GT_Cover_Arm(400));
+ GregTech_API.registerCover(GregtechItemList.Robot_Arm_ZPM.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[2][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)}), new GT_Cover_Arm(100));
+ GregTech_API.registerCover(GregtechItemList.Robot_Arm_UV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[3][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)}), new GT_Cover_Arm(20));
+ GregTech_API.registerCover(GregtechItemList.Robot_Arm_MAX.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM)}), new GT_Cover_Arm(4));
+ tLastID = 20;
+ GregtechItemList.Field_Generator_LuV.set(addItem(tLastID = 20, "Field Generator (LuV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 1L)}));
+ GregtechItemList.Field_Generator_ZPM.set(addItem(tLastID = 21, "Field Generator (ZPM)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 2L)}));
+ GregtechItemList.Field_Generator_UV.set(addItem(tLastID = 22, "Field Generator (UV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 4L)}));
+ GregtechItemList.Field_Generator_MAX.set(addItem(tLastID = 23, "Field Generator (MAX)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 8L)}));
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Field_Generator_LuV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WCW", "CGC", "WCW", Character.valueOf('G'), OrePrefixes.gem.get(Materials.EnderPearl), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Basic), Character.valueOf('W'), OrePrefixes.wireGt01.get(Materials.Osmium)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Field_Generator_ZPM.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WCW", "CGC", "WCW", Character.valueOf('G'), OrePrefixes.gem.get(Materials.EnderEye), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Good), Character.valueOf('W'), OrePrefixes.wireGt02.get(Materials.Osmium)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Field_Generator_UV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WCW", "CGC", "WCW", Character.valueOf('G'), OrePrefixes.gem.get(Materials.NetherStar), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Advanced), Character.valueOf('W'), OrePrefixes.wireGt04.get(Materials.Osmium)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Field_Generator_MAX.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WCW", "CGC", "WCW", Character.valueOf('G'), OrePrefixes.gem.get(Materials.NetherStar), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Osmium)});
+ tLastID = 24;
+ GregtechItemList.Emitter_LuV.set(addItem(tLastID = 24, "Emitter (LuV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 1L)}));
+ GregtechItemList.Emitter_ZPM.set(addItem(tLastID = 25, "Emitter (ZPM)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 2L)}));
+ GregtechItemList.Emitter_UV.set(addItem(tLastID = 26, "Emitter (UV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 4L)}));
+ GregtechItemList.Emitter_MAX.set(addItem(tLastID = 27, "Emitter (MAX)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 8L)}));
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Emitter_LuV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", Character.valueOf('Q'), OrePrefixes.gem.get(Materials.Quartzite), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Brass), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Basic), Character.valueOf('W'), OrePrefixes.cableGt01.get(Materials.Tin)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Emitter_ZPM.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", Character.valueOf('Q'), OrePrefixes.gem.get(Materials.NetherQuartz), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Electrum), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Good), Character.valueOf('W'), OrePrefixes.cableGt01.get(Materials.AnyCopper)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Emitter_UV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", Character.valueOf('Q'), OrePrefixes.gem.get(Materials.Emerald), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Chrome), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Advanced), Character.valueOf('W'), OrePrefixes.cableGt01.get(Materials.Gold)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Emitter_MAX.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", Character.valueOf('Q'), OrePrefixes.gem.get(Materials.EnderPearl), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Platinum), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('W'), OrePrefixes.cableGt01.get(Materials.Aluminium)});
+ tLastID = 28;
+ GregtechItemList.Sensor_LuV.set(addItem(tLastID = 28, "Sensor (LuV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 1L)}));
+ GregtechItemList.Sensor_ZPM.set(addItem(tLastID = 29, "Sensor (ZPM)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L)}));
+ GregtechItemList.Sensor_UV.set(addItem(tLastID = 30, "Sensor (UV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 4L)}));
+ GregtechItemList.Sensor_MAX.set(addItem(tLastID = 31, "Sensor (MAX)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 8L)}));
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Sensor_LuV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", Character.valueOf('Q'), OrePrefixes.gem.get(Materials.Quartzite), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Brass), Character.valueOf('P'), OrePrefixes.plate.get(Materials.Steel), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Basic)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Sensor_ZPM.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", Character.valueOf('Q'), OrePrefixes.gem.get(Materials.NetherQuartz), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Electrum), Character.valueOf('P'), OrePrefixes.plate.get(Materials.Aluminium), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Good)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Sensor_UV.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", Character.valueOf('Q'), OrePrefixes.gem.get(Materials.Emerald), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Chrome), Character.valueOf('P'), OrePrefixes.plate.get(Materials.StainlessSteel), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Advanced)});
+ //GT_ModHandler.addCraftingRecipe(GregtechItemList.Sensor_MAX.get(1L, new Object[0]), //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", Character.valueOf('Q'), OrePrefixes.gem.get(Materials.EnderPearl), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Platinum), Character.valueOf('P'), OrePrefixes.plate.get(Materials.Titanium), Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Elite)});
+
+
+ /* GregtechItemList.Circuit_Primitive.set(addItem(tLastID = 700, "Circuit"+" "+tLastID, "A simple Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Primitive)}));
+ GregtechItemList.Circuit_Basic.set(addItem(tLastID = 701, "Circuit"+" "+tLastID, "A basic Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Basic)}));
+ GregtechItemList.Circuit_Good.set(addItem(tLastID = 702, "Circuit"+" "+tLastID, "A good Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Good)}));
+ GregtechItemList.Circuit_Advanced.set(addItem(tLastID = 703, "Circuit"+" "+tLastID, "An advanced Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Advanced)}));
+ GregtechItemList.Circuit_Data.set(addItem(tLastID = 704, "Circuit"+" "+tLastID, "A Data Chip", new Object[]{OrePrefixes.circuit.get(Materials.Data)}));
+ GregtechItemList.Circuit_Elite.set(addItem(tLastID = 705, "Circuit"+" "+tLastID, "A Processor", new Object[]{OrePrefixes.circuit.get(Materials.Elite)}));
+ GregtechItemList.Circuit_Master.set(addItem(tLastID = 706, "Circuit"+" "+tLastID, "A High Voltage Processor", new Object[]{OrePrefixes.circuit.get(Materials.Master)}));
+ GregtechItemList.Tool_DataOrb.set(addItem(tLastID = 707, "Data Orb", "A High Capacity Data Storage", new Object[]{OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION, new Behaviour_DataOrb()}));
+ GregtechItemList.Circuit_Ultimate.set(ItemList.Tool_DataOrb.get(1L, new Object[0]));
+ GT_ModHandler.addShapelessCraftingRecipe(ItemList.Tool_DataOrb.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Tool_DataOrb.get(1L, new Object[0])});
+ GregtechItemList.Tool_DataStick.set(addItem(tLastID = 708, "Data Stick", "A Low Capacity Data Storage", new Object[]{OrePrefixes.circuit.get(Materials.Data), SubTag.NO_UNIFICATION, new Behaviour_DataStick()}));
+ GT_ModHandler.addShapelessCraftingRecipe(ItemList.Tool_DataStick.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ItemList.Tool_DataStick.get(1L, new Object[0])});
+
+*
+*
+ Circuit_IV, Circuit_LuV, Circuit_ZPM,
+ Circuit_Board_IV, Circuit_Board_LuV, Circuit_Board_ZPM,
+ Circuit_Parts_Crystal_Chip_IV, Circuit_Parts_Crystal_Chip_LuV, Circuit_Parts_Crystal_Chip_ZPM,
+ Circuit_Parts_IV, Circuit_Parts_LuV, Circuit_Parts_ZPM,
+ Circuit_Parts_Wiring_IV, Circuit_Parts_Wiring_LuV, Circuit_Parts_Wiring_ZPM;
+*
+*/
+ GregtechItemList.Circuit_IV.set(addItem(tLastID = 704, "Symbiotic Circuit (IV)", "A Symbiotic Data Processor", new Object[]{GregtechOrePrefixes.circuit.get(GT_Materials.Symbiotic)}));
+ GregtechItemList.Circuit_LuV.set(addItem(tLastID = 705, "Neutronic Circuit (LuV)", "A Neutron Particle Processor", new Object[]{OrePrefixes.circuit.get(GT_Materials.Neutronic)}));
+ GregtechItemList.Circuit_ZPM.set(addItem(tLastID = 706, "Quantum Circuit (ZPM)", "A Singlularity Processor", new Object[]{OrePrefixes.circuit.get(GT_Materials.Quantum)}));
+ GregtechItemList.Circuit_Board_IV.set(addItem(tLastID = 710, "IV Circuit Board", "An IV Voltage Rated Circuit Board", new Object[0]));
+ GregtechItemList.Circuit_Board_LuV.set(addItem(tLastID = 711, "LuV Circuit Board", "An LuV Voltage Rated Circuit Board", new Object[0]));
+ GregtechItemList.Circuit_Board_ZPM.set(addItem(tLastID = 712, "ZPM Processor Board", "A ZPM Voltage Rated Processor Board", new Object[0]));
+ GregtechItemList.Circuit_Parts_Crystal_Chip_IV.set(addItem(tLastID = 713, "(IV) Energized Crystal Chip", "Needed for Circuits", new Object[0]));
+ GregtechItemList.Circuit_Parts_Crystal_Chip_LuV.set(addItem(tLastID = 714, "(LuV) Neutron based Microchip", "Needed for Circuits", new Object[0]));
+ GregtechItemList.Circuit_Parts_Crystal_Chip_ZPM.set(addItem(tLastID = 715, "(ZPM) Quantum Chip", "Needed for Circuits", new Object[0]));
+ GregtechItemList.Circuit_Parts_IV.set(addItem(tLastID = 716, "(IV) Energized Circuit Parts", "Circuit Parts", new Object[0]));
+ GregtechItemList.Circuit_Parts_LuV.set(addItem(tLastID = 717, "(LuV) Neutron-based Circuit Parts", "Circuit Parts", new Object[0]));
+ GregtechItemList.Circuit_Parts_ZPM.set(addItem(tLastID = 718, "(ZPM) Quantum Circuit Parts", "Circuit Parts", new Object[0]));
+ GregtechItemList.Circuit_Parts_Wiring_IV.set(addItem(tLastID = 719, "Etched IV Voltage Wiring", "Part of Circuit Boards", new Object[0]));
+ GregtechItemList.Circuit_Parts_Wiring_LuV.set(addItem(tLastID = 720, "Etched LuV Voltage Wiring", "Part of Circuit Boards", new Object[0]));
+ GregtechItemList.Circuit_Parts_Wiring_ZPM.set(addItem(tLastID = 721, "Etched ZPM Voltage Wiring", "Part of Circuit Boards", new Object[0]));
+
+
+
+
+
+
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java b/src/Java/miscutil/core/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java
new file mode 100644
index 0000000000..94504290ac
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java
@@ -0,0 +1,24 @@
+package miscutil.core.xmod.gregtech.common.items;
+
+import miscutil.core.xmod.gregtech.api.items.Gregtech_MetaTool;
+import miscutil.core.xmod.gregtech.common.tools.TOOL_Gregtech_MaxEfficiencyMultiBlockItem;
+
+public class MetaGeneratedGregtechTools extends Gregtech_MetaTool {
+
+ public static final short TURBINE_SMALL = 10;
+ public static final short TURBINE = 12;
+ public static final short TURBINE_LARGE = 14;
+ public static final short HUGE_ITEM = 16;
+ public static final short TURBINE_BLADE = 18;
+ public static MetaGeneratedGregtechTools INSTANCE;
+
+ public MetaGeneratedGregtechTools() {
+ super("MU-metaitem.02");
+ INSTANCE = this;
+ //addTool(TURBINE_SMALL, "Small Turbine", "Turbine Rotors for your power station", new GT_Tool_Turbine_Small(), new Object[]{});
+ //addTool(TURBINE, "Turbine", "Turbine Rotors for your power station", new GT_Tool_Turbine_Normal(), new Object[]{});
+ //addTool(TURBINE_LARGE, "Large Turbine", "Turbine Rotors for your power station", new GT_Tool_Turbine_Large(), new Object[]{});
+ addTool(HUGE_ITEM, "Huge Item", "Item 4 for your power station", new TOOL_Gregtech_MaxEfficiencyMultiBlockItem(), new Object[]{});
+
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java
new file mode 100644
index 0000000000..454e7f3a90
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java
@@ -0,0 +1,119 @@
+package miscutil.core.xmod.gregtech.common.tileentities.generators;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.enums.ItemList;
+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_Recipe;
+import miscutil.core.xmod.gregtech.api.metatileentity.implementations.base.GregtechRocketFuelGeneratorBase;
+import net.minecraft.item.ItemStack;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public class GregtechMetaTileEntityRocketFuelGenerator
+ extends GregtechRocketFuelGeneratorBase {
+
+ public int mEfficiency;
+
+ public GregtechMetaTileEntityRocketFuelGenerator(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, "Requires liquid Fuel", new ITexture[0]);
+ onConfigLoad();
+ }
+
+ public GregtechMetaTileEntityRocketFuelGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ onConfigLoad();
+ }
+
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntityRocketFuelGenerator(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipes() {
+ return GT_Recipe.GT_Recipe_Map.sDieselFuels;
+ }
+
+ @Override
+ public int getCapacity() {
+ return 32000;
+ }
+
+ public void onConfigLoad() {
+ this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "RocketEngine.efficiency.tier." + this.mTier, (100 - this.mTier * 8));
+ }
+
+ @Override
+ public int getEfficiency() {
+ return this.mEfficiency;
+ }
+
+ @Override
+ public int getFuelValue(ItemStack aStack) {
+ int rValue = Math.max(GT_ModHandler.getFuelCanValue(aStack) * 6 / 5, super.getFuelValue(aStack));
+ if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) {
+ rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3);
+ }
+ return rValue;
+ }
+
+ @Override
+ public ITexture[] getFront(byte aColor) {
+ return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
+ }
+
+ @Override
+ public ITexture[] getBack(byte aColor) {
+ return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK)};
+ }
+
+ @Override
+ public ITexture[] getBottom(byte aColor) {
+ return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM)};
+ }
+
+ @Override
+ public ITexture[] getTop(byte aColor) {
+ return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP)};
+ }
+
+ @Override
+ public ITexture[] getSides(byte aColor) {
+ return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE)};
+ }
+
+ @Override
+ public ITexture[] getFrontActive(byte aColor) {
+ return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
+ }
+
+ @Override
+ public ITexture[] getBackActive(byte aColor) {
+ return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK_ACTIVE)};
+ }
+
+ @Override
+ public ITexture[] getBottomActive(byte aColor) {
+ return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM_ACTIVE)};
+ }
+
+ @Override
+ public ITexture[] getTopActive(byte aColor) {
+ return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP_ACTIVE)};
+ }
+
+ @Override
+ public ITexture[] getSidesActive(byte aColor) {
+ return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE)};
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityElectricBlastFurnace.java b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityElectricBlastFurnace.java
new file mode 100644
index 0000000000..7f82c8a25d
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityElectricBlastFurnace.java
@@ -0,0 +1,236 @@
+package miscutil.core.xmod.gregtech.common.tileentities.machines.multi;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Textures;
+import gregtech.api.gui.GT_GUIContainer_MultiMachine;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+
+public class GregtechMetaTileEntityElectricBlastFurnace
+ extends GT_MetaTileEntity_MultiBlockBase {
+ private int mHeatingCapacity = 0;
+
+ public GregtechMetaTileEntityElectricBlastFurnace(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntityElectricBlastFurnace(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntityElectricBlastFurnace(this.mName);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[]{"Controller Block for the Blast Furnace",
+ "Size: 3x3x4 (Hollow)", "Controller (front middle at bottom)",
+ "16x Heating Coils (two middle Layers, hollow)",
+ "1x Input (one of bottom)",
+ "1x Output (one of bottom)",
+ "1x Energy Hatch (one of bottom)",
+ "1x Maintenance Hatch (one of bottom)",
+ "1x Muffler Hatch (top middle)",
+ "Heat Proof Machine Casings for the rest"};
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[11], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)};
+ }
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[11]};
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ElectricBlastFurnace.png");
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sBlastRecipes;
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ for (int i = 0; i < tInputList.size() - 1; i++) {
+ for (int j = i + 1; j < tInputList.size(); j++) {
+ if (GT_Utility.areStacksEqual((ItemStack) tInputList.get(i), (ItemStack) tInputList.get(j))) {
+ if (((ItemStack) tInputList.get(i)).stackSize >= ((ItemStack) tInputList.get(j)).stackSize) {
+ tInputList.remove(j--);
+ } else {
+ tInputList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+ ItemStack[] tInputs = (ItemStack[]) Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
+
+ ArrayList<FluidStack> tFluidList = getStoredFluids();
+ for (int i = 0; i < tFluidList.size() - 1; i++) {
+ for (int j = i + 1; j < tFluidList.size(); j++) {
+ if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) {
+ if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) {
+ tFluidList.remove(j--);
+ } else {
+ tFluidList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+ FluidStack[] tFluids = (FluidStack[]) Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1);
+ if (tInputList.size() > 0) {
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
+ if ((tRecipe != null) && (this.mHeatingCapacity >= tRecipe.mSpecialValue) && (tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) {
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ if (tRecipe.mEUt <= 16) {
+ this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
+ } else {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = tRecipe.mDuration;
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)};
+ updateSlots();
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+
+ this.mHeatingCapacity = 0;
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) {
+ return false;
+ }
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 2, zDir)) {
+ return false;
+ }
+ addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 3, zDir), 11);
+
+ byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 2, zDir);
+ switch (tUsedMeta) {
+ case 12:
+ this.mHeatingCapacity = 1800;
+ break;
+ case 13:
+ this.mHeatingCapacity = 2700;
+ break;
+ case 14:
+ this.mHeatingCapacity = 3600;
+ break;
+ default:
+ return false;
+ }
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if ((i != 0) || (j != 0)) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != GregTech_API.sBlockCasings1) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) != tUsedMeta) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != GregTech_API.sBlockCasings1) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != tUsedMeta) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 3, zDir + j) != GregTech_API.sBlockCasings1) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 3, zDir + j) != 11) {
+ return false;
+ }
+ }
+ }
+ }
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if ((xDir + i != 0) || (zDir + j != 0)) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j);
+ if ((!addMaintenanceToMachineList(tTileEntity, 11)) && (!addInputToMachineList(tTileEntity, 11)) && (!addOutputToMachineList(tTileEntity, 11)) && (!addEnergyInputToMachineList(tTileEntity, 11))) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != GregTech_API.sBlockCasings1) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 11) {
+ return false;
+ }
+ }
+ }
+ }
+ }
+ this.mHeatingCapacity += 100 * (GT_Utility.getTier(getMaxInputVoltage()) - 2);
+ return true;
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 10;
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 2;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java
new file mode 100644
index 0000000000..39c795b409
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java
@@ -0,0 +1,452 @@
+package miscutil.core.xmod.gregtech.common.tileentities.machines.multi;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import miscutil.core.block.ModBlocks;
+import miscutil.core.util.Utils;
+import miscutil.core.xmod.gregtech.api.gui.GUI_MultiMachine;
+import miscutil.core.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
+import miscutil.core.xmod.gregtech.api.objects.GregtechRenderedTexture;
+import miscutil.core.xmod.gregtech.api.util.GregtechRecipe;
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+
+public class GregtechMetaTileEntityIndustrialCentrifuge
+extends GregtechMeta_MultiBlockBase {
+ private static boolean controller;
+ private int mLevel = 2;
+
+ public GregtechMetaTileEntityIndustrialCentrifuge(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntityIndustrialCentrifuge(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntityIndustrialCentrifuge(this.mName);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[]{
+ "Controller Block for the Industrial Centrifuge",
+ "Size: 3x3x3 (Hollow)",
+ "Controller (Front Center)",
+ "1x Maintenance Hatch (Rear Center)",
+ "The rest can be placed anywhere except the Front",
+ "1x Input Hatch",
+ "1x Output Hatch",
+ "1x Input Bus",
+ "1x Output Bus",
+ "1x [EV] Energy Hatch (Can be higher Tier)",
+ "Needs a Turbine Item (inside controller GUI)",
+ "Centrifuge Casings for the rest (16 at least)",};
+ }
+
+ /*@Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{GregtechTextures.BlockIcons.GT_CASING_BLOCKS[0], new GT_RenderedTexture(aActive ? Textures.BlockIcons.LARGETURBINE_ACTIVE5 : Textures.BlockIcons.LARGETURBINE5)};
+ }
+ return new ITexture[]{GregtechTextures.BlockIcons.GT_CASING_BLOCKS[0]};
+ }*/
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? new GregtechRenderedTexture(Textures.BlockIcons.LARGETURBINE_ACTIVE5) : new GregtechRenderedTexture(Textures.BlockIcons.LARGETURBINE5) : Textures.BlockIcons.CASING_BLOCKS[57]};
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "CokeOven.png");
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes;
+ }
+
+ /*@Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }*/
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ GT_Recipe mLastRecipe;
+
+ /*@Override
+ public boolean checkRecipe(ItemStack aStack) {
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+
+ GT_Recipe.GT_Recipe_Map map = getRecipeMap();
+ for (int i = 0; i < tInputList.size() - 1; i++) {
+ for (int j = i + 1; j < tInputList.size(); j++) {
+ if (GT_Utility.areStacksEqual((ItemStack) tInputList.get(i), (ItemStack) tInputList.get(j))) {
+ if (((ItemStack) tInputList.get(i)).stackSize >= ((ItemStack) tInputList.get(j)).stackSize) {
+ tInputList.remove(j--);
+ } else {
+ tInputList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+ ItemStack[] tInputs = (ItemStack[]) Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
+
+ ArrayList<FluidStack> tFluidList = getStoredFluids();
+ for (int i = 0; i < tFluidList.size() - 1; i++) {
+ for (int j = i + 1; j < tFluidList.size(); j++) {
+ if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) {
+ if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) {
+ tFluidList.remove(j--);
+ } else {
+ tFluidList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+ FluidStack[] tFluids = (FluidStack[]) Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1);
+ if (tInputList.size() > 0 || tFluids.length > 0) {
+ GT_Recipe tRecipe = map.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
+ if (tRecipe != null) {
+ if (tRecipe.mFluidInputs != null) {
+
+ }
+ mLastRecipe = tRecipe;
+ this.mEUt = 0;
+ this.mOutputItems = null;
+ this.mOutputFluids = null;
+ int machines = Math.min(16, mInventory[1].stackSize);
+ int i = 0;
+ for (; i < machines; i++) {
+ if (!tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) {
+ if (i == 0) {
+ return false;
+ }
+ break;
+ }
+ }
+ this.mMaxProgresstime = tRecipe.mDuration;
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ if (tRecipe.mEUt <= 16) {
+ this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
+ } else {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = tRecipe.mDuration;
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 4;
+ }
+ }
+ this.mEUt *= i;
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+ ItemStack[] tOut = new ItemStack[tRecipe.mOutputs.length];
+ for (int h = 0; h < tRecipe.mOutputs.length; h++) {
+ tOut[h] = tRecipe.getOutput(h).copy();
+ tOut[h].stackSize = 0;
+ }
+ FluidStack tFOut = null;
+ if (tRecipe.getFluidOutput(0) != null) tFOut = tRecipe.getFluidOutput(0).copy();
+ for (int f = 0; f < tOut.length; f++) {
+ if (tRecipe.mOutputs[f] != null && tOut[f] != null) {
+ for (int g = 0; g < i; g++) {
+ if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f))
+ tOut[f].stackSize += tRecipe.mOutputs[f].stackSize;
+ }
+ }
+ }
+ if (tFOut != null) {
+ int tSize = tFOut.amount;
+ tFOut.amount = tSize * i;
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ List<ItemStack> overStacks = new ArrayList<ItemStack>();
+ for (int f = 0; f < tOut.length; f++) {
+ if (tOut[f].getMaxStackSize() < tOut[f].stackSize) {
+ while (tOut[f].getMaxStackSize() < tOut[f].stackSize) {
+ ItemStack tmp = tOut[f].copy();
+ tmp.stackSize = tmp.getMaxStackSize();
+ tOut[f].stackSize = tOut[f].stackSize - tOut[f].getMaxStackSize();
+ overStacks.add(tmp);
+ }
+ }
+ }
+ if (overStacks.size() > 0) {
+ ItemStack[] tmp = new ItemStack[overStacks.size()];
+ tmp = overStacks.toArray(tmp);
+ tOut = ArrayUtils.addAll(tOut, tmp);
+ }
+ List<ItemStack> tSList = new ArrayList<ItemStack>();
+ for (ItemStack tS : tOut) {
+ if (tS.stackSize > 0) tSList.add(tS);
+ }
+ tOut = tSList.toArray(new ItemStack[tSList.size()]);
+ this.mOutputItems = tOut;
+ this.mOutputFluids = new FluidStack[]{tFOut};
+ updateSlots();
+ return true;
+ }
+ }
+ return false;
+ }*/
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ for (int i = 0; i < tInputList.size() - 1; i++) {
+ for (int j = i + 1; j < tInputList.size(); j++) {
+ if (GT_Utility.areStacksEqual((ItemStack) tInputList.get(i), (ItemStack) tInputList.get(j))) {
+ if (((ItemStack) tInputList.get(i)).stackSize >= ((ItemStack) tInputList.get(j)).stackSize) {
+ tInputList.remove(j--);
+ } else {
+ tInputList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+ ItemStack[] tInputs = (ItemStack[]) Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
+
+ ArrayList<FluidStack> tFluidList = getStoredFluids();
+ for (int i = 0; i < tFluidList.size() - 1; i++) {
+ for (int j = i + 1; j < tFluidList.size(); j++) {
+ if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) {
+ if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) {
+ tFluidList.remove(j--);
+ } else {
+ tFluidList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+ FluidStack[] tFluids = (FluidStack[]) Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1);
+ if (tInputList.size() > 0) {
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ GT_Recipe tRecipe = GregtechRecipe.Gregtech_Recipe_Map.sCokeOvenRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
+ if ((tRecipe != null) && (this.mLevel >= tRecipe.mSpecialValue) && (tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) {
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ if (tRecipe.mEUt <= 16) {
+ this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
+ } else {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = tRecipe.mDuration;
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)};
+ this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)};
+ updateSlots();
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @SuppressWarnings("static-method")
+ public Block getCasingBlock() {
+ return ModBlocks.blockCasingsMisc;
+ }
+
+ @SuppressWarnings("static-method")
+ public byte getCasingMeta() {
+ return 0;
+ }
+
+ @SuppressWarnings("static-method")
+ public byte getCasingTextureIndex() {
+ return 0;
+ }
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int yDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetY;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ //Utils.LOG_WARNING("X:"+xDir+" Y:"+yDir+" Z:"+zDir);
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
+ return false;
+ }
+ int tAmount = 0;
+ for (int i = -1; i < 2; i++) { //X-Dir
+ for (int j = -1; j < 2; j++) { //Z-Dir
+ for (int h = -1; h < 2; h++) { //Y-Dir
+ if ((h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))) {
+
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
+ //Utils.LOG_INFO("X:"+tTileEntity.getXCoord()+" Y:"+tTileEntity.getYCoord()+" Z:"+tTileEntity.getZCoord());
+ if ((!addMaintenanceToMachineList(tTileEntity, 57)) && (!addInputToMachineList(tTileEntity, 57)) && (!addOutputToMachineList(tTileEntity, 57)) && (!addEnergyInputToMachineList(tTileEntity, 57))) {
+
+ //Maintenance Hatch
+ if ((tTileEntity != null) && (tTileEntity.getMetaTileEntity() != null)) {
+ if (tTileEntity.getXCoord() == aBaseMetaTileEntity.getXCoord() && tTileEntity.getYCoord() == aBaseMetaTileEntity.getYCoord() && tTileEntity.getZCoord() == (aBaseMetaTileEntity.getZCoord()+2)) {
+ if ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Maintenance)) {
+ Utils.LOG_INFO("MAINT HATCH IN CORRECT PLACE");
+ this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) tTileEntity.getMetaTileEntity());
+ ((GT_MetaTileEntity_Hatch) tTileEntity.getMetaTileEntity()).mMachineBlock = getCasingTextureIndex();
+ } else {
+ return false;
+ }
+ }
+ else {
+ Utils.LOG_INFO("MAINT HATCH IN WRONG PLACE");
+ }
+ }
+
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 0) {
+ return false;
+ }
+ tAmount++;
+
+ }
+ }
+ }
+ }
+ }
+ return tAmount >= 16;
+ }
+
+ @SuppressWarnings("static-method")
+ public boolean ignoreController(Block tTileEntity) {
+ if (!controller && tTileEntity == GregTech_API.sBlockMachines) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
+
+ /*@Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }*/
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 2;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
+ private boolean checkStructure(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack){
+
+ Utils.LOG_INFO("structure checking");
+ int x = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int y = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetY;
+ int z = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ Utils.LOG_INFO("X:"+x+" Y:"+y+" Z:"+z);
+
+ //North case
+ int hatchMaintainence[] = {x, y, z+2};
+ int hatchInputBus[] = {x+1, y, z+1};
+ int hatchOutputBus[] = {x-1, y, z+1};
+ int hatchInput[] = {x+1, y+1, z+1};
+ int hatchOutput[] = {x-1, y+1, z+1};
+ int hatchEnergy[] = {x, y+1, z+2};
+
+ //South case
+ int hatchMaintainence0[] = {x, y, z-2};
+ int hatchInputBus0[] = {x-1, y, z-1};
+ int hatchOutputBus0[] = {x+1, y, z-1};
+ int hatchInput0[] = {x-1, y+1, z-1};
+ int hatchOutput0[] = {x+1, y+1, z-1};
+ int hatchEnergy0[] = {x, y+1, z-2};
+
+
+ //East case
+ int hatchMaintainence1[] = {x+2, y, z};
+ int hatchInputBus1[] = {x+1, y, z+1};
+ int hatchOutputBus1[] = {x+1, y, z-1};
+ int hatchInput1[] = {x+1, y+1, z+1};
+ int hatchOutput1[] = {x+1, y+1, z-1};
+ int hatchEnergy1[] = {x+2, y+1, z};
+
+ //West case
+ int hatchMaintainence2[] = {x-2, y, z};
+ int hatchInputBus2[] = {x-1, y, z-1};
+ int hatchOutputBus2[] = {x-1, y, z+1};
+ int hatchInput2[] = {x-1, y+1, z-1};
+ int hatchOutput2[] = {x-1, y+1, z+1};
+ int hatchEnergy2[] = {x-2, y+1, z};
+
+
+
+ /*//Maintenance Hatch
+ IGregTechTileEntity tTileEntityMaintenanceHatch = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 2);
+ if ((tTileEntityMaintenanceHatch != null) && (tTileEntityMaintenanceHatch.getMetaTileEntity() != null)) {
+ if ((tTileEntityMaintenanceHatch.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Maintenance)) {
+ this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) tTileEntityMaintenanceHatch.getMetaTileEntity());
+ ((GT_MetaTileEntity_Hatch) tTileEntityMaintenanceHatch.getMetaTileEntity()).mMachineBlock = getCasingTextureIndex();
+ } else {
+ return false;
+ }
+ }*/
+
+ /*//Energy Hatch
+ IGregTechTileEntity tTileEntityEnergyHatch = getBaseMetaTileEntity().getIGregTechTileEntity(i, h+1, j+2);
+ if ((tTileEntityEnergyHatch != null) && (tTileEntityEnergyHatch.getMetaTileEntity() != null)) {
+ if ((tTileEntityEnergyHatch.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Energy)) {
+ this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) tTileEntityEnergyHatch.getMetaTileEntity());
+ ((GT_MetaTileEntity_Hatch) tTileEntityEnergyHatch.getMetaTileEntity()).mMachineBlock = getCasingTextureIndex();
+ } else {
+ return false;
+ }
+ }*/
+
+
+
+
+ return false;
+ }
+} \ No newline at end of file
diff --git a/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCokeOven.java b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCokeOven.java
new file mode 100644
index 0000000000..a3d046d73d
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCokeOven.java
@@ -0,0 +1,267 @@
+package miscutil.core.xmod.gregtech.common.tileentities.machines.multi;
+
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import miscutil.core.block.ModBlocks;
+import miscutil.core.xmod.gregtech.api.gui.GUI_MultiMachine;
+import miscutil.core.xmod.gregtech.api.util.GregtechRecipe;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+
+public class GregtechMetaTileEntityIndustrialCokeOven
+ extends GT_MetaTileEntity_MultiBlockBase {
+ private int mLevel = 0;
+
+ public GregtechMetaTileEntityIndustrialCokeOven(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntityIndustrialCokeOven(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntityIndustrialCokeOven(this.mName);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[]{"Smelts up to 6-18 Items at once",
+ "Controller Block for the Multi Smelter",
+ "Size: 3x3x3 (Hollow)",
+ "Controller (front middle at bottom)",
+ "8x Heating Coils (middle Layer, hollow)",
+ "1x Input (one of bottom)",
+ "1x Output (one of bottom)",
+ "1x Energy Hatch (one of bottom)",
+ "1x Maintenance Hatch (one of bottom)",
+ "1x Muffler Hatch (top middle)",
+ "Heat Proof Machine Casings for the rest"};
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[58], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER)};
+ }
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[58]};
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "CokeOven.png");
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GregtechRecipe.Gregtech_Recipe_Map.sCokeOvenRecipes;
+
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ for (int i = 0; i < tInputList.size() - 1; i++) {
+ for (int j = i + 1; j < tInputList.size(); j++) {
+ if (GT_Utility.areStacksEqual((ItemStack) tInputList.get(i), (ItemStack) tInputList.get(j))) {
+ if (((ItemStack) tInputList.get(i)).stackSize >= ((ItemStack) tInputList.get(j)).stackSize) {
+ tInputList.remove(j--);
+ } else {
+ tInputList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+ ItemStack[] tInputs = (ItemStack[]) Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
+
+ ArrayList<FluidStack> tFluidList = getStoredFluids();
+ for (int i = 0; i < tFluidList.size() - 1; i++) {
+ for (int j = i + 1; j < tFluidList.size(); j++) {
+ if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) {
+ if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) {
+ tFluidList.remove(j--);
+ } else {
+ tFluidList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+ FluidStack[] tFluids = (FluidStack[]) Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1);
+ if (tInputList.size() > 0) {
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ GT_Recipe tRecipe = GregtechRecipe.Gregtech_Recipe_Map.sCokeOvenRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
+ if ((tRecipe != null) && (this.mLevel >= tRecipe.mSpecialValue) && (tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) {
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ if (tRecipe.mEUt <= 16) {
+ this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
+ } else {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = tRecipe.mDuration;
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)};
+ this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)};
+ updateSlots();
+ return true;
+ }
+ }
+ return false;
+ }
+ /*public boolean checkRecipe(ItemStack aStack) {
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ if (!tInputList.isEmpty()) {
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(getMaxInputVoltage()));
+
+ int j = 0;
+ this.mOutputItems = new ItemStack[12 * this.mLevel];
+ for (int i = 0; (i < 100) && (j < this.mOutputItems.length); i++) {
+ if (null != (this.mOutputItems[j] = GT_ModHandler.getSmeltingOutput((ItemStack) tInputList.get(i % tInputList.size()), true, null))) {
+ j++;
+ }
+ }
+ if (j > 0) {
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ this.mEUt = (-4 * (1 << tTier - 1) * (1 << tTier - 1) * this.mLevel);
+ this.mMaxProgresstime = Math.max(1, 512 / (1 << tTier - 1));
+ }
+ updateSlots();
+ return true;
+ }
+ return false;
+ }*/
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ int xr = aBaseMetaTileEntity.getXCoord();
+ int yr = aBaseMetaTileEntity.getYCoord();
+ int zr = aBaseMetaTileEntity.getZCoord();
+ this.mLevel = 0;
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) {
+ return false;
+ }
+ addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 2, zDir), 1);
+
+ byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 1, zDir);
+ switch (tUsedMeta) {
+ case 2:
+ this.mLevel = 1;
+ break;
+ case 3:
+ this.mLevel = 2;
+ break;
+ default:
+ return false;
+ }
+ this.mOutputItems = new ItemStack[12 * this.mLevel];
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if ((i != 0) || (j != 0)) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != ModBlocks.blockCasingsMisc) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != tUsedMeta) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != ModBlocks.blockCasingsMisc) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) != 1) {
+ return false;
+ }
+ }
+ }
+ }
+ for (int i = -1; i < 2; i++) {
+ xr = aBaseMetaTileEntity.getXCoord();
+ yr = aBaseMetaTileEntity.getYCoord();
+ zr = aBaseMetaTileEntity.getZCoord();
+ //Utils.LOG_WARNING("STEP 1 - x ["+xr+"] y ["+yr+"] z ["+zr+"]");
+ for (int j = -1; j < 2; j++) {
+ xr = aBaseMetaTileEntity.getXCoord();
+ yr = aBaseMetaTileEntity.getYCoord();
+ zr = aBaseMetaTileEntity.getZCoord();
+ //Utils.LOG_WARNING("STEP 2 - x ["+xr+"] y ["+yr+"] z ["+zr+"]");
+ if ((xDir + i != 0) || (zDir + j != 0)) {
+ xr = aBaseMetaTileEntity.getXCoord();
+ yr = aBaseMetaTileEntity.getYCoord();
+ zr = aBaseMetaTileEntity.getZCoord();
+ //Utils.LOG_WARNING("STEP 3 - x ["+xr+"] y ["+yr+"] z ["+zr+"]");
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j);
+ if ((!addMaintenanceToMachineList(tTileEntity, 1)) && (!addInputToMachineList(tTileEntity, 1)) && (!addOutputToMachineList(tTileEntity, 1)) && (!addEnergyInputToMachineList(tTileEntity, 1))) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != ModBlocks.blockCasingsMisc) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 1) {
+ return false;
+ }
+ }
+ }
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 24;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialPlatePress.java b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialPlatePress.java
new file mode 100644
index 0000000000..9f09b8db55
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialPlatePress.java
@@ -0,0 +1,249 @@
+package miscutil.core.xmod.gregtech.common.tileentities.machines.multi;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Textures;
+import gregtech.api.gui.GT_GUIContainer_MultiMachine;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+
+import java.util.ArrayList;
+
+import miscutil.core.util.Utils;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+
+public class GregtechMetaTileEntityIndustrialPlatePress
+extends GT_MetaTileEntity_MultiBlockBase {
+ public GregtechMetaTileEntityIndustrialPlatePress(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntityIndustrialPlatePress(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntityIndustrialPlatePress(this.mName);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[]{"Controller Block for the Vacuum Freezer", "Size: 3x3x3 (Hollow)", "Controller (front centered)", "1x Input (anywhere)", "1x Output (anywhere)", "1x Energy Hatch (anywhere)", "1x Maintenance Hatch (anywhere)", "Frost Proof Casings for the rest (16 at least!)"};
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[17], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER)};
+ }
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[17]};
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png");
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sBenderRecipes;
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ for (ItemStack tInput : tInputList) {
+ long tVoltage = getMaxInputVoltage();
+ byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], null, new ItemStack[]{tInput});
+ if (tRecipe != null) {
+ if (tRecipe.isRecipeInputEqual(true, null, new ItemStack[]{tInput})) {
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ if (tRecipe.mEUt <= 16) {
+ this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
+ this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
+ } else {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = tRecipe.mDuration;
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)};
+ updateSlots();
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /*public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
+ return false;
+ }
+ int stepX = 0;
+ int stepY = 0;
+ int stepZ = 0;
+
+ int tAmount = 0;
+ for (int i = -1; i < 2; i++) {
+ stepX=+i;
+ for (int j = -1; j < 2; j++) {
+ stepZ=+j;
+ for (int h = -1; h < 2; h++) {
+ stepY=+h;
+ Utils.LOG_INFO("X:"+stepX);
+ Utils.LOG_INFO("Y:"+stepY);
+ Utils.LOG_INFO("Z:"+stepZ);
+ Utils.LOG_INFO("Block Facing - X:"+xDir+" Z:"+zDir);
+ Utils.LOG_INFO("(h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))");
+ Utils.LOG_INFO(" "+(h != 0)+" || "+(((xDir + i != 0)+" || "+(zDir + j != 0))+" && "+((i != 0)+" || "+(j != 0))));
+ try {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
+ Utils.LOG_INFO("IPP - RESULT - ? - ["+tTileEntity.getXCoord()+"] y ["+tTileEntity.getYCoord()+"] z ["+tTileEntity.getZCoord()+"] || i ["+i+"] j ["+j+"] h ["+h+"]");
+ } catch(Throwable t){Utils.LOG_INFO("Bad move");
+ }
+ if ((h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
+ if ((!addMaintenanceToMachineList(tTileEntity, 17)) && (!addInputToMachineList(tTileEntity, 17)) && (!addOutputToMachineList(tTileEntity, 17)) && (!addEnergyInputToMachineList(tTileEntity, 17))) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings2) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 1) {
+ return false;
+ }
+ tAmount++;
+ }
+ }
+
+ }
+ }
+ }
+ return tAmount >= 16;
+ }*/
+
+
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) {
+ return false;
+ }
+ int stepX = aBaseMetaTileEntity.getXCoord();
+ int stepY = aBaseMetaTileEntity.getYCoord();
+ int stepZ = aBaseMetaTileEntity.getZCoord();
+ int temp = 0;
+
+ Utils.LOG_INFO("Starting Block located @ "+"[X:"+stepX+"][Y:"+stepY+"][Z:"+stepZ+"]");
+
+ int tAmount = 0;
+ switch (xDir) {
+ case -1:
+ stepX++;
+ Utils.LOG_INFO("Modifying stepX + accomodate a "+xDir+" xDir - [X:"+stepX+"][Y:"+stepY+"][Z:"+stepZ+"]");
+ break;
+
+ case 1:
+ stepX--;
+ Utils.LOG_INFO("Modifying stepX - accomodate a "+xDir+" xDir - [X:"+stepX+"][Y:"+stepY+"][Z:"+stepZ+"]");
+ break;
+ }
+ switch (zDir) {
+ case -1:
+ stepZ++;
+ Utils.LOG_INFO("Modifying stepZ + accomodate a "+zDir+" zDir - [X:"+stepX+"][Y:"+stepY+"][Z:"+stepZ+"]");
+ break;
+
+ case 1:
+ stepZ--;
+ Utils.LOG_INFO("Modifying stepZ - accomodate a "+zDir+" zDir - [X:"+stepX+"][Y:"+stepY+"][Z:"+stepZ+"]");
+ break;
+ }
+
+ for (int i = stepX-1; i <= stepX+1; i++){
+ for (int j = stepZ-1; j <= stepZ+1; j++){
+ for (int h = stepY-1; h <= stepY+1; h++){
+
+
+ Utils.LOG_INFO("Block Facing - X:"+xDir+" Z:"+zDir);
+ Utils.LOG_INFO("(h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))");
+ Utils.LOG_INFO(" "+(h != 0)+" || "+(((xDir + i != 0)+" || "+(zDir + j != 0))+" && "+((i != 0)+" || "+(j != 0))));
+
+ try {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
+ Utils.LOG_INFO("IPP - RESULT - ? - ["+tTileEntity.getXCoord()+"] y ["+tTileEntity.getYCoord()+"] z ["+tTileEntity.getZCoord()+"] || i ["+i+"] j ["+j+"] h ["+h+"]");
+ } catch(Throwable t){Utils.LOG_INFO("Checking Non-Hatch/Bus Block/Casing");
+ }
+ if ((h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
+ if ((!addMaintenanceToMachineList(tTileEntity, 17)) && (!addInputToMachineList(tTileEntity, 17)) && (!addOutputToMachineList(tTileEntity, 17)) && (!addEnergyInputToMachineList(tTileEntity, 17))) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings2) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 1) {
+ return false;
+ }
+ tAmount++;
+ }
+ }
+ }
+ }
+ }
+
+
+ return tAmount >= 16;
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIronBlastFurnace.java b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIronBlastFurnace.java
new file mode 100644
index 0000000000..6b60c40a48
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIronBlastFurnace.java
@@ -0,0 +1,369 @@
+package miscutil.core.xmod.gregtech.common.tileentities.machines.multi;
+
+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.core.xmod.gregtech.api.gui.CONTAINER_IronBlastFurnace;
+import miscutil.core.xmod.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/core/xmod/gregtech/common/tools/TOOL_Gregtech_Base.java b/src/Java/miscutil/core/xmod/gregtech/common/tools/TOOL_Gregtech_Base.java
new file mode 100644
index 0000000000..4d7228c4a5
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/common/tools/TOOL_Gregtech_Base.java
@@ -0,0 +1,168 @@
+package miscutil.core.xmod.gregtech.common.tools;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.damagesources.GT_DamageSources;
+
+import java.util.List;
+
+import miscutil.core.xmod.gregtech.api.interfaces.internal.Interface_ToolStats;
+import miscutil.core.xmod.gregtech.api.items.Gregtech_MetaTool;
+import net.minecraft.block.Block;
+import net.minecraft.enchantment.Enchantment;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.stats.AchievementList;
+import net.minecraft.util.DamageSource;
+import net.minecraft.util.EntityDamageSource;
+import net.minecraft.util.IChatComponent;
+import net.minecraftforge.event.world.BlockEvent;
+
+public abstract class TOOL_Gregtech_Base
+implements Interface_ToolStats {
+ public static final Enchantment[] FORTUNE_ENCHANTMENT = {Enchantment.fortune};
+ public static final Enchantment[] LOOTING_ENCHANTMENT = {Enchantment.looting};
+ public static final Enchantment[] ZERO_ENCHANTMENTS = new Enchantment[0];
+ public static final int[] ZERO_ENCHANTMENT_LEVELS = new int[0];
+
+ @Override
+ public int getToolDamagePerBlockBreak() {
+ return 100;
+ }
+
+ @Override
+ public int getToolDamagePerDropConversion() {
+ return 100;
+ }
+
+ @Override
+ public int getToolDamagePerContainerCraft() {
+ return 800;
+ }
+
+ @Override
+ public int getToolDamagePerEntityAttack() {
+ return 200;
+ }
+
+ @Override
+ public float getSpeedMultiplier() {
+ return 1.0F;
+ }
+
+ @Override
+ public float getMaxDurabilityMultiplier() {
+ return 1.0F;
+ }
+
+ @Override
+ public int getHurtResistanceTime(int aOriginalHurtResistance, Entity aEntity) {
+ return aOriginalHurtResistance;
+ }
+
+ @Override
+ public String getMiningSound() {
+ return null;
+ }
+
+ @Override
+ public String getCraftingSound() {
+ return null;
+ }
+
+ @Override
+ public String getEntityHitSound() {
+ return null;
+ }
+
+ @Override
+ public String getBreakingSound() {
+ return (String) GregTech_API.sSoundList.get(Integer.valueOf(0));
+ }
+
+ @Override
+ public int getBaseQuality() {
+ return 0;
+ }
+
+ @Override
+ public boolean canBlock() {
+ return false;
+ }
+
+ @Override
+ public boolean isCrowbar() {
+ return false;
+ }
+
+ @Override
+ public boolean isWrench() {
+ return false;
+ }
+
+ @Override
+ public boolean isWeapon() {
+ return false;
+ }
+
+ @Override
+ public boolean isRangedWeapon() {
+ return false;
+ }
+
+ @Override
+ public boolean isMiningTool() {
+ return true;
+ }
+
+ @Override
+ public DamageSource getDamageSource(EntityLivingBase aPlayer, Entity aEntity) {
+ return GT_DamageSources.getCombatDamage((aPlayer instanceof EntityPlayer) ? "player" : "mob", aPlayer, (aEntity instanceof EntityLivingBase) ? getDeathMessage(aPlayer, (EntityLivingBase) aEntity) : null);
+ }
+
+ public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) {
+ return new EntityDamageSource((aPlayer instanceof EntityPlayer) ? "player" : "mob", aPlayer).func_151519_b(aEntity);
+ }
+
+ @Override
+ public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) {
+ return 0;
+ }
+
+ @Override
+ public ItemStack getBrokenItem(ItemStack aStack) {
+ return null;
+ }
+
+ @Override
+ public Enchantment[] getEnchantments(ItemStack aStack) {
+ return ZERO_ENCHANTMENTS;
+ }
+
+ @Override
+ public int[] getEnchantmentLevels(ItemStack aStack) {
+ return ZERO_ENCHANTMENT_LEVELS;
+ }
+
+ @Override
+ public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer) {
+ aPlayer.triggerAchievement(AchievementList.openInventory);
+ aPlayer.triggerAchievement(AchievementList.mineWood);
+ aPlayer.triggerAchievement(AchievementList.buildWorkBench);
+ }
+
+ @Override
+ public void onStatsAddedToTool(Gregtech_MetaTool aItem, int aID) {
+ }
+
+ @Override
+ public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) {
+ return aOriginalDamage;
+ }
+
+ @Override
+ public float getMagicDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) {
+ return aOriginalDamage;
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/common/tools/TOOL_Gregtech_BaseMultiblockItem.java b/src/Java/miscutil/core/xmod/gregtech/common/tools/TOOL_Gregtech_BaseMultiblockItem.java
new file mode 100644
index 0000000000..421d8d02a8
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/common/tools/TOOL_Gregtech_BaseMultiblockItem.java
@@ -0,0 +1,49 @@
+package miscutil.core.xmod.gregtech.common.tools;
+
+import gregtech.api.interfaces.IIconContainer;
+import miscutil.core.xmod.gregtech.api.items.Gregtech_MetaTool;
+import net.minecraft.block.Block;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.ChatComponentText;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.IChatComponent;
+
+public abstract class TOOL_Gregtech_BaseMultiblockItem extends TOOL_Gregtech_Base {
+ @Override
+ public abstract float getBaseDamage();
+
+ @Override
+ public boolean isMinableBlock(Block aBlock, byte aMetaData) {
+ return false;
+ }
+
+ @Override
+ public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) {
+ return aIsToolHead ? getTurbineIcon() : null;
+ }
+
+ @Override
+ public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) {
+ return aIsToolHead ? Gregtech_MetaTool.getPrimaryMaterial(aStack).mRGBa : null;
+ }
+
+ @Override
+ public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) {
+ return new ChatComponentText(EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + " put " + EnumChatFormatting.RED +
+ aEntity.getCommandSenderName() + "s" + EnumChatFormatting.WHITE + " head into a turbine");
+ }
+
+ public abstract IIconContainer getTurbineIcon();
+
+ @Override
+ public abstract float getSpeedMultiplier();
+
+ @Override
+ public abstract float getMaxDurabilityMultiplier();
+
+ @Override
+ public ItemStack getBrokenItem(ItemStack aStack) {
+ return null;
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/common/tools/TOOL_Gregtech_MaxEfficiencyMultiBlockItem.java b/src/Java/miscutil/core/xmod/gregtech/common/tools/TOOL_Gregtech_MaxEfficiencyMultiBlockItem.java
new file mode 100644
index 0000000000..c1c5c92212
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/common/tools/TOOL_Gregtech_MaxEfficiencyMultiBlockItem.java
@@ -0,0 +1,27 @@
+package miscutil.core.xmod.gregtech.common.tools;
+
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.IIconContainer;
+
+public class TOOL_Gregtech_MaxEfficiencyMultiBlockItem extends TOOL_Gregtech_BaseMultiblockItem {
+ @Override
+ public float getSpeedMultiplier() {
+ return 4.0F;
+ }
+
+ @Override
+ public float getMaxDurabilityMultiplier() {
+ return 4.0F;
+ }
+
+ @Override
+ public float getBaseDamage() {
+ return 3.0F;
+ }
+
+ @Override
+ public IIconContainer getTurbineIcon() {
+ return Textures.ItemIcons.TURBINE_HUGE;
+ }
+
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/loaders/Processing_Block.java b/src/Java/miscutil/core/xmod/gregtech/loaders/Processing_Block.java
new file mode 100644
index 0000000000..409be09a1f
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/loaders/Processing_Block.java
@@ -0,0 +1,107 @@
+package miscutil.core.xmod.gregtech.loaders;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.SubTag;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
+import miscutil.core.util.Utils;
+import miscutil.core.xmod.gregtech.api.enums.GregtechOrePrefixes;
+import miscutil.core.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+import miscutil.core.xmod.gregtech.api.interfaces.internal.Interface_OreRecipeRegistrator;
+import miscutil.core.xmod.gregtech.api.util.GregtechOreDictUnificator;
+import net.minecraft.item.ItemStack;
+
+public class Processing_Block implements Interface_OreRecipeRegistrator {
+
+ private boolean isGem = false;
+
+ public Processing_Block() {
+ GregtechOrePrefixes.block.add(this);
+ }
+
+ @Override
+ public void registerOre(GregtechOrePrefixes aPrefix, GT_Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
+ Utils.LOG_INFO("Processing Blocks");
+ GT_Values.RA.addCutterRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GregtechOreDictUnificator.get(GregtechOrePrefixes.plate, aMaterial, 9L), null, (int) Math.max(aMaterial.getMass() * 10L, 1L), 30);
+
+ ItemStack tStack1 = GregtechOreDictUnificator.get(GregtechOrePrefixes.ingot, aMaterial, 1L);
+ ItemStack tStack2 = GregtechOreDictUnificator.get(GregtechOrePrefixes.gem, aMaterial, 1L);
+ ItemStack tStack3 = GregtechOreDictUnificator.get(GregtechOrePrefixes.dust, aMaterial, 1L);
+
+ GT_ModHandler.removeRecipe(new ItemStack[]{GT_Utility.copyAmount(1L, new Object[]{aStack})});
+
+ if (tStack1 != null) {
+ GT_ModHandler.removeRecipe(new ItemStack[]{tStack1, tStack1, tStack1, tStack1, tStack1, tStack1, tStack1, tStack1, tStack1});
+ }
+ if (tStack2 != null) {
+ GT_ModHandler.removeRecipe(new ItemStack[]{tStack2, tStack2, tStack2, tStack2, tStack2, tStack2, tStack2, tStack2, tStack2});
+ }
+ if (tStack3 != null) {
+ GT_ModHandler.removeRecipe(new ItemStack[]{tStack3, tStack3, tStack3, tStack3, tStack3, tStack3, tStack3, tStack3, tStack3});
+ }
+ if (aMaterial.mStandardMoltenFluid != null) {
+ GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0L, new Object[0]), aMaterial.getMolten(1296L), GregtechOreDictUnificator.get(GregtechOrePrefixes.block, aMaterial, 1L), 288, 8);
+ }
+ if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.storageblockcrafting, GregtechOrePrefixes.block.get(aMaterial).toString(), false)) {
+ if ((tStack1 == null) && (tStack2 == null) && (tStack3 != null)){
+ GT_ModHandler.addCraftingRecipe(GregtechOreDictUnificator.get(GregtechOrePrefixes.block, aMaterial, 1L), new Object[]{"XXX", "XXX", "XXX", Character.valueOf('X'), GregtechOrePrefixes.dust.get(aMaterial)});
+ }
+ if (tStack2 != null){
+ GT_ModHandler.addCraftingRecipe(GregtechOreDictUnificator.get(GregtechOrePrefixes.block, aMaterial, 1L), new Object[]{"XXX", "XXX", "XXX", Character.valueOf('X'), GregtechOrePrefixes.gem.get(aMaterial)});
+ }
+ if (tStack1 != null) {
+ GT_ModHandler.addCraftingRecipe(GregtechOreDictUnificator.get(GregtechOrePrefixes.block, aMaterial, 1L), new Object[]{"XXX", "XXX", "XXX", Character.valueOf('X'), GregtechOrePrefixes.ingot.get(aMaterial)});
+ }
+ }
+
+ if (aMaterial.contains(SubTag.CRYSTAL) && !aMaterial.contains(SubTag.METAL)){
+ isGem = true;
+ }
+ else {
+ isGem = false;
+ }
+ //Ingot
+ if (tStack1 != null) {
+ tStack1.stackSize = 9;
+ }
+ //Gem
+ if (tStack2 != null && !isGem) {
+ tStack2.stackSize = 9;
+ }
+ else if (tStack2 != null && isGem) {
+ tStack2.stackSize = 0;
+ }
+ //Dust
+ if (tStack3 != null && !isGem) {
+ tStack3.stackSize = 9;
+ }
+ else if (tStack3 != null && isGem) {
+ tStack3.stackSize = 0;
+ }
+
+ //Gems in FORGE HAMMER
+ if (tStack2 != null && !isGem) {
+ tStack2.stackSize = 9;
+ GT_Values.RA.addForgeHammerRecipe(aStack, tStack2, 100, 24);
+ }
+ else if (tStack2 != null && isGem) {
+ tStack2.stackSize = 9;
+ GT_Values.RA.addForgeHammerRecipe(aStack, tStack2, 100, 24);
+ tStack2.stackSize = 0;
+ }
+
+
+ if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.storageblockdecrafting, GregtechOrePrefixes.block.get(aMaterial).toString(), tStack2 != null)) {
+ if (tStack3 != null)
+ GT_ModHandler.addShapelessCraftingRecipe(tStack3, new Object[]{GregtechOrePrefixes.block.get(aMaterial)});
+ if (tStack2 != null)
+ GT_ModHandler.addShapelessCraftingRecipe(tStack2, new Object[]{GregtechOrePrefixes.block.get(aMaterial)});
+ if (tStack1 != null) {
+ GT_ModHandler.addShapelessCraftingRecipe(tStack1, new Object[]{GregtechOrePrefixes.block.get(aMaterial)});
+ }
+ }
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/loaders/Processing_Ingot1.java b/src/Java/miscutil/core/xmod/gregtech/loaders/Processing_Ingot1.java
new file mode 100644
index 0000000000..cd1db13c57
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/loaders/Processing_Ingot1.java
@@ -0,0 +1,68 @@
+package miscutil.core.xmod.gregtech.loaders;
+
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.SubTag;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
+import miscutil.core.util.Utils;
+import miscutil.core.xmod.gregtech.api.enums.GregtechOrePrefixes;
+import miscutil.core.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+import miscutil.core.xmod.gregtech.api.interfaces.internal.Interface_OreRecipeRegistrator;
+import miscutil.core.xmod.gregtech.api.util.GregtechRecipeRegistrator;
+import net.minecraft.item.ItemStack;
+
+public class Processing_Ingot1 implements Interface_OreRecipeRegistrator {
+ public Processing_Ingot1() {
+ GregtechOrePrefixes.ingot.add(this);
+ }
+
+ @Override
+ public void registerOre(GregtechOrePrefixes aPrefix, GT_Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
+ Utils.LOG_INFO("Processing Ingots");
+ if (aMaterial.mFuelPower > 0) {
+ GT_Values.RA.addFuel(GT_Utility.copyAmount(1L, new Object[]{aStack}), null, aMaterial.mFuelPower, aMaterial.mFuelType);
+ }
+ GT_Values.RA.addBoxingRecipe(GT_Utility.copyAmount(16L, new Object[]{aStack}), ItemList.Crate_Empty.get(1L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.crateGtIngot, aMaterial, 1L), 100, 8);
+ GT_Values.RA.addUnboxingRecipe(GT_OreDictUnificator.get(OrePrefixes.crateGtIngot, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 16L), ItemList.Crate_Empty.get(1L, new Object[0]), 800, 1);
+
+ if (aMaterial.mStandardMoltenFluid != null)
+ GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0L, new Object[0]), aMaterial.getMolten(144L), GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L), 32, 8);
+ GregtechRecipeRegistrator.registerReverseFluidSmelting(aStack, aMaterial, aPrefix.mMaterialAmount, null);
+ GregtechRecipeRegistrator.registerReverseMacerating(aStack, aMaterial, aPrefix.mMaterialAmount, null, null, null, false);
+ if (aMaterial.mSmeltInto.mArcSmeltInto != aMaterial) {
+ GregtechRecipeRegistrator.registerReverseArcSmelting(GT_Utility.copyAmount(1L, new Object[]{aStack}), aMaterial, aPrefix.mMaterialAmount, null, null, null);
+ }
+ if (!aMaterial.contains(SubTag.NO_SMASHING)) {
+ GT_Values.RA.addWiremillRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_Utility.copy(new Object[]{GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 2L), GT_OreDictUnificator.get(OrePrefixes.wireFine, aMaterial, 8L)}), 100, 4);
+ GT_Values.RA.addForgeHammerRecipe(GT_Utility.copyAmount(2L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L), (int) Math.max(aMaterial.getMass(), 1L), 16);
+ GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L), (int) Math.max(aMaterial.getMass() * 1L, 1L), 24);
+ GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(2L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plateDouble, aMaterial, 1L), (int) Math.max(aMaterial.getMass() * 2L, 1L), 96);
+ GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(3L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plateTriple, aMaterial, 1L), (int) Math.max(aMaterial.getMass() * 3L, 1L), 96);
+ GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(4L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plateQuadruple, aMaterial, 1L), (int) Math.max(aMaterial.getMass() * 4L, 1L), 96);
+ GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(5L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plateQuintuple, aMaterial, 1L), (int) Math.max(aMaterial.getMass() * 5L, 1L), 96);
+ GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(9L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plateDense, aMaterial, 1L), (int) Math.max(aMaterial.getMass() * 9L, 1L), 96);
+ }
+
+
+ if (!GregtechOrePrefixes.block.isIgnored(aMaterial))
+ GT_ModHandler.addCompressionRecipe(GT_Utility.copyAmount(9L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.block, aMaterial, 1L));
+ if (!aMaterial.contains(SubTag.NO_WORKING))
+ GT_Values.RA.addLatheRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.dustSmall, aMaterial.mMacerateInto, 2L), (int) Math.max(aMaterial.getMass() * 5L, 1L), 16);
+ if (!aMaterial.contains(SubTag.NO_SMELTING)) {
+ GT_Values.RA.addAlloySmelterRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), ItemList.Shape_Mold_Nugget.get(0L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.nugget, aMaterial, 9L), 100, 1);
+ if ((GT_ModHandler.getSmeltingOutput(aStack, false, null) == null) && (GT_OreDictUnificator.get(OrePrefixes.nugget, aMaterial.mSmeltInto, 1L) != null) && (!GT_ModHandler.addSmeltingRecipe(aStack, GT_OreDictUnificator.get(OrePrefixes.nugget, aMaterial.mSmeltInto, 9L))))
+ GT_ModHandler.addShapelessCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.nugget, aMaterial.mSmeltInto, 9L), new Object[]{aOreDictName});
+ }
+ ItemStack tStack;
+ if ((null != (tStack = GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L))) && (
+ (aMaterial.mBlastFurnaceRequired) || (aMaterial.contains(SubTag.NO_SMELTING)))) {
+ GT_ModHandler.removeFurnaceSmelting(tStack);
+ }
+
+ GregtechRecipeRegistrator.registerUsagesForGT_Materials(GT_Utility.copyAmount(1L, new Object[]{aStack}), OrePrefixes.plate.get(aMaterial).toString(), !aMaterial.contains(SubTag.NO_SMASHING));
+
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/gregtech/loaders/Processing_Plate1.java b/src/Java/miscutil/core/xmod/gregtech/loaders/Processing_Plate1.java
new file mode 100644
index 0000000000..a63a938310
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/gregtech/loaders/Processing_Plate1.java
@@ -0,0 +1,56 @@
+package miscutil.core.xmod.gregtech.loaders;
+
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
+import miscutil.core.util.Utils;
+import miscutil.core.xmod.gregtech.api.enums.GregtechOrePrefixes;
+import miscutil.core.xmod.gregtech.api.interfaces.internal.Interface_OreRecipeRegistrator;
+import net.minecraft.item.ItemStack;
+
+public class Processing_Plate1 implements Interface_OreRecipeRegistrator {
+ public Processing_Plate1() {
+ GregtechOrePrefixes.plate.add(this);
+ }
+
+ @Override
+ public void registerOre(GregtechOrePrefixes aPrefix, GregtechOrePrefixes.GT_Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
+ Utils.LOG_INFO("Processing Plates");
+ GT_ModHandler.removeRecipeByOutput(aStack);
+ GT_ModHandler.removeRecipe(new ItemStack[]{aStack});
+
+ GT_Values.RA.addBoxingRecipe(GT_Utility.copyAmount(16L, new Object[]{aStack}), ItemList.Crate_Empty.get(1L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.crateGtPlate, aMaterial, 1L), 100, 8);
+ GT_Values.RA.addUnboxingRecipe(GT_OreDictUnificator.get(OrePrefixes.crateGtPlate, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 16L), ItemList.Crate_Empty.get(1L, new Object[0]), 800, 1);
+
+ GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, aMaterial, 1L), Materials.Tin.getMolten(32), GT_OreDictUnificator.get(OrePrefixes.rotor, aMaterial, 1L), 240, 24);
+ GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, aMaterial, 1L), Materials.Lead.getMolten(48), GT_OreDictUnificator.get(OrePrefixes.rotor, aMaterial, 1L), 240, 24);
+ GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, aMaterial, 1L), Materials.SolderingAlloy.getMolten(16), GT_OreDictUnificator.get(OrePrefixes.rotor, aMaterial, 1L), 240, 24);
+
+
+
+ if (aMaterial.mStandardMoltenFluid != null) {
+ GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Plate.get(0L, new Object[0]), aMaterial.getMolten(144L), GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L), 32, 8);
+ }
+
+
+ if (aMaterial.mFuelPower > 0)
+ GT_Values.RA.addFuel(GT_Utility.copyAmount(1L, new Object[]{aStack}), null, aMaterial.mFuelPower, aMaterial.mFuelType);
+ GT_Utility.removeSimpleIC2MachineRecipe(GT_Utility.copyAmount(9L, new Object[]{aStack}), GT_ModHandler.getCompressorRecipeList(), GT_OreDictUnificator.get(OrePrefixes.plateDense, aMaterial, 1L));
+ GT_Values.RA.addImplosionRecipe(GT_Utility.copyAmount(2L, new Object[]{aStack}), 2, GT_OreDictUnificator.get(OrePrefixes.compressed, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L));
+ if (!aMaterial.contains(gregtech.api.enums.SubTag.NO_WORKING)) {
+ GT_Values.RA.addLatheRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.lens, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.dustSmall, aMaterial, 1L), (int) Math.max(aMaterial.getMass() / 2L, 1L), 16);
+ }
+ if (!aMaterial.contains(gregtech.api.enums.SubTag.NO_SMASHING)) {
+ GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.foil, aMaterial, 4L), (int) Math.max(aMaterial.getMass() * 1L, 1L), 24);
+ GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(2L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plateDouble, aMaterial, 1L), (int) Math.max(aMaterial.getMass() * 2L, 1L), 96);
+ GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(3L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plateTriple, aMaterial, 1L), (int) Math.max(aMaterial.getMass() * 3L, 1L), 96);
+ GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(4L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plateQuadruple, aMaterial, 1L), (int) Math.max(aMaterial.getMass() * 4L, 1L), 96);
+ GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(5L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plateQuintuple, aMaterial, 1L), (int) Math.max(aMaterial.getMass() * 5L, 1L), 96);
+ GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(9L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plateDense, aMaterial, 1L), (int) Math.max(aMaterial.getMass() * 9L, 1L), 96);
+ }
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/growthcraft/HANDLER_Growthcraft.java b/src/Java/miscutil/core/xmod/growthcraft/HANDLER_Growthcraft.java
new file mode 100644
index 0000000000..f227b1dc46
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/growthcraft/HANDLER_Growthcraft.java
@@ -0,0 +1,65 @@
+package miscutil.core.xmod.growthcraft;
+
+import growthcraft.api.cellar.Booze;
+import growthcraft.api.cellar.CellarRegistry;
+import growthcraft.cellar.block.BlockFluidBooze;
+import growthcraft.cellar.item.ItemBoozeBottle;
+import growthcraft.cellar.item.ItemBoozeBucketDEPRECATED;
+import growthcraft.cellar.item.ItemBucketBooze;
+import growthcraft.cellar.utils.BoozeRegistryHelper;
+import growthcraft.core.GrowthCraftCore;
+import growthcraft.hops.GrowthCraftHops;
+import miscutil.core.lib.LoadedMods;
+import net.minecraft.init.Items;
+import net.minecraft.item.Item;
+import net.minecraft.potion.Potion;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidRegistry;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public class HANDLER_Growthcraft {
+
+ public static BlockFluidBooze[] jackDanielsWhiskeyFluids;
+ public static Item jackDaniels;
+ public static Item jackDanielsSeeds;
+ public static Item jackDanielsWhiskey;
+ public static Item jackDanielsWhiskeyBucket_deprecated;
+ public static ItemBucketBooze[] jackDanielsWhiskeyBuckets;
+ public static Fluid[] jackDanielsWhiskeyBooze;
+ //private static int internalColour = FluidRegistry.getFluid("fluidJackDaniels").getColor();
+ private static int internalColour = 0000000;
+
+ //Run me during Pre-Init
+ public static void preInit(){
+ if (LoadedMods.Growthcraft || GrowthCraftCore.instance != null){
+ start();
+ }
+ }
+
+ private static void start(){
+ jackDaniels = GrowthCraftHops.hops;
+ jackDanielsSeeds = GrowthCraftHops.hopSeeds;
+
+ jackDanielsWhiskeyBooze = new Booze[5];
+ jackDanielsWhiskeyFluids = new BlockFluidBooze[jackDanielsWhiskeyBooze.length];
+ jackDanielsWhiskeyBuckets = new ItemBucketBooze[jackDanielsWhiskeyBooze.length];
+ BoozeRegistryHelper.initializeBooze(jackDanielsWhiskeyBooze, jackDanielsWhiskeyFluids, jackDanielsWhiskeyBuckets, "grc.jackDanielsWhiskey", internalColour);
+
+ jackDanielsWhiskey = new ItemBoozeBottle(6, -0.5F, jackDanielsWhiskeyBooze).setColor(internalColour).setTipsy(0.7F, 900).setPotionEffects(new int[] { Potion.digSpeed.id }, new int[] { 3600 });
+ jackDanielsWhiskeyBucket_deprecated = new ItemBoozeBucketDEPRECATED(jackDanielsWhiskeyBooze).setColor(internalColour);
+
+
+ //GameRegistry.registerItem(jackDaniels, "grc.jackDaniels");
+ //GameRegistry.registerItem(jackDanielsSeeds, "grc.jackDanielsSeeds");
+ GameRegistry.registerItem(jackDanielsWhiskey, "grc.jackDanielsWhiskey");
+ GameRegistry.registerItem(jackDanielsWhiskeyBucket_deprecated, "grc.jackDanielsWhiskey_bucket");
+
+ BoozeRegistryHelper.registerBooze(jackDanielsWhiskeyBooze, jackDanielsWhiskeyFluids, jackDanielsWhiskeyBuckets, jackDanielsWhiskey, "grc.jackDanielsWhiskey", jackDanielsWhiskeyBucket_deprecated);
+
+ CellarRegistry.instance().brew().addBrewing(FluidRegistry.WATER, Items.wheat, jackDanielsWhiskeyBooze[4], 200, 60, 0.4F);
+ CellarRegistry.instance().brew().addBrewing(jackDanielsWhiskeyBooze[4], jackDaniels, jackDanielsWhiskeyBooze[0], 350, 60, 0.1F);
+
+
+ }
+
+}
diff --git a/src/Java/miscutil/core/xmod/psychedelicraft/HANDLER_Psychedelicraft.java b/src/Java/miscutil/core/xmod/psychedelicraft/HANDLER_Psychedelicraft.java
new file mode 100644
index 0000000000..b4facc6a2d
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/psychedelicraft/HANDLER_Psychedelicraft.java
@@ -0,0 +1,27 @@
+package miscutil.core.xmod.psychedelicraft;
+
+import miscutil.core.lib.LoadedMods;
+import miscutil.core.xmod.psychedelicraft.fluids.PS_Fluids;
+
+
+public class HANDLER_Psychedelicraft {
+
+ public static void preInit(){
+ if (LoadedMods.Psychedelicraft){
+ PS_Fluids.registerFluids();
+ }
+ }
+
+ public static void init(){
+ if (LoadedMods.Psychedelicraft){
+ PS_Fluids.registerAlcohols();
+ }
+ }
+
+ public static void postInit(){
+ if (LoadedMods.Psychedelicraft){
+
+ }
+ }
+
+}
diff --git a/src/Java/miscutil/core/xmod/psychedelicraft/fluids/PS_Fluids.java b/src/Java/miscutil/core/xmod/psychedelicraft/fluids/PS_Fluids.java
new file mode 100644
index 0000000000..5bba9d5857
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/psychedelicraft/fluids/PS_Fluids.java
@@ -0,0 +1,54 @@
+package miscutil.core.xmod.psychedelicraft.fluids;
+
+import ivorius.ivtoolkit.gui.IntegerRange;
+import ivorius.psychedelicraft.blocks.TileEntityMashTub;
+import ivorius.psychedelicraft.config.PSConfig;
+import ivorius.psychedelicraft.fluids.FluidAlcohol;
+import ivorius.psychedelicraft.items.PSItems;
+import miscutil.core.lib.CORE;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.oredict.ShapelessOreRecipe;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public class PS_Fluids {
+
+ public static FluidAlcohol alcJD;
+
+ public static void registerFluids(){
+ alcJD = new FluidAlcohol("psc_JD", 2, 0.45D, 1.9D, 0.15D, PSConfig.alcInfoPotato);
+ alcJD.addName(CORE.MODID + ":" + "drinkMash", new IntegerRange(0, -1), new IntegerRange(0, 0));
+ alcJD.addName(CORE.MODID + ":" + "drinkAgedWhisky", new IntegerRange(0, 0), new IntegerRange(1, -1));
+ alcJD.addName(CORE.MODID + ":" + "drinkWhisky", new IntegerRange(0, -1), new IntegerRange(1, -1));
+ alcJD.setColor(-1426150904);
+ alcJD.setStillIconName(CORE.MODID + ":" + "mash_still");
+ alcJD.setFlowingIconName(CORE.MODID + ":" + "mash_flow");
+ alcJD.addIcon(new IntegerRange(-1, -1), new IntegerRange(0, 3), new IntegerRange(2, -1), CORE.MODID + ":" + "clear_still", CORE.MODID + ":" + "clear_flow");
+ alcJD.addIcon(new IntegerRange(-1, -1), new IntegerRange(4, 13), new IntegerRange(0, -1), CORE.MODID + ":" + "rum_semi_mature_still", CORE.MODID + ":" + "rum_semi_mature_flow");
+ alcJD.addIcon(new IntegerRange(-1, -1), new IntegerRange(14, -1), new IntegerRange(0, -1), CORE.MODID + ":" + "rum_mature_still", CORE.MODID + ":" + "rum_mature_flow");
+ FluidRegistry.registerFluid(alcJD);
+ }
+
+ public static void registerAlcohols(){
+ addMashTubRecipe2(new FluidStack(alcJD, TileEntityMashTub.MASH_TUB_CAPACITY), new Object[] { "foodPotato", "foodPotato", "foodPotato", "foodPotato", "foodPotato", "foodBanana", "foodBanana", "foodBanana" });
+ }
+
+ private static void addMashTubRecipe2(FluidStack fluid, Object... ingredients)
+ {
+ ItemStack mashTubStack = new ItemStack(PSItems.itemMashTub);
+ PSItems.itemMashTub.fill(mashTubStack, fluid, true);
+
+ Object[] ing = new Object[ingredients.length + 1];
+ System.arraycopy(ingredients, 0, ing, 1, ingredients.length);
+ ing[0] = new ItemStack(PSItems.itemMashTub);
+
+ addShapelessRecipe2(mashTubStack, ing);
+ }
+
+ private static void addShapelessRecipe2(ItemStack output, Object... params)
+ {
+ GameRegistry.addRecipe(new ShapelessOreRecipe(output, params));
+ }
+
+}
diff --git a/src/Java/miscutil/core/xmod/thermalfoundation/HANDLER_ThermalFoundation.java b/src/Java/miscutil/core/xmod/thermalfoundation/HANDLER_ThermalFoundation.java
new file mode 100644
index 0000000000..7c77d413e5
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/thermalfoundation/HANDLER_ThermalFoundation.java
@@ -0,0 +1,37 @@
+package miscutil.core.xmod.thermalfoundation;
+
+import miscutil.core.lib.LoadedMods;
+import miscutil.core.xmod.thermalfoundation.block.TF_Blocks;
+import miscutil.core.xmod.thermalfoundation.fluid.TF_Fluids;
+import miscutil.core.xmod.thermalfoundation.item.TF_Items;
+import miscutil.core.xmod.thermalfoundation.recipe.TF_Gregtech_Recipes;
+
+public class HANDLER_ThermalFoundation {
+
+ public static void preInit(){
+ if (LoadedMods.CoFHCore){
+ TF_Fluids.preInit();
+ TF_Items.preInit();
+ TF_Blocks.preInit();
+ }
+ }
+
+ public static void init(){
+ if (LoadedMods.CoFHCore){
+ TF_Fluids.init();
+ TF_Blocks.init();
+ TF_Items.init();
+ }
+ }
+
+ public static void postInit(){
+ if (LoadedMods.CoFHCore){
+ TF_Fluids.postInit();
+ TF_Items.postInit();
+ TF_Blocks.postInit();
+ if(LoadedMods.Gregtech){
+ TF_Gregtech_Recipes.run();
+ }
+ }
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/thermalfoundation/block/TF_Block_Fluid_Cryotheum.java b/src/Java/miscutil/core/xmod/thermalfoundation/block/TF_Block_Fluid_Cryotheum.java
new file mode 100644
index 0000000000..8865da678e
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/thermalfoundation/block/TF_Block_Fluid_Cryotheum.java
@@ -0,0 +1,188 @@
+package miscutil.core.xmod.thermalfoundation.block;
+
+import java.util.Random;
+
+import miscutil.core.lib.CORE;
+import miscutil.core.xmod.thermalfoundation.fluid.TF_Fluids;
+import net.minecraft.block.Block;
+import net.minecraft.block.material.MapColor;
+import net.minecraft.block.material.Material;
+import net.minecraft.block.material.MaterialLiquid;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.monster.EntityBlaze;
+import net.minecraft.entity.monster.EntityCreeper;
+import net.minecraft.entity.monster.EntitySnowman;
+import net.minecraft.entity.monster.EntityZombie;
+import net.minecraft.init.Blocks;
+import net.minecraft.potion.Potion;
+import net.minecraft.potion.PotionEffect;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+import cofh.core.fluid.BlockFluidInteractive;
+import cofh.lib.util.BlockWrapper;
+import cofh.lib.util.helpers.DamageHelper;
+import cofh.lib.util.helpers.ServerHelper;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public class TF_Block_Fluid_Cryotheum
+ extends BlockFluidInteractive
+{
+ Random random = new Random();
+ public static final int LEVELS = 5;
+ public static final Material materialFluidCryotheum = new MaterialLiquid(MapColor.iceColor);
+ private static boolean enableSourceFall = true;
+ private static boolean effect = true;
+
+ public TF_Block_Fluid_Cryotheum()
+ {
+ super(CORE.MODID, TF_Fluids.fluidCryotheum, materialFluidCryotheum, "cryotheum");
+ setQuantaPerBlock(5);
+ setTickRate(15);
+
+ setHardness(1000.0F);
+ setLightOpacity(1);
+ setParticleColor(0.15F, 0.7F, 1.0F);
+ }
+
+ public boolean preInit()
+ {
+ GameRegistry.registerBlock(this, "FluidCryotheum");
+
+ addInteraction(Blocks.grass, Blocks.dirt);
+ addInteraction(Blocks.water, 0, Blocks.ice);
+ addInteraction(Blocks.water, Blocks.snow);
+ addInteraction(Blocks.flowing_water, 0, Blocks.ice);
+ addInteraction(Blocks.flowing_water, Blocks.snow);
+ addInteraction(Blocks.lava, 0, Blocks.obsidian);
+ addInteraction(Blocks.lava, Blocks.stone);
+ addInteraction(Blocks.flowing_lava, 0, Blocks.obsidian);
+ addInteraction(Blocks.flowing_lava, Blocks.stone);
+ addInteraction(Blocks.leaves, Blocks.air);
+ addInteraction(Blocks.tallgrass, Blocks.air);
+ addInteraction(Blocks.fire, Blocks.air);
+ //addInteraction(TFBlocks.blockFluidGlowstone, 0, Blocks.glowstone);
+
+ String str1 = "Fluid.Cryotheum";
+ String str2 = "Enable this for Fluid Cryotheum to be worse than lava, except cold.";
+ effect = true;
+
+ str2 = "Enable this for Fluid Cryotheum Source blocks to gradually fall downwards.";
+ enableSourceFall = true;
+
+ return true;
+ }
+
+ public void onEntityCollidedWithBlock(World paramWorld, int paramInt1, int paramInt2, int paramInt3, Entity paramEntity)
+ {
+ paramEntity.extinguish();
+ if (!effect) {
+ return;
+ }
+ if ((paramEntity.motionY < -0.05D) || (paramEntity.motionY > 0.05D)) {
+ paramEntity.motionY *= 0.05D;
+ }
+ if ((paramEntity.motionZ < -0.05D) || (paramEntity.motionZ > 0.05D)) {
+ paramEntity.motionZ *= 0.05D;
+ }
+ if ((paramEntity.motionX < -0.05D) || (paramEntity.motionX > 0.05D)) {
+ paramEntity.motionX *= 0.05D;
+ }
+ if (ServerHelper.isClientWorld(paramWorld)) {
+ return;
+ }
+ if (paramWorld.getTotalWorldTime() % 8L != 0L) {
+ return;
+ }
+ if (((paramEntity instanceof EntityZombie)) || ((paramEntity instanceof EntityCreeper)))
+ {
+ EntitySnowman localEntitySnowman = new EntitySnowman(paramWorld);
+ localEntitySnowman.setLocationAndAngles(paramEntity.posX, paramEntity.posY, paramEntity.posZ, paramEntity.rotationYaw, paramEntity.rotationPitch);
+ paramWorld.spawnEntityInWorld(localEntitySnowman);
+
+ paramEntity.setDead();
+ }
+ else if (/*((paramEntity instanceof EntityBlizz)) ||*/((paramEntity instanceof EntitySnowman)))
+ {
+ ((EntityLivingBase)paramEntity).addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 120, 0));
+ ((EntityLivingBase)paramEntity).addPotionEffect(new PotionEffect(Potion.regeneration.id, 120, 0));
+ }
+ else if ((paramEntity instanceof EntityBlaze))
+ {
+ paramEntity.attackEntityFrom(DamageHelper.cryotheum, 10.0F);
+ }
+ else
+ {
+ boolean bool = paramEntity.velocityChanged;
+ paramEntity.attackEntityFrom(DamageHelper.cryotheum, 2.0F);
+ paramEntity.velocityChanged = bool;
+ }
+ }
+
+ public int getLightValue(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3)
+ {
+ return TF_Fluids.fluidCryotheum.getLuminosity();
+ }
+
+ public void updateTick(World paramWorld, int paramInt1, int paramInt2, int paramInt3, Random paramRandom)
+ {
+ if (effect) {
+ checkForInteraction(paramWorld, paramInt1, paramInt2, paramInt3);
+ }
+ if ((enableSourceFall) && (paramWorld.getBlockMetadata(paramInt1, paramInt2, paramInt3) == 0))
+ {
+ Block localBlock = paramWorld.getBlock(paramInt1, paramInt2 + this.densityDir, paramInt3);
+ int i = paramWorld.getBlockMetadata(paramInt1, paramInt2 + this.densityDir, paramInt3);
+ if ((localBlock == this) && (i != 0))
+ {
+ paramWorld.setBlock(paramInt1, paramInt2 + this.densityDir, paramInt3, this, 0, 3);
+ paramWorld.setBlockToAir(paramInt1, paramInt2, paramInt3);
+ return;
+ }
+ }
+ super.updateTick(paramWorld, paramInt1, paramInt2, paramInt3, paramRandom);
+ }
+
+ protected void checkForInteraction(World paramWorld, int paramInt1, int paramInt2, int paramInt3)
+ {
+ if (paramWorld.getBlock(paramInt1, paramInt2, paramInt3) != this) {
+ return;
+ }
+ int i = paramInt1;
+ int j = paramInt2;
+ int k = paramInt3;
+ for (int m = 0; m < 6; m++)
+ {
+ i = paramInt1 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][0];
+ j = paramInt2 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][1];
+ k = paramInt3 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][2];
+
+ interactWithBlock(paramWorld, i, j, k);
+ }
+ interactWithBlock(paramWorld, paramInt1 - 1, paramInt2, paramInt3 - 1);
+ interactWithBlock(paramWorld, paramInt1 - 1, paramInt2, paramInt3 + 1);
+ interactWithBlock(paramWorld, paramInt1 + 1, paramInt2, paramInt3 - 1);
+ interactWithBlock(paramWorld, paramInt1 + 1, paramInt2, paramInt3 + 1);
+ }
+
+ protected void interactWithBlock(World paramWorld, int paramInt1, int paramInt2, int paramInt3)
+ {
+ Block localBlock = paramWorld.getBlock(paramInt1, paramInt2, paramInt3);
+ if ((localBlock == Blocks.air) || (localBlock == this)) {
+ return;
+ }
+ int i = paramWorld.getBlockMetadata(paramInt1, paramInt2, paramInt3);
+ if (hasInteraction(localBlock, i))
+ {
+ BlockWrapper localBlockWrapper = getInteraction(localBlock, i);
+ paramWorld.setBlock(paramInt1, paramInt2, paramInt3, localBlockWrapper.block, localBlockWrapper.metadata, 3);
+ }
+ else if ((paramWorld.isSideSolid(paramInt1, paramInt2, paramInt3, ForgeDirection.UP)) && (paramWorld.isAirBlock(paramInt1, paramInt2 + 1, paramInt3)))
+ {
+ paramWorld.setBlock(paramInt1, paramInt2 + 1, paramInt3, Blocks.snow_layer, 0, 3);
+ }
+ }
+
+ protected void triggerInteractionEffects(World paramWorld, int paramInt1, int paramInt2, int paramInt3) {}
+}
diff --git a/src/Java/miscutil/core/xmod/thermalfoundation/block/TF_Block_Fluid_Pyrotheum.java b/src/Java/miscutil/core/xmod/thermalfoundation/block/TF_Block_Fluid_Pyrotheum.java
new file mode 100644
index 0000000000..2b3234f511
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/thermalfoundation/block/TF_Block_Fluid_Pyrotheum.java
@@ -0,0 +1,181 @@
+package miscutil.core.xmod.thermalfoundation.block;
+
+import java.util.Random;
+
+import miscutil.core.lib.CORE;
+import miscutil.core.xmod.thermalfoundation.fluid.TF_Fluids;
+import net.minecraft.block.Block;
+import net.minecraft.block.material.MapColor;
+import net.minecraft.block.material.Material;
+import net.minecraft.block.material.MaterialLiquid;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.monster.EntityCreeper;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+import cofh.core.fluid.BlockFluidInteractive;
+import cofh.lib.util.BlockWrapper;
+import cofh.lib.util.helpers.ServerHelper;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public class TF_Block_Fluid_Pyrotheum
+ extends BlockFluidInteractive
+{
+ Random random = new Random();
+ public static final int LEVELS = 5;
+ public static final Material materialFluidPyrotheum = new MaterialLiquid(MapColor.tntColor);
+ private static boolean effect = true;
+ private static boolean enableSourceFall = true;
+
+ public TF_Block_Fluid_Pyrotheum()
+ {
+ super(CORE.MODID, TF_Fluids.fluidPyrotheum, Material.lava, "pyrotheum");
+ setQuantaPerBlock(5);
+ setTickRate(10);
+
+ setHardness(1000.0F);
+ setLightOpacity(1);
+ setParticleColor(1.0F, 0.7F, 0.15F);
+ }
+
+ public boolean preInit()
+ {
+ GameRegistry.registerBlock(this, "FluidPyrotheum");
+
+ addInteraction(Blocks.cobblestone, Blocks.stone);
+ addInteraction(Blocks.grass, Blocks.dirt);
+ addInteraction(Blocks.sand, Blocks.glass);
+ addInteraction(Blocks.water, Blocks.stone);
+ addInteraction(Blocks.flowing_water, Blocks.stone);
+ addInteraction(Blocks.clay, Blocks.hardened_clay);
+ addInteraction(Blocks.ice, Blocks.stone);
+ addInteraction(Blocks.snow, Blocks.air);
+ addInteraction(Blocks.snow_layer, Blocks.air);
+ for (int i = 0; i < 8; i++) {
+ addInteraction(Blocks.stone_stairs, i, Blocks.stone_brick_stairs, i);
+ }
+ String str1 = "Fluid.Pyrotheum";
+ String str2 = "Enable this for Fluid Pyrotheum to be worse than lava.";
+ effect = true;
+
+ str2 = "Enable this for Fluid Pyrotheum Source blocks to gradually fall downwards.";
+ enableSourceFall = true;
+
+ return true;
+ }
+
+ public void onEntityCollidedWithBlock(World paramWorld, int paramInt1, int paramInt2, int paramInt3, Entity paramEntity)
+ {
+ if (!effect) {
+ return;
+ }
+ if (ServerHelper.isClientWorld(paramWorld)) {
+ return;
+ }
+ if (!(paramEntity instanceof EntityPlayer)) {
+ if ((paramEntity instanceof EntityCreeper))
+ {
+ paramWorld.createExplosion(paramEntity, paramEntity.posX, paramEntity.posY, paramEntity.posZ, 6.0F, paramEntity.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing"));
+ paramEntity.setDead();
+ }
+ }
+ }
+
+ public int getLightValue(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3)
+ {
+ return TF_Fluids.fluidPyrotheum.getLuminosity();
+ }
+
+ public int getFireSpreadSpeed(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3, ForgeDirection paramForgeDirection)
+ {
+ return effect ? 800 : 0;
+ }
+
+ public int getFlammability(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3, ForgeDirection paramForgeDirection)
+ {
+ return 0;
+ }
+
+ public boolean isFlammable(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3, ForgeDirection paramForgeDirection)
+ {
+ return (effect) && (paramForgeDirection.ordinal() > ForgeDirection.UP.ordinal()) && (paramIBlockAccess.getBlock(paramInt1, paramInt2 - 1, paramInt3) != this);
+ }
+
+ public boolean isFireSource(World paramWorld, int paramInt1, int paramInt2, int paramInt3, ForgeDirection paramForgeDirection)
+ {
+ return effect;
+ }
+
+ public void updateTick(World paramWorld, int paramInt1, int paramInt2, int paramInt3, Random paramRandom)
+ {
+ if (effect) {
+ checkForInteraction(paramWorld, paramInt1, paramInt2, paramInt3);
+ }
+ if ((enableSourceFall) && (paramWorld.getBlockMetadata(paramInt1, paramInt2, paramInt3) == 0))
+ {
+ Block localBlock = paramWorld.getBlock(paramInt1, paramInt2 + this.densityDir, paramInt3);
+ int i = paramWorld.getBlockMetadata(paramInt1, paramInt2 + this.densityDir, paramInt3);
+ if (((localBlock == this) && (i != 0)) || (localBlock.isFlammable(paramWorld, paramInt1, paramInt2 + this.densityDir, paramInt3, ForgeDirection.UP)))
+ {
+ paramWorld.setBlock(paramInt1, paramInt2 + this.densityDir, paramInt3, this, 0, 3);
+ paramWorld.setBlockToAir(paramInt1, paramInt2, paramInt3);
+ return;
+ }
+ }
+ super.updateTick(paramWorld, paramInt1, paramInt2, paramInt3, paramRandom);
+ }
+
+ protected void checkForInteraction(World paramWorld, int paramInt1, int paramInt2, int paramInt3)
+ {
+ if (paramWorld.getBlock(paramInt1, paramInt2, paramInt3) != this) {
+ return;
+ }
+ int i = paramInt1;
+ int j = paramInt2;
+ int k = paramInt3;
+ for (int m = 0; m < 6; m++)
+ {
+ i = paramInt1 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][0];
+ j = paramInt2 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][1];
+ k = paramInt3 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][2];
+
+ interactWithBlock(paramWorld, i, j, k);
+ }
+ interactWithBlock(paramWorld, paramInt1 - 1, paramInt2, paramInt3 - 1);
+ interactWithBlock(paramWorld, paramInt1 - 1, paramInt2, paramInt3 + 1);
+ interactWithBlock(paramWorld, paramInt1 + 1, paramInt2, paramInt3 - 1);
+ interactWithBlock(paramWorld, paramInt1 + 1, paramInt2, paramInt3 + 1);
+ }
+
+ protected void interactWithBlock(World paramWorld, int paramInt1, int paramInt2, int paramInt3)
+ {
+ Block localBlock = paramWorld.getBlock(paramInt1, paramInt2, paramInt3);
+ if ((localBlock == Blocks.air) || (localBlock == this)) {
+ return;
+ }
+ int i = paramWorld.getBlockMetadata(paramInt1, paramInt2, paramInt3);
+ if (hasInteraction(localBlock, i))
+ {
+ BlockWrapper localBlockWrapper = getInteraction(localBlock, i);
+ paramWorld.setBlock(paramInt1, paramInt2, paramInt3, localBlockWrapper.block, localBlockWrapper.metadata, 3);
+ triggerInteractionEffects(paramWorld, paramInt1, paramInt2, paramInt3);
+ }
+ else if (localBlock.isFlammable(paramWorld, paramInt1, paramInt2, paramInt3, ForgeDirection.UP))
+ {
+ paramWorld.setBlock(paramInt1, paramInt2, paramInt3, Blocks.fire);
+ }
+ else if ((paramWorld.isSideSolid(paramInt1, paramInt2, paramInt3, ForgeDirection.UP)) && (paramWorld.isAirBlock(paramInt1, paramInt2 + 1, paramInt3)))
+ {
+ paramWorld.setBlock(paramInt1, paramInt2 + 1, paramInt3, Blocks.fire, 0, 3);
+ }
+ }
+
+ protected void triggerInteractionEffects(World paramWorld, int paramInt1, int paramInt2, int paramInt3)
+ {
+ if (this.random.nextInt(16) == 0) {
+ paramWorld.playSoundEffect(paramInt1 + 0.5F, paramInt2 + 0.5F, paramInt3 + 0.5F, "random.fizz", 0.5F, 2.2F + (paramWorld.rand.nextFloat() - paramWorld.rand.nextFloat()) * 0.8F);
+ }
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/thermalfoundation/block/TF_Blocks.java b/src/Java/miscutil/core/xmod/thermalfoundation/block/TF_Blocks.java
new file mode 100644
index 0000000000..68c893170f
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/thermalfoundation/block/TF_Blocks.java
@@ -0,0 +1,26 @@
+package miscutil.core.xmod.thermalfoundation.block;
+
+import cofh.core.fluid.BlockFluidCoFHBase;
+
+public class TF_Blocks
+{
+
+ public static BlockFluidCoFHBase blockFluidPyrotheum;
+ public static BlockFluidCoFHBase blockFluidCryotheum;
+
+
+ public static void preInit()
+ {
+ blockFluidPyrotheum = new TF_Block_Fluid_Pyrotheum();
+ blockFluidCryotheum = new TF_Block_Fluid_Cryotheum();
+ blockFluidPyrotheum.preInit();
+ blockFluidCryotheum.preInit();
+ }
+
+ public static void init() {}
+
+ public static void postInit()
+ {
+
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/thermalfoundation/fluid/TF_Fluids.java b/src/Java/miscutil/core/xmod/thermalfoundation/fluid/TF_Fluids.java
new file mode 100644
index 0000000000..db73b110c8
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/thermalfoundation/fluid/TF_Fluids.java
@@ -0,0 +1,53 @@
+package miscutil.core.xmod.thermalfoundation.fluid;
+
+import miscutil.core.xmod.thermalfoundation.item.TF_Items;
+import net.minecraft.block.BlockDispenser;
+import net.minecraft.init.Items;
+import net.minecraft.item.EnumRarity;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidRegistry;
+import cofh.core.util.fluid.DispenserEmptyBucketHandler;
+import cofh.core.util.fluid.DispenserFilledBucketHandler;
+
+public class TF_Fluids
+{
+ public static Fluid fluidPyrotheum;
+ public static Fluid fluidCryotheum;
+
+ public static void preInit()
+ {
+
+ if (FluidRegistry.getFluid("pyrotheum") == null){
+ fluidPyrotheum = new Fluid("pyrotheum").setLuminosity(15).setDensity(2000).setViscosity(1200).setTemperature(4000).setRarity(EnumRarity.rare);
+ registerFluid(fluidPyrotheum, "pyrotheum");
+ }
+ else {
+ fluidPyrotheum = FluidRegistry.getFluid("pyrotheum");
+ }
+ if (FluidRegistry.getFluid("cryotheum") == null){
+ fluidCryotheum = new Fluid("cryotheum").setLuminosity(0).setDensity(4000).setViscosity(3000).setTemperature(50).setRarity(EnumRarity.rare);
+ registerFluid(fluidCryotheum, "cryotheum");
+ }
+ else {
+ fluidCryotheum = FluidRegistry.getFluid("cryotheum");
+ }
+ }
+
+ public static void init() {}
+
+ public static void postInit() {}
+
+ public static void registerFluid(Fluid paramFluid, String paramString)
+ {
+ if (!FluidRegistry.isFluidRegistered(paramString)) {
+ FluidRegistry.registerFluid(paramFluid);
+ }
+ paramFluid = FluidRegistry.getFluid(paramString);
+ }
+
+ public static void registerDispenserHandlers()
+ {
+ BlockDispenser.dispenseBehaviorRegistry.putObject(TF_Items.itemBucket, new DispenserFilledBucketHandler());
+ BlockDispenser.dispenseBehaviorRegistry.putObject(Items.bucket, new DispenserEmptyBucketHandler());
+ }
+}
diff --git a/src/Java/miscutil/core/xmod/thermalfoundation/item/TF_Items.java b/src/Java/miscutil/core/xmod/thermalfoundation/item/TF_Items.java
new file mode 100644
index 0000000000..99febd00db
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/thermalfoundation/item/TF_Items.java
@@ -0,0 +1,79 @@
+package miscutil.core.xmod.thermalfoundation.item;
+
+import miscutil.core.creative.AddToCreativeTab;
+import miscutil.core.util.item.UtilsItems;
+import miscutil.core.xmod.thermalfoundation.block.TF_Blocks;
+import miscutil.core.xmod.thermalfoundation.fluid.TF_Fluids;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidContainerRegistry;
+import cofh.core.item.ItemBase;
+import cofh.core.item.ItemBucket;
+import cofh.core.util.energy.FurnaceFuelHandler;
+import cofh.core.util.fluid.BucketHandler;
+import cofh.lib.util.helpers.ItemHelper;
+
+public class TF_Items {
+
+ public static ItemBase itemMaterial;
+ public static ItemStack rodBlizz;
+ public static ItemStack dustBlizz;
+ public static ItemStack dustPyrotheum;
+ public static ItemStack dustCryotheum;
+ public static ItemBucket itemBucket;
+ public static ItemStack bucketPyrotheum;
+ public static ItemStack bucketCryotheum;
+
+ public static ItemStack itemDustBlizz;
+ public static ItemStack itemDustPyrotheum;
+ public static ItemStack itemDustCryotheum;
+ public static ItemStack itemRodBlizz;
+
+ public static void preInit(){
+
+
+ itemBucket = (ItemBucket)new ItemBucket("MiscUtils").setUnlocalizedName("bucket").setCreativeTab(AddToCreativeTab.tabMisc);
+ itemMaterial = (ItemBase)new ItemBase("MiscUtils").setUnlocalizedName("material").setCreativeTab(AddToCreativeTab.tabMisc);
+
+
+ bucketPyrotheum = itemBucket.addOreDictItem(1, "bucketPyrotheum");
+ bucketCryotheum = itemBucket.addOreDictItem(2, "bucketCryotheum");
+ rodBlizz = itemMaterial.addOreDictItem(1, "rodBlizz");
+ dustBlizz = itemMaterial.addOreDictItem(2, "dustBlizz");
+ dustPyrotheum = itemMaterial.addOreDictItem(3, "dustPyrotheum");
+ dustCryotheum = itemMaterial.addOreDictItem(4, "dustCryotheum");
+
+ FurnaceFuelHandler.registerFuel(dustPyrotheum, 2400);
+
+
+ itemRodBlizz = UtilsItems.simpleMetaStack(itemMaterial, 1, 1);
+ itemDustBlizz = UtilsItems.simpleMetaStack(itemMaterial, 2, 1);
+ itemDustPyrotheum = UtilsItems.simpleMetaStack(itemMaterial, 3, 1);
+ itemDustCryotheum = UtilsItems.simpleMetaStack(itemMaterial, 4, 1);
+
+
+
+ }
+
+ public static void init(){
+
+ BucketHandler.registerBucket(TF_Blocks.blockFluidPyrotheum, 0, bucketPyrotheum);
+ BucketHandler.registerBucket(TF_Blocks.blockFluidCryotheum, 0, bucketCryotheum);
+ FluidContainerRegistry.registerFluidContainer(TF_Fluids.fluidPyrotheum, bucketPyrotheum, FluidContainerRegistry.EMPTY_BUCKET);
+ FluidContainerRegistry.registerFluidContainer(TF_Fluids.fluidCryotheum, bucketCryotheum, FluidContainerRegistry.EMPTY_BUCKET);
+
+
+ }
+
+ public static void postInit(){
+
+ ItemHelper.addRecipe(ItemHelper.ShapelessRecipe(ItemHelper.cloneStack(dustPyrotheum, 1), new Object[] { "dustCoal", "dustSulfur", "dustRedstone", "dustBlaze" }));
+ ItemHelper.addRecipe(ItemHelper.ShapelessRecipe(ItemHelper.cloneStack(dustCryotheum, 1), new Object[] { Items.snowball, "dustSaltpeter", "dustRedstone", "dustBlizz" }));
+ ItemHelper.addRecipe(ItemHelper.ShapelessRecipe(ItemHelper.cloneStack(dustCryotheum, 1), new Object[] { Items.snowball, "dustNitor", "dustRedstone", "dustBlizz" }));
+ //ItemHelper.addRecipe(ItemHelper.ShapelessRecipe(ItemHelper.cloneStack(dustBlizz, 2), new Object[] { "rodBlizz" }));
+
+
+
+ }
+
+}
diff --git a/src/Java/miscutil/core/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java b/src/Java/miscutil/core/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java
new file mode 100644
index 0000000000..dc35a59927
--- /dev/null
+++ b/src/Java/miscutil/core/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java
@@ -0,0 +1,62 @@
+package miscutil.core.xmod.thermalfoundation.recipe;
+
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+import miscutil.core.util.Utils;
+import miscutil.core.util.item.UtilsItems;
+import miscutil.core.xmod.thermalfoundation.item.TF_Items;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fluids.FluidStack;
+
+public class TF_Gregtech_Recipes {
+
+ public static void run(){
+ start();
+ }
+
+ private static void start(){
+ //Get Items to work with
+ ItemStack dust_Cryotheum = TF_Items.itemDustCryotheum.copy();
+ ItemStack dust_Pyrotheum = TF_Items.itemDustPyrotheum.copy();
+ ItemStack dust_Blizz = TF_Items.itemDustBlizz.copy();
+ ItemStack dust_Blizz3 = UtilsItems.simpleMetaStack(TF_Items.itemMaterial, 2, 3);
+ ItemStack rod_Blizz = TF_Items.itemRodBlizz.copy();
+ FluidStack moltenRedstone = getFluidStack("molten.redstone", 250);
+
+ //Gelid Cryotheum
+ Utils.LOG_INFO("Adding Recipes for Gelid Cryotheum");
+ GT_Values.RA.addFluidExtractionRecipe(dust_Cryotheum, GT_Values.NI, getFluidStack("cryotheum", 250), 10000, 200, 240);
+ GT_Values.RA.addChemicalBathRecipe((GT_OreDictUnificator.get(OrePrefixes.ore, Materials.Cinnabar, 1L)), getFluidStack("cryotheum", 200), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cinnabar, 3L), GT_Values.NI, GT_Values.NI, null, 400, 30);
+
+ //Blizz Powder
+ Utils.LOG_INFO("Adding Recipes for Blizz Powder");
+ GT_Values.RA.addChemicalBathRecipe(new ItemStack(Items.snowball, 4), moltenRedstone, dust_Blizz, GT_Values.NI, GT_Values.NI, null, 400, 240);
+
+ //Blizz Rod
+ Utils.LOG_INFO("Adding Recipes for Blizz Rod");
+ GT_Values.RA.addVacuumFreezerRecipe(new ItemStack(Items.blaze_rod), rod_Blizz, (int) Math.max((Materials.Blaze.getMass()*4) * 3L, 1L));
+ GT_ModHandler.addPulverisationRecipe(rod_Blizz, dust_Blizz3, new ItemStack(Items.snowball, 1), 50, false);
+
+ //Blazing Pyrotheum
+ Utils.LOG_INFO("Adding Recipes for Blazing Pyrotheum");
+ GT_Values.RA.addFluidExtractionRecipe(dust_Pyrotheum, GT_Values.NI, getFluidStack("pyrotheum", 250), 10000, 200, 240);
+
+ }
+
+ private static FluidStack getFluidStack(String fluidName, int amount){
+ Utils.LOG_WARNING("Trying to get a fluid stack of "+fluidName);
+ try {
+ return FluidRegistry.getFluidStack(fluidName, amount);
+ }
+ catch (Throwable e){
+ return null;
+ }
+
+ }
+
+}