diff --git a/src/api/java/mods/battlegear2/api/PlayerEventChild.java b/src/api/java/mods/battlegear2/api/PlayerEventChild.java index 654952c0..9a8116aa 100644 --- a/src/api/java/mods/battlegear2/api/PlayerEventChild.java +++ b/src/api/java/mods/battlegear2/api/PlayerEventChild.java @@ -1,8 +1,5 @@ package mods.battlegear2.api; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.event.Event.Result; import net.minecraftforge.event.entity.player.PlayerEvent; public class PlayerEventChild extends PlayerEvent{ diff --git a/src/main/java/tconstruct/blocks/CraftingSlab.java b/src/main/java/tconstruct/blocks/CraftingSlab.java index a9f4f67a..f02fe03a 100644 --- a/src/main/java/tconstruct/blocks/CraftingSlab.java +++ b/src/main/java/tconstruct/blocks/CraftingSlab.java @@ -10,7 +10,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.Icon; +import net.minecraft.util.IIcon; import net.minecraft.world.World; import tconstruct.TConstruct; import tconstruct.blocks.logic.CraftingStationLogic; diff --git a/src/main/java/tconstruct/blocks/GlueFluid.java b/src/main/java/tconstruct/blocks/GlueFluid.java index f7ad3d8a..f95bf7cf 100644 --- a/src/main/java/tconstruct/blocks/GlueFluid.java +++ b/src/main/java/tconstruct/blocks/GlueFluid.java @@ -3,20 +3,20 @@ package tconstruct.blocks; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.util.Icon; +import net.minecraft.util.IIcon; import net.minecraft.world.World; import net.minecraftforge.fluids.BlockFluidFinite; import net.minecraftforge.fluids.Fluid; public class GlueFluid extends BlockFluidFinite { - Icon stillIcon; - Icon flowIcon; + IIcon stillIcon; + IIcon flowIcon; public GlueFluid(int id, Fluid fluid, Material material) { @@ -25,7 +25,7 @@ public class GlueFluid extends BlockFluidFinite { @Override @SideOnly(Side.CLIENT) - public void registerIcons (IconRegister iconRegister) + public void registerIcons (IIconRegister iconRegister) { stillIcon = iconRegister.registerIcon("tinker:liquid_glue"); flowIcon = iconRegister.registerIcon("tinker:liquid_glue_flow"); @@ -33,7 +33,7 @@ public class GlueFluid extends BlockFluidFinite { @Override @SideOnly(Side.CLIENT) - public Icon getIcon (int side, int meta) + public IIcon getIcon (int side, int meta) { if (side == 0 || side == 1) return stillIcon; diff --git a/src/main/java/tconstruct/blocks/LavaTankBlock.java b/src/main/java/tconstruct/blocks/LavaTankBlock.java index 03310046..3c388e6e 100644 --- a/src/main/java/tconstruct/blocks/LavaTankBlock.java +++ b/src/main/java/tconstruct/blocks/LavaTankBlock.java @@ -5,7 +5,7 @@ import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; @@ -14,10 +14,10 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.Icon; +import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; @@ -28,12 +28,12 @@ import mantle.blocks.iface.IServantLogic; public class LavaTankBlock extends BlockContainer { - public Icon[] icons; + public IIcon[] icons; String texturePrefix = ""; - public LavaTankBlock(int id) + public LavaTankBlock() { - super(id, Material.rock); + super(Material.rock); setHardness(3F); setResistance(20F); setCreativeTab(TConstructRegistry.blockTab); @@ -41,9 +41,9 @@ public class LavaTankBlock extends BlockContainer setStepSound(Block.soundGlassFootstep); } - public LavaTankBlock(int id, String prefix) + public LavaTankBlock(String prefix) { - this(id); + this(); texturePrefix = prefix; } @@ -58,10 +58,10 @@ public class LavaTankBlock extends BlockContainer return textureNames; } - public void registerIcons (IconRegister iconRegister) + public void registerIcons (IIconRegister iconRegister) { String[] textureNames = getTextureNames(); - this.icons = new Icon[textureNames.length]; + this.icons = new IIcon[textureNames.length]; for (int i = 0; i < this.icons.length; ++i) { @@ -118,7 +118,7 @@ public class LavaTankBlock extends BlockContainer return TankRender.tankModelID; } - public Icon getIcon (int side, int meta) + public IIcon getIcon (int side, int meta) { if (meta >= 3) meta = 0; diff --git a/src/main/java/tconstruct/blocks/SmelteryBlock.java b/src/main/java/tconstruct/blocks/SmelteryBlock.java index 47062ae5..96d00b92 100644 --- a/src/main/java/tconstruct/blocks/SmelteryBlock.java +++ b/src/main/java/tconstruct/blocks/SmelteryBlock.java @@ -10,7 +10,7 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.Icon; +import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import tconstruct.TConstruct; diff --git a/src/main/java/tconstruct/blocks/StoneLadder.java b/src/main/java/tconstruct/blocks/StoneLadder.java index 099feb7e..84ddb52b 100644 --- a/src/main/java/tconstruct/blocks/StoneLadder.java +++ b/src/main/java/tconstruct/blocks/StoneLadder.java @@ -12,7 +12,7 @@ public class StoneLadder extends BlockLadder // Override ladder material public final Material blockMaterial = Material.rock; - private Icon icon; + private IIcon icon; // Use the normally protected constructor public StoneLadder() diff --git a/src/main/java/tconstruct/blocks/component/SmelteryComponent.java b/src/main/java/tconstruct/blocks/component/SmelteryComponent.java index 2a409648..2e828c2f 100644 --- a/src/main/java/tconstruct/blocks/component/SmelteryComponent.java +++ b/src/main/java/tconstruct/blocks/component/SmelteryComponent.java @@ -7,7 +7,7 @@ import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidHandler; diff --git a/src/main/java/tconstruct/blocks/logic/CastingBasinLogic.java b/src/main/java/tconstruct/blocks/logic/CastingBasinLogic.java index 34072a2d..6d1abb2d 100644 --- a/src/main/java/tconstruct/blocks/logic/CastingBasinLogic.java +++ b/src/main/java/tconstruct/blocks/logic/CastingBasinLogic.java @@ -10,10 +10,10 @@ import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.INetworkManager; -import net.minecraft.network.packet.Packet; +import net.minecraft.network.Packet; import net.minecraft.network.packet.Packet132TileEntityData; import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidEvent; import net.minecraftforge.fluids.FluidStack; @@ -378,7 +378,7 @@ public class CastingBasinLogic extends InventoryLogic implements IFluidTank, IFl { NBTTagCompound nbt = new NBTTagCompound(); liquid.writeToNBT(nbt); - tags.setCompoundTag("Fluid", nbt); + tags.setTag("Fluid", nbt); } tags.setBoolean("Initialized", init); tags.setInteger("Capacity", capacity); diff --git a/src/main/java/tconstruct/blocks/logic/CastingChannelLogic.java b/src/main/java/tconstruct/blocks/logic/CastingChannelLogic.java index ee8b47d7..cd8ce662 100644 --- a/src/main/java/tconstruct/blocks/logic/CastingChannelLogic.java +++ b/src/main/java/tconstruct/blocks/logic/CastingChannelLogic.java @@ -4,10 +4,10 @@ import java.util.HashMap; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.INetworkManager; -import net.minecraft.network.packet.Packet; +import net.minecraft.network.Packet; import net.minecraft.network.packet.Packet132TileEntityData; import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidEvent; import net.minecraftforge.fluids.FluidStack; diff --git a/src/main/java/tconstruct/blocks/logic/CastingTableLogic.java b/src/main/java/tconstruct/blocks/logic/CastingTableLogic.java index d34f55f2..f716d684 100644 --- a/src/main/java/tconstruct/blocks/logic/CastingTableLogic.java +++ b/src/main/java/tconstruct/blocks/logic/CastingTableLogic.java @@ -10,10 +10,10 @@ import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.INetworkManager; -import net.minecraft.network.packet.Packet; +import net.minecraft.network.Packet; import net.minecraft.network.packet.Packet132TileEntityData; import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidEvent; import net.minecraftforge.fluids.FluidStack; diff --git a/src/main/java/tconstruct/blocks/logic/FaucetLogic.java b/src/main/java/tconstruct/blocks/logic/FaucetLogic.java index 8f6572d7..b5c3717e 100644 --- a/src/main/java/tconstruct/blocks/logic/FaucetLogic.java +++ b/src/main/java/tconstruct/blocks/logic/FaucetLogic.java @@ -6,11 +6,11 @@ import mantle.blocks.iface.IFacingLogic; import net.minecraft.entity.EntityLivingBase; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.INetworkManager; -import net.minecraft.network.packet.Packet; +import net.minecraft.network.Packet; import net.minecraft.network.packet.Packet132TileEntityData; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; -import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; @@ -163,7 +163,7 @@ public class FaucetLogic extends TileEntity implements IFacingLogic, IActiveLogi { NBTTagCompound nbt = new NBTTagCompound(); liquid.writeToNBT(nbt); - tags.setCompoundTag("Fluid", nbt); + tags.setTag("Fluid", nbt); } } diff --git a/src/main/java/tconstruct/blocks/logic/LiquidTextureLogic.java b/src/main/java/tconstruct/blocks/logic/LiquidTextureLogic.java index 3406119a..430cf254 100644 --- a/src/main/java/tconstruct/blocks/logic/LiquidTextureLogic.java +++ b/src/main/java/tconstruct/blocks/logic/LiquidTextureLogic.java @@ -2,7 +2,7 @@ package tconstruct.blocks.logic; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.INetworkManager; -import net.minecraft.network.packet.Packet; +import net.minecraft.network.Packet; import net.minecraft.network.packet.Packet132TileEntityData; import net.minecraft.tileentity.TileEntity; diff --git a/src/main/java/tconstruct/blocks/logic/SmelteryDrainLogic.java b/src/main/java/tconstruct/blocks/logic/SmelteryDrainLogic.java index 395b4ad9..5622c103 100644 --- a/src/main/java/tconstruct/blocks/logic/SmelteryDrainLogic.java +++ b/src/main/java/tconstruct/blocks/logic/SmelteryDrainLogic.java @@ -5,10 +5,10 @@ import mantle.blocks.abstracts.MultiServantLogic; import net.minecraft.entity.EntityLivingBase; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.INetworkManager; -import net.minecraft.network.packet.Packet; +import net.minecraft.network.Packet; import net.minecraft.network.packet.Packet132TileEntityData; import net.minecraft.util.MathHelper; -import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; diff --git a/src/main/java/tconstruct/client/block/PaneConnectedRender.java b/src/main/java/tconstruct/client/block/PaneConnectedRender.java index 035da403..f586f5bf 100644 --- a/src/main/java/tconstruct/client/block/PaneConnectedRender.java +++ b/src/main/java/tconstruct/client/block/PaneConnectedRender.java @@ -8,7 +8,7 @@ import net.minecraft.block.Block; import net.minecraft.client.renderer.EntityRenderer; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.Icon; +import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import tconstruct.blocks.GlassPaneConnected; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; @@ -38,7 +38,7 @@ public class PaneConnectedRender implements ISimpleBlockRenderingHandler boolean flag2 = pane.canPaneConnectTo(world, x, y, z, SOUTH); boolean flag3 = pane.canPaneConnectTo(world, x, y, z, NORTH); - Icon sideTexture = pane.getSideTextureIndex(); + IIcon sideTexture = pane.getSideTextureIndex(); if (!flag && !flag1 && !flag2 && !flag3) { diff --git a/src/main/java/tconstruct/client/event/EventCloakRender.java b/src/main/java/tconstruct/client/event/EventCloakRender.java index 8347eea5..4a1a3694 100644 --- a/src/main/java/tconstruct/client/event/EventCloakRender.java +++ b/src/main/java/tconstruct/client/event/EventCloakRender.java @@ -1,15 +1,18 @@ package tconstruct.client.event; import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + import java.awt.*; import java.awt.image.BufferedImage; import java.io.*; import java.net.*; import java.util.*; + import javax.swing.ImageIcon; + import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraftforge.client.event.RenderPlayerEvent; -import net.minecraftforge.event.ForgeSubscribe; import mantle.lib.environment.EnvironmentChecks; public class EventCloakRender @@ -30,7 +33,7 @@ public class EventCloakRender instance = this; } - @ForgeSubscribe + @SubscribeEvent public void onPreRenderSpecials (RenderPlayerEvent.Specials.Pre event) { if (Loader.isModLoaded("shadersmod") || EnvironmentChecks.hasOptifine) diff --git a/src/main/java/tconstruct/client/gui/SmelteryGui.java b/src/main/java/tconstruct/client/gui/SmelteryGui.java index 088b91cb..acf0fceb 100644 --- a/src/main/java/tconstruct/client/gui/SmelteryGui.java +++ b/src/main/java/tconstruct/client/gui/SmelteryGui.java @@ -9,6 +9,7 @@ import net.minecraft.block.Block; import net.minecraft.client.renderer.*; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; import net.minecraft.network.packet.Packet250CustomPayload; import net.minecraft.util.*; import net.minecraft.world.World; @@ -166,7 +167,7 @@ public class SmelteryGui extends NewContainerGui this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); if (logic.fuelGague > 0) { - Icon lavaIcon = Block.lavaStill.getIcon(0, 0); + IIcon lavaIcon = Blocks.lava.getIcon(0, 0); int fuel = logic.getScaledFuelGague(52); int count = 0; while (fuel > 0) @@ -182,7 +183,7 @@ public class SmelteryGui extends NewContainerGui int base = 0; for (FluidStack liquid : logic.moltenMetal) { - Icon renderIndex = liquid.getFluid().getStillIcon(); + IIcon renderIndex = liquid.getFluid().getStillIcon(); int basePos = 54; if (logic.getCapacity() > 0) { diff --git a/src/main/java/tconstruct/client/tabs/InventoryTabArmorExtended.java b/src/main/java/tconstruct/client/tabs/InventoryTabArmorExtended.java index 393032fc..8ba476c7 100644 --- a/src/main/java/tconstruct/client/tabs/InventoryTabArmorExtended.java +++ b/src/main/java/tconstruct/client/tabs/InventoryTabArmorExtended.java @@ -1,6 +1,7 @@ package tconstruct.client.tabs; import tconstruct.client.TControls; +import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -8,7 +9,7 @@ public class InventoryTabArmorExtended extends AbstractTab { public InventoryTabArmorExtended() { - super(0, 0, 0, new ItemStack(Item.plateDiamond)); + super(0, 0, 0, new ItemStack(Items.diamond_chestplate)); } @Override diff --git a/src/main/java/tconstruct/client/tabs/InventoryTabVanilla.java b/src/main/java/tconstruct/client/tabs/InventoryTabVanilla.java index 399b180f..a2e6f15c 100644 --- a/src/main/java/tconstruct/client/tabs/InventoryTabVanilla.java +++ b/src/main/java/tconstruct/client/tabs/InventoryTabVanilla.java @@ -1,13 +1,13 @@ package tconstruct.client.tabs; -import net.minecraft.block.Block; +import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; public class InventoryTabVanilla extends AbstractTab { public InventoryTabVanilla() { - super(0, 0, 0, new ItemStack(Block.workbench)); + super(0, 0, 0, new ItemStack(Blocks.crafting_table)); } @Override diff --git a/src/main/java/tconstruct/items/armor/ArmorStandard.java b/src/main/java/tconstruct/items/armor/ArmorStandard.java index c3daa632..5afa5d86 100644 --- a/src/main/java/tconstruct/items/armor/ArmorStandard.java +++ b/src/main/java/tconstruct/items/armor/ArmorStandard.java @@ -9,9 +9,9 @@ import tconstruct.library.armor.*; public class ArmorStandard extends ArmorCore { - public ArmorStandard(int par1, int baseProtection, EnumArmorPart armorPart) + public ArmorStandard(int baseProtection, EnumArmorPart armorPart) { - super(par1, baseProtection, armorPart); + super(baseProtection, armorPart); } @Override diff --git a/src/main/java/tconstruct/items/armor/TArmorBase.java b/src/main/java/tconstruct/items/armor/TArmorBase.java index ce5e3718..690ddec3 100644 --- a/src/main/java/tconstruct/items/armor/TArmorBase.java +++ b/src/main/java/tconstruct/items/armor/TArmorBase.java @@ -6,7 +6,6 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumArmorMaterial; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; @@ -25,7 +24,7 @@ public class TArmorBase extends ItemArmor public TArmorBase(int armorSlot) { - super(EnumArmorMaterial.CLOTH, 0, armorSlot); + super(ArmorMaterial.CLOTH, 0, armorSlot); this.maxStackSize = 1; this.setMaxDamage(100); setNoRepair(); diff --git a/src/main/java/tconstruct/library/crafting/FluidType.java b/src/main/java/tconstruct/library/crafting/FluidType.java index 8d58d6dc..9855b59e 100644 --- a/src/main/java/tconstruct/library/crafting/FluidType.java +++ b/src/main/java/tconstruct/library/crafting/FluidType.java @@ -8,11 +8,11 @@ import tconstruct.common.TRepo; public enum FluidType { /** Vanilla Water Smelting **/ - Water(Block.snow.blockID, 0, 20, FluidRegistry.getFluid("water"), false), + Water(Blocks.snow.blockID, 0, 20, FluidRegistry.getFluid("water"), false), /** Iron Smelting **/ - Iron(Block.blockIron.blockID, 0, 600, TRepo.moltenIronFluid, true), + Iron(Blocks.iron_block.blockID, 0, 600, TRepo.moltenIronFluid, true), /** Gold Smelting **/ - Gold(Blocks.glold_block.blockID, 0, 400, TRepo.moltenGoldFluid, false), + Gold(Blocks.gold_block.blockID, 0, 400, TRepo.moltenGoldFluid, false), /** Tin Smelting **/ Tin(TRepo.metalBlock.blockID, 5, 400, TRepo.moltenTinFluid, false), /** Copper Smelting **/ diff --git a/src/main/java/tconstruct/library/event/PartBuilderEvent.java b/src/main/java/tconstruct/library/event/PartBuilderEvent.java index 248ec1a1..593f74cb 100644 --- a/src/main/java/tconstruct/library/event/PartBuilderEvent.java +++ b/src/main/java/tconstruct/library/event/PartBuilderEvent.java @@ -1,7 +1,7 @@ package tconstruct.library.event; +import cpw.mods.fml.common.eventhandler.Event; import net.minecraft.item.ItemStack; -import net.minecraftforge.event.Event; /* This event fires after all of the other construction. The resulting nbttag is added to the tool * Note: The tag is the base tag. toolTag.getCompoundTag("InfiTool") will have all of the tool's data. diff --git a/src/main/java/tconstruct/library/event/SmelteryEvent.java b/src/main/java/tconstruct/library/event/SmelteryEvent.java index fa14bf8d..b5a2bd7b 100644 --- a/src/main/java/tconstruct/library/event/SmelteryEvent.java +++ b/src/main/java/tconstruct/library/event/SmelteryEvent.java @@ -1,9 +1,9 @@ package tconstruct.library.event; +import cpw.mods.fml.common.eventhandler.Event; import mantle.blocks.abstracts.InventoryLogic; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraftforge.event.Event; public class SmelteryEvent extends Event { diff --git a/src/main/java/tconstruct/library/event/ToolCraftEvent.java b/src/main/java/tconstruct/library/event/ToolCraftEvent.java index effb6294..f80eb37e 100644 --- a/src/main/java/tconstruct/library/event/ToolCraftEvent.java +++ b/src/main/java/tconstruct/library/event/ToolCraftEvent.java @@ -1,10 +1,10 @@ package tconstruct.library.event; +import cpw.mods.fml.common.eventhandler.Event; import tconstruct.library.tools.ToolCore; import tconstruct.library.tools.ToolMaterial; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.event.Event; /* This event fires after all of the other construction. The resulting nbttag is added to the tool * Note: The tag is the base tag. toolTag.getCompoundTag("InfiTool") will have all of the tool's data. diff --git a/src/main/java/tconstruct/library/event/ToolCraftedEvent.java b/src/main/java/tconstruct/library/event/ToolCraftedEvent.java index b34f4811..a98e97cd 100644 --- a/src/main/java/tconstruct/library/event/ToolCraftedEvent.java +++ b/src/main/java/tconstruct/library/event/ToolCraftedEvent.java @@ -1,9 +1,9 @@ package tconstruct.library.event; +import cpw.mods.fml.common.eventhandler.Event; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; -import net.minecraftforge.event.Event; public class ToolCraftedEvent extends Event { diff --git a/src/main/java/tconstruct/util/EnvironmentChecks.java b/src/main/java/tconstruct/util/EnvironmentChecks.java index 4c713e4f..05eae698 100644 --- a/src/main/java/tconstruct/util/EnvironmentChecks.java +++ b/src/main/java/tconstruct/util/EnvironmentChecks.java @@ -8,11 +8,11 @@ import mantle.crash.CallableUnsuppConfig; import net.minecraft.client.gui.GuiMainMenu; import net.minecraftforge.client.event.GuiOpenEvent; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.ForgeSubscribe; import tconstruct.TConstruct; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.ICrashCallable; import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -74,7 +74,7 @@ public class EnvironmentChecks } @SideOnly(Side.CLIENT) - @ForgeSubscribe + @SubscribeEvent public void openMainMenu (GuiOpenEvent event) { if (event.gui instanceof GuiMainMenu) diff --git a/src/main/java/tconstruct/util/TEventHandler.java b/src/main/java/tconstruct/util/TEventHandler.java index 41e56387..988220cf 100644 --- a/src/main/java/tconstruct/util/TEventHandler.java +++ b/src/main/java/tconstruct/util/TEventHandler.java @@ -5,6 +5,8 @@ import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; import java.util.Random; +import cpw.mods.fml.common.eventhandler.Event.Result; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; @@ -21,6 +23,7 @@ import net.minecraft.entity.monster.EntityZombie; import net.minecraft.entity.monster.IMob; import net.minecraft.entity.passive.EntityChicken; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemFood; @@ -29,12 +32,8 @@ import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.util.EnumMovingObjectType; import net.minecraft.world.GameRules; import net.minecraft.world.World; -import net.minecraftforge.event.Event; -import net.minecraftforge.event.Event.Result; -import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.entity.living.LivingDeathEvent; import net.minecraftforge.event.entity.living.LivingDropsEvent; import net.minecraftforge.event.entity.living.LivingHurtEvent; @@ -69,7 +68,7 @@ public class TEventHandler Random random = new Random(); /* Crafting */ - @ForgeSubscribe + @SubscribeEvent public void craftTool (ToolCraftEvent.NormalTool event) { NBTTagCompound toolTag = event.toolTag.getCompoundTag("InfiTool"); @@ -172,7 +171,7 @@ public class TEventHandler return true; } - @ForgeSubscribe + @SubscribeEvent public void craftPart (PartBuilderEvent.NormalPart event) { if (event.pattern.getItem() == TRepo.woodPattern && event.pattern.getItemDamage() == 23) @@ -209,7 +208,7 @@ public class TEventHandler { if (matchesLeaves(stack)) { - FletchingMaterial leaves = (FletchingMaterial) TConstructRegistry.getCustomMaterial(new ItemStack(Block.leaves), FletchingMaterial.class); + FletchingMaterial leaves = (FletchingMaterial) TConstructRegistry.getCustomMaterial(new ItemStack(Blocks.leaves), FletchingMaterial.class); return leaves.craftingItem.copy(); } @@ -234,7 +233,7 @@ public class TEventHandler } /* Damage */ - @ForgeSubscribe + @SubscribeEvent public void onHurt (LivingHurtEvent event) { if (event.entityLiving instanceof EntityPlayer) @@ -250,7 +249,7 @@ public class TEventHandler } /* Drops */ - @ForgeSubscribe + @SubscribeEvent public void onLivingDrop (LivingDropsEvent event) { if (event.entityLiving == null) @@ -314,7 +313,7 @@ public class TEventHandler for (int iter = 0; iter < amount; ++iter) { - addDrops(event, new ItemStack(Item.feather, 1)); + addDrops(event, new ItemStack(Items.feather, 1)); } } } @@ -336,7 +335,7 @@ public class TEventHandler beheading += 2; if (beheading > 0 && random.nextInt(100) < beheading * 10) { - addDrops(event, new ItemStack(Item.skull.itemID, 1, enemy.getSkeletonType())); + addDrops(event, new ItemStack(Items.skull, 1, enemy.getSkeletonType())); } } } @@ -362,7 +361,7 @@ public class TEventHandler beheading += 2; if (beheading > 0 && random.nextInt(100) < beheading * 10) { - addDrops(event, new ItemStack(Item.skull.itemID, 1, 2)); + addDrops(event, new ItemStack(Items.skull, 1, 2)); } } /*if (stack.getItem() == TRepo.breakerBlade && random.nextInt(100) < 10) //Swap out for real beheading @@ -387,7 +386,7 @@ public class TEventHandler beheading += 2; if (beheading > 0 && random.nextInt(100) < beheading * 5) { - addDrops(event, new ItemStack(Item.skull.itemID, 1, 4)); + addDrops(event, new ItemStack(Items.skull, 1, 4)); } } } @@ -400,15 +399,15 @@ public class TEventHandler { for (EntityItem o : event.drops) { - if (o.getEntityItem().itemID == Item.ghastTear.itemID) + if (o.getEntityItem().itemID == Items.ghast_tear) { - o.setEntityItemStack(new ItemStack(Item.ingotGold, 1)); + o.setEntityItemStack(new ItemStack(Items.gold_ingot, 1)); } } } else { - addDrops(event, new ItemStack(Item.ghastTear, 1)); + addDrops(event, new ItemStack(Items.ghast_tear, 1)); } } //} @@ -419,7 +418,7 @@ public class TEventHandler if (PHConstruct.dropPlayerHeads) { - ItemStack dropStack = new ItemStack(Item.skull.itemID, 1, 3); + ItemStack dropStack = new ItemStack(Items.skull, 1, 3); NBTTagCompound nametag = new NBTTagCompound(); nametag.setString("SkullOwner", player.username); addDrops(event, dropStack); @@ -436,7 +435,7 @@ public class TEventHandler beheading += 2; if (beheading > 0 && random.nextInt(100) < beheading * 50) { - ItemStack dropStack = new ItemStack(Item.skull.itemID, 1, 3); + ItemStack dropStack = new ItemStack(Items.skull, 1, 3); NBTTagCompound nametag = new NBTTagCompound(); nametag.setString("SkullOwner", player.username); addDrops(event, dropStack); @@ -457,7 +456,7 @@ public class TEventHandler } } - @ForgeSubscribe + @SubscribeEvent public void onLivingDeath (LivingDeathEvent event) { Entity cause = event.source.getSourceOfDamage(); @@ -488,7 +487,7 @@ public class TEventHandler } }*/ - @ForgeSubscribe + @SubscribeEvent public void onLivingSpawn (LivingSpawnEvent.SpecialSpawn event) { EntityLivingBase living = event.entityLiving; @@ -518,7 +517,7 @@ public class TEventHandler /* Bonemeal */ - @ForgeSubscribe + @SubscribeEvent public void bonemealEvent (BonemealEvent event) { if (!event.world.isRemote) @@ -532,7 +531,7 @@ public class TEventHandler } /* Ore Dictionary */ - @ForgeSubscribe + @SubscribeEvent public void registerOre (OreRegisterEvent evt) { @@ -547,7 +546,7 @@ public class TEventHandler } } - @ForgeSubscribe + @SubscribeEvent public void bucketFill (FillBucketEvent evt) { if (evt.current.getItem() == Items.bucket && evt.target.typeOfHit == EnumMovingObjectType.TILE) @@ -624,7 +623,7 @@ public class TEventHandler } } - @ForgeSubscribe + @SubscribeEvent public void livingUpdate (LivingUpdateEvent event) { if(event.entityLiving instanceof EntityPlayer){ @@ -644,7 +643,7 @@ public class TEventHandler } //Player interact event - prevent breaking of tank air blocks in creative - @ForgeSubscribe + @SubscribeEvent public void playerInteract (PlayerInteractEvent event) { if (event.action == Action.LEFT_CLICK_BLOCK) diff --git a/src/main/java/tconstruct/util/TEventHandlerAchievement.java b/src/main/java/tconstruct/util/TEventHandlerAchievement.java index 2dfc3802..d297b7bf 100644 --- a/src/main/java/tconstruct/util/TEventHandlerAchievement.java +++ b/src/main/java/tconstruct/util/TEventHandlerAchievement.java @@ -1,9 +1,8 @@ package tconstruct.util; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; import tconstruct.library.event.SmelteryEvent; - -import net.minecraftforge.common.FakePlayer; -import net.minecraftforge.event.ForgeSubscribe; +import net.minecraftforge.common.util.FakePlayer; import tconstruct.achievements.TAchievements; import tconstruct.blocks.logic.ToolForgeLogic; import tconstruct.library.event.ToolCraftedEvent; @@ -11,7 +10,7 @@ import tconstruct.library.tools.*; public class TEventHandlerAchievement { - @ForgeSubscribe + @SubscribeEvent public void onToolCrafted(ToolCraftedEvent event){ if(event.player != null && !(event.player instanceof FakePlayer)){ event.player.addStat(TAchievements.achievements.get("tconstruct.tinkerer"), 1); @@ -26,7 +25,7 @@ public class TEventHandlerAchievement { } } - @ForgeSubscribe + @SubscribeEvent public void onItemPlacedIntoCasting(SmelteryEvent.ItemInsertedIntoCasting event){ if(event.player != null && event.item != null){ if(event.item.getItem() instanceof ToolCore){