aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus/xmod')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java18
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java18
2 files changed, 14 insertions, 22 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java
index a063d334bf..422a29c34e 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java
@@ -1,6 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.items.behaviours;
-import java.util.ArrayList;
import java.util.List;
import codechicken.lib.math.MathHelper;
@@ -63,7 +62,7 @@ public class Behaviour_Electric_Lighter extends Behaviour_None {
if (!aWorld.isRemote && aStack != null && aStack.stackSize == 1) {
if (aPlayer.isSneaking()) {
Logger.INFO("Changing Mode");
- boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMod");
+ boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMode");
Logger.INFO("Is currently in Fireball mode? "+aCurrentMode);
boolean aNewMode = Utils.invertBoolean(aCurrentMode);
Logger.INFO("Is now set to Fireball mode? "+aNewMode);
@@ -72,7 +71,7 @@ public class Behaviour_Electric_Lighter extends Behaviour_None {
PlayerUtils.messagePlayer(aPlayer, "Current Mode: "+EnumChatFormatting.RED+(aNewMode ? "Projectile" : "Fire Starter"));
}
else {
- boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMod");
+ boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMode");
if (aCurrentMode) {
//Shoot Lightning Attack
aWorld.playSoundAtEntity(aPlayer, "random.bow", 0.5F, 0.4F / (CORE.RANDOM.nextFloat() * 0.4F + 0.8F));
@@ -112,16 +111,16 @@ public class Behaviour_Electric_Lighter extends Behaviour_None {
if (!aWorld.isRemote && aStack != null && aStack.stackSize == 1) {
if (aPlayer.isSneaking()) {
Logger.INFO("Changing Mode");
- boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMod");
+ boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMode");
Logger.INFO("Is currently in Fireball mode? "+aCurrentMode);
boolean aNewMode = Utils.invertBoolean(aCurrentMode);
Logger.INFO("Is now set to Fireball mode? "+aNewMode);
- aStack.getTagCompound().setBoolean("aFireballMod", aNewMode);
+ aStack.getTagCompound().setBoolean("aFireballMode", aNewMode);
//NBTUtils.setBoolean(aStack, "aFireballMode", aNewMode);
PlayerUtils.messagePlayer(aPlayer, "Current Mode: "+EnumChatFormatting.RED+(aNewMode ? "Projectile" : "Fire Starter"));
}
else {
- boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMod");
+ boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMode");
if (aCurrentMode) {
//Shoot Lightning Attack
aWorld.playSoundAtEntity(aPlayer, "random.bow", 0.5F, 0.4F / (CORE.RANDOM.nextFloat() * 0.4F + 0.8F));
@@ -199,11 +198,14 @@ public class Behaviour_Electric_Lighter extends Behaviour_None {
}
}
boolean aCurrentMode;
+ if (!NBTUtils.hasTagCompound(aStack)) {
+ NBTUtils.createEmptyTagCompound(aStack);
+ }
if (NBTUtils.hasKey(aStack, "aFireballMode")) {
- aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMod");
+ aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMode");
}
else {
- aStack.getTagCompound().setBoolean("aFireballMod", false);
+ aStack.getTagCompound().setBoolean("aFireballMode", false);
aCurrentMode = false;
}
aList.add("Current Mode: "+EnumChatFormatting.RED+(aCurrentMode ? "Projectile" : "Fire Starter"));
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java
index f812eee113..60c0ade62f 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java
@@ -37,6 +37,7 @@ import gtPlusPlus.core.item.chemistry.AgriculturalChem;
import gtPlusPlus.core.item.chemistry.GenericChem;
import gtPlusPlus.core.item.chemistry.general.ItemGenericChemBase;
import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
@@ -996,20 +997,9 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
if (aItemInputs != null) {
for (final ItemStack aInput : aItemInputs) {
if (aInput != null) {
- if (aInput.isItemEqual(GenericChem.mRedCatalyst))
- return aInput;
- else if (aInput.isItemEqual(GenericChem.mYellowCatalyst))
- return aInput;
- else if (aInput.isItemEqual(GenericChem.mBlueCatalyst))
- return aInput;
- else if (aInput.isItemEqual(GenericChem.mOrangeCatalyst))
- return aInput;
- else if (aInput.isItemEqual(GenericChem.mPurpleCatalyst))
- return aInput;
- else if (aInput.isItemEqual(AgriculturalChem.mGreenCatalyst))
- return aInput;
- else if (aInput.isItemEqual(GenericChem.mBrownCatalyst))
+ if (ItemUtils.isCatalyst(aInput)) {
return aInput;
+ }
}
}
}
@@ -1023,7 +1013,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
log("damage catalyst "+damage);
if (damage >= getMaxCatalystDurability()) {
log("consume catalyst");
- ItemStack emptyCatalyst = ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier,1);
+ ItemStack emptyCatalyst = CI.getEmptyCatalyst(1);
addOutput(emptyCatalyst);
setDamage(aStack,0);
aStack.stackSize -= 1;