aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2019-10-11 18:14:07 +0100
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2019-10-11 18:14:07 +0100
commit4a2fa070a2ae91173cf15785c63b4090016323d4 (patch)
tree7a07b317b7b66778869f321da82f95dfee70107f /src/Java/gtPlusPlus/xmod
parent8ca23d37495647bda859bc1821c2551cf8b21bf3 (diff)
downloadGT5-Unofficial-4a2fa070a2ae91173cf15785c63b4090016323d4.tar.gz
GT5-Unofficial-4a2fa070a2ae91173cf15785c63b4090016323d4.tar.bz2
GT5-Unofficial-4a2fa070a2ae91173cf15785c63b4090016323d4.zip
$ Fixed many tiny bugs, found by static code analysis.
$ Fixed Canning handling further. $ Adjusted the Charcoal Pit fix.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod')
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java1
-rw-r--r--src/Java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java14
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java3
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java6
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java61
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Boulder.java3
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore_Normal.java3
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java21
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java13
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java13
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java9
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java8
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java109
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java5
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java5
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java10
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java20
-rw-r--r--src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/thaumcraft/util/ThaumcraftUtils.java29
-rw-r--r--src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java6
27 files changed, 204 insertions, 157 deletions
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java b/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java
index fd83cc707d..7d45899911 100644
--- a/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java
@@ -111,7 +111,6 @@ public class GTPP_Bees {
input,
null,
output,
- 0,
30,
8);
}
diff --git a/src/Java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java b/src/Java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java
index 64f1cfbe23..3b59b58cab 100644
--- a/src/Java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java
+++ b/src/Java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java
@@ -21,6 +21,10 @@ public class HandlerTooltip_GC {
private static Class<?> oMainClass;
private static Class<?> oFuelLoaderClass;
private static HashMap <Integer, String> mFuelNames;
+
+ static {
+ mFuelNames = new LinkedHashMap<Integer, String>();
+ }
@SubscribeEvent
public void onItemTooltip(ItemTooltipEvent event) {
@@ -38,7 +42,7 @@ public class HandlerTooltip_GC {
oFuelLoaderClass = GCFuelLoader;
}
- Field aField = ReflectionUtils.getField(GCBlocks, "fuelLoader");
+ Field aField = ReflectionUtils.getField(oMainClass, "fuelLoader");
if (aField != null) {
Block aBlock = (Block) aField.get(null);
if (aBlock != null) {
@@ -49,10 +53,12 @@ public class HandlerTooltip_GC {
}
} catch (Throwable t) {
}
- }
+ }
+ if (mFuelNames == null) {
+ mFuelNames = new LinkedHashMap<Integer, String>();
+ }
- if (mFuelNames == null || mFuelNames.isEmpty()) {
- mFuelNames = new LinkedHashMap<Integer, String>();
+ if (mFuelNames.isEmpty()) {
for (int aMapKey : RocketFuels.mValidRocketFuels.keySet()) {
Fluid aFuel = RocketFuels.mValidRocketFuels.get(aMapKey);
if (aFuel != null) {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
index 0143c9096f..f85d432b0c 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
@@ -59,6 +59,7 @@ public class HANDLER_GT {
public static final List<WorldGen_GT> sWorldgenListEverglades = new ArrayList<WorldGen_GT>();
public static final List<WorldGen_GT_Australia> sWorldgenListAustralia = new ArrayList<WorldGen_GT_Australia>();
public static final List<GTPP_Worldgen> sCustomWorldgenList = new ArrayList<GTPP_Worldgen>();
+ public static GT_MetaGenerated_Tool sMetaGeneratedToolInstance;
public static void preInit(){
@@ -88,7 +89,7 @@ public class HANDLER_GT {
//Only loads if the config option is true (default: true)
if (CORE.ConfigSwitches.enableSkookumChoochers){
- new MetaGeneratedGregtechTools();
+ sMetaGeneratedToolInstance= MetaGeneratedGregtechTools.getInstance();
}
if (ConfigSwitches.enableOldGTcircuits && !CORE.GTNH){
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
index 94adb5a92c..2726b140ca 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
@@ -216,10 +216,14 @@ public interface IGregtech_RecipeAdder {
public boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aDust, ItemStack aOutput);
- public boolean addFluidExtractionRecipe(ItemStack input, ItemStack input2, FluidStack output, int aTime, int aEu, int aSpecial);
+ public boolean addFluidExtractionRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidOut, int aTime, int aEu);
+
+ public boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn);
public boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn, FluidStack rFluidOut);
+ public boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn, FluidStack rFluidOut, int aTime, int aEu);
+
/**
* Adds a Fusion reactor Recipe
*
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java
index 1ce7fc49d3..e1b329c07f 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java
@@ -247,9 +247,9 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank
public int getFuelValue(FluidStack aLiquid) {
if (aLiquid != null && this.getRecipes() != null) {
Collection<GT_Recipe> tRecipeList = this.getRecipes().mRecipeList;
- Logger.WARNING("Fuels: "+tRecipeList.size());
if (tRecipeList != null) {
- Iterator var4 = tRecipeList.iterator();
+ Logger.WARNING("Fuels: "+tRecipeList.size());
+ Iterator<GT_Recipe> var4 = tRecipeList.iterator();
while (var4.hasNext()) {
GT_Recipe tFuel = (GT_Recipe) var4.next();
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java
index e0844bb071..4c60d9a932 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java
@@ -9,7 +9,6 @@ import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
@@ -17,7 +16,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
public class GT_MetaTileEntity_SuperBus_Input extends GT_MetaTileEntity_Hatch_InputBus {
- public GT_Recipe_Map mRecipeMap = null;
public GT_MetaTileEntity_SuperBus_Input(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier);
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java
index 839fb3a14a..c9b98a6a64 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java
@@ -102,7 +102,7 @@ public class GT_MetaTileEntity_Hatch_CustomFluidBase extends GT_MetaTileEntity_H
String[] s2 = new String[]{
"Fluid Input for Multiblocks",
"Capacity: " + getCapacity()+"L",
- "Accepted Fluid: " + mTempMod + mLockedStack.getLocalizedName()
+ "Accepted Fluid: " + mTempMod + mLockedStack != null ? mLockedStack.getLocalizedName() : "Empty"
};
return s2;
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
index 3b8597c5eb..68b81182fc 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
@@ -86,6 +86,18 @@ GT_MetaTileEntity_MultiBlockBase {
Logger.MACHINE_INFO("Found .08 findRecipe method? "+(a08 != null));
Logger.MACHINE_INFO("Found .09 findRecipe method? "+(a09 != null));
+ if (CORE.DEBUG) {
+ aLogger = ReflectionUtils.getMethod(Logger.class, "INFO", String.class);
+ }
+ else {
+ aLogger = ReflectionUtils.getMethod(Logger.class, "MACHINE_INFO", String.class);
+ }
+
+ try {
+ calculatePollutionReduction = GT_MetaTileEntity_Hatch_Muffler.class.getDeclaredMethod("calculatePollutionReduction", int.class);
+ } catch (NoSuchMethodException | SecurityException e) {}
+
+
//gregtech.api.util.GT_Recipe.GT_Recipe_Map.findRecipe(IHasWorldObjectAndCoords, GT_Recipe, boolean, long, FluidStack[], ItemStack, ItemStack...)
}
@@ -523,20 +535,27 @@ GT_MetaTileEntity_MultiBlockBase {
public void log(String s) {
- boolean isDebugLogging = CORE.DEBUG;
- boolean reset = true;
+ boolean isDebugLogging = CORE.DEBUG;
+ boolean reset = false;
- if (aLogger == null || reset) {
+ if (reset) {
if (isDebugLogging) {
- aLogger = ReflectionUtils.getMethod(Logger.class, "INFO", String.class);
+ aLogger = ReflectionUtils.getMethod(
+ Logger.class, "INFO", String.class
+ );
}
else {
- aLogger = ReflectionUtils.getMethod(Logger.class, "MACHINE_INFO", String.class);
+ aLogger = ReflectionUtils.getMethod(
+ Logger.class, "MACHINE_INFO", String.class
+ );
}
}
try {
aLogger.invoke(null, s);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {}
+ }
+ catch (IllegalAccessException | IllegalArgumentException
+ | InvocationTargetException e) {
+ }
}
@@ -1435,13 +1454,15 @@ GT_MetaTileEntity_MultiBlockBase {
boolean aExists = false;
for (E m : aList) {
IGregTechTileEntity b = ((IMetaTileEntity) m).getBaseMetaTileEntity();
- BlockPos aPos = new BlockPos(b);
- if (b != null && aPos != null) {
- if (aCurPos.equals(aPos)) {
- if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) {
- log("Found Duplicate "+b.getInventoryName()+" at " + aPos.getLocationString());
+ if (b != null) {
+ BlockPos aPos = new BlockPos(b);
+ if (aPos != null) {
+ if (aCurPos.equals(aPos)) {
+ if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) {
+ log("Found Duplicate "+b.getInventoryName()+" at " + aPos.getLocationString());
+ }
+ return false;
}
- return false;
}
}
}
@@ -1867,20 +1888,16 @@ GT_MetaTileEntity_MultiBlockBase {
}
}
- private static Method calculatePollutionReduction;
+ private static Method calculatePollutionReduction = null;
public int calculatePollutionReductionForHatch(GT_MetaTileEntity_Hatch_Muffler i , int g) {
- if (calculatePollutionReduction == null) {
+ if (calculatePollutionReduction != null) {
try {
- calculatePollutionReduction = i.getClass().getDeclaredMethod("calculatePollutionReduction", int.class);
- } catch (NoSuchMethodException | SecurityException e) {
- calculatePollutionReduction = null;
+ return (int) calculatePollutionReduction.invoke(i, g);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+
}
- }
- try {
- return (int) calculatePollutionReduction.invoke(i, g);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- return 0;
}
+ return 0;
}
@Override
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Boulder.java b/src/Java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Boulder.java
index c8a7b5119d..ca78a72e04 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Boulder.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Boulder.java
@@ -3,6 +3,7 @@ package gtPlusPlus.xmod.gregtech.api.world;
import java.util.Collection;
import java.util.Random;
+import gtPlusPlus.core.lib.CORE;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.util.MathHelper;
@@ -21,7 +22,7 @@ public class GTPP_Worldgen_Boulder extends GTPP_Worldgen_Ore {
int tX = aChunkX + aRandom.nextInt(16), tY = mMinY + aRandom.nextInt(mMaxY - mMinY), tZ = aChunkZ + aRandom.nextInt(16);
Block tBlock = aWorld.getBlock(tX, tY - 7, tZ);
if (tBlock != null && tBlock.isOpaqueCube() && aWorld.getBlock(tX, tY - 6, tZ).isAir(aWorld, tX, tY - 6, tZ)) {
- float math_pi = 3.141593F;
+ float math_pi = CORE.PI;
float var6 = aRandom.nextFloat() * math_pi;
float var1b = mSize / 8.0F;
float var3b = MathHelper.sin(var6) * var1b; float var4b = MathHelper.cos(var6) * var1b;
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore_Normal.java b/src/Java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore_Normal.java
index 9d7eb5a020..e66106ad4a 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore_Normal.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore_Normal.java
@@ -3,6 +3,7 @@ package gtPlusPlus.xmod.gregtech.api.world;
import java.util.Collection;
import java.util.Random;
+import gtPlusPlus.core.lib.CORE;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.util.MathHelper;
@@ -20,7 +21,7 @@ public class GTPP_Worldgen_Ore_Normal extends GTPP_Worldgen_Ore {
for (int i = 0; i < mAmount; i++) {
int tX = aChunkX + aRandom.nextInt(16), tY = mMinY + aRandom.nextInt(mMaxY - mMinY), tZ = aChunkZ + aRandom.nextInt(16);
if (mAllowToGenerateinVoid || aWorld.getBlock(tX, tY, tZ).isAir(aWorld, tX, tY, tZ)) {
- float math_pi = 3.141593F;float var1b = mSize / 8.0F;
+ float math_pi = CORE.PI;float var1b = mSize / 8.0F;
float var6 = aRandom.nextFloat() * math_pi;
float var3b = MathHelper.sin(var6) * var1b; float var4b = MathHelper.cos(var6) * var1b;
float var8b = -2*var3b;float var9b = -2*var4b;
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 629c584f70..2d7151bf45 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java
@@ -32,7 +32,6 @@ import gtPlusPlus.api.objects.minecraft.FormattedTooltipString;
import gtPlusPlus.core.handler.AchievementHandler;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.ELEMENT;
-import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.MaterialUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
@@ -51,19 +50,16 @@ import net.minecraftforge.fluids.FluidStack;
public class Meta_GT_Proxy {
static {
- instance = new Meta_GT_Proxy();
Logger.INFO("GT_PROXY - initialized.");
}
- public static final Meta_GT_Proxy instance;
-
public static List<Runnable> GT_BlockIconload = new ArrayList<>();
public static List<Runnable> GT_ItemIconload = new ArrayList<>();
public static AutoMap<Integer> GT_ValidHeatingCoilMetas = new AutoMap<Integer>();
- private static Class sBaseMetaTileEntityClass;
- private static Class sBaseMetaTileEntityClass2;
+ private static Class<BaseCustomTileEntity> sBaseMetaTileEntityClass;
+ private static Class<BaseCustomPower_MTE> sBaseMetaTileEntityClass2;
public static AchievementHandler mAssemblyAchievements;
@@ -79,7 +75,7 @@ public class Meta_GT_Proxy {
public static Block sBlockMachines;
- public void preInit() {
+ public static void preInit() {
//New GT++ Block, yay! (Progress)
//sBlockMachines = new GTPP_Block_Machines();
@@ -110,12 +106,12 @@ public class Meta_GT_Proxy {
CoverManager.generateCustomCovers();
}
- public void init() {
+ public static void init() {
scheduleCoverMapCleaner();
setValidHeatingCoilMetas();
}
- public void postInit() {
+ public static void postInit() {
mAssemblyAchievements = new AchievementHandler();
}
@@ -317,7 +313,7 @@ public class Meta_GT_Proxy {
- public void setValidHeatingCoilMetas() {
+ public static void setValidHeatingCoilMetas() {
for (int i = 0; i <= 6; i++ ) {
GT_ValidHeatingCoilMetas.put(i);
}
@@ -342,7 +338,7 @@ public class Meta_GT_Proxy {
}
- public void scheduleCoverMapCleaner(){
+ public static void scheduleCoverMapCleaner(){
TimerTask repeatedTask = new TimerTask() {
public void run() {
cleanupOverFlowCoverCache();
@@ -360,6 +356,7 @@ public class Meta_GT_Proxy {
long aCurrentTime = System.currentTimeMillis()/1000;
for (Object o : cache.values()) {
if (o != null && o instanceof HashMap) {
+ @SuppressWarnings("unchecked")
HashMap<String, Object> m = (HashMap<String, Object>) o;
if (m != null) {
String s = (String) m.get("aCoverKey");
@@ -390,7 +387,7 @@ public class Meta_GT_Proxy {
return StaticFields59.getFieldFromGregtechProxy(fieldName);
}
- public void setCustomGregtechTooltip(String aNbtTagName, FormattedTooltipString aData) {
+ public static void setCustomGregtechTooltip(String aNbtTagName, FormattedTooltipString aData) {
mCustomGregtechMetaTooltips.put(aNbtTagName, aData);
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java
index 4038d5bdf4..8b3fb9a42f 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java
@@ -297,7 +297,7 @@ public class TreeFarmHelper {
return true;
}
else if (aStack.getUnlocalizedName().toLowerCase().contains("mu-metaitem")) {
- String[] aData = aStack.getUnlocalizedName().toLowerCase().split(".");
+ String[] aData = aStack.getUnlocalizedName().toLowerCase().split("//.");
if (aData != null && aData.length > 0) {
for (String s : aData) {
if (s.contains("32120")) {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java
index 236ae65edb..bc11cb6a11 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java
@@ -8,7 +8,6 @@ import gregtech.api.enums.ToolDictNames;
import gregtech.api.items.GT_MetaGenerated_Tool;
import gregtech.api.objects.GT_HashSet;
import gregtech.api.objects.GT_ItemStack;
-import gregtech.common.tools.GT_Tool_WireCutter;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechToolDictNames;
import gtPlusPlus.xmod.gregtech.common.tools.TOOL_Gregtech_AngelGrinder;
@@ -25,10 +24,18 @@ public class MetaGeneratedGregtechTools extends GT_MetaGenerated_Tool {
public static final short ANGLE_GRINDER = 7834;
public static final short ELECTRIC_SNIPS = 7934;
public static GT_MetaGenerated_Tool INSTANCE;
+
+ static {
+ INSTANCE = new MetaGeneratedGregtechTools();
+ }
+
+ public static GT_MetaGenerated_Tool getInstance() {
+ return INSTANCE;
+ }
+
- public MetaGeneratedGregtechTools() {
+ private MetaGeneratedGregtechTools() {
super("plusplus.metatool.01");
- INSTANCE = this;
// Skookum Choocher
GregTech_API.registerTool(this.addTool(SKOOKUM_CHOOCHER, "Skookum Choocher",
"Can Really Chooch. Does a Skookum job at Hammering and Wrenching stuff.", new TOOL_Gregtech_Choocher(),
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java
index 4795b0d0b9..10a1f96be7 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java
@@ -710,8 +710,17 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi
catch (Throwable t) {
aTooltipSuper.put("Maximum pollution removed per second: "+mPollutionReduction);
}
- aTooltipSuper.put("Air Sides: "+mAirSides);
- return aTooltipSuper.toArray();
+ aTooltipSuper.put("Air Sides: "+mAirSides);
+
+ String[] mBuiltOutput = new String[aTooltipSuper.size()];
+ int aIndex = 0;
+ for (String i : aTooltipSuper) {
+ mBuiltOutput[aIndex++] = i;
+ }
+
+
+
+ return mBuiltOutput;
}
@Override
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java
index 2e0eeea844..8b07117596 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java
@@ -609,8 +609,13 @@ extends GregtechMeta_MultiBlockBase {
}
// -- Try not to fail after this point - inputs have already been consumed! --
- ItemStack[] mBuiltOutput = this.mReplicatorOutputMap.toArray();
-
+ ItemStack[] mBuiltOutput = new ItemStack[this.mReplicatorOutputMap.size()];
+ int aIndex = 0;
+ for (ItemStack i : this.mReplicatorOutputMap) {
+ mBuiltOutput[aIndex++] = i;
+ }
+
+
// Convert speed bonus to duration multiplier
// e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java
index 8925caf480..cb8b7590ee 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java
@@ -207,7 +207,7 @@ public class GregtechMTE_MiniFusionPlant extends GregtechMeta_MultiBlockBase {
FluidStack[] arg5 = (FluidStack[]) tFluidList.toArray(new FluidStack[tFluidList.size()]);
GT_Recipe arg6 = getRecipeMap().findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe,
false, this.getMaxInputVoltage(), arg5, new ItemStack[0]);
- if (arg6 == null && !this.mRunningOnLoad || this.maxEUStore() < (long) arg6.mSpecialValue) {
+ if (arg6 == null && !this.mRunningOnLoad || (arg6 != null && this.maxEUStore() < (long) arg6.mSpecialValue)) {
//Logger.INFO("Bad Step "+aStep++);
//this.turnCasingActive(false);
this.mLastRecipe = null;
@@ -215,7 +215,7 @@ public class GregtechMTE_MiniFusionPlant extends GregtechMeta_MultiBlockBase {
}
//Logger.INFO("Step "+aStep++);
- if (this.mRunningOnLoad || arg6.isRecipeInputEqual(true, arg5, new ItemStack[0])) {
+ if (this.mRunningOnLoad || (arg6 != null && arg6.isRecipeInputEqual(true, arg5, new ItemStack[0]))) {
//Logger.INFO("Step "+aStep++);
this.mLastRecipe = arg6;
this.mEUt = this.mLastRecipe.mEUt * 1;
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java
index 33555c8f51..f3fefdf789 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java
@@ -34,6 +34,10 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase
public static int CASING_TEXTURE_ID;
public static String mCasingName = "Advanced Cryogenic Casing";
public static TreeGenerator mTreeData;
+
+ static {
+ mTreeData = new TreeGenerator();
+ }
public GregtechMetaTileEntityTreeFarm(final int aID, final String aName, final String aNameRegional) {
super(aID, aName, aNameRegional);
@@ -76,10 +80,6 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase
}
}*/
- if (mTreeData == null) {
- mTreeData = new TreeGenerator();
- }
-
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java
index 07c8a4a7ac..24db72fbe0 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java
@@ -22,8 +22,6 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
public class GregtechMetaTileEntity_Refinery extends GregtechMeta_MultiBlockBase {
-
- public GT_Recipe mLastRecipe;
public GregtechMetaTileEntity_Refinery(final int aID, final String aName, final String aNameRegional) {
super(aID, aName, aNameRegional);
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java
index d8a5617b2e..d4a25e03dd 100