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/container | |
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/container')
6 files changed, 71 insertions, 69 deletions
diff --git a/src/Java/gtPlusPlus/core/container/Container_HeliumGenerator.java b/src/Java/gtPlusPlus/core/container/Container_HeliumGenerator.java index ffa778a8c6..e45d708761 100644 --- a/src/Java/gtPlusPlus/core/container/Container_HeliumGenerator.java +++ b/src/Java/gtPlusPlus/core/container/Container_HeliumGenerator.java @@ -1,11 +1,11 @@ package gtPlusPlus.core.container; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.inventories.InventoryHeliumGenerator; import gtPlusPlus.core.slots.SlotFuelRod; import gtPlusPlus.core.slots.SlotNoInput; import gtPlusPlus.core.tileentities.general.TileEntityHeliumGenerator; -import gtPlusPlus.core.util.Utils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; @@ -54,7 +54,7 @@ public class Container_HeliumGenerator extends Container { { for (var7 = 0; var7 < 3; ++var7) { - Utils.LOG_INFO("Adding slots at var:"+(o)+" x:"+(8 + var7 * 18)+" y:"+(9 + var6 * 18)); + Logger.INFO("Adding slots at var:"+(o)+" x:"+(8 + var7 * 18)+" y:"+(9 + var6 * 18)); this.addSlotToContainer(new SlotFuelRod(this.inventoryChest, o, 8 + (var7 * 18), 18 + (var6 * 18))); this.slotStorage[o] = o; o++; @@ -66,7 +66,7 @@ public class Container_HeliumGenerator extends Container { { for (var7 = 0; var7 < 3; ++var7) { - Utils.LOG_INFO("Adding slots at var:"+(o)+" x:"+(90+8+(var7 * 18))+" y:"+(9 + var6 * 18)); + Logger.INFO("Adding slots at var:"+(o)+" x:"+(90+8+(var7 * 18))+" y:"+(9 + var6 * 18)); this.addSlotToContainer(new SlotFuelRod(this.inventoryChest, o, 116 + (var7 * 18), 18 + (var6 * 18))); this.slotStorage[o] = o; o++; diff --git a/src/Java/gtPlusPlus/core/container/Container_ModularityTable.java b/src/Java/gtPlusPlus/core/container/Container_ModularityTable.java index d870750039..cfa1eed690 100644 --- a/src/Java/gtPlusPlus/core/container/Container_ModularityTable.java +++ b/src/Java/gtPlusPlus/core/container/Container_ModularityTable.java @@ -1,20 +1,16 @@ package gtPlusPlus.core.container; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.inventories.modulartable.InventoryModularMain; import gtPlusPlus.core.inventories.modulartable.InventoryModularOutput; -import gtPlusPlus.core.inventories.projecttable.InventoryProjectMain; -import gtPlusPlus.core.inventories.projecttable.InventoryProjectOutput; import gtPlusPlus.core.slots.*; import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable; -import gtPlusPlus.core.tileentities.machines.TileEntityProjectTable; -import gtPlusPlus.core.util.Utils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.*; -import net.minecraft.inventory.SlotCrafting; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; import net.minecraft.world.World; public class Container_ModularityTable extends Container { @@ -41,7 +37,7 @@ public class Container_ModularityTable extends Container { this.inventoryOutputs = tile.inventoryOutputs; this.tile_entity.setContainer(this); this.mRecipeTime = this.tile_entity.getRecipeTime(); - Utils.LOG_INFO("Container: "+this.mRecipeTime); + Logger.INFO("Container: "+this.mRecipeTime); int var6; int var7; @@ -103,6 +99,7 @@ public class Container_ModularityTable extends Container { /** * Called when the container is closed. */ + @Override public void onContainerClosed(EntityPlayer p_75134_1_){ super.onContainerClosed(p_75134_1_); if (!this.worldObj.isRemote){ @@ -131,21 +128,21 @@ public class Container_ModularityTable extends Container { } if (aSlotIndex == 0){ - Utils.LOG_INFO("Player Clicked on the bauble slot"); + Logger.INFO("Player Clicked on the bauble slot"); //TODO } else if (aSlotIndex == 1){ - Utils.LOG_INFO("Player Clicked on the upgrade slot"); + Logger.INFO("Player Clicked on the upgrade slot"); //TODO } else if (aSlotIndex == 2){ - Utils.LOG_INFO("Player Clicked on the output slot"); + Logger.INFO("Player Clicked on the output slot"); //TODO } else { for (final int x : this.slotGrid){ if (aSlotIndex == x){ - Utils.LOG_INFO("Player Clicked slot "+aSlotIndex+" in the crafting Grid"); + Logger.INFO("Player Clicked slot "+aSlotIndex+" in the crafting Grid"); } } } diff --git a/src/Java/gtPlusPlus/core/container/Container_ProjectTable.java b/src/Java/gtPlusPlus/core/container/Container_ProjectTable.java index 25e6756f71..dabe97ea45 100644 --- a/src/Java/gtPlusPlus/core/container/Container_ProjectTable.java +++ b/src/Java/gtPlusPlus/core/container/Container_ProjectTable.java @@ -1,15 +1,14 @@ package gtPlusPlus.core.container; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.inventories.projecttable.InventoryProjectMain; import gtPlusPlus.core.inventories.projecttable.InventoryProjectOutput; import gtPlusPlus.core.slots.*; import gtPlusPlus.core.tileentities.machines.TileEntityProjectTable; -import gtPlusPlus.core.util.Utils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.*; -import net.minecraft.inventory.SlotCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.world.World; @@ -93,7 +92,8 @@ public class Container_ProjectTable extends Container { /** * Callback for when the crafting matrix is changed. */ - public void onCraftMatrixChanged(IInventory p_75130_1_) + @Override + public void onCraftMatrixChanged(IInventory p_75130_1_) { this.craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj)); } @@ -101,7 +101,8 @@ public class Container_ProjectTable extends Container { /** * Called when the container is closed. */ - public void onContainerClosed(EntityPlayer p_75134_1_){ + @Override + public void onContainerClosed(EntityPlayer p_75134_1_){ super.onContainerClosed(p_75134_1_); if (!this.worldObj.isRemote){ for (int i = 0; i < 9; ++i){ @@ -122,16 +123,16 @@ public class Container_ProjectTable extends Container { } if (aSlotIndex == 0){ - Utils.LOG_INFO("Player Clicked on the Data Stick slot"); + Logger.INFO("Player Clicked on the Data Stick slot"); //TODO }if (aSlotIndex == 1){ - Utils.LOG_INFO("Player Clicked on the output slot"); + Logger.INFO("Player Clicked on the output slot"); //TODO } for (final int x : this.slotGrid){ if (aSlotIndex == x){ - Utils.LOG_INFO("Player Clicked slot "+aSlotIndex+" in the crafting Grid"); + Logger.INFO("Player Clicked slot "+aSlotIndex+" in the crafting Grid"); } } } @@ -212,6 +213,7 @@ public class Container_ProjectTable extends Container { } //Can merge Slot + @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/core/container/Container_TradeTable.java b/src/Java/gtPlusPlus/core/container/Container_TradeTable.java index e79a51f242..271dc8ef2c 100644 --- a/src/Java/gtPlusPlus/core/container/Container_TradeTable.java +++ b/src/Java/gtPlusPlus/core/container/Container_TradeTable.java @@ -1,14 +1,16 @@ package gtPlusPlus.core.container; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.inventories.tradetable.InventoryTradeMain; import gtPlusPlus.core.inventories.tradetable.InventoryTradeOutput; -import gtPlusPlus.core.slots.*; +import gtPlusPlus.core.slots.SlotGeneric; +import gtPlusPlus.core.slots.SlotNoInput; import gtPlusPlus.core.tileentities.machines.TileEntityTradeTable; -import gtPlusPlus.core.util.Utils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.*; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.world.World; @@ -35,7 +37,7 @@ public class Container_TradeTable extends Container { this.tile_entity.setContainer(this); if (te.isServerSide()) - Utils.LOG_INFO("Container - "+te.mOwnerName); + Logger.INFO("Container - "+te.mOwnerName); int var6; int var7; @@ -88,6 +90,7 @@ public class Container_TradeTable extends Container { /** * Called when the container is closed. */ + @Override public void onContainerClosed(EntityPlayer p_75134_1_){ super.onContainerClosed(p_75134_1_); if (!this.worldObj.isRemote){ @@ -109,16 +112,16 @@ public class Container_TradeTable extends Container { } if (aSlotIndex == 0){ - Utils.LOG_INFO("Player Clicked on the Data Stick slot"); + Logger.INFO("Player Clicked on the Data Stick slot"); //TODO }if (aSlotIndex == 1){ - Utils.LOG_INFO("Player Clicked on the output slot"); + Logger.INFO("Player Clicked on the output slot"); //TODO } for (final int x : this.slotGrid){ if (aSlotIndex == x){ - Utils.LOG_INFO("Player Clicked slot "+aSlotIndex+" in the crafting Grid"); + Logger.INFO("Player Clicked slot "+aSlotIndex+" in the crafting Grid"); } } } diff --git a/src/Java/gtPlusPlus/core/container/Container_Workbench.java b/src/Java/gtPlusPlus/core/container/Container_Workbench.java index 92398c12dd..e3b7e9d614 100644 --- a/src/Java/gtPlusPlus/core/container/Container_Workbench.java +++ b/src/Java/gtPlusPlus/core/container/Container_Workbench.java @@ -1,13 +1,13 @@ package gtPlusPlus.core.container; import gregtech.api.gui.GT_Slot_Holo; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.interfaces.IItemBlueprint; import gtPlusPlus.core.inventories.*; import gtPlusPlus.core.item.general.ItemBlueprint; import gtPlusPlus.core.slots.*; import gtPlusPlus.core.tileentities.machines.TileEntityWorkbench; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.ItemUtils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -185,74 +185,74 @@ public class Container_Workbench extends Container { } if (aSlotIndex == this.slotOutput){ - Utils.LOG_WARNING("Player Clicked on the output slot"); + Logger.WARNING("Player Clicked on the output slot"); //TODO } for (final int x : this.slotHolo){ if (aSlotIndex == x){ - Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the Holo Grid"); + Logger.WARNING("Player Clicked slot "+aSlotIndex+" in the Holo Grid"); if (x == 1){ - Utils.LOG_WARNING("Player Clicked Blueprint slot in the Holo Grid"); + Logger.WARNING("Player Clicked Blueprint slot in the Holo Grid"); } else if (x == 2){ - Utils.LOG_WARNING("Player Clicked Right Arrow slot in the Holo Grid"); + Logger.WARNING("Player Clicked Right Arrow slot in the Holo Grid"); if (this.inventoryHolo.getStackInSlot(1) != null){ - Utils.LOG_WARNING("Found an ItemStack."); + Logger.WARNING("Found an ItemStack."); if (this.inventoryHolo.getStackInSlot(1).getItem() instanceof IItemBlueprint){ - Utils.LOG_WARNING("Found a blueprint."); + Logger.WARNING("Found a blueprint."); final ItemStack tempBlueprint = this.inventoryHolo.getStackInSlot(1); final ItemBlueprint tempItemBlueprint = (ItemBlueprint) tempBlueprint.getItem(); if ((this.inventoryHolo.getStackInSlot(0) != null) && !tempItemBlueprint.hasBlueprint(tempBlueprint)){ - Utils.LOG_WARNING("Output slot was not empty."); - Utils.LOG_WARNING("Trying to manipulate NBT data on the blueprint stack, then replace it with the new one."); + Logger.WARNING("Output slot was not empty."); + Logger.WARNING("Trying to manipulate NBT data on the blueprint stack, then replace it with the new one."); tempItemBlueprint.setBlueprint(this.inventoryHolo.getStackInSlot(1), this.craftMatrix, this.inventoryHolo.getStackInSlot(0)); final ItemStack newTempBlueprint = ItemUtils.getSimpleStack(tempItemBlueprint); this.inventoryHolo.setInventorySlotContents(1, newTempBlueprint); - Utils.LOG_WARNING(ItemUtils.getArrayStackNames(tempItemBlueprint.getBlueprint(newTempBlueprint))); + Logger.WARNING(ItemUtils.getArrayStackNames(tempItemBlueprint.getBlueprint(newTempBlueprint))); } else { if (tempItemBlueprint.hasBlueprint(tempBlueprint)){ - Utils.LOG_WARNING("Blueprint already holds a recipe."); + Logger.WARNING("Blueprint already holds a recipe."); } else { - Utils.LOG_WARNING("Output slot was empty."); + Logger.WARNING("Output slot was empty."); } } } else { - Utils.LOG_WARNING("ItemStack found was not a blueprint."); + Logger.WARNING("ItemStack found was not a blueprint."); } } else { - Utils.LOG_WARNING("No ItemStack found in Blueprint slot."); + Logger.WARNING("No ItemStack found in Blueprint slot."); } } else if (x == 3){ - Utils.LOG_WARNING("Player Clicked Big [P] slot in the Holo Grid"); + Logger.WARNING("Player Clicked Big [P] slot in the Holo Grid"); } else if (x == 4){ - Utils.LOG_WARNING("Player Clicked Transfer to Crafting Grid slot in the Holo Grid"); + Logger.WARNING("Player Clicked Transfer to Crafting Grid slot in the Holo Grid"); } else if (x == 5){ - Utils.LOG_WARNING("Player Clicked Transfer to Storage Grid slot in the Holo Grid"); + Logger.WARNING("Player Clicked Transfer to Storage Grid slot in the Holo Grid"); } } } for (final int x : this.slotCrafting){ if (aSlotIndex == x){ - Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the crafting Grid"); + Logger.WARNING("Player Clicked slot "+aSlotIndex+" in the crafting Grid"); } } for (final int x : this.slotStorage){ if (aSlotIndex == x){ - Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the storage Grid"); + Logger.WARNING("Player Clicked slot "+aSlotIndex+" in the storage Grid"); } } for (final int x : this.slotTools){ if (aSlotIndex == x){ - Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the tool Grid"); + Logger.WARNING("Player Clicked slot "+aSlotIndex+" in the tool Grid"); } } } diff --git a/src/Java/gtPlusPlus/core/container/Container_WorkbenchAdvanced.java b/src/Java/gtPlusPlus/core/container/Container_WorkbenchAdvanced.java index 4fefb8b3f5..453b965bc7 100644 --- a/src/Java/gtPlusPlus/core/container/Container_WorkbenchAdvanced.java +++ b/src/Java/gtPlusPlus/core/container/Container_WorkbenchAdvanced.java @@ -1,13 +1,13 @@ package gtPlusPlus.core.container; import gregtech.api.gui.GT_Slot_Holo; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.interfaces.IItemBlueprint; import gtPlusPlus.core.inventories.*; import gtPlusPlus.core.item.general.ItemBlueprint; import gtPlusPlus.core.slots.*; import gtPlusPlus.core.tileentities.machines.TileEntityWorkbenchAdvanced; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.ItemUtils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -151,74 +151,74 @@ public class Container_WorkbenchAdvanced extends Container { } if (aSlotIndex == this.slotOutput){ - Utils.LOG_WARNING("Player Clicked on the output slot"); + Logger.WARNING("Player Clicked on the output slot"); //TODO } for (final int x : this.slotHolo){ if (aSlotIndex == x){ - Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the Holo Grid"); + Logger.WARNING("Player Clicked slot "+aSlotIndex+" in the Holo Grid"); if (x == 1){ - Utils.LOG_WARNING("Player Clicked Blueprint slot in the Holo Grid"); + Logger.WARNING("Player Clicked Blueprint slot in the Holo Grid"); } else if (x == 2){ - Utils.LOG_WARNING("Player Clicked Right Arrow slot in the Holo Grid"); + Logger.WARNING("Player Clicked Right Arrow slot in the Holo Grid"); if (this.inventoryHolo.getStackInSlot(1) != null){ - Utils.LOG_WARNING("Found an ItemStack."); + Logger.WARNING("Found an ItemStack."); if (this.inventoryHolo.getStackInSlot(1).getItem() instanceof IItemBlueprint){ - Utils.LOG_WARNING("Found a blueprint."); + Logger.WARNING("Found a blueprint."); final ItemStack tempBlueprint = this.inventoryHolo.getStackInSlot(1); final ItemBlueprint tempItemBlueprint = (ItemBlueprint) tempBlueprint.getItem(); if ((this.inventoryHolo.getStackInSlot(0) != null) && !tempItemBlueprint.hasBlueprint(tempBlueprint)){ - Utils.LOG_WARNING("Output slot was not empty."); - Utils.LOG_WARNING("Trying to manipulate NBT data on the blueprint stack, then replace it with the new one."); + Logger.WARNING("Output slot was not empty."); + Logger.WARNING("Trying to manipulate NBT data on the blueprint stack, then replace it with the new one."); tempItemBlueprint.setBlueprint(this.inventoryHolo.getStackInSlot(1), this.craftMatrix, this.inventoryHolo.getStackInSlot(0)); final ItemStack newTempBlueprint = ItemUtils.getSimpleStack(tempItemBlueprint); this.inventoryHolo.setInventorySlotContents(1, newTempBlueprint); - Utils.LOG_WARNING(ItemUtils.getArrayStackNames(tempItemBlueprint.getBlueprint(newTempBlueprint))); + Logger.WARNING(ItemUtils.getArrayStackNames(tempItemBlueprint.getBlueprint(newTempBlueprint))); } else { if (tempItemBlueprint.hasBlueprint(tempBlueprint)){ - Utils.LOG_WARNING("Blueprint already holds a recipe."); + Logger.WARNING("Blueprint already holds a recipe."); } else { - Utils.LOG_WARNING("Output slot was empty."); + Logger.WARNING("Output slot was empty."); } } } else { - Utils.LOG_WARNING("ItemStack found was not a blueprint."); + Logger.WARNING("ItemStack found was not a blueprint."); } } else { - Utils.LOG_WARNING("No ItemStack found in Blueprint slot."); + Logger.WARNING("No ItemStack found in Blueprint slot."); } } else if (x == 3){ - Utils.LOG_WARNING("Player Clicked Big [P] slot in the Holo Grid"); + Logger.WARNING("Player Clicked Big [P] slot in the Holo Grid"); } else if (x == 4){ - Utils.LOG_WARNING("Player Clicked Transfer to Crafting Grid slot in the Holo Grid"); + Logger.WARNING("Player Clicked Transfer to Crafting Grid slot in the Holo Grid"); } else if (x == 5){ - Utils.LOG_WARNING("Player Clicked Transfer to Storage Grid slot in the Holo Grid"); + Logger.WARNING("Player Clicked Transfer to Storage Grid slot in the Holo Grid"); } } } for (final int x : this.slotCrafting){ if (aSlotIndex == x){ - Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the crafting Grid"); + Logger.WARNING("Player Clicked slot "+aSlotIndex+" in the crafting Grid"); } } for (final int x : this.slotStorage){ if (aSlotIndex == x){ - Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the storage Grid"); + Logger.WARNING("Player Clicked slot "+aSlotIndex+" in the storage Grid"); } } for (final int x : this.slotTools){ if (aSlotIndex == x){ - Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the tool Grid"); + Logger.WARNING("Player Clicked slot "+aSlotIndex+" in the tool Grid"); } } } |