From 002e757d65f20ab809f7a21d0662e36aa84c2fc0 Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Mon, 29 Jun 2015 23:03:55 +0200 Subject: [PATCH] Version 5.08.22-23 --- main/java/gregtech/api/enums/Materials.java | 2 +- .../api/items/GT_MetaGenerated_Tool.java | 1 + .../api/items/GT_RadioactiveCellIC_Item.java | 8 ++++--- .../api/metatileentity/BaseTileEntity.java | 2 +- .../GT_MetaTileEntity_MultiBlockBase.java | 4 +--- main/java/gregtech/api/util/GT_Utility.java | 23 ++----------------- main/java/gregtech/common/GT_RecipeAdder.java | 5 +++- .../common/blocks/GT_TileEntity_Ores.java | 2 +- .../common/items/GT_DepletetCell_Item.java | 2 +- ...T_MetaTileEntity_FluidNaquadahReactor.java | 14 ++++++++--- ...T_MetaTileEntity_SolidNaquadahReactor.java | 14 ++++++++--- ...T_MetaTileEntity_LargeTurbine_HPSteam.java | 2 +- .../GT_MetaTileEntity_LargeTurbine_Steam.java | 2 +- .../GT_MetaTileEntity_ProcessingArray.java | 11 ++++++++- .../common/tools/GT_Tool_Turbine.java | 1 + .../loaders/misc/GT_Achievements.java | 16 ++++++------- .../oreprocessing/ProcessingOreSmelting.java | 8 +------ .../postload/GT_MachineRecipeLoader.java | 11 ++++++++- .../GT_Loader_Item_Block_And_Fluid.java | 6 ++--- 19 files changed, 74 insertions(+), 60 deletions(-) diff --git a/main/java/gregtech/api/enums/Materials.java b/main/java/gregtech/api/enums/Materials.java index e45ce625..efd3e9a8 100644 --- a/main/java/gregtech/api/enums/Materials.java +++ b/main/java/gregtech/api/enums/Materials.java @@ -730,7 +730,7 @@ public enum Materials implements IColorModulationContainer, ISubTagContainer { Water .add(SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.NO_RECYCLING); Sulfur .add(SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.FLAMMABLE); Saltpeter .add(SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.FLAMMABLE); - Graphite .add(SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.FLAMMABLE); + Graphite .add(SubTag.NO_SMASHING, SubTag.NO_SMELTING, SubTag.FLAMMABLE, SubTag.NO_SMELTING); Wheat .add(SubTag.FLAMMABLE, SubTag.MORTAR_GRINDABLE); Paper .add(SubTag.FLAMMABLE, SubTag.NO_SMELTING, SubTag.NO_SMASHING, SubTag.MORTAR_GRINDABLE, SubTag.PAPER); diff --git a/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java b/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java index b574d90f..292e2d46 100644 --- a/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java +++ b/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java @@ -339,6 +339,7 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item implements if (tStats == null || GT_Utility.setStack(aStack, tStats.getBrokenItem(aStack)) == null) { if (tStats != null) GT_Utility.doSoundAtClient(tStats.getBreakingSound(), 1, 1.0F); if (aStack.stackSize > 0) aStack.stackSize--; + } } return true; diff --git a/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java b/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java index e556f4b5..2d9d8e0c 100644 --- a/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java +++ b/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java @@ -21,10 +21,11 @@ import net.minecraft.world.World; public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implements IReactorComponent { public final int numberOfCells; - public final double sEnergy; + public final float sEnergy; public final int sRadiation; + public final float sHeat; - public GT_RadioactiveCellIC_Item( String aUnlocalized, String aEnglish, int aCellcount, int maxDamage, double aEnergy, int aRadiation) + public GT_RadioactiveCellIC_Item( String aUnlocalized, String aEnglish, int aCellcount, int maxDamage, float aEnergy, int aRadiation, float aHeat) { super(aUnlocalized, aEnglish, aCellcount); setMaxStackSize(64); @@ -32,6 +33,7 @@ import net.minecraft.world.World; this.numberOfCells = aCellcount; this.sEnergy = aEnergy; this.sRadiation = aRadiation; + this.sHeat = aHeat; } @@ -76,7 +78,7 @@ import net.minecraft.world.World; checkHeatAcceptor(reactor, x + 1, y, heatAcceptors); checkHeatAcceptor(reactor, x, y - 1, heatAcceptors); checkHeatAcceptor(reactor, x, y + 1, heatAcceptors); - heat = (int) (heat * sEnergy); + heat = Math.round(heat * sHeat); while ((heatAcceptors.size() > 0) && (heat > 0)) { diff --git a/main/java/gregtech/api/metatileentity/BaseTileEntity.java b/main/java/gregtech/api/metatileentity/BaseTileEntity.java index 49e7f4ec..d8a798d1 100644 --- a/main/java/gregtech/api/metatileentity/BaseTileEntity.java +++ b/main/java/gregtech/api/metatileentity/BaseTileEntity.java @@ -127,7 +127,7 @@ public abstract class BaseTileEntity extends TileEntity implements IHasWorldObje @Override public final boolean getOpacity(int aX, int aY, int aZ) { if (ignoreUnloadedChunks && crossedChunkBorder(aX, aZ) && !worldObj.blockExists(aX, aY, aZ)) return false; - return GT_Utility.isBlockOpaque(worldObj, aX, aY, aZ,true,true); + return GT_Utility.isOpaqueBlock(worldObj, aX, aY, aZ); } @Override diff --git a/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java b/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java index 58336d21..1ff909d3 100644 --- a/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java +++ b/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java @@ -337,9 +337,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { if (mInventory[1] != null && getBaseMetaTileEntity().getRandomNumber(2) == 0 &&!mInventory[1].getUnlocalizedName().startsWith("gt.blockmachines.basicmachine.")) { if(mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01){ ((GT_MetaGenerated_Tool)mInventory[1].getItem()).doDamage(mInventory[1], (long) Math.min(mEUt/5, Math.pow(mEUt, 0.7))); - if(mInventory[1]!=null&&mInventory[1].getItem().getDamage(mInventory[1])>mInventory[1].getMaxDamage()){ - mInventory[1]=null; - } + if(mInventory[1].stackSize==0)mInventory[1]=null; } } } diff --git a/main/java/gregtech/api/util/GT_Utility.java b/main/java/gregtech/api/util/GT_Utility.java index 3285661d..fea00321 100644 --- a/main/java/gregtech/api/util/GT_Utility.java +++ b/main/java/gregtech/api/util/GT_Utility.java @@ -1149,13 +1149,8 @@ public class GT_Utility { return aStack; } - public static boolean isBlockOccluded(World aWorld, int aX, int aY, int aZ, boolean aIgnoreUnloadedChunks, boolean aDefault) { - return isBlockOpaque(aWorld, aX+1, aY, aZ, aIgnoreUnloadedChunks, aDefault) && isBlockOpaque(aWorld, aX-1, aY, aZ, aIgnoreUnloadedChunks, aDefault) && isBlockOpaque(aWorld, aX, aY+1, aZ, T, aDefault) && isBlockOpaque(aWorld, aX, aY-1, aZ, T, aDefault) && isBlockOpaque(aWorld, aX, aY, aZ+1, aIgnoreUnloadedChunks, aDefault) && isBlockOpaque(aWorld, aX, aY, aZ-1, aIgnoreUnloadedChunks, aDefault); - } - - public static boolean isBlockOpaque(World aWorld, int aX, int aY, int aZ, boolean aIgnoreUnloadedChunks, boolean aDefault) { - if (aIgnoreUnloadedChunks || aWorld.blockExists(aX, aY, aZ)) return aWorld.getBlock(aX, aY, aZ).isOpaqueCube(); - return aDefault; + public static boolean isOpaqueBlock(World aWorld, int aX, int aY, int aZ) { + return aWorld.getBlock(aX, aY, aZ).isOpaqueCube(); } public static boolean isBlockAir(World aWorld, int aX, int aY, int aZ) { @@ -1448,20 +1443,6 @@ public class GT_Utility { return isStackInList(new GT_ItemStack(aStack), aList); } -// public static boolean isStackInList2(ItemStack aStack, Collection aList) { -// if (aStack == null) {return F;} -// GT_ItemStack bStack = new GT_ItemStack(aStack); -// for(Iterator it = aList.iterator();it.hasNext();){ -// GT_ItemStack stack = (GT_ItemStack) it.next(); -// if(stack.mItem==bStack.mItem){ -// if(stack.mMetaData==bStack.mMetaData){ -// return true; -// } -// } -// } -// return false; -// } - public static boolean isStackInList(GT_ItemStack aStack, Collection aList) { return aStack != null && (aList.contains(aStack) || aList.contains(new GT_ItemStack(aStack.mItem, aStack.mStackSize, W))); } diff --git a/main/java/gregtech/common/GT_RecipeAdder.java b/main/java/gregtech/common/GT_RecipeAdder.java index 22d66a58..64b1625b 100644 --- a/main/java/gregtech/common/GT_RecipeAdder.java +++ b/main/java/gregtech/common/GT_RecipeAdder.java @@ -10,7 +10,10 @@ import gregtech.api.util.GT_Config; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; + import java.util.ArrayList; + +import crazypants.enderio.material.Material; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; @@ -123,7 +126,7 @@ public class GT_RecipeAdder public boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt) { - if ((aInput1 == null) || (aOutput1 == null)) { + if ((aInput1 == null) || (aOutput1 == null || Materials.Graphite.contains(aInput1))) { return false; } if ((aInput2 == null) && ((OrePrefixes.ingot.contains(aInput1)) || (OrePrefixes.dust.contains(aInput1)) || (OrePrefixes.gem.contains(aInput1)))) { diff --git a/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java b/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java index 07976c8e..6edce964 100644 --- a/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java +++ b/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java @@ -60,7 +60,7 @@ public class GT_TileEntity_Ores public Packet getDescriptionPacket() { if (!this.worldObj.isRemote) { - if (GT_Utility.isBlockOccluded(worldObj, xCoord, yCoord, zCoord, false, true)) { + if ((this.mBlocked == (GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord + 1, this.yCoord, this.zCoord)) && (GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord - 1, this.yCoord, this.zCoord)) && (GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord + 1, this.zCoord)) && (GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord - 1, this.zCoord)) && (GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord, this.zCoord + 1)) && (GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord, this.zCoord - 1)) ? 1 : 0) == 0) { GT_Values.NW.sendPacketToAllPlayersInRange(this.worldObj, new GT_Packet_Ores(this.xCoord, (short)this.yCoord, this.zCoord, this.mMetaData), this.xCoord, this.zCoord); } } diff --git a/main/java/gregtech/common/items/GT_DepletetCell_Item.java b/main/java/gregtech/common/items/GT_DepletetCell_Item.java index dbc049f1..84c38db6 100644 --- a/main/java/gregtech/common/items/GT_DepletetCell_Item.java +++ b/main/java/gregtech/common/items/GT_DepletetCell_Item.java @@ -7,7 +7,7 @@ import gregtech.api.items.GT_RadioactiveCellIC_Item; public class GT_DepletetCell_Item extends GT_RadioactiveCellIC_Item{ public GT_DepletetCell_Item(String aUnlocalized, String aEnglish, int aRadiation) { - super(aUnlocalized, aEnglish, 1, 1, 0, aRadiation);} + super(aUnlocalized, aEnglish, 1, 1, 0, aRadiation,0);} public void processChamber(IReactor paramIReactor, ItemStack paramItemStack, int paramInt1, int paramInt2, boolean paramBoolean){} diff --git a/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_FluidNaquadahReactor.java b/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_FluidNaquadahReactor.java index cbc8d1ee..7b084c12 100644 --- a/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_FluidNaquadahReactor.java +++ b/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_FluidNaquadahReactor.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.generators; +import gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.Textures; import gregtech.api.enums.Textures.BlockIcons; import gregtech.api.interfaces.ITexture; @@ -13,6 +15,7 @@ import gregtech.api.util.GT_Recipe.GT_Recipe_Map; public class GT_MetaTileEntity_FluidNaquadahReactor extends GT_MetaTileEntity_BasicGenerator { + public int mEfficiency; public boolean isOutputFacing(byte aSide) { return (aSide > 1) && (aSide != getBaseMetaTileEntity().getFrontFacing()) && (aSide != getBaseMetaTileEntity().getBackFacing()); @@ -20,12 +23,12 @@ public class GT_MetaTileEntity_FluidNaquadahReactor public GT_MetaTileEntity_FluidNaquadahReactor(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, "Requires Enriched Naquadah Cells", new ITexture[0]); + super(aID, aName, aNameRegional, aTier, "Requires Enriched Naquadah Cells", new ITexture[0]);onConfigLoad(); } public GT_MetaTileEntity_FluidNaquadahReactor(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { - super(aName, aTier, aDescription, aTextures); + super(aName, aTier, aDescription, aTextures);onConfigLoad(); } public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) @@ -45,9 +48,14 @@ public class GT_MetaTileEntity_FluidNaquadahReactor public int getEfficiency() { - return 100; + return mEfficiency; } + public void onConfigLoad() + { + this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "FluidNaquadah.efficiency.tier."+this.mTier, 100); +} + public ITexture[] getFront(byte aColor) { return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_FRONT) }; diff --git a/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SolidNaquadahReactor.java b/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SolidNaquadahReactor.java index 4e85dbfe..945d0ad0 100644 --- a/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SolidNaquadahReactor.java +++ b/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SolidNaquadahReactor.java @@ -1,5 +1,7 @@ package gregtech.common.tileentities.generators; +import gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.Textures; import gregtech.api.enums.Textures.BlockIcons; import gregtech.api.interfaces.ITexture; @@ -13,6 +15,7 @@ import gregtech.api.util.GT_Recipe.GT_Recipe_Map; public class GT_MetaTileEntity_SolidNaquadahReactor extends GT_MetaTileEntity_BasicGenerator { + public int mEfficiency; public boolean isOutputFacing(byte aSide) { return (aSide > 1) && (aSide != getBaseMetaTileEntity().getFrontFacing()) && (aSide != getBaseMetaTileEntity().getBackFacing()); @@ -20,12 +23,12 @@ public class GT_MetaTileEntity_SolidNaquadahReactor public GT_MetaTileEntity_SolidNaquadahReactor(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, "Requires Enriched Naquadah Bolts", new ITexture[0]); + super(aID, aName, aNameRegional, aTier, "Requires Enriched Naquadah Bolts", new ITexture[0]);onConfigLoad(); } public GT_MetaTileEntity_SolidNaquadahReactor(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { - super(aName, aTier, aDescription, aTextures); + super(aName, aTier, aDescription, aTextures);onConfigLoad(); } public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) @@ -45,9 +48,14 @@ public class GT_MetaTileEntity_SolidNaquadahReactor public int getEfficiency() { - return 80; + return mEfficiency; } + public void onConfigLoad() + { + this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "SolidNaquadah.efficiency.tier."+this.mTier, 80); +} + public ITexture[] getFront(byte aColor) { return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT) }; diff --git a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java b/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java index 9e4d31e3..48bd34bf 100644 --- a/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java +++ b/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java @@ -49,7 +49,7 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La int tEU=0; int distOut=0; for(int i=0;i