aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2017-01-20 02:07:40 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2017-01-20 02:07:40 +1000
commita6bb1b33da251f4a2ec7a6d6facb4864e9905341 (patch)
tree84d47440794cadd5c64598355903b123e18e0662
parent142fe00070526484862f15f3a125400a22a2fe96 (diff)
downloadGT5-Unofficial-a6bb1b33da251f4a2ec7a6d6facb4864e9905341.tar.gz
GT5-Unofficial-a6bb1b33da251f4a2ec7a6d6facb4864e9905341.tar.bz2
GT5-Unofficial-a6bb1b33da251f4a2ec7a6d6facb4864e9905341.zip
+ Added a power cost of 32eu/action for the Tree Farmer. (Will eventually get a config option).
% Moved the internal power buffer variable out of the cut method into the class. % Massive project tidy up, lots of old unused code removed or tidied up. $ Fixed lots of String comparisons that used == instead of .equals(). $ Fixed Double/Triple/Quad null checks in certain places. $ Fixed returns that set values at the same time. $ Swapped 3.14 and 1.57 to Math.PI and Math.PI/2. $ Fixed possible cases where a NPE may be thrown, by calling logging outside of null checks. + Added PI to CORE.java, since it's a double and MC uses it as a float in each instance. - Stripped 95% of the useless code out of Meta_GT_Proxy.java
-rw-r--r--src/Java/gregtech/api/util/Recipe_GT.java45
-rw-r--r--src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java12
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/Machine_Charger.java83
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/Machine_NHG.java83
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/heliumgen/tileentity/TileEntityHeliumGenerator.java2
-rw-r--r--src/Java/gtPlusPlus/core/common/CommonProxy.java28
-rw-r--r--src/Java/gtPlusPlus/core/container/Container_Charger.java81
-rw-r--r--src/Java/gtPlusPlus/core/container/Container_NHG.java102
-rw-r--r--src/Java/gtPlusPlus/core/gui/machine/GUI_Charger.java50
-rw-r--r--src/Java/gtPlusPlus/core/gui/machine/GUI_NHG.java50
-rw-r--r--src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java2
-rw-r--r--src/Java/gtPlusPlus/core/handler/events/SneakManager.java67
-rw-r--r--src/Java/gtPlusPlus/core/handler/render/CapeHandler.java4
-rw-r--r--src/Java/gtPlusPlus/core/handler/render/FirepitModel.java15
-rw-r--r--src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java6
-rw-r--r--src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java7
-rw-r--r--src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustAbstract.java3
-rw-r--r--src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java2
-rw-r--r--src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java3
-rw-r--r--src/Java/gtPlusPlus/core/item/general/RF2EU_Battery.java4
-rw-r--r--src/Java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Base.java2
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java6
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java8
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java8
-rw-r--r--src/Java/gtPlusPlus/core/lib/CORE.java2
-rw-r--r--src/Java/gtPlusPlus/core/tileentities/machines/TileEntityCharger.java186
-rw-r--r--src/Java/gtPlusPlus/core/tileentities/machines/TileEntityNHG.java502
-rw-r--r--src/Java/gtPlusPlus/core/util/Utils.java13
-rw-r--r--src/Java/gtPlusPlus/core/util/item/ItemUtils.java33
-rw-r--r--src/Java/gtPlusPlus/core/util/player/UtilsMining.java17
-rw-r--r--src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java10
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java7
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_DeluxeTank.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SteamCondenser.java160
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IronBlastFurnace.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeTank.java1
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_SuperConductor.java6
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/creative/GregtechMetaCreativeEnergyBuffer.java3
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechRenderedTexture.java160
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/objects/XSTR.java5
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechRecipeRegistrator.java8
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java884
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityAnimalFarm.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityTreeFarm.java20
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java5
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java27
-rw-r--r--src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java56
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/GUI_RTG.java1
-rw-r--r--src/Java/gtPlusPlus/xmod/thermalfoundation/fluid/TF_Fluids.java1
51 files changed, 243 insertions, 2551 deletions
diff --git a/src/Java/gregtech/api/util/Recipe_GT.java b/src/Java/gregtech/api/util/Recipe_GT.java
index f0b80f084a..af421610b1 100644
--- a/src/Java/gregtech/api/util/Recipe_GT.java
+++ b/src/Java/gregtech/api/util/Recipe_GT.java
@@ -25,45 +25,7 @@ import net.minecraftforge.fluids.FluidStack;
*/
public class Recipe_GT extends GT_Recipe{
- 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;
-
+ public static volatile int VERSION = 508;
protected Recipe_GT(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue);
@@ -181,11 +143,6 @@ public class Recipe_GT extends GT_Recipe{
}
@Override
- public GT_Recipe copy() {
- return this.copy();
- }
-
- @Override
public boolean isRecipeInputEqual(boolean aDecreaseStacksizeBySuccess, FluidStack[] aFluidInputs, ItemStack... aInputs) {
return isRecipeInputEqual(aDecreaseStacksizeBySuccess, false, aFluidInputs, aInputs);
}
diff --git a/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java b/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java
index 9e71370197..d694557f55 100644
--- a/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java
+++ b/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java
@@ -45,15 +45,15 @@ public class BlockBaseModular extends BasicBlock{
//Utils.LOG_INFO("==========================================");
}
- if (thisBlockType == BlockTypes.STANDARD.name().toUpperCase()){
+ if (thisBlockType.equals(BlockTypes.STANDARD.name().toUpperCase())){
LanguageRegistry.addName(this, "Block of "+blockMaterial);
//Utils.LOG_INFO("Registered Block in Language Registry as: "+"Block of "+blockMaterial);
}
- else if (thisBlockType == BlockTypes.FRAME.name().toUpperCase()){
+ else if (thisBlockType.equals(BlockTypes.FRAME.name().toUpperCase())){
LanguageRegistry.addName(this, blockMaterial+ " Frame Box");
//Utils.LOG_INFO("Registered Block in Language Registry as: "+blockMaterial+ " Frame Box");
}
- else if (thisBlockType == BlockTypes.ORE.name().toUpperCase()){
+ else if (thisBlockType.equals(BlockTypes.ORE.name().toUpperCase())){
LanguageRegistry.addName(this, blockMaterial+ " Ore");
//Utils.LOG_INFO("Registered Block in Language Registry as: "+blockMaterial+ " Frame Box");
}
@@ -63,15 +63,15 @@ public class BlockBaseModular extends BasicBlock{
}
//setOreDict(unlocalizedName, blockType);
- if (thisBlockType == BlockTypes.STANDARD.name().toUpperCase()){
+ if (thisBlockType.equals(BlockTypes.STANDARD.name().toUpperCase())){
GameRegistry.registerBlock(this, ItemBlockGtBlock.class, Utils.sanitizeString(blockType.getTexture()+unlocalizedName));
//Utils.LOG_INFO("Registered Block in Block Registry as: "+"Block of "+blockMaterial);
}
- else if (thisBlockType == BlockTypes.FRAME.name().toUpperCase()){
+ else if (thisBlockType.equals(BlockTypes.FRAME.name().toUpperCase())){
GameRegistry.registerBlock(this, ItemBlockGtFrameBox.class, Utils.sanitizeString(blockType.getTexture()+unlocalizedName));
//Utils.LOG_INFO("Registered Block in Block Registry as: "+blockMaterial+" Frame Box");
}
- else if (thisBlockType == BlockTypes.ORE.name().toUpperCase()){
+ else if (thisBlockType.equals(BlockTypes.ORE.name().toUpperCase())){
GameRegistry.registerBlock(this, ItemBlockGtBlock.class, Utils.sanitizeString(blockType.getTexture()+unlocalizedName));
//Utils.LOG_INFO("Registered Block in Block Registry as: "+blockMaterial+" Frame Box");
}
diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_Charger.java b/src/Java/gtPlusPlus/core/block/machine/Machine_Charger.java
deleted file mode 100644
index 4f426b99c9..0000000000
--- a/src/Java/gtPlusPlus/core/block/machine/Machine_Charger.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package gtPlusPlus.core.block.machine;
-
-import gtPlusPlus.GTplusplus;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.tileentities.machines.TileEntityCharger;
-
-import java.util.ArrayList;
-
-import net.minecraft.block.Block;
-import net.minecraft.block.BlockContainer;
-import net.minecraft.block.material.Material;
-import net.minecraft.entity.item.EntityItem;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-import scala.util.Random;
-
-public class Machine_Charger extends BlockContainer
-{
- private static final String name = "Charging Machine";
-
- private final Random rand = new Random();
-
- public Machine_Charger(String unlocalizedName)
- {
- super(Material.iron);
- //GameRegistry.registerBlock(this, unlocalizedName);
- this.setBlockName(unlocalizedName);
- this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- }
-
- @Override
- public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float lx, float ly, float lz)
- {
- if (world.isRemote) return true;
-
- TileEntity te = world.getTileEntity(x, y, z);
- if (te != null && te instanceof TileEntityCharger)
- {
- player.openGui(GTplusplus.instance, 1, world, x, y, z);
- return true;
- }
- return false;
- }
-
- @Override
- public void breakBlock(World world, int x, int y, int z, Block block, int par6)
- {
- if (world.isRemote) return;
-
- ArrayList drops = new ArrayList();
-
- TileEntity teRaw = world.getTileEntity(x, y, z);
-
- if (teRaw != null && teRaw instanceof TileEntityCharger)
- {
- TileEntityCharger te = (TileEntityCharger) teRaw;
-
- for (int i = 0; i < te.getSizeInventory(); i++)
- {
- ItemStack stack = te.getStackInSlot(i);
-
- if (stack != null) drops.add(stack.copy());
- }
- }
-
- for (int i = 0;i < drops.size();i++)
- {
- EntityItem item = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, (ItemStack) drops.get(i));
- item.setVelocity((rand.nextDouble() - 0.5) * 0.25, rand.nextDouble() * 0.5 * 0.25, (rand.nextDouble() - 0.5) * 0.25);
- world.spawnEntityInWorld(item);
- }
- }
-
- @Override
- public TileEntity createNewTileEntity(World world, int par2)
- {
- return new TileEntityCharger();
- }
-} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_NHG.java b/src/Java/gtPlusPlus/core/block/machine/Machine_NHG.java
deleted file mode 100644
index 011e293000..0000000000
--- a/src/Java/gtPlusPlus/core/block/machine/Machine_NHG.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package gtPlusPlus.core.block.machine;
-
-import gtPlusPlus.GTplusplus;
-import gtPlusPlus.core.creative.AddToCreativeTab;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.tileentities.machines.TileEntityNHG;
-
-import java.util.ArrayList;
-
-import net.minecraft.block.Block;
-import net.minecraft.block.BlockContainer;
-import net.minecraft.block.material.Material;
-import net.minecraft.entity.item.EntityItem;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-import scala.util.Random;
-
-public class Machine_NHG extends BlockContainer
-{
- private static final String name = "Nuclear Fueled Helium Generator";
-
- private final Random rand = new Random();
-
- public Machine_NHG(String unlocalizedName)
- {
- super(Material.iron);
- //GameRegistry.registerBlock(this, unlocalizedName);
- this.setBlockName(unlocalizedName);
- this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- }
-
- @Override
- public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float lx, float ly, float lz)
- {
- if (world.isRemote) return true;
-
- TileEntity te = world.getTileEntity(x, y, z);
- if (te != null && te instanceof TileEntityNHG)
- {
- player.openGui(GTplusplus.instance, 0, world, x, y, z);
- return true;
- }
- return false;
- }
-
- @Override
- public void breakBlock(World world, int x, int y, int z, Block block, int par6)
- {
- if (world.isRemote) return;
-
- ArrayList drops = new ArrayList();
-
- TileEntity teRaw = world.getTileEntity(x, y, z);
-
- if (teRaw != null && teRaw instanceof TileEntityNHG)
- {
- TileEntityNHG te = (TileEntityNHG) teRaw;
-
- for (int i = 0; i < te.getSizeInventory(); i++)
- {
- ItemStack stack = te.getStackInSlot(i);
-
- if (stack != null) drops.add(stack.copy());
- }
- }
-
- for (int i = 0;i < drops.size();i++)
- {
- EntityItem item = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, (ItemStack) drops.get(i));
- item.setVelocity((rand.nextDouble() - 0.5) * 0.25, rand.nextDouble() * 0.5 * 0.25, (rand.nextDouble() - 0.5) * 0.25);
- world.spawnEntityInWorld(item);
- }
- }
-
- @Override
- public TileEntity createNewTileEntity(World world, int par2)
- {
- return new TileEntityNHG();
- }
-} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/machine/heliumgen/tileentity/TileEntityHeliumGenerator.java b/src/Java/gtPlusPlus/core/block/machine/heliumgen/tileentity/TileEntityHeliumGenerator.java
index 343f37527e..ffc4745059 100644
--- a/src/Java/gtPlusPlus/core/block/machine/heliumgen/tileentity/TileEntityHeliumGenerator.java
+++ b/src/Java/gtPlusPlus/core/block/machine/heliumgen/tileentity/TileEntityHeliumGenerator.java
@@ -249,7 +249,6 @@ public class TileEntityHeliumGenerator extends TileEntityInventory implements II
private boolean redstone = false;
private boolean fluidcoolreactor = false;
private boolean active = true;
- public boolean prevActive = false;
public short getReactorSize()
@@ -273,6 +272,7 @@ public class TileEntityHeliumGenerator extends TileEntityInventory implements II
return cols;
}
+ @Override
protected void updateEntityServer()
{
Utils.LOG_WARNING("updateEntityServer");
diff --git a/src/Java/gtPlusPlus/core/common/CommonProxy.java b/src/Java/gtPlusPlus/core/common/CommonProxy.java
index f16beb625f..d5a126ff39 100644
--- a/src/Java/gtPlusPlus/core/common/CommonProxy.java
+++ b/src/Java/gtPlusPlus/core/common/CommonProxy.java
@@ -15,18 +15,15 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.debug.DEBUG_INIT;
import gtPlusPlus.core.util.player.PlayerCache;
import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
-
-import java.util.Iterator;
-
import net.minecraft.entity.Entity;
-import net.minecraft.item.ItemStack;
import net.minecraftforge.common.MinecraftForge;
-import net.minecraftforge.oredict.OreDictionary;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.event.*;
public class CommonProxy {
+ public static Meta_GT_Proxy GtProxy;
+
public CommonProxy(){
//Should Register Gregtech Materials I've Made
MinecraftForge.EVENT_BUS.register(this);
@@ -38,19 +35,11 @@ public class CommonProxy {
else {
Utils.LOG_INFO("We're using Gregtech 5.08 or an equivalent fork.");
}
- handleGtIntegrationInit();
+ Utils.LOG_INFO("Setting up our own GT_Proxy.");
+ GtProxy = new Meta_GT_Proxy();
}
- }
- private static void handleGtIntegrationInit(){
- Utils.LOG_INFO("Setting up our own GT_Proxy.");
- Meta_GT_Proxy GtProxy = new Meta_GT_Proxy();
- for (String tOreName : OreDictionary.getOreNames()) {
- ItemStack tOreStack;
- Utils.LOG_INFO("Iterating list of GT materials for custom tool parts.");
- for (Iterator i$ = OreDictionary.getOres(tOreName).iterator(); i$.hasNext(); GtProxy.registerOre(new OreDictionary.OreRegisterEvent(tOreName, tOreStack))) {
- Utils.LOG_INFO("Iterating Material");
- tOreStack = (ItemStack) i$.next();
- }
+ else {
+ GtProxy = null;
}
}
@@ -122,12 +111,11 @@ public class CommonProxy {
}
- @SuppressWarnings("static-method")
public int addArmor(String armor) {
return 0;
}
-
- public void generateMysteriousParticles(Entity theEntity) { }
+ public void generateMysteriousParticles(Entity entity) {
+ }
}
diff --git a/src/Java/gtPlusPlus/core/container/Container_Charger.java b/src/Java/gtPlusPlus/core/container/Container_Charger.java
deleted file mode 100644
index 4b6c43ada6..0000000000
--- a/src/Java/gtPlusPlus/core/container/Container_Charger.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package gtPlusPlus.core.container;
-
-import gtPlusPlus.core.tileentities.machines.TileEntityCharger;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.Container;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-
-public class Container_Charger extends Container
-{
- private TileEntityCharger te;
-
- public static final int INPUT_1 = 0;
-
- private int slotID = 0;
-
- public Container_Charger(TileEntityCharger te, EntityPlayer player)
- {
- this.te = te;
-
- //Fuel Slot A
- addSlotToContainer(new Slot(te, slotID++, 80, 53));
-
-
-
- //Inventory
- for (int i = 0; i < 3; i++)
- {
- for (int j = 0; j < 9; j++)
- {
- addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
- }
- }
- // Hotbar
- for (int i = 0; i < 9; i++)
- {
- addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142));
- }
- }
-
- @Override
- public ItemStack transferStackInSlot(EntityPlayer player, int slotRaw)
- {
- ItemStack stack = null;
- Slot slot = (Slot)inventorySlots.get(slotRaw);
-
- if (slot != null && slot.getHasStack())
- {
- ItemStack stackInSlot = slot.getStack();
- stack = stackInSlot.copy();
-
- if (slotRaw < 3 * 9)
- {
- if (!mergeItemStack(stackInSlot, 3 * 9, inventorySlots.size(), true))
- {
- return null;
- }
- }
- else if (!mergeItemStack(stackInSlot, 0, 3 * 9, false))
- {
- return null;
- }
-
- if (stackInSlot.stackSize == 0)
- {
- slot.putStack((ItemStack)null);
- }
- else
- {
- slot.onSlotChanged();
- }
- }
- return stack;
- }
-
- @Override
- public boolean canInteractWith(EntityPlayer player)
- {
- return te.isUseableByPlayer(player);
- }
-} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/container/Container_NHG.java b/src/Java/gtPlusPlus/core/container/Container_NHG.java
deleted file mode 100644
index 5fd19489c0..0000000000
--- a/src/Java/gtPlusPlus/core/container/Container_NHG.java
+++ /dev/null
@@ -1,102 +0,0 @@
-package gtPlusPlus.core.container;
-
-import gtPlusPlus.core.tileentities.machines.TileEntityNHG;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.*;
-import net.minecraft.item.ItemStack;
-
-public class Container_NHG extends Container
-{
- private TileEntityNHG te;
-
- public static final int INPUT_1 = 0, INPUT_2 = 1, INPUT_3 = 2,
- INPUT_4 = 3, INPUT_5 = 4, INPUT_6 = 5,
- INPUT_7 = 6, INPUT_8 = 7, INPUT_9 = 8,
- INPUT_10 = 9, INPUT_11 = 10, INPUT_12 = 11,
- INPUT_13 = 12, INPUT_14 = 13, INPUT_15 = 14,
- INPUT_16 = 15, INPUT_17 = 16, INPUT_18 = 17,
- OUTPUT = 18;
-
- private int slotID = 0;
-
- public Container_NHG(TileEntityNHG te, EntityPlayer player)
- {
- this.te = te;
-
-
- //Fuel Rods A
- for (int i = 0; i < 3; i++)
- {
- for (int j = 0; j < 3; j++)
- {
- addSlotToContainer(new Slot(te, slotID++, 8 + j * 18, 17 + i * 18));
- }
- }
- //Fuel Rods B
- for (int i = 0; i < 3; i++)
- {
- for (int j = 0; j < 3; j++)
- {
- addSlotToContainer(new Slot(te, slotID++, 116 + j * 18, 17 + i * 18));
- }
- }
-
- //Output
- addSlotToContainer(new SlotFurnace(player, te, OUTPUT, 80, 53));
-
- //Inventory
- for (int i = 0; i < 3; i++)
- {
- for (int j = 0; j < 9; j++)
- {
- addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
- }
- }
- // Hotbar
- for (int i = 0; i < 9; i++)
- {
- addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142));
- }
- }
-
- @Override
- public ItemStack transferStackInSlot(EntityPlayer player, int slotRaw)
- {
- ItemStack stack = null;
- Slot slot = (Slot)inventorySlots.get(slotRaw);
-
- if (slot != null && slot.getHasStack())
- {
- ItemStack stackInSlot = slot.getStack();
- stack = stackInSlot.copy();
-
- if (slotRaw < 3 * 9)
- {
- if (!mergeItemStack(stackInSlot, 3 * 9, inventorySlots.size(), true))
- {
- return null;
- }
- }
- else if (!mergeItemStack(stackInSlot, 0, 3 * 9, false))
- {
- return null;
- }
-
- if (stackInSlot.stackSize == 0)
- {
- slot.putStack((ItemStack)null);
- }
- else
- {
- slot.onSlotChanged();
- }
- }
- return stack;
- }
-
- @Override
- public boolean canInteractWith(EntityPlayer player)
- {
- return te.isUseableByPlayer(player);
- }
-} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/gui/machine/GUI_Charger.java b/src/Java/gtPlusPlus/core/gui/machine/GUI_Charger.java
deleted file mode 100644
index c1f687c554..0000000000
--- a/src/Java/gtPlusPlus/core/gui/machine/GUI_Charger.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package gtPlusPlus.core.gui.machine;
-
-import gtPlusPlus.core.container.Container_Charger;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.tileentities.machines.TileEntityCharger;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.client.resources.I18n;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.util.ResourceLocation;
-
-import org.lwjgl.opengl.GL11;
-
-public class GUI_Charger extends GuiContainer
-{
- private ResourceLocation texture = new ResourceLocation(CORE.MODID, "textures/gui/machine_Charger.png");
-
- private InventoryPlayer inventory;
- private TileEntityCharger te;
-
- public GUI_Charger(TileEntityCharger te, EntityPlayer player)
- {
- super(new Container_Charger(te, player));
- inventory = player.inventory;
- this.te = te;
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
- {
- Minecraft.getMinecraft().renderEngine.bindTexture(texture);
-
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
-
- int x = (width - xSize) / 2;
- int y = (height - ySize) / 2;
-
- drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(int par1, int par2)
- {
- fontRendererObj.drawString(I18n.format(te.getInventoryName()), (xSize / 2) - (fontRendererObj.getStringWidth(I18n.format(te.getInventoryName())) / 2), 6, 4210752, false);
- //fontRendererObj.drawString(I18n.format(inventory.getInventoryName()), 8, ySize - 96 + 2, 4210752);
- fontRendererObj.drawString(I18n.format("Charge:"+te.getCharge()+"~"), 8, ySize - 96 + 2, 4210752);
- fontRendererObj.drawString(I18n.format("Progress:"+te.getProgress()+"ticks"), 80, ySize - 96 + 2, 4210752);
- }
-} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/gui/machine/GUI_NHG.java b/src/Java/gtPlusPlus/core/gui/machine/GUI_NHG.java
deleted file mode 100644
index 09b2ee93d8..0000000000
--- a/src/Java/gtPlusPlus/core/gui/machine/GUI_NHG.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package gtPlusPlus.core.gui.machine;
-
-import gtPlusPlus.core.container.Container_NHG;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.tileentities.machines.TileEntityNHG;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.client.resources.I18n;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.util.ResourceLocation;
-
-import org.lwjgl.opengl.GL11;
-
-public class GUI_NHG extends GuiContainer
-{
- private ResourceLocation texture = new ResourceLocation(CORE.MODID, "textures/gui/helium_collector_gui_12.png");
-
- private InventoryPlayer inventory;
- private TileEntityNHG te;
-
- public GUI_NHG(TileEntityNHG te, EntityPlayer player)
- {
- super(new Container_NHG(te, player));
- inventory = player.inventory;
- this.te = te;
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
- {
- Minecraft.getMinecraft().renderEngine.bindTexture(texture);
-
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
-
- int x = (width - xSize) / 2;
- int y = (height - ySize) / 2;
-
- drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(int par1, int par2)
- {
- fontRendererObj.drawString(I18n.format(te.getInventoryName()), (xSize / 2) - (fontRendererObj.getStringWidth(I18n.format(te.getInventoryName())) / 2), 6, 4210752, false);
- //fontRendererObj.drawString(I18n.format(inventory.getInventoryName()), 8, ySize - 96 + 2, 4210752);
- fontRendererObj.drawString(I18n.format("CoreTemp:"+te.getCoreTemp()+"K"), 8, ySize - 96 + 2, 4210752);
- fontRendererObj.drawString(I18n.format("Progress:"+te.getProgress()+"ticks"), 80, ySize - 96 + 2, 4210752);
- }
-} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java b/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java
index f9abae6d32..a50524122b 100644
--- a/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java
+++ b/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java
@@ -28,7 +28,7 @@ public class LoginEventHandler {
try {
- if (localPlayerRef instanceof EntityPlayerMP && localPlayerRef != null){
+ if (localPlayerRef instanceof EntityPlayerMP){
//Populates player cache
if (!localPlayerRef.worldObj.isRemote){
diff --git a/src/Java/gtPlusPlus/core/handler/events/SneakManager.java b/src/Java/gtPlusPlus/core/handler/events/SneakManager.java
index 9edc962a6b..f330fea861 100644
--- a/src/Java/gtPlusPlus/core/handler/events/SneakManager.java
+++ b/src/Java/gtPlusPlus/core/handler/events/SneakManager.java
@@ -4,7 +4,7 @@ import gtPlusPlus.core.util.Utils;
import net.minecraft.client.Minecraft;
public class SneakManager {
-
+
//We make this a singleton for clientside data storage.
public static SneakManager instance = new SneakManager();
protected static final Minecraft mc = Minecraft.getMinecraft();
@@ -12,72 +12,73 @@ public class SneakManager {
public static boolean isSneaking = true;
public static boolean optionDoubleTap = true;
public static boolean wasSprintDisabled = false;
-
+
private static State Sprinting = State.ON;
private static State Crouching = State.OFF;
-
+
public static boolean Sneaking(){
return Crouching.getState();
}
-
+
public static boolean Sprinting(){
return Sprinting.getState();
}
-
+
public static State getSneakingState(){
return Crouching;
}
-
+
public static State getSprintingDisabledState(){
return Sprinting;
}
-
+
public static void toggleSneaking(){
toggleState(Crouching);
}
-
+
public static void toggleSprinting(){
toggleState(Sprinting);
}
-
+
private static State toggleState(State state){
Utils.LOG_INFO("State Toggle");
- if (state == State.ON)
- return state = State.OFF;
- return state = State.ON;
+ if (state == State.ON) {
+ return State.OFF;
+ }
+ return State.ON;
}
-
+
public static State setCrouchingStateON(){
return Crouching = State.ON;
}
-
+
public static State setCrouchingStateOFF(){
return Crouching = State.OFF;
}
-
+
public static State setSprintingStateON(){
return Sprinting = State.ON;
}
-
+
public static State setSprintingStateOFF(){
return Sprinting = State.OFF;
}
-
- public static enum State {
- ON(true),
- OFF(false);
-
- private boolean STATE;
- private State (final boolean State)
- {
- this.STATE = State;
- }
-
- public boolean getState() {
- return STATE;
- }
-
- }
-
+
+ public static enum State {
+ ON(true),
+ OFF(false);
+
+ private boolean STATE;
+ private State (final boolean State)
+ {
+ this.STATE = State;
+ }
+
+ public boolean getState() {
+ return STATE;
+ }
+
+ }
+
}
diff --git a/src/Java/gtPlusPlus/core/handler/render/CapeHandler.java b/src/Java/gtPlusPlus/core/handler/render/CapeHandler.java
index 9f449e3044..f5e87ff512 100644
--- a/src/Java/gtPlusPlus/core/handler/render/CapeHandler.java
+++ b/src/Java/gtPlusPlus/core/handler/render/CapeHandler.java
@@ -80,8 +80,8 @@ public class CapeHandler extends RenderPlayer {
float f6 = aPlayer.prevRenderYawOffset
+ (aPlayer.renderYawOffset - aPlayer.prevRenderYawOffset)
* aPartialTicks;
- double d3 = MathHelper.sin(f6 * 3.141593F / 180.0F);
- double d4 = -MathHelper.cos(f6 * 3.141593F / 180.0F);
+ double d3 = MathHelper.sin(f6 * CORE.PI / 180.0F);
+ double d4 = -MathHelper.cos(f6 * CORE.PI / 180.0F);
float f7 = (float) d1 * 10.0F;
float f8 = (float) (d0 * d3 + d2 * d4) * 100.0F;
float f9 = (float) (d0 * d4 - (d2 * d3)) * 100.0F;
diff --git a/src/Java/gtPlusPlus/core/handler/render/FirepitModel.java b/src/Java/gtPlusPlus/core/handler/render/FirepitModel.java
index d07f7338df..9bad3d2f4e 100644
--- a/src/Java/gtPlusPlus/core/handler/render/FirepitModel.java
+++ b/src/Java/gtPlusPlus/core/handler/render/FirepitModel.java
@@ -6,6 +6,7 @@
package gtPlusPlus.core.handler.render;
+import gtPlusPlus.core.lib.CORE;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
@@ -40,14 +41,14 @@ public class FirepitModel extends ModelBase
Side_B.setRotationPoint(-6F, 18F, 6F);
Side_B.setTextureSize(16, 16);
Side_B.mirror = true;
- setRotation(Side_B, -0.3148822F, 1.570796F, 0F);
+ setRotation(Side_B, -0.3148822F, (CORE.PI/2), 0F);
Side_C = new ModelRenderer(this, 0, 0);
Side_C.addBox(0F, 0F, 0F, 12, 6, 1);
Side_C.setRotationPoint(6F, 18F, 6F);
Side_C.setTextureSize(16, 16);
Side_C.mirror = true;
- setRotation(Side_C, -0.3148822F, 3.141593F, 0F);
+ setRotation(Side_C, -0.3148822F, CORE.PI, 0F);
//Side_C.mirror = false;
Side_D = new ModelRenderer(this, 0, 0);
@@ -62,14 +63,14 @@ public class FirepitModel extends ModelBase
Log1.setRotationPoint(4F, 10F, -4F);
Log1.setTextureSize(16, 16);
Log1.mirror = true;
- setRotation(Log1, 0F, 0F, 1.570796F);
+ setRotation(Log1, 0F, 0F, (CORE.PI/2));
Log2 = new ModelRenderer(this, -2, 10);
Log2.addBox(0F, 0F, 0F, 14, 2, 2);
Log2.setRotationPoint(-4F, 10F, -4F);
Log2.setTextureSize(16, 16);
Log2.mirror = true;
- setRotation(Log2, 1.570796F, 0F, 1.570796F);
+ setRotation(Log2, (CORE.PI/2), 0F, (CORE.PI/2));
//Log2.mirror = false;
Log3 = new ModelRenderer(this, 0, 10);
@@ -77,14 +78,14 @@ public class FirepitModel extends ModelBase
Log3.setRotationPoint(-4F, 10F, 4F);
Log3.setTextureSize(16, 16);
Log3.mirror = true;
- setRotation(Log3, 3.141593F, 0F, 1.570796F);
+ setRotation(Log3, CORE.PI, 0F, (CORE.PI/2));
Log4 = new ModelRenderer(this, -2, 10);
Log4.addBox(0F, 0F, 0F, 14, 2, 2);
Log4.setRotationPoint(4F, 10F, 4F);
Log4.setTextureSize(16, 16);
Log4.mirror = true;
- setRotation(Log4, 4.712389F, 0F, 1.570796F);
+ setRotation(Log4, 4.712389F, 0F, (CORE.PI/2));
//Log4.mirror = false;
}
@@ -103,7 +104,7 @@ public class FirepitModel extends ModelBase
Log4.render(f5);
}
- private void setRotation(ModelRenderer model, float x, float y, float z)
+ private static void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
diff --git a/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java b/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java
index b9345f6f57..17af462a0f 100644
--- a/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java
+++ b/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java
@@ -14,13 +14,11 @@ public class BaseItemCell extends BaseItemComponent{
private IIcon base;
private IIcon overlay;
- private final Material cellMaterial;
ComponentTypes Cell = ComponentTypes.CELL;
public BaseItemCell(Material material) {
super(material, BaseItemComponent.ComponentTypes.CELL);
- this.cellMaterial = material;
- fluidColour = (short[]) ((cellMaterial == null) ? extraData : cellMaterial.getRGBA());
+ fluidColour = (short[]) ((material == null) ? extraData : material.getRGBA());
}
@Override
@@ -36,8 +34,6 @@ public class BaseItemCell extends BaseItemComponent{
//this.overlay = cellMaterial.getFluid(1000).getFluid().get
}
- private int fluidBright = 0;
- private int tickValue;
private short[] fluidColour;
boolean upwards = true;
diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
index 696f497afc..42a610641e 100644
--- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
+++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
@@ -28,14 +28,13 @@ public class BaseItemDust extends Item{
String name = "";
private int mTier;
private Material dustInfo;
- private String oredictName;
public BaseItemDust(String unlocalizedName, String materialName, Material matInfo, int colour, String pileSize, int tier, int sRadioactivity) {
setUnlocalizedName(unlocalizedName);
this.setUnlocalizedName(unlocalizedName);
this.setMaxStackSize(64);
this.setTextureName(getCorrectTexture(pileSize));
-
+
this.setCreativeTab(tabMisc);
this.colour = colour;
this.mTier = tier;
@@ -66,7 +65,6 @@ public class BaseItemDust extends Item{
Utils.LOG_WARNING("Generating OreDict Name: "+temp);
}
if (temp != null && !temp.equals("")){
- oredictName = temp;
GT_OreDictUnificator.registerOre(temp, ItemUtils.getSimpleStack(this));
}
addFurnaceRecipe();
@@ -111,6 +109,7 @@ public class BaseItemDust extends Item{
EntityUtils.applyRadiationDamageToEntity(sRadiation, world, entityHolding);
}
+ @SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
//if (pileType != null && materialName != null && pileType != "" && materialName != "" && !pileType.equals("") && !materialName.equals("")){
@@ -222,8 +221,8 @@ public class BaseItemDust extends Item{
Utils.LOG_WARNING("Adding recipe for Hot "+materialName+" Ingots in a Blast furnace.");
String tempIngot = temp.replace("ingot", "ingotHot");
ItemStack tempOutputStack = ItemUtils.getItemStackOfAmountFromOreDict(tempIngot, 1);
- Utils.LOG_WARNING("This will produce "+tempOutputStack.getDisplayName() + " Debug: "+tempIngot);
if (null != tempOutputStack){
+ Utils.LOG_WARNING("This will produce "+tempOutputStack.getDisplayName() + " Debug: "+tempIngot);
addBlastFurnaceRecipe(ItemUtils.getSimpleStack(this), null, tempOutputStack, null, 350*mTier);
}
return;
diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustAbstract.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustAbstract.java
index a49dc58188..3eab83f812 100644
--- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustAbstract.java
+++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustAbstract.java
@@ -18,7 +18,7 @@ public abstract class BaseItemDustAbstract extends Item{
public BaseItemDustAbstract(String unlocalizedName, String materialName, int colour, String pileSize) {
this.setUnlocalizedName(unlocalizedName);
this.setMaxStackSize(64);
- if (pileSize == "dust" || pileSize == "Dust"){
+ if (pileSize.toLowerCase().equals("dust")){
this.setTextureName(CORE.MODID + ":" + "dust");
}
else{
@@ -31,6 +31,7 @@ public abstract class BaseItemDustAbstract extends Item{
GameRegistry.registerItem(this, unlocalizedName);
}
+ @SuppressWarnings("rawtypes")
@Override
public abstract void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool);
diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java
index c90499c1ca..a4e8c1cadc 100644
--- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java
+++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java
@@ -59,7 +59,7 @@ public class BaseItemDustUnique extends Item{
temp = temp.replace("itemD", "d");
Utils.LOG_WARNING("Generating OreDict Name: "+temp);
}
- if (temp != null && temp != ""){
+ if (temp != null && !temp.equals("")){
GT_OreDictUnificator.registerOre(temp, ItemUtils.getSimpleStack(this));
}
}
diff --git a/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java b/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java
index 3c8e09e9e5..0458a38110 100644
--- a/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java
+++ b/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java
@@ -177,7 +177,8 @@ public class ItemBlueprint extends Item implements IItemBlueprint{
if (output != null){
setBlueprintName(stack, output.getDisplayName());
- return (hasBP = true);
+ hasBP = true;
+ return true;
}
return false;
} catch (Throwable t){
diff --git a/src/Java/gtPlusPlus/core/item/general/RF2EU_Battery.java b/src/Java/gtPlusPlus/core/item/general/RF2EU_Battery.java
index 146af86302..3f51db7047 100644
--- a/src/Java/gtPlusPlus/core/item/general/RF2EU_Battery.java
+++ b/src/Java/gtPlusPlus/core/item/general/RF2EU_Battery.java
@@ -8,7 +8,6 @@ import ic2.api.item.*;
import java.util.List;
-import cofh.energy.ItemEnergyContainer;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -19,6 +18,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
+import cofh.energy.ItemEnergyContainer;
import cpw.mods.fml.common.IFuelHandler;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
@@ -125,7 +125,7 @@ public class RF2EU_Battery extends ItemEnergyContainer implements IElectricItem,
{
int i = 30;
- float f13 = (float)(Minecraft.getSystemTime() % 6000L) / 3000.0F * 3.141592F * 2.0F;
+ float f13 = ((float)(Minecraft.getSystemTime() % 6000L) / 3000.0F * CORE.PI * 2.0F);
float t = 0.9F + 0.1F * MathHelper.cos(f13);
diff --git a/src/Java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Base.java b/src/Java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Base.java
index 36e6c66df8..2a94456c2a 100644
--- a/src/Java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Base.java
+++ b/src/Java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Base.java
@@ -147,7 +147,7 @@ public class FuelRod_Base extends Item{
int r = maximumFuel - i;
return r;
}
- return getFuelRemaining(stack);
+ return 0;
}
public boolean setFuelRemainingExplicitly(int i){
diff --git a/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java b/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java
index e278c258ba..a0b884f97d 100644
--- a/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java
+++ b/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java
@@ -27,12 +27,6 @@ public class MultiPickaxeBase extends StaballoyPickaxe{
return 0;
}
- protected Boolean FACING_HORIZONTAL = true;
- protected String FACING = "north";
- protected EntityPlayer localPlayer;
- protected String lookingDirection;
- protected World localWorld;
- protected ItemStack thisPickaxe = null;
protected final int colour;
protected final String materialName;
protected final String displayName;
diff --git a/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java b/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java
index bfe78b1866..627108f509 100644
--- a/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java
+++ b/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java
@@ -6,10 +6,8 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.recipe.RecipeUtils;
-import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -26,12 +24,6 @@ public class MultiSpadeBase extends StaballoySpade{
return 0;
}
- protected Boolean FACING_HORIZONTAL = true;
- protected String FACING = "north";
- protected EntityPlayer localPlayer;
- protected String lookingDirection;
- protected World localWorld;
- protected ItemStack thisPickaxe = null;
protected final int colour;
protected final String materialName;
protected final String displayName;
diff --git a/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java b/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java
index 81fc2cc05e..301671fc24 100644
--- a/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java
+++ b/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java
@@ -46,7 +46,7 @@ public class StaballoyAxe extends ItemAxe{
super.addInformation(stack, aPlayer, list, bool);
}
- public boolean canIgnore(Block bit){
+ public static boolean canIgnore(Block bit){
if (bit instanceof BlockAir)return true;
if (bit instanceof BlockGrass)return true;
if (bit instanceof BlockSand)return true;
@@ -105,7 +105,7 @@ public class StaballoyAxe extends ItemAxe{
for(int x=19;x>=0;x--){
int r=check(par1World,x,y,z,xo,yo,zo);
if (r==2) return 3;
- if (r==2) return 2;
+ //if (r==2) return 2;
if (r==1) f=true;
}
}
@@ -154,7 +154,7 @@ public class StaballoyAxe extends ItemAxe{
for(int x=19;x>=0;x--){
int r=check2(par1World,x,y,z,xo,yo,zo);
if (r==2) return 3;
- if (r==2) return 2;
+ //if (r==2) return 2;
if (r==1) f=true;
}
}
@@ -178,7 +178,7 @@ public class StaballoyAxe extends ItemAxe{
}
}
- private void breakMushroom(World wld, Block bit, EntityPlayer plr, boolean silk, int x, int y, int z, int met) {
+ private static void breakMushroom(World wld, Block bit, EntityPlayer plr, boolean silk, int x, int y, int z, int met) {
if (silk){
ItemStack stk = null; //TODO
/*if (bit==Blocks.brown_mushroom_block) stk = new ItemStack(LoonToolItems.brown_mushroom_block,1,met);
diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java
index 8fa2b99b79..e81c5bc4a9 100644
--- a/src/Java/gtPlusPlus/core/lib/CORE.java
+++ b/src/Java/gtPlusPlus/core/lib/CORE.java
@@ -20,6 +20,8 @@ public class CORE {
protected CORE(){
}
+
+ public final static float PI = (float) Math.PI;
public static final String name = "GT++";
public static final String MODID = "miscutils";
diff --git a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityCharger.java b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityCharger.java
deleted file mode 100644
index 9ec6aa3b24..0000000000
--- a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityCharger.java
+++ /dev/null
@@ -1,186 +0,0 @@
-package gtPlusPlus.core.tileentities.machines;
-
-import gtPlusPlus.core.item.base.BaseItemWithCharge;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.nbt.NBTTagList;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraftforge.common.util.Constants;
-
-public class TileEntityCharger extends TileEntity implements IInventory
-{
- private ItemStack[] items = new ItemStack[1]; //18
- private int progress_Current = 1;
- private int progress_Max = 1000;
- public float charge_Current;
- public float charge_Max = 10000;
- private float tempItemChargeValue;
-
- public float getCharge(){
- return charge_Current;
- }
-
- public int getProgress(){
- return progress_Current;
- }
-
- @Override
- public int getSizeInventory()
- {
- return items.length;
- }
-
- @Override
- public ItemStack getStackInSlot(int slot)
- {
- return items[slot];
- }
-
- @Override
- public ItemStack decrStackSize(int slot, int amount)
- {
- if (items[slot] != null)
- {
- ItemStack itemstack;
-
- if (items[slot].stackSize == amount)
- {
- itemstack = items[slot];
- items[slot] = null;
- markDirty();
- return itemstack;
- }
- itemstack = items[slot].splitStack(amount);
- if (items[slot].stackSize == 0) items[slot] = null;
- markDirty();
- return itemstack;
- }
- return null;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(int slot)
- {
- if (items[slot] != null)
- {
- ItemStack itemstack = items[slot];
- items[slot] = null;
- return itemstack;
- }
- return null;
- }
-
- @Override
- public void setInventorySlotContents(int slot, ItemStack stack)
- {
- if (stack != null){
- items[slot] = stack;
- if (stack != null && stack.stackSize > getInventoryStackLimit())
- {
- stack.stackSize = getInventoryStackLimit();
- }
-
-
- markDirty();
- }
- }
-
- @Override
- public String getInventoryName()
- {
- return "container.Charger";
- }
-
- @Override
- public boolean hasCustomInventoryName()
- {
- return false;
- }
-
- @Override
- public void readFromNBT(NBTTagCompound nbt)
- {
- super.readFromNBT(nbt);
- NBTTagList list = nbt.getTagList("Items", Constants.NBT.TAG_COMPOUND);
- items = new ItemStack[getSizeInventory()];
-
- for (int i = 0; i < list.tagCount(); ++i) { NBTTagCompound comp = list.getCompoundTagAt(i); int j = comp.getByte("Slot") & 255; if (j >= 0 && j < items.length)
- {
- items[j] = ItemStack.loadItemStackFromNBT(comp);
- }
- }
- }
-
- @Override
- public void writeToNBT(NBTTagCompound nbt)
- {
- super.writeToNBT(nbt);
- NBTTagList list = new NBTTagList();
-
- for (int i = 0; i < items.length; ++i)
- {
- if (items[i] != null)
- {
- NBTTagCompound comp = new NBTTagCompound();
- comp.setByte("Slot", (byte)i);
- items[i].writeToNBT(comp);
- list.appendTag(comp);
- }
- }
-
- nbt.setTag("Items", list);
- }
-
- @Override
- public int getInventoryStackLimit()
- {
- return 64;
- }
-
- @Override
- public boolean isUseableByPlayer(EntityPlayer player)
- {
- return worldObj.getTileEntity(xCoord, yCoord, zCoord) != this ? false : player.getDistanceSq((double)xCoord + 0.5D, (double)yCoord + 0.5D, (double)zCoord + 0.5D) <= 64.0D;
- }
-
- @Override
- public void openInventory() {}
-
- @Override
- public void closeInventory() {}
-
- @Override
- public boolean isItemValidForSlot(int slot, ItemStack stack)
- {
- return true;
- }
-
- @Override
- public void updateEntity() {
- if(!this.worldObj.isRemote){
- if (progress_Current < progress_Max){
- progress_Current++;
- }
- else if (progress_Current >= progress_Max){
- if (charge_Current < charge_Max){
- charge_Current = charge_Current+500;
- }
- if (getStackInSlot(0).getItem() instanceof BaseItemWithCharge){
- float tempCharge;
- ItemStack output = getStackInSlot(0).copy();
- if (output.stackTagCompound != null){
- tempCharge = output.stackTagCompound.getFloat("charge_Current");
- output.stackTagCompound = new NBTTagCompound();
- output.stackTagCompound.setFloat("charge_Current", tempCharge+40);
- this.charge_Current = charge_Current-40;
- tempCharge = 0;
- }
- }
- progress_Current = 0;
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityNHG.java b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityNHG.java
deleted file mode 100644
index 3a9dbbd4c7..0000000000
--- a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityNHG.java
+++ /dev/null
@@ -1,502 +0,0 @@
-package gtPlusPlus.core.tileentities.machines;
-
-import gtPlusPlus.core.item.ModItems;
-import gtPlusPlus.core.item.general.fuelrods.FuelRod_Base;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.math.MathUtils;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.nbt.NBTTagList;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraftforge.common.util.Constants;
-
-public class TileEntityNHG extends TileEntity implements IInventory
-{
- private ItemStack[] items = new ItemStack[19]; //18
- private int progress = 1;
- private int maxProgress = 180;
- private int heatCycleProgress = 12;
- public float coreTemp;
- public float maxTemp = 10000;
- private boolean fuelrod_1 = false;
- private boolean fuelrod_2 = false;
- private boolean fuelrod_3 = false;
- private boolean fuelrod_4 = false;
- private boolean fuelrod_5 = false;
- private boolean fuelrod_6 = false;
- private boolean fuelrod_7 = false;
- private boolean fuelrod_8 = false;
- private boolean fuelrod_9 = false;
- private boolean fuelrod_10 = false;
- private boolean fuelrod_11 = false;
- private boolean fuelrod_12 = false;
- private boolean fuelrod_13 = false;
- private boolean fuelrod_14 = false;
- private boolean fuelrod_15 = false;
- private boolean fuelrod_16 = false;
- private boolean fuelrod_17 = false;
- private boolean fuelrod_18 = false;
-
- public float getCoreTemp(){
- return coreTemp;
- }
-
- public int getProgress(){
- return progress;
- }
-
- public boolean isValidFuelRod(ItemStack input){
- if(!this.worldObj.isRemote){
- if (input != null){
- if (input.getItem() instanceof FuelRod_Base){
- int fuelRodFuelLevel = getRodFuelValue(input);
- float fuelRodHeatLevel = getRodHeatValue(input);
- Utils.LOG_WARNING("Fuel Left: "+fuelRodFuelLevel+" Current Temp: "+fuelRodHeatLevel);
- return true;
- //return input.stackTagCompound.getInteger("code");
- }
- }
-
- }
- return false;
- }
-
- public ItemStack doFuelRodHeatDamage(ItemStack input){
- if(!this.worldObj.isRemote){
- if (input != null){
- if (isValidFuelRod(input)){
- int fuelRodFuelLevel = getRodFuelValue(input);
- float fuelRodHeatLevel = getRodHeatValue(input);
- if(fuelRodFuelLevel <= 0 || fuelRodFuelLevel == 0){
- return null;
- }
- if(fuelRodHeatLevel == 0 && fuelRodFuelLevel > 0){
- if(fuelRodFuelLevel >= 5){
- int tempInt=fuelRodFuelLevel;
- float tempFloat=fuelRodHeatLevel;
- ItemStack output = input.copy();
- if (input.stackTagCompound != null){
- output.stackTagCompound = new NBTTagCompound();
- output.stackTagCompound.setInteger("fuelRemaining", tempInt-40);
- output.stackTagCompound.setFloat("heat", tempFloat+20);
- }
- return output;
- }
- return null;
- }
- else if(fuelRodHeatLevel >= 5 && fuelRodFuelLevel > 0){
- int tempInt=fuelRodFuelLevel;
- float tempFloat=fuelRodHeatLevel;
- ItemStack output = input.copy();
- if (input.stackTagCompound != null){
- output.stackTagCompound = new NBTTagCompound();
- output.stackTagCompound.setInteger("fuelRemaining", tempInt-5);
- output.stackTagCompound.setFloat("heat", tempFloat+5);
- }
- return output;
- }
-
- else if(fuelRodHeatLevel >= 5 && fuelRodFuelLevel == 0){
- ItemStack output = input.copy();
- if (input.stackTagCompound != null){
- output.stackTagCompound = new NBTTagCompound();
- output.stackTagCompound.setInteger("heat", -5);
- }
- return output;
- }
- else {
- return null;
- }
- }
- }
- }
- return null;
- }
-
- public float getRodHeatValue(ItemStack value){
- if (value != null){
- if (value.stackTagCompound != null){
- return value.stackTagCompound.getFloat("heat");
- }
- }
- return 0f;
- }
-
- public int getRodFuelValue(ItemStack value){
- if (value != null){
- if (value.stackTagCompound != null){
- int tempInt = value.stackTagCompound.getInteger("fuelRemaining");
- return tempInt;
- }
- }
- return 0;
- }
-
- public void checkFuelRods(){
-
- if(!this.worldObj.isRemote){
- for (int i = 0; i < getSizeInventory(); i++){
- if (items[i] != null){
- if (items[i].getItem() instanceof FuelRod_Base){
- ItemStack fuelRodStack = getStackInSlot(i).copy();
- //setInventorySlotContents(i, doFuelRodHeatDamage(fuelRodStack));
- if (i == 0){
- fuelrod_1 = true;
- ItemStack r = doFuelRodHeatDamage(fuelRodStack);
- setInventorySlotContents(i, r);
- }
- else if (i == 1){
- fuelrod_2 = true;
- ItemStack r = doFuelRodHeatDamage(fuelRodStack);
- setInventorySlotContents(i, r);
- }
- else if (i == 2){
- fuelrod_3 = true;
- ItemStack r = doFuelRodHeatDamage(fuelRodStack);
- setInventorySlotContents(i, r);
- }
- else if (i == 3){
- fuelrod_4 = true;
- ItemStack r = doFuelRodHeatDamage(fuelRodStack);
- setInventorySlotContents(i, r);
- }
- else if (i == 4){
- fuelrod_5 = true;
- ItemStack r = doFuelRodHeatDamage(fuelRodStack);
- setInventorySlotContents(i, r);
- }
- else if (i == 5){
- fuelrod_6 = true;
- ItemStack r = doFuelRodHeatDamage(fuelRodStack);
- setInventorySlotContents(i, r);
- }
- else if (i == 6){
- fuelrod_7 = true;
- ItemStack r = doFuelRodHeatDamage(fuelRodStack);
- setInventorySlotContents(i, r);
- }
- else if (i == 7){
- fuelrod_8 = true;
- ItemStack r = doFuelRodHeatDamage(fuelRodStack);
- setInventorySlotContents(i, r);
- }
- else if (i == 8){
- fuelrod_9 = true;
- ItemStack r = doFuelRodHeatDamage(fuelRodStack);
- setInventorySlotContents(i, r);
- }
- else if (i == 9){
- fuelrod_10 = true;
- ItemStack r = doFuelRodHeatDamage(fuelRodStack);
- setInventorySlotContents(i, r);
- }
- else if (i == 10){
- fuelrod_11 = true;
- ItemStack r = doFuelRodHeatDamage(fuelRodStack);
- setInventorySlotContents(i, r);
- }
- else if (i == 11){
- fuelrod_12 = true;
- ItemStack r = doFuelRodHeatDamage(fuelRodStack);
- setInventorySlotContents(i, r);
- }
- else if (i == 12){
- fuelrod_13 = true;
- ItemStack r = doFuelRodHeatDamage(fuelRodStack);
- setInventorySlotContents(i, r);
- }
- else if (i == 13){
- fuelrod_14 = true;
- ItemStack r = doFuelRodHeatDamage(fuelRodStack);
- setInventorySlotContents(i, r);
- }
- else if (i == 14){
- fuelrod_15 = true;
- ItemStack r = doFuelRodHeatDamage(fuelRodStack);
- setInventorySlotContents(i, r);
- }
- else if (i == 15){
- fuelrod_16 = true;
- ItemStack r = doFuelRodHeatDamage(fuelRodStack);
- setInventorySlotContents(i, r);
- }
- else if (i == 16){
- fuelrod_17 = true;
- ItemStack r = doFuelRodHeatDamage(fuelRodStack);
- setInventorySlotContents(i, r);
- }
- else if (i == 17){
- fuelrod_18 = true;
- ItemStack r = doFuelRodHeatDamage(fuelRodStack);
- setInventorySlotContents(i, r);
- }
-
-
- }
- }
- }
- Utils.LOG_WARNING("|"+fuelrod_1+"|"+fuelrod_2+"|"+fuelrod_3+"| "+"|"+fuelrod_10+"|"+fuelrod_11+"|"+fuelrod_12+"|");
- Utils.LOG_WARNING("|"+fuelrod_4+"|"+fuelrod_5+"|"+fuelrod_6+"| "+"|"+fuelrod_13+"|"+fuelrod_14+"|"+fuelrod_15+"|");
- Utils.LOG_WARNING("|"+fuelrod_7+"|"+fuelrod_8+"|"+fuelrod_9+"| "+"|"+fuelrod_16+"|"+fuelrod_17+"|"+fuelrod_18+"|");
- }
-
- }
-
- public boolean calculateHeat(){
- /*if (!fuelrod_1 || !fuelrod_2 || !fuelrod_3 || !fuelrod_4 || !fuelrod_5 || !fuelrod_6 || !fuelrod_7 || !fuelrod_8 || !fuelrod_9 || !fuelrod_10 || !fuelrod_11 || !fuelrod_12 || !fuelrod_13 || !fuelrod_14 || !fuelrod_15 || !fuelrod_16 || !fuelrod_17 || !fuelrod_18){
- coreTemp = 0;
- }
- else {*/
- if(!this.worldObj.isRemote){
- for (int i = 0; i < getSizeInventory(); i++){
- if (items[i] != null){
- if (items[i].getItem() instanceof FuelRod_Base){
- ItemStack fuelRodStack = getStackInSlot(i).copy();
- //if (fuelRodStack.stackTagCompound.getFloat("heat") != 0){
- doFuelRodHeatDamage(fuelRodStack);
- coreTemp = coreTemp+fuelRodStack.stackTagCompound.getFloat("heat");
- return true;
- //}
- }
- }
- }
- }
- //}
-
-
-
- return false;
- }
-
- @Override
- public int getSizeInventory()
- {
- return items.length;
- }
-
- @Override
- public ItemStack getStackInSlot(int slot)
- {
-
- return items[slot];
-
- }
-
- @Override
- public ItemStack decrStackSize(int slot, int amount)
- {
- if (items[slot] != null)
- {
- ItemStack itemstack;
-
- if (items[slot].stackSize == amount)
- {
- itemstack = items[slot];
- items[slot] = null;
- markDirty();
- return itemstack;
- }
- itemstack = items[slot].splitStack(amount);
- if (items[slot].stackSize == 0) items[slot] = null;
- markDirty();
- return itemstack;
- }
- return null;
- }
-
- @Override
- public ItemStack getStackInSlotOnClosing(int slot)
- {
- if (items[slot] != null)
- {
- ItemStack itemstack = items[slot];
- items[slot] = null;
- return itemstack;
- }
- return null;
- }
-
- @Override
- public void setInventorySlotContents(int slot, ItemStack stack)
- {
- if (stack != null){
- items[slot] = stack;
- if (stack != null && stack.stackSize > getInventoryStackLimit())
- {
- stack.stackSize = getInventoryStackLimit();
- }
-
-
- markDirty();
- }
- }
-
- @Override
- public String getInventoryName()
- {
- return "container.NHG";
- }
-
- @Override
- public boolean hasCustomInventoryName()
- {
- return false;
- }
-
- @Override
- public void readFromNBT(NBTTagCompound nbt)
- {
- super.readFromNBT(nbt);
- NBTTagList list = nbt.getTagList("Items", Constants.NBT.TAG_COMPOUND);
- items = new ItemStack[getSizeInventory()];
-
- for (int i = 0; i < list.tagCount(); ++i) { NBTTagCompound comp = list.getCompoundTagAt(i); int j = comp.getByte("Slot") & 255; if (j >= 0 && j < items.length)
- {
- items[j] = ItemStack.loadItemStackFromNBT(comp);
- }
- }
- }
-
- @Override
- public void writeToNBT(NBTTagCompound nbt)
- {
- super.writeToNBT(nbt);
- NBTTagList list = new NBTTagList();
-
- for (int i = 0; i < items.length; ++i)
- {
- if (items[i] != null)
- {
- NBTTagCompound comp = new NBTTagCompound();
- comp.setByte("Slot", (byte)i);
- items[i].writeToNBT(comp);
- list.appendTag(comp);
- }
- }
-
- nbt.setTag("Items", list);
- }
-
- @Override
- public int getInventoryStackLimit()
- {
- return 64;
- }
-
- @Override
- public boolean isUseableByPlayer(EntityPlayer player)
- {
- return worldObj.getTileEntity(xCoord, yCoord, zCoord) != this ? false : player.getDistanceSq((double)xCoord + 0.5D, (double)yCoord + 0.5D, (double)zCoord + 0.5D) <= 64.0D;
- }
-
- @Override
- public void openInventory() {}
-
- @Override
- public void closeInventory() {}
-
- @Override
- public boolean isItemValidForSlot(int slot, ItemStack stack)
- {
- return true;
- }
-
- //Machine Code - TODO
- private ItemStack neutrons;
-
- @Override
- public void updateEntity() {
-
- if(!this.worldObj.isRemote){
-
- if(progress >= heatCycleProgress){
- //Utils.LOG_SPECIFIC_WARNING("NFHG", "Updating Entity "+this.getBlockType().getUnlocalizedName(), 376);
- if (MathUtils.divideXintoY(heatCycleProgress, maxProgress)){
- Utils.LOG_SPECIFIC_WARNING("NFHG", "Updating Entity "+this.getBlockType().getUnlocalizedName(), 378);
- calculateHeat();
- heatCycleProgress=0;
- }
- }
-
- if(++progress >= maxProgress){
-
-
- Utils.LOG_SPECIFIC_WARNING("NFHG", "Updating Entity "+this.getBlockType().getUnlocalizedName(), 338);
- if (items[18] != null){
- ItemStack checkOutput = getStackInSlot(18);
- if(neutrons == null){
- neutrons = new ItemStack(ModItems.itemHeliumBlob, 1);
- if (checkOutput == null){
- Utils.LOG_WARNING("ItemStack in Output slot is definitely null, making a new ItemStack.");
- setInventorySlotContents(18, neutrons);
- progress = 0;
- markDirty();
- }
- else {
- checkOutput.stackSize++;
- Utils.LOG_WARNING("Found an ItemStack to increase the size of. Current size is "+neutrons.stackSize);
-
- progress = 0;
- markDirty();
- }
- }
- else if(checkOutput.getItem() == ModItems.itemHeliumBlob && checkOutput.stackSize < 64){
- checkOutput.stackSize++;
- Utils.LOG_WARNING("Found an ItemStack to increase size of. Current size is "+checkOutput.stackSize);
- progress = 0;
- markDirty();
- }
- else if(checkOutput.getItem() == ModItems.itemHeliumBlob && checkOutput.stackSize == 64){
- Utils.LOG_WARNING("Output stack is full.");
- progress = 0;
- markDirty();
- }
- }
- else if (items[18] == null){
- Utils.LOG_WARNING("ItemStack in Output slot is null");
- neutrons = new ItemStack(ModItems.itemHeliumBlob, 1);
- ItemStack checkOutput = getStackInSlot(18);
- if (checkOutput == null){
- Utils.LOG_WARNING("ItemStack in Output slot is definitely null, making a new ItemStack.");
- setInventorySlotContents(18, neutrons);
- progress = 0;
- markDirty();
- }
- else {
- Utils.LOG_WARNING("Found an ItemStack to increase the size of.");
- checkOutput.stackSize++;
- progress = 0;
- markDirty();
- }
- }
- checkFuelRods();
- }
- progress++;
- }
- }
-
- public void readCustomNBT(NBTTagCompound tag)
- {
- this.neutrons = ItemStack.loadItemStackFromNBT(tag.getCompoundTag("Neutrons"));
- this.progress = tag.getInteger("Progress");
- this.coreTemp = tag.getFloat("coreTemp");
- }
-
- public void writeCustomNBT(NBTTagCompound tag)
- {
- tag.setInteger("Progress", this.progress);
- tag.setFloat("coreTemp", this.coreTemp);
- if(neutrons != null) {
- NBTTagCompound produce = new NBTTagCompound();
- neutrons.writeToNBT(produce);
- tag.setTag("Neutrons", produce);
- }
- else
- tag.removeTag("Neutrons");
- }
-
-
-
-} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/util/Utils.java b/src/Java/gtPlusPlus/core/util/Utils.java
index 10a8f0fa3e..4d944788dd 100644
--- a/src/Java/gtPlusPlus/core/util/Utils.java
+++ b/src/Java/gtPlusPlus/core/util/Utils.java
@@ -77,7 +77,7 @@ public class Utils {
TC_AspectStack returnValue = null;
- if (aspect.toUpperCase() == "COGNITIO"){
+ if (aspect.toUpperCase().equals("COGNITIO")){
//Adds in Compat for older GT Versions which Misspell aspects.
try {
if (EnumUtils.isValidEnum(TC_Aspects.class, "COGNITIO")){
@@ -92,7 +92,7 @@ public class Utils {
Utils.LOG_INFO("Invalid Thaumcraft Aspects - Report this issue to Alkalus");
}
}
- else if (aspect.toUpperCase() == "EXANIMUS"){
+ else if (aspect.toUpperCase().equals("EXANIMUS")){
//Adds in Compat for older GT Versions which Misspell aspects.
try {
if (EnumUtils.isValidEnum(TC_Aspects.class, "EXANIMUS")){
@@ -109,7 +109,7 @@ public class Utils {
}
- else if (aspect.toUpperCase() == "PRAECANTATIO"){
+ else if (aspect.toUpperCase().equals("PRAECANTATIO")){
//Adds in Compat for older GT Versions which Misspell aspects.
try {
if (EnumUtils.isValidEnum(TC_Aspects.class, "PRAECANTATIO")){
@@ -201,7 +201,9 @@ public class Utils {
* Returns if that Liquid is IC2Steam.
*/
public static boolean isIC2Steam(FluidStack aFluid) {
- if (aFluid == null) return false;
+ if (aFluid == null) {
+ return false;
+ }
return aFluid.isFluidEqual(getIC2Steam(1));
}
@@ -441,8 +443,7 @@ public class Utils {
result = hexChar+hexAsStringOrInt;
return result;
}
- else if (hexAsStringOrInt.getClass() == Integer.class){
- ;
+ else if (hexAsStringOrInt.getClass() == Integer.class){
if (((String) hexAsStringOrInt).length() != 6){
String temp = leftPadWithZeroes((String) hexAsStringOrInt, 6);
result = temp;
diff --git a/src/Java/gtPlusPlus/core/util/item/ItemUtils.java b/src/Java/gtPlusPlus/core/util/item/ItemUtils.java
index 82c38de8bd..1f597302ba 100644
--- a/src/Java/gtPlusPlus/core/util/item/ItemUtils.java
+++ b/src/Java/gtPlusPlus/core/util/item/ItemUtils.java
@@ -78,7 +78,7 @@ public class ItemUtils {
try {
Item em = null;
Item em1 = getItem(FQRN);
- Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta);
+ //Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta);
if (em1 != null){
em = em1;
}
@@ -103,13 +103,12 @@ public class ItemUtils {
}
}
- @SuppressWarnings("unused")
public static ItemStack getItemStackWithMeta(boolean MOD, String FQRN, String itemName, int meta, int itemstackSize){
if (MOD){
try {
Item em = null;
Item em1 = getItem(FQRN);
- Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta);
+ //Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta);
if (em1 != null){
if (null == em){
em = em1;
@@ -128,12 +127,11 @@ public class ItemUtils {
return null;
}
- @SuppressWarnings("unused")
public static ItemStack simpleMetaStack(String FQRN, int meta, int itemstackSize){
try {
Item em = null;
Item em1 = getItem(FQRN);
- Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta);
+ //Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta);
if (em1 != null){
if (null == em){
em = em1;
@@ -170,7 +168,7 @@ public class ItemUtils {
}
return null;
} catch (NullPointerException e) {
- Utils.LOG_ERROR(item.getUnlocalizedName()+" not found. [NULL]");
+ //Utils.LOG_ERROR(item.getUnlocalizedName()+" not found. [NULL]");
return null;
}
}
@@ -218,17 +216,6 @@ public class ItemUtils {
return GameRegistry.findItemStack(fqrnSplit[0], fqrnSplit[1], Size);
}
- // TODO
- /*public static FluidStack getFluidStack(Materials m, int Size) // fqrn = fully qualified resource name
- {
- String[] fqrnSplit = fqrn.split(":");
-
- FluidStack x = (FluidStack) "Materials."+m+".getFluid"(Size);
-
- return GameRegistry.findItemStack(fqrnSplit[0], fqrnSplit[1], Size);
- }*/
-
-
public static void generateSpawnEgg(String entityModID, String parSpawnName, int colourEgg, int colourOverlay){
Item itemSpawnEgg = new BasicSpawnEgg(entityModID, parSpawnName, colourEgg, colourOverlay).setUnlocalizedName("spawn_egg_"+parSpawnName.toLowerCase()).setTextureName(CORE.MODID+":spawn_egg");
GameRegistry.registerItem(itemSpawnEgg, "spawnEgg"+parSpawnName);
@@ -405,8 +392,9 @@ public class ItemUtils {
public static BaseItemDecidust generateDecidust(Materials material){
if (GT_OreDictUnificator.get(OrePrefixes.dust, material, 1L) != null){
Material placeholder = MaterialUtils.generateMaterialFromGtENUM(material);
- if (placeholder != null)
- generateDecidust(placeholder);
+ if (placeholder != null) {
+ generateDecidust(placeholder);
+ }
}
return null;
}
@@ -422,8 +410,9 @@ public class ItemUtils {
public static BaseItemCentidust generateCentidust(Materials material){
if (GT_OreDictUnificator.get(OrePrefixes.dust, material, 1L) != null){
Material placeholder = MaterialUtils.generateMaterialFromGtENUM(material);
- if (placeholder != null)
- generateCentidust(placeholder);
+ if (placeholder != null) {
+ generateCentidust(placeholder);
+ }
}
return null;
}
@@ -515,7 +504,7 @@ public class ItemUtils {
if (blockDrops.isEmpty()){
return null;
}
- ItemStack outputs[] = new ItemStack[blockDrops.size()];
+ ItemStack[] outputs = new ItemStack[blockDrops.size()];
short forCounter = 0;
for (ItemStack I : blockDrops){
outputs[forCounter] = I;
diff --git a/src/Java/gtPlusPlus/core/util/player/UtilsMining.java b/src/Java/gtPlusPlus/core/util/player/UtilsMining.java
index 9147f4195c..8468c4b3a2 100644
--- a/src/Java/gtPlusPlus/core/util/player/UtilsMining.java
+++ b/src/Java/gtPlusPlus/core/util/player/UtilsMining.java
@@ -2,7 +2,6 @@ package gtPlusPlus.core.util.player;
import gtPlusPlus.core.util.Utils;
import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
@@ -44,7 +43,7 @@ public class UtilsMining {
}
}
- public static void customMine(World world, String FACING, EntityPlayer aPlayer){
+ /*public static void customMine(World world, String FACING, EntityPlayer aPlayer){
float DURABILITY_LOSS = 0;
if (!world.isRemote){
@@ -71,10 +70,10 @@ public class UtilsMining {
for(int i = -2; i < 3; i++) {
for(int j = -2; j < 3; j++) {
for(int k = -2; k < 3; k++) {
-/*// float dur = calculateDurabilityLoss(world, X + i, Y + k, Z + j);
+// float dur = calculateDurabilityLoss(world, X + i, Y + k, Z + j);
// DURABILITY_LOSS = (DURABILITY_LOSS + dur);
// Utils.LOG_WARNING("Added Loss: "+dur);
-*/ removeBlockAndDropAsItem(world, X + i, Y + k, Z + j);
+ removeBlockAndDropAsItem(world, X + i, Y + k, Z + j);
}
}
}
@@ -95,9 +94,9 @@ public class UtilsMining {
for(int i = -1; i < 2; i++) {
for(int j = -1; j < 2; j++) {
for(int k = -1; k < 2; k++) {
- /*float dur = calculateDurabilityLoss(world, X+k, Y + i, Z + j);
+ float dur = calculateDurabilityLoss(world, X+k, Y + i, Z + j);
DURABILITY_LOSS = (DURABILITY_LOSS + dur);
- Utils.LOG_WARNING("Added Loss: "+dur);*/
+ Utils.LOG_WARNING("Added Loss: "+dur);
removeBlockAndDropAsItem(world, X+k, Y + i, Z + j);
}
}
@@ -119,9 +118,9 @@ public class UtilsMining {
for(int i = -1; i < 2; i++) {
for(int j = -1; j < 2; j++) {
for(int k = -1; k < 2; k++) {
- /*float dur = calculateDurabilityLoss(world, X + j, Y + i, Z+k);
+ float dur = calculateDurabilityLoss(world, X + j, Y + i, Z+k);
DURABILITY_LOSS = (DURABILITY_LOSS + dur);
- Utils.LOG_WARNING("Added Loss: "+dur);*/
+ Utils.LOG_WARNING("Added Loss: "+dur);
removeBlockAndDropAsItem(world, X + j, Y + i, Z+k);
}
}
@@ -137,7 +136,7 @@ public class UtilsMining {
}
DURABILITY_LOSS = 0;
}
- }
+ }*/
public static boolean getBlockType(Block block, World world, int[] xyz, int miningLevel){
diff --git a/src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java b/src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java
index fe4399a579..c1972f4cfd 100644
--- a/src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java
+++ b/src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java
@@ -87,7 +87,11 @@ public class RecipeUtils {
Utils.LOG_WARNING("Adding 1.");
j++;
}
- else if (j >= 3){
+ else if (j == l){
+ Utils.LOG_WARNING("Done iteration.");
+ break;
+ }
+ else {
Utils.LOG_WARNING("ArrayList Values: '"+validSlots.get(j)+"' "+validSlots.get(j+1));
if (j < (l-2)){
Utils.LOG_WARNING("Adding 2.");
@@ -98,10 +102,6 @@ public class RecipeUtils {
break;
}
}
- else if (j == l){
- Utils.LOG_WARNING("Done iteration.");
- break;
- }
if (validSlots.get(j) instanceof String || validSlots.get(j) instanceof ItemStack){
//Utils.LOG_WARNING("Is Valid: "+validSlots.get(j));
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java
index d283cece3c..b830f9fd5a 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java
@@ -230,11 +230,6 @@ public enum GregtechOrePrefixes {
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);
@@ -530,7 +525,7 @@ public enum GregtechOrePrefixes {
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;
+ if (tObject != null && tObject instanceof GT_Materials) return (GT_Materials) tObject;
return _NULL;
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_DeluxeTank.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_DeluxeTank.java
index d4412ca3f5..2620f9b275 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_DeluxeTank.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_DeluxeTank.java
@@ -19,8 +19,6 @@ import cpw.mods.fml.relauncher.SideOnly;
*/
public class CONTAINER_DeluxeTank extends GT_Container_BasicTank {
- public int mContent = 0;
-
public CONTAINER_DeluxeTank(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
super(aInventoryPlayer, aTileEntity);
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SteamCondenser.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SteamCondenser.java
index 3feea9d2df..8d15fa030a 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SteamCondenser.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SteamCondenser.java
@@ -14,84 +14,84 @@ 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;
- }
- }
+ 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/gtPlusPlus/xmod/gregtech/api/gui/GUI_IronBlastFurnace.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IronBlastFurnace.java
index 1ce7bdea68..9d1a05e68d 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IronBlastFurnace.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IronBlastFurnace.java
@@ -24,7 +24,7 @@ public class GUI_IronBlastFurnace
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);
+ drawTexturedModalRect(x + 58, y + 28, 176, 0, Math.max(0, Math.min(20, 1 + this.mContainer.mProgressTime * 20 / (this.mContainer.mMaxProgressTime < 1 ? 1 : this.mContainer.mMaxProgressTime))), 11);
}
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeTank.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeTank.java
index 2effc58f9a..3cd26a8b7b 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeTank.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeTank.java
@@ -20,7 +20,6 @@ import net.minecraftforge.fluids.FluidStack;
*/
public abstract class GT_MetaTileEntity_DeluxeTank extends GT_MetaTileEntity_BasicTank {
- public FluidStack mFluid;
public FluidStack mFluid2;
/**
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java
index 1e88135e94..802687dd88 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java
@@ -17,7 +17,6 @@ import ic2.api.energy.tile.IEnergySink;
import java.util.ArrayList;
import java.util.Arrays;
-import cofh.energy.IEnergyReceiver;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.tileentity.TileEntity;
@@ -25,15 +24,14 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
+import cofh.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);
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_SuperConductor.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_SuperConductor.java
index 23c1f3e47f..5333b1ae24 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_SuperConductor.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_SuperConductor.java
@@ -18,7 +18,6 @@ import ic2.api.energy.tile.IEnergySink;
import java.util.ArrayList;
import java.util.Arrays;
-import cofh.energy.IEnergyReceiver;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.tileentity.TileEntity;
@@ -26,15 +25,14 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
+import cofh.energy.IEnergyReceiver;
public class GregtechMetaPipeEntity_SuperConductor extends GregtechMetaPipeEntityBase_Cable implements IMetaTileEntityCable {
- public long mTransferredAmperage = 0, mTransferredAmperageLast20 = 0, mTransferredVoltageLast20 = 0;
-
+
public final float mThickNess;
public final GT_Materials mMaterial;
public final long mCableLossPerMeter, mAmperage, mVoltage;
public final boolean mInsulated, mCanShock;
- public long mRestRF;
public GregtechMetaPipeEntity_SuperConductor(int aID, String aName, String aNameRegional, float aThickNess, GT_Materials aMaterial, long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) {
super(aID, aName, aNameRegional, 0, aMaterial, 0, aAmperage, aVoltage, aInsulated, aCanShock);
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java
index 617335eac6..81318efce7 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java
@@ -35,7 +35,7 @@ public abstract class GregtechMetaSafeBlockBase extends GT_MetaTileEntity_Tiered
@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);
+ ITexture tIcon = getOverlayIcon(), tOut = new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_QCHEST), tUp = new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_VENT);
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?
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/creative/GregtechMetaCreativeEnergyBuffer.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/creative/GregtechMetaCreativeEnergyBuffer.java
index 16f3ee019f..e2ec5aa0c8 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/creative/GregtechMetaCreativeEnergyBuffer.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/creative/GregtechMetaCreativeEnergyBuffer.java
@@ -38,9 +38,6 @@ public class GregtechMetaCreativeEnergyBuffer extends GregtechMetaEnergyBuffer {
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"};
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechRenderedTexture.java b/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechRenderedTexture.java
deleted file mode 100644
index e22c324984..0000000000
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechRenderedTexture.java
+++ /dev/null
@@ -1,160 +0,0 @@
-package gtPlusPlus.xmod.gregtech.api.objects;
-
-import gregtech.api.enums.Dyes;
-import gregtech.api.interfaces.*;
-import gtPlusPlus.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/gtPlusPlus/xmod/gregtech/api/objects/XSTR.java b/src/Java/gtPlusPlus/xmod/gregtech/api/objects/XSTR.java
index c0ccffe4d9..da3df32d3a 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/objects/XSTR.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/objects/XSTR.java
@@ -255,10 +255,11 @@ public class XSTR extends Random {
@Override
public void nextBytes(byte[] bytes_arr) {
- for (int iba = 0, lenba = bytes_arr.length; iba < lenba; )
- for (int rndba = nextInt(),
+ for (int iba = 0, lenba = bytes_arr.length; iba < lenba; ) {
+ for (int rndba = nextInt(),
nba = Math.min(lenba - iba, Integer.SIZE/Byte.SIZE);
nba-- > 0; rndba >>= Byte.SIZE)
bytes_arr[iba++] = (byte)rndba;
+ }
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechRecipeRegistrator.java b/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechRecipeRegistrator.java
index bb4173ecf1..48c8db0596 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechRecipeRegistrator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechRecipeRegistrator.java
@@ -170,10 +170,6 @@ public class GregtechRecipeRegistrator {
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);
@@ -219,10 +215,6 @@ public class GregtechRecipeRegistrator {
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);
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java b/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java
index 0ed27c97dc..b5ffac8e07 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java
@@ -1,434 +1,30 @@
package gtPlusPlus.xmod.gregtech.common;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.metatileentity.BaseMetaTileEntity;
-import gregtech.api.objects.ItemData;
-import gregtech.api.objects.MaterialStack;
-import gregtech.api.util.*;
-import gregtech.common.GT_Proxy.OreDictEventContainer;
-import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes;
-import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
-import gtPlusPlus.xmod.gregtech.api.util.GregtechOreDictUnificator;
-import gtPlusPlus.xmod.gregtech.api.util.GregtechRecipeRegistrator;
-import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechItems;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
-import cpw.mods.fml.common.Loader;
-import cpw.mods.fml.common.ModContainer;
-import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class Meta_GT_Proxy {
- //Store Some MetaTileEntity Data here, why not?
- public static final IMetaTileEntity[] METATILEENTITIES = new IMetaTileEntity[GregTech_API.MAXIMUM_METATILE_IDS];
-
public static List<Runnable> GT_BlockIconload = new ArrayList<Runnable>();
public static List<Runnable> GT_ItemIconload = new ArrayList<Runnable>();
-
-
@SideOnly(Side.CLIENT)
public static IIconRegister sBlockIcons, sItemIcons;
- //Silly Vars
- private static final Collection<String> mIgnoredItems = new HashSet<String>(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<String>(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<String>(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<ItemStack>(10000);
- public final static Collection<GregtechOreDictEventContainer> mEvents = new HashSet<GregtechOreDictEventContainer>();
- public final static Collection<OreDictEventContainer> mEventsFake = new HashSet<OreDictEventContainer>();
-
public Meta_GT_Proxy() {
Utils.LOG_INFO("GT_PROXY - initialized.");
for (String tOreName : OreDictionary.getOreNames()) {
- ItemStack tOreStack;
- for (Iterator<?> i$ = OreDictionary.getOres(tOreName).iterator(); i$.hasNext(); registerOre(new OreDictionary.OreRegisterEvent(tOreName, tOreStack))) {
- tOreStack = (ItemStack) i$.next();
- }
- }
- }
-
- /*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 registerOre2(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.");
- }
- }
-
- private static final void registerRecipes(OreDictEventContainer aOre) {
- if ((aOre.mEvent.Ore == null) || (aOre.mEvent.Ore.getItem() == null)) {
- return;
- }
- if (aOre.mEvent.Ore.stackSize != 1) {
- aOre.mEvent.Ore.stackSize = 1;
- }
- if (aOre.mPrefix != null) {
- if (!aOre.mPrefix.isIgnored(aOre.mMaterial)) {
- aOre.mPrefix.processOre(aOre.mMaterial == null ? Materials._NULL : aOre.mMaterial, aOre.mEvent.Name, aOre.mModID,
- GT_Utility.copyAmount(1L, new Object[]{aOre.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;
- if (mEvents.size() == 0){
- Utils.LOG_INFO("Found nothing to iterate over for use in material addition.");
- }
- for (Iterator<GregtechOreDictEventContainer> i$ = mEvents.iterator(); i$.hasNext(); registerRecipes(tEvent)) {
- tEvent = (GregtechOreDictEventContainer) i$.next();
- }
- OreDictEventContainer tEvent2;
- if (mEventsFake.size() == 0){
- Utils.LOG_INFO("Found nothing to iterate over for use in GT material addition.");
- }
- for (Iterator<OreDictEventContainer> i$ = mEventsFake.iterator(); i$.hasNext(); registerRecipes(tEvent2)) {
- tEvent2 = (OreDictEventContainer) 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);
- }
- }
+ }
public static boolean areWeUsingGregtech5uExperimental(){
int version = GregTech_API.VERSION;
@@ -442,477 +38,5 @@ public class Meta_GT_Proxy {
return false;
}
}
-
-
-
-
-
-
- @SubscribeEvent
- public void registerOre(OreDictionary.OreRegisterEvent aEvent) {
- ModContainer tContainer = Loader.instance().activeModContainer();
- String aMod = tContainer == null ? "UNKNOWN" : tContainer.getModId();
- String aOriginalMod = aMod;
- if (GT_OreDictUnificator.isRegisteringOres()) {
- aMod = "gregtech";
- } else if (aMod.equals("gregtech")) {
- 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("gregtech")) {
- 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;
- if (true || aEvent.Ore.getUnlocalizedName().startsWith("item.oreberry")) {
- if ((aOriginalMod.toLowerCase().contains("xycraft")) || (aOriginalMod.toLowerCase().contains("tconstruct"))
- || ((aOriginalMod.toLowerCase().contains("natura")) && (!aOriginalMod.toLowerCase().contains("natural")))) {
- if (GT_Values.D1) {
- GT_Log.ore.println(aMod + " -> " + aEvent.Name + " is getting ignored, because of racism. :P");
- }
- return;
- }
- }
- 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)) {
- GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
- }
- mRegisteredOres.add(aEvent.Ore);
- if ((aEvent.Name.startsWith("item")) && (mIgnoredItems.contains(aEvent.Name))) {
- GT_Log.ore.println(tModToName);
- if (aEvent.Name.equals("itemCopperWire")) {
- GT_OreDictUnificator.registerOre(OreDictNames.craftingWireCopper, aEvent.Ore);
- }
- if (aEvent.Name.equals("itemRubber")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.Rubber, aEvent.Ore);
- }
- return;
- }
- if (mIgnoredNames.contains(aEvent.Name)) {
- GT_Log.ore.println(tModToName + " is getting ignored via hardcode.");
- return;
- }
- if (aEvent.Name.equals("stone")) {
- GT_OreDictUnificator.registerOre("stoneSmooth", aEvent.Ore);
- return;
- }
- if (aEvent.Name.equals("cobblestone")) {
- GT_OreDictUnificator.registerOre("stoneCobble", aEvent.Ore);
- 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.equals("copperWire")) {
- GT_OreDictUnificator.registerOre(OreDictNames.craftingWireCopper, aEvent.Ore);
- }
- if (aEvent.Name.equals("oreHeeEndrium")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.ore, Materials.Endium, aEvent.Ore);
- }
- if (aEvent.Name.equals("sheetPlastic")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.plate, Materials.Plastic, aEvent.Ore);
- }
- if (aEvent.Name.equals("shardAir")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedAir, aEvent.Ore);
- return;
- }
- if (aEvent.Name.equals("shardWater")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedWater, aEvent.Ore);
- return;
- }
- if (aEvent.Name.equals("shardFire")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedFire, aEvent.Ore);
- return;
- }
- if (aEvent.Name.equals("shardEarth")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedEarth, aEvent.Ore);
- return;
- }
- if (aEvent.Name.equals("shardOrder")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedOrder, aEvent.Ore);
- return;
- }
- if (aEvent.Name.equals("shardEntropy")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.gem, Materials.InfusedEntropy, aEvent.Ore);
- return;
- }
- if (aEvent.Name.equals("fieryIngot")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.FierySteel, aEvent.Ore);
- return;
- }
- if (aEvent.Name.equals("ironwood")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.IronWood, aEvent.Ore);
- return;
- }
- if (aEvent.Name.equals("steeleaf")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.Steeleaf, aEvent.Ore);
- return;
- }
- if (aEvent.Name.equals("knightmetal")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.ingot, Materials.Knightmetal, aEvent.Ore);
- return;
- }
- if (aEvent.Name.contains(" ")) {
- GT_Log.ore.println(tModToName + " is getting re-registered because the OreDict Name containing invalid spaces.");
- GT_OreDictUnificator.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;
- }
- OrePrefixes aPrefix = OrePrefixes.getOrePrefix(aEvent.Name);
- Materials aMaterial = Materials._NULL;
- if ((aPrefix == OrePrefixes.nugget) && (aMod.equals("Thaumcraft")) && (aEvent.Ore.getItem().getUnlocalizedName().contains("ItemResource"))) {
- return;
- }
- 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) {
- GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
- }
- if (aPrefix != aPrefix.mPrefixInto) {
- String tNewName = aEvent.Name.replaceFirst(aPrefix.toString(), aPrefix.mPrefixInto.toString());
- if (!GT_OreDictUnificator.isRegisteringOres()) {
- GT_Log.ore.println(tModToName + " uses a depricated Prefix, and is getting re-registered as " + tNewName);
- }
- GT_OreDictUnificator.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 = Materials.get(tName);
- if (aMaterial != aMaterial.mMaterialInto) {
- GT_OreDictUnificator.registerOre(aPrefix, aMaterial.mMaterialInto, aEvent.Ore);
- if (!GT_OreDictUnificator.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 != Materials._NULL) {
- Materials tReRegisteredMaterial;
- for (Iterator i$ = aMaterial.mOreReRegistrations.iterator(); i$.hasNext(); GT_OreDictUnificator.registerOre(aPrefix,
- tReRegisteredMaterial, aEvent.Ore)) {
- tReRegisteredMaterial = (Materials) i$.next();
- }
- aMaterial.add(GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
- if ((GregTech_API.sThaumcraftCompat != null) && (aPrefix.doGenerateItem(aMaterial)) && (!aPrefix.isIgnored(aMaterial))) {
- long tAmount = aPrefix.mMaterialAmount < 0L ? 3628800L : aPrefix.mMaterialAmount;
- List<TC_Aspects.TC_AspectStack> tAspects = new ArrayList();
- TC_Aspects.TC_AspectStack tAspect;
- for (Iterator i$ = aPrefix.mAspects.iterator(); i$.hasNext(); tAspect.addToAspectList(tAspects)) {
- tAspect = (TC_Aspects.TC_AspectStack) i$.next();
- }
- tAspect = null;
- for (Iterator i$ = aMaterial.mAspects.iterator(); i$.hasNext(); tAspect.copy(tAspect.mAmount * tAmount / 3628800L)
- .addToAspectList(tAspects)) {
- tAspect = (TC_Aspects.TC_AspectStack) i$.next();
- }
- GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}),
- tAspects, aEvent.Name);
- }
- switch (aPrefix) {
- case crystal:
- if ((aMaterial == Materials.CertusQuartz) || (aMaterial == Materials.NetherQuartz) || (aMaterial == Materials.Fluix)) {
- GT_OreDictUnificator.registerOre(OrePrefixes.gem, aMaterial, aEvent.Ore);
- }
- break;
- case gem:
- switch (aMaterial) {
- case Lapis:
- case Sodalite:
- GT_OreDictUnificator.registerOre(Dyes.dyeBlue, aEvent.Ore);
- break;
- case Lazurite:
- GT_OreDictUnificator.registerOre(Dyes.dyeCyan, aEvent.Ore);
- break;
- case InfusedAir:
- case InfusedWater:
- case InfusedFire:
- case InfusedEarth:
- case InfusedOrder:
- case InfusedEntropy:
- GT_OreDictUnificator.registerOre(aMaterial.name().replaceFirst("Infused", "shard"), aEvent.Ore);
- break;
- case Chocolate:
- GT_OreDictUnificator.registerOre(Dyes.dyeBrown, aEvent.Ore);
- break;
- case CertusQuartz:
- case NetherQuartz:
- GT_OreDictUnificator.registerOre(OrePrefixes.item.get(aMaterial), aEvent.Ore);
- case Fluix:
- case Quartz:
- case Quartzite:
- GT_OreDictUnificator.registerOre(OrePrefixes.crystal, aMaterial, aEvent.Ore);
- GT_OreDictUnificator.registerOre(OreDictNames.craftingQuartz, aEvent.Ore);
- default:
- break;
- }
- break;
- case cableGt01:
- if (aMaterial == Materials.Tin) {
- GT_OreDictUnificator.registerOre(OreDictNames.craftingWireTin, aEvent.Ore);
- }
- if (aMaterial == Materials.AnyCopper) {
- GT_OreDictUnificator.registerOre(OreDictNames.craftingWireCopper, aEvent.Ore);
- }
- if (aMaterial == Materials.Gold) {
- GT_OreDictUnificator.registerOre(OreDictNames.craftingWireGold, aEvent.Ore);
- }
- if (aMaterial == Materials.AnyIron) {
- GT_OreDictUnificator.registerOre(OreDictNames.craftingWireIron, aEvent.Ore);
- }
- break;
- case lens:
- if ((aMaterial.contains(SubTag.TRANSPARENT)) && (aMaterial.mColor != Dyes._NULL)) {
- GT_OreDictUnificator.registerOre("craftingLens" + aMaterial.mColor.toString().replaceFirst("dye", ""), aEvent.Ore);
- }
- break;
- case plate:
- if ((aMaterial == Materials.Plastic) || (aMaterial == Materials.Rubber)) {
- GT_OreDictUnificator.registerOre(OrePrefixes.sheet, aMaterial, aEvent.Ore);
- }
- if (aMaterial == Materials.Silicon) {
- GT_OreDictUnificator.registerOre(OrePrefixes.item, aMaterial, aEvent.Ore);
- }
- if (aMaterial == Materials.Wood) {
- GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
- GT_OreDictUnificator.registerOre(OrePrefixes.plank, aMaterial, aEvent.Ore);
- }
- break;
- case cell:
- if (aMaterial == Materials.Empty) {
- GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
- }
- break;
- case gearGt:
- GT_OreDictUnificator.registerOre(OrePrefixes.gear, aMaterial, aEvent.Ore);
- break;
- case stick:
- if (!GT_RecipeRegistrator.sRodMaterialList.contains(aMaterial)) {
- GT_RecipeRegistrator.sRodMaterialList.add(aMaterial);
- }
- if (aMaterial == Materials.Wood) {
- GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
- }
- if ((aMaterial == Materials.Tin) || (aMaterial == Materials.Lead) || (aMaterial == Materials.SolderingAlloy)) {
- GT_OreDictUnificator.registerOre(ToolDictNames.craftingToolSolderingMetal, aEvent.Ore);
- }
- break;
- case dust:
- if (aMaterial == Materials.Salt) {
- GT_OreDictUnificator.registerOre("itemSalt", aEvent.Ore);
- }
- if (aMaterial == Materials.Wood) {
- GT_OreDictUnificator.registerOre("pulpWood", aEvent.Ore);
- }
- if (aMaterial == Materials.Wheat) {
- GT_OreDictUnificator.registerOre("foodFlour", aEvent.Ore);
- }
- if (aMaterial == Materials.Lapis) {
- GT_OreDictUnificator.registerOre(Dyes.dyeBlue, aEvent.Ore);
- }
- if (aMaterial == Materials.Lazurite) {
- GT_OreDictUnificator.registerOre(Dyes.dyeCyan, aEvent.Ore);
- }
- if (aMaterial == Materials.Sodalite) {
- GT_OreDictUnificator.registerOre(Dyes.dyeBlue, aEvent.Ore);
- }
- if (aMaterial == Materials.Cocoa) {
- GT_OreDictUnificator.registerOre(Dyes.dyeBrown, aEvent.Ore);
- GT_OreDictUnificator.registerOre("foodCocoapowder", aEvent.Ore);
- }
- if (aMaterial == Materials.Coffee) {
- GT_OreDictUnificator.registerOre(Dyes.dyeBrown, aEvent.Ore);
- }
- if (aMaterial == Materials.BrownLimonite) {
- GT_OreDictUnificator.registerOre(Dyes.dyeBrown, aEvent.Ore);
- }
- if (aMaterial == Materials.YellowLimonite) {
- GT_OreDictUnificator.registerOre(Dyes.dyeYellow, aEvent.Ore);
- }
- break;
- case ingot:
- if (aMaterial == Materials.Rubber) {
- GT_OreDictUnificator.registerOre("itemRubber", aEvent.Ore);
- }
- if (aMaterial == Materials.FierySteel) {
- GT_OreDictUnificator.registerOre("fieryIngot", aEvent.Ore);
- }
- if (aMaterial == Materials.IronWood) {
- GT_OreDictUnificator.registerOre("ironwood", aEvent.Ore);
- }
- if (aMaterial == Materials.Steeleaf) {
- GT_OreDictUnificator.registerOre("steeleaf", aEvent.Ore);
- }
- if (aMaterial == Materials.Knightmetal) {
- GT_OreDictUnificator.registerOre("knightmetal", aEvent.Ore);
- }
- if ((aMaterial == Materials.Brass) && (aEvent.Ore.getItemDamage() == 2)
- && (aEvent.Ore.getUnlocalizedName().equals("item.ingotBrass"))
- && (new ItemStack(aEvent.Ore.getItem(), 1, 0).getUnlocalizedName().contains("red"))) {
- GT_OreDictUnificator.set(OrePrefixes.ingot, Materials.RedAlloy, new ItemStack(aEvent.Ore.getItem(), 1, 0));
- GT_OreDictUnificator.set(OrePrefixes.ingot, Materials.BlueAlloy, new ItemStack(aEvent.Ore.getItem(), 1, 1));
- GT_OreDictUnificator.set(OrePrefixes.ingot, Materials.Brass, new ItemStack(aEvent.Ore.getItem(), 1, 2));
- GT_Values.RA.addCutterRecipe(new ItemStack(aEvent.Ore.getItem(), 1, 3), new ItemStack(aEvent.Ore.getItem(), 16, 4),
- null, 400, 8);
- }
- break;
- default:
- break;
- }
- if (aPrefix.mIsUnificatable && !aMaterial.mUnificatable) {
- return;
- }
- } else {
- for (Dyes tDye : Dyes.VALUES) {
- if (aEvent.Name.endsWith(tDye.name().replaceFirst("dye", ""))) {
- GT_OreDictUnificator.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;
- }
- switch (aPrefix) {
- case dye:
- if (GT_Utility.isStringValid(tName)) {
- GT_OreDictUnificator.registerOre(OrePrefixes.dye, aEvent.Ore);
- }
- break;
- case stoneSmooth:
- GT_OreDictUnificator.registerOre("stone", aEvent.Ore);
- break;
- case stoneCobble:
- GT_OreDictUnificator.registerOre("cobblestone", aEvent.Ore);
- break;
- case plank:
- if (tName.equals("Wood")) {
- GT_OreDictUnificator.addItemData(aEvent.Ore, new ItemData(Materials.Wood, 3628800L, new MaterialStack[0]));
- }
- break;
- case slab:
- if (tName.equals("Wood")) {
- GT_OreDictUnificator.addItemData(aEvent.Ore, new ItemData(Materials.Wood, 1814400L, new MaterialStack[0]));
- }
- break;
- case sheet:
- if (tName.equals("Plastic")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.plate, Materials.Plastic, aEvent.Ore);
- }
- if (tName.equals("Rubber")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.plate, Materials.Rubber, aEvent.Ore);
- }
- break;
- case crafting:
- if (tName.equals("ToolSolderingMetal")) {
- GregTech_API.registerSolderingMetal(aEvent.Ore);
- }
- if (tName.equals("IndustrialDiamond")) {
- GT_OreDictUnificator.addToBlacklist(aEvent.Ore);
- }
- if (tName.equals("WireCopper")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.wire, Materials.Copper, aEvent.Ore);
- }
- break;
- case wood:
- if (tName.equals("Rubber")) {
- GT_OreDictUnificator.registerOre("logRubber", aEvent.Ore);
- }
- break;
- case food:
- if (tName.equals("Cocoapowder")) {
- GT_OreDictUnificator.registerOre(OrePrefixes.dust, Materials.Cocoa, aEvent.Ore);
- }
- break;
- default:
- break;
- }
- }
- GT_Log.ore.println(tModToName);
-
- //GregtechOreDictEventContainer tOre = new GregtechOreDictEventContainer(aEvent, aPrefix, aMaterial, aMod);
- OreDictEventContainer tOreFake = new OreDictEventContainer(aEvent, aPrefix, aMaterial, aMod);
- if ((!mOreDictActivated) || (!GregTech_API.sUnificationEntriesRegistered)) {
- mEventsFake.add(tOreFake);
- } else {
- mEventsFake.clear();
- }
- if (mOreDictActivated) {
- registerRecipes(tOreFake);
- }
- } catch (Throwable e) {
- e.printStackTrace(GT_Log.err);
- }
-
- }
-
-
- /**
- * This gives you a new BaseMetaTileEntity. As some Interfaces are not always loaded (Buildcraft, Univeral Electricity) I have to use Invocation at the Constructor of the BaseMetaTileEntity
- */
- private static Class<BaseMetaTileEntity> sBaseMetaTileEntityClass = null;
-
- public static BaseMetaTileEntity constructBaseMetaTileEntity() {
- if (sBaseMetaTileEntityClass == null) {
- try {
- return (BaseMetaTileEntity) (sBaseMetaTileEntityClass = BaseMetaTileEntity.class).newInstance();
- } catch (Throwable e) {/*Do nothing*/}
- }
-
- try {
- return (BaseMetaTileEntity) (sBaseMetaTileEntityClass.newInstance());
- } catch (Throwable e) {
- Utils.LOG_INFO("Fatal Error ocurred while initializing TileEntities, crashing Minecraft.");
- e.printStackTrace(GT_Log.err);
- throw new RuntimeException(e);
- }
- }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityAnimalFarm.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityAnimalFarm.java
index 5e552f6647..5a165c4072 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityAnimalFarm.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityAnimalFarm.java
@@ -35,10 +35,6 @@ public class GregtechMetaTileEntityAnimalFarm extends GT_MetaTileEntity_MultiBlo
private boolean running = false;
private boolean p1, p2, p3, p4, p5, p6;
- public int mMaxProgresstime = 0;
- public int mUpdate = 5;
- public int mProgresstime = 0;
- public boolean mMachine = false;
public ItemStack mOutputItem1;
public ItemStack mOutputItem2;
private Block Humus;
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityTreeFarm.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityTreeFarm.java
index 87367f168a..f779f0767a 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityTreeFarm.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityTreeFarm.java
@@ -41,7 +41,8 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock
/* private */ private int plantSaplingTicks = 0;
/* private */ private int cleanupTicks = 0;
/* private */ private boolean canChop = false;
- /* private */ private long mInternalPower = 0;
+ /* private */ private long mInternalPower = 0;
+ /* private */ private static int powerDrain = 32;
public GregtechMetaTileEntityTreeFarm(final int aID, final String aName, final String aNameRegional) {
super(aID, aName, aNameRegional);
@@ -89,7 +90,7 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock
if (this.mInternalPower<(maxEUStore()-128)){
tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(128, false);
this.mInternalPower = (this.mInternalPower+128);
- Utils.LOG_INFO("Increasing internal power storage by 128EU. Stored:"+this.mInternalPower);
+ //Utils.LOG_INFO("Increasing internal power storage by 128EU. Stored:"+this.mInternalPower);
}
}
}
@@ -421,25 +422,24 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock
if (TreefarmManager.isWoodLog(loopBlock) || TreefarmManager.isLeaves(loopBlock)){
- long tempStoredEU = tHatch.getEUVar();
- int powerDrain = 32;
+ long tempStoredEU = tHatch.getEUVar();
if (tempStoredEU >= powerDrain){
- Utils.LOG_INFO("Cutting a "+loopBlock.getLocalizedName()+", currently stored:"+tempStoredEU+" | max:"+tHatch.maxEUStore());
+ //Utils.LOG_INFO("Cutting a "+loopBlock.getLocalizedName()+", currently stored:"+tempStoredEU+" | max:"+tHatch.maxEUStore());
//tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(128 * 1, false);
drainEnergyInput(powerDrain);
long tempStoredEU2 = tHatch.getEUVar();
if (tempStoredEU != tempStoredEU2){
if (tempStoredEU == (tempStoredEU2+powerDrain)){
- Utils.LOG_INFO(powerDrain+"EU was drained.");
+ //Utils.LOG_INFO(powerDrain+"EU was drained.");
}
else {
- Utils.LOG_INFO(""+(tempStoredEU-tempStoredEU2)+"EU was drained.");
+ //Utils.LOG_INFO(""+(tempStoredEU-tempStoredEU2)+"EU was drained.");
}
}
else {
- Utils.LOG_INFO("Stored EU did not change.");
+ //Utils.LOG_INFO("Stored EU did not change.");
}
posX = aBaseMetaTileEntity.getXCoord()+xDir+i;
@@ -504,7 +504,7 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock
return true;
}
- private static boolean findSaplings(final IGregTechTileEntity aBaseMetaTileEntity){
+ private boolean findSaplings(final IGregTechTileEntity aBaseMetaTileEntity){
Utils.LOG_INFO("called findSaplings()");
int saplings = 0;
final int xDir = net.minecraftforge.common.util.ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 7;
@@ -520,6 +520,7 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock
posiZ = aBaseMetaTileEntity.getZCoord()+zDir+j;
//Utils.LOG_INFO("Found a sapling to grow.");
saplings++;
+ drainEnergyInput(powerDrain);
applyBonemeal(aBaseMetaTileEntity.getWorld(), posiX, posiY, posiZ);
}
}
@@ -591,6 +592,7 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock
world.setBlockMetadataWithNotify(posX, posY, posZ, n.getItemDamage(), 4);
//Deplete Input stack
depleteInputEx(n);
+ drainEnergyInput(powerDrain);
counter--;
//Update slot contents?
updateSlots();
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java
index eb25909920..6cd65437cb 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java
@@ -62,6 +62,7 @@ extends GT_MetaTileEntity_BasicTank {
Utils.LOG_WARNING("mFluid was not null, Saving TileEntity NBT data.");
gtCraftingComponentsTag.setInteger("xAmount", mFluid.amount);
gtCraftingComponentsTag.setString("xFluid", mFluid.getFluid().getName());
+ mFluidName = mFluid.getFluid().getName();
//Backup the current tag
//gtCraftingComponentsTag.setTag("backupTag", internalCraftingComponentsTag);
@@ -347,13 +348,9 @@ extends GT_MetaTileEntity_BasicTank {
}
//Internal Tag was not valid.
- try{
if (internalCraftingComponentsTag == null){
Utils.LOG_WARNING("Internal NBT data tag was null.");
return;
- }
- } catch (NullPointerException x){
- Utils.LOG_WARNING("Caught null NBT.");
}
/*if (internalCraftingComponentsTag.hasNoTags()){
Utils.LOG_WARNING("Internal NBT data tag was not valid.");
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java
index 39b7fb41bd..3ab2c613a2 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java
@@ -1,13 +1,8 @@
package gtPlusPlus.xmod.gregtech.loaders;
-import gregtech.api.metatileentity.BaseMetaTileEntity;
import gtPlusPlus.core.block.ModBlocks;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks;
import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks2;
-import cpw.mods.fml.common.event.FMLInterModComms;
-import cpw.mods.fml.common.registry.GameRegistry;
public class Gregtech_Blocks {
@@ -16,28 +11,6 @@ public class Gregtech_Blocks {
//Casing Blocks
ModBlocks.blockCasingsMisc = new GregtechMetaCasingBlocks();
ModBlocks.blockCasings2Misc = new GregtechMetaCasingBlocks2();
- //ModBlocks.blockMetaTileEntity = new GregtechBlockMachines();
- //registerDefailtGtTe();
-
-
-
- }
-
- //Register default Tile Entity
- private static void registerDefailtGtTe(){
- Utils.LOG_INFO("Registering new GT TileEntities.");
-
- BaseMetaTileEntity tBaseMetaTileEntity = Meta_GT_Proxy.constructBaseMetaTileEntity();
-
- Utils.LOG_INFO("Testing BaseMetaTileEntity.");
- if (tBaseMetaTileEntity == null) {
- Utils.LOG_INFO("Fatal Error ocurred while initializing TileEntities, crashing Minecraft.");
- throw new RuntimeException("");
- }
- Utils.LOG_INFO("Registering the BaseMetaTileEntityEx.");
- GameRegistry.registerTileEntity(tBaseMetaTileEntity.getClass(), "BaseMetaTileEntityEx");
- FMLInterModComms.sendMessage("appliedenergistics2", "whitelist-spatial", tBaseMetaTileEntity.getClass().getName());
}
-
}
diff --git a/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java b/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java
index 7f62c7fe53..472c4c6a1f 100644
--- a/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java
+++ b/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java
@@ -14,15 +14,15 @@ public class FishTrapHandler {
protected static void addFish(String lootType, ItemStack lootStack, int lootChance){
if (LoadedMods.getModVersion("Growthcraft").contains("2.3.1")){
- if (lootType == fishTypes[0]){
+ if (lootType.equals(fishTypes[0])){
Growthcraft_Old.addTrapFish(lootStack, lootChance);
Utils.LOG_INFO("Added "+lootStack.getDisplayName()+" as an extra Fish for Growthcraft Fishtraps.");
}
- else if (lootType == fishTypes[1]){
+ else if (lootType.equals(fishTypes[1])){
Growthcraft_Old.addTrapJunk(lootStack, lootChance);
Utils.LOG_INFO("Added "+lootStack.getDisplayName()+" as extra Junk for Growthcraft Fishtraps.");
}
- else if (lootType == fishTypes[2]){
+ else if (lootType.equals(fishTypes[2])){
Growthcraft_Old.addTrapTreasure(lootStack, lootChance);
Utils.LOG_INFO("Added "+lootStack.getDisplayName()+" as extra Treasure for Growthcraft Fishtraps.");
}
@@ -67,79 +67,79 @@ public class FishTrapHandler {
}
private static int getLootChance(String name){
- if (name == harvestcraftFish[0]){
+ if (name.equals(harvestcraftFish[0])){
return 20;
}
- else if (name == harvestcraftFish[1]){
+ else if (name.equals(harvestcraftFish[1])){
return 10;
}
- else if (name == harvestcraftFish[2]){
+ else if (name.equals(harvestcraftFish[2])){
return 15;
}
- else if (name == harvestcraftFish[3]){
+ else if (name.equals(harvestcraftFish[3])){
return 55;
}
- else if (name == harvestcraftFish[4]){
+ else if (name.equals(harvestcraftFish[4])){
return 5;
}
- else if (name == harvestcraftFish[5]){
+ else if (name.equals(harvestcraftFish[5])){
return 8;
}
- else if (name == harvestcraftFish[6]){
+ else if (name.equals(harvestcraftFish[6])){
return 11;
}
- else if (name == harvestcraftFish[7]){
+ else if (name.equals(harvestcraftFish[7])){
return 11;
}
- else if (name == harvestcraftFish[8]){
+ else if (name.equals(harvestcraftFish[8])){
return 15;
}
- else if (name == harvestcraftFish[9]){
+ else if (name.equals(harvestcraftFish[9])){
return 1;
}
- else if (name == harvestcraftFish[10]){
+ else if (name.equals(harvestcraftFish[10])){
return 5;
}
- else if (name == harvestcraftFish[11]){
+ else if (name.equals(harvestcraftFish[11])){
return 10;
}
- else if (name == harvestcraftFish[12]){
+ else if (name.equals(harvestcraftFish[12])){
return 25;
}
- else if (name == harvestcraftFish[13]){
+ else if (name.equals(harvestcraftFish[13])){
return 15;
}
- else if (name == harvestcraftFish[14]){
+ else if (name.equals(harvestcraftFish[14])){
return 20;
} //"Perch", "Scallop", "Shrimp", "Snail", "Snapper", "Tilapia", "Trout", "Tuna", "Turtle", "Walleye"};
- else if (name == harvestcraftFish[15]){
+ else if (name.equals(harvestcraftFish[15])){
return 22;
}
- else if (name == harvestcraftFish[16]){
+ else if (name.equals(harvestcraftFish[16])){
return 10;
}
- else if (name == harvestcraftFish[17]){
+ else if (name.equals(harvestcraftFish[17])){
return 35;
}
- else if (name == harvestcraftFish[18]){
+ else if (name.equals(harvestcraftFish[18])){
return 3;
}
- else if (name == harvestcraftFish[19]){
+ else if (name.equals(harvestcraftFish[19])){
return 20;
}
- else if (name == harvestcraftFish[20]){
+ else if (name.equals(harvestcraftFish[20])){
return 4;
}
- else if (name == harvestcraftFish[21]){
+ else if (name.equals(harvestcraftFish[21])){
return 40;
}
- else if (name == harvestcraftFish[22]){
+ else if (name.equals(harvestcraftFish[22])){
return 30;
}
- else if (name == harvestcraftFish[23]){
+ else if (name.equals(harvestcraftFish[23])){
return 5;
}
- else if (name == harvestcraftFish[24]){
+ else if (name.equals(harvestcraftFish[24])){
return 8;
}
else {
diff --git a/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/GUI_RTG.java b/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/GUI_RTG.java
index 0d5f701b7a..34ac0af814 100644
--- a/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/GUI_RTG.java
+++ b/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/GUI_RTG.java
@@ -17,7 +17,6 @@ public class GUI_RTG
extends GuiRTGenerator
{
public CONTAINER_RTG container;
- public String name;
public GUI_RTG(CONTAINER_RTG container1)
{
diff --git a/src/Java/gtPlusPlus/xmod/thermalfoundation/fluid/TF_Fluids.java b/src/Java/gtPlusPlus/xmod/thermalfoundation/fluid/TF_Fluids.java
index 984ff4604b..6753b213e1 100644
--- a/src/Java/gtPlusPlus/xmod/thermalfoundation/fluid/TF_Fluids.java
+++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/fluid/TF_Fluids.java
@@ -56,7 +56,6 @@ public class TF_Fluids
if (!FluidRegistry.isFluidRegistered(paramString)) {
FluidRegistry.registerFluid(paramFluid);
}
- paramFluid = FluidRegistry.getFluid(paramString);
}
public static void registerDispenserHandlers()