diff options
| author | Draknyte1 <Draknyte1@hotmail.com> | 2017-12-20 23:39:49 +1000 |
|---|---|---|
| committer | Draknyte1 <Draknyte1@hotmail.com> | 2017-12-20 23:39:49 +1000 |
| commit | 5715a32d2901922503fd850f3a68503fb77467c3 (patch) | |
| tree | 7e12520fbc23844e99493d55af4410a785538e35 /src/Java/gtPlusPlus/core/item/tool | |
| parent | 2a4795f65d98ff60a177d7d6a5552fd687d9f6e8 (diff) | |
| download | GT5-Unofficial-5715a32d2901922503fd850f3a68503fb77467c3.tar.gz GT5-Unofficial-5715a32d2901922503fd850f3a68503fb77467c3.tar.bz2 GT5-Unofficial-5715a32d2901922503fd850f3a68503fb77467c3.zip | |
- Disabled some logging.
% Minor Project Clean-up, added missing Override annotations to 100+ methods & removed pointless casts.
% Moved Logging to it's own class.
$ Fixed Multi-block handling of Pollution.
$ Fixed the GT 5.09 material enabler system. (From My Side, it's still borked on GTs).
+ Added a Dynamic Proxy invocation for IMaterialHandler.
+ Added an AutoMap data type, which is a Auto-incremental ID'd Hashmap wrapper.
Diffstat (limited to 'src/Java/gtPlusPlus/core/item/tool')
3 files changed, 39 insertions, 38 deletions
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; } |
