diff options
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech')
4 files changed, 132 insertions, 289 deletions
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 52c06e6946..e4a6907335 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 @@ -1,19 +1,5 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base; -import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.concurrent.TimeUnit; - -import net.minecraft.util.ChatComponentTranslation; -import org.apache.commons.lang3.ArrayUtils; - import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -24,16 +10,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.metatileentity.implementations.*; import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; @@ -43,11 +20,7 @@ import gtPlusPlus.GTplusplus; import gtPlusPlus.GTplusplus.INIT_PHASE; import gtPlusPlus.api.helpers.GregtechPlusPlus_API.Multiblock_API; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; -import gtPlusPlus.api.objects.data.ConcurrentHashSet; -import gtPlusPlus.api.objects.data.ConcurrentSet; -import gtPlusPlus.api.objects.data.FlexiblePair; -import gtPlusPlus.api.objects.data.Triplet; +import gtPlusPlus.api.objects.data.*; import gtPlusPlus.api.objects.minecraft.BlockPos; import gtPlusPlus.api.objects.minecraft.multi.SpecialMultiBehaviour; import gtPlusPlus.core.lib.CORE; @@ -58,11 +31,7 @@ import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.preloader.CORE_Preloader; import gtPlusPlus.preloader.asm.AsmConfig; -import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_MultiMachine; -import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_MultiMachine_NoPlayerInventory; -import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine; -import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine_Default; -import gtPlusPlus.xmod.gregtech.api.gui.GUI_Multi_Basic_Slotted; +import gtPlusPlus.xmod.gregtech.api.gui.*; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_AirIntake; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_ControlCore; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBattery; @@ -75,10 +44,19 @@ import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; +import org.apache.commons.lang3.ArrayUtils; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.*; +import java.util.concurrent.TimeUnit; + +import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls; public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_MultiBlockBase { @@ -91,13 +69,6 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult Logger.MACHINE_INFO("Found .08 findRecipe method? "+(a08 != null)); Logger.MACHINE_INFO("Found .09 findRecipe method? "+(a09 != null)); - if (CORE_Preloader.DEBUG_MODE) { - aLogger = ReflectionUtils.getMethod(Logger.class, "INFO", String.class); - } - else { - aLogger = ReflectionUtils.getMethod(Logger.class, "MACHINE_INFO", String.class); - } - try { calculatePollutionReduction = GT_MetaTileEntity_Hatch_Muffler.class.getDeclaredMethod("calculatePollutionReduction", int.class); } @@ -817,27 +788,13 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult public static Method aLogger = null; public void log(String s) { - boolean reset = false; - if (reset || aLogger == null) { - if (!AsmConfig.disableAllLogging) { - aLogger = ReflectionUtils.getMethod( - Logger.class, "INFO", String.class - ); + if (!AsmConfig.disableAllLogging) { + if (CORE_Preloader.DEBUG_MODE) { + Logger.INFO(s); + } else { + Logger.MACHINE_INFO(s); } - else { - aLogger = ReflectionUtils.getMethod( - Logger.class, "MACHINE_INFO", String.class - ); - } - } - try { - aLogger.invoke(null, s); } - catch (IllegalAccessException | IllegalArgumentException - | InvocationTargetException e) { - e.printStackTrace(); - } - } public boolean checkRecipeGeneric() { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java index c10906d433..36351cf752 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java @@ -1,11 +1,6 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.generators; import cpw.mods.fml.common.registry.GameRegistry; - -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntityFurnace; - import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.Textures; @@ -14,47 +9,45 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.objects.GT_ItemStack; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.boilers.GT_MetaTileEntity_Boiler; - -import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_AdvancedBoiler; import gtPlusPlus.xmod.gregtech.api.gui.GUI_AdvancedBoiler; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityFurnace; import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { - final private int mSteamPerSecond; - final private int mPollutionPerSecond; - final private int mBoilerTier; + private final int steamPerSecond; + private final int tier; - public GT_MetaTileEntity_Boiler_Base(int aID, String aNameRegional, int aBoilerTier) { - super(aID, "electricboiler." + aBoilerTier + ".tier.single", aNameRegional, - "Produces " + (CORE.ConfigSwitches.boilerSteamPerSecond * aBoilerTier) + "L of Steam per second"); - this.mSteamPerSecond = (CORE.ConfigSwitches.boilerSteamPerSecond * aBoilerTier); - this.mPollutionPerSecond = 20 + (15 * aBoilerTier); - this.mBoilerTier = aBoilerTier; + public GT_MetaTileEntity_Boiler_Base(int aID, String aNameRegional, int tier) { + super(aID, "electricboiler." + tier + ".tier.single", aNameRegional, + "Produces " + (CORE.ConfigSwitches.boilerSteamPerSecond * tier) + "L of Steam per second"); + this.steamPerSecond = (CORE.ConfigSwitches.boilerSteamPerSecond * tier); + this.tier = tier; } public GT_MetaTileEntity_Boiler_Base(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); - this.mSteamPerSecond = (CORE.ConfigSwitches.boilerSteamPerSecond * aTier); - this.mPollutionPerSecond = 20 + (15 * aTier); - this.mBoilerTier = aTier; + this.steamPerSecond = (CORE.ConfigSwitches.boilerSteamPerSecond * aTier); + this.tier = aTier; } @Override public String[] getDescription() { return new String[]{ this.mDescription, - "Consumes "+(mSteamPerSecond/160)+"L of water per second", - "Produces "+this.mPollutionPerSecond+" pollution/sec",}; + "Produces " + getPollution() + " pollution/sec", + "Consumes fuel only when temperature is less than 100C", + "Fuel with burn time greater than 500 is more efficient.", + "Doesn't explode if there's no water" + }; } public ITexture getOverlayIcon() { @@ -80,15 +73,11 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { } protected GT_RenderedTexture getCasingTexture() { - if (this.mBoilerTier == 1) { + if (this.tier == 1) { return new GT_RenderedTexture(Textures.BlockIcons.MACHINE_LV_SIDE); - } - else if (this.mBoilerTier == 2) { - + } else if (this.tier == 2) { return new GT_RenderedTexture(Textures.BlockIcons.MACHINE_MV_SIDE); - } - else { - + } else { return new GT_RenderedTexture(Textures.BlockIcons.MACHINE_HV_SIDE); } // return new @@ -103,7 +92,7 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { } public ITexture[] getFront(final byte aColor) { - return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mBoilerTier][aColor + 1], + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.tier][aColor + 1], this.getCasingTexture() }; } @@ -120,7 +109,7 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { } public ITexture[] getSides(final byte aColor) { - return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mBoilerTier][aColor + 1], + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.tier][aColor + 1], this.getCasingTexture() }; } @@ -156,15 +145,12 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { // Please find out what I do. // I do stuff within the GUI. - // this.mTemperature = Math.min(54, Math.max(0, this.mTemperature * 54 / - // (((GT_MetaTileEntity_Boiler) - // this.mTileEntity.getMetaTileEntity()).maxProgresstime() - 10))); + // this.mTemperature = Math.min(54, Math.max(0, this.mTemperature * 54 / (((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).maxProgresstime() - 10))); @Override public int maxProgresstime() { - return 1000 + (250 * mBoilerTier); + return 1000 + (250 * tier); } - // Electric boiler? Okay. @Override public boolean isElectric() { return false; @@ -172,7 +158,7 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { @Override public int getCapacity() { - return (16000 + (16000 * mBoilerTier)); + return (16000 + (16000 * tier)); } // This type of machine can have different water and steam capacities. @@ -182,27 +168,49 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { @Override protected int getProductionPerSecond() { - return 0; + return steamPerSecond; } @Override protected int getMaxTemperature() { - return 0; + return maxProgresstime(); } @Override protected int getEnergyConsumption() { - return 0; + return 2; } @Override protected int getCooldownInterval() { - return 0; + return 40; + } + + @Override + protected int getHeatUpRate() { + return 10; + } + + @Override + protected void updateFuel(IGregTechTileEntity tile, long ticks) { + ItemStack fuelStack = this.mInventory[2]; + if(fuelStack == null) return; + + int burnTime = getBurnTime(fuelStack); + if (burnTime > 0 && this.mTemperature <= 100) { + consumeFuel(tile, fuelStack, burnTime); + } } @Override - protected void updateFuel(IGregTechTileEntity iGregTechTileEntity, long l) { + protected void produceSteam(int aAmount) { + super.produceSteam(aAmount); + + if(mSteam.amount > getSteamCapacity()) { + sendSound(SOUND_EVENT_LET_OFF_EXCESS_STEAM); + mSteam.amount = getSteamCapacity(); + } } @Override @@ -210,18 +218,16 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { // support returning those different capacities. public FluidTankInfo[] getTankInfo(ForgeDirection aSide) { return new FluidTankInfo[]{ - new FluidTankInfo(this.mFluid, getCapacity()), - new FluidTankInfo(this.mSteam, getSteamCapacity()) + new FluidTankInfo(this.mFluid, getCapacity()), + new FluidTankInfo(this.mSteam, getSteamCapacity()) }; } - // We want automation. @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return aIndex == 1 || aIndex == 3; } - // We want automation. @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return aIndex == 2; @@ -229,7 +235,7 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { @Override protected int getPollution() { - return 0; + return 20 + (15 * tier); } @Override @@ -244,163 +250,38 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Boiler_Base(this.mName, mBoilerTier, this.mDescription, this.mTextures); + return new GT_MetaTileEntity_Boiler_Base(this.mName, tier, this.mDescription, this.mTextures); } @Override - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)) { - // Utils.LOG_MACHINE_INFO("Ticking Boiler"); - - //if (aTick % 60L == 0L) { - // Utils.LOG_MACHINE_INFO("Temp:"+this.mTemperature); - // Utils.LOG_MACHINE_INFO("getCapacity():"+this.getCapacity()); - // Utils.LOG_MACHINE_INFO("getSteamCapacity():"+this.getSteamCapacity()); - // Utils.LOG_MACHINE_INFO("maxProgresstime():"+this.maxProgresstime()); - // Utils.LOG_MACHINE_INFO("mSteamPerSecond:"+this.mSteamPerSecond); - // Utils.LOG_MACHINE_INFO("mProcessingEnergy:"+this.mProcessingEnergy); - //} - - int mTempSteam = this.mSteam != null ? this.mSteam.amount : 0; - if (this.mTemperature <= 20) { - this.mTemperature = 20; - this.mLossTimer = 0; - } - if (++this.mLossTimer > 40) { - this.mTemperature -= 1; - this.mLossTimer = 0; - } - for (byte i = 1; (this.mSteam != null) && (i < 6); i = (byte) (i + 1)) { - if (i != aBaseMetaTileEntity.getFrontFacing()) { - IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i); - if (tTileEntity != null) { - FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), - Math.max(1, this.mSteam.amount / 2), false); - if (tDrained != null) { - int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), - tDrained, false); - if (tFilledAmount > 0) { - tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity - .drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true); - } - } - } - } - } - if (aTick % 20L == 0L) { - if (this.mTemperature > 100) { - if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0)) { - this.mHadNoWater = true; - } - else { - if (this.mHadNoWater) { - aBaseMetaTileEntity.doExplosion(4096L); - return; - } - - //this.mFluid.amount -= (10 * this.mBoilerTier); - - this.mFluid.amount -= (mSteamPerSecond/160); - - Logger.MACHINE_INFO("Draining "+(mSteamPerSecond/160)+"L of water. There is "+this.mFluid.amount+"L left."); - if (this.mSteam == null) { - this.mSteam = GT_ModHandler.getSteam((this.mSteamPerSecond)); - Logger.MACHINE_INFO("Added "+(this.mSteam.amount-mTempSteam)+"L of steam."); - - } - else if (GT_ModHandler.isSteam(this.mSteam)) { - this.mSteam.amount += (this.mSteamPerSecond); - Logger.MACHINE_INFO("Added "+(this.mSteam.amount-mTempSteam)+"L of steam."); - } - else { - this.mSteam = GT_ModHandler.getSteam((this.mSteamPerSecond)); - Logger.MACHINE_INFO("Added "+(this.mSteam.amount-mTempSteam)+"L of steam."); - } - } - } - else { - this.mHadNoWater = false; - } - } - if ((this.mSteam != null) && (this.mSteam.amount > getSteamCapacity())) { - sendSound((byte) 1); - this.mSteam.amount = getSteamCapacity() * 3 / 4; - } - ItemStack fuelSlot = this.mInventory[2]; - if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && (fuelSlot != null)) { - - if (isInputFuelItem(fuelSlot) && (this.mTemperature < (maxProgresstime() - 250))) { - Logger.MACHINE_INFO("Current Heat:" + this.mTemperature + "/" + (maxProgresstime() - 250) - + " Burning fuel because not yet at a suitable temp."); - useInputFuelItem(aBaseMetaTileEntity, fuelSlot); - } - - } - - if ((this.mTemperature < maxProgresstime()) && (this.mProcessingEnergy > 0) && (aTick % 10L == 0L)) { - // Utils.LOG_MACHINE_INFO("Adding +1 Temp."); - this.mProcessingEnergy -= 2; - this.mTemperature += 1; - } - if (this.mProcessingEnergy > 0 && (aTick % 20L == 0L)) { - // Utils.LOG_MACHINE_INFO("Current Temp is at: "+this.mTemperature+"C"); - // GT_Pollution.addPollution(getBaseMetaTileEntity(), - // this.mPollutionPerSecond); - } - aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0); - } - + protected void onDangerousWaterLack(IGregTechTileEntity tile, long ticks) { + // Smart boilers don't explode! } - public boolean isInputFuelItem(ItemStack inputItem) { - int vCurrentBurnTime = 0; - vCurrentBurnTime = GameRegistry.getFuelValue(inputItem); - if (vCurrentBurnTime <= 0) { - int furnaceTime = TileEntityFurnace.getItemBurnTime(inputItem); - if (furnaceTime > 0) { - vCurrentBurnTime = furnaceTime; - } - } - if (vCurrentBurnTime > 0) { - return true; - } - else { - return false; + /** + * Returns burn time if the stack is a valid fuel, otherwise return 0. + */ + private static int getBurnTime(ItemStack stack) { + int burnTime = GameRegistry.getFuelValue(stack); + if (burnTime <= 0) { + burnTime = TileEntityFurnace.getItemBurnTime(stack); } - } - public boolean useInputFuelItem(IGregTechTileEntity aBaseMetaTileEntity, ItemStack inputItem) { - int vCurrentBurnTime = 0; - vCurrentBurnTime = GameRegistry.getFuelValue(inputItem); + return burnTime; + } - if (vCurrentBurnTime <= 0) { - int furnaceTime = TileEntityFurnace.getItemBurnTime(inputItem); - if (furnaceTime > 0) { - vCurrentBurnTime = furnaceTime; - } - } + public void consumeFuel(IGregTechTileEntity tile, ItemStack fuel, int burnTime) { + this.mProcessingEnergy += burnTime / 10; + this.mTemperature += burnTime / 500; // will add bonus temperature points if the burn time is pretty high - if (vCurrentBurnTime > 0) { - this.mProcessingEnergy += (vCurrentBurnTime / 10); - if ((vCurrentBurnTime / 500) > 0) { - this.mTemperature += (vCurrentBurnTime / 500); + tile.decrStackSize(2, 1); + if (tile.getRandomNumber(3) == 0) { + if (fuel.getDisplayName().toLowerCase().contains("charcoal") + || fuel.getDisplayName().toLowerCase().contains("coke")) { + tile.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L)); + } else { + tile.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L)); } - aBaseMetaTileEntity.decrStackSize(2, 1); - if (aBaseMetaTileEntity.getRandomNumber(3) == 0) { - if (inputItem.getDisplayName().toLowerCase().contains("charcoal") - || inputItem.getDisplayName().toLowerCase().contains("coke")) { - aBaseMetaTileEntity.addStackToSlot(3, - GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L)); - } - else { - aBaseMetaTileEntity.addStackToSlot(3, - GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L)); - } - } - return true; - } - else { - return false; } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java index a1f9ecbe78..babba5afe9 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.generators; +import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_AdvancedBoiler; +import gtPlusPlus.xmod.gregtech.api.gui.GUI_AdvancedBoiler; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.nbt.NBTTagCompound; @@ -21,7 +23,7 @@ import net.minecraftforge.fluids.IFluidHandler; public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { public GT_MetaTileEntity_Boiler_Solar(final int aID, final String aName, final String aNameRegional) { - super(aID, aName, aNameRegional, "Steam Power by the Sun", new ITexture[0]); + super(aID, aName, aNameRegional, "Steam Power by the Sun"); } public GT_MetaTileEntity_Boiler_Solar(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { @@ -56,12 +58,12 @@ extends GT_MetaTileEntity_Boiler { @Override public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity); + return new CONTAINER_AdvancedBoiler(aPlayerInventory, aBaseMetaTileEntity); } @Override public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SolarBoiler.png"); + return new GUI_AdvancedBoiler(aPlayerInventory, aBaseMetaTileEntity, "SolarBoiler.png"); } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java index e14175ad4a..e1f3767f60 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java @@ -1,7 +1,5 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced; -import java.lang.reflect.Method; - import gregtech.GT_Mod; import gregtech.api.enums.Dyes; import gregtech.api.enums.GT_Values; @@ -16,45 +14,50 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_FusionComputer; - import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; - import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; +import java.lang.reflect.Method; + public class GregtechMetaTileEntity_Adv_Fusion_MK4 extends GT_MetaTileEntity_FusionComputer { public static final Method mUpdateHatchTexture; static { mUpdateHatchTexture = ReflectionUtils.getMethod(GT_MetaTileEntity_Hatch.class, "updateTexture", int.class); - } - - public GregtechMetaTileEntity_Adv_Fusion_MK4(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional, 6); - } + } - public GregtechMetaTileEntity_Adv_Fusion_MK4(String aName) { - super(aName); - } + public GregtechMetaTileEntity_Adv_Fusion_MK4(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional, 6); + } - @Override - public int tier() { - return 9; - } + public GregtechMetaTileEntity_Adv_Fusion_MK4(String aName) { + super(aName); + } - @Override - public long maxEUStore() { - return (640010000L*4) * (Math.min(16, this.mEnergyHatches.size())) / 8L; - } + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + return new GT_Multiblock_Tooltip_Builder().addInfo(GregtechMetaTileEntity_Adv_Fusion_MK4.class.getName() + ": I don't have any info, please fix me"); + } - @Override + @Override + public int tier() { + return 9; + } + + @Override + public long maxEUStore() { + return (640010000L * 4) * (Math.min(16, this.mEnergyHatches.size())) / 8L; + } + + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GregtechMetaTileEntity_Adv_Fusion_MK4(mName); } @@ -103,17 +106,17 @@ public class GregtechMetaTileEntity_Adv_Fusion_MK4 extends GT_MetaTileEntity_Fus ITexture[] sTexture; if (aSide == aFacing) { sTexture = new ITexture[]{ - new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, - Dyes.getModulation(-1, Dyes._NULL.mRGBa)), - new GT_RenderedTexture(this.getIconOverlay())}; + new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, + Dyes.getModulation(-1, Dyes._NULL.mRGBa)), + new GT_RenderedTexture(this.getIconOverlay())}; } else if (!aActive) { sTexture = new ITexture[]{ - new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, - Dyes.getModulation(-1, Dyes._NULL.mRGBa))}; + new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, + Dyes.getModulation(-1, Dyes._NULL.mRGBa))}; } else { sTexture = new ITexture[]{ - new GT_RenderedTexture((IIconContainer) TexturesGtBlock.TEXTURE_CASING_FUSION_CASING_ULTRA, - Dyes.getModulation(-1, Dyes._NULL.mRGBa))}; + new GT_RenderedTexture(TexturesGtBlock.TEXTURE_CASING_FUSION_CASING_ULTRA, + Dyes.getModulation(-1, Dyes._NULL.mRGBa))}; } return sTexture; } @@ -339,7 +342,7 @@ public class GregtechMetaTileEntity_Adv_Fusion_MK4 extends GT_MetaTileEntity_Fus mEfficiencyIncrease = 0; if (mOutputFluids != null && mOutputFluids.length > 0) { try { - GT_Mod.instance.achievements.issueAchivementHatchFluid(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), mOutputFluids[0]); + GT_Mod.achievements.issueAchivementHatchFluid(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), mOutputFluids[0]); } catch (Exception e) { } } |