diff options
Diffstat (limited to 'src/Java/gtPlusPlus/core/item')
26 files changed, 154 insertions, 154 deletions
diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index 387315a885..b9b204cc3b 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -6,6 +6,7 @@ import static gtPlusPlus.core.lib.CORE.LOAD_ALL_CONTENT; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.Materials; import gregtech.api.util.GT_OreDictUnificator; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.common.compat.COMPAT_Baubles; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.item.base.BaseEuItem; @@ -502,7 +503,7 @@ public final class ModItems { } catch (final Throwable r){ - Utils.LOG_INFO("Failed to Generated a Material. "+r.getMessage()); + Logger.INFO("Failed to Generated a Material. "+r.getMessage()); //Utils.LOG_INFO("Failed to Generated a Material. "+r.getCause().getMessage()); //Utils.LOG_INFO("Failed to Generated a Material. "+r.getStackTrace()[0].getMethodName()); //Utils.LOG_INFO("Failed to Generated a Material. "+r.getStackTrace()[1].getMethodName()); @@ -692,7 +693,7 @@ public final class ModItems { //EnderIO Resources if ((LoadedMods.EnderIO || LOAD_ALL_CONTENT)){ - Utils.LOG_INFO("EnderIO Found - Loading Resources."); + Logger.INFO("EnderIO Found - Loading Resources."); //Enderio Dusts itemDustSoularium = ItemUtils.generateSpecialUseDusts("Soularium", "Soularium", MaterialEIO.SOULARIUM.vChemicalFormula, MaterialEIO.SOULARIUM.getRgbAsHex())[0]; itemDustRedstoneAlloy = ItemUtils.generateSpecialUseDusts("RedstoneAlloy", "Redstone Alloy", MaterialEIO.REDSTONE_ALLOY.vChemicalFormula, MaterialEIO.REDSTONE_ALLOY.getRgbAsHex())[0]; @@ -718,24 +719,24 @@ public final class ModItems { GT_OreDictUnificator.registerOre("platePhasedIron", ItemUtils.getSimpleStack(itemPlatePulsatingIron)); } else { - Utils.LOG_WARNING("EnderIO not Found - Skipping Resources."); + Logger.WARNING("EnderIO not Found - Skipping Resources."); } //Big Reactors if (LoadedMods.Big_Reactors|| LOAD_ALL_CONTENT){ - Utils.LOG_INFO("BigReactors Found - Loading Resources."); + Logger.INFO("BigReactors Found - Loading Resources."); //Item Init itemPlateBlutonium = ItemUtils.generateSpecialUsePlate("Blutonium", "Blutonium", new short[]{0, 0, 255}, 0); itemPlateBlutonium = ItemUtils.generateSpecialUsePlate("Cyanite", "Cyanite", new short[]{0, 191, 255}, 0); itemPlateLudicrite = ItemUtils.generateSpecialUsePlate("Ludicrite", "Ludicrite", new short[]{167, 5, 179}, 0); } else { - Utils.LOG_WARNING("BigReactors not Found - Skipping Resources."); + Logger.WARNING("BigReactors not Found - Skipping Resources."); } //Thaumcraft if ((LoadedMods.Thaumcraft|| LOAD_ALL_CONTENT) && !CORE.GTNH){ - Utils.LOG_INFO("Thaumcraft Found - Loading Resources."); + Logger.INFO("Thaumcraft Found - Loading Resources."); //Item Init try { ItemUtils.getItemForOreDict("Thaumcraft:ItemResource", "ingotVoidMetal", "Void Metal Ingot", 16); @@ -747,44 +748,44 @@ public final class ModItems { } else { - Utils.LOG_WARNING("Thaumcraft not Found - Skipping Resources."); + Logger.WARNING("Thaumcraft not Found - Skipping Resources."); } //Pneumaticraft if (LoadedMods.PneumaticCraft|| LOAD_ALL_CONTENT){ - Utils.LOG_INFO("PneumaticCraft Found - Loading Resources."); + Logger.INFO("PneumaticCraft Found - Loading Resources."); //Item Init itemPlateCompressedIron = ItemUtils.generateSpecialUsePlate("CompressedIron", "Compressed Iron", new short[]{128, 128, 128}, 0); } else { - Utils.LOG_WARNING("PneumaticCraft not Found - Skipping Resources."); + Logger.WARNING("PneumaticCraft not Found - Skipping Resources."); } //Simply Jetpacks if (LoadedMods.Simply_Jetpacks|| LOAD_ALL_CONTENT){ - Utils.LOG_INFO("SimplyJetpacks Found - Loading Resources."); + Logger.INFO("SimplyJetpacks Found - Loading Resources."); //Item Init itemPlateEnrichedSoularium = new RarityUncommon().setUnlocalizedName("itemPlateEnrichedSoularium").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemPlateSoularium"); //Registry GameRegistry.registerItem(itemPlateEnrichedSoularium, "itemPlateEnrichedSoularium"); } else { - Utils.LOG_WARNING("SimplyJetpacks not Found - Skipping Resources."); + Logger.WARNING("SimplyJetpacks not Found - Skipping Resources."); } //rfTools if (LoadedMods.RFTools|| LOAD_ALL_CONTENT){ - Utils.LOG_INFO("rfTools Found - Loading Resources."); + Logger.INFO("rfTools Found - Loading Resources."); //Item Init itemPlateDimensionShard = ItemUtils.generateSpecialUsePlate("DimensionShard", "Dimensional Shard", new short[]{170, 230, 230}, 0); } else { - Utils.LOG_WARNING("rfTools not Found - Skipping Resources."); + Logger.WARNING("rfTools not Found - Skipping Resources."); } //IC2 Exp if (LoadedMods.IndustrialCraft2|| LOAD_ALL_CONTENT){ - Utils.LOG_INFO("IndustrialCraft2 Found - Loading Resources."); + Logger.INFO("IndustrialCraft2 Found - Loading Resources."); RfEuBattery = new RF2EU_Battery(); //Baubles Mod Test @@ -794,14 +795,14 @@ public final class ModItems { COMPAT_Baubles.run(); } else { - Utils.LOG_INFO("Baubles Not Found - Skipping Resources."); + Logger.INFO("Baubles Not Found - Skipping Resources."); } } catch(final Throwable T){ - Utils.LOG_INFO("Baubles Not Found - Skipping Resources."); + Logger.INFO("Baubles Not Found - Skipping Resources."); } } else { - Utils.LOG_WARNING("IndustrialCraft2 not Found - Skipping Resources."); + Logger.WARNING("IndustrialCraft2 not Found - Skipping Resources."); } diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemDamageable.java b/src/Java/gtPlusPlus/core/item/base/BaseItemDamageable.java index c85eea4bed..8ae28fc343 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemDamageable.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemDamageable.java @@ -5,8 +5,8 @@ import java.util.List; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; @@ -159,7 +159,7 @@ public class BaseItemDamageable extends Item { @Override public boolean doesContainerItemLeaveCraftingGrid(ItemStack stack) { - Utils.LOG_INFO("Does Leave Table? "+stack.getDisplayName()); + Logger.INFO("Does Leave Table? "+stack.getDisplayName()); return true; } @@ -175,7 +175,7 @@ public class BaseItemDamageable extends Item { @Override public boolean hasContainerItem(ItemStack stack) { - Utils.LOG_INFO("hasContainerItem? "+stack.getDisplayName()); + Logger.INFO("hasContainerItem? "+stack.getDisplayName()); return true; } diff --git a/src/Java/gtPlusPlus/core/item/base/BasicSpawnEgg.java b/src/Java/gtPlusPlus/core/item/base/BasicSpawnEgg.java index 4bff33493e..04bb1d59d8 100644 --- a/src/Java/gtPlusPlus/core/item/base/BasicSpawnEgg.java +++ b/src/Java/gtPlusPlus/core/item/base/BasicSpawnEgg.java @@ -5,8 +5,8 @@ import java.util.List; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.util.Utils; import net.minecraft.block.Block; import net.minecraft.block.BlockLiquid; import net.minecraft.client.renderer.texture.IIconRegister; @@ -44,7 +44,7 @@ public class BasicSpawnEgg extends ItemMonsterPlacer this.entityMODID = MODID; // DEBUG - Utils.LOG_WARNING("Spawn egg constructor for "+this.entityToSpawnName); + Logger.WARNING("Spawn egg constructor for "+this.entityToSpawnName); } /** @@ -174,7 +174,7 @@ public class BasicSpawnEgg extends ItemMonsterPlacer else { //DEBUG - Utils.LOG_WARNING("Entity not found "+this.entityToSpawnName); + Logger.WARNING("Entity not found "+this.entityToSpawnName); } } diff --git a/src/Java/gtPlusPlus/core/item/base/CoreItem.java b/src/Java/gtPlusPlus/core/item/base/CoreItem.java index 951d2050f5..8baf909af7 100644 --- a/src/Java/gtPlusPlus/core/item/base/CoreItem.java +++ b/src/Java/gtPlusPlus/core/item/base/CoreItem.java @@ -5,8 +5,8 @@ import java.util.List; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; @@ -175,7 +175,7 @@ public class CoreItem extends Item if (this.turnsInto != null){ if (entityHolding instanceof EntityPlayer){ - Utils.LOG_INFO("Replacing "+iStack.getDisplayName()+" with "+this.turnsInto.getDisplayName()+"."); + Logger.INFO("Replacing "+iStack.getDisplayName()+" with "+this.turnsInto.getDisplayName()+"."); final ItemStack tempTransform = this.turnsInto; if (iStack.stackSize == 64){ tempTransform.stackSize=64; diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java index 6aa1f54cc8..e75d2a69e8 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java @@ -8,9 +8,9 @@ import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.entity.EntityUtils; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; @@ -48,25 +48,25 @@ public class BaseItemDust extends Item{ GameRegistry.registerItem(this, unlocalizedName); String temp = ""; - Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: "+this.getUnlocalizedName()); + Logger.WARNING("Unlocalized name for OreDict nameGen: "+this.getUnlocalizedName()); if (this.getUnlocalizedName().contains("item.")){ temp = this.getUnlocalizedName().replace("item.", ""); - Utils.LOG_WARNING("Generating OreDict Name: "+temp); + Logger.WARNING("Generating OreDict Name: "+temp); } else { temp = this.getUnlocalizedName(); } if (temp.contains("DustTiny")){ temp = temp.replace("itemD", "d"); - Utils.LOG_WARNING("Generating OreDict Name: "+temp); + Logger.WARNING("Generating OreDict Name: "+temp); } else if (temp.contains("DustSmall")){ temp = temp.replace("itemD", "d"); - Utils.LOG_WARNING("Generating OreDict Name: "+temp); + Logger.WARNING("Generating OreDict Name: "+temp); } else { temp = temp.replace("itemD", "d"); - Utils.LOG_WARNING("Generating OreDict Name: "+temp); + Logger.WARNING("Generating OreDict Name: "+temp); } if ((temp != null) && !temp.equals("")){ GT_OreDictUnificator.registerOre(temp, ItemUtils.getSimpleStack(this)); @@ -157,7 +157,7 @@ public class BaseItemDust extends Item{ } private void addMacerationRecipe(){ - Utils.LOG_WARNING("Adding recipe for "+this.materialName+" Dusts"); + Logger.WARNING("Adding recipe for "+this.materialName+" Dusts"); String tempIngot = this.getUnlocalizedName().replace("item.itemDust", "ingot"); final String tempDust = this.getUnlocalizedName().replace("item.itemDust", "dust"); @@ -168,17 +168,17 @@ public class BaseItemDust extends Item{ return; } - Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: "+this.getUnlocalizedName()); + Logger.WARNING("Unlocalized name for OreDict nameGen: "+this.getUnlocalizedName()); if (this.getUnlocalizedName().contains("item.")){ tempIngot = this.getUnlocalizedName().replace("item.", ""); - Utils.LOG_WARNING("Generating OreDict Name: "+tempIngot); + Logger.WARNING("Generating OreDict Name: "+tempIngot); } else { tempIngot = this.getUnlocalizedName(); } tempIngot = tempIngot.replace("itemDust", "ingot"); - Utils.LOG_WARNING("Generating OreDict Name: "+tempIngot); + Logger.WARNING("Generating OreDict Name: "+tempIngot); final ItemStack[] outputStacks = {this.dustInfo.getDust(1)}; if ((tempIngot != null) && !tempIngot.equals("")){ tempInputStack = ItemUtils.getItemStackOfAmountFromOreDict(tempIngot, 1); @@ -224,30 +224,30 @@ public class BaseItemDust extends Item{ if ((temp != null) && !temp.equals("")){ if (this.dustInfo.requiresBlastFurnace()){ - Utils.LOG_WARNING("Adding recipe for Hot "+this.materialName+" Ingots in a Blast furnace."); + Logger.WARNING("Adding recipe for Hot "+this.materialName+" Ingots in a Blast furnace."); final String tempIngot = temp.replace("ingot", "ingotHot"); final ItemStack tempOutputStack = ItemUtils.getItemStackOfAmountFromOreDict(tempIngot, 1); if (null != tempOutputStack){ - Utils.LOG_WARNING("This will produce "+tempOutputStack.getDisplayName() + " Debug: "+tempIngot); + Logger.WARNING("This will produce "+tempOutputStack.getDisplayName() + " Debug: "+tempIngot); this.addBlastFurnaceRecipe(ItemUtils.getSimpleStack(this), null, tempOutputStack, null, 350*this.mTier); } return; } - Utils.LOG_WARNING("Adding recipe for "+this.materialName+" Ingots in a furnace."); + Logger.WARNING("Adding recipe for "+this.materialName+" Ingots in a furnace."); final ItemStack tempOutputStack = ItemUtils.getItemStackOfAmountFromOreDict(temp, 1); //Utils.LOG_WARNING("This will produce an ingot of "+tempOutputStack.getDisplayName() + " Debug: "+temp); if (null != tempOutputStack){ if ((this.mTier < 5) || !this.dustInfo.requiresBlastFurnace()){ if (CORE.GT_Recipe.addSmeltingAndAlloySmeltingRecipe(ItemUtils.getSimpleStack(this), tempOutputStack)){ - Utils.LOG_WARNING("Successfully added a furnace recipe for "+this.materialName); + Logger.WARNING("Successfully added a furnace recipe for "+this.materialName); } else { - Utils.LOG_WARNING("Failed to add a furnace recipe for "+this.materialName); + Logger.WARNING("Failed to add a furnace recipe for "+this.materialName); } } else if ((this.mTier >= 5) || this.dustInfo.requiresBlastFurnace()){ - Utils.LOG_WARNING("Adding recipe for "+this.materialName+" Ingots in a Blast furnace."); - Utils.LOG_WARNING("This will produce "+tempOutputStack.getDisplayName()); + Logger.WARNING("Adding recipe for "+this.materialName+" Ingots in a Blast furnace."); + Logger.WARNING("This will produce "+tempOutputStack.getDisplayName()); if (null != tempOutputStack){ this.addBlastFurnaceRecipe(ItemUtils.getSimpleStack(this), null, tempOutputStack, null, 350*this.mTier); } diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java index f19aaff4b3..2c32c0c8af 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java @@ -6,9 +6,9 @@ import java.util.List; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.util.GT_OreDictUnificator; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.StringUtils; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; import net.minecraft.entity.player.EntityPlayer; @@ -54,25 +54,25 @@ public class BaseItemDustUnique extends Item{ } String temp = ""; - Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: "+this.getUnlocalizedName()); + Logger.WARNING("Unlocalized name for OreDict nameGen: "+this.getUnlocalizedName()); if (this.getUnlocalizedName().contains("item.")){ temp = this.getUnlocalizedName().replace("item.", ""); - Utils.LOG_WARNING("Generating OreDict Name: "+temp); + Logger.WARNING("Generating OreDict Name: "+temp); } else { temp = this.getUnlocalizedName(); } if (temp.contains("DustTiny")){ temp = temp.replace("itemD", "d"); - Utils.LOG_WARNING("Generating OreDict Name: "+temp); + Logger.WARNING("Generating OreDict Name: "+temp); } else if (temp.contains("DustSmall")){ temp = temp.replace("itemD", "d"); - Utils.LOG_WARNING("Generating OreDict Name: "+temp); + Logger.WARNING("Generating OreDict Name: "+temp); } else { temp = temp.replace("itemD", "d"); - Utils.LOG_WARNING("Generating OreDict Name: "+temp); + Logger.WARNING("Generating OreDict Name: "+temp); } if ((temp != null) && !temp.equals("")){ GT_OreDictUnificator.registerOre(temp, ItemUtils.getSimpleStack(this)); diff --git a/src/Java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java b/src/Java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java index 0467d2647e..5f737b47a0 100644 --- a/src/Java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java +++ b/src/Java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java @@ -2,6 +2,7 @@ package gtPlusPlus.core.item.base.foods; import java.util.List; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; @@ -40,7 +41,7 @@ public class BaseItemHotFood extends BaseItemFood{ if (!world.isRemote){ if(iStack.getItemDamage() == this.cooldownTime) { if (entityHolding instanceof EntityPlayer){ - Utils.LOG_INFO("Foods Done."); + Logger.INFO("Foods Done."); ((EntityPlayer) entityHolding).inventory.addItemStackToInventory(ItemUtils.getSimpleStack(this.output)); ((EntityPlayer) entityHolding).inventory.consumeInventoryItem(this); } diff --git a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java index 0933790de1..26b3ff2ce7 100644 --- a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java +++ b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java @@ -1,9 +1,9 @@ package gtPlusPlus.core.item.base.ingots; import gregtech.api.util.GT_ModHandler; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.ItemUtils; import net.minecraft.item.ItemStack; @@ -28,13 +28,13 @@ public class BaseItemIngot extends BaseItemComponent{ final ItemStack tempStack = ItemUtils.getSimpleStack(this, 9); ItemStack tempOutput = null; String temp = this.getUnlocalizedName().replace("item.itemIngot", "block"); - Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: "+this.getUnlocalizedName()); + Logger.WARNING("Unlocalized name for OreDict nameGen: "+this.getUnlocalizedName()); if (this.getUnlocalizedName().contains("item.")){ temp = this.getUnlocalizedName().replace("item.", ""); - Utils.LOG_WARNING("Generating OreDict Name: "+temp); + Logger.WARNING("Generating OreDict Name: "+temp); } temp = temp.replace("itemIngot", "block"); - Utils.LOG_WARNING("Generating OreDict Name: "+temp); + Logger.WARNING("Generating OreDict Name: "+temp); if ((temp != null) && !temp.equals("")){ tempOutput = ItemUtils.getItemStackOfAmountFromOreDict(temp, 1); if (tempOutput != null){ diff --git a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java index b6f139b74a..329fae509a 100644 --- a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java +++ b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java @@ -3,6 +3,7 @@ package gtPlusPlus.core.item.base.ingots; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.GT_Values; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.Material; @@ -44,7 +45,7 @@ public class BaseItemIngotHot extends BaseItemIngot{ } private void generateRecipe(){ - Utils.LOG_WARNING("Adding Vacuum Freezer recipe for a Hot Ingot of "+this.materialName+"."); + Logger.WARNING("Adding Vacuum Freezer recipe for a Hot Ingot of "+this.materialName+"."); GT_Values.RA.addVacuumFreezerRecipe(ItemUtils.getSimpleStack(this), this.outputIngot.copy(), 60*this.mTier); } diff --git a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot_OLD.java b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot_OLD.java index e821258d8e..8534172bbb 100644 --- a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot_OLD.java +++ b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot_OLD.java @@ -3,9 +3,9 @@ package gtPlusPlus.core.item.base.ingots; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.entity.EntityUtils; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; @@ -67,13 +67,13 @@ public class BaseItemIngot_OLD extends Item{ final ItemStack tempStack = ItemUtils.getSimpleStack(this, 9); ItemStack tempOutput = null; String temp = this.getUnlocalizedName().replace("item.itemIngot", "block"); - Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: "+this.getUnlocalizedName()); + Logger.WARNING("Unlocalized name for OreDict nameGen: "+this.getUnlocalizedName()); if (this.getUnlocalizedName().contains("item.")){ temp = this.getUnlocalizedName().replace("item.", ""); - Utils.LOG_WARNING("Generating OreDict Name: "+temp); + Logger.WARNING("Generating OreDict Name: "+temp); } temp = temp.replace("itemIngot", "block"); - Utils.LOG_WARNING("Generating OreDict Name: "+temp); + Logger.WARNING("Generating OreDict Name: "+temp); if ((temp != null) && !temp.equals("")){ tempOutput = ItemUtils.getItemStackOfAmountFromOreDict(temp, 1); if (tempOutput != null){ diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockNBT.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockNBT.java index 44ec66c47b..4ac7c7f5ff 100644 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockNBT.java +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockNBT.java @@ -1,8 +1,8 @@ package gtPlusPlus.core.item.base.itemblock; import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.tileentities.base.TileEntityBase; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.player.PlayerUtils; import net.minecraft.block.Block; import net.minecraft.entity.Entity; @@ -73,7 +73,7 @@ public class ItemBlockNBT extends ItemBlock { TileEntityBase tTileEntity = (TileEntityBase) aWorld.getTileEntity(aX, aY, aZ); if (tTileEntity != null && aPlayer != null) { if (tTileEntity.isServerSide()){ - Utils.LOG_INFO("Setting Tile Entity information"); + Logger.INFO("Setting Tile Entity information"); NBTTagCompound aNBT = GT_Utility.ItemNBT.getNBT(aStack); tTileEntity.setOwnerInformation(aNBT.getString("mOwner"), aNBT.getString("mUUID"), aNBT.getBoolean("mOP")); } diff --git a/src/Java/gtPlusPlus/core/item/base/misc/BaseItemMisc.java b/src/Java/gtPlusPlus/core/item/base/misc/BaseItemMisc.java index 27059e8fde..96dd2c5a16 100644 --- a/src/Java/gtPlusPlus/core/item/base/misc/BaseItemMisc.java +++ b/src/Java/gtPlusPlus/core/item/base/misc/BaseItemMisc.java @@ -9,11 +9,8 @@ import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; -import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.entity.EntityUtils; import gtPlusPlus.core.util.item.ItemUtils; -import gtPlusPlus.core.util.math.MathUtils; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; @@ -80,6 +77,7 @@ public class BaseItemMisc extends Item{ @SideOnly(Side.CLIENT) private IIcon secondIcon; + @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister par1IconRegister) { if (this.miscType == MiscTypes.DROP && LoadedMods.Forestry){ diff --git a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java index 5fe7ca6424..0259a6c6f3 100644 --- a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java +++ b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java @@ -1,9 +1,9 @@ package gtPlusPlus.core.item.base.rods; import gregtech.api.enums.GT_Values; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.Utils; import net.minecraft.item.ItemStack; public class BaseItemRod extends BaseItemComponent{ @@ -15,7 +15,7 @@ public class BaseItemRod extends BaseItemComponent{ private void addExtruderRecipe(){ - Utils.LOG_WARNING("Adding cutter recipe for "+this.materialName+" Rods"); + Logger.WARNING("Adding cutter recipe for "+this.materialName+" Rods"); final ItemStack stackStick = this.componentMaterial.getRod(1); final ItemStack stackBolt = this.componentMaterial.getBolt(4); diff --git a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java index 84d7d00472..1ac307d68c 100644 --- a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java +++ b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java @@ -1,9 +1,9 @@ package gtPlusPlus.core.item.base.rods; import gregtech.api.enums.GT_Values; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.ItemUtils; import net.minecraft.item.ItemStack; @@ -20,7 +20,7 @@ public class BaseItemRodLong extends BaseItemComponent{ } private void addExtruderRecipe(){ - Utils.LOG_WARNING("Adding recipe for Long "+this.materialName+" Rods"); + Logger.WARNING("Adding recipe for Long "+this.materialName+" Rods"); final String tempStick = this.unlocalName.replace("itemRodLong", "stick"); final String tempStickLong = this.unlocalName.replace("itemRodLong", "stickLong"); diff --git a/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java b/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java index f35e4834cc..733a8aa9d7 100644 --- a/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java +++ b/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java @@ -1,9 +1,9 @@ package gtPlusPlus.core.item.base.screws; import gregtech.api.enums.GT_Values; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.ItemUtils; import net.minecraft.item.ItemStack; @@ -15,7 +15,7 @@ public class BaseItemScrew extends BaseItemComponent{ } private void addLatheRecipe(){ - Utils.LOG_WARNING("Adding recipe for "+this.materialName+" Screws"); + Logger.WARNING("Adding recipe for "+this.materialName+" Screws"); final ItemStack boltStack = ItemUtils.getItemStackOfAmountFromOreDict(this.unlocalName.replace("itemScrew", "bolt"), 1); if (null != boltStack){ GT_Values.RA.addLatheRecipe( diff --git a/src/Java/gtPlusPlus/core/item/bauble/ModularBauble.java b/src/Java/gtPlusPlus/core/item/bauble/ModularBauble.java index cebfa7050d..b7c2b6ae89 100644 --- a/src/Java/gtPlusPlus/core/item/bauble/ModularBauble.java +++ b/src/Java/gtPlusPlus/core/item/bauble/ModularBauble.java @@ -23,9 +23,7 @@ import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IIcon; +import net.minecraft.util.*; public class ModularBauble extends BaseBauble { @@ -86,7 +84,7 @@ public class ModularBauble extends BaseBauble { } if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_HP)) > 0) { if (mStatlevel > 0 && mStatlevel <= 100) { - int bonus = (int) (mStatlevel / 5); + int bonus = mStatlevel / 5; attributes.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(), new AttributeModifier(getBaubleUUID(stack), "HP" + mStatlevel, bonus * 2, 0)); } @@ -142,7 +140,7 @@ public class ModularBauble extends BaseBauble { } if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_HP)) > 0) { list.add(EnumChatFormatting.GRAY + "Health Boost: " + EnumChatFormatting.RED + mStatlevel - + EnumChatFormatting.GRAY + "/100. Bonus " + ((int) mStatlevel / 5) + " hearts."); + + EnumChatFormatting.GRAY + "/100. Bonus " + (mStatlevel / 5) + " hearts."); } if ((mStatlevel = ModularArmourUtils.getModifierLevel(stack, Modifiers.BOOST_SPEED)) > 0) { list.add(EnumChatFormatting.GRAY + "Speed Boost: " + EnumChatFormatting.WHITE + mStatlevel diff --git a/src/Java/gtPlusPlus/core/item/general/ItemAreaClear.java b/src/Java/gtPlusPlus/core/item/general/ItemAreaClear.java index c3187ba92c..ea4d8f5a1b 100644 --- a/src/Java/gtPlusPlus/core/item/general/ItemAreaClear.java +++ b/src/Java/gtPlusPlus/core/item/general/ItemAreaClear.java @@ -2,10 +2,10 @@ package gtPlusPlus.core.item.general; import java.util.List; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.item.base.CoreItem; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.array.BlockPos; import gtPlusPlus.core.util.entity.EntityUtils; import gtPlusPlus.core.util.math.MathUtils; @@ -182,7 +182,7 @@ public class ItemAreaClear extends CoreItem { removeBlocks(world, groundBlock); } else { - Utils.LOG_INFO("Filling."); + Logger.INFO("Filling."); fillBlocks(world, groundBlock); } return super.onItemRightClick(thisItem, world, parEntity); diff --git a/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java b/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java index 65aa618cb3..720005f6ae 100644 --- a/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java +++ b/src/Java/gtPlusPlus/core/item/general/ItemBlueprint.java @@ -3,10 +3,10 @@ package gtPlusPlus.core.item.general; import java.util.List; import cpw.mods.fml.common.registry.GameRegistry; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.interfaces.IItemBlueprint; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.player.PlayerUtils; @@ -224,19 +224,19 @@ public class ItemBlueprint extends Item implements IItemBlueprint{ if (itemStack.hasTagCompound()){ if (!itemStack.stackTagCompound.getBoolean("mBlueprint") && !itemStack.stackTagCompound.getString("mName").equals("")){ //No Blueprint and no name Set - Utils.LOG_WARNING("No Blueprint and no name Set"); + Logger.WARNING("No Blueprint and no name Set"); return false; } else if (itemStack.stackTagCompound.getBoolean("mBlueprint") && !itemStack.stackTagCompound.getString("mName").equals("")){ //Has Blueprint but invalid name set - Utils.LOG_WARNING("Has Blueprint but invalid name set"); + Logger.WARNING("Has Blueprint but invalid name set"); //itemStack.stackTagCompound = null; //createNBT(itemStack); return false; } else if (!itemStack.stackTagCompound.getBoolean("mBlueprint") && itemStack.stackTagCompound.getString("mName").equals("")){ //Has no Blueprint, but strangely has a name - Utils.LOG_WARNING("Has no Blueprint, but strangely has a name"); + Logger.WARNING("Has no Blueprint, but strangely has a name"); //itemStack.stackTagCompound = null; //createNBT(itemStack); return false; @@ -247,7 +247,7 @@ public class ItemBlueprint extends Item implements IItemBlueprint{ final int bpID = MathUtils.randInt(0, 1000); final boolean hasRecipe = false; final String recipeName = ""; - Utils.LOG_WARNING("Creating Blueprint, setting up it's NBT data. "+bpID); + Logger.WARNING("Creating Blueprint, setting up it's NBT data. "+bpID); itemStack.stackTagCompound = new NBTTagCompound(); itemStack.stackTagCompound.setInteger("mID", bpID); itemStack.stackTagCompound.setBoolean("mBlueprint", hasRecipe); @@ -258,7 +258,7 @@ public class ItemBlueprint extends Item implements IItemBlueprint{ final int bpID = MathUtils.randInt(0, 1000); final boolean hasRecipe = false; final String recipeName = ""; - Utils.LOG_WARNING("Creating a Blueprint, setting up it's NBT data. "+bpID); + Logger.WARNING("Creating a Blueprint, setting up it's NBT data. "+bpID); itemStack.stackTagCompound = new NBTTagCompound(); itemStack.stackTagCompound.setInteger("mID", bpID); itemStack.stackTagCompound.setBoolean("mBlueprint", hasRecipe); diff --git a/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java b/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java index 63e0abb238..a3a8a98e6a 100644 --- a/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java +++ b/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java @@ -6,9 +6,9 @@ import baubles.api.BaubleType; import baubles.api.IBauble; import cpw.mods.fml.common.Optional; import cpw.mods.fml.common.registry.GameRegistry; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.player.PlayerUtils; @@ -215,7 +215,7 @@ public class ItemHealingDevice extends Item implements IElectricItem, IElectricI if (this.getCharge(arg0) >= (1638400/4)){ if (arg1.getHealth() < arg1.getMaxHealth()){ final float rx = arg1.getMaxHealth()-arg1.getHealth(); - Utils.LOG_INFO("rx:"+rx); + Logger.INFO("rx:"+rx); arg1.heal(rx*2); this.discharge(arg0, (1638400/4)*rx, 6, true, true, false); PlayerUtils.messagePlayer((EntityPlayer) arg1, "Your NanoBooster Whirs! Leaving you feeling stronger. It Healed "+rx+" hp."); diff --git a/src/Java/gtPlusPlus/core/item/general/capture/ItemEntityCatcher.java b/src/Java/gtPlusPlus/core/item/general/capture/ItemEntityCatcher.java index e74a3f8851..1b8ab947e5 100644 --- a/src/Java/gtPlusPlus/core/item/general/capture/ItemEntityCatcher.java +++ b/src/Java/gtPlusPlus/core/item/general/capture/ItemEntityCatcher.java @@ -5,16 +5,14 @@ import java.util.UUID; import cpw.mods.fml.common.registry.GameRegistry; import gtPlusPlus.api.interfaces.IEntityCatcher; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.array.BlockPos; import gtPlusPlus.core.util.nbt.NBTUtils; import gtPlusPlus.core.util.player.PlayerUtils; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.*; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -49,22 +47,22 @@ public class ItemEntityCatcher extends Item implements IEntityCatcher { @Override public Entity getStoredEntity(World aWorld, ItemStack aStack) { if (aStack == null || !hasEntity(aStack)) { - Utils.LOG_INFO("Cannot get stored entity."); + Logger.INFO("Cannot get stored entity."); return null; } Entity mEntityToSpawn; int mEntityID; - Utils.LOG_WARNING("getStoredEntity(1)"); + Logger.WARNING("getStoredEntity(1)"); mEntityID = NBTUtils.getInteger(aStack, "mEntityID"); mEntityToSpawn = EntityList.createEntityByID(mEntityID, aWorld); if (mEntityToSpawn != null) { - Utils.LOG_WARNING("getStoredEntity(2)"); + Logger.WARNING("getStoredEntity(2)"); return mEntityToSpawn; } - Utils.LOG_INFO("Failed to get stored entity. - getStoredEntity()"); + Logger.INFO("Failed to get stored entity. - getStoredEntity()"); return null; } @@ -72,11 +70,11 @@ public class ItemEntityCatcher extends Item implements IEntityCatcher { public boolean setStoredEntity(World aWorld, ItemStack aStack, Entity aEntity) { if (aEntity == null) { NBTUtils.setBoolean(aStack, "mHasEntity", false); - Utils.LOG_INFO("Bad Entity being stored."); + Logger.INFO("Bad Entity being stored."); return false; } - Utils.LOG_WARNING("setStoredEntity(1)"); + Logger.WARNING("setStoredEntity(1)"); NBTTagCompound mEntityData; Class<? extends Entity> mEntityClass; @@ -84,7 +82,7 @@ public class ItemEntityCatcher extends Item implements IEntityCatcher { String mEntityName; int mEntityID, mEntityHashcode; UUID mUuidPersistent, mUuidUnique; - Utils.LOG_WARNING("setStoredEntity(2)"); + Logger.WARNING("setStoredEntity(2)"); mEntityData = aEntity.getEntityData(); mEntityClass = aEntity.getClass(); @@ -95,7 +93,7 @@ public class ItemEntityCatcher extends Item implements IEntityCatcher { mEntityHashcode = aEntity.hashCode(); mUuidPersistent = aEntity.getPersistentID(); mUuidUnique = aEntity.getUniqueID(); - Utils.LOG_WARNING("setStoredEntity(3)"); + Logger.WARNING("setStoredEntity(3)"); NBTUtils.createTagCompound(aStack, "mEntityData", mEntityData); NBTUtils.setString(aStack,"mEntityName", mEntityName); @@ -105,7 +103,7 @@ public class ItemEntityCatcher extends Item implements IEntityCatcher { NBTUtils.setString(aStack,"mUuidUnique", mUuidUnique.toString()); NBTUtils.setInteger(aStack,"mEntityHashcode", mEntityHashcode); NBTUtils.setBoolean(aStack,"mHasEntity", true); - Utils.LOG_WARNING("setStoredEntity(4)"); + Logger.WARNING("setStoredEntity(4)"); return true; } @@ -132,7 +130,7 @@ public class ItemEntityCatcher extends Item implements IEntityCatcher { @Override public boolean spawnStoredEntity(World aWorld, ItemStack aStack, BlockPos aPos) { if (aStack == null || !hasEntity(aStack)) { - Utils.LOG_INFO("Cannot release, either invalid Itemstack or no entity stored."); + Logger.INFO("Cannot release, either invalid Itemstack or no entity stored."); return false; } @@ -147,31 +145,31 @@ public class ItemEntityCatcher extends Item implements IEntityCatcher { EntityLiving mEntityToSpawn = (EntityLiving) getStoredEntity(aWorld, aStack); Class<? extends Entity> mEntityClass = getStoredEntityClass(aStack); - Utils.LOG_WARNING("spawnStoredEntity(1)"); + Logger.WARNING("spawnStoredEntity(1)"); if (mEntityToSpawn != null && mEntityClass != null) { - Utils.LOG_WARNING("spawnStoredEntity(2)"); + Logger.WARNING("spawnStoredEntity(2)"); if (mEntityToSpawn.getEntityData() != mEntityData) { - Utils.LOG_WARNING("spawnStoredEntity(x)"); + Logger.WARNING("spawnStoredEntity(x)"); NBTUtils.setEntityCustomData(mEntityToSpawn, mEntityData); } mEntityToSpawn.setLocationAndAngles(aPos.xPos, aPos.yPos, aPos.zPos, aWorld.rand.nextFloat() * 360.0F, 0.0F); - if (mEntityToSpawn instanceof EntityLiving) { - ((EntityLiving) mEntityToSpawn).onSpawnWithEgg(null); + if (mEntityToSpawn != null) { + mEntityToSpawn.onSpawnWithEgg(null); aWorld.spawnEntityInWorld(mEntityToSpawn); - Utils.LOG_WARNING("spawnStoredEntity(3)"); + Logger.WARNING("spawnStoredEntity(3)"); } - if (mEntityToSpawn instanceof EntityLiving) { - ((EntityLiving) mEntityToSpawn).playLivingSound(); - Utils.LOG_WARNING("spawnStoredEntity(4)"); + if (mEntityToSpawn != null) { + mEntityToSpawn.playLivingSound(); + Logger.WARNING("spawnStoredEntity(4)"); } - Utils.LOG_WARNING("spawnStoredEntity(5)"); + Logger.WARNING("spawnStoredEntity(5)"); NBTUtils.setBoolean(aStack,"mHasEntity", false); return true; } - Utils.LOG_INFO("Failed to spawn stored entity. - spawnStoredEntity()"); + Logger.INFO("Failed to spawn stored entity. - spawnStoredEntity()"); return false; } @@ -202,10 +200,10 @@ public class ItemEntityCatcher extends Item implements IEntityCatcher { public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) { if (Utils.isServer()) { - Utils.LOG_WARNING("Trying to release (1)"); + Logger.WARNING("Trying to release (1)"); if (NBTUtils.hasKey(itemstack,"mHasEntity") && NBTUtils.getBoolean(itemstack,"mHasEntity")) { - Utils.LOG_WARNING("Trying to release (2)"); + Logger.WARNING("Trying to release (2)"); boolean mDidSpawn = spawnStoredEntity(world, itemstack, new BlockPos(x, y+1, z)); if (!mDidSpawn){ @@ -223,12 +221,12 @@ public class ItemEntityCatcher extends Item implements IEntityCatcher { @Override public boolean itemInteractionForEntity(ItemStack aStack, EntityPlayer aPlayer, EntityLivingBase aEntity) { if (Utils.isServer()) { - Utils.LOG_WARNING("Trying to catch (1)"); + Logger.WARNING("Trying to catch (1)"); if (!hasEntity(aStack)) { - Utils.LOG_WARNING("Trying to catch (2)"); + Logger.WARNING("Trying to catch (2)"); boolean mStored = setStoredEntity(aPlayer.worldObj, aStack, aEntity); if (mStored) { - Utils.LOG_WARNING("Trying to catch (3)"); + Logger.WARNING("Trying to catch (3)"); aEntity.setDead(); PlayerUtils.messagePlayer(aPlayer, "You have captured a "+NBTUtils.getString(aStack,"mEntityName")+" in the Jar."); //NBTUtils.tryIterateNBTData(aStack); diff --git a/src/Java/gtPlusPlus/core/item/general/throwables/ItemHydrofluoricAcidPotion.java b/src/Java/gtPlusPlus/core/item/general/throwables/ItemHydrofluoricAcidPotion.java index 1ed49760c0..2a98a0a13f 100644 --- a/src/Java/gtPlusPlus/core/item/general/throwables/ItemHydrofluoricAcidPotion.java +++ b/src/Java/gtPlusPlus/core/item/general/throwables/ItemHydrofluoricAcidPotion.java @@ -15,6 +15,7 @@ public class ItemHydrofluoricAcidPotion extends CoreItem { super(unlocalizedName, displayName, AddToCreativeTab.tabMisc, 16, 0, description, EnumRarity.uncommon, EnumChatFormatting.GRAY, false, null); } + @Override public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player) { if (!player.capabilities.isCreativeMode) { --item.stackSize; diff --git a/src/Java/gtPlusPlus/core/item/general/throwables/ItemSulfuricAcidPotion.java b/src/Java/gtPlusPlus/core/item/general/throwables/ItemSulfuricAcidPotion.java index 60e3550b5c..dd5db807b6 100644 --- a/src/Java/gtPlusPlus/core/item/general/throwables/ItemSulfuricAcidPotion.java +++ b/src/Java/gtPlusPlus/core/item/general/throwables/ItemSulfuricAcidPotion.java @@ -15,6 +15,7 @@ public class ItemSulfuricAcidPotion extends CoreItem { super(unlocalizedName, displayName, AddToCreativeTab.tabMisc, 16, 0, description, EnumRarity.common, EnumChatFormatting.GRAY, false, null); } + @Override public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player) { if (!player.capabilities.isCreativeMode) { --item.stackSize; diff --git a/src/Java/gtPlusPlus/core/item/init/ItemsMultiTools.java b/src/Java/gtPlusPlus/core/item/init/ItemsMultiTools.java index cc73ba3d32..fc7381354a 100644 --- a/src/Java/gtPlusPlus/core/item/init/ItemsMultiTools.java +++ b/src/Java/gtPlusPlus/core/item/init/ItemsMultiTools.java @@ -1,12 +1,12 @@ package gtPlusPlus.core.item.init; import gregtech.api.enums.Materials; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.ALLOY; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.ItemUtils; public class ItemsMultiTools { @@ -64,7 +64,7 @@ public class ItemsMultiTools { } private static boolean toolFactory(final Material m){ - Utils.LOG_WARNING("Generating Multi-Tools for "+m.getLocalizedName()); + Logger.WARNING("Generating Multi-Tools for "+m.getLocalizedName()); ModItems.MP_GTMATERIAL = ItemUtils.generateMultiPick(m); ModItems.MS_GTMATERIAL = ItemUtils.generateMultiShovel(m); return true; diff --git a/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java b/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java index 602b0d75f7..45e0bd8fe6 100644 --- a/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java +++ b/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java @@ -5,6 +5,7 @@ import java.util.List; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; @@ -104,13 +105,13 @@ public class MultiPickaxeBase extends StaballoyPickaxe{ final String toolScrewDriver = "craftingToolScrewdriver"; if (null == ItemUtils.getItemStackOfAmountFromOreDictNoBroken(rodLong, 1)){ - Utils.LOG_WARNING("stickLong of "+cleanName+" does not exist."); + Logger.WARNING("stickLong of "+cleanName+" does not exist."); return false; } if (null == ItemUtils.getItemStackOfAmountFromOreDictNoBroken(plateDense, 1)){ - Utils.LOG_WARNING("plateDense of "+cleanName+" does not exist."); + Logger.WARNING("plateDense of "+cleanName+" does not exist."); if (null != ItemUtils.getItemStackOfAmountFromOreDictNoBroken(plateDouble, 1)){ - Utils.LOG_WARNING("plateDouble of "+cleanName+" does exist. Using it instead."); + Logger.WARNING("plateDouble of "+cleanName+" does exist. Using it instead."); RecipeUtils.recipeBuilder( plateDouble, plateDouble, plateDouble, toolFile, rodLong, toolHammer, @@ -119,7 +120,7 @@ public class MultiPickaxeBase extends StaballoyPickaxe{ return true; } - Utils.LOG_WARNING("plateDouble of "+cleanName+" does not exist."); + Logger.WARNING("plateDouble of "+cleanName+" does not exist."); return false; } @@ -161,13 +162,13 @@ public class MultiPickaxeBase extends StaballoyPickaxe{ //Utils.LOG_WARNING(removalist.toString()); bHardness = removalist.getBlockHardness(world, X, Y, Z)*100; - Utils.LOG_INFO("Hardness: "+bHardness); + Logger.INFO("Hardness: "+bHardness); bDurabilityLoss = 100; //Utils.LOG_WARNING("Durability Loss: "+bDurabilityLoss); correctTool = this.canPickaxeBlock(removalist, world, new int[]{X,Y,Z}); - Utils.LOG_WARNING(""+correctTool); + Logger.WARNING(""+correctTool); if (!correctTool){ return 0; diff --git a/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java b/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java index a73ae3045c..d8b88c6c6d 100644 --- a/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java +++ b/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java @@ -4,8 +4,8 @@ import java.util.List; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.player.UtilsMining; import net.minecraft.block.Block; import net.minecraft.entity.EntityLivingBase; @@ -77,13 +77,13 @@ public class StaballoyPickaxe extends ItemPickaxe{ //Utils.LOG_WARNING(removalist.toString()); bHardness = removalist.getBlockHardness(world, X, Y, Z); - Utils.LOG_WARNING("Hardness: "+bHardness); + Logger.WARNING("Hardness: "+bHardness); bDurabilityLoss = (bDurabilityLoss + bHardness); //Utils.LOG_WARNING("Durability Loss: "+bDurabilityLoss); correctTool = this.canPickaxeBlock(removalist, world, new int[]{X,Y,Z}); - Utils.LOG_WARNING(""+correctTool); + Logger.WARNING(""+correctTool); if (!correctTool){ return 0; @@ -115,14 +115,14 @@ public class StaballoyPickaxe extends ItemPickaxe{ float DURABILITY_LOSS = 0; if (!world.isRemote){ - Utils.LOG_WARNING("hardness:"+block.getBlockHardness(world, X, Y, Z)); + Logger.WARNING("hardness:"+block.getBlockHardness(world, X, Y, Z)); if (FACING.equals("below") || FACING.equals("above")){ DURABILITY_LOSS = 0; for(int i = -1; i < 2; i++) { for(int j = -1; j < 2; j++) { final float dur = this.calculateDurabilityLoss(world, X + i, Y, Z + j); DURABILITY_LOSS = (DURABILITY_LOSS + dur); - Utils.LOG_WARNING("Added Loss: "+dur); + Logger.WARNING("Added Loss: "+dur); this.removeBlockAndDropAsItem(world, X + i, Y, Z + j, heldItem); } } @@ -134,7 +134,7 @@ public class StaballoyPickaxe extends ItemPickaxe{ for(int j = -1; j < 2; j++) { final float dur = this.calculateDurabilityLoss(world, X, Y + i, Z + j); DURABILITY_LOSS = (DURABILITY_LOSS + dur); - Utils.LOG_WARNING("Added Loss: "+dur); + Logger.WARNING("Added Loss: "+dur); this.removeBlockAndDropAsItem(world, X , Y + i, Z + j, heldItem); } } @@ -146,25 +146,25 @@ public class StaballoyPickaxe extends ItemPickaxe{ for(int j = -1; j < 2; j++) { final float dur = this.calculateDurabilityLoss(world, X + j, Y + i, Z); DURABILITY_LOSS = (DURABILITY_LOSS + dur); - Utils.LOG_WARNING("Added Loss: "+dur); + Logger.WARNING("Added Loss: "+dur); this.removeBlockAndDropAsItem(world, X + j, Y + i, Z, heldItem); } } } //int heldItemDurability = heldItem.getDamage(1); - Utils.LOG_WARNING("Total Loss: "+(int)DURABILITY_LOSS); + Logger.WARNING("Total Loss: "+(int)DURABILITY_LOSS); //heldItem.setDamage(heldStack, DURABILITY_LOSS); //Utils.LOG_WARNING("|GID|Durability: "+heldItem.getItemDamage()); //Utils.LOG_WARNING("Durability: "+heldStack.getDamage(heldStack)); - Utils.LOG_WARNING("1x: "+(heldItem.getItemDamage())); + Logger.WARNING("1x: "+(heldItem.getItemDamage())); final int itemdmg = heldItem.getItemDamage(); final int maxdmg = heldItem.getMaxDamage(); final int dodmg = (int)DURABILITY_LOSS; final int durNow = maxdmg-itemdmg; final int durLeft = (int) ((maxdmg-itemdmg)-DURABILITY_LOSS); - Utils.LOG_WARNING( + Logger.WARNING( "Current Damage: " + itemdmg + " Max Damage: " + maxdmg + " Durability to be lost: " + dodmg @@ -176,13 +176,13 @@ public class StaballoyPickaxe extends ItemPickaxe{ //Break Tool if (((durNow-dodmg) <= (99)) && (itemdmg != 0)){ //TODO break tool - Utils.LOG_WARNING("Breaking Tool"); + Logger.WARNING("Breaking Tool"); heldItem.stackSize = 0; } //Do Damage else { //setItemDamage(heldItem, durLeft); - Utils.LOG_WARNING(""+(durNow-durLeft)); + Logger.WARNING(""+(durNow-durLeft)); this.damageItem(heldItem, (durNow-durLeft)-1, this.localPlayer); } @@ -215,17 +215,17 @@ public class StaballoyPickaxe extends ItemPickaxe{ try { final Block block = world.getBlock(X, Y, Z); final float dur = this.calculateDurabilityLoss(world, X, Y, Z); - Utils.LOG_WARNING(block.toString()); + Logger.WARNING(block.toString()); String removalTool = ""; removalTool = block.getHarvestTool(1); - Utils.LOG_WARNING("Removing.1 "+removalTool); + Logger.WARNING("Removing.1 "+removalTool); /*if ((removalTool.equalsIgnoreCase("pickaxe") || removalTool.equalsIgnoreCase("null") || removalTool == null)){ Utils.LOG_WARNING("Removing.2"); if (UtilsMining.getBlockType(block, world, new int[]{X,Y,Z}, miningLevel)) { Utils.LOG_WARNING("Removing.3"); */ if (this.canPickaxeBlock(block, world, new int[]{X,Y,Z})){ - Utils.LOG_WARNING("Removing.4"); + Logger.WARNING("Removing.4"); if (block == Blocks.air){ return; @@ -233,7 +233,7 @@ public class StaballoyPickaxe extends ItemPickaxe{ if((block != Blocks.bedrock) && (block.getBlockHardness(world, X, Y, Z) >= 0) && (block.getBlockHardness(world, X, Y, Z) <= 100) && (block != Blocks.water) && (block != Blocks.lava)){ - Utils.LOG_WARNING("Removing.5"); + Logger.WARNING("Removing.5"); if (heldItem.getItemDamage() <= (heldItem.getMaxDamage()-dur)){ if (X == 0 && Y == 0 && Z == 0){ @@ -252,7 +252,7 @@ public class StaballoyPickaxe extends ItemPickaxe{ }*/ } else { - Utils.LOG_WARNING("Incorrect Tool for mining this block."); + Logger.WARNING("Incorrect Tool for mining this block."); } } catch (final NullPointerException e){ diff --git a/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoySpade.java b/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoySpade.java index 9400c8308c..30c7fb7b7a 100644 --- a/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoySpade.java +++ b/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoySpade.java @@ -4,8 +4,8 @@ import java.util.List; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.player.UtilsMining; import net.minecraft.block.Block; import net.minecraft.entity.EntityLivingBase; @@ -75,7 +75,7 @@ public class StaballoySpade extends ItemSpade{ correctTool = currentBlock.getHarvestTool(0); //Utils.LOG_WARNING(correctTool); - Utils.LOG_WARNING("Tool for Block: "+correctTool+" | Current block: "+currentBlock.getLocalizedName()); + Logger.WARNING("Tool for Block: "+correctTool+" | Current block: "+currentBlock.getLocalizedName()); if (UtilsMining.getBlockType(currentBlock, currentWorld, xyz, this.miningLevel) || correctTool.equals("shovel")){ return true;} } catch (final NullPointerException e){ @@ -117,18 +117,18 @@ public class StaballoySpade extends ItemSpade{ } //int heldItemDurability = heldItem.getDamage(1); - Utils.LOG_WARNING("Total Loss: "+(int)DURABILITY_LOSS); + Logger.WARNING("Total Loss: "+(int)DURABILITY_LOSS); //heldItem.setDamage(heldStack, DURABILITY_LOSS); //Utils.LOG_WARNING("|GID|Durability: "+heldItem.getItemDamage()); //Utils.LOG_WARNING("Durability: "+heldStack.getDamage(heldStack)); - Utils.LOG_WARNING("1x: "+(heldItem.getItemDamage())); + Logger.WARNING("1x: "+(heldItem.getItemDamage())); final int itemdmg = heldItem.getItemDamage(); final int maxdmg = heldItem.getMaxDamage(); final int dodmg = (int)DURABILITY_LOSS; final int durNow = maxdmg-itemdmg; final int durLeft = (int) ((maxdmg-itemdmg)-DURABILITY_LOSS); - Utils.LOG_WARNING( + Logger.WARNING( "Current Damage: " + itemdmg + " Max Damage: " + maxdmg + " Durability to be lost: " + dodmg @@ -140,13 +140,13 @@ public class StaballoySpade extends ItemSpade{ //Break Tool if (((durNow-dodmg) <= (900)) && (itemdmg != 0)){ //TODO break tool - Utils.LOG_WARNING("Breaking Tool"); + Logger.WARNING("Breaking Tool"); heldItem.stackSize = 0; } //Do Damage else { //setItemDamage(heldItem, durLeft); - Utils.LOG_WARNING(""+(durNow-durLeft)); + Logger.WARNING(""+(durNow-durLeft)); this.damageItem(heldItem, (durNow-durLeft)-1, this.localPlayer); } DURABILITY_LOSS = 0; @@ -165,10 +165,10 @@ public class StaballoySpade extends ItemSpade{ //Should clear up blocks quicker if I chain it. public int removeBlockAndDropAsItem(final World world, final int X, final int Y, final int Z, final ItemStack heldItem){ this.localWorld = world; - Utils.LOG_WARNING("Trying to drop/remove a block."); + Logger.WARNING("Trying to drop/remove a block."); try { final Block block = world.getBlock(X, Y, Z); - Utils.LOG_WARNING(block.toString()); + Logger.WARNING(block.toString()); String removalTool = ""; removalTool = block.getHarvestTool(0); if (removalTool != null){ @@ -188,22 +188,22 @@ public class StaballoySpade extends ItemSpade{ } block.dropBlockAsItem(world, X, Y, Z, world.getBlockMetadata(X, Y, Z), 0); world.setBlockToAir(X, Y, Z); - Utils.LOG_WARNING("Adding 100 damage to item."); + Logger.WARNING("Adding 100 damage to item."); return 100; } - Utils.LOG_WARNING("Incorrect Tool for mining this block. Wrong Block Water/lava/bedrock/blacklist"); + Logger.WARNING("Incorrect Tool for mining this block. Wrong Block Water/lava/bedrock/blacklist"); return 0; } - Utils.LOG_WARNING("Incorrect Tool for mining this block. Cannot Shovel this block type."); + Logger.WARNING("Incorrect Tool for mining this block. Cannot Shovel this block type."); return 0; } - Utils.LOG_WARNING("Incorrect Tool for mining this block. Blocks mining tool is now Shovel."); + Logger.WARNING("Incorrect Tool for mining this block. Blocks mining tool is now Shovel."); return 0; } - Utils.LOG_WARNING("Either the block was air or it declares an invalid mining tool."); + Logger.WARNING("Either the block was air or it declares an invalid mining tool."); return 0; } catch (final NullPointerException e){ - Utils.LOG_WARNING("Something Broke"); + Logger.WARNING("Something Broke"); e.printStackTrace(); return 0; } |