aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java3
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java20
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GTPP_Recipe.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java54
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java5
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/misc/AssLineAchievements.java9
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java2
10 files changed, 62 insertions, 45 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java
index 47e4a7ae53..e637365c1e 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java
@@ -12,6 +12,7 @@ import gregtech.api.util.GT_Utility;
import gregtech.common.GT_Pollution;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
import ic2.api.Direction;
import net.minecraft.item.ItemStack;
@@ -88,7 +89,7 @@ public class BaseCustomTileEntity extends BaseMetaTileEntity {
}
}
- GT_Pollution.addPollution(this, 100000);
+ PollutionUtils.addPollution(this, 100000);
this.mMetaTileEntity.doExplosion(aAmount);
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java
index b0dc635aee..19ba932a02 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java
@@ -361,17 +361,7 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
@Override
public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
if (aBaseMetaTileEntity.isClientSide()) return true;
- if(!GT_Mod.gregtechproxy.mForceFreeFace) {
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
- for(byte i=0;i < 6; i++){
- if(aBaseMetaTileEntity.getAirAtSide(i)){
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
- }
- GT_Utility.sendChatToPlayer(aPlayer,"No free Side!");
+ aBaseMetaTileEntity.openGUI(aPlayer);
return true;
}
@@ -461,7 +451,8 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
}
if (mProgresstime > 5) mStuttering = false;
XSTR aXSTR = new XSTR();
- if(GT_Mod.gregtechproxy.mAprilFool && aXSTR.nextInt(5000)==0)GT_Utility.sendSoundToPlayers(aBaseMetaTileEntity.getWorld(), GregTech_API.sSoundList.get(5), 10.0F, -1.0F, aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(),aBaseMetaTileEntity.getZCoord());
+ //Dumb April Fools Shit
+ // if(GT_Mod.gregtechproxy.mAprilFool && aXSTR.nextInt(5000)==0)GT_Utility.sendSoundToPlayers(aBaseMetaTileEntity.getWorld(), GregTech_API.sSoundList.get(5), 10.0F, -1.0F, aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(),aBaseMetaTileEntity.getZCoord());
} else {
if (!mStuttering) {
stutterProcess();
@@ -726,7 +717,7 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
if (aSide == getBaseMetaTileEntity().getFrontFacing() || aSide == mMainFacing) {
mAllowInputFromOutputSide = !mAllowInputFromOutputSide;
- GT_Utility.sendChatToPlayer(aPlayer, mAllowInputFromOutputSide ? trans("095","Input from Output Side allowed") : trans("096","Input from Output Side forbidden"));
+ GT_Utility.sendChatToPlayer(aPlayer, mAllowInputFromOutputSide ? "Input from Output Side allowed" : "Input from Output Side forbidden");
}
}
@@ -790,9 +781,6 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
GT_Recipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[mTier], new FluidStack[]{getFillableStack()}, getSpecialSlot(), getAllInputs());
if (tRecipe == null) return DID_NOT_FIND_RECIPE;
- if (GT_Mod.gregtechproxy.mLowGravProcessing && tRecipe.mSpecialValue == -100 &&
- !isValidForLowGravity(tRecipe,getBaseMetaTileEntity().getWorld().provider.dimensionId))
- return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe;
if (!canOutput(tRecipe)) {
mOutputBlocked++;
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GTPP_Recipe.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GTPP_Recipe.java
index d5180ef4e1..18665538d0 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GTPP_Recipe.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GTPP_Recipe.java
@@ -27,7 +27,7 @@ public class GT_MetaTileEntity_BasicMachine_GTPP_Recipe extends GT_MetaTileEntit
GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage,
int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName,
String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) {
- super(aName, aTier, aDescription, aRecipes, aInputSlots, aOutputSlots, aTankCapacity, aAmperage, aGUIParameterA,
+ super(aName, aTier, aDescription[0], aRecipes, aInputSlots, aOutputSlots, aTankCapacity, aAmperage, aGUIParameterA,
aGUIParameterB, aTextures, aGUIName, aNEIName, aSound, aSharedTank, aRequiresFluidForFiltering, aSpecialEffect);
}
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 96df4dbfd0..5e41af86af 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
@@ -28,7 +28,7 @@ public class GT_MetaTileEntity_SuperBus_Input extends GT_MetaTileEntity_Hatch_In
}
public GT_MetaTileEntity_SuperBus_Input(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
+ super(aName, aTier, aDescription[0], aTextures);
}
/**
@@ -65,7 +65,7 @@ public class GT_MetaTileEntity_SuperBus_Input extends GT_MetaTileEntity_Hatch_In
}
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_SuperBus_Input(this.mName, this.mTier, this.mDescriptionArray, this.mTextures);
+ return new GT_MetaTileEntity_SuperBus_Input(this.mName, this.mTier, this.mDescription, this.mTextures);
}
public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java
index d09b71ee35..4fac3d36d8 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java
@@ -26,7 +26,7 @@ public class GT_MetaTileEntity_SuperBus_Output extends GT_MetaTileEntity_Hatch_O
}
public GT_MetaTileEntity_SuperBus_Output(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
+ super(aName, aTier, aDescription[0], aTextures);
}
/**
@@ -43,7 +43,7 @@ public class GT_MetaTileEntity_SuperBus_Output extends GT_MetaTileEntity_Hatch_O
}
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_SuperBus_Output(this.mName, this.mTier, this.mDescriptionArray, this.mTextures);
+ return new GT_MetaTileEntity_SuperBus_Output(this.mName, this.mTier, this.mDescription, this.mTextures);
}
public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java b/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java
index 9068bf2ec1..63581af16c 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java
@@ -5,7 +5,6 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -34,6 +33,7 @@ public class StaticFields59 {
public static final Field mDescriptionArray;
public static final Field mCasingTexturePages;
public static final Field mAssLineVisualMapNEI;
+ public static final GT_Recipe_Map sAssemblylineVisualRecipes;
public static final Method mCalculatePollutionReduction;
public static final Method mAddFurnaceRecipe;
@@ -44,29 +44,51 @@ public class StaticFields59 {
//OrePrefixes
static {
+ Logger.INFO("[SH] Creating Static Helper for various fields which require reflective access.");
mGtBlockCasings5 = getField(GregTech_API.class, "sBlockCasings5");
+ Logger.INFO("[SH] Got Field: sBlockCasings5");
mPreventableComponents = getField(OrePrefixes.class, "mPreventableComponents");
+ Logger.INFO("[SH] Got Field: mPreventableComponents");
mDisabledItems = getField(OrePrefixes.class, "mDisabledItems");
- mMultiblockChemicalRecipes = getField(GT_Recipe_Map.class, "sMultiblockChemicalRecipes");
+ Logger.INFO("[SH] Got Field: mDisabledItems");
mDescriptionArray = getField(GT_MetaTileEntity_TieredMachineBlock.class, "mDescriptionArray");
+ Logger.INFO("[SH] Got Field: mDescriptionArray");
mCasingTexturePages = getField(BlockIcons.class, "casingTexturePages");
+ Logger.INFO("[SH] Got Field: casingTexturePages");
+
mAssLineVisualMapNEI = getField(GT_Recipe_Map.class, "sAssemblylineVisualRecipes");
-
- mCalculatePollutionReduction = getMethod(GT_MetaTileEntity_Hatch_Muffler.class, "calculatePollutionReduction", int.class);
-
- Logger.INFO("Initializing a recipe handler for different versions of Gregtech 5.");
- //Yep...
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- Logger.INFO("Selecting GT 5.7/5.8 Recipe Set");
- mAddFurnaceRecipe = getMethod(GT_ModHandler.class, "addSmeltingAndAlloySmeltingRecipe", ItemStack.class, ItemStack.class);
+ Logger.INFO("[SH] Got Field: mAssLineVisualMapNEI");
+ GT_Recipe_Map aTemp;
+ if (mAssLineVisualMapNEI != null) {
+ try {
+ aTemp = (GT_Recipe_Map) mAssLineVisualMapNEI.get(null);
+ Logger.INFO("[SH] Got Field: sAssemblylineVisualRecipes");
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ aTemp = null;
+ }
+ } else {
+ aTemp = null;
}
- else {
- Logger.INFO("Selecting GT 5.9 Recipe Set");
- mAddFurnaceRecipe = getMethod(GT_ModHandler.class, "addSmeltingAndAlloySmeltingRecipe", ItemStack.class, ItemStack.class, boolean.class);
+
+ sAssemblylineVisualRecipes = aTemp;
+ mMultiblockChemicalRecipes = getField(GT_Recipe_Map.class, "sMultiblockChemicalRecipes");
+ Logger.INFO("[SH] Got Field: sMultiblockChemicalRecipes");
+
+ mCalculatePollutionReduction = getMethod(GT_MetaTileEntity_Hatch_Muffler.class, "calculatePollutionReduction",
+ int.class);
+ Logger.INFO("[SH] Got Method: calculatePollutionReduction");
+
+ // Yep...
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ mAddFurnaceRecipe = getMethod(GT_ModHandler.class, "addSmeltingAndAlloySmeltingRecipe", ItemStack.class,
+ ItemStack.class);
+ Logger.INFO("[SH] Got Method: addSmeltingAndAlloySmeltingRecipe");
+ } else {
+ mAddFurnaceRecipe = getMethod(GT_ModHandler.class, "addSmeltingAndAlloySmeltingRecipe", ItemStack.class,
+ ItemStack.class, boolean.class);
+ Logger.INFO("[SH] Got Method: addSmeltingAndAlloySmeltingRecipe");
}
-
-
-
+
}
public static synchronized final Block getBlockCasings5() {
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 eb6a9bfcd3..c364fe5e9e 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
@@ -229,7 +229,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi
//I stole this code
reduction = (MathUtils.safeInt((long)reduction*this.mBaseEff)/100000)*mAirSides*Math.max((tTier-2), 1);
Logger.WARNING("reduction[2]:"+reduction);
- reduction = GT_Utility.safeInt(((long)reduction/100)*this.mOptimalAirFlow);
+ reduction = MathUtils.safeInt(((long)reduction/100)*this.mOptimalAirFlow);
Logger.WARNING("reduction[3]:"+reduction);
mPollutionReduction = reduction;
@@ -683,7 +683,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi
byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
reduction += (((Math.max((tTier-2), 1)*2)*50)*mAirSides);
reduction = (MathUtils.safeInt((long)reduction*this.mBaseEff)/100000)*mAirSides*Math.max((tTier-2), 1);
- reduction = GT_Utility.safeInt(((long)reduction/100)*this.mOptimalAirFlow);
+ reduction = MathUtils.safeInt(((long)reduction/100)*this.mOptimalAirFlow);
aTooltipSuper.put("Maximum pollution removed per second: "+reduction);
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java
index 8446737017..23ca94e54d 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java
@@ -22,6 +22,7 @@ import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map;
import gregtech.common.GT_Pollution;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.util.minecraft.FluidUtils;
+import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import net.minecraft.block.Block;
@@ -401,7 +402,7 @@ public class GregtechMetaTileEntityGeneratorArray extends GregtechMeta_MultiBloc
if (this.addOutput(tEmptyContainer1)) {
aBaseMetaTileEntity.increaseStoredEnergyUnits((long) tFuelValue, true);
this.depleteInput(a);
- GT_Pollution.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollutionPerTick(null));
+ PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollutionPerTick(null));
}
}
}
@@ -418,7 +419,7 @@ public class GregtechMetaTileEntityGeneratorArray extends GregtechMeta_MultiBloc
(this.maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / (long) tFuelValue);
if (tFluidAmountToUse > 0L && aBaseMetaTileEntity
.increaseStoredEnergyUnits(tFluidAmountToUse * (long) tFuelValue, true)) {
- GT_Pollution.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollutionPerTick(null));
+ PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollutionPerTick(null));
mFluid.amount = (int) ((long) mFluid.amount
- tFluidAmountToUse * (long) tEmptyContainer);
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/misc/AssLineAchievements.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/misc/AssLineAchievements.java
index d41079f40d..4e02dabc5b 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/misc/AssLineAchievements.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/misc/AssLineAchievements.java
@@ -142,15 +142,20 @@ public class AssLineAchievements {
if (player == null || stack == null) {
return;
}
+
+ if (StaticFields59.sAssemblylineVisualRecipes == null) {
+ return;
+ }
+
Logger.INFO("Trying to check for achievements");
// Debug scanner unlocks all AL recipes in creative
if (player.capabilities.isCreativeMode && aPickupUnlocalSafe.equals("gt.metaitem.01.32761")) {
- for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList) {
+ for (GT_Recipe recipe : StaticFields59.sAssemblylineVisualRecipes.mRecipeList) {
issueAchievement(player, recipe.getOutput(0).getUnlocalizedName());
recipe.mHidden = false;
}
}
- for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList) {
+ for (GT_Recipe recipe : StaticFields59.sAssemblylineVisualRecipes.mRecipeList) {
String aSafeUnlocalName;
if (recipe.getOutput(0) == null) {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
index 4be0378699..001edf3ab9 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
@@ -877,7 +877,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
@Override
public boolean addMultiblockChemicalRecipe(ItemStack[] itemStacks, FluidStack[] fluidStacks, FluidStack[] fluidStacks2, ItemStack[] outputs, int time, int eu) {
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK || mLargeChemReactor == null) {
return false;
}
try {