diff options
author | Jordan Byrne <draknyte1@hotmail.com> | 2017-12-24 11:54:30 +1000 |
---|---|---|
committer | Jordan Byrne <draknyte1@hotmail.com> | 2017-12-24 11:54:30 +1000 |
commit | ecf908e98ccee72a713091e8ab547e35a41d7436 (patch) | |
tree | f0dade1481aa02fd0ac4fcf8a672cc7a761a0547 /src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity | |
parent | b9fe3352840abe0846834cefd578895ec6f5e520 (diff) | |
parent | fa5de3584ce7bc97ce6f32b31f6062b5b6e89e75 (diff) | |
download | GT5-Unofficial-ecf908e98ccee72a713091e8ab547e35a41d7436.tar.gz GT5-Unofficial-ecf908e98ccee72a713091e8ab547e35a41d7436.tar.bz2 GT5-Unofficial-ecf908e98ccee72a713091e8ab547e35a41d7436.zip |
> Why does Git make me do these? arghhh...
Merge branch 'master' of https://github.com/draknyte1/GTplusplus
# Conflicts:
# src/Java/gtPlusPlus/core/material/ALLOY.java
# src/Java/gtPlusPlus/core/material/ELEMENT.java
# src/Java/gtPlusPlus/core/material/Material.java
# src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity')
8 files changed, 159 insertions, 111 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeMachine.java index 7b4cf471b0..83c2235d8c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeMachine.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeMachine.java @@ -14,7 +14,7 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; -import gtPlusPlus.core.util.Utils; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.xmod.gregtech.api.objects.XSTR; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -452,7 +452,7 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ } boolean tRemovedOutputFluid = false; - Utils.LOG_WARNING("R0"); + Logger.WARNING("R0"); if (doesAutoOutputFluids() && getDrainableStack() != null && aBaseMetaTileEntity.getFrontFacing() != mMainFacing && (tSucceeded || aTick % 20 == 0)) { IFluidHandler tTank = aBaseMetaTileEntity.getITankContainerAtSide(aBaseMetaTileEntity.getFrontFacing()); @@ -477,27 +477,27 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ if (mOutputBlocked != 0) if (isOutputEmpty()) mOutputBlocked = 0; else mOutputBlocked++; - Utils.LOG_WARNING("R1"); + Logger.WARNING("R1"); if (allowToCheckRecipe()) { - Utils.LOG_WARNING("R2--------------------------------------------------"); - Utils.LOG_WARNING("R2: (mMaxProgresstime <= 0 && aBaseMetaTileEntity.isAllowedToWork() && (tRemovedOutputFluid || tSucceeded || aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) && hasEnoughEnergyToCheckRecipe())"); - Utils.LOG_WARNING("R2--------------------------------------------------"); - Utils.LOG_WARNING("R2-mMaxProgresstime: "+mMaxProgresstime); - Utils.LOG_WARNING("R2-isAllowedToWork(): "+aBaseMetaTileEntity.isAllowedToWork()); - Utils.LOG_WARNING("R2--------------------------------------------------"); - Utils.LOG_WARNING("R2-tRemovedOutputFluid: "+tRemovedOutputFluid); - Utils.LOG_WARNING("R2-tSucceeded: "+tSucceeded); - Utils.LOG_WARNING("R2-hasInventoryBeenModified(): "+aBaseMetaTileEntity.hasInventoryBeenModified()); - Utils.LOG_WARNING("R2-(aTick % 600 == 0): "+(aTick % 600 == 0)); - Utils.LOG_WARNING("R2-hasWorkJustBeenEnabled(): "+aBaseMetaTileEntity.hasWorkJustBeenEnabled()); - Utils.LOG_WARNING("R2--------------------------------------------------"); - Utils.LOG_WARNING("R2-hasEnoughEnergyToCheckRecipe(): "+hasEnoughEnergyToCheckRecipe()); - Utils.LOG_WARNING("R2--------------------------------------------------"); + Logger.WARNING("R2--------------------------------------------------"); + Logger.WARNING("R2: (mMaxProgresstime <= 0 && aBaseMetaTileEntity.isAllowedToWork() && (tRemovedOutputFluid || tSucceeded || aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) && hasEnoughEnergyToCheckRecipe())"); + Logger.WARNING("R2--------------------------------------------------"); + Logger.WARNING("R2-mMaxProgresstime: "+mMaxProgresstime); + Logger.WARNING("R2-isAllowedToWork(): "+aBaseMetaTileEntity.isAllowedToWork()); + Logger.WARNING("R2--------------------------------------------------"); + Logger.WARNING("R2-tRemovedOutputFluid: "+tRemovedOutputFluid); + Logger.WARNING("R2-tSucceeded: "+tSucceeded); + Logger.WARNING("R2-hasInventoryBeenModified(): "+aBaseMetaTileEntity.hasInventoryBeenModified()); + Logger.WARNING("R2-(aTick % 600 == 0): "+(aTick % 600 == 0)); + Logger.WARNING("R2-hasWorkJustBeenEnabled(): "+aBaseMetaTileEntity.hasWorkJustBeenEnabled()); + Logger.WARNING("R2--------------------------------------------------"); + Logger.WARNING("R2-hasEnoughEnergyToCheckRecipe(): "+hasEnoughEnergyToCheckRecipe()); + Logger.WARNING("R2--------------------------------------------------"); if (mMaxProgresstime <= 0 && aBaseMetaTileEntity.isAllowedToWork() && (tRemovedOutputFluid || tSucceeded || aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) && hasEnoughEnergyToCheckRecipe()) { - Utils.LOG_WARNING("R3"); + Logger.WARNING("R3"); if (checkRecipe() == 2) { if (mInventory[3] != null && mInventory[3].stackSize <= 0) mInventory[3] = null; - Utils.LOG_WARNING("R4"); + Logger.WARNING("R4"); for (int i = getInputSlot(), j = i + mInputSlotCount; i < j; i++) if (mInventory[i] != null && mInventory[i].stackSize <= 0) mInventory[i] = null; for (int i = 0; i < mOutputItems.length; i++) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeTank.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeTank.java index 175869a1ac..b5e7d7d64c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeTank.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeTank.java @@ -5,7 +5,7 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; import gregtech.api.util.GT_Utility; -import gtPlusPlus.core.util.Utils; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_DeluxeTank; import gtPlusPlus.xmod.gregtech.api.gui.GUI_DeluxeTank; import net.minecraft.entity.player.InventoryPlayer; @@ -228,7 +228,7 @@ public abstract class GT_MetaTileEntity_DeluxeTank extends GT_MetaTileEntity_Bas } } else { - Utils.LOG_INFO("Something broke when trying to empty cells between two fluid tank areas."); + Logger.INFO("Something broke when trying to empty cells between two fluid tank areas."); } } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java index 9c93ca3889..8b5a1e520b 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java @@ -3,21 +3,16 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; import static gregtech.api.enums.GT_Values.V; import gregtech.api.enums.GT_Values; -import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.xmod.gregtech.api.gui.hatches.charge.CONTAINER_Electric_2by2; -import gtPlusPlus.xmod.gregtech.api.gui.hatches.charge.CONTAINER_Electric_4by4; -import gtPlusPlus.xmod.gregtech.api.gui.hatches.charge.GUI_Electric_2by2; -import gtPlusPlus.xmod.gregtech.api.gui.hatches.charge.GUI_Electric_4by4; +import gtPlusPlus.xmod.gregtech.api.gui.hatches.charge.*; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -219,10 +214,12 @@ GT_MetaTileEntity_Hatch { && (mRecipeMap == null || mRecipeMap.containsInput(aStack)); } + @Override public int rechargerSlotStartIndex() { return 0; } + @Override public int rechargerSlotCount() { switch (mTier) { case 2 : @@ -234,10 +231,12 @@ GT_MetaTileEntity_Hatch { } } + @Override public int dechargerSlotStartIndex() { return 0; } + @Override public int dechargerSlotCount() { return 0; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java index aa234a3dc9..29d32d4d9d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java @@ -2,7 +2,6 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; import static gregtech.api.enums.GT_Values.V; -import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -10,12 +9,9 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.xmod.gregtech.api.gui.hatches.charge.CONTAINER_Electric_2by2; -import gtPlusPlus.xmod.gregtech.api.gui.hatches.charge.CONTAINER_Electric_4by4; -import gtPlusPlus.xmod.gregtech.api.gui.hatches.charge.GUI_Electric_2by2; -import gtPlusPlus.xmod.gregtech.api.gui.hatches.charge.GUI_Electric_4by4; +import gtPlusPlus.xmod.gregtech.api.gui.hatches.charge.*; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -178,18 +174,22 @@ GT_MetaTileEntity_Hatch { } } + @Override public int rechargerSlotStartIndex() { return 0; } + @Override public int rechargerSlotCount() { return 0; } + @Override public int dechargerSlotStartIndex() { return 0; } + @Override public int dechargerSlotCount() { return mTier == 2 ? 4 : 16; } @@ -205,7 +205,7 @@ GT_MetaTileEntity_Hatch { if (aBaseMetaTileEntity.getMetaTileEntity() instanceof MetaTileEntity) { MetaTileEntity mMetaTileEntity = (MetaTileEntity) aBaseMetaTileEntity.getMetaTileEntity(); if (mMetaTileEntity.dechargerSlotCount() > 0 && mMetaTileEntity.getEUVar() < aBaseMetaTileEntity.getEUCapacity()) { - Utils.LOG_INFO("3"); + Logger.INFO("3"); for (int i = mMetaTileEntity.dechargerSlotStartIndex(), k = mMetaTileEntity.dechargerSlotCount() + i; i < k; i++) { if (mMetaTileEntity.mInventory[i] != null && mMetaTileEntity.getEUVar() < aBaseMetaTileEntity.getEUCapacity()) { aBaseMetaTileEntity.increaseStoredEnergyUnits(GT_ModHandler.dischargeElectricItem(mMetaTileEntity.mInventory[i], (int) Math.min(V[mTier] * 15, aBaseMetaTileEntity.getEUCapacity() - aBaseMetaTileEntity.getStoredEU()), (int) Math.min(Integer.MAX_VALUE, mMetaTileEntity.getInputTier()), true, false, false), true); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java index 6de1594b69..220e6eb4dc 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java @@ -19,8 +19,8 @@ import gregtech.api.metatileentity.MetaPipeEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; import gregtech.common.GT_Proxy; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; import ic2.api.energy.tile.IEnergySink; import net.minecraft.entity.Entity; @@ -88,8 +88,8 @@ public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { // Utils.LOG_INFO("FATAL ERROR - REFLECTION FAILED FOR GT CABLES // - PLEASE REPORT THIS."); - Utils.LOG_WARNING("FATAL ERROR - REFLECTION FAILED FOR GT CABLES - PLEASE REPORT THIS."); - Utils.LOG_ERROR("FATAL ERROR - REFLECTION FAILED FOR GT CABLES - PLEASE REPORT THIS."); + Logger.WARNING("FATAL ERROR - REFLECTION FAILED FOR GT CABLES - PLEASE REPORT THIS."); + Logger.ERROR("FATAL ERROR - REFLECTION FAILED FOR GT CABLES - PLEASE REPORT THIS."); temp = 4; } } 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 fdcdab63fe..f6a8d55174 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,21 +1,21 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; +import java.lang.reflect.*; import java.util.ArrayList; import java.util.Iterator; +import org.apache.commons.lang3.reflect.FieldUtils; + +import gregtech.api.enums.Materials; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; 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; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; -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.util.GT_Recipe; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_MultiMachine; import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine; @@ -102,7 +102,7 @@ GT_MetaTileEntity_MultiBlockBase { public int getValidOutputSlots(final IGregTechTileEntity machineCalling, final GT_Recipe sRecipes, final ItemStack[] sInputs) { - Utils.LOG_WARNING("Finding valid output slots for " + Logger.WARNING("Finding valid output slots for " + machineCalling.getInventoryName()); final ArrayList<ItemStack> tInputList = this.getStoredInputs(); final GT_Recipe tRecipe = sRecipes; @@ -145,11 +145,11 @@ GT_MetaTileEntity_MultiBlockBase { baseRecipe = tRecipe.copy(); if ((cloneRecipe != baseRecipe) || (cloneRecipe == null)) { cloneRecipe = baseRecipe.copy(); - Utils.LOG_WARNING("Setting Recipe"); + Logger.WARNING("Setting Recipe"); } if ((cloneTime != baseRecipe.mDuration) || (cloneTime == 0)) { cloneTime = baseRecipe.mDuration; - Utils.LOG_WARNING("Setting Time"); + Logger.WARNING("Setting Time"); } if (cloneRecipe.mDuration > 0) { @@ -158,16 +158,16 @@ GT_MetaTileEntity_MultiBlockBase { (100 - percentage)); cloneRecipe.mDuration = tempTime; if (cloneRecipe.mDuration < originalTime) { - Utils.LOG_MACHINE_INFO("Generated recipe with a smaller time. | " + Logger.MACHINE_INFO("Generated recipe with a smaller time. | " + originalTime + " | " + cloneRecipe.mDuration + " |"); return cloneRecipe; } else { - Utils.LOG_MACHINE_INFO("Did not generate recipe with a smaller time. | " + Logger.MACHINE_INFO("Did not generate recipe with a smaller time. | " + originalTime + " | " + cloneRecipe.mDuration + " |"); return tRecipe; } } - Utils.LOG_MACHINE_INFO("Error generating recipe, returning null."); + Logger.MACHINE_INFO("Error generating recipe, returning null."); return null; } @@ -213,6 +213,15 @@ GT_MetaTileEntity_MultiBlockBase { } super.updateSlots(); } + + public boolean isToolCreative(ItemStack mStack){ + Materials t1 = GT_MetaGenerated_Tool.getPrimaryMaterial(mStack); + Materials t2 = GT_MetaGenerated_Tool.getSecondaryMaterial(mStack); + if (t1 == Materials._NULL && t2 == Materials._NULL){ + return true; + } + return false; + } @Override public boolean addToMachineList(final IGregTechTileEntity aTileEntity, @@ -401,4 +410,44 @@ GT_MetaTileEntity_MultiBlockBase { return super.addDynamoToMachineList(aTileEntity, aBaseCasingIndex); } + + /** + * Pollution Management + */ + + public int getPollutionPerTick(ItemStack arg0) { + return 0; + } + + public boolean polluteEnvironment(int aPollutionLevel) { + int mPollution = 0; + Field f = FieldUtils.getDeclaredField(this.getClass(), "mPollution", true); + if (f != null){ + try { + mPollution = (int) f.get(this); + } + catch (IllegalArgumentException | IllegalAccessException e) {} + } + + if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && f != null){ + mPollution += aPollutionLevel; + for (final GT_MetaTileEntity_Hatch_Muffler tHatch : this.mMufflerHatches) { + if (isValidMetaTileEntity(tHatch)) { + if (mPollution < 10000) { + break; + } + if (!tHatch.polluteEnvironment()) { + continue; + } + mPollution -= 10000; + } + } + return mPollution < 10000; + } + else { + return false; + } + + } + } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechDoubleFuelGeneratorBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechDoubleFuelGeneratorBase.java index 717616ff71..c499b38ce8 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechDoubleFuelGeneratorBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechDoubleFuelGeneratorBase.java @@ -10,8 +10,8 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_DeluxeTank; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -70,10 +70,10 @@ public abstract class GregtechDoubleFuelGeneratorBase extends GT_MetaTileEntity_ @Override public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { if (aBaseMetaTileEntity.isClientSide()){ - Utils.LOG_WARNING("Entity is Client side, simply returning true"); + Logger.WARNING("Entity is Client side, simply returning true"); return true; } - Utils.LOG_WARNING("Entity is not Client side, opening entity Container and by extension, it's GUI, then returning true"); + Logger.WARNING("Entity is not Client side, opening entity Container and by extension, it's GUI, then returning true"); aBaseMetaTileEntity.openGUI(aPlayer); return true; } @@ -216,19 +216,19 @@ public abstract class GregtechDoubleFuelGeneratorBase extends GT_MetaTileEntity_ final int tFuelValue2 = this.getFuelValue(this.mFluid2), tConsumed2 = this.consumedFluidPerOperation(this.mFluid2); if (((tFuelValue > 0) && (tConsumed > 0) && (this.mFluid.amount > tConsumed))/* && (tFuelValue2 > 0 && tConsumed2 > 0 && mFluid2.amount > tConsumed2)*/) { - Utils.LOG_WARNING("tFuelValue: "+tFuelValue); - Utils.LOG_WARNING("tConsumed: "+tConsumed); - Utils.LOG_WARNING("mFluid.name: "+this.mFluid.getFluid().getName()); - Utils.LOG_WARNING("mFluid.amount: "+this.mFluid.amount); - Utils.LOG_WARNING("mFluid.amount > tConsumed: "+(this.mFluid.amount > tConsumed)); + Logger.WARNING("tFuelValue: "+tFuelValue); + Logger.WARNING("tConsumed: "+tConsumed); + Logger.WARNING("mFluid.name: "+this.mFluid.getFluid().getName()); + Logger.WARNING("mFluid.amount: "+this.mFluid.amount); + Logger.WARNING("mFluid.amount > tConsumed: "+(this.mFluid.amount > tConsumed)); - Utils.LOG_WARNING("========================================================="); + Logger.WARNING("========================================================="); - Utils.LOG_WARNING("tFuelValue2: "+tFuelValue2); - Utils.LOG_WARNING("tConsumed2: "+tConsumed2); - Utils.LOG_WARNING("mFluid2.name: "+this.mFluid2.getFluid().getName()); - Utils.LOG_WARNING("mFluid2.amount: "+this.mFluid2.amount); - Utils.LOG_WARNING("mFluid2.amount > tConsumed2: "+(this.mFluid2.amount > tConsumed2)); + Logger.WARNING("tFuelValue2: "+tFuelValue2); + Logger.WARNING("tConsumed2: "+tConsumed2); + Logger.WARNING("mFluid2.name: "+this.mFluid2.getFluid().getName()); + Logger.WARNING("mFluid2.amount: "+this.mFluid2.amount); + Logger.WARNING("mFluid2.amount > tConsumed2: "+(this.mFluid2.amount > tConsumed2)); long tFluidAmountToUse = Math.min(this.mFluid.amount / tConsumed, (((this.maxEUOutput() * 30) + this.getMinimumStoredEU()) - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue); long tFluidAmountToUse2 = Math.min(this.mFluid2.amount / tConsumed2, (((this.maxEUOutput() * 30) + this.getMinimumStoredEU()) - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue2); @@ -239,9 +239,9 @@ public abstract class GregtechDoubleFuelGeneratorBase extends GT_MetaTileEntity_ if (aBaseMetaTileEntity.getUniversalEnergyStored() <= (aBaseMetaTileEntity.getEUCapacity()-aBaseMetaTileEntity.getUniversalEnergyStored())){ tFluidAmountToUse = 1; - Utils.LOG_WARNING("========================================================="); - Utils.LOG_WARNING("tFluidAmountToUse - Updated: "+tFluidAmountToUse); - Utils.LOG_WARNING("========================================================="); + Logger.WARNING("========================================================="); + Logger.WARNING("tFluidAmountToUse - Updated: "+tFluidAmountToUse); + Logger.WARNING("========================================================="); } } @@ -251,15 +251,15 @@ public abstract class GregtechDoubleFuelGeneratorBase extends GT_MetaTileEntity_ }*/ if (aBaseMetaTileEntity.getUniversalEnergyStored() <= (aBaseMetaTileEntity.getEUCapacity()-aBaseMetaTileEntity.getUniversalEnergyStored())){ tFluidAmountToUse2 = 1; - Utils.LOG_WARNING("========================================================="); - Utils.LOG_WARNING("tFluidAmountToUse2 - Updated: "+tFluidAmountToUse2); - Utils.LOG_WARNING("========================================================="); + Logger.WARNING("========================================================="); + Logger.WARNING("tFluidAmountToUse2 - Updated: "+tFluidAmountToUse2); + Logger.WARNING("========================================================="); } } - Utils.LOG_WARNING("========================================================="); - Utils.LOG_WARNING("tFluidAmountToUse: "+tFluidAmountToUse); - Utils.LOG_WARNING("========================================================="); + Logger.WARNING("========================================================="); + Logger.WARNING("tFluidAmountToUse: "+tFluidAmountToUse); + Logger.WARNING("========================================================="); /*Utils.LOG_WARNING("mFluid.amount / tConsumed: "+("fluidAmount:"+mFluid.amount)+(" tConsumed:"+tConsumed)+" | "+(mFluid.amount / tConsumed)); Utils.LOG_WARNING("maxEUOutput() * 20 + getMinimumStoredEU(): "+(maxEUOutput() * 30 + getMinimumStoredEU())); @@ -272,9 +272,9 @@ public abstract class GregtechDoubleFuelGeneratorBase extends GT_MetaTileEntity_ Utils.LOG_WARNING("(maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue): "+((maxEUOutput() * 30 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue)); */ - Utils.LOG_WARNING("========================================================="); - Utils.LOG_WARNING("tFluidAmountToUse2: "+tFluidAmountToUse2); - Utils.LOG_WARNING("========================================================="); + Logger.WARNING("========================================================="); + Logger.WARNING("tFluidAmountToUse2: "+tFluidAmountToUse2); + Logger.WARNING("========================================================="); /*Utils.LOG_WARNING("mFluid2.amount / tConsumed2: "+("fluidAmount2:"+mFluid2.amount)+(" tConsumed2:"+tConsumed2)+" | "+(mFluid2.amount / tConsumed2)); Utils.LOG_WARNING("maxEUOutput() * 20 + getMinimumStoredEU(): "+(maxEUOutput() * 30 + getMinimumStoredEU())); @@ -288,19 +288,19 @@ public abstract class GregtechDoubleFuelGeneratorBase extends GT_MetaTileEntity_ */ if (((tFluidAmountToUse > 0) && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)) && ((tFluidAmountToUse2 > 0) && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse2 * tFuelValue2, true))){ - Utils.LOG_WARNING("tFuelValue: "+tFuelValue); - Utils.LOG_WARNING("tConsumed: "+tConsumed); - Utils.LOG_WARNING("mFluid.name: "+this.mFluid.getFluid().getName()); - Utils.LOG_WARNING("mFluid.amount: "+this.mFluid.amount); - Utils.LOG_WARNING("mFluid.amount > tConsumed: "+(this.mFluid.amount > tConsumed)); + Logger.WARNING("tFuelValue: "+tFuelValue); + Logger.WARNING("tConsumed: "+tConsumed); + Logger.WARNING("mFluid.name: "+this.mFluid.getFluid().getName()); + Logger.WARNING("mFluid.amount: "+this.mFluid.amount); + Logger.WARNING("mFluid.amount > tConsumed: "+(this.mFluid.amount > tConsumed)); - Utils.LOG_WARNING("========================================================="); + Logger.WARNING("========================================================="); - Utils.LOG_WARNING("tFuelValue2: "+tFuelValue2); - Utils.LOG_WARNING("tConsumed2: "+tConsumed2); - Utils.LOG_WARNING("mFluid2.name: "+this.mFluid2.getFluid().getName()); - Utils.LOG_WARNING("mFluid2.amount: "+this.mFluid2.amount); - Utils.LOG_WARNING("mFluid2.amount > tConsumed2: "+(this.mFluid2.amount > tConsumed2)); + Logger.WARNING("tFuelValue2: "+tFuelValue2); + Logger.WARNING("tConsumed2: "+tConsumed2); + Logger.WARNING("mFluid2.name: "+this.mFluid2.getFluid().getName()); + Logger.WARNING("mFluid2.amount: "+this.mFluid2.amount); + Logger.WARNING("mFluid2.amount > tConsumed2: "+(this.mFluid2.amount > tConsumed2)); if (this.useFuel){ this.mFluid.amount -= tFluidAmountToUse * tConsumed; @@ -313,10 +313,10 @@ public abstract class GregtechDoubleFuelGeneratorBase extends GT_MetaTileEntity_ } else { - Utils.LOG_WARNING("========================================================="); - Utils.LOG_WARNING("Either tFluidAmountToUse1 <= 0, power cannot be increased of tFluidAmountToUse2 <= 0"); - Utils.LOG_WARNING("tFluidAmountToUse1: "+tFluidAmountToUse); - Utils.LOG_WARNING("tFluidAmountToUse2: "+tFluidAmountToUse2); + Logger.WARNING("========================================================="); + Logger.WARNING("Either tFluidAmountToUse1 <= 0, power cannot be increased of tFluidAmountToUse2 <= 0"); + Logger.WARNING("tFluidAmountToUse1: "+tFluidAmountToUse); + Logger.WARNING("tFluidAmountToUse2: "+tFluidAmountToUse2); } } else { @@ -335,12 +335,12 @@ public abstract class GregtechDoubleFuelGeneratorBase extends GT_MetaTileEntity_ } } else { - Utils.LOG_WARNING("One mFluid is null"); + Logger.WARNING("One mFluid is null"); if (this.mFluid != null) { - Utils.LOG_WARNING("mFluid1 is not null"); + Logger.WARNING("mFluid1 is not null"); } if (this.mFluid2 != null) { - Utils.LOG_WARNING("mFluid2 is not null"); + Logger.WARNING("mFluid2 is not null"); } } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java index 289da38d53..058063a45f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java @@ -10,7 +10,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; -import gtPlusPlus.core.util.Utils; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.util.player.PlayerCache; import gtPlusPlus.core.util.player.PlayerUtils; import net.minecraft.entity.player.EntityPlayer; @@ -201,35 +201,35 @@ public abstract class GregtechMetaSafeBlockBase extends GT_MetaTileEntity_Tiered }*/ //Utils.LOG_INFO("test"); if (this.ownerUUID == null){ - Utils.LOG_INFO("No owner yet for this block."); + Logger.INFO("No owner yet for this block."); } else { //Utils.LOG_INFO("test"); - Utils.LOG_INFO("Current Owner: "+PlayerCache.lookupPlayerByUUID(this.ownerUUID)+" - UUID: "+this.ownerUUID); + Logger.INFO("Current Owner: "+PlayerCache.lookupPlayerByUUID(this.ownerUUID)+" - UUID: "+this.ownerUUID); } - Utils.LOG_WARNING("Is ownerUUID Null"); + Logger.WARNING("Is ownerUUID Null"); if (this.ownerUUID == null){ - Utils.LOG_WARNING("OwnerUUID is Null, let's set it."); - Utils.LOG_WARNING("Accessing Players UUID is: "+tempUUID); + Logger.WARNING("OwnerUUID is Null, let's set it."); + Logger.WARNING("Accessing Players UUID is: "+tempUUID); this.ownerUUID = tempUUID; //Utils.messagePlayer(aPlayer, "Owner of this safe, now set. Try accessing it again."); - Utils.LOG_WARNING("Block Owner is now set to: "+this.ownerUUID); + Logger.WARNING("Block Owner is now set to: "+this.ownerUUID); } - Utils.LOG_WARNING("No, it is not."); - Utils.LOG_WARNING("Checking ownerUUID."); + Logger.WARNING("No, it is not."); + Logger.WARNING("Checking ownerUUID."); if (this.ownerUUID != null){ - Utils.LOG_WARNING("ownerUUID != Null, if accessor == owner."); - Utils.LOG_WARNING("Accessing is: "+PlayerCache.lookupPlayerByUUID(tempUUID)); + Logger.WARNING("ownerUUID != Null, if accessor == owner."); + Logger.WARNING("Accessing is: "+PlayerCache.lookupPlayerByUUID(tempUUID)); if (this.ownerUUID.equals(tempUUID)){ - Utils.LOG_WARNING("Owner's UUID: "+this.ownerUUID); + Logger.WARNING("Owner's UUID: "+this.ownerUUID); aBaseMetaTileEntity.openGUI(aPlayer); //Utils.LOG_WARNING("GUI should now be open for you sir."); } else { PlayerUtils.messagePlayer(aPlayer, "Access Denied, This does not belong to you."); PlayerUtils.messagePlayer(aPlayer, "it is owned by: "+PlayerCache.lookupPlayerByUUID(this.ownerUUID)); - Utils.LOG_WARNING("Expecting Player : "+PlayerCache.lookupPlayerByUUID(this.ownerUUID)); - Utils.LOG_ERROR("Access Denied."); + Logger.WARNING("Expecting Player : "+PlayerCache.lookupPlayerByUUID(this.ownerUUID)); + Logger.ERROR("Access Denied."); return true; } @@ -284,7 +284,7 @@ public abstract class GregtechMetaSafeBlockBase extends GT_MetaTileEntity_Tiered this.value_last = this.value_current; this.value_current = this.bUnbreakable; if (this.value_last != this.value_current){ - Utils.LOG_WARNING("VALUE CHANGE - Ticking for a moment."); + Logger.WARNING("VALUE CHANGE - Ticking for a moment."); if (this.bUnbreakable == true){ //Xasda.setmTileEntity((BaseMetaTileEntity) aBaseMetaTileEntity); //Utils.LOG_ERROR("Safe is Indestructible."); |