diff options
11 files changed, 55 insertions, 36 deletions
diff --git a/src/Java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java b/src/Java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java index 7c67df905b..7c71f09302 100644 --- a/src/Java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java +++ b/src/Java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java @@ -17,7 +17,7 @@ import gtPlusPlus.core.tileentities.machines.TileEntityTradeTable; @SideOnly(Side.CLIENT) public class GUI_TradeTable extends GuiContainer { - + TileEntityTradeTable mThisTable; String mOwnerName; @@ -25,18 +25,10 @@ public class GUI_TradeTable extends GuiContainer { public GUI_TradeTable(final InventoryPlayer player_inventory, final TileEntityTradeTable te, final String mOwnerName){ super(new Container_TradeTable(player_inventory, te)); - - if (te == null){ - this.mThisTable = null; - this.mOwnerName = mOwnerName; - Logger.INFO("Set invalid TE in GUI"); - } - else { - if (te.isServerSide()){ + if (te.isServerSide()){ mThisTable = te; this.mOwnerName = mOwnerName; Logger.INFO("Set valid TE in GUI"); - } } } @@ -45,7 +37,7 @@ public class GUI_TradeTable extends GuiContainer { this.fontRendererObj.drawString(I18n.format("Owner - "+this.mOwnerName, new Object[0]), 28, 66, 4210752); //this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); } - + @Override protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j){ GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); diff --git a/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java b/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java index 4ac42eaeb3..688483b831 100644 --- a/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java +++ b/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java @@ -19,7 +19,7 @@ public class BaseItemCell extends BaseItemComponent{ public BaseItemCell(final Material material) { super(material, BaseItemComponent.ComponentTypes.CELL); - this.fluidColour = (short[]) ((material == null) ? this.extraData : material.getRGBA()); + this.fluidColour = (short[]) material.getRGBA(); //FluidContainerRegistry.registerFluidContainer(material.getFluid(1000), ItemUtils.getSimpleStack(this), Ic2Items.cell.copy()); } diff --git a/src/Java/gtPlusPlus/core/item/base/cell/BaseItemPlasmaCell.java b/src/Java/gtPlusPlus/core/item/base/cell/BaseItemPlasmaCell.java index e216a21796..23d1d022fa 100644 --- a/src/Java/gtPlusPlus/core/item/base/cell/BaseItemPlasmaCell.java +++ b/src/Java/gtPlusPlus/core/item/base/cell/BaseItemPlasmaCell.java @@ -26,7 +26,7 @@ public class BaseItemPlasmaCell extends BaseItemComponent{ public BaseItemPlasmaCell(final Material material) { super(material, ComponentTypes.PLASMACELL); - this.fluidColour = (short[]) ((material == null) ? this.extraData : material.getRGBA()); + this.fluidColour = (short[]) material.getRGBA(); } @Override diff --git a/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java b/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java index 3d31f6c0a5..6923cb545e 100644 --- a/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java @@ -71,9 +71,7 @@ public class BaseOreComponent extends Item{ @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public final void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { - - if ((this.materialName != null) && (this.materialName != "") && !this.materialName.equals("") && (this.componentMaterial != null)){ - + if (this.materialName != null && !this.materialName.equals("")){ if (this.componentMaterial != null){ if (!this.componentMaterial.vChemicalFormula.equals("??") && !this.componentMaterial.vChemicalFormula.equals("?") && this.componentMaterial.getState() != MaterialState.PURE_LIQUID) { list.add(Utils.sanitizeStringKeepBrackets(this.componentMaterial.vChemicalFormula)); diff --git a/src/Java/gtPlusPlus/core/tileentities/base/TileEntityBase.java b/src/Java/gtPlusPlus/core/tileentities/base/TileEntityBase.java index e4f1576565..90c37e140a 100644 --- a/src/Java/gtPlusPlus/core/tileentities/base/TileEntityBase.java +++ b/src/Java/gtPlusPlus/core/tileentities/base/TileEntityBase.java @@ -17,7 +17,6 @@ public abstract class TileEntityBase extends TileEntity implements ISidedInvento public String mOwnerUUID = "null"; private boolean mIsOwnerOP = false; - @SuppressWarnings("static-method") public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag){ if(!nbt.hasKey(tag)) { @@ -105,8 +104,7 @@ public abstract class TileEntityBase extends TileEntity implements ISidedInvento public boolean processRecipe(){ return true; - } - + } @Override public boolean canUpdate() { @@ -130,8 +128,7 @@ public abstract class TileEntityBase extends TileEntity implements ISidedInvento public void setOwnerInformation(String mName, String mUUID, boolean mOP){ if (isServerSide()){ - if (this.mOwnerName.equals("null") || this.mOwnerUUID.equals("null") - || this.mOwnerName == null || this.mOwnerUUID == null){ + if (this.mOwnerName == null || this.mOwnerUUID == null || this.mOwnerName.equals("null") || this.mOwnerUUID.equals("null")){ this.mOwnerName = mName; this.mOwnerUUID = mUUID; this.mIsOwnerOP = mOP; @@ -158,7 +155,7 @@ public abstract class TileEntityBase extends TileEntity implements ISidedInvento @Override public String getInventoryName() { - return this.hasCustomInventoryName() ? this.customName : "container.fishrap"; + return this.hasCustomInventoryName() ? this.customName : "container.tileentity.name"; } @Override diff --git a/src/Java/gtPlusPlus/core/util/minecraft/EntityUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/EntityUtils.java index 5767e91c78..10d14d3d34 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/EntityUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/EntityUtils.java @@ -86,12 +86,12 @@ public class EntityUtils { /** * Static Version of the method used in {@code doFireDamage(entity, int)} to save memory. */ - private static Method dealFireDamage = null; + private volatile static Method dealFireDamage = null; /** * Reflective Call to do Fire Damage to an entity (Does not set entity on fire though) */ - public static boolean doFireDamage(Entity entity, int amount){ + public synchronized static boolean doFireDamage(Entity entity, int amount){ if (dealFireDamage == null){ try { dealFireDamage = Entity.class.getDeclaredMethod("dealFireDamage", int.class); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java index 6417170984..8f7539f268 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java @@ -34,8 +34,8 @@ import net.minecraftforge.fluids.*; public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_BasicTank { - public static int TESSERACT_ENERGY_COST_DIMENSIONAL = 2048; - public static int TESSERACT_ENERGY_COST = 512; + public static int TESSERACT_ENERGY_COST_DIMENSIONAL = 512; + public static int TESSERACT_ENERGY_COST = 128; public byte isWorking = 0; public int oFrequency = 0; public int mNeededEnergy = 0; @@ -168,8 +168,12 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public void onConfigLoad(final GT_Config aConfig) { - TESSERACT_ENERGY_COST = 512; - TESSERACT_ENERGY_COST_DIMENSIONAL = 2048; + int J = 1; + if (CORE.GTNH) { + J = 4; + } + TESSERACT_ENERGY_COST = 128*J; + TESSERACT_ENERGY_COST_DIMENSIONAL = 512*J; } @Override @@ -534,8 +538,15 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi if (!this.getBaseMetaTileEntity().isAllowedToWork()) { return false; } - this.mNeededEnergy += (aTerminal.getBaseMetaTileEntity().getWorld() == this.getBaseMetaTileEntity().getWorld() + int J = (aTerminal.getBaseMetaTileEntity().getWorld() == this.getBaseMetaTileEntity().getWorld() ? TESSERACT_ENERGY_COST : TESSERACT_ENERGY_COST_DIMENSIONAL); + + if (CORE.GTNH) { + J *= 4; + } + + this.mNeededEnergy += J; + return true; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java index 3d4aa98032..f5cc4a0cd5 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java @@ -31,6 +31,8 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic public UUID mOwner; public boolean mDidWork = false; public static boolean sInterDimensionalTesseractAllowed = true; + private static int TESSERACT_ENERGY_COST = 128; + private static int TESSERACT_ENERGY_COST_DIMENSIONAL = 512; public GT_MetaTileEntity_TesseractTerminal(final int aID, final String aName, final String aNameRegional, final int aTier) { @@ -79,12 +81,12 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public long getMinimumStoredEU() { - return this.getBaseMetaTileEntity().getEUCapacity() / 2; + return (this.getBaseMetaTileEntity().getEUCapacity() / 100); } @Override public long maxEUInput() { - return 128; + return TESSERACT_ENERGY_COST_DIMENSIONAL; } @Override @@ -94,7 +96,7 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public long maxEUStore() { - return 512 * 32; + return TESSERACT_ENERGY_COST_DIMENSIONAL * 8 * 32; } @Override @@ -132,6 +134,14 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public void onConfigLoad(final GT_Config aConfig) { sInterDimensionalTesseractAllowed = true; + if (CORE.GTNH) { + TESSERACT_ENERGY_COST = 512; + TESSERACT_ENERGY_COST_DIMENSIONAL = 2048; + } + else { + TESSERACT_ENERGY_COST = 128; + TESSERACT_ENERGY_COST_DIMENSIONAL = 512; + } } @Override @@ -485,7 +495,10 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic public String[] getDescription() { return new String[] { this.mDescription, "Accesses Tesseract Generators remotely", - "Connect with pipes to extract items", + "Connect with pipes to extract items or fluids", + "Outputs from the back face", + "Consumes "+TESSERACT_ENERGY_COST+"EU/t for same dimension transfers", + "Consumes "+TESSERACT_ENERGY_COST_DIMENSIONAL+"EU/t for cross dimensional transfers", CORE.GT_Tooltip }; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java index 41a71046fe..faeaf1d605 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java @@ -191,7 +191,10 @@ public class GregtechMetaTileEntity_CompactFusionReactor extends GT_MetaTileEnti FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); GT_Recipe tRecipe = getRecipeList().findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, GT_Values.V[8], tFluids, new ItemStack[] {}); - if ((tRecipe == null && !mRunningOnLoad) || (maxEUStore() < tRecipe.mSpecialValue)) { + if (tRecipe == null) { + return false; + } + if ((tRecipe == null && !mRunningOnLoad) || (tRecipe != null && maxEUStore() < tRecipe.mSpecialValue)) { this.mLastRecipe = null; Logger.INFO("Just plain bad."); return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_PocketFusion.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_PocketFusion.java index 00b323e7f3..7ccee3f4b4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_PocketFusion.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_PocketFusion.java @@ -191,7 +191,12 @@ public class GregtechMetaTileEntity_PocketFusion extends GT_MetaTileEntity_Delux FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); GT_Recipe tRecipe = getRecipeList().findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, GT_Values.V[8], tFluids, new ItemStack[] {}); - if ((tRecipe == null && !mRunningOnLoad) || (maxEUStore() < tRecipe.mSpecialValue)) { + + if (tRecipe == null) { + return false; + } + + if ((tRecipe == null && !mRunningOnLoad) || (tRecipe != null && maxEUStore() < tRecipe.mSpecialValue)) { this.mLastRecipe = null; Logger.INFO("Just plain bad."); return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java index 932a9f5efd..892b601871 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java @@ -324,7 +324,7 @@ public class GregtechConduits { GT_Values.RA.addExtruderRecipe( ItemUtils.getSimpleStack(pipeIngot, 1), ItemList.Shape_Extruder_Pipe_Tiny.get(0), - ItemUtils.getItemStackOfAmountFromOreDict("pipe"+"Tiny"+output, 2), + ItemUtils.getItemStackOfAmountFromOreDictNoBroken("pipe"+"Tiny"+output, 2), 5, eut); GT_Values.RA.addExtruderRecipe( |