aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2019-12-10 11:01:32 +0000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2019-12-10 11:01:32 +0000
commit2525ff075586759657e89b9f01969f0596bca2df (patch)
treea492c6396f067e2c1e7feb2dd79b01b0c5c3c8df /src
parent051c46ab36a749954cff3bae1fbd44cea6f1fc99 (diff)
downloadGT5-Unofficial-2525ff075586759657e89b9f01969f0596bca2df.tar.gz
GT5-Unofficial-2525ff075586759657e89b9f01969f0596bca2df.tar.bz2
GT5-Unofficial-2525ff075586759657e89b9f01969f0596bca2df.zip
% Changed name of custom GT++ Programmed Circuit to Programmed Bio Circuit.
$ Fixed getNumberedBioCircuit() in CI. $ Fixed an issue where stripped fields were referenced in server side bytecode. $ Fixed Tooltips not working as intended for items giving custom GT++ Multi behaviour. $ Fixed 'No Bonus Output Chance' item not registering correctly.
Diffstat (limited to 'src')
-rw-r--r--src/Java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java5
-rw-r--r--src/Java/gtPlusPlus/api/objects/minecraft/multi/NoOutputBonusMultiBehaviour.java3
-rw-r--r--src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java12
-rw-r--r--src/Java/gtPlusPlus/core/recipe/common/CI.java3
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java5
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java7
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/util/SpecialBehaviourTooltipHandler.java12
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java9
-rw-r--r--src/resources/assets/miscutils/lang/en_US.lang2
9 files changed, 39 insertions, 19 deletions
diff --git a/src/Java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java b/src/Java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java
index 9816d45bbf..3acca269d7 100644
--- a/src/Java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java
+++ b/src/Java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java
@@ -2,6 +2,7 @@ package gtPlusPlus.api.helpers;
import java.util.HashMap;
+import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.WeightedCollection;
import gtPlusPlus.api.objects.minecraft.multi.SpecialMultiBehaviour;
import gtPlusPlus.core.util.minecraft.ItemUtils;
@@ -26,10 +27,12 @@ public class GregtechPlusPlus_API {
*/
public static boolean registerSpecialMultiBehaviour(SpecialMultiBehaviour aBehaviour) {
if (aBehaviour.getTriggerItem() == null || aBehaviour.getTriggerItemTooltip() == null || aBehaviour.getTriggerItemTooltip().length() <= 0) {
+ Logger.INFO("Failed to attach custom multiblock logic to "+ItemUtils.getItemName(aBehaviour.getTriggerItem()));
return false;
}
mSpecialBehaviourItemMap.put("UniqueKey_"+aBehaviour.hashCode(), aBehaviour);
- SpecialBehaviourTooltipHandler.addTooltipForItem(aBehaviour.getTriggerItem(), aBehaviour.getTriggerItemTooltip());
+ SpecialBehaviourTooltipHandler.addTooltipForItem(aBehaviour.getTriggerItem(), aBehaviour.getTriggerItemTooltip());
+ Logger.INFO("Attached custom multiblock logic to "+ItemUtils.getItemName(aBehaviour.getTriggerItem()));
return true;
}
diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/multi/NoOutputBonusMultiBehaviour.java b/src/Java/gtPlusPlus/api/objects/minecraft/multi/NoOutputBonusMultiBehaviour.java
index 871b42b901..0769d0a473 100644
--- a/src/Java/gtPlusPlus/api/objects/minecraft/multi/NoOutputBonusMultiBehaviour.java
+++ b/src/Java/gtPlusPlus/api/objects/minecraft/multi/NoOutputBonusMultiBehaviour.java
@@ -1,13 +1,12 @@
package gtPlusPlus.api.objects.minecraft.multi;
-import gtPlusPlus.api.helpers.GregtechPlusPlus_API.Multiblock_API;
import gtPlusPlus.core.recipe.common.CI;
import net.minecraft.item.ItemStack;
public class NoOutputBonusMultiBehaviour extends SpecialMultiBehaviour {
public NoOutputBonusMultiBehaviour() {
- Multiblock_API.registerSpecialMultiBehaviour(this);
+
}
@Override
diff --git a/src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java b/src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java
index 098b670509..6166835f31 100644
--- a/src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java
+++ b/src/Java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java
@@ -33,13 +33,13 @@ public abstract class BasicTileBlockWithTooltip extends BlockContainer implement
* Each mapped object holds the data for the six sides.
*/
@SideOnly(Side.CLIENT)
- private AutoMap<CubicObject<SafeTexture>> mSidedTextureArray = new AutoMap<CubicObject<SafeTexture>>();
+ private AutoMap<CubicObject<SafeTexture>> mSidedTextureArray;
/**
* Holds the data for the six sides, each side holds an array of data for each respective meta.
*/
@SideOnly(Side.CLIENT)
- private AutoMap<CubicObject<String>> mSidedTexturePathArray = new AutoMap<CubicObject<String>>();
+ private AutoMap<CubicObject<String>> mSidedTexturePathArray;
/**
* Does this block have any meta at all?
@@ -157,7 +157,13 @@ public abstract class BasicTileBlockWithTooltip extends BlockContainer implement
@SideOnly(Side.CLIENT)
private final void handleTextures() {
- Logger.INFO("[TeTexture] Building Texture Maps for "+getTileEntityName()+".");
+ Logger.INFO("[TeTexture] Building Texture Maps for "+getTileEntityName()+".");
+
+ // Init on the Client side only, to prevent Field initialisers existing in the Server side bytecode.
+ mSidedTextureArray = new AutoMap<CubicObject<SafeTexture>>();
+ mSidedTexturePathArray = new AutoMap<CubicObject<String>>();
+
+
//Store them in forge order
//DOWN, UP, NORTH, SOUTH, WEST, EAST
diff --git a/src/Java/gtPlusPlus/core/recipe/common/CI.java b/src/Java/gtPlusPlus/core/recipe/common/CI.java
index ce5587ef33..be1089a72a 100644
--- a/src/Java/gtPlusPlus/core/recipe/common/CI.java
+++ b/src/Java/gtPlusPlus/core/recipe/common/CI.java
@@ -6,6 +6,7 @@ import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.item.chemistry.AgriculturalChem;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.material.ALLOY;
@@ -1240,7 +1241,7 @@ public class CI {
}
public static ItemStack getNumberedBioCircuit(int i) {
- return GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(i, 0L);
+ return ItemUtils.simpleMetaStack(AgriculturalChem.mBioCircuit, i, 0);
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
index 42354e49e1..fd4659c543 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
@@ -19,9 +19,11 @@ import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import gregtech.common.items.GT_MetaGenerated_Tool_01;
+import gtPlusPlus.api.helpers.GregtechPlusPlus_API.Multiblock_API;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.data.Pair;
+import gtPlusPlus.api.objects.minecraft.multi.NoOutputBonusMultiBehaviour;
import gtPlusPlus.australia.gen.gt.WorldGen_GT_Australia;
import gtPlusPlus.core.handler.COMPAT_HANDLER;
import gtPlusPlus.core.handler.OldCircuitHandler;
@@ -123,6 +125,9 @@ public class HANDLER_GT {
}
+ // Register the No-Bonus Special Behaviour.
+ Multiblock_API.registerSpecialMultiBehaviour(new NoOutputBonusMultiBehaviour());
+
//Register some custom recipe maps for any enabled multiblocks.
//MultiblockRecipeMapHandler.run();
}
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 89c1112726..55378113d9 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
@@ -100,12 +100,7 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult
try {
calculatePollutionReduction = GT_MetaTileEntity_Hatch_Muffler.class.getDeclaredMethod("calculatePollutionReduction", int.class);
- } catch (NoSuchMethodException | SecurityException e) {}
-
-
- // Register the No-Bonus Special Behaviour.
- new NoOutputBonusMultiBehaviour();
-
+ } catch (NoSuchMethodException | SecurityException e) {}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/util/SpecialBehaviourTooltipHandler.java b/src/Java/gtPlusPlus/xmod/gregtech/api/util/SpecialBehaviourTooltipHandler.java
index f345a67db6..74655fb744 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/util/SpecialBehaviourTooltipHandler.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/util/SpecialBehaviourTooltipHandler.java
@@ -3,7 +3,9 @@ package gtPlusPlus.xmod.gregtech.api.util;
import java.util.HashMap;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+import gregtech.api.util.GT_Utility;
import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
public class SpecialBehaviourTooltipHandler {
@@ -18,9 +20,13 @@ public class SpecialBehaviourTooltipHandler {
public void onItemTooltip(ItemTooltipEvent event){
if (event != null) {
if (event.itemStack != null) {
- String s = mTooltipCache.get(event.itemStack);
- if (s != null && s.length() > 0) {
- event.toolTip.add(s);
+ for (ItemStack aKey : mTooltipCache.keySet()) {
+ if (GT_Utility.areStacksEqual(aKey, event.itemStack, false)) {
+ String s = mTooltipCache.get(aKey);
+ if (s != null && s.length() > 0) {
+ event.toolTip.add(EnumChatFormatting.RED+s);
+ }
+ }
}
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java
index 38c80ce8c4..81afe2b147 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java
@@ -564,10 +564,15 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase {
return tRecipe;
}
- private static WeightedCollection<ItemStack> generateWeightedCollection(){
+ private static ItemStack[] getOutputForTier(int aTier){
+ ItemStack[] aOutputs = new ItemStack[16];
+
+
+
+
WeightedCollection<ItemStack> aCollection = new WeightedCollection<ItemStack>();
- return aCollection;
+ return aOutputs;
}
diff --git a/src/resources/assets/miscutils/lang/en_US.lang b/src/resources/assets/miscutils/lang/en_US.lang
index 394680edd8..ad10be2d8b 100644
--- a/src/resources/assets/miscutils/lang/en_US.lang
+++ b/src/resources/assets/miscutils/lang/en_US.lang
@@ -3039,7 +3039,7 @@ tile.blockRoundRobinator.4.name=Round Robinator V
//Added 16/10/19
-item.BioRecipeSelector.name=Programmed Circuit
+item.BioRecipeSelector.name=Programmed Bio Circuit
item.FermentationBase.name=Cell of Fermentation Base
item.ureamix.name=Cell of Urea Mix
item.liquidresin.name=Cell of Liquid Resin