From 5715a32d2901922503fd850f3a68503fb77467c3 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Wed, 20 Dec 2017 23:39:49 +1000 Subject: - 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. --- src/Java/gtPlusPlus/core/block/ModBlocks.java | 5 +- .../core/block/general/antigrief/TowerDevice.java | 4 +- .../block/machine/Machine_ModularityTable.java | 4 +- .../core/block/machine/Machine_ProjectTable.java | 4 +- .../core/block/machine/Machine_TradeTable.java | 4 +- .../core/block/machine/Machine_Workbench.java | 4 +- .../core/client/model/ModelStaballoyConstruct.java | 15 ++- .../renderer/RenderMiningExplosivesPrimed.java | 6 +- .../core/client/renderer/RenderPotionthrow.java | 25 ++-- .../client/renderer/RenderStaballoyConstruct.java | 21 +-- src/Java/gtPlusPlus/core/commands/CommandMath.java | 50 ++++---- src/Java/gtPlusPlus/core/common/CommonProxy.java | 27 ++-- .../core/common/compat/COMPAT_Baubles.java | 6 +- .../core/container/Container_HeliumGenerator.java | 6 +- .../core/container/Container_ModularityTable.java | 21 ++- .../core/container/Container_ProjectTable.java | 16 ++- .../core/container/Container_TradeTable.java | 17 ++- .../core/container/Container_Workbench.java | 40 +++--- .../container/Container_WorkbenchAdvanced.java | 40 +++--- .../core/entity/InternalEntityRegistry.java | 4 +- .../entity/monster/EntityStaballoyConstruct.java | 12 +- .../projectile/EntityHydrofluoricAcidPotion.java | 5 +- .../projectile/EntitySulfuricAcidPotion.java | 3 +- .../core/gui/machine/GUI_TradeTable.java | 6 +- src/Java/gtPlusPlus/core/handler/BookHandler.java | 4 +- .../gtPlusPlus/core/handler/COMPAT_HANDLER.java | 4 +- src/Java/gtPlusPlus/core/handler/GuiHandler.java | 10 +- .../gtPlusPlus/core/handler/OldCircuitHandler.java | 8 +- .../handler/Recipes/LateRegistrationHandler.java | 6 +- .../core/handler/Recipes/RegistrationHandler.java | 4 +- .../core/handler/events/BlockEventHandler.java | 20 +-- .../core/handler/events/LoginEventHandler.java | 11 +- .../events/PickaxeBlockBreakEventHandler.java | 10 +- .../core/handler/events/SneakManager.java | 4 +- .../handler/events/UnbreakableBlockManager.java | 50 ++++---- .../events/ZombieBackupSpawnEventHandler.java | 8 +- .../workbench/Workbench_CraftingHandler.java | 4 +- .../inventories/InventoryWorkbenchHoloSlots.java | 14 +- src/Java/gtPlusPlus/core/item/ModItems.java | 35 ++--- .../core/item/base/BaseItemDamageable.java | 6 +- .../gtPlusPlus/core/item/base/BasicSpawnEgg.java | 6 +- src/Java/gtPlusPlus/core/item/base/CoreItem.java | 4 +- .../core/item/base/dusts/BaseItemDust.java | 34 ++--- .../core/item/base/dusts/BaseItemDustUnique.java | 12 +- .../core/item/base/foods/BaseItemHotFood.java | 3 +- .../core/item/base/ingots/BaseItemIngot.java | 8 +- .../core/item/base/ingots/BaseItemIngotHot.java | 3 +- .../core/item/base/ingots/BaseItemIngot_OLD.java | 8 +- .../core/item/base/itemblock/ItemBlockNBT.java | 4 +- .../core/item/base/misc/BaseItemMisc.java | 4 +- .../core/item/base/rods/BaseItemRod.java | 4 +- .../core/item/base/rods/BaseItemRodLong.java | 4 +- .../core/item/base/screws/BaseItemScrew.java | 4 +- .../gtPlusPlus/core/item/bauble/ModularBauble.java | 8 +- .../core/item/general/ItemAreaClear.java | 4 +- .../core/item/general/ItemBlueprint.java | 12 +- .../core/item/general/ItemHealingDevice.java | 4 +- .../item/general/capture/ItemEntityCatcher.java | 58 ++++----- .../throwables/ItemHydrofluoricAcidPotion.java | 1 + .../general/throwables/ItemSulfuricAcidPotion.java | 1 + .../gtPlusPlus/core/item/init/ItemsMultiTools.java | 4 +- .../core/item/tool/staballoy/MultiPickaxeBase.java | 13 +- .../core/item/tool/staballoy/StaballoyPickaxe.java | 34 ++--- .../core/item/tool/staballoy/StaballoySpade.java | 30 ++--- src/Java/gtPlusPlus/core/lib/LoadedMods.java | 92 +++++++------- src/Java/gtPlusPlus/core/material/Material.java | 85 +++++++------ .../core/material/MaterialGenerator.java | 5 +- src/Java/gtPlusPlus/core/proxy/ClientProxy.java | 13 +- .../core/recipe/Gregtech_Recipe_Adder.java | 4 +- .../gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 54 ++++---- .../gtPlusPlus/core/recipe/RECIPES_General.java | 10 +- .../core/recipe/RECIPES_LaserEngraver.java | 30 ++--- .../gtPlusPlus/core/recipe/RECIPES_MTWRAPPER.java | 4 +- .../core/recipe/RECIPES_MachineComponents.java | 8 +- .../gtPlusPlus/core/recipe/RECIPES_Machines.java | 8 +- .../core/recipe/RECIPES_Old_Circuits.java | 18 +-- .../gtPlusPlus/core/recipe/RECIPES_Shapeless.java | 4 +- .../gtPlusPlus/core/recipe/ShapedRecipeObject.java | 4 +- src/Java/gtPlusPlus/core/recipe/common/CI.java | 7 +- src/Java/gtPlusPlus/core/slots/SlotBlueprint.java | 6 +- .../core/slots/SlotCraftingNoCollect.java | 11 +- src/Java/gtPlusPlus/core/slots/SlotGtTool.java | 6 +- .../gtPlusPlus/core/slots/SlotGtToolElectric.java | 6 +- .../core/slots/SlotModularBaubleUpgrades.java | 6 +- .../core/tileentities/ModTileEntities.java | 4 +- .../core/tileentities/base/TileEntityBase.java | 10 +- .../tileentities/general/TileEntityFishTrap.java | 12 +- .../general/TileEntityInfiniteFluid.java | 14 +- .../general/TileEntityXpConverter.java | 38 +++--- .../machines/TileEntityModularityTable.java | 17 +-- .../machines/TileEntityProjectTable.java | 42 +++--- src/Java/gtPlusPlus/core/util/Utils.java | 141 +++++---------------- src/Java/gtPlusPlus/core/util/array/AutoMap.java | 77 +++++++++++ .../core/util/debug/DEBUG_ITEM_ShapeSpawner.java | 4 +- .../core/util/debug/DEBUG_TimerThread.java | 10 +- .../core/util/enchanting/EnchantingUtils.java | 6 +- .../gtPlusPlus/core/util/fluid/FluidUtils.java | 29 +++-- src/Java/gtPlusPlus/core/util/geo/GeoUtils.java | 14 +- .../gregtech/recipehandlers/GregtechRecipe.java | 14 +- .../core/util/inventory/InventoryUtils.java | 10 +- src/Java/gtPlusPlus/core/util/item/ItemUtils.java | 47 +++---- .../core/util/materials/MaterialUtils.java | 28 +--- src/Java/gtPlusPlus/core/util/math/MathUtils.java | 7 +- .../core/util/nbt/ModularArmourUtils.java | 4 +- src/Java/gtPlusPlus/core/util/nbt/NBTUtils.java | 8 +- .../core/util/networking/NetworkUtils.java | 12 +- .../gtPlusPlus/core/util/player/PlayerCache.java | 16 +-- .../gtPlusPlus/core/util/player/PlayerUtils.java | 2 +- .../gtPlusPlus/core/util/player/UtilsMining.java | 18 +-- .../gtPlusPlus/core/util/recipe/RecipeUtils.java | 140 ++++++++++---------- .../core/util/recipe/shapeless/ShapelessUtils.java | 6 +- .../core/util/reflect/ReflectionUtils.java | 44 ++++++- src/Java/gtPlusPlus/core/util/wrapper/var.java | 4 +- .../darkworld/biome/BiomeGenerator_Custom.java | 37 +++--- .../world/darkworld/biome/Biome_DarkWorld.java | 4 +- .../block/blockDarkWorldPollutedDirt.java | 4 +- .../world/darkworld/chunk/ChunkProviderModded.java | 6 +- .../world/darkworld/gen/WorldGenDeadLilly.java | 4 +- .../darkworld/gen/WorldGenMinable_Custom.java | 34 ++--- 119 files changed, 1050 insertions(+), 1008 deletions(-) create mode 100644 src/Java/gtPlusPlus/core/util/array/AutoMap.java (limited to 'src/Java/gtPlusPlus/core') diff --git a/src/Java/gtPlusPlus/core/block/ModBlocks.java b/src/Java/gtPlusPlus/core/block/ModBlocks.java index 81d3a84dc9..cbd21a8888 100644 --- a/src/Java/gtPlusPlus/core/block/ModBlocks.java +++ b/src/Java/gtPlusPlus/core/block/ModBlocks.java @@ -1,6 +1,7 @@ package gtPlusPlus.core.block; import cpw.mods.fml.common.registry.GameRegistry; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.base.BasicBlock.BlockTypes; import gtPlusPlus.core.block.base.BlockBaseOre; import gtPlusPlus.core.block.general.BlockCompressedObsidian; @@ -66,7 +67,7 @@ public final class ModBlocks { public static Block blockNet; public static void init() { - Utils.LOG_INFO("Initializing Blocks."); + Logger.INFO("Initializing Blocks."); //blockGriefSaver = new TowerDevice().setBlockName("blockGriefSaver").setCreativeTab(AddToCreativeTab.tabBlock).setBlockTextureName("blockDefault"); registerBlocks(); @@ -74,7 +75,7 @@ public final class ModBlocks { public static void registerBlocks(){ - Utils.LOG_INFO("Registering Blocks."); + Logger.INFO("Registering Blocks."); GameRegistry.registerBlock(MatterFabricatorEffectBlock = new LightGlass(Material.glass, false).setHardness(0.1F).setBlockTextureName(CORE.MODID + ":" + "blockMFEffect").setStepSound(Block.soundTypeGlass), "blockMFEffect"); //Fluids diff --git a/src/Java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java b/src/Java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java index 8ac4e2df8d..ea3d9c3ee9 100644 --- a/src/Java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java +++ b/src/Java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java @@ -7,10 +7,10 @@ import java.util.Random; 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.tileentities.general.TileEntityReverter; -import gtPlusPlus.core.util.Utils; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -266,7 +266,7 @@ public class TowerDevice extends Block { public TileEntity createTileEntity(final World world, final int metadata) { if (metadata == 0) { - Utils.LOG_INFO("I have been created. [Antigriefer]"+this.getLocalizedName()); + Logger.INFO("I have been created. [Antigriefer]"+this.getLocalizedName()); return new TileEntityReverter(); } return null; diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_ModularityTable.java b/src/Java/gtPlusPlus/core/block/machine/Machine_ModularityTable.java index 1b4c5ebd01..bd41980325 100644 --- a/src/Java/gtPlusPlus/core/block/machine/Machine_ModularityTable.java +++ b/src/Java/gtPlusPlus/core/block/machine/Machine_ModularityTable.java @@ -5,10 +5,10 @@ import cpw.mods.fml.common.registry.LanguageRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gtPlusPlus.GTplusplus; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable; -import gtPlusPlus.core.util.Utils; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -70,7 +70,7 @@ public class Machine_ModularityTable extends BlockContainer final TileEntity te = world.getTileEntity(x, y, z); if ((te != null) && (te instanceof TileEntityModularityTable)){ player.openGui(GTplusplus.instance, 1, world, x, y, z); - Utils.LOG_INFO("Player opened GUI"); + Logger.INFO("Player opened GUI"); return true; } return false; diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_ProjectTable.java b/src/Java/gtPlusPlus/core/block/machine/Machine_ProjectTable.java index 939015adf7..712d32aba7 100644 --- a/src/Java/gtPlusPlus/core/block/machine/Machine_ProjectTable.java +++ b/src/Java/gtPlusPlus/core/block/machine/Machine_ProjectTable.java @@ -6,11 +6,11 @@ import cpw.mods.fml.common.registry.LanguageRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gtPlusPlus.GTplusplus; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.tileentities.machines.TileEntityProjectTable; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.player.PlayerUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; import ic2.core.item.tool.ItemToolWrench; @@ -95,7 +95,7 @@ public class Machine_ProjectTable extends BlockContainer player.openGui(GTplusplus.instance, 0, world, x, y, z); return true; } - Utils.LOG_INFO("Holding a Wrench, doing wrench things instead."); + Logger.INFO("Holding a Wrench, doing wrench things instead."); } return false; } diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_TradeTable.java b/src/Java/gtPlusPlus/core/block/machine/Machine_TradeTable.java index 724b438b13..4cad0977ed 100644 --- a/src/Java/gtPlusPlus/core/block/machine/Machine_TradeTable.java +++ b/src/Java/gtPlusPlus/core/block/machine/Machine_TradeTable.java @@ -3,10 +3,10 @@ package gtPlusPlus.core.block.machine; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gtPlusPlus.GTplusplus; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.base.BlockBaseNBT; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.tileentities.machines.TileEntityTradeTable; -import gtPlusPlus.core.util.Utils; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EnumCreatureType; @@ -55,7 +55,7 @@ public class Machine_TradeTable extends BlockBaseNBT return true; } else { - Utils.LOG_INFO("Bad TE"); + Logger.INFO("Bad TE"); } return false; } diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_Workbench.java b/src/Java/gtPlusPlus/core/block/machine/Machine_Workbench.java index b5c54ad9a8..06df4ca480 100644 --- a/src/Java/gtPlusPlus/core/block/machine/Machine_Workbench.java +++ b/src/Java/gtPlusPlus/core/block/machine/Machine_Workbench.java @@ -6,11 +6,11 @@ import cpw.mods.fml.common.registry.LanguageRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gtPlusPlus.GTplusplus; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.tileentities.machines.TileEntityWorkbench; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.player.PlayerUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; import ic2.core.item.tool.ItemToolWrench; @@ -95,7 +95,7 @@ public class Machine_Workbench extends BlockContainer player.openGui(GTplusplus.instance, 3, world, x, y, z); return true; } - Utils.LOG_INFO("Holding a Wrench, doing wrench things instead."); + Logger.INFO("Holding a Wrench, doing wrench things instead."); } return false; } diff --git a/src/Java/gtPlusPlus/core/client/model/ModelStaballoyConstruct.java b/src/Java/gtPlusPlus/core/client/model/ModelStaballoyConstruct.java index ab56e11a9a..72693e3de7 100644 --- a/src/Java/gtPlusPlus/core/client/model/ModelStaballoyConstruct.java +++ b/src/Java/gtPlusPlus/core/client/model/ModelStaballoyConstruct.java @@ -65,7 +65,8 @@ public class ModelStaballoyConstruct extends ModelIronGolem /** * Sets the models various rotation angles then renders the model. */ - public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + @Override + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); this.ironGolemHead.render(p_78088_7_); @@ -81,7 +82,8 @@ public class ModelStaballoyConstruct extends ModelIronGolem * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how * "far" arms and legs can swing at most. */ - public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + @Override + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { this.ironGolemHead.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); this.ironGolemHead.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); @@ -95,15 +97,16 @@ public class ModelStaballoyConstruct extends ModelIronGolem * Used for easily adding entity-dependent animations. The second and third float params here are the same second * and third as in the setRotationAngles method. */ - public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) + @Override + public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) { EntityIronGolem entityirongolem = (EntityIronGolem)p_78086_1_; int i = entityirongolem.getAttackTimer(); if (i > 0) { - this.ironGolemRightArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a((float)i - p_78086_4_, 10.0F); - this.ironGolemLeftArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a((float)i - p_78086_4_, 10.0F); + this.ironGolemRightArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a(i - p_78086_4_, 10.0F); + this.ironGolemLeftArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a(i - p_78086_4_, 10.0F); } else { @@ -111,7 +114,7 @@ public class ModelStaballoyConstruct extends ModelIronGolem if (j > 0) { - this.ironGolemRightArm.rotateAngleX = -0.8F + 0.025F * this.func_78172_a((float)j, 70.0F); + this.ironGolemRightArm.rotateAngleX = -0.8F + 0.025F * this.func_78172_a(j, 70.0F); this.ironGolemLeftArm.rotateAngleX = 0.0F; } else diff --git a/src/Java/gtPlusPlus/core/client/renderer/RenderMiningExplosivesPrimed.java b/src/Java/gtPlusPlus/core/client/renderer/RenderMiningExplosivesPrimed.java index bbbde96c8e..42071428a7 100644 --- a/src/Java/gtPlusPlus/core/client/renderer/RenderMiningExplosivesPrimed.java +++ b/src/Java/gtPlusPlus/core/client/renderer/RenderMiningExplosivesPrimed.java @@ -4,8 +4,8 @@ import org.lwjgl.opengl.GL11; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.util.Utils; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.texture.TextureMap; @@ -19,7 +19,7 @@ public class RenderMiningExplosivesPrimed extends Render { public RenderMiningExplosivesPrimed(){ this.shadowSize = 0.5F; - Utils.LOG_INFO("Rendering Mining Explosion. 1"); + Logger.INFO("Rendering Mining Explosion. 1"); } /** @@ -29,7 +29,7 @@ public class RenderMiningExplosivesPrimed extends Render { * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that. */ public void doRender(final EntityTNTPrimed entity, final double p_76986_2_, final double p_76986_4_, final double p_76986_6_, final float p_76986_8_, final float p_76986_9_){ - Utils.LOG_INFO("Rendering Mining Explosion. 2"); + Logger.INFO("Rendering Mining Explosion. 2"); GL11.glPushMatrix(); GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_, (float)p_76986_6_); float f2; diff --git a/src/Java/gtPlusPlus/core/client/renderer/RenderPotionthrow.java b/src/Java/gtPlusPlus/core/client/renderer/RenderPotionthrow.java index 378d03f1df..e86a3fa7ab 100644 --- a/src/Java/gtPlusPlus/core/client/renderer/RenderPotionthrow.java +++ b/src/Java/gtPlusPlus/core/client/renderer/RenderPotionthrow.java @@ -1,5 +1,8 @@ package gtPlusPlus.core.client.renderer; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.Tessellator; @@ -12,8 +15,6 @@ import net.minecraft.item.ItemPotion; import net.minecraft.potion.PotionHelper; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; @SideOnly(Side.CLIENT) public class RenderPotionthrow extends Render @@ -38,7 +39,8 @@ public class RenderPotionthrow extends Render * (Render> 16 & 255) / 255.0F; - float f3 = (float)(i >> 8 & 255) / 255.0F; - float f4 = (float)(i & 255) / 255.0F; + float f2 = (i >> 16 & 255) / 255.0F; + float f3 = (i >> 8 & 255) / 255.0F; + float f4 = (i & 255) / 255.0F; GL11.glColor3f(f2, f3, f4); GL11.glPushMatrix(); this.func_77026_a(tessellator, ItemPotion.func_94589_d("overlay")); @@ -73,7 +75,8 @@ public class RenderPotionthrow extends Render /** * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. */ - protected ResourceLocation getEntityTexture(Entity p_110775_1_) + @Override + protected ResourceLocation getEntityTexture(Entity p_110775_1_) { return TextureMap.locationItemsTexture; } @@ -91,10 +94,10 @@ public class RenderPotionthrow extends Render GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); p_77026_1_.startDrawingQuads(); p_77026_1_.setNormal(0.0F, 1.0F, 0.0F); - p_77026_1_.addVertexWithUV((double)(0.0F - f5), (double)(0.0F - f6), 0.0D, (double)f, (double)f3); - p_77026_1_.addVertexWithUV((double)(f4 - f5), (double)(0.0F - f6), 0.0D, (double)f1, (double)f3); - p_77026_1_.addVertexWithUV((double)(f4 - f5), (double)(f4 - f6), 0.0D, (double)f1, (double)f2); - p_77026_1_.addVertexWithUV((double)(0.0F - f5), (double)(f4 - f6), 0.0D, (double)f, (double)f2); + p_77026_1_.addVertexWithUV(0.0F - f5, 0.0F - f6, 0.0D, f, f3); + p_77026_1_.addVertexWithUV(f4 - f5, 0.0F - f6, 0.0D, f1, f3); + p_77026_1_.addVertexWithUV(f4 - f5, f4 - f6, 0.0D, f1, f2); + p_77026_1_.addVertexWithUV(0.0F - f5, f4 - f6, 0.0D, f, f2); p_77026_1_.draw(); } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/client/renderer/RenderStaballoyConstruct.java b/src/Java/gtPlusPlus/core/client/renderer/RenderStaballoyConstruct.java index 20a3a0b2f4..8de64eef26 100644 --- a/src/Java/gtPlusPlus/core/client/renderer/RenderStaballoyConstruct.java +++ b/src/Java/gtPlusPlus/core/client/renderer/RenderStaballoyConstruct.java @@ -1,5 +1,8 @@ package gtPlusPlus.core.client.renderer; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gtPlusPlus.core.client.model.ModelStaballoyConstruct; @@ -8,13 +11,9 @@ import gtPlusPlus.core.lib.CORE; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.*; import net.minecraft.init.Blocks; import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; @SideOnly(Side.CLIENT) public class RenderStaballoyConstruct extends RenderLiving { @@ -37,7 +36,7 @@ public class RenderStaballoyConstruct extends RenderLiving { */ public void doRender(EntityStaballoyConstruct p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) { - super.doRender((EntityLiving) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); + super.doRender(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); } /** @@ -51,7 +50,7 @@ public class RenderStaballoyConstruct extends RenderLiving { protected void rotateCorpse(EntityStaballoyConstruct p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) { super.rotateCorpse(p_77043_1_, p_77043_2_, p_77043_3_, p_77043_4_); - if ((double) p_77043_1_.limbSwingAmount >= 0.01D) { + if (p_77043_1_.limbSwingAmount >= 0.01D) { float f3 = 13.0F; float f4 = p_77043_1_.limbSwing - p_77043_1_.limbSwingAmount * (1.0F - p_77043_4_) + 6.0F; float f5 = (Math.abs(f4 % f3 - f3 * 0.5F) - f3 * 0.25F) / (f3 * 0.25F); @@ -74,7 +73,7 @@ public class RenderStaballoyConstruct extends RenderLiving { int i = p_77029_1_.getBrightnessForRender(p_77029_2_); int j = i % 65536; int k = i / 65536; - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) j / 1.0F, (float) k / 1.0F); + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, j / 1.0F, k / 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.bindTexture(TextureMap.locationBlocksTexture); this.field_147909_c.renderBlockAsItem(Blocks.red_flower, 0, 1.0F); @@ -91,15 +90,18 @@ public class RenderStaballoyConstruct extends RenderLiving { * void func_76986_a(T entity, double d, double d1, double d2, float f, * float f1). But JAD is pre 1.5 so doesn't do that. */ + @Override public void doRender(EntityLiving p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) { this.doRender((EntityStaballoyConstruct) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); } + @Override protected void renderEquippedItems(EntityLivingBase p_77029_1_, float p_77029_2_) { this.renderEquippedItems((EntityStaballoyConstruct) p_77029_1_, p_77029_2_); } + @Override protected void rotateCorpse(EntityLivingBase p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) { this.rotateCorpse((EntityStaballoyConstruct) p_77043_1_, p_77043_2_, p_77043_3_, p_77043_4_); } @@ -112,6 +114,7 @@ public class RenderStaballoyConstruct extends RenderLiving { * void func_76986_a(T entity, double d, double d1, double d2, float f, * float f1). But JAD is pre 1.5 so doesn't do that. */ + @Override public void doRender(EntityLivingBase p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) { this.doRender((EntityStaballoyConstruct) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); @@ -121,6 +124,7 @@ public class RenderStaballoyConstruct extends RenderLiving { * Returns the location of an entity's texture. Doesn't seem to be called * unless you call Render.bindEntityTexture. */ + @Override protected ResourceLocation getEntityTexture(Entity p_110775_1_) { return this.getEntityTexture((EntityStaballoyConstruct) p_110775_1_); } @@ -133,6 +137,7 @@ public class RenderStaballoyConstruct extends RenderLiving { * void func_76986_a(T entity, double d, double d1, double d2, float f, * float f1). But JAD is pre 1.5 so doesn't do that. */ + @Override public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) { this.doRender((EntityStaballoyConstruct) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); diff --git a/src/Java/gtPlusPlus/core/commands/CommandMath.java b/src/Java/gtPlusPlus/core/commands/CommandMath.java index 966f73c589..27c963bf81 100644 --- a/src/Java/gtPlusPlus/core/commands/CommandMath.java +++ b/src/Java/gtPlusPlus/core/commands/CommandMath.java @@ -3,7 +3,7 @@ package gtPlusPlus.core.commands; import java.util.ArrayList; import java.util.List; -import gtPlusPlus.core.util.Utils; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.util.player.PlayerUtils; import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; @@ -82,23 +82,23 @@ public class CommandMath implements ICommand System.out.println("Processing on Server side - Home Teleport engaged by: "+P.getDisplayName()); final int XP_TOTAL = P.experienceTotal; - Utils.LOG_WARNING("Total Xp:" + XP_TOTAL); + Logger.WARNING("Total Xp:" + XP_TOTAL); final ChunkCoordinates X = P.getPlayerCoordinates(); - Utils.LOG_WARNING("Player Location: "+X); + Logger.WARNING("Player Location: "+X); ChunkCoordinates Y = null; - Utils.LOG_WARNING("Bed Location: "+Y); + Logger.WARNING("Bed Location: "+Y); try { if (P.getBedLocation(0) == null){ Y = W.getSpawnPoint(); - Utils.LOG_WARNING("Spawn Location: "+Y); + Logger.WARNING("Spawn Location: "+Y); } else if (P.getBedLocation(0) != null){ Y = P.getBedLocation(0); - Utils.LOG_WARNING("Bed Location: "+Y); + Logger.WARNING("Bed Location: "+Y); } else { Y = W.getSpawnPoint(); - Utils.LOG_WARNING("Spawn Location: "+Y); + Logger.WARNING("Spawn Location: "+Y); } } catch(final NullPointerException e) { @@ -106,37 +106,37 @@ public class CommandMath implements ICommand } if (Y == null) { Y = W.getSpawnPoint(); - Utils.LOG_WARNING("Spawn Location: "+Y); + Logger.WARNING("Spawn Location: "+Y); } final int x1 = X.posX; - Utils.LOG_WARNING("X1: "+x1); + Logger.WARNING("X1: "+x1); final int x2 = Y.posX; - Utils.LOG_WARNING("X2: "+x2); + Logger.WARNING("X2: "+x2); final int y1 = X.posY; - Utils.LOG_WARNING("Y1: "+y1); + Logger.WARNING("Y1: "+y1); final int y2 = Y.posY; - Utils.LOG_WARNING("Y2: "+y2); + Logger.WARNING("Y2: "+y2); final int z1 = X.posZ; - Utils.LOG_WARNING("Z1: "+z1); + Logger.WARNING("Z1: "+z1); final int z2 = Y.posZ; - Utils.LOG_WARNING("Z2: "+z2); + Logger.WARNING("Z2: "+z2); final double d = Math.sqrt(((x2-x1)*(x2-x1))+((y2-y1)*(y2-y1))+((z2-z1)*(z2-z1))); final String xpCost = String.valueOf((int)(d*0.15)); - Utils.LOG_WARNING("d:" + d); - Utils.LOG_WARNING("-----------------------------------------"); - Utils.LOG_WARNING("Actual math formulae"); - Utils.LOG_WARNING(String.valueOf(d)); - Utils.LOG_WARNING("-----------------------------------------"); - Utils.LOG_WARNING("Xp Cost based on answer B."); - Utils.LOG_WARNING(String.valueOf(d*0.15) + " | " + String.valueOf(xpCost)); - Utils.LOG_WARNING("-----------------------------------------"); - Utils.LOG_WARNING("Xp Total"); - Utils.LOG_WARNING(String.valueOf(XP_TOTAL)); - Utils.LOG_WARNING("-----------------------------------------"); + Logger.WARNING("d:" + d); + Logger.WARNING("-----------------------------------------"); + Logger.WARNING("Actual math formulae"); + Logger.WARNING(String.valueOf(d)); + Logger.WARNING("-----------------------------------------"); + Logger.WARNING("Xp Cost based on answer B."); + Logger.WARNING(String.valueOf(d*0.15) + " | " + String.valueOf(xpCost)); + Logger.WARNING("-----------------------------------------"); + Logger.WARNING("Xp Total"); + Logger.WARNING(String.valueOf(XP_TOTAL)); + Logger.WARNING("-----------------------------------------"); diff --git a/src/Java/gtPlusPlus/core/common/CommonProxy.java b/src/Java/gtPlusPlus/core/common/CommonProxy.java index 1360932dfb..11be6f5f2d 100644 --- a/src/Java/gtPlusPlus/core/common/CommonProxy.java +++ b/src/Java/gtPlusPlus/core/common/CommonProxy.java @@ -4,6 +4,7 @@ import static gtPlusPlus.core.lib.CORE.DEBUG; import cpw.mods.fml.common.event.*; import cpw.mods.fml.common.registry.GameRegistry; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.entity.InternalEntityRegistry; @@ -34,12 +35,12 @@ public class CommonProxy { Utils.registerEvent(this); if (LoadedMods.Gregtech){ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){ - Utils.LOG_INFO("We're using Gregtech 5.09 Experimental."); + Logger.INFO("We're using Gregtech 5.09 Experimental."); } else { - Utils.LOG_INFO("We're using Gregtech 5.08 or an earlier fork."); + Logger.INFO("We're using Gregtech 5.08 or an earlier fork."); } - Utils.LOG_INFO("Setting up our own GT_Proxy."); + Logger.INFO("Setting up our own GT_Proxy."); GtProxy = new Meta_GT_Proxy(); } else { @@ -48,27 +49,27 @@ public class CommonProxy { } public void preInit(final FMLPreInitializationEvent e) { - Utils.LOG_INFO("Doing some house cleaning."); + Logger.INFO("Doing some house cleaning."); LoadedMods.checkLoaded(); - Utils.LOG_INFO("Making sure we're ready to party!"); + Logger.INFO("Making sure we're ready to party!"); if (!DEBUG){ - Utils.LOG_WARNING("Development mode not enabled."); + Logger.WARNING("Development mode not enabled."); } else if (DEBUG){ - Utils.LOG_INFO("Development mode enabled."); + Logger.INFO("Development mode enabled."); } else { - Utils.LOG_WARNING("Development mode not set."); + Logger.WARNING("Development mode not set."); } AddToCreativeTab.initialiseTabs(); COMPAT_IntermodStaging.preInit(); BookHandler.run(); //Registration of entities and renderers - Utils.LOG_INFO("[Proxy] Calling Entity registrator."); + Logger.INFO("[Proxy] Calling Entity registrator."); registerEntities(); - Utils.LOG_INFO("[Proxy] Calling Tile Entity registrator."); + Logger.INFO("[Proxy] Calling Tile Entity registrator."); registerTileEntities(); @@ -103,7 +104,7 @@ public class CommonProxy { * End of Subscribe Event registration. */ - Utils.LOG_INFO("[Proxy] Calling Render registrator."); + Logger.INFO("[Proxy] Calling Render registrator."); registerRenderThings(); //Compat Handling @@ -113,7 +114,7 @@ public class CommonProxy { } public void postInit(final FMLPostInitializationEvent e) { - Utils.LOG_INFO("Cleaning up, doing postInit."); + Logger.INFO("Cleaning up, doing postInit."); PlayerCache.initCache(); //Circuits @@ -126,7 +127,7 @@ public class CommonProxy { if (!CORE.burnables.isEmpty()){ BurnableFuelHandler fuelHandler = new BurnableFuelHandler(); GameRegistry.registerFuelHandler(fuelHandler); - Utils.LOG_INFO("[Fuel Handler] Registering "+fuelHandler.getClass().getName()); + Logger.INFO("[Fuel Handler] Registering "+fuelHandler.getClass().getName()); } //Compat Handling diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java index c365a19231..55a0a8ac10 100644 --- a/src/Java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java +++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java @@ -1,9 +1,9 @@ package gtPlusPlus.core.common.compat; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.item.general.*; import gtPlusPlus.core.lib.LoadedMods; -import gtPlusPlus.core.util.Utils; public class COMPAT_Baubles { @@ -17,7 +17,7 @@ public class COMPAT_Baubles { } public static void baublesLoaded(){ - Utils.LOG_INFO("Baubles Found - Loading Wearables."); + Logger.INFO("Baubles Found - Loading Wearables."); ModItems.itemPersonalCloakingDevice = new ItemCloakingDevice(0); //itemPersonalCloakingDeviceCharged = new ItemCloakingDevice(0).set; ModItems.itemPersonalHealingDevice = new ItemHealingDevice(); @@ -27,7 +27,7 @@ public class COMPAT_Baubles { } public static void baublesNotLoaded(){ - Utils.LOG_INFO("Baubles Not Found - Skipping Resources."); + Logger.INFO("Baubles Not Found - Skipping Resources."); } } 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"); } } } diff --git a/src/Java/gtPlusPlus/core/entity/InternalEntityRegistry.java b/src/Java/gtPlusPlus/core/entity/InternalEntityRegistry.java index 5eb6e91812..5233c876e9 100644 --- a/src/Java/gtPlusPlus/core/entity/InternalEntityRegistry.java +++ b/src/Java/gtPlusPlus/core/entity/InternalEntityRegistry.java @@ -2,19 +2,19 @@ package gtPlusPlus.core.entity; import cpw.mods.fml.common.registry.EntityRegistry; import gtPlusPlus.GTplusplus; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.entity.monster.EntitySickBlaze; import gtPlusPlus.core.entity.monster.EntityStaballoyConstruct; import gtPlusPlus.core.entity.projectile.EntityHydrofluoricAcidPotion; import gtPlusPlus.core.entity.projectile.EntitySulfuricAcidPotion; import gtPlusPlus.core.entity.projectile.EntityToxinballSmall; -import gtPlusPlus.core.util.Utils; public class InternalEntityRegistry { static int mEntityID = 0; public static void registerEntities(){ - Utils.LOG_INFO("Registering GT++ Entities."); + Logger.INFO("Registering GT++ Entities."); //EntityRegistry.registerModEntity(EntityMiningChargePrimed.class, "MiningCharge", 3, Main.modInstance, 64, 20, true); EntityRegistry.registerModEntity(EntityPrimedMiningExplosive.class, "MiningCharge", mEntityID++, GTplusplus.instance, 64, 20, true); EntityRegistry.registerModEntity(EntitySulfuricAcidPotion.class, "throwablePotionSulfuric", mEntityID++, GTplusplus.instance, 64, 20, true); diff --git a/src/Java/gtPlusPlus/core/entity/monster/EntityStaballoyConstruct.java b/src/Java/gtPlusPlus/core/entity/monster/EntityStaballoyConstruct.java index 2cbd00bf2c..e95ee5caf0 100644 --- a/src/Java/gtPlusPlus/core/entity/monster/EntityStaballoyConstruct.java +++ b/src/Java/gtPlusPlus/core/entity/monster/EntityStaballoyConstruct.java @@ -11,11 +11,9 @@ import net.minecraft.entity.ai.*; import net.minecraft.entity.monster.EntityIronGolem; import net.minecraft.entity.monster.IMob; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.*; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; import net.minecraft.village.Village; import net.minecraft.world.World; @@ -188,15 +186,18 @@ public class EntityStaballoyConstruct extends EntityIronGolem { } } + @Override public Village getVillage() { return null; } + @Override @SideOnly(Side.CLIENT) public int getAttackTimer() { return this.attackTimer; } + @Override public void setHoldingRose(boolean p_70851_1_) { this.holdRoseTick = p_70851_1_ ? 400 : 0; this.worldObj.setEntityState(this, (byte) 11); @@ -248,14 +249,17 @@ public class EntityStaballoyConstruct extends EntityIronGolem { } } + @Override public int getHoldRoseTick() { return this.holdRoseTick; } + @Override public boolean isPlayerCreated() { return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; } + @Override public void setPlayerCreated(boolean p_70849_1_) { byte b0 = this.dataWatcher.getWatchableObjectByte(16); diff --git a/src/Java/gtPlusPlus/core/entity/projectile/EntityHydrofluoricAcidPotion.java b/src/Java/gtPlusPlus/core/entity/projectile/EntityHydrofluoricAcidPotion.java index 8b86d456b7..c935409650 100644 --- a/src/Java/gtPlusPlus/core/entity/projectile/EntityHydrofluoricAcidPotion.java +++ b/src/Java/gtPlusPlus/core/entity/projectile/EntityHydrofluoricAcidPotion.java @@ -5,10 +5,8 @@ import gtPlusPlus.core.util.array.BlockPos; import gtPlusPlus.core.util.entity.EntityUtils; import gtPlusPlus.core.util.math.MathUtils; import net.minecraft.block.Block; -import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.init.Blocks; import net.minecraft.potion.Potion; @@ -34,6 +32,7 @@ public class EntityHydrofluoricAcidPotion extends EntityThrowable { /** * Called when this EntityThrowable hits a block or entity. */ + @Override protected void onImpact(MovingObjectPosition object) { int xBlock = object.blockX; int yBlock = object.blockY; @@ -41,7 +40,7 @@ public class EntityHydrofluoricAcidPotion extends EntityThrowable { if (object.entityHit != null) { byte b0 = 6; if (!GT_Utility.isWearingFullRadioHazmat((EntityLivingBase) object.entityHit)){ - object.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float) b0); + object.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), b0); EntityUtils.setEntityOnFire(object.entityHit, 5); if (object.entityHit instanceof EntityPlayer){ diff --git a/src/Java/gtPlusPlus/core/entity/projectile/EntitySulfuricAcidPotion.java b/src/Java/gtPlusPlus/core/entity/projectile/EntitySulfuricAcidPotion.java index 38bcb42791..cd4bec52bf 100644 --- a/src/Java/gtPlusPlus/core/entity/projectile/EntitySulfuricAcidPotion.java +++ b/src/Java/gtPlusPlus/core/entity/projectile/EntitySulfuricAcidPotion.java @@ -29,6 +29,7 @@ public class EntitySulfuricAcidPotion extends EntityThrowable { /** * Called when this EntityThrowable hits a block or entity. */ + @Override protected void onImpact(MovingObjectPosition object) { int xBlock = object.blockX; int yBlock = object.blockY; @@ -36,7 +37,7 @@ public class EntitySulfuricAcidPotion extends EntityThrowable { if (object.entityHit != null) { byte b0 = 6; if (!GT_Utility.isWearingFullRadioHazmat((EntityLivingBase) object.entityHit)){ - object.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float) b0); + object.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), b0); EntityUtils.setEntityOnFire(object.entityHit, 10); object.entityHit.fireResistance = 0; ravage(EntityUtils.findBlockPosUnderEntity(object.entityHit)); diff --git a/src/Java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java b/src/Java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java index ea4d4ff2b8..70c4ce423a 100644 --- a/src/Java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java +++ b/src/Java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java @@ -4,10 +4,10 @@ import org.lwjgl.opengl.GL11; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.container.Container_TradeTable; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.tileentities.machines.TileEntityTradeTable; -import gtPlusPlus.core.util.Utils; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; @@ -27,13 +27,13 @@ public class GUI_TradeTable extends GuiContainer { if (te == null){ this.mThisTable = null; this.mOwnerName = mOwnerName; - Utils.LOG_INFO("Set invalid TE in GUI"); + Logger.INFO("Set invalid TE in GUI"); } else { if (te.isServerSide()){ mThisTable = te; this.mOwnerName = mOwnerName; - Utils.LOG_INFO("Set valid TE in GUI