aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus/core')
-rw-r--r--src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java2
-rw-r--r--src/Java/gtPlusPlus/core/container/Container_SuperJukebox.java4
-rw-r--r--src/Java/gtPlusPlus/core/gui/machine/GUI_PestKiller.java4
-rw-r--r--src/Java/gtPlusPlus/core/item/ModItems.java8
-rw-r--r--src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java121
-rw-r--r--src/Java/gtPlusPlus/core/item/general/ItemControlCore.java3
-rw-r--r--src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java29
-rw-r--r--src/Java/gtPlusPlus/core/item/general/ItemSlowBuildingRing.java7
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/misc/DebugScanner.java22
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/misc/GregtechPump.java2
-rw-r--r--src/Java/gtPlusPlus/core/material/Material.java17
-rw-r--r--src/Java/gtPlusPlus/core/material/MaterialGenerator.java28
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java10
-rw-r--r--src/Java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java2
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java6
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/HazmatUtils.java9
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java4
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java5
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java2
19 files changed, 91 insertions, 194 deletions
diff --git a/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java b/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java
index 8310fa3c23..c0113e869b 100644
--- a/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java
+++ b/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java
@@ -175,7 +175,7 @@ public class BlockBaseModular extends BasicBlock {
}
}
metType = (metType.equals("9j4852jyo3rjmh3owlhw9oe") ? "METALLIC" : metType);
- int tier = this.blockMaterial.vTier;
+ int tier = blockMaterial != null ? this.blockMaterial.vTier : 0;
String aType = (this.thisBlock == BlockTypes.FRAME) ? "frameGt" : (tier <= 4 ? "block1" : "block5");
this.blockIcon = iIcon.registerIcon("gregtech" + ":" + "materialicons/"+ metType +"/" + aType);
}
diff --git a/src/Java/gtPlusPlus/core/container/Container_SuperJukebox.java b/src/Java/gtPlusPlus/core/container/Container_SuperJukebox.java
index 34a4e9fa97..f9bf617e1b 100644
--- a/src/Java/gtPlusPlus/core/container/Container_SuperJukebox.java
+++ b/src/Java/gtPlusPlus/core/container/Container_SuperJukebox.java
@@ -191,7 +191,7 @@ public class Container_SuperJukebox extends Container {
@Override
public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
- if (tile_entity.getWorldObj().isRemote || tile_entity == null) return null;
+ if (tile_entity == null || tile_entity.getWorldObj().isRemote) return null;
switch (aSlotIndex) {
case SLOT_HOLO_PLAY:
if (tile_entity == null) return null;
@@ -217,7 +217,7 @@ public class Container_SuperJukebox extends Container {
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
- if (tile_entity.getWorldObj().isRemote || tile_entity == null) return;
+ if (tile_entity == null || tile_entity.getWorldObj().isRemote) return;
isPlaying = tile_entity.mIsPlaying;
isLooping = tile_entity.mIsLooping;
diff --git a/src/Java/gtPlusPlus/core/gui/machine/GUI_PestKiller.java b/src/Java/gtPlusPlus/core/gui/machine/GUI_PestKiller.java
index 889b19443e..881c6c82a1 100644
--- a/src/Java/gtPlusPlus/core/gui/machine/GUI_PestKiller.java
+++ b/src/Java/gtPlusPlus/core/gui/machine/GUI_PestKiller.java
@@ -57,12 +57,10 @@ public class GUI_PestKiller extends GuiContainer {
Color startGrad = new Color(50, 50, 50);
Color endGrad = new Color(20, 20, 20);
Container_PestKiller aCont = (Container_PestKiller) this.inventorySlots;
- TileEntityPestKiller aTileKiller = aCont.tile_entity;
double aPercentage = 0;
double aDivisor = (100/16);
- int aFrameHeight = 16;
-
+ int aFrameHeight = 16;
boolean didRender = false;
if (aCont != null) {
diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java
index 007079b9c8..96fe5694cc 100644
--- a/src/Java/gtPlusPlus/core/item/ModItems.java
+++ b/src/Java/gtPlusPlus/core/item/ModItems.java
@@ -1055,10 +1055,10 @@ public final class ModItems {
GT_OreDictUnificator.registerOre("platePhasedIron", ItemUtils.getSimpleStack(itemPlatePulsatingIron));
GT_OreDictUnificator.registerOre("blockVibrantAlloy", ItemUtils.getItemStackOfAmountFromOreDict("blockPhasedGold", 1));
- CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getPlate(1), null, MaterialEIO.REDSTONE_ALLOY.getFluid(144), 10000, 16, 4*9);
- CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getIngot(1), null, MaterialEIO.REDSTONE_ALLOY.getFluid(144), 10000, 16, 4*9);
- CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getNugget(1), null, MaterialEIO.REDSTONE_ALLOY.getFluid(16), 10000, 16, 4);
- CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getBlock(1), null, MaterialEIO.REDSTONE_ALLOY.getFluid(1294), 10000, 16, 4*9*9);
+ CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getPlate(1), null, MaterialEIO.REDSTONE_ALLOY.getFluid(144), 16, 4*9);
+ CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getIngot(1), null, MaterialEIO.REDSTONE_ALLOY.getFluid(144), 16, 4*9);
+ CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getNugget(1), null, MaterialEIO.REDSTONE_ALLOY.getFluid(16), 16, 4);
+ CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getBlock(1), null, MaterialEIO.REDSTONE_ALLOY.getFluid(1294), 16, 4*9*9);
}
else {
diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
index afc4b17354..1b13d34495 100644
--- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
+++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
@@ -1,14 +1,10 @@
package gtPlusPlus.core.item.base.dusts;
import gtPlusPlus.core.item.base.BaseItemComponent;
-import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
public class BaseItemDust extends BaseItemComponent {
-
-
- private Material dustInfo;
private BaseItemComponent[] mSizedDusts = new BaseItemComponent[2];
public BaseItemDust(Material aMat) {
@@ -33,127 +29,10 @@ public class BaseItemDust extends BaseItemComponent {
}
}
- private BaseItemDust(final String unlocalizedName, final String materialName, final Material matInfo, final int colour, final String pileSize, final int tier){
- this(unlocalizedName, materialName, matInfo, colour, pileSize, tier, true);
- }
-
private BaseItemDust(String unlocalizedName, String materialName, Material matInfo, int colour, String pileSize, int tier, boolean addRecipes) {
super(matInfo, ComponentTypes.DUST);
-
- try {/*
- this.setUnlocalizedName(unlocalizedName);
- this.setMaxStackSize(64);
-
- this.setCreativeTab(tabMisc);
- this.colour = colour;
- this.mTier = tier;
- this.materialName = materialName;
- this.dustInfo = matInfo;
- this.setTextureName(this.getCorrectTexture(pileSize));
- GameRegistry.registerItem(this, unlocalizedName);
-
- String temp = "";
- Logger.WARNING("Unlocalized name for OreDict nameGen: "+this.getUnlocalizedName());
- if (this.getUnlocalizedName().contains("item.")){
- temp = this.getUnlocalizedName().replace("item.", "");
- Logger.WARNING("Generating OreDict Name: "+temp);
- }
- else {
- temp = this.getUnlocalizedName();
- }
- if (temp.contains("DustTiny")){
- temp = temp.replace("itemD", "d");
- Logger.WARNING("Generating OreDict Name: "+temp);
- }
- else if (temp.contains("DustSmall")){
- temp = temp.replace("itemD", "d");
- Logger.WARNING("Generating OreDict Name: "+temp);
- }
- else {
- temp = temp.replace("itemD", "d");
- Logger.WARNING("Generating OreDict Name: "+temp);
- }
- if ((temp != null) && !temp.equals("")){
- GT_OreDictUnificator.registerOre(temp, ItemUtils.getSimpleStack(this));
- }
- if (addRecipes){
- this.addFurnaceRecipe();
- this.addMacerationRecipe();
- }
- */}
- catch (Throwable t) {
- t.printStackTrace();
- }
- }
-
- private String getCorrectTexture(final String pileSize){
-
- if (!CORE.ConfigSwitches.useGregtechTextures || this.dustInfo.getTextureSet() == null){
- if ((pileSize == "dust") || (pileSize == "Dust")){
- this.setTextureName(CORE.MODID + ":" + "dust");}
- else{
- this.setTextureName(CORE.MODID + ":" + "dust"+pileSize);
- }
- }
-
-
- if (pileSize.toLowerCase().contains("small")){
- return "gregtech" + ":" + "materialicons/"+this.dustInfo.getTextureSet().mSetName+"/dustSmall";
- }
- else if (pileSize.toLowerCase().contains("tiny")){
- return "gregtech" + ":" + "materialicons/"+this.dustInfo.getTextureSet().mSetName+"/dustTiny";
- }
- return "gregtech" + ":" + "materialicons/"+this.dustInfo.getTextureSet().mSetName+"/dust";
}
- /* @Override
- public String getItemStackDisplayName(final ItemStack iStack) {
-
- String unlocal = super.getItemStackDisplayName(iStack);
- if (!unlocal.toLowerCase().contains(".name")) {
- return unlocal;
- }
- else {
- return unlocal;
- }
-
- }*/
-
- /* @Override
- public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) {
- try {
- if (this.dustInfo != null){
- if (entityHolding instanceof EntityPlayer){
- if (!((EntityPlayer) entityHolding).capabilities.isCreativeMode){
- EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.dustInfo.vRadiationLevel, world, entityHolding);
- }
- }
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- }*/
-
- /*@SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
-
- if (stack.getDisplayName().toLowerCase().contains("fluorite")){
- list.add("Mined from Sandstone and Limestone.");
- }
- if (this.dustInfo != null){
- list.add(this.dustInfo.vChemicalFormula);
- }
- if (this.dustInfo.vRadiationLevel > 0){
- list.add(CORE.GT_Tooltip_Radioactive);
- }
-
-
- //}
- super.addInformation(stack, aPlayer, list, bool);
- }*/
-
public static class DustState {
static final int NORMAL = (1);
static final int SMALL = (10);
diff --git a/src/Java/gtPlusPlus/core/item/general/ItemControlCore.java b/src/Java/gtPlusPlus/core/item/general/ItemControlCore.java
index 5ef72b6f17..b74b7972be 100644
--- a/src/Java/gtPlusPlus/core/item/general/ItemControlCore.java
+++ b/src/Java/gtPlusPlus/core/item/general/ItemControlCore.java
@@ -71,6 +71,9 @@ public class ItemControlCore extends Item {
@Override
public String getItemStackDisplayName(final ItemStack tItem) {
+ if (tItem == null) {
+ return "Control Core";
+ }
String aReturnValue = super.getItemStackDisplayName(tItem);
if (tItem != null) {
try {
diff --git a/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java b/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java
index c8acdc2152..82bb29b5bf 100644
--- a/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java
+++ b/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java
@@ -2,23 +2,10 @@ package gtPlusPlus.core.item.general;
import java.util.List;
-import cpw.mods.fml.common.Optional;
-import cpw.mods.fml.common.registry.GameRegistry;
-
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-import net.minecraft.world.World;
-
import baubles.api.BaubleType;
import baubles.api.IBauble;
+import cpw.mods.fml.common.Optional;
+import cpw.mods.fml.common.registry.GameRegistry;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
@@ -31,6 +18,16 @@ import gtPlusPlus.xmod.gregtech.common.helpers.ChargingHelper;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.api.item.IElectricItemManager;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.World;
@Optional.InterfaceList(value = {@Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles"), @Optional.Interface(iface = "baubles.api.BaubleType", modid = "Baubles")})
public class ItemHealingDevice extends Item implements IElectricItem, IElectricItemManager, IBauble{
@@ -232,7 +229,7 @@ public class ItemHealingDevice extends Item implements IElectricItem, IElectricI
@Override //TODO
public void onWornTick(final ItemStack aBaubleStack, final EntityLivingBase arg1) {
- if (!arg1.worldObj.isRemote){
+ if (arg1 != null && arg1.worldObj != null && !arg1.worldObj.isRemote){
//Try Charge First
diff --git a/src/Java/gtPlusPlus/core/item/general/ItemSlowBuildingRing.java b/src/Java/gtPlusPlus/core/item/general/ItemSlowBuildingRing.java
index 09c23d3551..c151a16f09 100644
--- a/src/Java/gtPlusPlus/core/item/general/ItemSlowBuildingRing.java
+++ b/src/Java/gtPlusPlus/core/item/general/ItemSlowBuildingRing.java
@@ -111,11 +111,8 @@ public class ItemSlowBuildingRing extends Item implements IBauble{
private static void doEffect(final EntityLivingBase arg1){
try {
// Get World
- World aWorld = arg1.worldObj;
- if (arg1.worldObj.isRemote){
- return;
- }
- if (aWorld != null) {
+ World aWorld = arg1.worldObj;
+ if (aWorld != null && !aWorld.isRemote) {
EntityPlayer aPlayer;
if (arg1 instanceof EntityPlayer) {
aPlayer = (EntityPlayer) arg1;
diff --git a/src/Java/gtPlusPlus/core/item/tool/misc/DebugScanner.java b/src/Java/gtPlusPlus/core/item/tool/misc/DebugScanner.java
index d0f3005d00..0170df0dc7 100644
--- a/src/Java/gtPlusPlus/core/item/tool/misc/DebugScanner.java
+++ b/src/Java/gtPlusPlus/core/item/tool/misc/DebugScanner.java
@@ -7,6 +7,7 @@ import gtPlusPlus.core.util.minecraft.PlayerUtils;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
+import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
@@ -62,19 +63,22 @@ public class DebugScanner extends CoreItem {
PlayerUtils.messagePlayer(player, "Invisible? "+entity.isInvisible());
PlayerUtils.messagePlayer(player, "Age: "+entity.ticksExisted);
- if (entity instanceof EntityLiving) {
- EntityLiving g = (EntityLiving) entity;
+ if (entity instanceof EntityLivingBase) {
+ EntityLivingBase g = (EntityLivingBase) entity;
PlayerUtils.messagePlayer(player, "Health: "+g.getHealth()+"/"+g.getMaxHealth());
PlayerUtils.messagePlayer(player, "On ground? "+g.onGround);
- PlayerUtils.messagePlayer(player, "Can Loot? "+g.canPickUpLoot());
- PlayerUtils.messagePlayer(player, "Child? "+g.isChild());
- if (entity instanceof EntityPlayer) {
- EntityPlayer y = (EntityPlayer) entity;
- PlayerUtils.messagePlayer(player, "Experience: "+y.experience);
- PlayerUtils.messagePlayer(player, "Name: "+y.getCommandSenderName());
- }
+ PlayerUtils.messagePlayer(player, "Child? "+g.isChild());
+ }
+ if (entity instanceof EntityLiving) {
+ EntityLiving g = (EntityLiving) entity;
+ PlayerUtils.messagePlayer(player, "Can Loot? "+g.canPickUpLoot());
}
+ if (entity instanceof EntityPlayer) {
+ EntityPlayer y = (EntityPlayer) entity;
+ PlayerUtils.messagePlayer(player, "Experience: "+y.experience);
+ PlayerUtils.messagePlayer(player, "Name: "+y.getCommandSenderName());
+ }
}
return true;
diff --git a/src/Java/gtPlusPlus/core/item/tool/misc/GregtechPump.java b/src/Java/gtPlusPlus/core/item/tool/misc/GregtechPump.java
index 0c31b999cd..a48573888e 100644
--- a/src/Java/gtPlusPlus/core/item/tool/misc/GregtechPump.java
+++ b/src/Java/gtPlusPlus/core/item/tool/misc/GregtechPump.java
@@ -1127,7 +1127,7 @@ public class GregtechPump extends Item implements ISpecialElectricItem, IElectri
else if ((aTileEntity instanceof IFluidTank || aTileEntity instanceof IFluidHandler)) {
if (aTileEntity instanceof IFluidTank) {
Logger.INFO("Tile Was instanceof IFluidTank.");
- FluidStack f = ((IFluidTank) aTileEntity).getFluid();
+ FluidStack f = ((IFluidTank) aTileEntity).getFluid();
if (aSetFluid == null) {
aSetFluid = f;
aSetFluid.amount = f.amount;
diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java
index dbcbeac32a..d95b17e75c 100644
--- a/src/Java/gtPlusPlus/core/material/Material.java
+++ b/src/Java/gtPlusPlus/core/material/Material.java
@@ -237,7 +237,7 @@ public class Material {
int hashSize = MathUtils.howManyPlaces(aValueForGen);
String a = String.valueOf(aValueForGen);
- String b = null;
+ String b = "";
if (hashSize < 9) {
int aSecondHash = this.materialState.hashCode();
@@ -379,9 +379,6 @@ public class Material {
aDataSet.put(m.getStackMaterial().vRadiationLevel);
}
byte aAverage = MathUtils.getByteAverage(aDataSet);
- if (aAverage > Byte.MAX_VALUE || aAverage < Byte.MIN_VALUE) {
- aAverage = 0;
- }
if (aAverage > 0) {
Logger.MATERIALS(this.getLocalizedName()+" is radioactive due to trace elements. Level: "+aAverage+".");
this.isRadioactive = true;
@@ -531,11 +528,6 @@ public class Material {
}
}
- public Material(String string, MaterialState solid, TextureSet setShiny, int i, short[] s, int j, int k, int l,
- int m, boolean b, String string2, int n) {
- // TODO Auto-generated constructor stub
- }
-
public final TextureSet getTextureSet() {
synchronized(this) {
return textureSet;
@@ -868,10 +860,9 @@ public class Material {
ItemStack a1 = getOre(1);
Item a2 = a1.getItem();
Block a3 = Block.getBlockFromItem(a2);
-
- //Logger.DEBUG_MATERIALS("[Invalid Ore] Is a1 valid? "+(a1 != null));
- //Logger.DEBUG_MATERIALS("[Invalid Ore] Is a2 valid? "+(a2 != null));
- //Logger.DEBUG_MATERIALS("[Invalid Ore] Is a3 valid? "+(a3 != null));
+ if (a3 != null) {
+ return a3;
+ }
Block x = Block.getBlockFromItem(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ore"+Utils.sanitizeString(this.unlocalizedName), stacksize).getItem());
if (x != null){
diff --git a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java
index 1757b461ee..797a033dcc 100644
--- a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java
+++ b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java
@@ -59,10 +59,17 @@ public class MaterialGenerator {
@SuppressWarnings("unused")
private static volatile Block tempBlock;
+
+ public static boolean addFluidExtractionRecipe(ItemStack aEmpty, ItemStack aRemains, FluidStack aFluid) {
+ return addFluidExtractionRecipe(aEmpty, aRemains, aFluid, null, null);
+ }
+
/**
* Called Reflectively from CORE.RA.addFluidExtractionRecipe
+ * @param aSpecial
+ * @return
*/
- private static void addFluidExtractionRecipe(ItemStack aEmpty, ItemStack aRemains, FluidStack aFluid, int aDuration, int aEU) {
+ public static boolean addFluidExtractionRecipe(ItemStack aEmpty, ItemStack aRemains, FluidStack aFluid, Integer aDuration, Integer aEU) {
/*GT_Recipe r = new Recipe_GT(
true,
new ItemStack[] {aEmpty, aRemains != null ? aRemains : null},
@@ -73,13 +80,22 @@ public class MaterialGenerator {
new FluidStack[] {c},
a2, a3, a1);*/
//new RecipeGen_FluidCanning(r, true);
- new RecipeGen_FluidCanning(true, aEmpty, aRemains, aFluid, aDuration, aEU);
+ RecipeGen_FluidCanning g = new RecipeGen_FluidCanning(true, aEmpty, aRemains, aFluid, aDuration, aEU);
+ if (g != null && g.valid()) {
+ return true;
+ }
+ return false;
}
+
+ public static boolean addFluidCannerRecipe(ItemStack aEmpty, ItemStack aFullContainer, FluidStack aFluidIn, FluidStack rFluidOut) {
+ return addFluidCannerRecipe(aEmpty, aFullContainer, aFluidIn, rFluidOut, null, null);
+ }
/**
* Called Reflectively from CORE.RA.addFluidCannerRecipe
+ * @return
*/
- private static void addFluidCannerRecipe(ItemStack aFullContainer, ItemStack aEmpty, FluidStack aFluid) {
+ public static boolean addFluidCannerRecipe(ItemStack aEmpty, ItemStack aFullContainer, FluidStack aFluidIn, FluidStack rFluidOut, Integer aTime, Integer aEu) {
/*GT_Recipe r = new Recipe_GT(
true,
new ItemStack[] {aEmpty},
@@ -90,7 +106,11 @@ public class MaterialGenerator {
new FluidStack[] {rFluidOut},
0, 0, 0);*/
//new RecipeGen_FluidCanning(r, false);
- new RecipeGen_FluidCanning(false, aEmpty, aFullContainer, aFluid, null, null);
+ RecipeGen_FluidCanning g = new RecipeGen_FluidCanning(false, aEmpty, aFullContainer, aFluidIn, null, null, 0);
+ if (g != null && g.valid()) {
+ return true;
+ }
+ return false;
}
public static void generate(final Material matInfo){
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
index c3c8da7761..f237eb9f37 100644
--- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
@@ -1589,18 +1589,18 @@ public class RECIPES_GREGTECH {
private static void fluidExtractorRecipes() {
//FLiBe fuel
CORE.RA.addFluidExtractionRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustLi2BeF4", 1), null,
- FluidUtils.getFluidStack("li2bef4", 144), 10000, 100, 500);
+ FluidUtils.getFluidStack("li2bef4", 144), 100, 500);
//LFTR Fuel 1
CORE.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ZrF4U235.getDust(1), null,
- NUCLIDE.LiFBeF2ZrF4U235.getFluid(144), 10000, 250, 1000);
+ NUCLIDE.LiFBeF2ZrF4U235.getFluid(144), 250, 1000);
CORE.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ZrF4UF4.getDust(1), null,
- NUCLIDE.LiFBeF2ZrF4UF4.getFluid(144), 10000, 150, 2000);
+ NUCLIDE.LiFBeF2ZrF4UF4.getFluid(144), 150, 2000);
CORE.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ThF4UF4.getDust(1), null,
- NUCLIDE.LiFBeF2ThF4UF4.getFluid(144), 10000, 200, 1500);
+ NUCLIDE.LiFBeF2ThF4UF4.getFluid(144), 200, 1500);
//ZIRCONIUM_TETRAFLUORIDE
CORE.RA.addFluidExtractionRecipe(FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getDust(1), null,
- FluidUtils.getFluidStack(ModItems.fluidZrF4, 144), 10000, 200, 512+256);
+ FluidUtils.getFluidStack(ModItems.fluidZrF4, 144), 200, 512+256);
diff --git a/src/Java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java b/src/Java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java
index 0cda40c616..0157384cd0 100644
--- a/src/Java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java
+++ b/src/Java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java
@@ -101,8 +101,8 @@ public class TileEntityCircuitProgrammer extends TileEntity implements ISidedInv
}
if (doAdd) {
ItemStack aOutput = CI.getNumberedCircuit(e);
- aOutput.stackSize = aSize;
if (aOutput != null) {
+ aOutput.stackSize = aSize;
this.setInventorySlotContents(e, aInputStack);
this.setInventorySlotContents(25, aOutput);
return true;
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java
index ff60d8c416..8902947c0d 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java
@@ -149,7 +149,7 @@ public class FluidUtils {
public static Fluid addGtFluid(final String aName, final String aLocalized, final GT_Materials aMaterial, final int aState, final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount, final boolean aGenerateCell) {
- Fluid g = addGTFluid(aName, "fluid.autogenerated", aLocalized, aMaterial.mRGBa, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount, aGenerateCell);
+ Fluid g = addGTFluid(aName, "fluid.autogenerated", aLocalized, aMaterial != null ? aMaterial.mRGBa : new short[]{255, 255, 255, 0}, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount, aGenerateCell);
if (g != null) {
if (aMaterial != null) {
switch (aState) {
@@ -310,7 +310,7 @@ public class FluidUtils {
rFluid.setTemperature((int) (aTemperatureK));
}
if ((aFullContainer != null) && (aEmptyContainer != null) && !FluidContainerRegistry.registerFluidContainer(new FluidStack(rFluid, aFluidAmount), aFullContainer, aEmptyContainer)) {
- CORE.RA.addFluidCannerRecipe(CI.emptyCells(1), aFullContainer, null, new FluidStack(rFluid, aFluidAmount));
+ CORE.RA.addFluidCannerRecipe(CI.emptyCells(1), aFullContainer, new FluidStack(rFluid, aFluidAmount));
}
else {
//Utils.LOG_INFO("Failed creating recipes to fill/empty cells of "+aName+".");
@@ -466,7 +466,6 @@ public class FluidUtils {
dustStack, //Input
null, //Input 2
FluidUtils.getFluidStack(gtFluid, amountPerItem), //Fluid Output
- 0, //Chance
1*20, //Duration
16 //Eu Tick
);
@@ -476,7 +475,6 @@ public class FluidUtils {
dustStack2, //Input
null, //Input 2
FluidUtils.getFluidStack(gtFluid, amountPerItem), //Fluid Output
- 0, //Chance
1*20, //Duration
16 //Eu Tick
);
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/HazmatUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/HazmatUtils.java
index c529f60ba1..d69dd5d66e 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/HazmatUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/HazmatUtils.java
@@ -306,7 +306,14 @@ public class HazmatUtils {
//Logger.INFO("[Hazmat] Item was mapped for TTs");
Collections.sort(aTempTooltipData);
//Logger.INFO("[Hazmat] Sorted TTs");
- return aTempTooltipData.toArray();
+
+ String[] mBuiltOutput = new String[aTempTooltipData.size()];
+ int aIndex = 0;
+ for (String i : aTempTooltipData) {
+ mBuiltOutput[aIndex++] = i;
+ }
+
+ return mBuiltOutput;
}
}
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java
index 25d1eb2793..a8cef939be 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java
@@ -694,7 +694,9 @@ public class ItemUtils {
public static String[] getArrayStackNamesAsArray(final ItemStack[] aStack) {
final String[] itemNames = aStack == null ? new String[] {} : new String[aStack.length];
- Logger.INFO(""+aStack.length);
+ if (aStack != null){
+ Logger.INFO(""+aStack.length);
+ }
if (aStack == null || aStack.length < 1) {
return itemNames;
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
index 364430b07d..9c623bb9be 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
@@ -25,6 +25,7 @@ import gtPlusPlus.core.material.state.MaterialState;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.data.EnumUtils;
import gtPlusPlus.core.util.data.StringUtils;
+import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -207,9 +208,9 @@ public class MaterialUtils {
return true;
}
- public static int getTierOfMaterial(final int aMeltingPoint){
+ public static int getTierOfMaterial(final double aMeltingPoint){
- return aMeltingPoint < 1000 ? 0 : (Math.round(aMeltingPoint/1000));
+ return aMeltingPoint < 1000 ? 0 : (MathUtils.roundToClosestInt(aMeltingPoint/1000f));
/*if ((aMeltingPoint >= 0) && (aMeltingPoint <= 1000)){
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java
index 6a41e54ec3..2f42e36bec 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java
@@ -138,7 +138,7 @@ public class PollutionUtils {
if (te == null) {
return false;
}
- return nullifyPollution(te);
+ return nullifyPollution((IHasWorldObjectAndCoords) te);
}
public static boolean nullifyPollution(IHasWorldObjectAndCoords aTileOfSomeSort) {