From 2214833189caf3eb262f049746be4987b97aa6a7 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Fri, 15 Dec 2017 18:15:08 +1000 Subject: More fixes pre-gtnh update (#168) $ Tree Farmer Fix (a) $ Multitank Fix. ^ Version Bump. * + Added Chainsaw support to treefarm. + Added check for creative tools to tree farm for creative testing. --- .../multi/GregtechMetaTileEntityTreeFarm.java | 77 +++++++++++----------- .../multi/GregtechMetaTileEntity_MultiTank.java | 4 +- 2 files changed, 40 insertions(+), 41 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/tileentities') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityTreeFarm.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityTreeFarm.java index eccc96c253..6d951b7221 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityTreeFarm.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityTreeFarm.java @@ -15,10 +15,7 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; -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_MultiBlockBase; +import gregtech.api.metatileentity.implementations.*; import gregtech.api.objects.GT_ItemStack; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; @@ -35,6 +32,7 @@ import gtPlusPlus.core.util.particles.BlockBreakParticles; import gtPlusPlus.xmod.forestry.trees.TreefarmManager; import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_TreeFarmer; import gtPlusPlus.xmod.gregtech.api.gui.GUI_TreeFarmer; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.helpers.TreeFarmHelper; import net.minecraft.block.Block; @@ -48,7 +46,7 @@ import net.minecraft.server.MinecraftServer; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; -public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlockBase { +public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase { /* private */ private int treeCheckTicks = 0; /* private */ private int plantSaplingTicks = 0; @@ -102,10 +100,10 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock @Override public void saveNBTData(final NBTTagCompound aNBT) { - + Utils.LOG_INFO("Called NBT data save"); aNBT.setLong("mInternalPower", this.mInternalPower); - + //Save [Buzz]Saw final NBTTagList list = new NBTTagList(); for(int i = 0;i<2;i++){ @@ -119,14 +117,14 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock } } aNBT.setTag("Items", list); - + super.saveNBTData(aNBT); } @Override public void loadNBTData(final NBTTagCompound aNBT) { this.mInternalPower = aNBT.getLong("mInternalPower"); - + //Load [Buzz]Saw final NBTTagList list = aNBT.getTagList("Items", 10); for(int i = 0;i(); this.mEnergyHatches = new ArrayList<>(); - this.canChop = this.checkMachine(aBaseMetaTileEntity, this.mInventory[1]); + if (aBaseMetaTileEntity != null && this.mInventory[1] != null){ + this.canChop = this.checkMachine(aBaseMetaTileEntity, this.mInventory[1]); + } } } } @@ -989,7 +986,9 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock //Call Cleanup Task last, before ticking. if (this.cleanupTicks == 600){ - this.checkMachine(aBaseMetaTileEntity, this.mInventory[1]); + if (aBaseMetaTileEntity != null && this.mInventory[1] != null){ + this.checkMachine(aBaseMetaTileEntity, this.mInventory[1]); + } /*Utils.LOG_MACHINE_INFO("Looking For rubbish to cleanup - Serverside | "+this.cleanupTicks); TreeFarmHelper.cleanUp(aBaseMetaTileEntity);*/ } @@ -1002,7 +1001,7 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock } - //@Deprecated + //@Deprecated //public static boolean damageOrDechargeItem(ItemStack aStack, int aDamage, int aDecharge, EntityLivingBase aPlayer) { // if ((GT_Utility.isStackInvalid(aStack)) || ((aStack.getMaxStackSize() <= 1) && (aStack.stackSize > 1))) // return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MultiTank.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MultiTank.java index b908e5439c..b8f2535b1f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MultiTank.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MultiTank.java @@ -172,7 +172,7 @@ extends GregtechMeta_MultiBlockBase { public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); - if (this.internalStorageTank.amount >= this.maximumFluidStorage){ + if ((this.internalStorageTank != null) && this.internalStorageTank.amount >= this.maximumFluidStorage){ if (this.internalStorageTank.amount > this.maximumFluidStorage){ this.internalStorageTank.amount = this.maximumFluidStorage; } @@ -589,4 +589,4 @@ extends GregtechMeta_MultiBlockBase { this.getBaseMetaTileEntity().markDirty();*/ return true; } -} +} \ No newline at end of file -- cgit From 5715a32d2901922503fd850f3a68503fb77467c3 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Wed, 20 Dec 2017 23:39:49 +1000 Subject: - Disabled some logging. % Minor Project Clean-up, added missing Override annotations to 100+ methods & removed pointless casts. % Moved Logging to it's own class. $ Fixed Multi-block handling of Pollution. $ Fixed the GT 5.09 material enabler system. (From My Side, it's still borked on GTs). + Added a Dynamic Proxy invocation for IMaterialHandler. + Added an AutoMap data type, which is a Auto-incremental ID'd Hashmap wrapper. --- .../GT_MetaTileEntity_TesseractGenerator.java | 18 +-- .../generators/GT_MetaTileEntity_Boiler_Base.java | 4 +- .../GT_MetaTileEntity_SemiFluidGenerator.java | 25 +++- .../GregtechMetaTileEntitySolarGenerator.java | 8 +- .../generators/GregtechMetaTileEntity_RTG.java | 10 +- .../basic/GT_MetaTileEntity_WorldAccelerator.java | 14 +-- .../GregtechMetaAtmosphericReconditioner.java | 28 ++--- .../basic/GregtechMetaPollutionCreator.java | 3 +- .../basic/GregtechMetaPollutionDetector.java | 4 +- ...regtechMetaTileEntity_CompactFusionReactor.java | 61 +++++---- .../machines/multi/GT4Entity_AutoCrafter.java | 18 +-- .../machines/multi/GT4Entity_ThermalBoiler.java | 4 +- .../machines/multi/GregtechMTE_NuclearReactor.java | 96 +++++++------- .../multi/GregtechMetaTileEntityAnimalFarm.java | 60 ++++----- .../GregtechMetaTileEntityGeneratorArray.java | 41 +++--- .../multi/GregtechMetaTileEntityTreeFarm.java | 139 ++++++++++----------- .../GregtechMetaTileEntity_AlloyBlastSmelter.java | 6 +- .../GregtechMetaTileEntity_CatalyticReactor.java | 54 ++++---- .../multi/GregtechMetaTileEntity_Cyclotron.java | 26 ++-- ...regtechMetaTileEntity_IndustrialCentrifuge.java | 38 +++--- .../GregtechMetaTileEntity_IndustrialCokeOven.java | 14 +-- ...echMetaTileEntity_IndustrialCuttingMachine.java | 20 +-- ...gtechMetaTileEntity_IndustrialElectrolyzer.java | 4 +- ...GregtechMetaTileEntity_IndustrialMacerator.java | 22 ++-- ...regtechMetaTileEntity_IndustrialPlatePress.java | 4 +- .../GregtechMetaTileEntity_IndustrialSifter.java | 82 ++++++------ .../GregtechMetaTileEntity_IndustrialSinter.java | 22 ++-- ...MetaTileEntity_IndustrialThermalCentrifuge.java | 34 ++--- ...GregtechMetaTileEntity_IndustrialWashPlant.java | 32 ++--- .../GregtechMetaTileEntity_IndustrialWireMill.java | 22 ++-- .../GregtechMetaTileEntity_MassFabricator.java | 56 ++++----- .../multi/GregtechMetaTileEntity_MultiTank.java | 73 ++++++----- ...chMetaTileEntity_PowerSubStationController.java | 79 ++++++------ .../multi/GregtechMetaTileEntity_Refinery.java | 52 ++++---- .../storage/GregtechMetaEnergyBuffer.java | 6 +- 35 files changed, 599 insertions(+), 580 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/tileentities') 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 8a0248e85c..0208fcbd49 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 @@ -13,8 +13,8 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Config; import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.player.PlayerUtils; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.helpers.tesseract.TesseractHelper; @@ -199,7 +199,7 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi final float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ); switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + (2 * (byte) (int) (tCoords[1] * 2.0F)))) { case 0: - Utils.LOG_WARNING("Freq. -1 | " + this.mFrequency); + Logger.WARNING("Freq. -1 | " + this.mFrequency); try { CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency); } catch (Throwable t) { @@ -208,7 +208,7 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi break; case 1: - Utils.LOG_WARNING("Freq. +1 | " + this.mFrequency); + Logger.WARNING("Freq. +1 | " + this.mFrequency); try { CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency); } catch (Throwable t) { @@ -557,21 +557,21 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi // Set owner if (PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName()) != null) { if (this.mOwner == null) { - Utils.LOG_WARNING("Setting Generators Owner. 1"); + Logger.WARNING("Setting Generators Owner. 1"); this.mOwner = PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName()); } } if (this.mFrequency != this.oFrequency) { - Utils.LOG_WARNING("mFreq != oFreq"); + Logger.WARNING("mFreq != oFreq"); if (getGeneratorEntity() == this) { getGeneratorEntity(this.oFrequency); this.getBaseMetaTileEntity().issueBlockUpdate(); - Utils.LOG_WARNING("this Gen == oFreq on map - do block update"); + Logger.WARNING("this Gen == oFreq on map - do block update"); } - Utils.LOG_WARNING("mFreq will be set to oFreq"); + Logger.WARNING("mFreq will be set to oFreq"); this.oFrequency = this.mFrequency; } if ((this.getBaseMetaTileEntity().isAllowedToWork()) @@ -586,7 +586,7 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi } } else { if (getGeneratorEntity(Integer.valueOf(this.mFrequency)) == this) { - Utils.LOG_WARNING("this gen == mFreq on map - do block update"); + Logger.WARNING("this gen == mFreq on map - do block update"); TesseractHelper.removeGenerator(PlayerUtils.getPlayerOnServerFromUUID(mOwner), this.mFrequency); this.getBaseMetaTileEntity().issueBlockUpdate(); } @@ -700,7 +700,7 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi if (this.getBaseMetaTileEntity().getOwnerName() != null && !this.getBaseMetaTileEntity().getOwnerName().equals("")) { this.mOwner = PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName()); - Utils.LOG_WARNING("Setting Generators Owner. 2"); + Logger.WARNING("Setting Generators Owner. 2"); } super.onCreated(aStack, aWorld, aPlayer); } 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 8c89b96adf..4363e57ad3 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 @@ -8,8 +8,8 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.*; import gregtech.common.tileentities.boilers.GT_MetaTileEntity_Boiler; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_AdvancedBoiler; import gtPlusPlus.xmod.gregtech.api.gui.GUI_AdvancedBoiler; import net.minecraft.entity.player.InventoryPlayer; @@ -265,7 +265,7 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && (fuelSlot != null)) { if (isInputFuelItem(fuelSlot) && (this.mTemperature < (maxProgresstime() - 250))) { - Utils.LOG_INFO("Current Heat:" + this.mTemperature + "/" + (maxProgresstime() - 250) + Logger.INFO("Current Heat:" + this.mTemperature + "/" + (maxProgresstime() - 250) + " Burning fuel because not yet at a suitable temp."); useInputFuelItem(aBaseMetaTileEntity, fuelSlot); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java index b9fd375fdd..086b8d291f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java @@ -2,17 +2,13 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.generators; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; -import gregtech.api.enums.ConfigCategories; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Textures; +import gregtech.api.enums.*; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.*; import gtPlusPlus.core.lib.CORE; import net.minecraft.item.ItemStack; @@ -38,10 +34,12 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi onConfigLoad(); } + @Override public int getPollution() { return (int) (2.0D * Math.pow(2.0D, this.mTier)); } + @Override public int getCapacity() { return 8000; } @@ -51,10 +49,12 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi "SemiFluidGenerator.efficiency.tier." + this.mTier, 100 - (this.mTier * 10)); } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_SemiFluidGenerator(this.mName, this.mTier, this.mDescription, this.mTextures); } + @Override public GT_Recipe.GT_Recipe_Map getRecipes() { return GT_Recipe.GT_Recipe_Map.sDenseLiquidFuels; } @@ -64,14 +64,17 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi return new String[]{this.mDescription, "Produces "+(this.getPollution()*20)+" pollution/sec", "Fuel Efficiency: "+this.getEfficiency() + "%", CORE.GT_Tooltip}; } + @Override public int getEfficiency() { return this.mEfficiency; } + @Override public boolean isOutputFacing(byte aSide) { return (aSide == getBaseMetaTileEntity().getFrontFacing()); } + @Override public int getFuelValue(ItemStack aStack) { if ((GT_Utility.isStackInvalid(aStack)) || (getRecipes() == null)) return 0; @@ -82,53 +85,63 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi return rValue; } + @Override public ITexture[] getFront(byte aColor) { return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; } + @Override public ITexture[] getBack(byte aColor) { return new ITexture[] { super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK) }; } + @Override public ITexture[] getBottom(byte aColor) { return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM) }; } + @Override public ITexture[] getTop(byte aColor) { return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP) }; } + @Override public ITexture[] getSides(byte aColor) { return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE) }; } + @Override public ITexture[] getFrontActive(byte aColor) { return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; } + @Override public ITexture[] getBackActive(byte aColor) { return new ITexture[] { super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK_ACTIVE) }; } + @Override public ITexture[] getBottomActive(byte aColor) { return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM_ACTIVE) }; } + @Override public ITexture[] getTopActive(byte aColor) { return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP_ACTIVE) }; } + @Override public ITexture[] getSidesActive(byte aColor) { return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE) }; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java index a268ade81e..2f1daa4bdf 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java @@ -9,7 +9,7 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.objects.GT_RenderedTexture; -import gtPlusPlus.core.util.Utils; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_SolarGenerator; import gtPlusPlus.xmod.gregtech.api.gui.GUI_SolarGenerator; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators.GregtechMetaSolarGenerator; @@ -70,7 +70,7 @@ public class GregtechMetaTileEntitySolarGenerator extends GregtechMetaSolarGener if ((aTick % 10L) == 0L) { - Utils.LOG_WARNING("getUniversalEnergyStored: "+aBaseMetaTileEntity.getUniversalEnergyStored() + " maxEUOutput * 20 + getMinimumStoredEU: " + ((this.maxEUOutput() * 20) + this.getMinimumStoredEU())); + Logger.WARNING("getUniversalEnergyStored: "+aBaseMetaTileEntity.getUniversalEnergyStored() + " maxEUOutput * 20 + getMinimumStoredEU: " + ((this.maxEUOutput() * 20) + this.getMinimumStoredEU())); if ((this.mSolarCharge > 100) && (aBaseMetaTileEntity.isAllowedToWork()) && (!aBaseMetaTileEntity.getWorld().isThundering()) && @@ -80,13 +80,13 @@ public class GregtechMetaTileEntitySolarGenerator extends GregtechMetaSolarGener } if ((this.mSolarCharge < 500) && (this.mProcessingEnergy != 0) && ((aTick % 32L) == 0L)) { - Utils.LOG_WARNING("Adding Solar Charge. Currently "+this.mSolarCharge); + Logger.WARNING("Adding Solar Charge. Currently "+this.mSolarCharge); this.mProcessingEnergy -= 1; this.mSolarCharge += 1; } if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && ((aTick % 64L) == 0L) && (!aBaseMetaTileEntity.getWorld().isThundering())) { - Utils.LOG_WARNING("Adding Processing Energy. Currently "+this.mProcessingEnergy); + Logger.WARNING("Adding Processing Energy. Currently "+this.mProcessingEnergy); final boolean bRain = aBaseMetaTileEntity.getWorld().isRaining() && (aBaseMetaTileEntity.getBiome().rainfall > 0.0F); this.mProcessingEnergy += (bRain && (aBaseMetaTileEntity.getWorld().skylightSubtracted >= 4)) || !aBaseMetaTileEntity.getSkyAtSide((byte) 1) ? 0 : !bRain && aBaseMetaTileEntity.getWorld().isDaytime() ? 8 : 1; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java index cb97771901..fd17c1d663 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java @@ -7,9 +7,9 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.*; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.PollutionUtils; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; @@ -334,22 +334,22 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator this.mNewTier = mTier2; //ReflectionUtils.setFinalStatic(mTier2, GT_Values.V[0]); } catch (Exception e) { - Utils.LOG_INFO("Failed setting mTier."); + Logger.INFO("Failed setting mTier."); e.printStackTrace(); } this.mTicksToBurnFor = getTotalEUGenerated(convertDaysToTicks(tFuel.mSpecialValue), voltage); if (mTicksToBurnFor >= Integer.MAX_VALUE){ mTicksToBurnFor = Integer.MAX_VALUE; - Utils.LOG_INFO("Fuel went over Int limit, setting to MAX_VALUE."); + Logger.INFO("Fuel went over Int limit, setting to MAX_VALUE."); } this.mDaysRemaining = MathUtils.roundToClosestInt(mTicksToBurnFor/20/60/3); - Utils.LOG_INFO("step | "+(int) (mTicksToBurnFor * getEfficiency() / 100L)); + Logger.INFO("step | "+(int) (mTicksToBurnFor * getEfficiency() / 100L)); return (int) (mTicksToBurnFor * getEfficiency() / 100L); //return (int) (tFuel.mSpecialValue * 365L * getEfficiency() / 100L); //return tFuel.mEUt; } - Utils.LOG_INFO("Not sure"); + Logger.INFO("Not sure"); return 0; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_WorldAccelerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_WorldAccelerator.java index e0f94036a7..da3b8aa551 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_WorldAccelerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_WorldAccelerator.java @@ -13,8 +13,8 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; import gregtech.api.objects.GT_RenderedTexture; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.player.PlayerUtils; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; @@ -213,8 +213,8 @@ public class GT_MetaTileEntity_WorldAccelerator extends GT_MetaTileEntity_Tiered } } } catch (Exception e) { - Utils.LOG_ERROR("GT_MetaTileEntity_WorldAccelerator.onPostTick.crash"); - Utils.LOG_ERROR(e.getMessage()); + Logger.ERROR("GT_MetaTileEntity_WorldAccelerator.onPostTick.crash"); + Logger.ERROR(e.getMessage()); } } @@ -236,8 +236,8 @@ public class GT_MetaTileEntity_WorldAccelerator extends GT_MetaTileEntity_Tiered } } } catch (Exception e) { - Utils.LOG_ERROR("GT_MetaTileEntity_WorldAccelerator.doAccelerateTileEntities.crash"); - Utils.LOG_ERROR(e.getMessage()); + Logger.ERROR("GT_MetaTileEntity_WorldAccelerator.doAccelerateTileEntities.crash"); + Logger.ERROR(e.getMessage()); } } @@ -316,8 +316,8 @@ public class GT_MetaTileEntity_WorldAccelerator extends GT_MetaTileEntity_Tiered tBlock.updateTick(pWorld, pX, pY, pZ, pRnd); } } catch (Exception e) { - Utils.LOG_ERROR("GT_MetaTileEntity_WorldAccelerator.tryTickBlock.crash"); - Utils.LOG_ERROR(e.getMessage()); + Logger.ERROR("GT_MetaTileEntity_WorldAccelerator.tryTickBlock.crash"); + Logger.ERROR(e.getMessage()); } } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java index 69892ea995..b99ce19031 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java @@ -12,10 +12,10 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; import gregtech.common.items.GT_MetaGenerated_Tool_01; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.general.ItemAirFilter; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.PollutionUtils; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.api.gui.basic.CONTAINER_PollutionCleaner; import gtPlusPlus.xmod.gregtech.api.gui.basic.GUI_PollutionCleaner; @@ -158,7 +158,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi //Use a Turbine if(hasRotor(stackRotor) && hasAirFilter(stackFilter)){ - Utils.LOG_WARNING("Found Turbine."); + Logger.WARNING("Found Turbine."); mBaseEff = (int) ((50.0F + (10.0F * ((GT_MetaGenerated_Tool) stackRotor.getItem()).getToolCombatDamage(stackRotor))) * 100); mOptimalAirFlow = (int) Math.max(Float.MIN_NORMAL, ((GT_MetaGenerated_Tool) stackRotor.getItem()).getToolStats(stackRotor).getSpeedMultiplier() * GT_MetaGenerated_Tool.getPrimaryMaterial(stackRotor).mToolSpeed * 50); @@ -168,8 +168,8 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi //Utils.LOG_WARNING("Pollution Cleaner [5]"); //Log Debug information. - Utils.LOG_WARNING("mBaseEff[1]:"+mBaseEff); - Utils.LOG_WARNING("mOptimalAirFlow[1]:"+mOptimalAirFlow); + Logger.WARNING("mBaseEff[1]:"+mBaseEff); + Logger.WARNING("mOptimalAirFlow[1]:"+mOptimalAirFlow); //Calculate The Voltage we are running long tVoltage = maxEUInput(); @@ -182,7 +182,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi //If no sides are free, how will you process the atmosphere? if (mAirSides > 0){ mPollutionReduction += (((mTier*2)*100)*mAirSides); //Was originally *100 - Utils.LOG_WARNING("mPollutionReduction[1]:"+mPollutionReduction); + Logger.WARNING("mPollutionReduction[1]:"+mPollutionReduction); //I stole this code mPollutionReduction = (MathUtils.safeInt((long)mPollutionReduction*this.mBaseEff)/100000)*mAirSides; @@ -193,7 +193,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi //Set a temp to remove variable to aleviate duplicate code. int toRemove = 0; - Utils.LOG_WARNING("mCurrentPollution[4]:"+mCurrentPollution); + Logger.WARNING("mCurrentPollution[4]:"+mCurrentPollution); if (mPollutionReduction <= mCurrentPollution){ //Clean some Air. toRemove = mPollutionReduction; @@ -207,10 +207,10 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi if (toRemove > 0){ if (damageTurbineRotor() && damageAirFilter()){ removePollution(toRemove); - Utils.LOG_WARNING("mNewPollution[4]:"+getCurrentChunkPollution()); + Logger.WARNING("mNewPollution[4]:"+getCurrentChunkPollution()); } else { - Utils.LOG_WARNING("Could not damage turbine rotor or Air Filter."); + Logger.WARNING("Could not damage turbine rotor or Air Filter."); aBaseMetaTileEntity.setActive(false); } } //End of pollution removal block. @@ -271,16 +271,16 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi } } - Utils.LOG_WARNING("Trying to do "+damageValue+" damage to the rotor."); + Logger.WARNING("Trying to do "+damageValue+" damage to the rotor."); //Damage Rotor //int rotorDurability = this.mInventory[this.SLOT_ROTOR].getItemDamage(); long rotorDamage = GT_MetaGenerated_Tool.getToolDamage(this.mInventory[this.SLOT_ROTOR]); long rotorDurabilityMax = GT_MetaGenerated_Tool.getToolMaxDamage(this.mInventory[this.SLOT_ROTOR]); long rotorDurability = (rotorDurabilityMax - rotorDamage); - Utils.LOG_WARNING("Rotor Damage: "+rotorDamage + " | Max Durability: "+rotorDurabilityMax+" | "+" Remaining Durability: "+rotorDurability); + Logger.WARNING("Rotor Damage: "+rotorDamage + " | Max Durability: "+rotorDurabilityMax+" | "+" Remaining Durability: "+rotorDurability); if (rotorDurability > damageValue){ - Utils.LOG_WARNING("Damaging Rotor."); + Logger.WARNING("Damaging Rotor."); GT_ModHandler.damageOrDechargeItem(this.mInventory[this.SLOT_ROTOR], (int) damageValue, 0, null); long tempDur = GT_MetaGenerated_Tool.getToolDamage(this.mInventory[this.SLOT_ROTOR]); @@ -293,14 +293,14 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi } if (rotorDurability <= 0) { - Utils.LOG_WARNING("Destroying Rotor."); + Logger.WARNING("Destroying Rotor."); this.mInventory[this.SLOT_ROTOR] = null; return false; } }else { - Utils.LOG_WARNING("Bad Rotor."); + Logger.WARNING("Bad Rotor."); return false; } } @@ -369,7 +369,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi else { //Do Damage ItemAirFilter.setFilterDamage(filter, currentUse+1); - Utils.LOG_WARNING("Filter Damage: "+currentUse); + Logger.WARNING("Filter Damage: "+currentUse); return true; } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java index 77f139ccd8..d6286fb409 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java @@ -6,6 +6,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.PollutionUtils; import gtPlusPlus.core.util.Utils; @@ -394,7 +395,7 @@ public class GregtechMetaPollutionCreator extends GregtechMetaTileEntity { else { returnValue = getCurrentChunkPollution(); } - Utils.LOG_INFO("| DEBUG: "+returnValue +" | ArrayPos:"+this.mArrayPos+" | Counter:"+counter+" | Total:"+total+" |"); + Logger.INFO("| DEBUG: "+returnValue +" | ArrayPos:"+this.mArrayPos+" | Counter:"+counter+" | Total:"+total+" |"); return returnValue; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java index 677f0342a1..53c66a0425 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java @@ -6,6 +6,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.PollutionUtils; import gtPlusPlus.core.util.Utils; @@ -404,7 +405,7 @@ public class GregtechMetaPollutionDetector extends GregtechMetaTileEntity { else { returnValue = getCurrentChunkPollution(); } - Utils.LOG_INFO("| DEBUG: "+returnValue +" | ArrayPos:"+this.mArrayPos+" | Counter:"+counter+" | Total:"+total+" |"); + Logger.INFO("| DEBUG: "+returnValue +" | ArrayPos:"+this.mArrayPos+" | Counter:"+counter+" | Total:"+total+" |"); return returnValue; } @@ -434,6 +435,7 @@ public class GregtechMetaPollutionDetector extends GregtechMetaTileEntity { super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); } + @Override public boolean allowGeneralRedstoneOutput() { if (this.getCurrentChunkPollution() >= this.mRedstoneLevel){ this.markDirty(); 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 dc28b6b761..f739e73c26 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 @@ -9,11 +9,9 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import gregtech.api.util.Recipe_GT; +import gregtech.api.util.*; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_DeluxeMachine; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -147,16 +145,16 @@ GT_MetaTileEntity_DeluxeMachine { long mFusionPoint = 20000000L; @Override public int checkRecipe() { - Utils.LOG_WARNING("Recipe Tick 1."); + Logger.WARNING("Recipe Tick 1."); if (!this.mCanProcessRecipe) { - Utils.LOG_WARNING("Recipe Tick 1.1 - Cannot Process Recipe."); + Logger.WARNING("Recipe Tick 1.1 - Cannot Process Recipe."); if (this.mChargeConsumed < mFusionPoint) { - Utils.LOG_WARNING("Recipe Tick 1.2 - Cannot Ignite Fusion, Charge too low."); + Logger.WARNING("Recipe Tick 1.2 - Cannot Ignite Fusion, Charge too low."); this.mCharging = true; this.mCanProcessRecipe = false; if (this.getBaseMetaTileEntity().decreaseStoredEnergyUnits( (mFusionPoint / 100), false)) { - Utils.LOG_WARNING("Recipe Tick 1.3 - Charging Internal storage. "+(mFusionPoint / 100)+"/"+mFusionPoint); + Logger.WARNING("Recipe Tick 1.3 - Charging Internal storage. "+(mFusionPoint / 100)+"/"+mFusionPoint); mChargeConsumed += (mFusionPoint / 100); } } else { @@ -166,13 +164,13 @@ GT_MetaTileEntity_DeluxeMachine { } } else { - Utils.LOG_WARNING("Recipe Tick 1.1 - Try to Process Recipe."); + Logger.WARNING("Recipe Tick 1.1 - Try to Process Recipe."); if (checkRecipeMulti()) { - Utils.LOG_WARNING("Recipe Tick 1.2 - Process Recipe was Successful."); + Logger.WARNING("Recipe Tick 1.2 - Process Recipe was Successful."); return 2; } } - Utils.LOG_WARNING("Recipe Tick 2. - Process Recipe failed."); + Logger.WARNING("Recipe Tick 2. - Process Recipe failed."); return 0; } @@ -188,11 +186,11 @@ GT_MetaTileEntity_DeluxeMachine { int tFluidList_sS = tFluidList.size(); for (int i = 0; i < tFluidList_sS - 1; i++) { for (int j = i + 1; j < tFluidList_sS; j++) { - if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), - (FluidStack) tFluidList.get(j))) { - if (((FluidStack) tFluidList - .get(i)).amount >= ((FluidStack) tFluidList - .get(j)).amount) { + if (GT_Utility.areFluidsEqual(tFluidList.get(i), + tFluidList.get(j))) { + if (tFluidList + .get(i).amount >= tFluidList + .get(j).amount) { tFluidList.remove(j--); tFluidList_sS = tFluidList.size(); } else { @@ -435,22 +433,22 @@ GT_MetaTileEntity_DeluxeMachine { long aTick) { //super.onPostTick(aBaseMetaTileEntity, aTick); if (aBaseMetaTileEntity.isServerSide()) { - Utils.LOG_WARNING("1"); + Logger.WARNING("1"); if (mEfficiency < 0) mEfficiency = 0; if (mRunningOnLoad) { - Utils.LOG_WARNING("2"); + Logger.WARNING("2"); this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU(); checkRecipeMulti(); } if (--mUpdate == 0 || --mStartUpCheck == 0) { - Utils.LOG_WARNING("3"); + Logger.WARNING("3"); mMachine = true; } if (mStartUpCheck < 0) { - Utils.LOG_WARNING("4"); + Logger.WARNING("4"); if (mMachine) { - Utils.LOG_WARNING("5"); + Logger.WARNING("5"); if (aBaseMetaTileEntity.getStoredEU() + (2048 * tierOverclock()) < maxEUStore()) { @@ -458,12 +456,12 @@ GT_MetaTileEntity_DeluxeMachine { 2048 * tierOverclock(), true); } if (this.mEUStore <= 0 && mMaxProgresstime > 0) { - Utils.LOG_WARNING("6"); + Logger.WARNING("6"); stopMachine(); this.mLastRecipe = null; } if (mMaxProgresstime > 0) { - Utils.LOG_WARNING("7"); + Logger.WARNING("7"); this.getBaseMetaTileEntity() .decreaseStoredEnergyUnits(mEUt, true); if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime) { @@ -485,21 +483,21 @@ GT_MetaTileEntity_DeluxeMachine { checkRecipeMulti(); } } else { - Utils.LOG_WARNING("8"); + Logger.WARNING("8"); if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity .hasInventoryBeenModified()) { - Utils.LOG_WARNING("9"); + Logger.WARNING("9"); // turnCasingActive(mMaxProgresstime > 0); if (aBaseMetaTileEntity.isAllowedToWork()) { - Utils.LOG_WARNING("10"); + Logger.WARNING("10"); this.mEUStore = (int) aBaseMetaTileEntity .getStoredEU(); if (checkRecipeMulti()) { - Utils.LOG_WARNING("11"); + Logger.WARNING("11"); if (this.mEUStore < this.mLastRecipe.mSpecialValue) { - Utils.LOG_WARNING("12"); + Logger.WARNING("12"); mMaxProgresstime = 0; // turnCasingActive(false); } @@ -515,12 +513,12 @@ GT_MetaTileEntity_DeluxeMachine { } } else { // turnCasingActive(false); - Utils.LOG_WARNING("Bad"); + Logger.WARNING("Bad"); this.mLastRecipe = null; stopMachine(); } } - Utils.LOG_WARNING("Good"); + Logger.WARNING("Good"); aBaseMetaTileEntity.setActive(mMaxProgresstime > 0); } } @@ -605,19 +603,16 @@ GT_MetaTileEntity_DeluxeMachine { @Override public int fill(FluidStack aFluid, boolean doFill) { - // TODO Auto-generated method stub return super.fill(aFluid, doFill); } @Override public FluidStack drain(int maxDrain, boolean doDrain) { - // TODO Auto-generated method stub return super.drain(maxDrain, doDrain); } @Override public int getTankPressure() { - // TODO Auto-generated method stub return 500; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GT4Entity_AutoCrafter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GT4Entity_AutoCrafter.java index 3dee1df0f0..777310ef0f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GT4Entity_AutoCrafter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GT4Entity_AutoCrafter.java @@ -13,10 +13,10 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockB import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.array.ArrayUtils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.nbt.NBTUtils; @@ -178,12 +178,12 @@ extends GT_MetaTileEntity_MultiBlockBase final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j); if (!this.addToMachineList(tTileEntity, TAE.GTPP_INDEX(28))) { if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasings2Misc) { - Utils.LOG_WARNING("Bad Block. Found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) .getLocalizedName()); - Utils.LOG_WARNING("Block Found at x:"+(aBaseMetaTileEntity.getXCoord()+xDir+i)+" | y:"+(aBaseMetaTileEntity.getYCoord()+h)+" | z:"+(aBaseMetaTileEntity.getZCoord()+zDir+j)); + Logger.WARNING("Bad Block. Found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) .getLocalizedName()); + Logger.WARNING("Block Found at x:"+(aBaseMetaTileEntity.getXCoord()+xDir+i)+" | y:"+(aBaseMetaTileEntity.getYCoord()+h)+" | z:"+(aBaseMetaTileEntity.getZCoord()+zDir+j)); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 12) { - Utils.LOG_WARNING("Bad Meta."); + Logger.WARNING("Bad Meta."); return false; } ++tAmount; @@ -197,8 +197,8 @@ extends GT_MetaTileEntity_MultiBlockBase (this.mInputBusses.size() == 0) || (this.mOutputBusses.size() == 0) || (this.mMufflerHatches.size() != 1) || (this.mMaintenanceHatches.size() != 1) || (this.mEnergyHatches.size() == 0)){ - Utils.LOG_WARNING("Wrong Hatch count."); - Utils.LOG_WARNING("|"+this.mInputHatches.size()+ + Logger.WARNING("Wrong Hatch count."); + Logger.WARNING("|"+this.mInputHatches.size()+ "|"+this.mOutputHatches.size()+ "|"+this.mInputBusses.size()+ "|"+this.mOutputBusses.size()+ @@ -394,7 +394,7 @@ extends GT_MetaTileEntity_MultiBlockBase } //Return if no input hatch set. if (craftingInput == null){ - Utils.LOG_WARNING("Cannot do Auto-Crafting without a 9-slot Input Bus [MV]."); + Logger.WARNING("Cannot do Auto-Crafting without a 9-slot Input Bus [MV]."); return false; } @@ -458,7 +458,7 @@ extends GT_MetaTileEntity_MultiBlockBase this.mEUt = 8 * (1 << this.mTier - 1) * (1 << this.mTier - 1); this.mMaxProgresstime = MathUtils.roundToClosestInt((50-(5*MathUtils.randDouble(((this.mTier-2) <= 0 ? 1 : (this.mTier-2)), this.mTier)))); - Utils.LOG_WARNING("MPT: "+mMaxProgresstime+" | "+mEUt); + Logger.WARNING("MPT: "+mMaxProgresstime+" | "+mEUt); this.getBaseMetaTileEntity().setActive(true); //Setup some vars @@ -494,7 +494,7 @@ extends GT_MetaTileEntity_MultiBlockBase mCorrectInputs++; } else { - Utils.LOG_WARNING("Input in Slot "+mCorrectInputs+" was not valid."); + Logger.WARNING("Input in Slot "+mCorrectInputs+" was not valid."); } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GT4Entity_ThermalBoiler.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GT4Entity_ThermalBoiler.java index f7940e3d68..98f3d92980 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GT4Entity_ThermalBoiler.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GT4Entity_ThermalBoiler.java @@ -7,10 +7,10 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.*; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.general.ItemLavaFilter; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; @@ -55,7 +55,7 @@ extends GT_MetaTileEntity_MultiBlockBase @Override public int getDamageToComponent(ItemStack aStack){ - Utils.LOG_INFO("Trying to damage component."); + Logger.INFO("Trying to damage component."); return ItemList.Component_LavaFilter.get(1L).getClass().isInstance(aStack) ? 1 : 0; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java index cc8f25869c..c95a91a724 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java @@ -13,12 +13,12 @@ import gregtech.api.objects.GT_ItemStack; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.Recipe_GT; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.ELEMENT; import gtPlusPlus.core.material.nuclear.FLUORIDES; import gtPlusPlus.core.material.nuclear.NUCLIDE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.fluid.FluidUtils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine; @@ -166,12 +166,12 @@ public class GregtechMTE_NuclearReactor extends GT_MetaTileEntity_MultiBlockBase //If not a hatch, continue, else add hatch and continue. if ((!this.addMufflerToMachineList(tTileEntity, TAE.GTPP_INDEX(12))) && (!this.addOutputToMachineList(tTileEntity, TAE.GTPP_INDEX(12))) && (!this.addDynamoToMachineList(tTileEntity, TAE.GTPP_INDEX(12)))) { if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) { - Utils.LOG_INFO("Hastelloy-N Reactor Casing(s) Missing from one of the top layers inner 3x3."); - Utils.LOG_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); + Logger.INFO("Hastelloy-N Reactor Casing(s) Missing from one of the top layers inner 3x3."); + Logger.INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 12) { - Utils.LOG_INFO("Hastelloy-N Reactor Casing(s) Missing from one of the top layers inner 3x3. Wrong Meta for Casing."); + Logger.INFO("Hastelloy-N Reactor Casing(s) Missing from one of the top layers inner 3x3. Wrong Meta for Casing."); return false; } } @@ -183,7 +183,7 @@ public class GregtechMTE_NuclearReactor extends GT_MetaTileEntity_MultiBlockBase // Reactor Inner 5x5 //if ((i != -1 && i != 1) && (j != -1 && j != 1)) { if (!aBaseMetaTileEntity.getAirOffset(xDir + i, h, zDir + j)) { - Utils.LOG_INFO("Make sure the inner 3x3 of the Multiblock is Air."); + Logger.INFO("Make sure the inner 3x3 of the Multiblock is Air."); return false; } @@ -211,13 +211,13 @@ public class GregtechMTE_NuclearReactor extends GT_MetaTileEntity_MultiBlockBase //Deal with all 4 sides (Reactor walls) if ((h == 1) || (h == 2)) { if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) { - Utils.LOG_INFO("Reactor Shielding Missing from somewhere in the second layer."); - Utils.LOG_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); + Logger.INFO("Reactor Shielding Missing from somewhere in the second layer."); + Logger.INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 13) { - Utils.LOG_INFO("Reactor Shielding Missing from somewhere in the second layer."); - Utils.LOG_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); + Logger.INFO("Reactor Shielding Missing from somewhere in the second layer."); + Logger.INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); return false; } } @@ -228,13 +228,13 @@ public class GregtechMTE_NuclearReactor extends GT_MetaTileEntity_MultiBlockBase if (((xDir + i) != 0) || ((zDir + j) != 0)) {//no controller if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) { - Utils.LOG_INFO("Hastelloy-N Reactor Casing(s) Missing from one of the edges on the top layer."); - Utils.LOG_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); + Logger.INFO("Hastelloy-N Reactor Casing(s) Missing from one of the edges on the top layer."); + Logger.INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 12) { - Utils.LOG_INFO("Hastelloy-N Reactor Casing(s) Missing from one of the edges on the top layer. "+h); - Utils.LOG_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); + Logger.INFO("Hastelloy-N Reactor Casing(s) Missing from one of the edges on the top layer. "+h); + Logger.INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); if (h ==0){ if (tTileEntity instanceof GregtechMTE_NuclearReactor){ @@ -256,8 +256,8 @@ public class GregtechMTE_NuclearReactor extends GT_MetaTileEntity_MultiBlockBase if (this.mDynamoHatches != null) { for (int i = 0; i < this.mDynamoHatches.size(); i++) { if (this.mDynamoHatches.get(i).mTier < 5){ - Utils.LOG_INFO("You require at LEAST IV tier Dynamo Hatches."); - Utils.LOG_INFO(this.mOutputHatches.get(i).getBaseMetaTileEntity().getXCoord()+","+this.mOutputHatches.get(i).getBaseMetaTileEntity().getYCoord()+","+this.mOutputHatches.get(i).getBaseMetaTileEntity().getZCoord()); + Logger.INFO("You require at LEAST IV tier Dynamo Hatches."); + Logger.INFO(this.mOutputHatches.get(i).getBaseMetaTileEntity().getXCoord()+","+this.mOutputHatches.get(i).getBaseMetaTileEntity().getYCoord()+","+this.mOutputHatches.get(i).getBaseMetaTileEntity().getZCoord()); return false; } } @@ -266,9 +266,9 @@ public class GregtechMTE_NuclearReactor extends GT_MetaTileEntity_MultiBlockBase for (int i = 0; i < this.mOutputHatches.size(); i++) { if ((this.mOutputHatches.get(i).mTier < 5) && (this.mOutputHatches.get(i).getBaseMetaTileEntity() instanceof GregtechMTE_NuclearReactor)){ - Utils.LOG_INFO("You require at LEAST IV tier Output Hatches."); - Utils.LOG_INFO(this.mOutputHatches.get(i).getBaseMetaTileEntity().getXCoord()+","+this.mOutputHatches.get(i).getBaseMetaTileEntity().getYCoord()+","+this.mOutputHatches.get(i).getBaseMetaTileEntity().getZCoord()); - Utils.LOG_INFO(this.mOutputHatches.get(i).getBaseMetaTileEntity().getInventoryName()); + Logger.INFO("You require at LEAST IV tier Output Hatches."); + Logger.INFO(this.mOutputHatches.get(i).getBaseMetaTileEntity().getXCoord()+","+this.mOutputHatches.get(i).getBaseMetaTileEntity().getYCoord()+","+this.mOutputHatches.get(i).getBaseMetaTileEntity().getZCoord()); + Logger.INFO(this.mOutputHatches.get(i).getBaseMetaTileEntity().getInventoryName()); return false; } } @@ -276,31 +276,31 @@ public class GregtechMTE_NuclearReactor extends GT_MetaTileEntity_MultiBlockBase if (this.mInputHatches != null) { for (int i = 0; i < this.mInputHatches.size(); i++) { if (this.mInputHatches.get(i).mTier < 5){ - Utils.LOG_INFO("You require at LEAST IV tier Input Hatches."); - Utils.LOG_INFO(this.mOutputHatches.get(i).getBaseMetaTileEntity().getXCoord()+","+this.mOutputHatches.get(i).getBaseMetaTileEntity().getYCoord()+","+this.mOutputHatches.get(i).getBaseMetaTileEntity().getZCoord()); - Utils.LOG_INFO(this.mOutputHatches.get(i).getBaseMetaTileEntity().getInventoryName()); + Logger.INFO("You require at LEAST IV tier Input Hatches."); + Logger.INFO(this.mOutputHatches.get(i).getBaseMetaTileEntity().getXCoord()+","+this.mOutputHatches.get(i).getBaseMetaTileEntity().getYCoord()+","+this.mOutputHatches.get(i).getBaseMetaTileEntity().getZCoord()); + Logger.INFO(this.mOutputHatches.get(i).getBaseMetaTileEntity().getInventoryName()); return false; } } } if (this.mMufflerHatches.size() != 4){ - Utils.LOG_INFO("You require EXACTLY 4 muffler hatches on top. FOUR. You have "+this.mMufflerHatches.size()); + Logger.INFO("You require EXACTLY 4 muffler hatches on top. FOUR. You have "+this.mMufflerHatches.size()); return false; } if (this.mInputHatches.size() < 4){ - Utils.LOG_INFO("You require 4 or more input hatches. You have "+this.mInputHatches.size()); + Logger.INFO("You require 4 or more input hatches. You have "+this.mInputHatches.size()); return false; } if (this.mOutputHatches.size() < 10){ - Utils.LOG_INFO("You require 10 or more output hatches. You have "+this.mOutputHatches.size()); + Logger.INFO("You require 10 or more output hatches. You have "+this.mOutputHatches.size()); return false; } if (this.mDynamoHatches.size() != 4){ - Utils.LOG_INFO("You require EXACTLY 4 dynamo hatches. FOUR. You have "+this.mDynamoHatches.size()); + Logger.INFO("You require EXACTLY 4 dynamo hatches. FOUR. You have "+this.mDynamoHatches.size()); return false; } if (this.mMaintenanceHatches.size() != 2){ - Utils.LOG_INFO("You require EXACTLY 2 muffler hatches. TWO. You have "+this.mMaintenanceHatches.size()); + Logger.INFO("You require EXACTLY 2 muffler hatches. TWO. You have "+this.mMaintenanceHatches.size()); return false; } this.mWrench = true; @@ -310,7 +310,7 @@ public class GregtechMTE_NuclearReactor extends GT_MetaTileEntity_MultiBlockBase this.mSolderingTool = true; this.mCrowbar = true; this.turnCasingActive(false); - Utils.LOG_INFO("Multiblock Formed."); + Logger.INFO("Multiblock Formed."); return true; } @@ -385,15 +385,15 @@ public class GregtechMTE_NuclearReactor extends GT_MetaTileEntity_MultiBlockBase final ArrayList tFluids = this.getStoredFluids(); final Collection tRecipeList = Recipe_GT.Gregtech_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.mRecipeList; if((tFluids.size() > 0) && (tRecipeList != null)) { //Does input hatch have a LFTR fuel? - Utils.LOG_WARNING("Found more than one input fluid and a list of valid recipes."); + Logger.WARNING("Found more than one input fluid and a list of valid recipes."); for (final FluidStack hatchFluid1 : tFluids) { //Loops through hatches - Utils.LOG_WARNING("Looping through Input hatches - Found "+hatchFluid1.getLocalizedName()); + Logger.WARNING("Looping through Input hatches - Found "+hatchFluid1.getLocalizedName()); for(final GT_Recipe aFuel : tRecipeList) { //Loops through LFTR fuel recipes - Utils.LOG_WARNING("Looping through Recipes. "+aFuel.mSpecialValue); + Logger.WARNING("Looping through Recipes. "+aFuel.mSpecialValue); FluidStack tLiquid; final FluidStack testStack = aFuel.mFluidInputs[1]; if ((tLiquid = testStack) != null) { //Create fluidstack from current recipe - Utils.LOG_WARNING("Creating a fluidstack from the current recipe. "+testStack.getLocalizedName()); + Logger.WARNING("Creating a fluidstack from the current recipe. "+testStack.getLocalizedName()); if (hatchFluid1.isFluidEqual(tLiquid)) { //Has a LFTR fluid this.fuelConsumption = this.boostEu ? (aFuel.mSpecialValue/4096) : (aFuel.mSpecialValue/2048); //Calc fuel consumption @@ -409,37 +409,37 @@ public class GregtechMTE_NuclearReactor extends GT_MetaTileEntity_MultiBlockBase if(tFluids.contains(NUCLIDE.LiFBeF2ThF4UF4.getFluid(2