diff options
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common')
47 files changed, 684 insertions, 665 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java b/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java index e5c9cace94..6de9fa1259 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java @@ -6,7 +6,7 @@ import java.util.List; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; -import gtPlusPlus.core.util.Utils; +import gtPlusPlus.api.objects.Logger; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraftforge.oredict.OreDictionary; @@ -19,7 +19,7 @@ public class Meta_GT_Proxy { public static IIconRegister sBlockIcons, sItemIcons; public Meta_GT_Proxy() { - Utils.LOG_INFO("GT_PROXY - initialized."); + Logger.INFO("GT_PROXY - initialized."); for (final String tOreName : OreDictionary.getOreNames()) { } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java index e57a936697..89b7b728b6 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java @@ -3,6 +3,7 @@ package gtPlusPlus.xmod.gregtech.common.blocks.fluid; import gregtech.api.enums.ItemList; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.base.cell.BaseItemCell; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.util.Utils; @@ -40,14 +41,14 @@ public class GregtechFluidHandler { if (!LoadedMods.ThermalFoundation){ - Utils.LOG_INFO("Adding in our own GT versions of Thermal Foundation Fluids"); + Logger.INFO("Adding in our own GT versions of Thermal Foundation Fluids"); FluidUtils.addFluid("cryotheum", "Gelid Cryotheum", GT_Materials.Cryotheum, 4, -1200, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Cryotheum, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); FluidUtils.addFluid("pyrotheum", "Blazing Pyrotheum", GT_Materials.Pyrotheum, 4, 4000, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Pyrotheum, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); FluidUtils.addFluid("ender", "Resonant Ender", GT_Materials.Ender, 4, 4000, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Ender, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); } if (LoadedMods.IndustrialCraft2){ - Utils.LOG_INFO("Adding in GT Fluids for various nuclear related content."); + Logger.INFO("Adding in GT Fluids for various nuclear related content."); FluidUtils.addFluid("hydrofluoricAcid", "Industrial Strength Hydrofluoric Acid", GT_Materials.HydrofluoricAcid, 1, 120, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.HydrofluoricAcid, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); generateIC2FluidCell("HydrofluoricAcid"); @@ -65,10 +66,10 @@ public class GregtechFluidHandler { if (!LoadedMods.IHL || (ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenChloride", 1) == null)){ if (FluidUtils.getFluidStack("hydrogenchloride", 1) == null){ if (LoadedMods.IHL){ - Utils.LOG_INFO("IHL Loaded but hydrogen chloride could not be found for some reason. How about we add our own."); + Logger.INFO("IHL Loaded but hydrogen chloride could not be found for some reason. How about we add our own."); } else { - Utils.LOG_INFO("No Suitable versions of Hydrogen Chloride available, adding our own."); + Logger.INFO("No Suitable versions of Hydrogen Chloride available, adding our own."); } FluidUtils.addFluid("hydrogenChloride", "Industrial Strength Hydrogen Chloride", GT_Materials.HydrogenChloride, 4, 75, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.HydrogenChloride, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); generateIC2FluidCell("HydrogenChloride"); @@ -87,7 +88,7 @@ public class GregtechFluidHandler { } private static ItemStack generateIC2FluidCell(final String fluidNameWithCaps){ - Utils.LOG_INFO("Adding a Cell for "+fluidNameWithCaps); + Logger.INFO("Adding a Cell for "+fluidNameWithCaps); if (LoadedMods.IndustrialCraft2){ return Utils.createInternalNameAndFluidCell(fluidNameWithCaps); } @@ -95,7 +96,7 @@ public class GregtechFluidHandler { } private static ItemStack generateIC2FluidCellNoOreDict(final String fluidNameWithCaps){ - Utils.LOG_INFO("Adding a Cell for "+fluidNameWithCaps); + Logger.INFO("Adding a Cell for "+fluidNameWithCaps); if (LoadedMods.IndustrialCraft2){ return Utils.createInternalNameAndFluidCellNoOreDict(fluidNameWithCaps); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java index be1ceb2fd7..3795f9815f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java @@ -2,8 +2,8 @@ package gtPlusPlus.xmod.gregtech.common.blocks.textures; import gregtech.api.GregTech_API; import gregtech.api.interfaces.IIconContainer; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; @@ -23,7 +23,7 @@ public class TexturesGtBlock { public CustomIcon(final String aIconName) { this.mIconName = aIconName; - Utils.LOG_WARNING("Constructing a Custom Texture. " + this.mIconName); + Logger.WARNING("Constructing a Custom Texture. " + this.mIconName); GregTech_API.sGTBlockIconload.add(this); } @@ -40,7 +40,7 @@ public class TexturesGtBlock { @Override public void run() { this.mIcon = GregTech_API.sBlockIcons.registerIcon(CORE.MODID + ":" + this.mIconName); - Utils.LOG_WARNING("FIND ME _ Processing texture: "+this.getTextureFile().getResourcePath()); + Logger.WARNING("FIND ME _ Processing texture: "+this.getTextureFile().getResourcePath()); } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java index 31a95560da..db3812ad92 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java @@ -2,8 +2,8 @@ package gtPlusPlus.xmod.gregtech.common.blocks.textures; import gregtech.api.GregTech_API; import gregtech.api.interfaces.IIconContainer; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; @@ -29,7 +29,7 @@ public final class TexturesGtTools { public CustomIcon(final String aIconName) { this.mIconName = aIconName; - Utils.LOG_INFO("Constructing a Custom Texture. " + this.mIconName); + Logger.INFO("Constructing a Custom Texture. " + this.mIconName); GregTech_API.sGTItemIconload.add(this); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java index 35cf3d02e1..210603ec0d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java @@ -1,16 +1,13 @@ package gtPlusPlus.xmod.gregtech.common.helpers; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; +import java.util.*; import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_ModHandler; -import gregtech.common.items.GT_MetaGenerated_Item_01; -import gregtech.common.items.GT_MetaGenerated_Item_02; -import gregtech.common.items.GT_MetaGenerated_Tool_01; +import gregtech.common.items.*; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.array.BlockPos; import gtPlusPlus.core.util.array.Pair; @@ -184,20 +181,20 @@ public class ChargingHelper { if (mEntity == null){ return false; } - Utils.LOG_WARNING("trying to map new player"); + Logger.WARNING("trying to map new player"); if (mValidPlayers.containsKey(mPlayer)){ - Utils.LOG_WARNING("Key contains player already?"); + Logger.WARNING("Key contains player already?"); return false; } else { - Utils.LOG_WARNING("key not found, adding"); + Logger.WARNING("key not found, adding"); Pair<GregtechMetaWirelessCharger, Byte> mEntry = new Pair<GregtechMetaWirelessCharger, Byte>(mEntity, (byte) mEntity.getMode()); if (mValidPlayers.put(mPlayer, mEntry) == null){ - Utils.LOG_WARNING("Added a Player to the Tick Map."); + Logger.WARNING("Added a Player to the Tick Map."); return true; } else { - Utils.LOG_WARNING("Tried to add player but it was already there?"); + Logger.WARNING("Tried to add player but it was already there?"); return false; } } @@ -207,21 +204,21 @@ public class ChargingHelper { if (mEntity == null){ return false; } - Utils.LOG_WARNING("trying to remove player from map"); + Logger.WARNING("trying to remove player from map"); if (mValidPlayers.containsKey(mPlayer)){ - Utils.LOG_WARNING("key found, removing"); + Logger.WARNING("key found, removing"); Pair<GregtechMetaWirelessCharger, Byte> mEntry = new Pair<GregtechMetaWirelessCharger, Byte>(mEntity, (byte) mEntity.getMode()); if (mValidPlayers.remove(mPlayer, mEntry)){ - Utils.LOG_WARNING("Removed a Player to the Tick Map."); + Logger.WARNING("Removed a Player to the Tick Map."); return true; } else { - Utils.LOG_WARNING("Tried to remove player but it was not there?"); + Logger.WARNING("Tried to remove player but it was not there?"); return false; } } else { - Utils.LOG_WARNING("Key does not contain player?"); + Logger.WARNING("Key does not contain player?"); return false; } } @@ -268,17 +265,17 @@ public class ChargingHelper { for (ItemStack mTemp : mItems){ mItemSlot++; if (mTemp != null){ - Utils.LOG_WARNING("Slot "+mItemSlot+" contains "+mTemp.getDisplayName()); + Logger.WARNING("Slot "+mItemSlot+" contains "+mTemp.getDisplayName()); } //Is item Electrical if (isItemValid(mTemp)){ - Utils.LOG_WARNING("1"); + Logger.WARNING("1"); //Transfer Limit double mItemEuTLimit = ((IElectricItem) mTemp.getItem()).getTransferLimit(mTemp); //Check if Tile has more or equal EU to what can be transferred into the item. if (mEuStored >= mItemEuTLimit){ - Utils.LOG_WARNING("2"); + Logger.WARNING("2"); double mItemMaxCharge = ((IElectricItem) mTemp.getItem()).getMaxCharge(mTemp); double mitemCurrentCharge = ElectricItem.manager.getCharge(mTemp); @@ -289,7 +286,7 @@ public class ChargingHelper { //Try get charge direct from NBT for GT and IC2 stacks try { - Utils.LOG_WARNING("3"); + Logger.WARNING("3"); if (mTemp.getItem() instanceof GT_MetaGenerated_Tool_01 || mTemp.getItem() instanceof GT_MetaGenerated_Item_01 || mTemp.getItem() instanceof GT_MetaGenerated_Item_02 @@ -327,7 +324,7 @@ public class ChargingHelper { mVoltageIncrease = mItemEuTLimit; } - Utils.LOG_WARNING("4"); + Logger.WARNING("4"); int mMulti; if ((mitemCurrentCharge + (mVoltageIncrease*20)) <= (mItemMaxCharge - (mVoltageIncrease*20))){ @@ -342,15 +339,15 @@ public class ChargingHelper { else { mMulti = 1; } - Utils.LOG_WARNING("5"); + Logger.WARNING("5"); int mMultiVoltage = (int) (mMulti*mVoltageIncrease); if ((mitemCurrentCharge + mMultiVoltage) <= mItemMaxCharge){ - Utils.LOG_WARNING("6"); + Logger.WARNING("6"); if (GT_ModHandler.chargeElectricItem(mTemp, mMultiVoltage, mTier, true, false) == 0){ - Utils.LOG_WARNING("6.5"); + Logger.WARNING("6.5"); for (int i=0; i<mMulti;i++){ if (ElectricItem.manager.charge(mTemp, mVoltageIncrease, mTier, false, false) == 0){ continue; @@ -358,10 +355,10 @@ public class ChargingHelper { } } if (ElectricItem.manager.getCharge(mTemp) > mitemCurrentCharge){ - Utils.LOG_WARNING("7"); - mEntity.setEUVar((long) (mEuStored-(mVoltage*mMulti))); + Logger.WARNING("7"); + mEntity.setEUVar(mEuStored-(mVoltage*mMulti)); mEuStored = mEntity.getEUVar(); - Utils.LOG_WARNING("Charged "+mTemp.getDisplayName()+" | Slot: "+mItemSlot+" | EU Multiplier: "+mMulti+" | EU/t input: "+mVoltageIncrease+" | EU/t consumed by Tile: "+mVoltage+" | Item Max Charge: "+mItemMaxCharge+" | Item Start Charge: "+mitemCurrentCharge+" | Item New Charge"+ElectricItem.manager.getCharge(mTemp)); + Logger.WARNING("Charged "+mTemp.getDisplayName()+" | Slot: "+mItemSlot+" | EU Multiplier: "+mMulti+" | EU/t input: "+mVoltageIncrease+" | EU/t consumed by Tile: "+mVoltage+" | Item Max Charge: "+mItemMaxCharge+" | Item Start Charge: "+mitemCurrentCharge+" | Item New Charge"+ElectricItem.manager.getCharge(mTemp)); mChargedItems++; } } @@ -371,7 +368,7 @@ public class ChargingHelper { } else { if (mTemp != null){ - Utils.LOG_WARNING("Found Non-Valid item. "+mTemp.getDisplayName()); + Logger.WARNING("Found Non-Valid item. "+mTemp.getDisplayName()); } } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/CraftingHelper.java b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/CraftingHelper.java index e3bfc81291..6a69c9f61a 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/CraftingHelper.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/CraftingHelper.java @@ -1,7 +1,7 @@ package gtPlusPlus.xmod.gregtech.common.helpers; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.xmod.gregtech.common.helpers.autocrafter.AC_Helper_Container; import gtPlusPlus.xmod.gregtech.common.helpers.autocrafter.AC_Helper_Utils; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GT4Entity_AutoCrafter; @@ -23,7 +23,7 @@ public class CraftingHelper{ public final AC_Helper_Container inventory; public CraftingHelper(GT4Entity_AutoCrafter AC){ - Utils.LOG_INFO("[A-C] Created a crafting helper."); + Logger.INFO("[A-C] Created a crafting helper."); crafter = AC; AC_Helper_Utils.addCrafter(AC); //Get some variables. diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java index 3a0031c5d3..d023307820 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java @@ -9,9 +9,9 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.common.items.GT_MetaGenerated_Item_02; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.slots.SlotBuzzSaw.SAWTOOL; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.fluid.FluidUtils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.particles.BlockBreakParticles; @@ -121,7 +121,7 @@ public class TreeFarmHelper { } final BonemealEvent event = new BonemealEvent(player, world, block, intX, intY, intZ); if (MinecraftForge.EVENT_BUS.post(event)){ - Utils.LOG_MACHINE_INFO("Not sure why this returned false"); + Logger.MACHINE_INFO("Not sure why this returned false"); return false; } if (event.getResult() == Result.ALLOW){ @@ -145,7 +145,7 @@ public class TreeFarmHelper { } public static boolean cleanUp(final IGregTechTileEntity aBaseMetaTileEntity){ - Utils.LOG_MACHINE_INFO("called cleanUp()"); + Logger.MACHINE_INFO("called cleanUp()"); int cleanedUp = 0; final int xDir = net.minecraftforge.common.util.ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 11; final int zDir = net.minecraftforge.common.util.ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 11; @@ -173,7 +173,7 @@ public class TreeFarmHelper { )){ if (!testBlock.getUnlocalizedName().toLowerCase().contains("air") || !testBlock.getUnlocalizedName().toLowerCase().contains("pumpkin")) { - Utils.LOG_INFO("5:"+testBlock.getUnlocalizedName()); + Logger.WARNING("5:"+testBlock.getUnlocalizedName()); } else { aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getXCoord()+xDir+i, aBaseMetaTileEntity.getYCoord()+h, aBaseMetaTileEntity.getZCoord()+zDir+j, Blocks.bookshelf); } @@ -193,14 +193,14 @@ public class TreeFarmHelper { ){ if (!testBlock.getUnlocalizedName().toLowerCase().contains("air") || !testBlock.getUnlocalizedName().toLowerCase().contains("pumpkin")) { - Utils.LOG_INFO("0:"+testBlock.getUnlocalizedName()); + Logger.WARNING("0:"+testBlock.getUnlocalizedName()); } else { aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getXCoord()+xDir+i, aBaseMetaTileEntity.getYCoord()+h, aBaseMetaTileEntity.getZCoord()+zDir+j, Blocks.melon_block); } if (TreefarmManager.isLeaves(testBlock) || TreefarmManager.isWoodLog(testBlock)){ - Utils.LOG_INFO("1:"+testBlock.getUnlocalizedName()); + Logger.WARNING("1:"+testBlock.getUnlocalizedName()); int posiX, posiY, posiZ; posiX = aBaseMetaTileEntity.getXCoord()+xDir+i; posiY = aBaseMetaTileEntity.getYCoord()+h; @@ -211,11 +211,11 @@ public class TreeFarmHelper { new BlockBreakParticles(aBaseMetaTileEntity.getWorld(), posiX, posiY, posiZ, Blocks.dirt); } else { - //Utils.LOG_INFO("2:"+testBlock.getUnlocalizedName()); + //Utils.LOG_WARNING("2:"+testBlock.getUnlocalizedName()); } } else { - //Utils.LOG_INFO("1"); + //Utils.LOG_WARNING("1"); } @@ -223,13 +223,13 @@ public class TreeFarmHelper { } } - Utils.LOG_MACHINE_INFO("cleaning up | "+cleanedUp ); + Logger.MACHINE_INFO("cleaning up | "+cleanedUp ); return true; } public static SAWTOOL isCorrectMachinePart(final ItemStack aStack) { if (aStack != null){ - //Utils.LOG_INFO("Found "+aStack.getDisplayName()+" in the GUI slot."); + //Utils.LOG_WARNING("Found "+aStack.getDisplayName()+" in the GUI slot."); if ((aStack.getItem() instanceof GT_MetaGenerated_Item_02) || (aStack.getItem() instanceof GT_MetaGenerated_Tool)){ if (OrePrefixes.craftingTool.contains(aStack)){ if (aStack.getDisplayName().toLowerCase().contains("saw") || aStack.getDisplayName().toLowerCase().contains("gt.metatool.01.10")){ diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/autocrafter/AC_Helper_Container.java b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/autocrafter/AC_Helper_Container.java index f5b066fdc2..b9a4d861b3 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/autocrafter/AC_Helper_Container.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/autocrafter/AC_Helper_Container.java @@ -1,14 +1,9 @@ package gtPlusPlus.xmod.gregtech.common.helpers.autocrafter; -import gtPlusPlus.core.util.Utils; +import gtPlusPlus.api.objects.Logger; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.InventoryCraftResult; -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.inventory.Slot; -import net.minecraft.inventory.SlotCrafting; +import net.minecraft.inventory.*; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.world.World; @@ -69,16 +64,18 @@ public class AC_Helper_Container extends Container /** * Callback for when the crafting matrix is changed. */ + @Override public void onCraftMatrixChanged(IInventory p_75130_1_) { this.craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj)); - Utils.LOG_INFO("Crafted "+this.craftResult.getStackInSlot(0)); + Logger.INFO("Crafted "+this.craftResult.getStackInSlot(0)); } /** * Called when the container is closed. */ + @Override public void onContainerClosed(EntityPlayer p_75134_1_) { super.onContainerClosed(p_75134_1_); @@ -97,6 +94,7 @@ public class AC_Helper_Container extends Container } } + @Override public boolean canInteractWith(EntityPlayer p_75145_1_) { return true; @@ -105,11 +103,13 @@ public class AC_Helper_Container extends Container /** * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. */ + @Override public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_){ ItemStack itemstack = null; return itemstack; } + @Override public boolean func_94530_a(ItemStack p_94530_1_, Slot p_94530_2_) { return p_94530_2_.inventory != this.craftResult && super.func_94530_a(p_94530_1_, p_94530_2_); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/autocrafter/AC_Helper_Utils.java b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/autocrafter/AC_Helper_Utils.java index 052b611250..84cf6067d1 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/autocrafter/AC_Helper_Utils.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/autocrafter/AC_Helper_Utils.java @@ -6,8 +6,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GT4Entity_AutoCrafter; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; @@ -26,11 +26,11 @@ public class AC_Helper_Utils { if (!sAutocrafterMap.containsValue(AC)){ int increase = sAutocrafterMap.size()+1; sAutocrafterMap.put(increase, AC); - Utils.LOG_INFO("[A-C] "+"Added Auto-Crafter to index on position "+increase+"."); + Logger.INFO("[A-C] "+"Added Auto-Crafter to index on position "+increase+"."); return increase; } else { - Utils.LOG_INFO("[A-C] Tried adding an Auto-Crafter to Index, but found one already there."); + Logger.INFO("[A-C] Tried adding an Auto-Crafter to Index, but found one already there."); } return 0; } @@ -68,7 +68,7 @@ public class AC_Helper_Utils { } } } - Utils.LOG_WARNING("Failed. [getCrafterByID]"); + Logger.WARNING("Failed. [getCrafterByID]"); return null; } @@ -83,7 +83,7 @@ public class AC_Helper_Utils { } } } - Utils.LOG_WARNING("Failed. [getIDByCrafter]"); + Logger.WARNING("Failed. [getIDByCrafter]"); return 0; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/tesseract/TesseractHelper.java b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/tesseract/TesseractHelper.java index 2773bea825..cbf6445559 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/tesseract/TesseractHelper.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/tesseract/TesseractHelper.java @@ -10,7 +10,7 @@ import java.util.Map.Entry; import static gtPlusPlus.core.lib.CORE.sTesseractGeneratorOwnershipMap; import static gtPlusPlus.core.lib.CORE.sTesseractTerminalOwnershipMap; -import gtPlusPlus.core.util.Utils; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_TesseractGenerator; import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_TesseractTerminal; import net.minecraft.entity.player.EntityPlayer; @@ -28,7 +28,7 @@ public class TesseractHelper { public final static boolean isGeneratorOwnedByPlayer(EntityPlayer player, GT_MetaTileEntity_TesseractGenerator generator) { if (player == null){ - Utils.LOG_WARNING("Failed. [isGeneratorOwnedByPlayer]"); + Logger.WARNING("Failed. [isGeneratorOwnedByPlayer]"); return false; } //Utils.LOG_WARNING("Success. [isGeneratorOwnedByPlayer] 1"); @@ -47,7 +47,7 @@ public class TesseractHelper { } } } - Utils.LOG_WARNING("Failed. [isGeneratorOwnedByPlayer]"); + Logger.WARNING("Failed. [isGeneratorOwnedByPlayer]"); return false; } @@ -58,7 +58,7 @@ public class TesseractHelper { return false; } UUID playerIdentifier = player.getUniqueID(); - Utils.LOG_WARNING("Setting Generator on "+freq+" for "+player.getDisplayName()+"."); + Logger.WARNING("Setting Generator on "+freq+" for "+player.getDisplayName()+"."); if (playerIdentifier != null) { Map<Integer, GT_MetaTileEntity_TesseractGenerator> playerOwned = sTesseractGeneratorOwnershipMap .get(playerIdentifier); @@ -66,7 +66,7 @@ public class TesseractHelper { Map<Integer, GT_MetaTileEntity_TesseractGenerator> newOwnershipMap = new HashMap<Integer, GT_MetaTileEntity_TesseractGenerator>(); newOwnershipMap.put(freq, generator); sTesseractGeneratorOwnershipMap.put(playerIdentifier, newOwnershipMap); - Utils.LOG_WARNING("Success! [Empty Map]"); + Logger.WARNING("Success! [Empty Map]"); return true; } else if (sTesseractGeneratorOwnershipMap.containsKey(playerIdentifier)) { Map<Integer, GT_MetaTileEntity_TesseractGenerator> ownershipMap = sTesseractGeneratorOwnershipMap @@ -76,11 +76,11 @@ public class TesseractHelper { } ownershipMap.put(freq, generator); sTesseractGeneratorOwnershipMap.put(playerIdentifier, ownershipMap); - Utils.LOG_WARNING("Success!"); + Logger.WARNING("Success!"); return true; } } - Utils.LOG_WARNING("Failed. [setGeneratorOwnershipByPlayer]"); + Logger.WARNING("Failed. [setGeneratorOwnershipByPlayer]"); return false; } @@ -91,7 +91,7 @@ public class TesseractHelper { return null; } UUID playerIdentifier = player.getUniqueID(); - Utils.LOG_WARNING("Getting Generator on "+freq+" for "+player.getDisplayName()+"."); + Logger.WARNING("Getting Generator on "+freq+" for "+player.getDisplayName()+"."); if (!sTesseractGeneratorOwnershipMap.isEmpty() && playerIdentifier != null) { //Utils.LOG_WARNING("Success. [getGeneratorByFrequency] 1"); Map<Integer, GT_MetaTileEntity_TesseractGenerator> generators = getGeneratorOwnershipByPlayer(player); @@ -102,12 +102,12 @@ public class TesseractHelper { Entry<Integer, GT_MetaTileEntity_TesseractGenerator> current = i.next(); if (current.getKey().equals(freq)) { //Utils.LOG_WARNING("Success. [getGeneratorByFrequency] 3"); - Utils.LOG_WARNING("Success!"); + Logger.WARNING("Success!"); return current.getValue(); } } } - Utils.LOG_WARNING("Failed. [getGeneratorByFrequency]"); + Logger.WARNING("Failed. [getGeneratorByFrequency]"); return null; } @@ -161,14 +161,14 @@ public class TesseractHelper { } UUID playerIdentifier = player.getUniqueID(); if (playerIdentifier != null) { - Utils.LOG_WARNING("Setting Terminal on "+freq+" for "+player.getDisplayName()+"."); + Logger.WARNING("Setting Terminal on "+freq+" for "+player.getDisplayName()+"."); Map<Integer, GT_MetaTileEntity_TesseractTerminal> playerOwned = sTesseractTerminalOwnershipMap .get(playerIdentifier); if (playerOwned == null || playerOwned.isEmpty()) { Map<Integer, GT_MetaTileEntity_TesseractTerminal> newOwnershipMap = new HashMap<Integer, GT_MetaTileEntity_TesseractTerminal>(); newOwnershipMap.put(freq, generator); sTesseractTerminalOwnershipMap.put(playerIdentifier, newOwnershipMap); - Utils.LOG_WARNING("Success! [Empty Map]"); + Logger.WARNING("Success! [Empty Map]"); return true; } else if (sTesseractTerminalOwnershipMap.containsKey(playerIdentifier)) { Map<Integer, GT_MetaTileEntity_TesseractTerminal> ownershipMap = sTesseractTerminalOwnershipMap @@ -177,11 +177,11 @@ public class TesseractHelper { ownershipMap.put(freq, generator); } sTesseractTerminalOwnershipMap.put(playerIdentifier, ownershipMap); - Utils.LOG_WARNING("Success!"); + Logger.WARNING("Success!"); return true; } } - Utils.LOG_WARNING("Failed. [setTerminalOwnershipByPlayer]"); + Logger.WARNING("Failed. [setTerminalOwnershipByPlayer]"); return false; } @@ -192,7 +192,7 @@ public class TesseractHelper { return null; } UUID playerIdentifier = player.getUniqueID(); - Utils.LOG_WARNING("Getting Terminal on "+freq+" for "+player.getDisplayName()+"."); + Logger.WARNING("Getting Terminal on "+freq+" for "+player.getDisplayName()+"."); if (!sTesseractTerminalOwnershipMap.isEmpty() && playerIdentifier != null) { Map<Integer, GT_MetaTileEntity_TesseractTerminal> generators = getTerminalOwnershipByPlayer(player); Set<Entry<Integer, GT_MetaTileEntity_TesseractTerminal>> players = generators.entrySet(); @@ -200,12 +200,12 @@ public class TesseractHelper { while (i.hasNext()) { Entry<Integer, GT_MetaTileEntity_TesseractTerminal> current = i.next(); if (current.getKey().equals(freq)) { - Utils.LOG_WARNING("Success!"); + Logger.WARNING("Success!"); return current.getValue(); } } } - Utils.LOG_WARNING("Failed. [getTerminalByFrequency]"); + Logger.WARNING("Failed. [getTerminalByFrequency]"); return null; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java index 7a3862c34d..78d9a5867d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java @@ -12,6 +12,7 @@ import gregtech.api.util.*; import gregtech.common.covers.*; import gregtech.common.items.behaviors.Behaviour_DataOrb; import gregtech.common.items.behaviors.Behaviour_DataStick; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.recipe.RECIPES_Old_Circuits; import gtPlusPlus.core.util.StringUtils; @@ -35,7 +36,7 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { int tLastID = 0; if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){ - Utils.LOG_INFO("Gregtech 5.09 not found, using fallback components. (I like how I have to add compat to something I added first and had stolen.)"); + Logger.INFO("Gregtech 5.09 not found, using fallback components. (I like how I have to add compat to something I added first and had stolen.)"); GregtechItemList.Electric_Pump_LuV.set(this.addItem(tLastID = 0, "Electric Pump (LuV)", "163920 L/sec (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)})); GregtechItemList.Electric_Pump_ZPM.set(this.addItem(tLastID = 1, "Electric Pump (ZPM)", "655680 L/sec (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 2L), getTcAspectStack(TC_Aspects.MACHINA, 2L), getTcAspectStack(TC_Aspects.ITER, 2L), getTcAspectStack(TC_Aspects.AQUA, 2L)})); GregtechItemList.Electric_Pump_UV.set(this.addItem(tLastID = 2, "Electric Pump (UV)", "2622720 L/sec (as Cover)", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 4L), getTcAspectStack(TC_Aspects.MACHINA, 4L), getTcAspectStack(TC_Aspects.ITER, 4L), getTcAspectStack(TC_Aspects.AQUA, 4L)})); @@ -299,7 +300,7 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { private boolean registerOldCircuits(){ //Enable Old Circuits - Utils.LOG_INFO("[Old Feature - Circuits] Enabling Pre-5.09.28 Circuits and Data Storage."); + Logger.INFO("[Old Feature - Circuits] Enabling Pre-5.09.28 Circuits and Data Storage."); GregtechItemList.Old_Circuit_Primitive.set(this.addItem(200, "NAND Chip", "A very simple Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Primitive)})); GregtechItemList.Old_Circuit_Basic.set(this.addItem(201, "Basic Electronic Circuit", "A basic Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Basic)})); 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<FluidStack> tFluids = this.getStoredFluids(); final Collection<GT_Recipe> 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))){ FluidStack depletionStack = FluidUtils.getFluidStack(tLiquid, (this.boostEu ? (aFuel.mSpecialValue/4096) : (aFuel.mSpecialValue/2048))); - Utils.LOG_WARNING("Input hatch contains some FLiBe Fuel, using "+this.fuelConsumption+" | "+aFuel.mSpecialValue+" | "+depletionStack.amount); + Logger.WARNING("Input hatch contains some FLiBe Fuel, using "+this.fuelConsumption+" | "+aFuel.mSpecialValue+" | "+depletionStack.amount); if(this.depleteInput(depletionStack)) { //Deplete that amount - Utils.LOG_WARNING("Depleted some FLiBe fluid"); + Logger.WARNING("Depleted some FLiBe fluid"); } this.depleteInput(NUCLIDE.LiFBeF2ThF4UF4.getFluid(this.boostEu ? 2 : 1)); - Utils.LOG_WARNING("Depleted "+(this.boostEu ? 2 : 1)+"L of LiFBeF2ThF4UF4 fluid"); + Logger.WARNING("Depleted "+(this.boostEu ? 2 : 1)+"L of LiFBeF2ThF4UF4 fluid"); } //1/2 as Efficient if (tFluids.contains(NUCLIDE.LiFBeF2ZrF4UF4.getFluid(4))){ FluidStack depletionStack = FluidUtils.getFluidStack(tLiquid, (this.boostEu ? (aFuel.mSpecialValue/4096) : (aFuel.mSpecialValue/2048))); - Utils.LOG_WARNING("Input hatch contains some FLiBe Fuel, using "+this.fuelConsumption+" | "+aFuel.mSpecialValue+" | "+depletionStack.amount); + Logger.WARNING("Input hatch contains some FLiBe Fuel, using "+this.fuelConsumption+" | "+aFuel.mSpecialValue+" | "+depletionStack.amount); if(this.depleteInput(depletionStack)) { //Deplete that amount - Utils.LOG_WARNING("Depleted some FLiBe fluid"); + Logger.WARNING("Depleted some FLiBe fluid"); } this.depleteInput(NUCLIDE.LiFBeF2ZrF4UF4.getFluid(this.boostEu ? 4 : 2)); - Utils.LOG_WARNING("Depleted "+(this.boostEu ? 4 : 2)+"L of LiFBeF2ZrF4UF4 fluid"); + Logger.WARNING("Depleted "+(this.boostEu ? 4 : 2)+"L of LiFBeF2ZrF4UF4 fluid"); } //10x less Efficient. if (tFluids.contains(NUCLIDE.LiFBeF2ZrF4U235.getFluid(20))) { FluidStack depletionStack = FluidUtils.getFluidStack(tLiquid, (this.boostEu ? (aFuel.mSpecialValue/4096) : (aFuel.mSpecialValue/2048))); - Utils.LOG_WARNING("Input hatch contains some FLiBe Fuel, using "+this.fuelConsumption+" | "+aFuel.mSpecialValue+" | "+depletionStack.amount); + Logger.WARNING("Input hatch contains some FLiBe Fuel, using "+this.fuelConsumption+" | "+aFuel.mSpecialValue+" | "+depletionStack.amount); if(this.depleteInput(depletionStack)) { //Deplete that amount - Utils.LOG_WARNING("Depleted some FLiBe fluid"); + Logger.WARNING("Depleted some FLiBe fluid"); } this.depleteInput(NUCLIDE.LiFBeF2ZrF4U235.getFluid(this.boostEu ? 20 : 10)); - Utils.LOG_WARNING("Depleted "+(this.boostEu ? 20 : 10)+"L of LiFBeF2ZrF4U235 fluid"); + Logger.WARNING("Depleted "+(this.boostEu ? 20 : 10)+"L of LiFBeF2ZrF4U235 fluid"); } } } else { @@ -452,7 +452,7 @@ public class GregtechMTE_NuclearReactor extends GT_MetaTileEntity_MultiBlockBase if (this.depleteInput(Materials.Helium.getGas(1000L))){ //Make an empty fluid stack for possible sparging output FluidStack[] spargeOutput = new FluidStack[]{}; - Utils.LOG_WARNING("Doing a Sparge with Helium - "+this.heliumSparging); + Logger.WARNING("Doing a Sparge with Helium - "+this.heliumSparging); this.heliumSparging = false; spargeOutput = this.getByproductsOfSparge(Materials.Helium.getGas(1000L)); @@ -460,7 +460,7 @@ public class GregtechMTE_NuclearReactor extends GT_MetaTileEntity_MultiBlockBase try { if (spargeOutput.length >= 1){ for (final FluidStack F : spargeOutput){ - Utils.LOG_WARNING("Adding Sparge Output - "+F.getLocalizedName()); + Logger.WARNING("Adding Sparge Output - "+F.getLocalizedName()); this.addOutput(F); } } @@ -472,13 +472,13 @@ public class GregtechMTE_NuclearReactor extends GT_MetaTileEntity_MultiBlockBase if (this.depleteInput(Materials.Fluorine.getGas(100L))){ //Make an empty fluid stack for possible sparging output FluidStack[] spargeOutput = new FluidStack[]{}; - Utils.LOG_WARNING("Doing a Sparge with Fluorine"); + Logger.WARNING("Doing a Sparge with Fluorine"); spargeOutput = this.getByproductsOfSparge(Materials.Fluorine.getGas(100L)); this.heliumSparging = true; //If Sparging occurred, try add the outputs to the output hatches. if (spargeOutput.length > 0){ for (final FluidStack F : spargeOutput){ - Utils.LOG_WARNING("Adding Sparge Output - "+F.getLocalizedName()); + Logger.WARNING("Adding Sparge Output - "+F.getLocalizedName()); this.addOutput(F); } } @@ -504,10 +504,10 @@ public class GregtechMTE_NuclearReactor extends GT_MetaTileEntity_MultiBlockBase else if (this.mEfficiency > 500){ this.mEfficiency = 500; } - Utils.LOG_WARNING("Efficiency == "+this.mEfficiency); + Logger.WARNING("Efficiency == "+this.mEfficiency); this.mEUt = (this.mEfficiency < 500 ? 2048 : (8196)); //Output 0 if startup is less than 20% - Utils.LOG_WARNING("Generating "+this.mEUt+"EU/t @ an efficiency level of "+this.mEfficiency); + Logger.WARNING("Generating "+this.mEUt+"EU/t @ an efficiency level of "+this.mEfficiency); this.mProgresstime = 1; this.mMaxProgresstime = 1; @@ -586,7 +586,7 @@ public class GregtechMTE_NuclearReactor extends GT_MetaTileEntity_MultiBlockBase MathUtils.roundToClosestInt(MathUtils.randInt(10, 100)/10) }; final int heliumContent = (1000-outputChances[0]-outputChances[1]-outputChances[2]-outputChances[3]-outputChances[4]); - Utils.LOG_WARNING("Helium remaining: "+heliumContent); + Logger.WARNING("Helium remaining: "+heliumContent); outputArrayOfGases = new FluidStack[]{ ELEMENT.getInstance().XENON.getFluid(outputChances[0]), ELEMENT.getInstance().NEON.getFluid(outputChances[1]), @@ -604,7 +604,7 @@ public class GregtechMTE_NuclearReactor extends GT_MetaTileEntity_MultiBlockBase MathUtils.roundToClosestInt(MathUtils.randDouble(1, 50)/10) }; final int fluorineContent = (100-outputChances[0]-outputChances[1]-outputChances[2]-outputChances[3]); - Utils.LOG_WARNING("Fluorine remaining: "+fluorineContent); + Logger.WARNING("Fluorine remaining: "+fluorineContent); outputArrayOfGases = new FluidStack[]{ FLUORIDES.LITHIUM_FLUORIDE.getFluid(outputChances[0]), FLUORIDES.NEPTUNIUM_HEXAFLUORIDE.getFluid(outputChances[1]), diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityAnimalFarm.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityAnimalFarm.java index d55912badc..da83b3c3d1 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityAnimalFarm.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityAnimalFarm.java @@ -13,8 +13,8 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachi import gregtech.api.objects.GT_ItemStack; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.LoadedMods; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.xmod.forestry.trees.TreefarmManager; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.block.Block; @@ -111,7 +111,7 @@ public class GregtechMetaTileEntityAnimalFarm extends GT_MetaTileEntity_MultiBlo @Override public boolean checkRecipe(final ItemStack aStack) { - Utils.LOG_INFO("Working"); + Logger.INFO("Working"); /*if (!checkRecursiveBlocks()) { this.mEfficiency = 0; this.mEfficiencyIncrease = 0; @@ -145,28 +145,28 @@ public class GregtechMetaTileEntityAnimalFarm extends GT_MetaTileEntity_MultiBlo public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { //this.mCasings.clear(); - Utils.LOG_INFO("Step 1"); + Logger.INFO("Step 1"); final int xDir = net.minecraftforge.common.util.ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 7; final int zDir = net.minecraftforge.common.util.ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 7; for (int i = -7; i <= 7; i++) { - Utils.LOG_INFO("Step 2"); + Logger.INFO("Step 2"); for (int j = -7; j <= 7; j++) { - Utils.LOG_INFO("Step 3"); + Logger.INFO("Step 3"); for (int h = 0; h <= 1; h++) { - Utils.LOG_INFO("Step 4"); + Logger.INFO("Step 4"); final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j); //Farm Floor inner 14x14 if (((i != -7) && (i != 7)) && ((j != -7) && (j != 7))) { - Utils.LOG_INFO("Step 5 - H:"+h); + Logger.INFO("Step 5 - H:"+h); // Farm Dirt Floor and Inner Air/Log space. if (h == 0) { //Dirt Floor if (!TreefarmManager.isDirtBlock(aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j))) { - Utils.LOG_INFO("Dirt like block missing from inner 14x14."); - Utils.LOG_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); + Logger.INFO("Dirt like block missing from inner 14x14."); + Logger.INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); aBaseMetaTileEntity.getWorld().setBlock( (aBaseMetaTileEntity.getXCoord()+(xDir+i)), (aBaseMetaTileEntity.getYCoord()+(h)), @@ -189,12 +189,12 @@ public class GregtechMetaTileEntityAnimalFarm extends GT_MetaTileEntity_MultiBlo } //Dealt with inner 5x5, now deal with the exterior. else { - Utils.LOG_INFO("Step 6 - H:"+h); + Logger.INFO("Step 6 - H:"+h); //Deal with all 4 sides (Fenced area) if (h == 1) { if (!TreefarmManager.isFenceBlock(aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j))) { - Utils.LOG_INFO("Fence/Gate missing from outside the second layer."); - Utils.LOG_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); + Logger.INFO("Fence/Gate missing from outside the second layer."); + Logger.INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); return false; } } @@ -209,31 +209,31 @@ public class GregtechMetaTileEntityAnimalFarm extends GT_MetaTileEntity_MultiBlo if (((xDir + i) != 0) || ((zDir + j) != 0)) {//no controller if (!(aBaseMetaTileEntity.getMetaTileID() != 752)) { - Utils.LOG_INFO("Fark Keeper Casings Missing from one of the edges on the bottom edge. x:"+(xDir+i)+" y:"+h+" z:"+(zDir+j)+" | "+aBaseMetaTileEntity.getClass()); - Utils.LOG_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); + Logger.INFO("Fark Keeper Casings Missing from one of the edges on the bottom edge. x:"+(xDir+i)+" y:"+h+" z:"+(zDir+j)+" | "+aBaseMetaTileEntity.getClass()); + Logger.INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); return false; } - Utils.LOG_INFO("Found a farm keeper."); + Logger.INFO("Found a farm keeper."); } } } - Utils.LOG_INFO("Step a"); + Logger.INFO("Step a"); } - Utils.LOG_INFO("Step b"); + Logger.INFO("Step b"); } - Utils.LOG_INFO("Step c"); + Logger.INFO("Step c"); } - Utils.LOG_INFO("Step d"); + Logger.INFO("Step d"); } - Utils.LOG_INFO("Step 7"); + Logger.INFO("Step 7"); //Must have at least one energy hatch. if (this.mEnergyHatches != null) { for (int i = 0; i < this.mEnergyHatches.size(); i++) { if (this.mEnergyHatches.get(i).mTier < 2){ - Utils.LOG_INFO("You require at LEAST MV tier Energy 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 MV tier Energy Hatches."); + Logger.INFO(this.mOutputHatches.get(i).getBaseMetaTileEntity().getXCoord()+","+this.mOutputHatches.get(i).getBaseMetaTileEntity().getYCoord()+","+this.mOutputHatches.get(i).getBaseMetaTileEntity().getZCoord()); return false; } } @@ -243,9 +243,9 @@ public class GregtechMetaTileEntityAnimalFarm extends GT_MetaTileEntity_MultiBlo for (int i = 0; i < this.mOutputHatches.size(); i++) { if ((this.mOutputHatches.get(i).mTier < 2) && (this.mOutputHatches.get(i).getBaseMetaTileEntity() instanceof GregtechMTE_NuclearReactor)){ - Utils.LOG_INFO("You require at LEAST MV 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 MV 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; } } @@ -254,16 +254,16 @@ public class GregtechMetaTileEntityAnimalFarm extends GT_MetaTileEntity_MultiBlo if (this.mInputHatches != null) { for (int i = 0; i < this.mInputHatches.size(); i++) { if (this.mInputHatches.get(i).mTier < 2){ - Utils.LOG_INFO("You require at LEAST MV 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 MV 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; } } } this.mSolderingTool = true; //turnCasingActive(true); - Utils.LOG_INFO("Multiblock Formed."); + Logger.INFO("Multiblock Formed."); return true; } @@ -326,7 +326,7 @@ public class GregtechMetaTileEntityAnimalFarm extends GT_MetaTileEntity_MultiBlo //System.out.println("After: "+cv.mTextures.hashCode()); return cv; } catch (final NoSuchFieldException e) { - Utils.LOG_INFO("Could not find mTextures."); + Logger.INFO("Could not find mTextures."); return casing; } } catch (SecurityException | IllegalArgumentException | IllegalAccessException e) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityGeneratorArray.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityGeneratorArray.java index a6b3944a06..12329c875f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityGeneratorArray.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityGeneratorArray.java @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi; +import java.util.*; + import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_MultiMachine; @@ -9,18 +11,13 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map; -import gtPlusPlus.core.util.Utils; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.util.fluid.FluidUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.List; public class GregtechMetaTileEntityGeneratorArray extends GregtechMeta_MultiBlockBase { @@ -34,10 +31,12 @@ public class GregtechMetaTileEntityGeneratorArray extends GregtechMeta_MultiBloc super(aName); } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GregtechMetaTileEntityGeneratorArray(this.mName); } + @Override public String[] getDescription() { return new String[]{ "Controller Block for the Generator Array", @@ -51,6 +50,7 @@ public class GregtechMetaTileEntityGeneratorArray extends GregtechMeta_MultiBloc "Place up to 16 Single Block GT Generators into the Controller Inventory"}; } + @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == aFacing) { return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[48], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)}; @@ -58,10 +58,12 @@ public class GregtechMetaTileEntityGeneratorArray extends GregtechMeta_MultiBloc return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[48]}; } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ProcessingArray.png"); } + @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { if (mInventory[1] == null) return null; String tmp = mInventory[1].getUnlocalizedName().replaceAll("gt\\.blockmachines\\.basicgenerator\\.", ""); @@ -93,6 +95,7 @@ public class GregtechMetaTileEntityGeneratorArray extends GregtechMeta_MultiBloc return null; } + @Override public boolean isCorrectMachinePart(ItemStack aStack) { if (aStack != null && aStack.getUnlocalizedName().startsWith("gt.blockmachines.")) { return true; @@ -100,11 +103,13 @@ public class GregtechMetaTileEntityGeneratorArray extends GregtechMeta_MultiBloc return false; } + @Override public boolean isFacingValid(byte aFacing) { return aFacing > 1; } public String mMachine = ""; + @Override public boolean checkRecipe(ItemStack aStack) { if (!isCorrectMachinePart(mInventory[1])) { return false; @@ -138,17 +143,17 @@ public class GregtechMetaTileEntityGeneratorArray extends GregtechMeta_MultiBloc if(!mMachine.equals(mInventory[1].getUnlocalizedName()))mLastRecipe=null; mMachine = mInventory[1].getUnlocalizedName(); - Utils.LOG_WARNING("mMachine: "+mMachine); + Logger.WARNING("mMachine: "+mMachine); ArrayList<FluidStack> tFluids = getStoredFluids(); Collection<GT_Recipe> tRecipeList = this.getRecipeMap().mRecipeList; - Utils.LOG_WARNING("tRecipeList: "+tRecipeList); + Logger.WARNING("tRecipeList: "+tRecipeList); if(tFluids.size() > 0 && tRecipeList != null) { //Does input hatch have a diesel fuel? - Utils.LOG_WARNING("1"); + Logger.WARNING("1"); for (FluidStack hatchFluid1 : tFluids) { //Loops through hatches - Utils.LOG_WARNING("2"); + Logger.WARNING("2"); for(GT_Recipe aFuel : tRecipeList) { //Loops through diesel fuel recipes - Utils.LOG_WARNING("3"); + Logger.WARNING("3"); /*if (aFuel != null){ for (FluidStack x : aFuel.mFluidInputs){ if (x != null){ @@ -158,12 +163,12 @@ public class GregtechMetaTileEntityGeneratorArray extends GregtechMeta_MultiBloc }*/ FluidStack tLiquid; tLiquid = FluidUtils.getFluidStack(aFuel.mFluidInputs[0], aFuel.mFluidInputs[0].amount); - Utils.LOG_WARNING("5"); + Logger.WARNING("5"); fuelConsumption = aFuel.mFluidInputs[0].amount; if(depleteInput(tLiquid)) { //Deplete that amount - Utils.LOG_WARNING("6"); + Logger.WARNING("6"); boostEu = true; - Utils.LOG_WARNING("7"); + Logger.WARNING("7"); fuelValue = aFuel.mEUt*aFuel.mDuration; fuelRemaining = hatchFluid1.amount; //Record available fuel @@ -171,7 +176,7 @@ public class GregtechMetaTileEntityGeneratorArray extends GregtechMeta_MultiBloc //this.mProgresstime = 1; this.mMaxProgresstime = 20; this.mEfficiencyIncrease = 9500; - Utils.LOG_WARNING("9"); + Logger.WARNING("9"); return true; } } @@ -190,6 +195,7 @@ public class GregtechMetaTileEntityGeneratorArray extends GregtechMeta_MultiBloc return list.toArray(new ItemStack[list.size()]); } + @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; @@ -218,22 +224,27 @@ public class GregtechMetaTileEntityGeneratorArray extends GregtechMeta_MultiBloc return tAmount >= 16; } + @Override public int getMaxEfficiency(ItemStack aStack) { return 10000; } + @Override public int getPollutionPerTick(ItemStack aStack) { return 0; } + @Override public int getDamageToComponent(ItemStack aStack) { return 0; } + @Override public boolean explodesOnComponentBreak(ItemStack aStack) { return false; } + @Override public int getAmountOfOutputs() { return 1; } 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 6d951b7221..e349ae1f53 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 @@ -18,14 +18,12 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.*; import gregtech.api.objects.GT_ItemStack; 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.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.players.FakeFarmer; import gtPlusPlus.core.slots.SlotBuzzSaw.SAWTOOL; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.particles.BlockBreakParticles; @@ -36,9 +34,7 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.Gregtech import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.helpers.TreeFarmHelper; import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.*; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; @@ -101,7 +97,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase @Override public void saveNBTData(final NBTTagCompound aNBT) { - Utils.LOG_INFO("Called NBT data save"); + Logger.WARNING("Called NBT data save"); aNBT.setLong("mInternalPower", this.mInternalPower); //Save [Buzz]Saw @@ -112,7 +108,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase final NBTTagCompound data = new NBTTagCompound(); stack.writeToNBT(data); data.setInteger("Slot", i); - Utils.LOG_INFO("Saving "+stack.getDisplayName()+" in slot "+i); + Logger.WARNING("Saving "+stack.getDisplayName()+" in slot "+i); list.appendTag(data); } } @@ -132,7 +128,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase final int slot = data.getInteger("Slot"); if((slot >= 0) && (slot < 2)){ this.mInventory[slot] = ItemStack.loadItemStackFromNBT(data); - Utils.LOG_INFO("Loading "+this.mInventory[slot].getDisplayName()+" in slot "+i); + Logger.WARNING("Loading "+this.mInventory[slot].getDisplayName()+" in slot "+i); } } @@ -143,7 +139,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase public boolean drainEnergyInput(final long aEU) { if (this.mInternalPower >= 32){ this.mInternalPower = (this.mInternalPower-32); - Utils.LOG_MACHINE_INFO("Draining internal power storage by 32EU. Stored:"+this.mInternalPower); + Logger.MACHINE_INFO("Draining internal power storage by 32EU. Stored:"+this.mInternalPower); return true;} return false; } @@ -163,7 +159,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase } } else { - Utils.LOG_MACHINE_INFO("Bad Power hatch to obtain energy from."); + Logger.MACHINE_INFO("Bad Power hatch to obtain energy from."); } } } @@ -238,7 +234,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase @Override public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { if (aBaseMetaTileEntity.isClientSide() || aBaseMetaTileEntity.getWorld().isRemote) { - Utils.LOG_INFO("Doing nothing Client Side."); + Logger.WARNING("Doing nothing Client Side."); return false; } aBaseMetaTileEntity.openGUI(aPlayer); @@ -257,7 +253,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase @Override public boolean checkRecipe(final ItemStack aStack) { - Utils.LOG_MACHINE_INFO("Working"); + Logger.MACHINE_INFO("Working"); this.mEfficiency = 0; this.mEfficiencyIncrease = 0; this.mMaxProgresstime = 0; @@ -266,38 +262,38 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase @Override public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { - Utils.LOG_WARNING("Step 1"); + Logger.WARNING("Step 1"); final int xDir = net.minecraftforge.common.util.ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 7; final int zDir = net.minecraftforge.common.util.ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 7; for (int i = -7; i <= 7; i++) { - Utils.LOG_WARNING("Step 2"); + Logger.WARNING("Step 2"); for (int j = -7; j <= 7; j++) { - Utils.LOG_WARNING("Step 3"); + Logger.WARNING("Step 3"); for (int h = 0; h <= 1; h++) { - Utils.LOG_WARNING("Step 4"); + Logger.WARNING("Step 4"); final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j); //Farm Floor inner 14x14 if (((i != -7) && (i != 7)) && ((j != -7) && (j != 7))) { - Utils.LOG_WARNING("Step 5 - H:"+h); + Logger.WARNING("Step 5 - H:"+h); // Farm Dirt Floor and Inner Air/Log space. if (h == 0) { //Dirt Floor if (!TreefarmManager.isDirtBlock(aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j))) { - Utils.LOG_MACHINE_INFO("Dirt like block missing from inner 14x14."); - Utils.LOG_MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); + Logger.MACHINE_INFO("Dirt like block missing from inner 14x14."); + Logger.MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); return false; } } } //Dealt with inner 5x5, now deal with the exterior. else { - Utils.LOG_WARNING("Step 6 - H:"+h); + Logger.WARNING("Step 6 - H:"+h); //Deal with all 4 sides (Fenced area) if (h == 1) { if (!TreefarmManager.isFenceBlock(aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j))) { - Utils.LOG_MACHINE_INFO("Fence/Gate missing from outside the second layer."); - Utils.LOG_MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); + Logger.MACHINE_INFO("Fence/Gate missing from outside the second layer."); + Logger.MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); return false; } } @@ -308,11 +304,11 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase if (((xDir + i) != 0) || ((zDir + j) != 0)) {//no controller if (tTileEntity.getMetaTileID() != 752) { - Utils.LOG_MACHINE_INFO("Farm Keeper Casings Missing from one of the edges on the bottom edge. x:"+(xDir+i)+" y:"+h+" z:"+(zDir+j)+" | "+aBaseMetaTileEntity.getClass()); - Utils.LOG_MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()+" "+tTileEntity.getMetaTileID()); + Logger.MACHINE_INFO("Farm Keeper Casings Missing from one of the edges on the bottom edge. x:"+(xDir+i)+" y:"+h+" z:"+(zDir+j)+" | "+aBaseMetaTileEntity.getClass()); + Logger.MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()+" "+tTileEntity.getMetaTileID()); return false; } - Utils.LOG_WARNING("Found a farm keeper."); + Logger.WARNING("Found a farm keeper."); } } } @@ -325,8 +321,8 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase if (this.mEnergyHatches != null) { for (int i = 0; i < this.mEnergyHatches.size(); i++) { if (this.mEnergyHatches.get(i).mTier < 2){ - Utils.LOG_MACHINE_INFO("You require at LEAST MV tier Energy Hatches."); - Utils.LOG_MACHINE_INFO(this.mOutputHatches.get(i).getBaseMetaTileEntity().getXCoord()+","+this.mOutputHatches.get(i).getBaseMetaTileEntity().getYCoord()+","+this.mOutputHatches.get(i).getBaseMetaTileEntity().getZCoord()); + Logger.MACHINE_INFO("You require at LEAST MV tier Energy Hatches."); + Logger.MACHINE_INFO(this.mOutputHatches.get(i).getBaseMetaTileEntity().getXCoord()+","+this.mOutputHatches.get(i).getBaseMetaTileEntity().getYCoord()+","+this.mOutputHatches.get(i).getBaseMetaTileEntity().getZCoord()); return false; } } @@ -336,9 +332,9 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase for (int i = 0; i < this.mOutputHatches.size(); i++) { if ((this.mOutputHatches.get(i).mTier < 2) && (this.mOutputHatches.get(i).getBaseMetaTileEntity() instanceof GregtechMTE_NuclearReactor)){ - Utils.LOG_MACHINE_INFO("You require at LEAST MV tier Output Hatches."); - Utils.LOG_MACHINE_INFO(this.mOutputHatches.get(i).getBaseMetaTileEntity().getXCoord()+","+this.mOutputHatches.get(i).getBaseMetaTileEntity().getYCoord()+","+this.mOutputHatches.get(i).getBaseMetaTileEntity().getZCoord()); - Utils.LOG_MACHINE_INFO(this.mOutputHatches.get(i).getBaseMetaTileEntity().getInventoryName()); + Logger.MACHINE_INFO("You require at LEAST MV tier Output Hatches."); + Logger.MACHINE_INFO(this.mOutputHatches.get(i).getBaseMetaTileEntity().getXCoord()+","+this.mOutputHatches.get(i).getBaseMetaTileEntity().getYCoord()+","+this.mOutputHatches.get(i).getBaseMetaTileEntity().getZCoord()); + Logger.MACHINE_INFO(this.mOutputHatches.get(i).getBaseMetaTileEntity().getInventoryName()); return false; } } @@ -347,15 +343,15 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase if (this.mInputHatches != null) { for (int i = 0; i < this.mInputHatches.size(); i++) { if (this.mInputHatches.get(i).mTier < 2){ - Utils.LOG_MACHINE_INFO("You require at LEAST MV tier Input Hatches."); - Utils.LOG_MACHINE_INFO(this.mOutputHatches.get(i).getBaseMetaTileEntity().getXCoord()+","+this.mOutputHatches.get(i).getBaseMetaTileEntity().getYCoord()+","+this.mOutputHatches.get(i).getBaseMetaTileEntity().getZCoord()); - Utils.LOG_MACHINE_INFO(this.mOutputHatches.get(i).getBaseMetaTileEntity().getInventoryName()); + Logger.MACHINE_INFO("You require at LEAST MV tier Input Hatches."); + Logger.MACHINE_INFO(this.mOutputHatches.get(i).getBaseMetaTileEntity().getXCoord()+","+this.mOutputHatches.get(i).getBaseMetaTileEntity().getYCoord()+","+this.mOutputHatches.get(i).getBaseMetaTileEntity().getZCoord()); + Logger.MACHINE_INFO(this.mOutputHatches.get(i).getBaseMetaTileEntity().getInventoryName()); return false; } } } this.mSolderingTool = true; - Utils.LOG_MACHINE_INFO("Multiblock Formed."); + Logger.MACHINE_INFO("Multiblock Formed."); return true; } @@ -374,6 +370,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase return 0;//moved to cut log instead } + @Override public int getAmountOfOutputs() { return 1; } @@ -412,7 +409,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase private boolean findLogs(final IGregTechTileEntity aBaseMetaTileEntity){ - Utils.LOG_MACHINE_INFO("called findLogs()"); + Logger.MACHINE_INFO("called findLogs()"); int logsCut = 0; boolean stopCheck = false; final int xDir = net.minecraftforge.common.util.ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 7; @@ -447,8 +444,8 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase } if (stopCheck){ - Utils.LOG_MACHINE_INFO("Either found too many logs, so taking a break mid cut for lag conservation, or found no trees to cut, so stopping"); - Utils.LOG_MACHINE_INFO("found: "+logsCut +" and check up to h:"+h+" - Taking Break:"+ takingBreak); + Logger.MACHINE_INFO("Either found too many logs, so taking a break mid cut for lag conservation, or found no trees to cut, so stopping"); + Logger.MACHINE_INFO("found: "+logsCut +" and check up to h:"+h+" - Taking Break:"+ takingBreak); stopCheck = false; break OUTER; } @@ -460,20 +457,20 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase if (TreefarmManager.isWoodLog(loopBlock) || TreefarmManager.isLeaves(loopBlock)){ final long tempStoredEU = this.mInternalPower; if (tempStoredEU >= powerDrain){ - Utils.LOG_MACHINE_INFO("Cutting a "+loopBlock.getLocalizedName()+", currently stored:"+tempStoredEU+" | max:"+this.maxEUStore()); + Logger.MACHINE_INFO("Cutting a "+loopBlock.getLocalizedName()+", currently stored:"+tempStoredEU+" | max:"+this.maxEUStore()); this.drainEnergyInput(powerDrain); final long tempStoredEU2 = this.mInternalPower; if (tempStoredEU != tempStoredEU2){ if (tempStoredEU == (tempStoredEU2+powerDrain)){ - Utils.LOG_MACHINE_INFO(powerDrain+"EU was drained."); + Logger.MACHINE_INFO(powerDrain+"EU was drained."); } else { - Utils.LOG_MACHINE_INFO(""+(tempStoredEU-tempStoredEU2)+"EU was drained."); + Logger.MACHINE_INFO(""+(tempStoredEU-tempStoredEU2)+"EU was drained."); } } else { - Utils.LOG_MACHINE_INFO("Stored EU did not change."); + Logger.MACHINE_INFO("Stored EU did not change."); } posX = aBaseMetaTileEntity.getXCoord()+xDir+i; @@ -485,7 +482,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase } } else { - Utils.LOG_MACHINE_INFO("Not enough power to cut."); + Logger.MACHINE_INFO("Not enough power to cut."); } } } @@ -494,7 +491,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase } } else { - Utils.LOG_MACHINE_INFO("Not enough Power | can hold:"+this.maxEUStore()+" | holding:"+aBaseMetaTileEntity.getStoredEU()); + Logger.MACHINE_INFO("Not enough Power | can hold:"+this.maxEUStore()+" | holding:"+aBaseMetaTileEntity.getStoredEU()); } this.canChop = false; @@ -506,7 +503,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase private boolean growSaplingsWithBonemeal(final IGregTechTileEntity aBaseMetaTileEntity){ - Utils.LOG_MACHINE_INFO("called growSaplingsWithBonemeal()"); + Logger.MACHINE_INFO("called growSaplingsWithBonemeal()"); int saplings = 0; final int xDir = net.minecraftforge.common.util.ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 7; final int zDir = net.minecraftforge.common.util.ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 7; @@ -529,25 +526,25 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase TreeFarmHelper.applyBonemeal(this.getFakePlayer(), aBaseMetaTileEntity.getWorld(), posiX, posiY, posiZ, fertTier); } else { - Utils.LOG_MACHINE_INFO("x3"); + Logger.MACHINE_INFO("x3"); break; } } else { - Utils.LOG_MACHINE_INFO("x2"); + Logger.MACHINE_INFO("x2"); break; } } } } } - Utils.LOG_MACHINE_INFO("Tried to grow saplings: | "+saplings ); + Logger.MACHINE_INFO("Tried to grow saplings: | "+saplings ); return true; } @SuppressWarnings("deprecation") private boolean plantSaplings(final IGregTechTileEntity aBaseMetaTileEntity){ - Utils.LOG_MACHINE_INFO("called plantSaplings()"); + Logger.MACHINE_INFO("called plantSaplings()"); final World world = aBaseMetaTileEntity.getWorld(); ArrayList<ItemStack> r = this.getStoredInputs(); final int saplings = 0; @@ -555,12 +552,12 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase final int zDir = net.minecraftforge.common.util.ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 7; int counter = 0; if (r.size() > 0){ - Utils.LOG_MACHINE_INFO("| r was not null. "+r.size()+" |"); + Logger.MACHINE_INFO("| r was not null. "+r.size()+" |"); if (this.getStoredInternalPower() >= 32) { OUTER : for (final ItemStack n : r){ - Utils.LOG_MACHINE_INFO("found "+n.getDisplayName()); + Logger.MACHINE_INFO("found "+n.getDisplayName()); if (OrePrefixes.sapling.contains(n) || n.getDisplayName().toLowerCase().contains("sapling")){ - Utils.LOG_MACHINE_INFO(""+n.getDisplayName()); + Logger.MACHINE_INFO(""+n.getDisplayName()); counter = n.stackSize; final Block saplingToPlace = Block.getBlockFromItem(n.getItem()); @@ -602,18 +599,18 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase //Test If Inputs Changed final ArrayList<ItemStack> temp = this.getStoredInputs(); if (r != temp){ - Utils.LOG_MACHINE_INFO("Inputs changed, updating."); + Logger.MACHINE_INFO("Inputs changed, updating."); for (final ItemStack xr : r){ - Utils.LOG_MACHINE_INFO("xr:"+xr.getDisplayName()+"x"+xr.stackSize); + Logger.MACHINE_INFO("xr:"+xr.getDisplayName()+"x"+xr.stackSize); } for (final ItemStack xc : temp){ - Utils.LOG_MACHINE_INFO("xc:"+xc.getDisplayName()+"x"+xc.stackSize); + Logger.MACHINE_INFO("xc:"+xc.getDisplayName()+"x"+xc.stackSize); } r = temp; } } else { - Utils.LOG_MACHINE_INFO(n.getDisplayName()+" did not have a valid block."); + Logger.MACHINE_INFO(n.getDisplayName()+" did not have a valid block."); } } else { @@ -631,7 +628,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase } } else { - Utils.LOG_MACHINE_INFO("item was not a sapling"); + Logger.MACHINE_INFO("item was not a sapling"); continue OUTER; } } @@ -643,13 +640,13 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase }*/ } } - Utils.LOG_MACHINE_INFO("Tried to plant saplings: | "+saplings ); + Logger.MACHINE_INFO("Tried to plant saplings: | "+saplings ); return true; } @Optional.Method(modid = "Forestry") public boolean plantSaplingAt(final ItemStack germling, final World world, final int x, final int y, final int z) { - Utils.LOG_MACHINE_INFO("Planting Sapling with Forestry method, since it's installed."); + Logger.MACHINE_INFO("Planting Sapling with Forestry method, since it's installed."); if (PluginManager.Module.ARBORICULTURE.isEnabled()) { final IIndividual tree = GeneticsUtil.getGeneticEquivalent(germling); if (!(tree instanceof ITree)) { @@ -677,7 +674,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase if (block.getUnlocalizedName().toLowerCase().contains("leaves") || block.getUnlocalizedName().toLowerCase().contains("leaf") || TreefarmManager.isLeaves(block)){ chanceForLeaves = MathUtils.randInt(1, 10); if (chanceForLeaves > 8) { - Utils.LOG_MACHINE_INFO("Found some leaves that will drop, chance to drop item "+chanceForLeaves+", needed 800-1000."); + Logger.MACHINE_INFO("Found some leaves that will drop, chance to drop item "+chanceForLeaves+", needed 800-1000."); } } @@ -688,7 +685,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase final int multiplier = MathUtils.randInt(1, 3); if ((chanceForRubber > 7) && (chanceForLeaves > 8)){ rubberResin.stackSize = multiplier; - Utils.LOG_MACHINE_INFO("Adding "+rubberResin.getDisplayName()+" x"+rubberResin.stackSize); + Logger.MACHINE_INFO("Adding "+rubberResin.getDisplayName()+" x"+rubberResin.stackSize); this.addOutput(rubberResin); this.updateSlots(); } @@ -702,7 +699,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase if (drops != null){ for (final ItemStack outputs : drops){ if (chanceForLeaves > 8){ - Utils.LOG_MACHINE_INFO("Adding 1x "+outputs.getDisplayName()); + Logger.MACHINE_INFO("Adding 1x "+outputs.getDisplayName()); this.addOutput(outputs); //Update bus contents. this.updateSlots(); @@ -747,7 +744,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase } } else { - Utils.LOG_MACHINE_INFO("No fertiliser found."); + Logger.MACHINE_INFO("No fertiliser found."); return false; } return false; @@ -799,7 +796,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase } } } - Utils.LOG_MACHINE_INFO("No fertiliser found."); + Logger.MACHINE_INFO("No fertiliser found."); return false; } @@ -836,7 +833,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase return false; } - Utils.LOG_MACHINE_INFO("Taking one sapling away from in input bus."); + Logger.MACHINE_INFO("Taking one sapling away from in input bus."); for (final GT_MetaTileEntity_Hatch_InputBus tHatch : this.mInputBusses) { tHatch.mRecipeMap = this.getRecipeMap(); @@ -942,19 +939,19 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase if (this.canChop){ //Set Machine State if (this.treeCheckTicks == 200){ - Utils.LOG_MACHINE_INFO("Looking For Trees - Serverside | "+this.treeCheckTicks); + Logger.MACHINE_INFO("Looking For Trees - Serverside | "+this.treeCheckTicks); //Find wood to Cut if (validCuttingTool){ this.findLogs(aBaseMetaTileEntity); } else { - Utils.LOG_MACHINE_INFO("Did not find a valid saw or Buzzsaw blade."); + Logger.MACHINE_INFO("Did not find a valid saw or Buzzsaw blade."); } } } else { if (this.plantSaplingTicks == 100){ - Utils.LOG_MACHINE_INFO("Looking For space to plant saplings - Serverside | "+this.plantSaplingTicks); + Logger.MACHINE_INFO("Looking For space to plant saplings - Serverside | "+this.plantSaplingTicks); //Plant Some Saplings if (aBaseMetaTileEntity != null){ @@ -962,7 +959,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase } } else if (this.plantSaplingTicks == 200){ - Utils.LOG_MACHINE_INFO("Looking For Saplings to grow - Serverside | "+this.plantSaplingTicks); + Logger.MACHINE_INFO("Looking For Saplings to grow - Serverside | "+this.plantSaplingTicks); //Try Grow some Saplings if (this.doesInputHatchContainAnyFertiliser()){ @@ -980,7 +977,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase } else { if ((this.treeCheckTicks == 200) || (this.plantSaplingTicks == 100) || (this.plantSaplingTicks == 200)){ - Utils.LOG_MACHINE_INFO("Machine is not fully repaired, not ticking. Repair status code:"+this.getRepairStatus()); + Logger.MACHINE_INFO("Machine is not fully repaired, not ticking. Repair status code:"+this.getRepairStatus()); } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java index bdb514ba84..ebee8b2f17 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java @@ -14,9 +14,9 @@ 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 gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -137,7 +137,7 @@ extends GregtechMeta_MultiBlockBase { final byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); final GT_Recipe tRecipe = Recipe_GT.Gregtech_Recipe_Map.sAlloyBlastSmelterRecipes.findRecipe(this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); if ((tRecipe != null) && (this.mHeatingCapacity >= tRecipe.mSpecialValue) && (tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) { - Utils.LOG_WARNING("Found some Valid Inputs."); + Logger.WARNING("Found some Valid Inputs."); this.mEfficiency = (10000 - ((this.getIdealStatus() - this.getRepairStatus()) * 1000)); this.mEfficiencyIncrease = 10000; if (tRecipe.mEUt <= 16) { @@ -160,7 +160,7 @@ extends GregtechMeta_MultiBlockBase { return true; } } - Utils.LOG_WARNING("Failed to find some Valid Inputs."); + Logger.WARNING("Failed to find some Valid Inputs."); return false; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_CatalyticReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_CatalyticReactor.java index e13360b7c5..9c031f81d2 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_CatalyticReactor.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_CatalyticReactor.java @@ -12,8 +12,8 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockB 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.block.ModBlocks; -import gtPlusPlus.core.util.Utils; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -178,115 +178,115 @@ public class GregtechMetaTileEntity_CatalyticReactor extends GT_MetaTileEntity_M if ((!this.addToMachineList(tTileEntity, TAE.GTPP_INDEX(17))) && (!this.addEnergyInputToMachineList(tTileEntity, TAE.GTPP_INDEX(17)))) { if (aBaseMetaTileEntity.getBlockOffset(xDir + i, Y, zDir + j) != ModBlocks.blockCasings2Misc) { - Utils.LOG_INFO("Wrong Block."); + Logger.INFO("Wrong Block."); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, Y, zDir + j) != 2) { - Utils.LOG_INFO("Wrong Meta 1."); + Logger.INFO("Wrong Meta 1."); return false; } } else { - Utils.LOG_INFO("Added Hatch. "+tTileEntity.getInventoryName()); + Logger.INFO("Added Hatch. "+tTileEntity.getInventoryName()); } } Y = 1; - Utils.LOG_INFO("Checking at Y+1 as well."); + Logger.INFO("Checking at Y+1 as well."); final IGregTechTileEntity tTileEntity2 = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, Y, zDir + j); if ((!this.addToMachineList(tTileEntity2, TAE.GTPP_INDEX(17))) && (!this.addEnergyInputToMachineList(tTileEntity2, TAE.GTPP_INDEX(17)))) { if (aBaseMetaTileEntity.getBlockOffset(xDir + i, Y, zDir + j) != ModBlocks.blockCasings2Misc) { - Utils.LOG_INFO("Wrong Block."); + Logger.INFO("Wrong Block."); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, Y, zDir + j) != 2) { - Utils.LOG_INFO("Wrong Meta 1."); + Logger.INFO("Wrong Meta 1."); return false; } } else { - Utils.LOG_INFO("Added Hatch. "+tTileEntity2.getInventoryName()); + Logger.INFO("Added Hatch. "+tTileEntity2.getInventoryName()); } } } for (int y = 2; y < 6; y++) { if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir) != ModBlocks.blockCasings2Misc) { //Must Define meta for center blocks - Utils.LOG_INFO("Wrong Block."); + Logger.INFO("Wrong Block."); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir, y, zDir) != 3) { - Utils.LOG_INFO("Wrong Meta. 2"); + Logger.INFO("Wrong Meta. 2"); return false; } if (aBaseMetaTileEntity.getBlockOffset(xDir + 1, y, zDir) != ModBlocks.blockCasings2Misc) { - Utils.LOG_INFO("Wrong Block.1"); + Logger.INFO("Wrong Block.1"); if (y==3){ if (aBaseMetaTileEntity.getBlockOffset(xDir + 1, y, zDir) == ModBlocks.blockCasingsMisc) { if (aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, y, zDir) != 13) { return false; } - Utils.LOG_INFO("Found Zeron-Casing."); + Logger.INFO("Found Zeron-Casing."); } } else { - Utils.LOG_INFO("debug.1"); + Logger.INFO("debug.1"); return false; } } if (aBaseMetaTileEntity.getBlockOffset(xDir - 1, y, zDir) != ModBlocks.blockCasings2Misc) { - Utils.LOG_INFO("Wrong Block.2"); + Logger.INFO("Wrong Block.2"); if (y==3){ if (aBaseMetaTileEntity.getBlockOffset(xDir + 1, y, zDir) == ModBlocks.blockCasingsMisc) { if (aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, y, zDir) != 13) { return false; } - Utils.LOG_INFO("Found Zeron-Casing."); + Logger.INFO("Found Zeron-Casing."); } } else { - Utils.LOG_INFO("debug.2"); + Logger.INFO("debug.2"); return false; } } if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir + 1) != ModBlocks.blockCasings2Misc) { - Utils.LOG_INFO("Wrong Block.3"); + Logger.INFO("Wrong Block.3"); if (y==3){ if (aBaseMetaTileEntity.getBlockOffset(xDir + 1, y, zDir) == ModBlocks.blockCasingsMisc) { if (aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, y, zDir) != 13) { return false; } - Utils.LOG_INFO("Found Zeron-Casing."); + Logger.INFO("Found Zeron-Casing."); } } else { - Utils.LOG_INFO("debug.3"); + Logger.INFO("debug.3"); return false; } } if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir - 1) != ModBlocks.blockCasings2Misc) { - Utils.LOG_INFO("Wrong Block.4"); + Logger.INFO("Wrong Block.4"); if (y==3){ if (aBaseMetaTileEntity.getBlockOffset(xDir + 1, y, zDir) == ModBlocks.blockCasingsMisc) { if (aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, y, zDir) != 13) { return false; } - Utils.LOG_INFO("Found Zeron-Casing."); + Logger.INFO("Found Zeron-Casing."); } } else { - Utils.LOG_INFO("debug.4"); + Logger.INFO("debug.4"); return false; } } if (aBaseMetaTileEntity.getBlockOffset(xDir, y + 3, zDir) != ModBlocks.blockCasings2Misc) { - Utils.LOG_INFO("Wrong Block.5"); + Logger.INFO("Wrong Block.5"); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir, y + 3, zDir) != 3) { - Utils.LOG_INFO("Wrong Meta. 3"); + Logger.INFO("Wrong Meta. 3"); return false; } } @@ -294,15 +294,15 @@ public class GregtechMetaTileEntity_CatalyticReactor extends GT_MetaTileEntity_M if ((this.mInputHatches.size() != 4) || (this.mOutputHatches.size() != 2) || (this.mOutputBusses.size() != 1) || (this.mMufflerHatches.size() != 1) || (this.mMaintenanceHatches.size() != 2) || (this.mEnergyHatches.size() < 1)){ - Utils.LOG_INFO("Wrong Hatch count."); + Logger.INFO("Wrong Hatch count."); return false; } if (this.mMufflerHatches.size() == 1){ if (this.mMufflerHatches.get(0).mTier < 7){ - Utils.LOG_INFO("Your Muffler must be AT LEAST ZPM tier or higher."); + Logger.INFO("Your Muffler must be AT LEAST ZPM tier or higher."); } } - Utils.LOG_INFO("Multiblock Formed."); + Logger.INFO("Multiblock Formed."); return true; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_Cyclotron.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_Cyclotron.java index a6fc495bab..6bda53def5 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_Cyclotron.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_Cyclotron.java @@ -9,22 +9,14 @@ import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; -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_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_MultiBlockBase; +import gregtech.api.metatileentity.implementations.*; import gregtech.api.objects.GT_ItemStack; 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 gregtech.common.gui.GT_GUIContainer_FusionReactor; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.block.Block; @@ -280,6 +272,7 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas } + @Override public boolean isCorrectMachinePart(ItemStack aStack) { return true; } @@ -288,9 +281,9 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas public boolean checkRecipe(ItemStack aStack) { //Utils.LOG_INFO("Recipe Check."); ArrayList<ItemStack> tItemList = getStoredInputs(); - ItemStack[] tItemInputs = (ItemStack[]) tItemList.toArray(new ItemStack[tItemList.size()]); + ItemStack[] tItemInputs = tItemList.toArray(new ItemStack[tItemList.size()]); ArrayList<FluidStack> tInputList = getStoredFluids(); - FluidStack[] tFluidInputs = (FluidStack[]) tInputList.toArray(new FluidStack[tInputList.size()]); + FluidStack[] tFluidInputs = tInputList.toArray(new FluidStack[tInputList.size()]); long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); @@ -318,11 +311,11 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas final ItemStack[] outputs = new ItemStack[tRecipe.mOutputs.length]; for (int i = 0; i < tRecipe.mOutputs.length; i++){ if (this.getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(i)){ - Utils.LOG_WARNING("Adding a bonus output"); + Logger.WARNING("Adding a bonus output"); outputs[i] = tRecipe.getOutput(i); } else { - Utils.LOG_WARNING("Adding null output"); + Logger.WARNING("Adding null output"); outputs[i] = null; } } @@ -441,6 +434,7 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas return 50; } + @Override public int getDamageToComponent(ItemStack aStack) { return 0; } @@ -472,10 +466,12 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas return true; } + @Override public int getAmountOfOutputs() { return 1; } + @SuppressWarnings("deprecation") public boolean turnCasingActive(final boolean status) { if (this.mEnergyHatches != null) { for (final GT_MetaTileEntity_Hatch_Muffler hatch : this.mMufflerHatches) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCentrifuge.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCentrifuge.java index 2d621e7388..498e8ae17c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCentrifuge.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCentrifuge.java @@ -16,9 +16,9 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maint 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.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; @@ -103,17 +103,17 @@ extends GregtechMeta_MultiBlockBase { return false; }*/ - Utils.LOG_WARNING("Centrifuge Debug - 1"); + Logger.WARNING("Centrifuge Debug - 1"); final GT_Recipe.GT_Recipe_Map map = this.getRecipeMap(); if (map == null) { - Utils.LOG_WARNING("Centrifuge Debug - False - No recipe map"); + Logger.WARNING("Centrifuge Debug - False - No recipe map"); return false; } - Utils.LOG_WARNING("Centrifuge Debug - 2"); + Logger.WARNING("Centrifuge Debug - 2"); final ArrayList<ItemStack> tInputList = this.getStoredInputs(); final long tVoltage = this.getMaxInputVoltage(); final byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - Utils.LOG_WARNING("Centrifuge Debug - Tier variable: "+tTier); + Logger.WARNING("Centrifuge Debug - Tier variable: "+tTier); final ItemStack[] tInputs = tInputList.toArray(new ItemStack[tInputList.size()]); final ArrayList<FluidStack> tFluidList = this.getStoredFluids(); final FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); @@ -121,41 +121,41 @@ extends GregtechMeta_MultiBlockBase { GT_Recipe tRecipe = map.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); tRecipe = this.reduceRecipeTimeByPercentage(tRecipe, 40F); if (tRecipe != null) { - Utils.LOG_WARNING("Recipe was not invalid"); + Logger.WARNING("Recipe was not invalid"); this.mLastRecipe = tRecipe; this.mEUt = 0; this.mOutputItems = null; this.mOutputFluids = null; if (!tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { - Utils.LOG_WARNING("False: 1"); + Logger.WARNING("False: 1"); return false; } this.mMaxProgresstime = tRecipe.mDuration; this.mEfficiency = (10000 - ((this.getIdealStatus() - this.getRepairStatus()) * 1000)); this.mEfficiencyIncrease = 10000; - Utils.LOG_WARNING("Centrifuge Debug - 2 - Max Progress Time: "+this.mMaxProgresstime); + Logger.WARNING("Centrifuge Debug - 2 - Max Progress Time: "+this.mMaxProgresstime); if (tRecipe.mEUt <= 16) { - Utils.LOG_WARNING("Centrifuge Debug - Using < 16eu/t"); + Logger.WARNING("Centrifuge Debug - Using < 16eu/t"); this.mEUt = (tRecipe.mEUt * (1 << (tTier - 1)) * (1 << (tTier - 1))); this.mMaxProgresstime = (tRecipe.mDuration / (1 << (tTier - 1))); - Utils.LOG_WARNING("Centrifuge Debug - 3.1 - Max Progress Time: "+this.mMaxProgresstime+" EU/t"+this.mEUt + " Obscure GT Value "+gregtech.api.enums.GT_Values.V[(tTier - 1)]); + Logger.WARNING("Centrifuge Debug - 3.1 - Max Progress Time: "+this.mMaxProgresstime+" EU/t"+this.mEUt + " Obscure GT Value "+gregtech.api.enums.GT_Values.V[(tTier - 1)]); } else { - Utils.LOG_WARNING("Centrifuge Debug - using > 16eu/t"); + Logger.WARNING("Centrifuge Debug - using > 16eu/t"); this.mEUt = tRecipe.mEUt; this.mMaxProgresstime = tRecipe.mDuration; - Utils.LOG_WARNING("Centrifuge Debug - 3.2 - Max Progress Time: "+this.mMaxProgresstime+" EU/t"+this.mEUt + " Obscure GT Value "+gregtech.api.enums.GT_Values.V[(tTier - 1)]); + Logger.WARNING("Centrifuge Debug - 3.2 - Max Progress Time: "+this.mMaxProgresstime+" EU/t"+this.mEUt + " Obscure GT Value "+gregtech.api.enums.GT_Values.V[(tTier - 1)]); while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { this.mEUt *= 4; this.mMaxProgresstime /= 2; - Utils.LOG_WARNING("Centrifuge Debug - 4 - Max Progress Time: "+this.mMaxProgresstime+" EU/t"+this.mEUt); + Logger.WARNING("Centrifuge Debug - 4 - Max Progress Time: "+this.mMaxProgresstime+" EU/t"+this.mEUt); } } this.mEUt *= 1; if (this.mEUt > 0) { this.mEUt = (-this.mEUt); - Utils.LOG_WARNING("Centrifuge Debug - 5 - Max Progress Time: "+this.mMaxProgresstime+" EU/t"+this.mEUt); + Logger.WARNING("Centrifuge Debug - 5 - Max Progress Time: "+this.mMaxProgresstime+" EU/t"+this.mEUt); } ItemStack[] tOut = new ItemStack[tRecipe.mOutputs.length]; for (int h = 0; h < tRecipe.mOutputs.length; h++) { @@ -184,7 +184,7 @@ extends GregtechMeta_MultiBlockBase { if (this.mMaxProgresstime <= 0){ this.mMaxProgresstime++; } - Utils.LOG_WARNING("Centrifuge Debug - 6 - Max Progress Time: "+this.mMaxProgresstime+" EU/t"+this.mEUt); + Logger.WARNING("Centrifuge Debug - 6 - Max Progress Time: "+this.mMaxProgresstime+" EU/t"+this.mEUt); final List<ItemStack> overStacks = new ArrayList<>(); for (int f = 0; f < tOut.length; f++) { if (tOut[f].getMaxStackSize() < tOut[f].stackSize) { @@ -211,11 +211,11 @@ extends GregtechMeta_MultiBlockBase { this.mOutputItems = tOut; this.mOutputFluids = new FluidStack[]{tFOut}; this.updateSlots(); - Utils.LOG_WARNING("Centrifuge: True"); + Logger.WARNING("Centrifuge: True"); return true; } } - Utils.LOG_WARNING("Centrifuge: Recipe was invalid."); + Logger.WARNING("Centrifuge: Recipe was invalid."); return false; } @@ -264,7 +264,7 @@ extends GregtechMeta_MultiBlockBase { if ((tTileEntity != null) && (tTileEntity.getMetaTileEntity() != null)) { if ((tTileEntity.getXCoord() == aBaseMetaTileEntity.getXCoord()) && (tTileEntity.getYCoord() == aBaseMetaTileEntity.getYCoord()) && (tTileEntity.getZCoord() == (aBaseMetaTileEntity.getZCoord()+2))) { if ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Maintenance)) { - Utils.LOG_WARNING("MAINT HATCH IN CORRECT PLACE"); + Logger.WARNING("MAINT HATCH IN CORRECT PLACE"); this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) tTileEntity.getMetaTileEntity()); ((GT_MetaTileEntity_Hatch) tTileEntity.getMetaTileEntity()).mMachineBlock = this.getCasingTextureIndex(); } else { @@ -272,7 +272,7 @@ extends GregtechMeta_MultiBlockBase { } } else { - Utils.LOG_WARNING("MAINT HATCH IN WRONG PLACE"); + Logger.WARNING("MAINT HATCH IN WRONG PLACE"); } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCokeOven.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCokeOven.java index acf05cfd0b..b763d424c9 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCokeOven.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCokeOven.java @@ -10,12 +10,10 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; 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.block.ModBlocks; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import net.minecraft.entity.player.InventoryPlayer; @@ -77,14 +75,16 @@ extends GregtechMeta_MultiBlockBase { } + @Override public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(207)), 10, 1.0F, aX, aY, aZ); + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(Integer.valueOf(207)), 10, 1.0F, aX, aY, aZ); } } - public void startProcess() { + @Override + public void startProcess() { sendLoopStart((byte) 1); } @@ -131,7 +131,7 @@ extends GregtechMeta_MultiBlockBase { final FluidStack[] tFluids = Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1); final int tValidOutputSlots = this.getValidOutputSlots(this.getBaseMetaTileEntity(), Recipe_GT.Gregtech_Recipe_Map.sCokeOvenRecipes.findRecipe(this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[(byte) Math.max(1, GT_Utility.getTier(this.getMaxInputVoltage()))], tFluids, tInputs), tInputs); - Utils.LOG_WARNING("Valid Output Hatches: "+tValidOutputSlots); + Logger.WARNING("Valid Output Hatches: "+tValidOutputSlots); //More than or one input if ((tInputList.size() > 0) && (tValidOutputSlots >= 1)) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCuttingMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCuttingMachine.java index ad1b9cc635..3b86b348ad 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCuttingMachine.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCuttingMachine.java @@ -12,9 +12,9 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maint 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.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import net.minecraft.block.Block; @@ -142,7 +142,7 @@ extends GregtechMeta_MultiBlockBase { } } if (tAirCount != 10) { - Utils.LOG_INFO("False 1"); + Logger.INFO("False 1"); return false; } for (byte i = 2; i < 6; i = (byte) (i + 1)) { @@ -165,14 +165,14 @@ extends GregtechMeta_MultiBlockBase { if ((this.getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingBlock()) && (this.getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingMeta())) { } else if (!this.addToMachineList(this.getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i))) && (!this.addEnergyInputToMachineList(this.getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i))))) { - Utils.LOG_INFO("False 2"); + Logger.INFO("False 2"); return false; } } else if ((this.getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingBlock()) && (this.getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingMeta())) { } else { - Utils.LOG_INFO("False 3"); + Logger.INFO("False 3"); return false; } } @@ -180,11 +180,11 @@ extends GregtechMeta_MultiBlockBase { } } if ((this.mOutputHatches.size() != 0) || (this.mInputHatches.size() < 0)) { - Utils.LOG_INFO("Use Busses, Not Hatches for Input/Output."); + Logger.INFO("Use Busses, Not Hatches for Input/Output."); return false; } if ((this.mInputBusses.size() != 2) || (this.mOutputBusses.size() != 2)) { - Utils.LOG_INFO("Incorrect amount of Input & Output busses."); + Logger.INFO("Incorrect amount of Input & Output busses."); return false; } this.mMaintenanceHatches.clear(); @@ -194,19 +194,19 @@ extends GregtechMeta_MultiBlockBase { this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) tTileEntity.getMetaTileEntity()); ((GT_MetaTileEntity_Hatch) tTileEntity.getMetaTileEntity()).mMachineBlock = this.getCasingTextureIndex(); } else { - Utils.LOG_INFO("Maintenance hatch must be in the middle block on the back."); + Logger.INFO("Maintenance hatch must be in the middle block on the back."); return false; } } if ((this.mMaintenanceHatches.size() != 1) || (this.mEnergyHatches.size() != 1)) { - Utils.LOG_INFO("Incorrect amount of Maintenance or Energy hatches."); + Logger.INFO("Incorrect amount of Maintenance or Energy hatches."); return false; } } else { - Utils.LOG_INFO("False 5"); + Logger.INFO("False 5"); return false; } - Utils.LOG_INFO("True"); + Logger.INFO("True"); return true; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialElectrolyzer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialElectrolyzer.java index c07d331dbb..2334af7cd4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialElectrolyzer.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialElectrolyzer.java @@ -15,9 +15,9 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; 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.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import net.minecraft.block.Block; @@ -117,7 +117,7 @@ extends GregtechMeta_MultiBlockBase { final FluidStack[] tFluids = Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1); final int tValidOutputSlots = this.getValidOutputSlots(this.getBaseMetaTileEntity(), GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.findRecipe(this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[(byte) Math.max(1, GT_Utility.getTier(this.getMaxInputVoltage()))], tFluids, tInputs), tInputs); - Utils.LOG_WARNING("Valid Output Slots: "+tValidOutputSlots); + Logger.WARNING("Valid Output Slots: "+tValidOutputSlots); //More than or one input if ((tInputList.size() > 0) && (tValidOutputSlots >= 1)) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialMacerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialMacerator.java index 48d5ee7452..5154c36833 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialMacerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialMacerator.java @@ -15,9 +15,9 @@ 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 gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; @@ -147,7 +147,7 @@ extends GregtechMeta_MultiBlockBase { tRecipe = this.reduceRecipeTimeByPercentage(tRecipe, 60F); final int tValidOutputSlots = this.getValidOutputSlots(this.getBaseMetaTileEntity(), tRecipe, tInputs); - Utils.LOG_WARNING("Maceration Stack - Valid Output Hatches: "+tValidOutputSlots); + Logger.WARNING("Maceration Stack - Valid Output Hatches: "+tValidOutputSlots); //More than or one input if ((tInputList.size() > 0) && (tValidOutputSlots >= 1)) { @@ -191,11 +191,11 @@ extends GregtechMeta_MultiBlockBase { final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j); if ((!this.addMaintenanceToMachineList(tTileEntity, TAE.GTPP_INDEX(7))) && (!this.addInputToMachineList(tTileEntity, TAE.GTPP_INDEX(7))) && (!this.addOutputToMachineList(tTileEntity, TAE.GTPP_INDEX(7))) && (!this.addEnergyInputToMachineList(tTileEntity, TAE.GTPP_INDEX(7))) && (!this.ignoreController(aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j)))) { if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) { - Utils.LOG_INFO("Returned False 1"); + Logger.INFO("Returned False 1"); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 7) { - Utils.LOG_INFO("Returned False 2"); + Logger.INFO("Returned False 2"); return false; } tAmount++; @@ -205,12 +205,12 @@ extends GregtechMeta_MultiBlockBase { } } if ((this.mOutputHatches.size() != 0) || (this.mInputBusses.size() != 1) || (this.mOutputBusses.size() != 5)) { - Utils.LOG_INFO("Returned False 3"); + Logger.INFO("Returned False 3"); return false; } final int height = this.getBaseMetaTileEntity().getYCoord(); if (this.mInputBusses.get(0).getBaseMetaTileEntity().getYCoord() != height) { - Utils.LOG_INFO("height: "+height+" | Returned False 4"); + Logger.INFO("height: "+height+" | Returned False 4"); return false; } final GT_MetaTileEntity_Hatch_OutputBus[] tmpHatches = new GT_MetaTileEntity_Hatch_OutputBus[5]; @@ -219,7 +219,7 @@ extends GregtechMeta_MultiBlockBase { if (tmpHatches[hatchNumber] == null) { tmpHatches[hatchNumber] = this.mOutputBusses.get(i); } else { - Utils.LOG_INFO("Returned False 5"); + Logger.INFO("Returned False 5"); return false; } } @@ -270,16 +270,16 @@ extends GregtechMeta_MultiBlockBase { for (int i = 0; (i < 256) && (j < this.mOutputItems.length); ++i) { if (i==0) { - Utils.LOG_WARNING("Adding the default output"); + Logger.WARNING("Adding the default output"); this.mOutputItems[0] = tRecipe.getOutput(0); - Utils.LOG_INFO("Ading output. "+i+" | "+tRecipe.mOutputs.length + " | "+this.mOutputItems[0].stackSize+" | "+tRecipe.getOutput(0).stackSize); + Logger.INFO("Ading output. "+i+" | "+tRecipe.mOutputs.length + " | "+this.mOutputItems[0].stackSize+" | "+tRecipe.getOutput(0).stackSize); } else if (this.getBaseMetaTileEntity().getRandomNumber(7500) < tRecipe.getOutputChance(i)){ - Utils.LOG_WARNING("Adding a bonus output"); + Logger.WARNING("Adding a bonus output"); this.mOutputItems[i] = tRecipe.getOutput(i); } else { - Utils.LOG_WARNING("Adding null output"); + Logger.WARNING("Adding null output"); this.mOutputItems[i] = null; } ++j; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialPlatePress.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialPlatePress.java index 05454a37c7..33c73e0a82 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialPlatePress.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialPlatePress.java @@ -12,9 +12,9 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; 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.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import net.minecraft.block.Block; @@ -110,7 +110,7 @@ extends GregtechMeta_MultiBlockBase { final FluidStack[] tFluids = Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1); final int tValidOutputSlots = this.getValidOutputSlots(this.getBaseMetaTileEntity(), GT_Recipe.GT_Recipe_Map.sBenderRecipes.findRecipe(this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[(byte) Math.max(1, GT_Utility.getTier(this.getMaxInputVoltage()))], tFluids, tInputs), tInputs); - Utils.LOG_WARNING("Valid Output Slots: "+tValidOutputSlots); + Logger.WARNING("Valid Output Slots: "+tValidOutputSlots); //More than or one input if ((tInputList.size() > 0) && (tValidOutputSlots >= 1)) { final long tVoltage = this.getMaxInputVoltage(); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialSifter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialSifter.java index d4272430de..ea6bb3eeba 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialSifter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialSifter.java @@ -14,9 +14,9 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Outpu 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.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; @@ -117,7 +117,7 @@ extends GregtechMeta_MultiBlockBase { @Override public boolean checkRecipe(final ItemStack aStack) { - Utils.LOG_WARNING("1"); + Logger.WARNING("1"); //Get inputs. final ArrayList<ItemStack> tInputList = this.getStoredInputs(); @@ -134,7 +134,7 @@ extends GregtechMeta_MultiBlockBase { } } - Utils.LOG_WARNING("2"); + Logger.WARNING("2"); //Temp var final ItemStack[] tInputs = Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2); @@ -145,7 +145,7 @@ extends GregtechMeta_MultiBlockBase { } - Utils.LOG_WARNING("3"); + Logger.WARNING("3"); //Make a recipe instance for the rest of the method. final GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sSifterRecipes.findRecipe(this.getBaseMetaTileEntity(), false, 9223372036854775807L, null, tInputs); @@ -156,53 +156,53 @@ extends GregtechMeta_MultiBlockBase { if ((this.cloneRecipe != tRecipe) || (this.cloneRecipe == null)){ this.cloneRecipe = tRecipe.copy(); - Utils.LOG_WARNING("Setting Recipe"); + Logger.WARNING("Setting Recipe"); } if ((this.mInputStacks != tRecipe.mInputs) || (this.mInputStacks == null)){ this.mInputStacks = tRecipe.mInputs; - Utils.LOG_WARNING("Setting Recipe Inputs"); + Logger.WARNING("Setting Recipe Inputs"); } if ((this.cloneChances != tRecipe.mChances) || (this.cloneChances == null)){ this.cloneChances = tRecipe.mChances.clone(); - Utils.LOG_WARNING("Setting Chances"); + Logger.WARNING("Setting Chances"); } for (int r=0;r<this.cloneChances.length;r++){ - Utils.LOG_WARNING("Original map Output["+r+"] chance = "+this.cloneChances[r]); + Logger.WARNING("Original map Output["+r+"] chance = "+this.cloneChances[r]); } - Utils.LOG_WARNING("3.1"); + Logger.WARNING("3.1"); //Change bonus chances int[] outputChances; - Utils.LOG_WARNING("3.2"); + Logger.WARNING("3.2"); if (this.cloneRecipe.mChances != null){ outputChances = this.cloneRecipe.mChances.clone(); - Utils.LOG_WARNING("3.3"); + Logger.WARNING("3.3"); for (int r=0;r<outputChances.length;r++){ - Utils.LOG_WARNING("Output["+r+"] chance = "+outputChances[r]); + Logger.WARNING("Output["+r+"] chance = "+outputChances[r]); if (outputChances[r]<10000){ final int temp = outputChances[r]; if ((outputChances[r] < 8000) && (outputChances[r] >= 1)){ outputChances[r] = temp+1200; - Utils.LOG_WARNING("Output["+r+"] chance now = "+outputChances[r]); + Logger.WARNING("Output["+r+"] chance now = "+outputChances[r]); } else if ((outputChances[r] < 9000) && (outputChances[r] >= 8000)){ outputChances[r] = temp+400; - Utils.LOG_WARNING("Output["+r+"] chance now = "+outputChances[r]); + Logger.WARNING("Output["+r+"] chance now = "+outputChances[r]); } else if ((outputChances[r] <= 9900) && (outputChances[r] >= 9000)){ outputChances[r] = temp+100; - Utils.LOG_WARNING("Output["+r+"] chance now = "+outputChances[r]); + Logger.WARNING("Output["+r+"] chance now = "+outputChances[r]); } } } - Utils.LOG_WARNING("3.4"); + Logger.WARNING("3.4"); //Rebuff Drop Rates for % output this.cloneRecipe.mChances = outputChances; @@ -210,16 +210,16 @@ extends GregtechMeta_MultiBlockBase { } - Utils.LOG_WARNING("4"); + Logger.WARNING("4"); final int tValidOutputSlots = this.getValidOutputSlots(this.getBaseMetaTileEntity(), this.cloneRecipe, tInputs); - Utils.LOG_WARNING("Sifter - Valid Output Hatches: "+tValidOutputSlots); + Logger.WARNING("Sifter - Valid Output Hatches: "+tValidOutputSlots); //More than or one input if ((tInputList.size() > 0) && (tValidOutputSlots >= 1)) { if ((this.cloneRecipe != null) && (this.cloneRecipe.isRecipeInputEqual(true, null, tInputs))) { - Utils.LOG_WARNING("Valid Recipe found - size "+this.cloneRecipe.mOutputs.length); + Logger.WARNING("Valid Recipe found - size "+this.cloneRecipe.mOutputs.length); this.mEfficiency = (10000 - ((this.getIdealStatus() - this.getRepairStatus()) * 1000)); this.mEfficiencyIncrease = 10000; @@ -229,11 +229,11 @@ extends GregtechMeta_MultiBlockBase { final ItemStack[] outputs = new ItemStack[this.cloneRecipe.mOutputs.length]; for (int i = 0; i < this.cloneRecipe.mOutputs.length; i++){ if (this.getBaseMetaTileEntity().getRandomNumber(7500) < this.cloneRecipe.getOutputChance(i)){ - Utils.LOG_WARNING("Adding a bonus output"); + Logger.WARNING("Adding a bonus output"); outputs[i] = this.cloneRecipe.getOutput(i); } else { - Utils.LOG_WARNING("Adding null output"); + Logger.WARNING("Adding null output"); outputs[i] = null; } } @@ -250,7 +250,7 @@ extends GregtechMeta_MultiBlockBase { @Override public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { - Utils.LOG_MACHINE_INFO("Checking structure for Industrial Sifter."); + Logger.MACHINE_INFO("Checking structure for Industrial Sifter."); final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2; final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2; @@ -278,12 +278,12 @@ extends GregtechMeta_MultiBlockBase { if (h != 0){ if (!this.addToMachineList(tTileEntity, TAE.GTPP_INDEX(21))) { if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasings2Misc) { - Utils.LOG_MACHINE_INFO("Sifter Casing(s) Missing from one of the "+sHeight+" layers inner 3x3."); - Utils.LOG_MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); + Logger.MACHINE_INFO("Sifter Casing(s) Missing from one of the "+sHeight+" layers inner 3x3."); + Logger.MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 6) { - Utils.LOG_MACHINE_INFO("Sifter Casing(s) Missing from one of the "+sHeight+" layers inner 3x3. Wrong Meta for Casing. Found:"+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()+" with meta:"+aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j)); + Logger.MACHINE_INFO("Sifter Casing(s) Missing from one of the "+sHeight+" layers inner 3x3. Wrong Meta for Casing. Found:"+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()+" with meta:"+aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j)); return false; } } @@ -291,12 +291,12 @@ extends GregtechMeta_MultiBlockBase { else { if (!this.addToMachineList(tTileEntity, TAE.GTPP_INDEX(21))) { if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasings2Misc) { - Utils.LOG_MACHINE_INFO("Sifter Casing(s) Missing from one of the "+sHeight+" layers inner 3x3."); - Utils.LOG_MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); + Logger.MACHINE_INFO("Sifter Casing(s) Missing from one of the "+sHeight+" layers inner 3x3."); + Logger.MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 5) { - Utils.LOG_MACHINE_INFO("Sifter Casing(s) Missing from one of the "+sHeight+" layers inner 3x3. Wrong Meta for Casing. Found:"+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()+" with meta:"+aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j)); + Logger.MACHINE_INFO("Sifter Casing(s) Missing from one of the "+sHeight+" layers inner 3x3. Wrong Meta for Casing. Found:"+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()+" with meta:"+aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j)); return false; } tAmount++; @@ -319,13 +319,13 @@ extends GregtechMeta_MultiBlockBase { if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasings2Misc) { if ((tTileEntity instanceof GregtechMetaTileEntity_IndustrialSifter) || (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) == GregTech_API.sBlockMachines)){ if (h != 0){ - Utils.LOG_MACHINE_INFO("Found a secondary controller at the wrong Y level."); + Logger.MACHINE_INFO("Found a secondary controller at the wrong Y level."); return false; } } else { - Utils.LOG_MACHINE_INFO("Sifter Casings Missing from somewhere in the "+sHeight+" layer edge."); - Utils.LOG_MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); + Logger.MACHINE_INFO("Sifter Casings Missing from somewhere in the "+sHeight+" layer edge."); + Logger.MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); return false; } } @@ -335,9 +335,9 @@ extends GregtechMeta_MultiBlockBase { } else { - Utils.LOG_MACHINE_INFO("Sifter Casings Missing from somewhere in the "+sHeight+" layer edge."); - Utils.LOG_MACHINE_INFO("Incorrect Meta value for block, expected 5."); - Utils.LOG_MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j)+"."); + Logger.MACHINE_INFO("Sifter Casings Missing from somewhere in the "+sHeight+" layer edge."); + Logger.MACHINE_INFO("Incorrect Meta value for block, expected 5."); + Logger.MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j)+"."); return false; } } @@ -353,11 +353,11 @@ extends GregtechMeta_MultiBlockBase { } if ((this.mInputBusses.size() != 1) || (this.mOutputBusses.size() != 4) || (this.mMaintenanceHatches.size() != 1) || (this.mEnergyHatches.size() < 1)) { - Utils.LOG_INFO("Returned False 3"); - Utils.LOG_INFO("Input Buses: "+this.mInputBusses.size()+" | expected: 1"); - Utils.LOG_INFO("Output Buses: "+this.mOutputBusses.size()+" | expected: 4"); - Utils.LOG_INFO("Energy Hatches: "+this.mEnergyHatches.size()+" | expected: 1"); - Utils.LOG_INFO("Maint. hatches: "+this.mMaintenanceHatches.size()+" | expected: 1"); + Logger.INFO("Returned False 3"); + Logger.INFO("Input Buses: "+this.mInputBusses.size()+" | expected: 1"); + Logger.INFO("Output Buses: "+this.mOutputBusses.size()+" | expected: 4"); + Logger.INFO("Energy Hatches: "+this.mEnergyHatches.size()+" | expected: 1"); + Logger.INFO("Maint. hatches: "+this.mMaintenanceHatches.size()+" | expected: 1"); return false; } final int height = this.getBaseMetaTileEntity().getYCoord(); @@ -368,7 +368,7 @@ extends GregtechMeta_MultiBlockBase { if (tmpHatches[i] == null) { tmpHatches[i] = this.mOutputBusses.get(i); } else { - Utils.LOG_MACHINE_INFO("Returned False 5 - "+this.mOutputBusses.size()); + Logger.MACHINE_INFO("Returned False 5 - "+this.mOutputBusses.size()); return false; } } @@ -377,7 +377,7 @@ extends GregtechMeta_MultiBlockBase { this.mOutputBusses.add(tmpHatches[i]); } - Utils.LOG_INFO("Industrial Sifter - Structure Built? "+(tAmount>=35)); + Logger.INFO("Industrial Sifter - Structure Built? "+(tAmount>=35)); return tAmount >= 35; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialSinter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialSinter.java index 3d37db5b48..ecabdbe343 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialSinter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialSinter.java @@ -13,9 +13,9 @@ 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.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; @@ -132,7 +132,7 @@ extends GT_MetaTileEntity_MultiBlockBase { for (byte j = -1; j < 2; j = (byte) (j + 1)) { for (byte k = -1; k < 2; k = (byte) (k + 1)) { if (this.getBaseMetaTileEntity().getAirOffset(i, j, k)) { - Utils.LOG_INFO("Found Air at: "+(controllerX+i)+" "+(controllerY+k)+" "+(controllerZ+k)); + Logger.INFO("Found Air at: "+(controllerX+i)+" "+(controllerY+k)+" "+(controllerZ+k)); //if (aBaseMetaTileEntity.getWorld().isRemote){ //asdasd.renderStandardBlock(ModBlocks.MatterFabricatorEffectBlock, (controllerX+i), (controllerY+k), (controllerZ+k)); //UtilsRendering.drawBlockInWorld((controllerX+i), (controllerY+k), (controllerZ+k), Color.YELLOW_GREEN); @@ -143,7 +143,7 @@ extends GT_MetaTileEntity_MultiBlockBase { } } if (tAirCount != 10) { - Utils.LOG_INFO("False. Air != 10. Air == "+tAirCount); + Logger.INFO("False. Air != 10. Air == "+tAirCount); //return false; } for (byte i = 2; i < 6; i = (byte) (i + 1)) { @@ -169,14 +169,14 @@ extends GT_MetaTileEntity_MultiBlockBase { if ((this.getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingBlock()) && (this.getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingMeta())) { } else if (!this.addToMachineList(this.getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i))) && (!this.addEnergyInputToMachineList(this.getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i))))) { - Utils.LOG_INFO("False 2"); + Logger.INFO("False 2"); return false; } } else if ((this.getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingBlock()) && (this.getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingMeta())) { } else { - Utils.LOG_INFO("False 3"); + Logger.INFO("False 3"); return false; } } @@ -184,11 +184,11 @@ extends GT_MetaTileEntity_MultiBlockBase { } } if ((this.mOutputHatches.size() != 0) || (this.mInputHatches.size() != 0)) { - Utils.LOG_INFO("Use Busses, Not Hatches for Input/Output."); + Logger.INFO("Use Busses, Not Hatches for Input/Output."); return false; } if ((this.mInputBusses.size() != 2) || (this.mOutputBusses.size() != 2)) { - Utils.LOG_INFO("Incorrect amount of Input & Output busses."); + Logger.INFO("Incorrect amount of Input & Output busses."); return false; } this.mMaintenanceHatches.clear(); @@ -198,19 +198,19 @@ extends GT_MetaTileEntity_MultiBlockBase { this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) tTileEntity.getMetaTileEntity()); ((GT_MetaTileEntity_Hatch) tTileEntity.getMetaTileEntity()).mMachineBlock = this.getCasingTextureIndex(); } else { - Utils.LOG_INFO("Maintenance hatch must be in the middle block on the back."); + Logger.INFO("Maintenance hatch must be in the middle block on the back."); return false; } } if ((this.mMaintenanceHatches.size() != 1) || (this.mEnergyHatches.size() != 1)) { - Utils.LOG_INFO("Incorrect amount of Maintenance or Energy hatches."); + Logger.INFO("Incorrect amount of Maintenance or Energy hatches."); return false; } } else { - Utils.LOG_INFO("False 5"); + Logger.INFO("False 5"); return false; } - Utils.LOG_INFO("True"); + Logger.INFO("True"); return true; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java index 7826e9fcfe..64a36900fe 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java @@ -11,9 +11,9 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; 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.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import net.minecraft.block.Block; @@ -41,14 +41,14 @@ extends GregtechMeta_MultiBlockBase { return new String[]{ "Controller Block for the Industrial Thermal Centrifuge", "60% faster than using single block machines of the same voltage", - "Size: 3x2x3 [WxHxL]", "Controller (front centered)", - "1x Input Bus (Any casing)", - "1x Output Bus (Any casing)", - "1x Maintenance Hatch (Any casing)", - "1x Muffler Hatch (Any casing)", - "1x Energy Hatch (Any casing)", + "Size: 3x2x3 [WxHxL]", "Controller (front centered, top layer)", + "1x Input Bus (Any bottom layer casing)", + "1x Output Bus (Any bottom layer casing)", + "1x Maintenance Hatch (Any bottom layer casing)", + "1x Muffler Hatch (Casing under controller)", + "1x Energy Hatch (Any bottom layer casing)", "Thermal processing Casings for the rest (8 at least!)", - "Causes " + (20 * getPollutionPerTick(null)) + " Pollution per second", + "Noise Hazard Sign Blocks also count as valid casings", CORE.GT_Tooltip }; @@ -89,7 +89,7 @@ extends GregtechMeta_MultiBlockBase { if (tRecipe != null) { final int tValidOutputSlots = this.getValidOutputSlots(this.getBaseMetaTileEntity(), tRecipe, new ItemStack[]{tInput}); - Utils.LOG_WARNING("Valid Output Slots: "+tValidOutputSlots); + Logger.WARNING("Valid Output Slots: "+tValidOutputSlots); //More than or one input if ((tInputList.size() > 0) && (tValidOutputSlots >= 1)) { @@ -141,24 +141,29 @@ extends GregtechMeta_MultiBlockBase { for (int i = -1; i < 2; ++i) { for (int j = -1; j < 2; ++j) { for (int h = -1; h < 0; ++h) { - //if ((h != 0) || ((((xDir + i != 0) || (zDir + j != 0))) && (((i != 0) || (j != 0))))) { + if ((h != 0) || ((((xDir + i != 0) || (zDir + j != 0))) && (((i != 0) || (j != 0))))) { IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j); + + Logger.INFO("------------------"); + Logger.INFO("xDir: "+xDir+" | zDir: "+zDir); + Logger.INFO("i: "+i+" | j: "+j+" | h: "+h); if (!addToMachineList(tTileEntity)) { Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j); byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j); if ((((tBlock != ModBlocks.blockCasings2Misc) || (tMeta != 0))) && (((tBlock != GregTech_API.sBlockCasings3) || (tMeta != 9)))) { - Utils.LOG_WARNING("Wrong Block?"); + Logger.INFO("Wrong Block?"); return false; } - ++tAmount; + tAmount++; } - //} + } } } } - Utils.LOG_WARNING("Trying to assemble structure. Completed? "+(tAmount >= 8)); + Logger.INFO("------------------"); + Logger.WARNING("Trying to assemble structure. Completed? "+(tAmount >= 8)); return (tAmount >= 8); } @@ -167,6 +172,7 @@ extends GregtechMeta_MultiBlockBase { return 10000; } + @Override public int getPollutionPerTick(final ItemStack aStack) { return 45; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWashPlant.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWashPlant.java index c6d82cf512..fce26484d0 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWashPlant.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWashPlant.java @@ -9,9 +9,9 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; 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.lib.CORE; -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; @@ -131,7 +131,7 @@ extends GregtechMeta_MultiBlockBase { this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); if (mRunningOnLoad || tRecipe.isRecipeInputEqual(true, mFluidInputList, new ItemStack[]{tInput})) { - Utils.LOG_WARNING("Recipe Complete."); + Logger.WARNING("Recipe Complete."); this.mLastRecipe = tRecipe; this.mEUt = MathUtils.findPercentageOfInt(this.mLastRecipe.mEUt, 80); this.mMaxProgresstime = MathUtils.findPercentageOfInt(this.mLastRecipe.mDuration, 20); @@ -166,7 +166,7 @@ extends GregtechMeta_MultiBlockBase { int mOffsetZ_Upper = 0; - Utils.LOG_WARNING("mDirectionX "+(mDirectionX)); + Logger.WARNING("mDirectionX "+(mDirectionX)); if (mDirectionX == 0){ mCurrentDirectionX = 2; mCurrentDirectionZ = 3; @@ -174,7 +174,7 @@ extends GregtechMeta_MultiBlockBase { mOffsetX_Upper = 2; mOffsetZ_Lower = -3; mOffsetZ_Upper = 3; - Utils.LOG_WARNING("Controler is facing Z direction."); + Logger.WARNING("Controler is facing Z direction."); } else { mCurrentDirectionX = 3; @@ -183,7 +183,7 @@ extends GregtechMeta_MultiBlockBase { mOffsetX_Upper = 3; mOffsetZ_Lower = -2; mOffsetZ_Upper = 2; - Utils.LOG_WARNING("Controler is facing X direction."); + Logger.WARNING("Controler is facing X direction."); } //if (aBaseMetaTileEntity.fac) @@ -191,8 +191,8 @@ extends GregtechMeta_MultiBlockBase { final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * mCurrentDirectionX; final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * mCurrentDirectionZ; - Utils.LOG_WARNING("xDir"+(xDir)); - Utils.LOG_WARNING("zDir"+(zDir)); + Logger.WARNING("xDir"+(xDir)); + Logger.WARNING("zDir"+(zDir)); /*if (!(aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir))) { return false; }*/ @@ -204,22 +204,22 @@ extends GregtechMeta_MultiBlockBase { IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j); if (!addToMachineList(tTileEntity)) { - Utils.LOG_WARNING("X: "+i+" | Z: "+j); + Logger.WARNING("X: "+i+" | Z: "+j); Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j); byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j); if ((tBlock != getCasingBlock()) && (tMeta != getCasingMeta())) { if ((i != mOffsetX_Lower && j != mOffsetZ_Lower && i != mOffsetX_Upper && j != mOffsetZ_Upper) && (h == 0 || h == 1)){ if (tBlock == Blocks.air){ - Utils.LOG_WARNING("Found Air"); + Logger.WARNING("Found Air"); } else if (tBlock == Blocks.water){ - Utils.LOG_WARNING("Found Water"); + Logger.WARNING("Found Water"); } } else { - Utils.LOG_WARNING("[x] Did not form - Found: "+tBlock.getLocalizedName() + " | "+tBlock.getDamageValue(aBaseMetaTileEntity.getWorld(), aBaseMetaTileEntity.getXCoord()+ i, aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord() + j)); - Utils.LOG_WARNING("[x] Did not form - Found: "+(aBaseMetaTileEntity.getXCoord()+xDir + i) +" | "+ aBaseMetaTileEntity.getYCoord()+" | "+ (aBaseMetaTileEntity.getZCoord()+zDir + j)); + Logger.WARNING("[x] Did not form - Found: "+tBlock.getLocalizedName() + " | "+tBlock.getDamageValue(aBaseMetaTileEntity.getWorld(), aBaseMetaTileEntity.getXCoord()+ i, aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord() + j)); + Logger.WARNING("[x] Did not form - Found: "+(aBaseMetaTileEntity.getXCoord()+xDir + i) +" | "+ aBaseMetaTileEntity.getYCoord()+" | "+ (aBaseMetaTileEntity.getZCoord()+zDir + j)); return false; } @@ -231,10 +231,10 @@ extends GregtechMeta_MultiBlockBase { } } if ((tAmount >= 8)){ - Utils.LOG_WARNING("Made structure."); + Logger.WARNING("Made structure."); } else { - Utils.LOG_WARNING("Did not make structure."); + Logger.WARNING("Did not make structure."); } return (tAmount >= 8); } @@ -375,10 +375,10 @@ extends GregtechMeta_MultiBlockBase { } } if ((tAmount == 45)){ - Utils.LOG_WARNING("Filled structure."); + Logger.WARNING("Filled structure."); } else { - Utils.LOG_WARNING("Did not fill structure."); + Logger.WARNING("Did not fill structure."); } return (tAmount == 45); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWireMill.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWireMill.java index 50dbed4fb9..ece7740394 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWireMill.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWireMill.java @@ -12,9 +12,9 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maint 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.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; @@ -87,7 +87,7 @@ extends GregtechMeta_MultiBlockBase { if (tRecipe != null) { final int tValidOutputSlots = this.getValidOutputSlots(this.getBaseMetaTileEntity(), tRecipe, new ItemStack[]{tInput}); - Utils.LOG_WARNING("Valid Output Slots: "+tValidOutputSlots); + Logger.WARNING("Valid Output Slots: "+tValidOutputSlots); //More than or one input if ((tInputList.size() > 0) && (tValidOutputSlots >= 1)) { @@ -134,7 +134,7 @@ extends GregtechMeta_MultiBlockBase { } } if (tAirCount != 10) { - Utils.LOG_INFO("False 1"); + Logger.INFO("False 1"); return false; } for (byte i = 2; i < 6; i = (byte) (i + 1)) { @@ -157,14 +157,14 @@ extends GregtechMeta_MultiBlockBase { if ((this.getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingBlock()) && (this.getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingMeta())) { } else if (!this.addToMachineList(this.getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i))) && (!this.addEnergyInputToMachineList(this.getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i))))) { - Utils.LOG_INFO("False 2"); + Logger.INFO("False 2"); return false; } } else if ((this.getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingBlock()) && (this.getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingMeta())) { } else { - Utils.LOG_INFO("False 3"); + Logger.INFO("False 3"); return false; } } @@ -172,11 +172,11 @@ extends GregtechMeta_MultiBlockBase { } } if ((this.mOutputHatches.size() != 0) || (this.mInputHatches.size() != 0)) { - Utils.LOG_INFO("Use Busses, Not Hatches for Input/Output."); + Logger.INFO("Use Busses, Not Hatches for Input/Output."); return false; } if ((this.mInputBusses.size() != 2) || (this.mOutputBusses.size() != 2)) { - Utils.LOG_INFO("Incorrect amount of Input & Output busses."); + Logger.INFO("Incorrect amount of Input & Output busses."); return false; } this.mMaintenanceHatches.clear(); @@ -186,19 +186,19 @@ extends GregtechMeta_MultiBlockBase { this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) tTileEntity.getMetaTileEntity()); ((GT_MetaTileEntity_Hatch) tTileEntity.getMetaTileEntity()).mMachineBlock = this.getCasingTextureIndex(); } else { - Utils.LOG_INFO("Maintenance hatch must be in the middle block on the back."); + Logger.INFO("Maintenance hatch must be in the middle block on the back."); return false; } } if ((this.mMaintenanceHatches.size() != 1) || (this.mEnergyHatches.size() != 1)) { - Utils.LOG_INFO("Incorrect amount of Maintenance or Energy hatches."); + Logger.INFO("Incorrect amount of Maintenance or Energy hatches."); return false; } } else { - Utils.LOG_INFO("False 5"); + Logger.INFO("False 5"); return false; } - Utils.LOG_INFO("True"); + Logger.INFO("True"); return true; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MassFabricator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MassFabricator.java index 5fc5b9c3fb..98ca91d7f6 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MassFabricator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MassFabricator.java @@ -17,9 +17,9 @@ import gregtech.api.util.GT_Config; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.api.util.Recipe_GT; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.fluid.FluidUtils; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.xmod.gregtech.api.gui.GUI_MatterFab; @@ -106,12 +106,12 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo @Override public boolean checkRecipe(final ItemStack aStack) { - Utils.LOG_WARNING("Fabricating Matter."); + Logger.WARNING("Fabricating Matter."); if (this.mInputHatches.size() != 1){ - Utils.LOG_INFO("Too many input hatches. Found: "+this.mInputHatches.size()+" | Expected: 1"); + Logger.INFO("Too many input hatches. Found: "+this.mInputHatches.size()+" | Expected: 1"); return false; } - Utils.LOG_WARNING("Step 1"); + Logger.WARNING("Step 1"); final ArrayList<ItemStack> tInputList = this.getStoredInputs(); for (int i = 0; i < (tInputList.size() - 1); i++) { @@ -126,7 +126,7 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo } } } - Utils.LOG_WARNING("Step 2"); + Logger.WARNING("Step 2"); final ItemStack[] tInputs = Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2); @@ -145,7 +145,7 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo } } } - Utils.LOG_WARNING("Step 3"); + Logger.WARNING("Step 3"); final long tVoltage = this.getMaxInputVoltage(); final byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); @@ -183,12 +183,12 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo Utils.LOG_INFO("Did not find an itemstack containing 9 IC2 Scrap or more."); } }*/ - Utils.LOG_WARNING("Step 4"); + Logger.WARNING("Step 4"); tFluids = Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tFluidList.size()]), 0, tFluidList.size()); if (tFluids.length > 0) { - Utils.LOG_WARNING("Input fluid found"); + Logger.WARNING("Input fluid found"); for(int i = 0;i<tFluids.length;i++){ final GT_Recipe tRecipe = Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.findRecipe(this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[]{tFluids[i]}, new ItemStack[]{}); if (tRecipe != null) { @@ -221,13 +221,13 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo } } else { - Utils.LOG_INFO("Invalid Recipe"); + Logger.INFO("Invalid Recipe"); return false; } } } else if (tFluids.length == 0) { - Utils.LOG_WARNING("Input fluid not found"); + Logger.WARNING("Input fluid not found"); this.fakeRecipe = Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.findRecipe(this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[]{this.tempFake}, new ItemStack[]{}); this.mEfficiency = (10000 - ((this.getIdealStatus() - this.getRepairStatus()) * 1000)); @@ -256,9 +256,9 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo } } else { - Utils.LOG_INFO("Invalid no input Recipe"); + Logger.INFO("Invalid no input Recipe"); } - Utils.LOG_INFO("Fabricating Matter.bad"); + Logger.INFO("Fabricating Matter.bad"); return false; } @@ -284,27 +284,27 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo if (((i != -2) && (i != 2)) && ((j != -2) && (j != 2))) {// innerer 3x3 ohne h�he if (h == 0) {// innen boden (kantal coils) if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) { - Utils.LOG_INFO("Matter Generation Coils missings from the bottom layer, inner 3x3."); + Logger.INFO("Matter Generation Coils missings from the bottom layer, inner 3x3."); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 8) { - Utils.LOG_INFO("Matter Generation Coils missings from the bottom layer, inner 3x3."); + Logger.INFO("Matter Generation Coils missings from the bottom layer, inner 3x3."); return false; } } else if (h == 3) {// innen decke (ulv casings + input + muffler) if ((!this.addMufflerToMachineList(tTileEntity, TAE.GTPP_INDEX(9)))) { if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) { - Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the top layers inner 3x3."); + Logger.INFO("Matter Fabricator Casings Missing from one of the top layers inner 3x3."); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) { - Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the top layers inner 3x3."); + Logger.INFO("Matter Fabricator Casings Missing from one of the top layers inner 3x3."); return false; } } } else {// innen air 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; } } @@ -313,11 +313,11 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo if ((!this.addMaintenanceToMachineList(tTileEntity, TAE.GTPP_INDEX(9))) && (!this.addInputToMachineList(tTileEntity, TAE.GTPP_INDEX(9))) && (!this.addOutputToMachineList(tTileEntity, TAE.GTPP_INDEX(9))) && (!this.addEnergyInputToMachineList(tTileEntity, TAE.GTPP_INDEX(9)))) { if (((xDir + i) != 0) || ((zDir + j) != 0)) {//no controller if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) { - Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the edges of the bottom layer."); + Logger.INFO("Matter Fabricator Casings Missing from one of the edges of the bottom layer."); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) { - Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the edges of the bottom layer."); + Logger.INFO("Matter Fabricator Casings Missing from one of the edges of the bottom layer."); return false; } } @@ -327,18 +327,18 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo if (((i == -2) || (i == 2)) && ((j == -2) || (j == 2))){ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) { - Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the corners in the second layer."); + Logger.INFO("Matter Fabricator Casings Missing from one of the corners in the second layer."); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) { - Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the corners in the second layer."); + Logger.INFO("Matter Fabricator Casings Missing from one of the corners in the second layer."); return false; } } else if (((i != -2) || (i != 2)) && ((j != -2) || (j != 2))){ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != IC2Glass) { - Utils.LOG_INFO("Glass Casings Missing from somewhere in the second layer."); + Logger.INFO("Glass Casings Missing from somewhere in the second layer."); return false; } } @@ -346,29 +346,29 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo if (h == 2) { if (((i == -2) || (i == 2)) && ((j == -2) || (j == 2))){ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) { - Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the corners in the third layer."); + Logger.INFO("Matter Fabricator Casings Missing from one of the corners in the third layer."); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) { - Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the corners in the third layer."); + Logger.INFO("Matter Fabricator Casings Missing from one of the corners in the third layer."); return false; } } else if (((i != -2) || (i != 2)) && ((j != -2) || (j != 2))){ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != IC2Glass) { - Utils.LOG_INFO("Glass Casings Missing from somewhere in the third layer."); + Logger.INFO("Glass Casings Missing from somewhere in the third layer."); return false; } } } if (h == 3) { if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) { - Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the edges on the top layer."); + Logger.INFO("Matter Fabricator Casings Missing from one of the edges on the top layer."); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) { - Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the edges on the top layer."); + Logger.INFO("Matter Fabricator Casings Missing from one of the edges on the top layer."); return false; } } @@ -377,7 +377,7 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo } } } - Utils.LOG_INFO("Multiblock Formed."); + Logger.INFO("Multiblock Formed."); return true; } 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 b8f2535b1f..7f2036fcc3 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 @@ -3,9 +3,7 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi; import java.util.ArrayList; import java.util.Arrays; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.TAE; -import gregtech.api.enums.Textures; +import gregtech.api.enums.*; import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -15,9 +13,9 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input 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.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.array.Pair; import gtPlusPlus.core.util.fluid.FluidUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; @@ -137,11 +135,11 @@ extends GregtechMeta_MultiBlockBase { if (temp != null){ if (this.internalStorageTank == null){ this.internalStorageTank = temp; - Utils.LOG_WARNING(temp.getFluid().getName()+" Amount: "+temp.amount+"L"); + Logger.WARNING(temp.getFluid().getName()+" Amount: "+temp.amount+"L"); } else{ - Utils.LOG_WARNING("Retained Fluid."); - Utils.LOG_WARNING(this.internalStorageTank.getFluid().getName()+" Amxount: "+this.internalStorageTank.amount+"L"); + Logger.WARNING("Retained Fluid."); + Logger.WARNING(this.internalStorageTank.getFluid().getName()+" Amxount: "+this.internalStorageTank.amount+"L"); } this.markDirty(); return true; @@ -272,7 +270,7 @@ extends GregtechMeta_MultiBlockBase { final FluidStack[] tFluids = Arrays.copyOfRange(tFluidList.toArray(new FluidStack[1]), 0, 1); if (tFluids.length >= 2){ - Utils.LOG_WARNING("Bad"); + Logger.WARNING("Bad"); return false; } @@ -289,37 +287,37 @@ extends GregtechMeta_MultiBlockBase { } } if ((tFluids.length <= 0) || (slotInputCount > 1)){ - Utils.LOG_WARNING("Bad"); + Logger.WARNING("Bad"); return false; } - Utils.LOG_WARNING("Okay - 2"); + Logger.WARNING("Okay - 2"); if (this.internalStorageTank == null){ - Utils.LOG_WARNING("Okay - 3"); + Logger.WARNING("Okay - 3"); if ((rList.get(0).getKey().mFluid != null) && (rList.get(0).getKey().mFluid.amount > 0)){ - Utils.LOG_WARNING("Okay - 4"); - Utils.LOG_WARNING("Okay - 1"+" rList.get(0).getKey().mFluid.amount: "+rList.get(0).getKey().mFluid.amount /*+" internalStorageTank:"+internalStorageTank.amount*/); + Logger.WARNING("Okay - 4"); + Logger.WARNING("Okay - 1"+" rList.get(0).getKey().mFluid.amount: "+rList.get(0).getKey().mFluid.amount /*+" internalStorageTank:"+internalStorageTank.amount*/); final FluidStack tempFluidStack = rList.get(0).getKey().mFluid; final Fluid tempFluid = tempFluidStack.getFluid(); this.internalStorageTank = FluidUtils.getFluidStack(tempFluid.getName(), tempFluidStack.amount); rList.get(0).getKey().mFluid.amount = 0; - Utils.LOG_WARNING("Okay - 1.1"+" rList.get(0).getKey().mFluid.amount: "+rList.get(0).getKey().mFluid.amount +" internalStorageTank:"+this.internalStorageTank.amount); + Logger.WARNING("Okay - 1.1"+" rList.get(0).getKey().mFluid.amount: "+rList.get(0).getKey().mFluid.amount +" internalStorageTank:"+this.internalStorageTank.amount); return true; } - Utils.LOG_WARNING("No Fluid in hatch."); + Logger.WARNING("No Fluid in hatch."); return false; } else if (this.internalStorageTank.isFluidEqual(rList.get(0).getKey().mFluid)){ - Utils.LOG_WARNING("Storing "+rList.get(0).getKey().mFluid.amount+"L"); - Utils.LOG_WARNING("Contains "+this.internalStorageTank.amount+"L"); + Logger.WARNING("Storing "+rList.get(0).getKey().mFluid.amount+"L"); + Logger.WARNING("Contains "+this.internalStorageTank.amount+"L"); int tempAdd = 0; tempAdd = rList.get(0).getKey().getFluidAmount(); rList.get(0).getKey().mFluid = null; - Utils.LOG_WARNING("adding "+tempAdd); + Logger.WARNING("adding "+tempAdd); this.internalStorageTank.amount = this.internalStorageTank.amount + tempAdd; - Utils.LOG_WARNING("Tank now Contains "+this.internalStorageTank.amount+"L of "+this.internalStorageTank.getFluid().getName()+"."); + Logger.WARNING("Tank now Contains "+this.internalStorageTank.amount+"L of "+this.internalStorageTank.getFluid().getName()+"."); //Utils.LOG_WARNING("Tank"); @@ -327,19 +325,19 @@ extends GregtechMeta_MultiBlockBase { } else { final FluidStack superTempFluidStack = rList.get(0).getKey().mFluid; - Utils.LOG_WARNING("is input fluid equal to stored fluid? "+(this.internalStorageTank.isFluidEqual(superTempFluidStack))); + Logger.WARNING("is input fluid equal to stored fluid? "+(this.internalStorageTank.isFluidEqual(superTempFluidStack))); if (superTempFluidStack != null) { - Utils.LOG_WARNING("Input hatch[0] Contains "+superTempFluidStack.amount+"L of "+superTempFluidStack.getFluid().getName()+"."); + Logger.WARNING("Input hatch[0] Contains "+superTempFluidStack.amount+"L of "+superTempFluidStack.getFluid().getName()+"."); } - Utils.LOG_WARNING("Large Multi-Tank Contains "+this.internalStorageTank.amount+"L of "+this.internalStorageTank.getFluid().getName()+"."); + Logger.WARNING("Large Multi-Tank Contains "+this.internalStorageTank.amount+"L of "+this.internalStorageTank.getFluid().getName()+"."); if (this.internalStorageTank.amount <= 0){ - Utils.LOG_WARNING("Internal Tank is empty, sitting idle."); + Logger.WARNING("Internal Tank is empty, sitting idle."); return false; } if ((this.mOutputHatches.get(0).mFluid == null) || this.mOutputHatches.isEmpty() || (this.mOutputHatches.get(0).mFluid.isFluidEqual(this.internalStorageTank) && (this.mOutputHatches.get(0).mFluid.amount < this.mOutputHatches.get(0).getCapacity()))){ - Utils.LOG_WARNING("Okay - 3"); + Logger.WARNING("Okay - 3"); final int tempCurrentStored = this.internalStorageTank.amount; int tempResult = 0; final int tempHatchSize = this.mOutputHatches.get(0).getCapacity(); @@ -349,10 +347,10 @@ extends GregtechMeta_MultiBlockBase { if (tempHatchRemainingSpace <= 0){ return false; } - Utils.LOG_WARNING("Okay - 3.1.x"+" hatchCapacity: "+tempHatchSize +" tempCurrentStored: "+tempCurrentStored+" output hatch holds: "+tempHatchCurrentHolding+" tank has "+tempHatchRemainingSpace+"L of space left."); + Logger.WARNING("Okay - 3.1.x"+" hatchCapacity: "+tempHatchSize +" tempCurrentStored: "+tempCurrentStored+" output hatch holds: "+tempHatchCurrentHolding+" tank has "+tempHatchRemainingSpace+"L of space left."); if (tempHatchSize >= tempHatchRemainingSpace){ - Utils.LOG_WARNING("Okay - 3.1.1"+" hatchCapacity: "+tempHatchSize +" tempCurrentStored: "+tempCurrentStored+" output hatch holds: "+tempHatchCurrentHolding+" tank has "+tempHatchRemainingSpace+"L of space left."); + Logger.WARNING("Okay - 3.1.1"+" hatchCapacity: "+tempHatchSize +" tempCurrentStored: "+tempCurrentStored+" output hatch holds: "+tempHatchCurrentHolding+" tank has "+tempHatchRemainingSpace+"L of space left."); int adder; if ((tempCurrentStored > 0) && (tempCurrentStored <= tempHatchSize)){ @@ -370,20 +368,20 @@ extends GregtechMeta_MultiBlockBase { tempResult = adder; tempOutputFluid.amount = tempResult; - Utils.LOG_WARNING("Okay - 3.1.2"+" result: "+tempResult +" tempCurrentStored: "+tempCurrentStored + " filling output hatch with: "+tempOutputFluid.amount+"L of "+tempOutputFluid.getFluid().getName()); + Logger.WARNING("Okay - 3.1.2"+" result: "+tempResult +" tempCurrentStored: "+tempCurrentStored + " filling output hatch with: "+tempOutputFluid.amount+"L of "+tempOutputFluid.getFluid().getName()); this.mOutputHatches.get(0).fill(tempOutputFluid, true); //mOutputHatches.get(0).mFluid.amount = tempResult; this.internalStorageTank.amount = (tempCurrentStored-adder); - Utils.LOG_WARNING("Okay - 3.1.3"+" internalTankStorage: "+this.internalStorageTank.amount +"L | output hatch contains: "+this.mOutputHatches.get(0).mFluid.amount+"L of "+this.mOutputHatches.get(0).mFluid.getFluid().getName()); + Logger.WARNING("Okay - 3.1.3"+" internalTankStorage: "+this.internalStorageTank.amount +"L | output hatch contains: "+this.mOutputHatches.get(0).mFluid.amount+"L of "+this.mOutputHatches.get(0).mFluid.getFluid().getName()); /*if (internalStorageTank.amount <= 0) internalStorageTank = null;*/ } - Utils.LOG_WARNING("Tank ok."); + Logger.WARNING("Tank ok."); return true; } } //this.getBaseMetaTileEntity().(tFluids[0].amount, true); - Utils.LOG_WARNING("Tank"); + Logger.WARNING("Tank"); return false; } @@ -392,7 +390,7 @@ extends GregtechMeta_MultiBlockBase { final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) { - Utils.LOG_WARNING("Must be hollow."); + Logger.WARNING("Must be hollow."); return false; } int tAmount = 0; @@ -404,7 +402,7 @@ extends GregtechMeta_MultiBlockBase { if ((!this.addMaintenanceToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && (!this.addInputToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && (!this.addOutputToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && (!this.addEnergyInputToMachineList(tTileEntity, TAE.GTPP_INDEX(11)))) { if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) { if (h < 3){ - Utils.LOG_WARNING("Casing Expected."); + Logger.WARNING("Casing Expected."); return false; } else if (h >= 3){ @@ -413,7 +411,7 @@ extends GregtechMeta_MultiBlockBase { } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 11) { if (h < 3){ - Utils.LOG_WARNING("Wrong Meta."); + Logger.WARNING("Wrong Meta."); return false; } else if (h >= 3){ @@ -425,10 +423,10 @@ extends GregtechMeta_MultiBlockBase { } else if (h >= 3){ if ((aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) == Blocks.air) || aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getUnlocalizedName().contains("residual")){ - Utils.LOG_WARNING("Found air"); + Logger.WARNING("Found air"); } else { - Utils.LOG_WARNING("Layer "+(h+2)+" is complete. Adding "+(64000*9)+"L storage to the tank."); + Logger.WARNING("Layer "+(h+2)+" is complete. Adding "+(64000*9)+"L storage to the tank."); tAmount++; } } @@ -439,8 +437,8 @@ extends GregtechMeta_MultiBlockBase { } this.multiblockCasingCount = (short) tAmount; this.maximumFluidStorage = getMaximumTankStorage(tAmount); - Utils.LOG_INFO("Your Multitank can be 20 blocks tall."); - Utils.LOG_INFO("Casings Count: "+this.multiblockCasingCount+" Valid Multiblock: "+(tAmount >= 16)+" Tank Storage Capacity:"+this.maximumFluidStorage+"L"); + Logger.INFO("Your Multitank can be 20 blocks tall."); + Logger.INFO("Casings Count: "+this.multiblockCasingCount+" Valid Multiblock: "+(tAmount >= 16)+" Tank Storage Capacity:"+this.maximumFluidStorage+"L"); this.tryForceNBTUpdate(); return tAmount >= 16; } @@ -522,6 +520,7 @@ extends GregtechMeta_MultiBlockBase { return 10000; } + @Override public int getPollutionPerTick(final ItemStack aStack) { return 5; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_PowerSubStationController.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_PowerSubStationController.java index 54365f63d7..e9638d29ed 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_PowerSubStationController.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_PowerSubStationController.java @@ -9,15 +9,13 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -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.*; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Config; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; 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.GUI_MultiMachine; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBattery; @@ -102,7 +100,7 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe @Override public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { - Utils.LOG_MACHINE_INFO("Checking structure for Industrial Power Sub-Station."); + Logger.MACHINE_INFO("Checking structure for Industrial Power Sub-Station."); final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2; final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2; @@ -128,12 +126,12 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe if (h == 2 || h == 1){ //If not a hatch, continue, else add hatch and continue. if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasings2Misc) { - Utils.LOG_MACHINE_INFO("Station Casing(s) Missing from one of the top layers inner 3x3."); - Utils.LOG_MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); + Logger.MACHINE_INFO("Station Casing(s) Missing from one of the top layers inner 3x3."); + Logger.MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 7) { - Utils.LOG_MACHINE_INFO("Station Casing(s) Missing from one of the top layers inner 3x3. Wrong Meta for Casing. Found:"+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()+" with meta:"+aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j)); + Logger.MACHINE_INFO("Station Casing(s) Missing from one of the top layers inner 3x3. Wrong Meta for Casing. Found:"+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()+" with meta:"+aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j)); return false; } } @@ -141,12 +139,12 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe if (h==0){ if (!this.addToMachineList(tTileEntity, TAE.GTPP_INDEX(24))) { if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasings2Misc) { - Utils.LOG_MACHINE_INFO("Station Casing(s) Missing from one of the bottom layers inner 3x3."); - Utils.LOG_MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); + Logger.MACHINE_INFO("Station Casing(s) Missing from one of the bottom layers inner 3x3."); + Logger.MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 8) { - Utils.LOG_MACHINE_INFO("Station Casing(s) Missing from one of the bottom layers inner 3x3. Wrong Meta for Casing. Found:"+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()+" with meta:"+aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j)); + Logger.MACHINE_INFO("Station Casing(s) Missing from one of the bottom layers inner 3x3. Wrong Meta for Casing. Found:"+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()+" with meta:"+aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j)); return false; } tAmount++; @@ -155,12 +153,12 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe if (h==3){ if (!this.addToMachineList(tTileEntity, TAE.GTPP_INDEX(24))) { if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasings2Misc) { - Utils.LOG_MACHINE_INFO("Station Casing(s) Missing from one of the top layers inner 3x3."); - Utils.LOG_MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); + Logger.MACHINE_INFO("Station Casing(s) Missing from one of the top layers inner 3x3."); + Logger.MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 8) { - Utils.LOG_MACHINE_INFO("Station Casing(s) Missing from one of the top layers inner 3x3. Wrong Meta for Casing. Found:"+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()+" with meta:"+aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j)); + Logger.MACHINE_INFO("Station Casing(s) Missing from one of the top layers inner 3x3. Wrong Meta for Casing. Found:"+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()+" with meta:"+aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j)); return false; } tAmount++; @@ -178,13 +176,13 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe if (h == 3){ if (!this.addToMachineList(tTileEntity, TAE.GTPP_INDEX(24))) { if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasings2Misc) { - Utils.LOG_MACHINE_INFO("Station Casings Missing from somewhere in the top layer edge. 3"); - Utils.LOG_MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); + Logger.MACHINE_INFO("Station Casings Missing from somewhere in the top layer edge. 3"); + Logger.MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 8) { - Utils.LOG_MACHINE_INFO("Station Casings Missing from somewhere in the top layer edge. 3"); - Utils.LOG_MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); + Logger.MACHINE_INFO("Station Casings Missing from somewhere in the top layer edge. 3"); + Logger.MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); return false; } tAmount++; @@ -193,13 +191,13 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe else if (h == 2){ if (!this.addToMachineList(tTileEntity, TAE.GTPP_INDEX(24))) { if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasings2Misc) { - Utils.LOG_MACHINE_INFO("Station Casings Missing from somewhere in the top layer edge. 2"); - Utils.LOG_MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); + Logger.MACHINE_INFO("Station Casings Missing from somewhere in the top layer edge. 2"); + Logger.MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 8) { - Utils.LOG_MACHINE_INFO("Station Casings Missing from somewhere in the top layer edge. 2"); - Utils.LOG_MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); + Logger.MACHINE_INFO("Station Casings Missing from somewhere in the top layer edge. 2"); + Logger.MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); return false; } tAmount++; @@ -208,13 +206,13 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe else { if (!this.addToMachineList(tTileEntity, TAE.GTPP_INDEX(24))) { if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasings2Misc) { - Utils.LOG_MACHINE_INFO("Station Casings Missing from somewhere in the second layer. 1"); - Utils.LOG_MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); + Logger.MACHINE_INFO("Station Casings Missing from somewhere in the second layer. 1"); + Logger.MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 8) { - Utils.LOG_MACHINE_INFO("Station Casings Missing from somewhere in the second layer. 1"); - Utils.LOG_MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); + Logger.MACHINE_INFO("Station Casings Missing from somewhere in the second layer. 1"); + Logger.MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); return false; } tAmount++; @@ -228,13 +226,13 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe if (((xDir + i) != 0) || ((zDir + j) != 0)) {//no controller if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasings2Misc) { - Utils.LOG_MACHINE_INFO("Station Casing(s) Missing from one of the edges on the top layer."); - Utils.LOG_MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); + Logger.MACHINE_INFO("Station Casing(s) Missing from one of the edges on the top layer."); + Logger.MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 8) { - Utils.LOG_MACHINE_INFO("Station Casing(s) Missing from one of the edges on the top layer. "+h); - Utils.LOG_MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); + Logger.MACHINE_INFO("Station Casing(s) Missing from one of the edges on the top layer. "+h); + Logger.MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); if (h ==0){ if (tTileEntity instanceof GregtechMetaTileEntity_PowerSubStationController){ @@ -271,12 +269,12 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe if ((this.mChargeHatches.size() < 1) || (this.mDischargeHatches.size() < 1) || (this.mMaintenanceHatches.size() != 1) || (this.mEnergyHatches.size() < 1) || (this.mAllDynamoHatches.size() < 1)) { - Utils.LOG_MACHINE_INFO("Returned False 3"); - Utils.LOG_MACHINE_INFO("Charge Buses: "+this.mChargeHatches.size()+" | expected: 1 | "+(this.mChargeHatches.size() != 1)); - Utils.LOG_MACHINE_INFO("Discharge Buses: "+this.mDischargeHatches.size()+" | expected: 1 | "+(this.mDischargeHatches.size() != 1)); - Utils.LOG_MACHINE_INFO("Energy Hatches: "+this.mEnergyHatches.size()+" | expected: >= 1 | "+(this.mEnergyHatches.size() < 1)); - Utils.LOG_MACHINE_INFO("Dynamo Hatches: "+this.mAllDynamoHatches.size()+" | expected: >= 1 | "+(this.mAllDynamoHatches.size() < 1)); - Utils.LOG_MACHINE_INFO("Maint. Hatches: "+this.mMaintenanceHatches.size()+" | expected: 1 | "+(this.mMaintenanceHatches.size() != 1)); + Logger.MACHINE_INFO("Returned False 3"); + Logger.MACHINE_INFO("Charge Buses: "+this.mChargeHatches.size()+" | expected: 1 | "+(this.mChargeHatches.size() != 1)); + Logger.MACHINE_INFO("Discharge Buses: "+this.mDischargeHatches.size()+" | expected: 1 | "+(this.mDischargeHatches.size() != 1)); + Logger.MACHINE_INFO("Energy Hatches: "+this.mEnergyHatches.size()+" | expected: >= 1 | "+(this.mEnergyHatches.size() < 1)); + Logger.MACHINE_INFO("Dynamo Hatches: "+this.mAllDynamoHatches.size()+" | expected: >= 1 | "+(this.mAllDynamoHatches.size() < 1)); + Logger.MACHINE_INFO("Maint. Hatches: "+this.mMaintenanceHatches.size()+" | expected: 1 | "+(this.mMaintenanceHatches.size() != 1)); return false; } @@ -295,7 +293,7 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe this.mAverageEuUsage = (tempAvg/hatchCount); } - Utils.LOG_INFO("Structure Built? "+""+tAmount+" | "+(tAmount>=35)); + Logger.INFO("Structure Built? "+""+tAmount+" | "+(tAmount>=35)); return tAmount >= 35; } @@ -327,6 +325,7 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe return 0; } + @Override public int getAmountOfOutputs() { return 1; } @@ -479,7 +478,7 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe if (this.mActualStoredEU<this.maxEUStore()){ } - Utils.LOG_INFO("Draining Discharge Hatch #2"); + Logger.INFO("Draining Discharge Hatch #2"); } } for (GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) { @@ -491,7 +490,7 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe } long nNewStoredPower = this.getEUVar(); if (nNewStoredPower < nStoredPower){ - Utils.LOG_ERROR("Used "+(nStoredPower-nNewStoredPower)+"eu."); + Logger.ERROR("Used "+(nStoredPower-nNewStoredPower)+"eu."); return true; } @@ -527,7 +526,7 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe } long nNewStoredPower = this.getEUVar(); if (nNewStoredPower < nStoredPower){ - Utils.LOG_ERROR("Used "+(nStoredPower-nNewStoredPower)+"eu."); + Logger.ERROR("Used "+(nStoredPower-nNewStoredPower)+"eu."); return true; } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_Refinery.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_Refinery.java index 1c5930537e..6661812aac 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_Refinery.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_Refinery.java @@ -10,9 +10,9 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; 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.lib.CORE; -import gtPlusPlus.core.util.Utils; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; @@ -68,8 +68,8 @@ public class GregtechMetaTileEntity_Refinery extends GT_MetaTileEntity_MultiBloc 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 { tFluidList.remove(i--); tFluidList_sS=tFluidList.size(); @@ -109,11 +109,11 @@ public class GregtechMetaTileEntity_Refinery extends GT_MetaTileEntity_MultiBloc if ((!this.addToMachineList(tTileEntity, TAE.GTPP_INDEX(18))) && (!this.addEnergyInputToMachineList(tTileEntity, TAE.GTPP_INDEX(18)))) { if (aBaseMetaTileEntity.getBlockOffset(xDir + i, Y, zDir + j) != ModBlocks.blockCasings2Misc) { - Utils.LOG_INFO("1 Wrong Block. Found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, Y, zDir + j).getLocalizedName()); + Logger.INFO("1 Wrong Block. Found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, Y, zDir + j).getLocalizedName()); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, Y, zDir + j) != 2) { - Utils.LOG_INFO("1 Wrong Meta. Found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, Y, zDir + j).getLocalizedName()+" | Expected Meta 2 | Got Meta "+aBaseMetaTileEntity.getMetaIDOffset(xDir + i, Y, zDir + j)); + Logger.INFO("1 Wrong Meta. Found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, Y, zDir + j).getLocalizedName()+" | Expected Meta 2 | Got Meta "+aBaseMetaTileEntity.getMetaIDOffset(xDir + i, Y, zDir + j)); return false; } } @@ -127,11 +127,11 @@ public class GregtechMetaTileEntity_Refinery extends GT_MetaTileEntity_MultiBloc if ((!this.addToMachineList(tTileEntity2, TAE.GTPP_INDEX(18))) && (!this.addEnergyInputToMachineList(tTileEntity2, TAE.GTPP_INDEX(18)))) { if (aBaseMetaTileEntity.getBlockOffset(xDir + i, Y, zDir + j) != ModBlocks.blockCasings2Misc) { - Utils.LOG_INFO("2 Wrong Block. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, Y, zDir).getLocalizedName()); + Logger.INFO("2 Wrong Block. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, Y, zDir).getLocalizedName()); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, Y, zDir + j) != 2) { - Utils.LOG_INFO("2 Wrong Meta. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, Y, zDir).getLocalizedName()+" | Expected Meta 2 | Got Meta "+aBaseMetaTileEntity.getMetaIDOffset(xDir, Y, zDir)); + Logger.INFO("2 Wrong Meta. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, Y, zDir).getLocalizedName()+" | Expected Meta 2 | Got Meta "+aBaseMetaTileEntity.getMetaIDOffset(xDir, Y, zDir)); return false; } } @@ -144,21 +144,21 @@ public class GregtechMetaTileEntity_Refinery extends GT_MetaTileEntity_MultiBloc for (int y = 2; y < 7; y++) { if (y<=6){ if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir) != ModBlocks.blockCasings2Misc) { //Must Define meta for center blocks - Utils.LOG_INFO("3 Wrong Block. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir).getLocalizedName()); + Logger.INFO("3 Wrong Block. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir).getLocalizedName()); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir, y, zDir) != 3) { - Utils.LOG_INFO("3 Wrong Meta. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir).getLocalizedName()+" | Expected Meta 3 | Got Meta "+aBaseMetaTileEntity.getMetaIDOffset(xDir, y, zDir)); + Logger.INFO("3 Wrong Meta. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir).getLocalizedName()+" | Expected Meta 3 | Got Meta "+aBaseMetaTileEntity.getMetaIDOffset(xDir, y, zDir)); return false; } } if (y==6){ if (aBaseMetaTileEntity.getBlockOffset(xDir, y + 1, zDir) != ModBlocks.blockCasings2Misc) { - Utils.LOG_INFO("8 Wrong Block. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, y+1, zDir).getLocalizedName()+" | "+aBaseMetaTileEntity.getMetaIDOffset(xDir, y+1, zDir)); + Logger.INFO("8 Wrong Block. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, y+1, zDir).getLocalizedName()+" | "+aBaseMetaTileEntity.getMetaIDOffset(xDir, y+1, zDir)); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir, y + 1, zDir) != 1) { - Utils.LOG_INFO("8 Wrong Meta. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, y+1, zDir).getLocalizedName()+" | Expected Meta 1 | Got Meta "+aBaseMetaTileEntity.getMetaIDOffset(xDir, y + 1, zDir)); + Logger.INFO("8 Wrong Meta. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, y+1, zDir).getLocalizedName()+" | Expected Meta 1 | Got Meta "+aBaseMetaTileEntity.getMetaIDOffset(xDir, y + 1, zDir)); return false; } } @@ -167,14 +167,14 @@ public class GregtechMetaTileEntity_Refinery extends GT_MetaTileEntity_MultiBloc if (y==3){ if (aBaseMetaTileEntity.getBlockOffset(xDir + 1, y, zDir) == ModBlocks.blockCasingsMisc) { if (aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, y, zDir) != 13) { - Utils.LOG_INFO("4 Wrong Meta. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir).getLocalizedName()+" | Expected Meta 13 | Got Meta "+aBaseMetaTileEntity.getMetaIDOffset(xDir, y, zDir)); + Logger.INFO("4 Wrong Meta. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir).getLocalizedName()+" | Expected Meta 13 | Got Meta "+aBaseMetaTileEntity.getMetaIDOffset(xDir, y, zDir)); return false; } - Utils.LOG_INFO("Found Zeron-Casing at "+(aBaseMetaTileEntity.getYCoord()+y)); + Logger.INFO("Found Zeron-Casing at "+(aBaseMetaTileEntity.getYCoord()+y)); } } else { - Utils.LOG_INFO("debug.1"); + Logger.INFO("debug.1"); return false; } } @@ -184,14 +184,14 @@ public class GregtechMetaTileEntity_Refinery extends GT_MetaTileEntity_MultiBloc if (y==3){ if (aBaseMetaTileEntity.getBlockOffset(xDir + 1, y, zDir) == ModBlocks.blockCasingsMisc) { if (aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, y, zDir) != 13) { - Utils.LOG_INFO("5 Wrong Meta. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir).getLocalizedName()+" | Expected Meta 13 | Got Meta "+aBaseMetaTileEntity.getMetaIDOffset(xDir, y, zDir)); + Logger.INFO("5 Wrong Meta. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir).getLocalizedName()+" | Expected Meta 13 | Got Meta "+aBaseMetaTileEntity.getMetaIDOffset(xDir, y, zDir)); return false; } - Utils.LOG_INFO("Found Zeron-Casing at "+(aBaseMetaTileEntity.getYCoord()+y)); + Logger.INFO("Found Zeron-Casing at "+(aBaseMetaTileEntity.getYCoord()+y)); } } else { - Utils.LOG_INFO("debug.2"); + Logger.INFO("debug.2"); return false; } } @@ -201,14 +201,14 @@ public class GregtechMetaTileEntity_Refinery extends GT_MetaTileEntity_MultiBloc if (y==3){ if (aBaseMetaTileEntity.getBlockOffset(xDir + 1, y, zDir) == ModBlocks.blockCasingsMisc) { if (aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, y, zDir) != 13) { - Utils.LOG_INFO("6 Wrong Meta. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir).getLocalizedName()+" | Expected Meta 13 | Got Meta "+aBaseMetaTileEntity.getMetaIDOffset(xDir, y, zDir)); + Logger.INFO("6 Wrong Meta. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir).getLocalizedName()+" | Expected Meta 13 | Got Meta "+aBaseMetaTileEntity.getMetaIDOffset(xDir, y, zDir)); return false; } - Utils.LOG_INFO("Found Zeron-Casing at "+(aBaseMetaTileEntity.getYCoord()+y)); + Logger.INFO("Found Zeron-Casing at "+(aBaseMetaTileEntity.getYCoord()+y)); } } else { - Utils.LOG_INFO("debug.3"); + Logger.INFO("debug.3"); return false; } } @@ -217,14 +217,14 @@ public class GregtechMetaTileEntity_Refinery extends GT_MetaTileEntity_MultiBloc if (y==3){ if (aBaseMetaTileEntity.getBlockOffset(xDir + 1, y, zDir) == ModBlocks.blockCasingsMisc) { if (aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, y, zDir) != 13) { - Utils.LOG_INFO("7 Wrong Meta. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir).getLocalizedName()+" | Expected Meta 13 | Got Meta "+aBaseMetaTileEntity.getMetaIDOffset(xDir, y, zDir)); + Logger.INFO("7 Wrong Meta. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir).getLocalizedName()+" | Expected Meta 13 | Got Meta "+aBaseMetaTileEntity.getMetaIDOffset(xDir, y, zDir)); return false; } - Utils.LOG_INFO("Found Zeron-Casing at "+(aBaseMetaTileEntity.getYCoord()+y)); + Logger.INFO("Found Zeron-Casing at "+(aBaseMetaTileEntity.getYCoord()+y)); } } else { - Utils.LOG_INFO("debug.4"); + Logger.INFO("debug.4"); return false; } } @@ -233,15 +233,15 @@ public class GregtechMetaTileEntity_Refinery extends GT_MetaTileEntity_MultiBloc if ((this.mInputHatches.size() != 4) || (this.mOutputHatches.size() != 2) || (this.mOutputBusses.size() != 1) || (this.mMufflerHatches.size() != 1) || (this.mMaintenanceHatches.size() != 1) || (this.mEnergyHatches.size() != 1)){ - Utils.LOG_INFO("Wrong Hatch count."); + Logger.INFO("Wrong Hatch count."); return false; } if (this.mMufflerHatches.size() == 1){ if (this.mMufflerHatches.get(0).mTier < 7){ - Utils.LOG_INFO("Your Muffler must be AT LEAST ZPM tier or higher."); + Logger.INFO("Your Muffler must be AT LEAST ZPM tier or higher."); } } - Utils.LOG_INFO("Fission Fuel Production Plant Formed."); + Logger.INFO("Fission Fuel Production Plant Formed."); return true; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java index 2fa05f7709..8d795cf50c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java @@ -12,8 +12,8 @@ import gregtech.api.items.GT_MetaBase_Item; 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.core.util.player.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMetaTileEntity; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -222,14 +222,14 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity { @Override public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { - Utils.LOG_WARNING("Right Click on MTE by Player"); + Logger.WARNING("Right Click on MTE by Player"); if (aBaseMetaTileEntity.isClientSide()) { return true; //aBaseMetaTileEntity.openGUI(aPlayer); } - Utils.LOG_WARNING("MTE is Client-side"); + Logger.WARNING("MTE is Client-side"); this.showEnergy(aPlayer.getEntityWorld(), aPlayer); return true; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java index 490f3d7163..46bd28d318 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java @@ -102,6 +102,7 @@ extends GT_Tool { return true; } + @Override public boolean isWrench(){ return true; } |