From 82de9e1aa0b6bcf3cce29d4eea12c18a9fd43a10 Mon Sep 17 00:00:00 2001 From: John Yorke Date: Mon, 26 Oct 2020 20:43:15 -0300 Subject: [PATCH] Cleanup --- .../java/taintedmagic/api/IHeldItemHUD.java | 2 +- .../api/IRenderInventoryItem.java | 2 +- ...oidsentBlood.java => RecipeVoidBlood.java} | 32 +- .../client/handler/ClientHandler.java | 16 +- .../client/handler/HUDHandler.java | 148 ++-- .../client/model/ModelKatana.java | 72 +- .../taintedmagic/client/model/ModelSaya.java | 48 +- .../renderer/RenderEntityDiffusion.java | 86 +-- .../renderer/RenderEntityHomingShard.java | 120 ++-- .../client/renderer/RenderItemKatana.java | 36 +- .../java/taintedmagic/common/CommonProxy.java | 1 - .../taintedmagic/common/TMCreativeTab.java | 73 ++ .../taintedmagic/common/TaintedMagic.java | 101 ++- .../common/TaintedMagicCreativeTab.java | 74 -- .../common/blocks/BlockLumos.java | 177 ++--- .../common/blocks/BlockNightshadeBush.java | 72 +- .../common/blocks/BlockShadowOre.java | 16 +- .../common/blocks/BlockShadowmetal.java | 2 +- .../common/blocks/BlockWarpwoodLeaves.java | 467 +++++++------ .../common/blocks/BlockWarpwoodLog.java | 84 +-- .../common/blocks/BlockWarpwoodPlanks.java | 18 +- .../common/blocks/BlockWarpwoodSapling.java | 84 ++- .../common/blocks/tile/TileLumos.java | 125 ++-- .../common/entities/EntityDarkMatter.java | 118 ++-- .../common/entities/EntityDiffusion.java | 272 +++---- .../common/entities/EntityHomingShard.java | 307 ++++---- .../common/handler/ConfigHandler.java | 72 +- .../common/handler/UpdateHandler.java | 85 +-- .../common/handler/WandHandler.java | 31 +- .../common/helper/TaintedMagicHelper.java | 107 +-- .../common/items/ItemCrimsonBlood.java | 35 +- .../common/items/ItemFlyteCharm.java | 7 +- .../common/items/ItemGatekey.java | 147 ++-- .../common/items/ItemMagicFunguar.java | 84 ++- .../common/items/ItemMaterial.java | 158 +++-- .../common/items/ItemNightshadeBerries.java | 38 +- .../taintedmagic/common/items/ItemSalis.java | 67 +- .../common/items/ItemVoidBlood.java | 33 + .../common/items/ItemVoidsentBlood.java | 38 - .../items/blocks/ItemBlockShadowOre.java | 22 - .../blocks/ItemBlockWarpwoodSapling.java | 22 - .../common/items/equipment/ItemLumosRing.java | 80 +-- .../equipment/ItemShadowFortressArmor.java | 172 ++--- .../equipment/ItemVoidFortressArmor.java | 96 +-- .../items/equipment/ItemVoidmetalGoggles.java | 80 +-- .../items/equipment/ItemVoidwalkerBoots.java | 116 +-- .../items/equipment/ItemVoidwalkerSash.java | 231 +++--- .../items/equipment/ItemWarpedGoggles.java | 58 +- .../common/items/tools/ItemHollowDagger.java | 26 +- .../common/items/tools/ItemKatana.java | 661 +++++++++--------- .../items/tools/ItemPrimordialEdge.java | 175 ++--- .../items/tools/ItemShadowmetalAxe.java | 33 +- .../items/tools/ItemShadowmetalHoe.java | 105 +-- .../items/tools/ItemShadowmetalPick.java | 33 +- .../items/tools/ItemShadowmetalSpade.java | 33 +- .../items/tools/ItemShadowmetalSword.java | 33 +- .../items/tools/ItemThaumicDisassembler.java | 268 ++++--- .../common/items/wand/ItemWandCap.java | 66 +- .../common/items/wand/ItemWandRod.java | 66 +- .../common/items/wand/foci/FocusUpgrades.java | 35 - .../items/wand/foci/TMFocusUpgrades.java | 41 ++ .../java/taintedmagic/common/lib/LibInfo.java | 9 +- .../common/network/PacketHandler.java | 2 +- .../common/network/PacketKatanaAttack.java | 99 +-- .../common/registry/BlockRegistry.java | 66 +- .../common/registry/ItemRegistry.java | 56 +- .../common/registry/OreDictRegistry.java | 18 +- .../common/registry/RecipeRegistry.java | 124 +++- .../common/registry/ResearchRegistry.java | 24 +- .../common/registry/TMEntityRegistry.java | 15 +- .../common/research/TMResearchItem.java | 116 ++- .../research/ThaumcraftResearchItem.java | 129 ++-- .../common/world/WorldGenWarpwoodTree.java | 335 ++++----- ...temVoidsentBlood.png => ItemVoidBlood.png} | Bin 74 files changed, 3485 insertions(+), 3415 deletions(-) rename src/main/java/taintedmagic/api/{RecipeVoidsentBlood.java => RecipeVoidBlood.java} (62%) create mode 100644 src/main/java/taintedmagic/common/TMCreativeTab.java delete mode 100644 src/main/java/taintedmagic/common/TaintedMagicCreativeTab.java create mode 100644 src/main/java/taintedmagic/common/items/ItemVoidBlood.java delete mode 100644 src/main/java/taintedmagic/common/items/ItemVoidsentBlood.java delete mode 100644 src/main/java/taintedmagic/common/items/blocks/ItemBlockShadowOre.java delete mode 100644 src/main/java/taintedmagic/common/items/blocks/ItemBlockWarpwoodSapling.java delete mode 100644 src/main/java/taintedmagic/common/items/wand/foci/FocusUpgrades.java create mode 100644 src/main/java/taintedmagic/common/items/wand/foci/TMFocusUpgrades.java rename src/main/resources/assets/taintedmagic/textures/items/{ItemVoidsentBlood.png => ItemVoidBlood.png} (100%) diff --git a/src/main/java/taintedmagic/api/IHeldItemHUD.java b/src/main/java/taintedmagic/api/IHeldItemHUD.java index ee81c39..177e1c9 100644 --- a/src/main/java/taintedmagic/api/IHeldItemHUD.java +++ b/src/main/java/taintedmagic/api/IHeldItemHUD.java @@ -6,5 +6,5 @@ import net.minecraft.item.ItemStack; public interface IHeldItemHUD { - abstract void renderHUD (ScaledResolution res, EntityPlayer p, ItemStack s, float partialTicks, float fract); + abstract void renderHUD (ScaledResolution res, EntityPlayer player, ItemStack stack, float partialTicks, float fract); } diff --git a/src/main/java/taintedmagic/api/IRenderInventoryItem.java b/src/main/java/taintedmagic/api/IRenderInventoryItem.java index f36c0b3..aa4d9f3 100644 --- a/src/main/java/taintedmagic/api/IRenderInventoryItem.java +++ b/src/main/java/taintedmagic/api/IRenderInventoryItem.java @@ -5,5 +5,5 @@ import net.minecraft.item.ItemStack; public interface IRenderInventoryItem { - abstract void render (EntityPlayer p, ItemStack s, float partialTicks); + abstract void render (EntityPlayer player, ItemStack stack, float partialTicks); } diff --git a/src/main/java/taintedmagic/api/RecipeVoidsentBlood.java b/src/main/java/taintedmagic/api/RecipeVoidBlood.java similarity index 62% rename from src/main/java/taintedmagic/api/RecipeVoidsentBlood.java rename to src/main/java/taintedmagic/api/RecipeVoidBlood.java index 7d87e2e..c9f31ab 100644 --- a/src/main/java/taintedmagic/api/RecipeVoidsentBlood.java +++ b/src/main/java/taintedmagic/api/RecipeVoidBlood.java @@ -6,32 +6,32 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; -import taintedmagic.common.items.ItemVoidsentBlood; +import taintedmagic.common.items.ItemVoidBlood; /** - * Custom recipe for aplpying Voidsent Blood to Cult Attire + * Custom recipe for aplpying Voidsent Blood to armour. */ -public class RecipeVoidsentBlood implements IRecipe +public class RecipeVoidBlood implements IRecipe { @Override - public boolean matches (InventoryCrafting inv, World w) + public boolean matches (InventoryCrafting inv, World world) { boolean foundBlood = false; - boolean foundArmor = false; + boolean foundArmour = false; for (int i = 0; i < inv.getSizeInventory(); i++) { - ItemStack s = inv.getStackInSlot(i); + ItemStack stack = inv.getStackInSlot(i); - if (s != null) + if (stack != null) { - if (s.getItem() instanceof ItemVoidsentBlood && !foundBlood) foundBlood = true; - else if (s.getItem() instanceof ItemArmor && !foundArmor) foundArmor = true; + if (stack.getItem() instanceof ItemVoidBlood && !foundBlood) foundBlood = true; + else if (stack.getItem() instanceof ItemArmor && !foundArmour) foundArmour = true; else return false; } } - return foundBlood && foundArmor; + return foundBlood && foundArmour; } @Override @@ -43,13 +43,13 @@ public class RecipeVoidsentBlood implements IRecipe for (int i = 0; i < inv.getSizeInventory(); i++) { - if (inv.getStackInSlot(i) != null && inv.getStackInSlot(i).getItem() instanceof ItemArmor) armor = inv - .getStackInSlot(i); - else if (inv.getStackInSlot(i) != null && inv.getStackInSlot(i).getItem() instanceof ItemVoidsentBlood) blood = inv - .getStackInSlot(i); + if (inv.getStackInSlot(i) != null && inv.getStackInSlot(i).getItem() instanceof ItemArmor) + armor = inv.getStackInSlot(i); + else if (inv.getStackInSlot(i) != null && inv.getStackInSlot(i).getItem() instanceof ItemVoidBlood) + blood = inv.getStackInSlot(i); } - if (armor != null && blood != null && (armor.getTagCompound() == null || (armor.getTagCompound() != null && !armor - .getTagCompound().getBoolean("voidtouched")))) + if (armor != null && blood != null && (armor.getTagCompound() == null + || (armor.getTagCompound() != null && !armor.getTagCompound().getBoolean("voidtouched")))) { copy = armor.copy(); if (copy.getTagCompound() == null) copy.setTagCompound(new NBTTagCompound()); diff --git a/src/main/java/taintedmagic/client/handler/ClientHandler.java b/src/main/java/taintedmagic/client/handler/ClientHandler.java index 61f9704..64bb1d1 100644 --- a/src/main/java/taintedmagic/client/handler/ClientHandler.java +++ b/src/main/java/taintedmagic/client/handler/ClientHandler.java @@ -35,18 +35,18 @@ public class ClientHandler @SubscribeEvent public void onPlayerRender (RenderPlayerEvent.Specials.Post event) { - EntityPlayer p = event.entityPlayer; - if (p.getActivePotionEffect(Potion.invisibility) != null) return; - - ItemStack[] inv = p.inventory.mainInventory; + EntityPlayer player = event.entityPlayer; + if (player.getActivePotionEffect(Potion.invisibility) != null) return; + + ItemStack[] inv = player.inventory.mainInventory; List rendering = new ArrayList(); for (int i = 0; i < 36; i++) { - ItemStack s = inv[i]; - if (s != null && s.getItem() instanceof IRenderInventoryItem && !rendering.contains(s.getItem())) + ItemStack stack = inv[i]; + if (stack != null && stack.getItem() instanceof IRenderInventoryItem && !rendering.contains(stack.getItem())) { - ((IRenderInventoryItem) s.getItem()).render(p, s, event.partialRenderTick); - rendering.add(s.getItem()); + ((IRenderInventoryItem) stack.getItem()).render(player, stack, event.partialRenderTick); + rendering.add(stack.getItem()); } if (i == 36) rendering.clear(); } diff --git a/src/main/java/taintedmagic/client/handler/HUDHandler.java b/src/main/java/taintedmagic/client/handler/HUDHandler.java index 2640d29..c908d79 100644 --- a/src/main/java/taintedmagic/client/handler/HUDHandler.java +++ b/src/main/java/taintedmagic/client/handler/HUDHandler.java @@ -12,7 +12,6 @@ import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.MathHelper; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; @@ -22,91 +21,94 @@ import taintedmagic.common.TaintedMagic; @SideOnly (Side.CLIENT) public class HUDHandler { - @SubscribeEvent - public void renderGameOverlayEvent (RenderGameOverlayEvent.Post event) - { - if (event.type == ElementType.ALL) - { - renderHeldItemHUD(event.partialTicks); - renderString(); - } - } + @SubscribeEvent + public void renderGameOverlayEvent (RenderGameOverlayEvent.Post event) + { + if (event.type == ElementType.ALL) + { + renderHeldItemHUD(event.partialTicks); + renderString(); + } + } - private static float ticksEquipped = 0.0F; - private static ItemStack s = null; - private static ItemStack last = null; + private static float ticksEquipped = 0.0F; + private static ItemStack stack = null; + private static ItemStack last = null; - private void renderHeldItemHUD (float pt) - { - EntityPlayer p = TaintedMagic.proxy.getClientPlayer(); - Minecraft mc = Minecraft.getMinecraft(); - ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); + private void renderHeldItemHUD (float partialTicks) + { + EntityPlayer player = TaintedMagic.proxy.getClientPlayer(); + Minecraft mc = Minecraft.getMinecraft(); + ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - if (s != null && s.getItem() instanceof IHeldItemHUD) last = s.copy(); - s = p.getCurrentEquippedItem(); + if (stack != null && stack.getItem() instanceof IHeldItemHUD) last = stack.copy(); + stack = player.getCurrentEquippedItem(); - boolean b = false; - if (s != null && s.getItem() instanceof IHeldItemHUD) b = true; - else b = false; + boolean b = false; + if (stack != null && stack.getItem() instanceof IHeldItemHUD) b = true; + else b = false; - float time = 30.0F; - if (b) ticksEquipped = Math.min(time, ticksEquipped + pt); - else ticksEquipped = Math.max(0F, ticksEquipped - pt); + float time = 30.0F; + if (b) ticksEquipped = Math.min(time, ticksEquipped + partialTicks); + else ticksEquipped = Math.max(0F, ticksEquipped - partialTicks); - float fract = ticksEquipped / time; + float fract = ticksEquipped / time; - if (b) ((IHeldItemHUD) s.getItem()).renderHUD(res, p, s, pt, fract); - else if (!b && ticksEquipped != 0) ((IHeldItemHUD) last.getItem()).renderHUD(res, p, last, pt, fract); - } + if (b) ((IHeldItemHUD) stack.getItem()).renderHUD(res, player, stack, partialTicks, fract); + else if (!b && ticksEquipped != 0) ((IHeldItemHUD) last.getItem()).renderHUD(res, player, last, partialTicks, fract); + } - private static String currentStr; - private static int start; - private static int ticks; - private static boolean gay; + private static String currentStr; + private static int start; + private static int ticks; + private static boolean gay; - public static void displayStringRainbow (String str, int display) - { - } + /** + * Displays text above the health bar for a specified duration. + * + * @param str The string to display. + * @param duration The duration to display it for (in ticks). + * @param rainbow Setting this to true makes things absolutely fabulous. + */ + public static void displayString (String str, int duration, boolean rainbow) + { + currentStr = str; + ticks = start = duration; + gay = rainbow; + } - public static void displayString (String str, int duration, boolean rainbow) - { - currentStr = str; - ticks = start = duration; - gay = rainbow; - } + public static void updateTicks () + { + if (ticks > 0) ticks--; + } - public static void updateTicks () - { - if (ticks > 0) ticks--; - } + private void renderString () + { + if (ticks > 0 && !MathHelper.stringNullOrLengthZero(currentStr)) + { + Minecraft mc = Minecraft.getMinecraft(); + ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); + int x = res.getScaledWidth(); + int y = res.getScaledHeight(); + FontRenderer font = mc.fontRenderer; - private void renderString () - { - if (ticks > 0 && !MathHelper.stringNullOrLengthZero(currentStr)) - { - Minecraft mc = Minecraft.getMinecraft(); - ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - int x = res.getScaledWidth(); - int y = res.getScaledHeight(); - FontRenderer font = mc.fontRenderer; + int startX = (x - font.getStringWidth(currentStr)) / 2; + int startY = y - 72; - int startX = (x - font.getStringWidth(currentStr)) / 2; - int startY = y - 72; + int opacity = ticks > ((float) start * 0.25F) ? 255 : (int) (255F * ((float) ticks / ((float) start * 0.25F))); + if (opacity < 5) opacity = 0; - int opacity = ticks > ((float) start * 0.25F) ? 255 : (int) (255F * ((float) ticks / ((float) start * 0.25F))); - if (opacity < 5) opacity = 0; + int rgb = Color.HSBtoRGB( ((float) (start - ticks) / (float) start), 1.0F, 1.0F); - int rgb = Color.HSBtoRGB( ((float) (start - ticks) / (float) start), 1.0F, 1.0F); - - if (opacity > 0) - { - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - font.drawStringWithShadow(currentStr, startX, startY, (gay ? rgb : 0xFFFFFF) + (opacity << 24)); - GL11.glDisable(GL11.GL_BLEND); - GL11.glPopMatrix(); - } - } - } + if (opacity > 0) + { + GL11.glPushMatrix(); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + font.drawStringWithShadow(currentStr, startX, startY, (gay ? rgb : 0xFFFFFF) + (opacity << 24)); + GL11.glDisable(GL11.GL_BLEND); + GL11.glPopMatrix(); + } + } + } } diff --git a/src/main/java/taintedmagic/client/model/ModelKatana.java b/src/main/java/taintedmagic/client/model/ModelKatana.java index e80040f..1307ca4 100644 --- a/src/main/java/taintedmagic/client/model/ModelKatana.java +++ b/src/main/java/taintedmagic/client/model/ModelKatana.java @@ -4,46 +4,46 @@ import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; /** - * katana - wiiv Created using Tabula 4.1.1 + * Katana model - created by using Tabula 4.1.1 */ public class ModelKatana extends ModelBase { - public ModelRenderer blade; - public ModelRenderer grip1; - public ModelRenderer grip2; + public ModelRenderer blade; + public ModelRenderer grip1; + public ModelRenderer grip2; - public ModelKatana () - { - this.textureWidth = 32; - this.textureHeight = 64; - - this.grip2 = new ModelRenderer(this, 22, 0); - this.grip2.setRotationPoint(0.0F, 0.0F, 0.0F); - this.grip2.addBox(-1.0F, -12.0F, -1.5F, 2, 12, 3, 0.0F); - - this.blade = new ModelRenderer(this, 0, 0); - this.blade.setRotationPoint(0.0F, -40.0F, 0.0F); - this.blade.addBox(-0.5F, 0.0F, -2.0F, 1, 48, 4, -0.75F); - - this.grip1 = new ModelRenderer(this, 0, 52); - this.grip1.setRotationPoint(0.0F, -40.0F, 0.0F); - this.grip1.addBox(-2.5F, 0.0F, -3.5F, 5, 1, 7, 0.0F); - this.grip1.addChild(this.grip2); - } + public ModelKatana () + { + this.textureWidth = 32; + this.textureHeight = 64; - public void render (float size) - { - this.blade.render(size); - this.grip1.render(size); - } + this.grip2 = new ModelRenderer(this, 22, 0); + this.grip2.setRotationPoint(0.0F, 0.0F, 0.0F); + this.grip2.addBox(-1.0F, -12.0F, -1.5F, 2, 12, 3, 0.0F); - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - private void setRotation (ModelRenderer m, float x, float y, float z) - { - m.rotateAngleX = x; - m.rotateAngleY = y; - m.rotateAngleZ = z; - } + this.blade = new ModelRenderer(this, 0, 0); + this.blade.setRotationPoint(0.0F, -40.0F, 0.0F); + this.blade.addBox(-0.5F, 0.0F, -2.0F, 1, 48, 4, -0.75F); + + this.grip1 = new ModelRenderer(this, 0, 52); + this.grip1.setRotationPoint(0.0F, -40.0F, 0.0F); + this.grip1.addBox(-2.5F, 0.0F, -3.5F, 5, 1, 7, 0.0F); + this.grip1.addChild(this.grip2); + } + + public void render (float size) + { + this.blade.render(size); + this.grip1.render(size); + } + + /** + * This is a helper function from Tabula to set the rotation of model parts + */ + private void setRotation (ModelRenderer m, float x, float y, float z) + { + m.rotateAngleX = x; + m.rotateAngleY = y; + m.rotateAngleZ = z; + } } diff --git a/src/main/java/taintedmagic/client/model/ModelSaya.java b/src/main/java/taintedmagic/client/model/ModelSaya.java index cfcd7d3..02dd69e 100644 --- a/src/main/java/taintedmagic/client/model/ModelSaya.java +++ b/src/main/java/taintedmagic/client/model/ModelSaya.java @@ -4,34 +4,34 @@ import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; /** - * katana - wiiv Created using Tabula 4.1.1 + * Saya model - created by using Tabula 4.1.1 */ public class ModelSaya extends ModelBase { - public ModelRenderer saya; + public ModelRenderer saya; - public ModelSaya () - { - this.textureWidth = 32; - this.textureHeight = 64; - - this.saya = new ModelRenderer(this, 10, 0); - this.saya.setRotationPoint(0.0F, -40.0F, 0.0F); - this.saya.addBox(-1.0F, 0.5F, -2.0F, 2, 48, 4, 0.0F); - } + public ModelSaya () + { + this.textureWidth = 32; + this.textureHeight = 64; - public void render (float size) - { - this.saya.render(size); - } + this.saya = new ModelRenderer(this, 10, 0); + this.saya.setRotationPoint(0.0F, -40.0F, 0.0F); + this.saya.addBox(-1.0F, 0.5F, -2.0F, 2, 48, 4, 0.0F); + } - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotation (ModelRenderer m, float x, float y, float z) - { - m.rotateAngleX = x; - m.rotateAngleY = y; - m.rotateAngleZ = z; - } + public void render (float size) + { + this.saya.render(size); + } + + /** + * This is a helper function from Tabula to set the rotation of model parts + */ + public void setRotation (ModelRenderer m, float x, float y, float z) + { + m.rotateAngleX = x; + m.rotateAngleY = y; + m.rotateAngleZ = z; + } } diff --git a/src/main/java/taintedmagic/client/renderer/RenderEntityDiffusion.java b/src/main/java/taintedmagic/client/renderer/RenderEntityDiffusion.java index 9ed00a8..0d910f4 100644 --- a/src/main/java/taintedmagic/client/renderer/RenderEntityDiffusion.java +++ b/src/main/java/taintedmagic/client/renderer/RenderEntityDiffusion.java @@ -12,64 +12,64 @@ import thaumcraft.client.lib.UtilsFX; public class RenderEntityDiffusion extends Render { - public void render (EntityDiffusion e, double x, double y, double z, float f, float pT) - { - Tessellator t = Tessellator.instance; + @Override + public void doRender (Entity entity, double x, double y, double z, float f, float partialTicks) + { + render((EntityDiffusion) entity, x, y, z, f, partialTicks); + } - GL11.glPushMatrix(); + public void render (EntityDiffusion entity, double x, double y, double z, float f, float partialTicks) + { + Tessellator t = Tessellator.instance; - GL11.glTranslated(x, y, z); + GL11.glPushMatrix(); - float color = 0.1F; - float alpha = (20.0F - (float) e.ticksExisted) / 40.0F; + GL11.glTranslated(x, y, z); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + float color = 0.1F; + float alpha = (20.0F - (float) entity.ticksExisted) / 40.0F; - UtilsFX.bindTexture(ParticleEngine.particleTexture); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - float f2 = e.ticksExisted % 13 / 16.0F; - float f3 = f2 + 0.0624375F; - float f4 = 0.1875F; - float f5 = f4 + 0.0624375F; - float f6 = 1.0F; - float f7 = 0.5F; - float f8 = 0.5F; + UtilsFX.bindTexture(ParticleEngine.particleTexture); - GL11.glColor4f(color, color, color, alpha); + float f2 = entity.ticksExisted % 13 / 16.0F; + float f3 = f2 + 0.0624375F; + float f4 = 0.1875F; + float f5 = f4 + 0.0624375F; + float f6 = 1.0F; + float f7 = 0.5F; + float f8 = 0.5F; - GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + GL11.glColor4f(color, color, color, alpha); - float s = 0.5F; - GL11.glScalef(s, s, s); + GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); - t.startDrawingQuads(); + float s = 0.5F; + GL11.glScalef(s, s, s); - t.setNormal(0.0F, 1.0F, 0.0F); - t.setColorRGBA_F(color, color, color, alpha); + t.startDrawingQuads(); - t.addVertexWithUV(0.0F - f7, 0.0F - f8, 0.0D, f2, f5); - t.addVertexWithUV(f6 - f7, 0.0F - f8, 0.0D, f3, f5); - t.addVertexWithUV(f6 - f7, 1.0F - f8, 0.0D, f3, f4); - t.addVertexWithUV(0.0F - f7, 1.0F - f8, 0.0D, f2, f4); + t.setNormal(0.0F, 1.0F, 0.0F); + t.setColorRGBA_F(color, color, color, alpha); - t.draw(); + t.addVertexWithUV(0.0F - f7, 0.0F - f8, 0.0D, f2, f5); + t.addVertexWithUV(f6 - f7, 0.0F - f8, 0.0D, f3, f5); + t.addVertexWithUV(f6 - f7, 1.0F - f8, 0.0D, f3, f4); + t.addVertexWithUV(0.0F - f7, 1.0F - f8, 0.0D, f2, f4); - GL11.glDisable(GL11.GL_BLEND); + t.draw(); - GL11.glPopMatrix(); - } + GL11.glDisable(GL11.GL_BLEND); - @Override - public void doRender (Entity e, double x, double y, double z, float f, float pT) - { - render((EntityDiffusion) e, x, y, z, f, pT); - } + GL11.glPopMatrix(); + } - @Override - protected ResourceLocation getEntityTexture (Entity e) - { - return null; - } + @Override + protected ResourceLocation getEntityTexture (Entity entity) + { + return null; + } } diff --git a/src/main/java/taintedmagic/client/renderer/RenderEntityHomingShard.java b/src/main/java/taintedmagic/client/renderer/RenderEntityHomingShard.java index 2bbb68a..6c5d347 100644 --- a/src/main/java/taintedmagic/client/renderer/RenderEntityHomingShard.java +++ b/src/main/java/taintedmagic/client/renderer/RenderEntityHomingShard.java @@ -13,83 +13,85 @@ import thaumcraft.client.fx.ParticleEngine; import thaumcraft.client.lib.UtilsFX; /** - * this class is based off of RenderHomingShard.class created by as - * part of Thaumcraft 5 + * This class is based off of RenderHomingShard.class created by as part of Thaumcraft 5. */ public class RenderEntityHomingShard extends Render { - public RenderEntityHomingShard () - { - super(); - this.shadowSize = 0.0F; - } + public RenderEntityHomingShard () + { + super(); + this.shadowSize = 0.0F; + } - public void renderEntityAt (EntityHomingShard e, double x, double y, double z, float f, float pT) - { - Tessellator t = Tessellator.instance; + @Override + public void doRender (Entity entity, double x, double y, double z, float f, float partialTicks) + { + render((EntityHomingShard) entity, x, y, z, f, partialTicks); + } - GL11.glPushMatrix(); - - GL11.glDepthMask(false); - - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + public void render (EntityHomingShard entity, double x, double y, double z, float f, float partialTicks) + { + Tessellator t = Tessellator.instance; - UtilsFX.bindTexture(ParticleEngine.particleTexture); + GL11.glPushMatrix(); - float f2 = (8 + e.ticksExisted % 8) / 16.0F; - float f3 = f2 + 0.0625F; - float f4 = 0.25F; - float f5 = f4 + 0.0625F; + GL11.glDepthMask(false); - float f6 = 1.0F; - float f7 = 0.5F; - float f8 = 0.5F; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - float red = 0.405F; - float green = 0.075F; - float blue = 0.525F; - float alpha = 1.0F; + UtilsFX.bindTexture(ParticleEngine.particleTexture); - GL11.glColor4f(red, green, blue, alpha); + float f2 = (8 + entity.ticksExisted % 8) / 16.0F; + float f3 = f2 + 0.0625F; + float f4 = 0.25F; + float f5 = f4 + 0.0625F; - GL11.glPushMatrix(); - - GL11.glTranslated(x, y, z); - - GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); - GL11.glScalef(0.4F + 0.1F * e.getStrength(), 0.4F + 0.1F * e.getStrength(), 0.4F + 0.1F * e.getStrength()); + float f6 = 1.0F; + float f7 = 0.5F; + float f8 = 0.5F; - t.startDrawingQuads(); + float red = 0.405F; + float green = 0.075F; + float blue = 0.525F; + float alpha = 1.0F; - t.setColorRGBA_F(red, green, blue, alpha); - t.setNormal(0.0F, 1.0F, 0.0F); - t.setBrightness(240); + GL11.glColor4f(red, green, blue, alpha); - t.addVertexWithUV(-f7, -f8, 0.0D, f2, f5); - t.addVertexWithUV(f6 - f7, -f8, 0.0D, f3, f5); - t.addVertexWithUV(f6 - f7, 1.0F - f8, 0.0D, f3, f4); - t.addVertexWithUV(-f7, 1.0F - f8, 0.0D, f2, f4); + GL11.glPushMatrix(); - t.draw(); + GL11.glTranslated(x, y, z); - GL11.glPopMatrix(); + GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + GL11.glScalef(0.4F + 0.1F * entity.getStrength(), 0.4F + 0.1F * entity.getStrength(), + 0.4F + 0.1F * entity.getStrength()); - GL11.glDisable(GL11.GL_BLEND); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - GL11.glDepthMask(true); + t.startDrawingQuads(); - GL11.glPopMatrix(); - } + t.setColorRGBA_F(red, green, blue, alpha); + t.setNormal(0.0F, 1.0F, 0.0F); + t.setBrightness(240); - public void doRender (Entity e, double x, double y, double z, float f, float pT) - { - renderEntityAt((EntityHomingShard) e, x, y, z, f, pT); - } + t.addVertexWithUV(-f7, -f8, 0.0D, f2, f5); + t.addVertexWithUV(f6 - f7, -f8, 0.0D, f3, f5); + t.addVertexWithUV(f6 - f7, 1.0F - f8, 0.0D, f3, f4); + t.addVertexWithUV(-f7, 1.0F - f8, 0.0D, f2, f4); - protected ResourceLocation getEntityTexture (Entity e) - { - return TextureMap.locationBlocksTexture; - } + t.draw(); + + GL11.glPopMatrix(); + + GL11.glDisable(GL11.GL_BLEND); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glDepthMask(true); + + GL11.glPopMatrix(); + } + + @Override + protected ResourceLocation getEntityTexture (Entity entity) + { + return TextureMap.locationBlocksTexture; + } } diff --git a/src/main/java/taintedmagic/client/renderer/RenderItemKatana.java b/src/main/java/taintedmagic/client/renderer/RenderItemKatana.java index 8b52300..f93138b 100644 --- a/src/main/java/taintedmagic/client/renderer/RenderItemKatana.java +++ b/src/main/java/taintedmagic/client/renderer/RenderItemKatana.java @@ -18,37 +18,37 @@ import thaumcraft.client.lib.UtilsFX; public class RenderItemKatana implements IItemRenderer { @Override - public boolean handleRenderType (ItemStack s, ItemRenderType t) + public boolean handleRenderType (ItemStack stack, ItemRenderType type) { return true; } @Override - public boolean shouldUseRenderHelper (ItemRenderType t, ItemStack s, ItemRendererHelper h) + public boolean shouldUseRenderHelper (ItemRenderType type, ItemStack stack, ItemRendererHelper helper) { return true; } @Override - public void renderItem (ItemRenderType t, ItemStack s, Object... data) + public void renderItem (ItemRenderType type, ItemStack stack, Object... data) { - EntityPlayer p = TaintedMagic.proxy.getClientPlayer(); + EntityPlayer player = TaintedMagic.proxy.getClientPlayer(); GL11.glPushMatrix(); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glScalef(1.4F, 1.4F, 1.4F); - if ( (p.getHeldItem() == null || p.getHeldItem() != s) && t != ItemRenderType.EQUIPPED) + if ( (player.getHeldItem() == null || player.getHeldItem() != stack) && type != ItemRenderType.EQUIPPED) { GL11.glPushMatrix(); - if (t == ItemRenderType.ENTITY) + if (type == ItemRenderType.ENTITY) { GL11.glScalef(0.5F, 0.5F, 0.5F); GL11.glTranslatef(0F, 0.5F, 0F); GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F); } - else if (t == ItemRenderType.INVENTORY) + else if (type == ItemRenderType.INVENTORY) { GL11.glScalef(0.4F, 0.4F, 0.4F); GL11.glRotatef(-65, 1.0F, 0.0F, 0.0F); @@ -60,24 +60,24 @@ public class RenderItemKatana implements IItemRenderer GL11.glTranslatef(0.0F, -0.7F, 0.0F); } - UtilsFX.bindTexture(ItemKatana.getTexture(s)); - ItemKatana.saya.render(0.0625F); + UtilsFX.bindTexture(ItemKatana.getTexture(stack)); + ItemKatana.SAYA.render(0.0625F); GL11.glPopMatrix(); } GL11.glPushMatrix(); - if (t == ItemRenderType.ENTITY) + if (type == ItemRenderType.ENTITY) { GL11.glScalef(0.5F, 0.5F, 0.5F); GL11.glTranslatef(0F, 0.5F, 0F); GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F); } - else if (t == ItemRenderType.EQUIPPED_FIRST_PERSON) + else if (type == ItemRenderType.EQUIPPED_FIRST_PERSON) { - if (p.isUsingItem()) + if (player.isUsingItem()) { GL11.glTranslatef(5.0F, 1.0F, -0.2F); GL11.glRotatef(155.0F, 0.0F, 1.0F, 0.0F); @@ -89,7 +89,7 @@ public class RenderItemKatana implements IItemRenderer GL11.glRotatef(-10F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-10F, 0.0F, 0.0F, 1.0F); } - else if (t == ItemRenderType.INVENTORY) + else if (type == ItemRenderType.INVENTORY) { GL11.glScalef(0.4F, 0.4F, 0.4F); GL11.glRotatef(-65, 1.0F, 0.0F, 0.0F); @@ -104,12 +104,12 @@ public class RenderItemKatana implements IItemRenderer GL11.glTranslatef(0.0F, 2F, 0.65F); } - UtilsFX.bindTexture(ItemKatana.getTexture(s)); + UtilsFX.bindTexture(ItemKatana.getTexture(stack)); - ItemKatana.katana.render(0.0625F); + ItemKatana.KATANA.render(0.0625F); // Runes - if (ItemKatana.hasAnyInscription(s)) + if (ItemKatana.hasAnyInscription(stack)) { GL11.glPushMatrix(); int j = 200; @@ -124,13 +124,13 @@ public class RenderItemKatana implements IItemRenderer for (int a = 0; a < 14; a++) { int rune = (a * 3) % 16; - drawRune(-1.65D + a * 0.14D, 0D, -0.03D, rune, p); + drawRune(-1.65D + a * 0.14D, 0D, -0.03D, rune, player); } GL11.glRotated(180.0D, 0.0D, 1.0D, 0.0D); for (int a = 0; a < 14; a++) { int rune = (a + 1 * 3) % 16; - drawRune(-1.65D + a * 0.14D, 0D, -0.03D, rune, p); + drawRune(-1.65D + a * 0.14D, 0D, -0.03D, rune, player); } GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glDisable(GL11.GL_BLEND); diff --git a/src/main/java/taintedmagic/common/CommonProxy.java b/src/main/java/taintedmagic/common/CommonProxy.java index b49b401..09c150b 100644 --- a/src/main/java/taintedmagic/common/CommonProxy.java +++ b/src/main/java/taintedmagic/common/CommonProxy.java @@ -1,7 +1,6 @@ package taintedmagic.common; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class CommonProxy diff --git a/src/main/java/taintedmagic/common/TMCreativeTab.java b/src/main/java/taintedmagic/common/TMCreativeTab.java new file mode 100644 index 0000000..ad7414d --- /dev/null +++ b/src/main/java/taintedmagic/common/TMCreativeTab.java @@ -0,0 +1,73 @@ +package taintedmagic.common; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagByte; +import taintedmagic.common.helper.TaintedMagicHelper; +import taintedmagic.common.lib.LibInfo; +import taintedmagic.common.registry.ItemRegistry; +import thaumcraft.common.config.ConfigItems; +import thaumcraft.common.items.wands.ItemWandCasting; + +public class TMCreativeTab extends CreativeTabs +{ + public List list = new ArrayList(); + + public TMCreativeTab () + { + super(LibInfo.MODID); + } + + @Override + public void displayAllReleventItems (List list) + { + super.displayAllReleventItems(list); + + ItemStack stack = new ItemStack(ConfigItems.itemWandCasting); + ItemWandCasting wand = (ItemWandCasting) stack.getItem(); + + wand.setCap(stack, ItemRegistry.WAND_CAP_SHADOWMETAL); + wand.setRod(stack, ItemRegistry.STAFF_ROD_WARPWOOD); + wand.storeAllVis(stack, TaintedMagicHelper.getPrimals(wand.getMaxVis(stack))); + + if (list != null) list.add(0, stack); + + ItemStack stack2 = stack.copy(); + ItemWandCasting wand2 = (ItemWandCasting) stack2.getItem(); + + wand2.setRod(stack2, ItemRegistry.WAND_ROD_WARPWOOD); + wand2.storeAllVis(stack2, TaintedMagicHelper.getPrimals(wand2.getMaxVis(stack2))); + + if (list != null) list.add(1, stack2); + + ItemStack stack3 = stack2.copy(); + ItemWandCasting wand3 = (ItemWandCasting) stack3.getItem(); + + stack3.setTagInfo("sceptre", new NBTTagByte((byte) 1)); + wand3.storeAllVis(stack3, TaintedMagicHelper.getPrimals(wand3.getMaxVis(stack3))); + + if (list != null) list.add(2, stack3); + } + + @Override + public ItemStack getIconItemStack () + { + ItemStack stack = new ItemStack(ConfigItems.itemWandCasting); + ItemWandCasting wand = (ItemWandCasting) stack.getItem(); + + wand.setCap(stack, ItemRegistry.WAND_CAP_SHADOWMETAL); + wand.setRod(stack, ItemRegistry.WAND_ROD_WARPWOOD); + + return stack; + } + + @Override + public Item getTabIconItem () + { + return null; + } +} diff --git a/src/main/java/taintedmagic/common/TaintedMagic.java b/src/main/java/taintedmagic/common/TaintedMagic.java index 2da4836..a2ffa11 100644 --- a/src/main/java/taintedmagic/common/TaintedMagic.java +++ b/src/main/java/taintedmagic/common/TaintedMagic.java @@ -19,80 +19,79 @@ import net.minecraftforge.common.util.EnumHelper; import taintedmagic.common.handler.ConfigHandler; import taintedmagic.common.handler.TMEventHandler; import taintedmagic.common.handler.UpdateHandler; -import taintedmagic.common.items.wand.foci.FocusUpgrades; +import taintedmagic.common.items.wand.foci.TMFocusUpgrades; import taintedmagic.common.lib.LibInfo; import taintedmagic.common.network.PacketHandler; import taintedmagic.common.registry.BlockRegistry; import taintedmagic.common.registry.ItemRegistry; -import taintedmagic.common.registry.TMEntityRegistry; import taintedmagic.common.registry.OreDictRegistry; import taintedmagic.common.registry.RecipeRegistry; import taintedmagic.common.registry.ResearchRegistry; +import taintedmagic.common.registry.TMEntityRegistry; @Mod (modid = LibInfo.MODID, name = LibInfo.NAME, version = LibInfo.VERSION, dependencies = LibInfo.DEPENDENCIES) public class TaintedMagic { - @Mod.Instance ("TaintedMagic") - public static TaintedMagic instance; + @Mod.Instance ("TaintedMagic") + public static TaintedMagic instance; - // Proxies - @SidedProxy (clientSide = "taintedmagic.client.ClientProxy", serverSide = "taintedmagic.common.CommonProxy") - public static CommonProxy proxy; + // Proxies + @SidedProxy (clientSide = "taintedmagic.client.ClientProxy", serverSide = "taintedmagic.common.CommonProxy") + public static CommonProxy proxy; - public static TMEventHandler taintedMagicEvents; - public static CreativeTabs tabTaintedMagic = new TaintedMagicCreativeTab(); - public static ConfigHandler configHandler; + // Tainted Magic creative tab + public static CreativeTabs tabTaintedMagic = new TMCreativeTab(); - public static final Logger log = LogManager.getLogger("TAINTEDMAGIC"); + // TM log + public static final Logger log = LogManager.getLogger("TAINTEDMAGIC"); - public static EnumRarity rarityCreation = EnumHelper.addRarity("CREATION", EnumChatFormatting.GOLD, "Creation"); + // Creation EnumRarity + public static EnumRarity rarityCreation = EnumHelper.addRarity("CREATION", EnumChatFormatting.GOLD, "Creation"); - // Pre init - @EventHandler - public static void preInit (FMLPreInitializationEvent event) - { - log.info("Please stand back... Pre-initializing Tainted Magic!"); + // Pre init + @EventHandler + public static void preInit (FMLPreInitializationEvent event) + { + log.info("...Pre-initializing Tainted Magic!"); - // Config - configHandler.config = new Configuration(event.getSuggestedConfigurationFile()); - configHandler.init(); + // Config + ConfigHandler.config = new Configuration(event.getSuggestedConfigurationFile()); + ConfigHandler.initConfig(); - proxy.registerClientHandlers(); + proxy.registerClientHandlers(); - PacketHandler.init(); - ItemRegistry.init(); - BlockRegistry.init(); - BlockRegistry.initTiles(); - TMEntityRegistry.init(); - RecipeRegistry.init(); - OreDictRegistry.init(); + PacketHandler.initPackets(); + ItemRegistry.initItems(); + BlockRegistry.initBlocks(); + BlockRegistry.initTiles(); + TMEntityRegistry.initEntities(); + RecipeRegistry.initRecipes(); + OreDictRegistry.initOreDict(); - if (configHandler.UPDATE_HANDLER) UpdateHandler.init(); - } + if (ConfigHandler.NOTIFY_UPDATE) UpdateHandler.checkForUpdate(); + } - // Init - @EventHandler - public static void init (FMLInitializationEvent event) - { - log.info("Things seem to be going smoothly... Initializing Tainted Magic!"); + // Init + @EventHandler + public static void init (FMLInitializationEvent event) + { + log.info("...Initializing Tainted Magic!"); - taintedMagicEvents = new TMEventHandler(); + MinecraftForge.EVENT_BUS.register(new TMEventHandler()); + FMLCommonHandler.instance().bus().register(new TMEventHandler()); + + proxy.registerRenderers(); + TMFocusUpgrades.initFocusUpgrades(); + } - MinecraftForge.EVENT_BUS.register(taintedMagicEvents); - FMLCommonHandler.instance().bus().register(taintedMagicEvents); + // Post init + @EventHandler + public static void postInit (FMLPostInitializationEvent event) + { + log.info("...Post-initializing Tainted Magic!"); - proxy.registerRenderers(); - FocusUpgrades.init(); - } + ResearchRegistry.initResearch(); - // Post init - @EventHandler - public static void postInit (FMLPostInitializationEvent event) - { - log.info("Almost done... Post-initializing Tainted Magic!"); - - ResearchRegistry.initResearch(); - - log.info("Phew! Tainted Magic has finished loading, enjoy!"); - } + log.info("...Loading complete, enjoy!"); + } } diff --git a/src/main/java/taintedmagic/common/TaintedMagicCreativeTab.java b/src/main/java/taintedmagic/common/TaintedMagicCreativeTab.java deleted file mode 100644 index 3ae2ddf..0000000 --- a/src/main/java/taintedmagic/common/TaintedMagicCreativeTab.java +++ /dev/null @@ -1,74 +0,0 @@ -package taintedmagic.common; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagByte; -import taintedmagic.common.helper.TaintedMagicHelper; -import taintedmagic.common.lib.LibInfo; -import taintedmagic.common.registry.ItemRegistry; -import thaumcraft.common.config.ConfigItems; -import thaumcraft.common.items.wands.ItemWandCasting; - -public class TaintedMagicCreativeTab extends CreativeTabs -{ - public List list = new ArrayList(); - - public TaintedMagicCreativeTab () - { - super(LibInfo.MODID); - } - - @Override - public void displayAllReleventItems (List l) - { - super.displayAllReleventItems(l); - - ItemStack s = new ItemStack(ConfigItems.itemWandCasting); - ItemWandCasting wand = (ItemWandCasting) s.getItem(); - - wand.setCap(s, ItemRegistry.WAND_CAP_SHADOWMETAL); - wand.setRod(s, ItemRegistry.STAFF_ROD_WARPWOOD); - wand.storeAllVis(s, TaintedMagicHelper.getPrimals(wand.getMaxVis(s))); - - if (l != null) l.add(0, s); - - ItemStack s2 = s.copy(); - ItemWandCasting wand2 = (ItemWandCasting) s2.getItem(); - - - wand2.setRod(s2, ItemRegistry.WAND_ROD_WARPWOOD); - wand2.storeAllVis(s2, TaintedMagicHelper.getPrimals(wand2.getMaxVis(s2))); - - if (l != null) l.add(1, s2); - - ItemStack s3 = s2.copy(); - ItemWandCasting wand3 = (ItemWandCasting) s3.getItem(); - - s3.setTagInfo("sceptre", new NBTTagByte((byte) 1)); - wand3.storeAllVis(s3, TaintedMagicHelper.getPrimals(wand3.getMaxVis(s3))); - - if (l != null) l.add(2, s3); - } - - @Override - public ItemStack getIconItemStack () - { - ItemStack wand = new ItemStack(ConfigItems.itemWandCasting); - ItemWandCasting wandCasting = (ItemWandCasting) wand.getItem(); - - wandCasting.setCap(wand, ItemRegistry.WAND_CAP_SHADOWMETAL); - wandCasting.setRod(wand, ItemRegistry.WAND_ROD_WARPWOOD); - - return wand; - } - - @Override - public Item getTabIconItem () - { - return null; - } -} diff --git a/src/main/java/taintedmagic/common/blocks/BlockLumos.java b/src/main/java/taintedmagic/common/blocks/BlockLumos.java index 7578a6e..1ac5c44 100644 --- a/src/main/java/taintedmagic/common/blocks/BlockLumos.java +++ b/src/main/java/taintedmagic/common/blocks/BlockLumos.java @@ -19,108 +19,109 @@ import thaumcraft.common.config.Config; public class BlockLumos extends Block implements ITileEntityProvider { - public BlockLumos () - { - super(Config.airyMaterial); - this.setStepSound(new Block.SoundType("stone", -1, -1)); - this.setBlockName("BlockLumos"); - this.setTickRandomly(false); - this.setLightLevel(1.0F); - this.setBlockTextureName("thaumcraft:blank"); - } + public BlockLumos () + { + super(Config.airyMaterial); + this.setStepSound(new Block.SoundType("stone", -1, -1)); + this.setBlockName("BlockLumos"); + this.setTickRandomly(false); + this.setLightLevel(1.0F); + this.setBlockTextureName("thaumcraft:blank"); + } - @Override - public void onBlockDestroyedByPlayer (World w, int x, int y, int z, int meta) - { - super.onBlockDestroyedByPlayer(w, x, y, z, meta); + @Override + public void onBlockDestroyedByPlayer (World world, int x, int y, int z, int meta) + { + super.onBlockDestroyedByPlayer(world, x, y, z, meta); - w.playSound(x, y, z, "thaumcraft:ice", 0.3F, 1.1F + w.rand.nextFloat() * 0.1F, true); + world.playSound(x, y, z, "thaumcraft:ice", 0.3F, 1.1F + world.rand.nextFloat() * 0.1F, true); - for (int a = 0; a < 9; a++) - if (w.isRemote) spawnBreakParticles(w, x, y, z); - } + for (int i = 0; i < 9; i++) + if (world.isRemote) spawnBreakParticles(world, x, y, z); + } - @SideOnly (Side.CLIENT) - void spawnBreakParticles (World w, double x, double y, double z) - { - FXSparkle fx = new FXSparkle(w, x + w.rand.nextFloat(), y + w.rand.nextFloat(), z + w.rand.nextFloat(), 1.75F, 6, 3 + w.rand.nextInt(3)); - fx.motionX += w.rand.nextGaussian() * 0.1D; - fx.motionY += w.rand.nextGaussian() * 0.1D; - fx.motionZ += w.rand.nextGaussian() * 0.1D; - fx.setGravity(0.5F); - ParticleEngine.instance.addEffect(w, fx); - } + @SideOnly (Side.CLIENT) + void spawnBreakParticles (World world, double x, double y, double z) + { + FXSparkle fx = new FXSparkle(world, x + world.rand.nextFloat(), y + world.rand.nextFloat(), z + world.rand.nextFloat(), + 1.75F, 6, 3 + world.rand.nextInt(3)); + fx.motionX += world.rand.nextGaussian() * 0.1D; + fx.motionY += world.rand.nextGaussian() * 0.1D; + fx.motionZ += world.rand.nextGaussian() * 0.1D; + fx.setGravity(0.5F); + ParticleEngine.instance.addEffect(world, fx); + } - @Override - public void setBlockBoundsBasedOnState (IBlockAccess w, int x, int y, int z) - { - int meta = w.getBlockMetadata(x, y, z); - if (meta == 0) setBlockBounds(0.3F, 0.3F, 0.3F, 0.7F, 0.7F, 0.7F); - else setBlockBounds(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F); - } + @Override + public void setBlockBoundsBasedOnState (IBlockAccess world, int x, int y, int z) + { + int meta = world.getBlockMetadata(x, y, z); + if (meta == 0) setBlockBounds(0.3F, 0.3F, 0.3F, 0.7F, 0.7F, 0.7F); + else setBlockBounds(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F); + } - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool (World w, int x, int y, int z) - { - return null; - } + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool (World world, int x, int y, int z) + { + return null; + } - @Override - public int getRenderType () - { - return -1; - } + @Override + public int getRenderType () + { + return -1; + } - @Override - public boolean isSideSolid (IBlockAccess w, int x, int y, int z, ForgeDirection side) - { - return false; - } + @Override + public boolean isSideSolid (IBlockAccess world, int x, int y, int z, ForgeDirection side) + { + return false; + } - @Override - public boolean isBlockNormalCube () - { - return false; - } + @Override + public boolean isBlockNormalCube () + { + return false; + } - @Override - public boolean isOpaqueCube () - { - return false; - } + @Override + public boolean isOpaqueCube () + { + return false; + } - @Override - public boolean isReplaceable (IBlockAccess w, int x, int y, int z) - { - return true; - } + @Override + public boolean isReplaceable (IBlockAccess world, int x, int y, int z) + { + return true; + } - @Override - public boolean canBeReplacedByLeaves (IBlockAccess w, int x, int y, int z) - { - return true; - } + @Override + public boolean canBeReplacedByLeaves (IBlockAccess world, int x, int y, int z) + { + return true; + } - public boolean renderAsNormalBlock () - { - return false; - } + public boolean renderAsNormalBlock () + { + return false; + } - @Override - public Item getItemDropped (int a, Random r, int b) - { - return null; - } + @Override + public Item getItemDropped (int a, Random random, int b) + { + return null; + } - @Override - public Item getItem (World w, int x, int y, int z) - { - return null; - } + @Override + public Item getItem (World world, int x, int y, int z) + { + return null; + } - @Override - public TileEntity createNewTileEntity (World w, int m) - { - return new TileLumos(); - } + @Override + public TileEntity createNewTileEntity (World world, int m) + { + return new TileLumos(); + } } \ No newline at end of file diff --git a/src/main/java/taintedmagic/common/blocks/BlockNightshadeBush.java b/src/main/java/taintedmagic/common/blocks/BlockNightshadeBush.java index 746aa7d..f76e818 100644 --- a/src/main/java/taintedmagic/common/blocks/BlockNightshadeBush.java +++ b/src/main/java/taintedmagic/common/blocks/BlockNightshadeBush.java @@ -18,43 +18,49 @@ import taintedmagic.common.registry.ItemRegistry; public class BlockNightshadeBush extends BlockBush { - public BlockNightshadeBush () - { - super(Material.plants); - this.setBlockName("BlockNightshadeBush"); - this.setBlockTextureName("taintedmagic:BlockNightshadeBush"); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setStepSound(soundTypeGrass); - } + public BlockNightshadeBush () + { + super(Material.plants); + this.setBlockName("BlockNightshadeBush"); + this.setBlockTextureName("taintedmagic:BlockNightshadeBush"); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setStepSound(soundTypeGrass); + } - public Item getItemDropped (int a, Random r, int b) - { - return ItemRegistry.ItemNightshadeBerries; - } + public Item getItemDropped (int a, Random random, int b) + { + return ItemRegistry.ItemNightshadeBerries; + } - public int quantityDropped (Random r) - { - return 1 + r.nextInt(3); - } + public int quantityDropped (Random random) + { + return 1 + random.nextInt(3); + } - public void onEntityCollidedWithBlock (World w, int x, int y, int z, Entity e) - { - super.onEntityCollidedWithBlock(w, x, y, z, e); + public void onEntityCollidedWithBlock (World world, int x, int y, int z, Entity entity) + { + super.onEntityCollidedWithBlock(world, x, y, z, entity); - if (e instanceof EntityLivingBase) - { - e.attackEntityFrom(new DamageSource("nightshade"), 1.0F); - ((EntityLivingBase) e).addPotionEffect(new PotionEffect(Potion.poison.id, 100, 0)); - } - } + if (entity instanceof EntityLivingBase) + { + entity.attackEntityFrom(new DamageSource("nightshade"), 1.0F); + try + { + ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.poison.id, 140, 0)); + } + catch (Exception e) + { + } + } + } - public int getFlammability (IBlockAccess w, int x, int y, int z, ForgeDirection face) - { - return 100; - } + public int getFlammability (IBlockAccess world, int x, int y, int z, ForgeDirection face) + { + return 100; + } - public int getFireSpreadSpeed (IBlockAccess w, int x, int y, int z, ForgeDirection face) - { - return 60; - } + public int getFireSpreadSpeed (IBlockAccess world, int x, int y, int z, ForgeDirection face) + { + return 60; + } } diff --git a/src/main/java/taintedmagic/common/blocks/BlockShadowOre.java b/src/main/java/taintedmagic/common/blocks/BlockShadowOre.java index 542f86d..6af72d0 100644 --- a/src/main/java/taintedmagic/common/blocks/BlockShadowOre.java +++ b/src/main/java/taintedmagic/common/blocks/BlockShadowOre.java @@ -6,12 +6,12 @@ import taintedmagic.common.TaintedMagic; public class BlockShadowOre extends Block { - public BlockShadowOre () - { - super(Material.rock); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setBlockTextureName("taintedmagic:BlockShadowOre"); - this.setBlockName("BlockShadowOre"); - this.setHardness(5.0F); - } + public BlockShadowOre () + { + super(Material.rock); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setBlockTextureName("taintedmagic:BlockShadowOre"); + this.setBlockName("BlockShadowOre"); + this.setHardness(5.0F); + } } diff --git a/src/main/java/taintedmagic/common/blocks/BlockShadowmetal.java b/src/main/java/taintedmagic/common/blocks/BlockShadowmetal.java index a7d6db5..b9d836f 100644 --- a/src/main/java/taintedmagic/common/blocks/BlockShadowmetal.java +++ b/src/main/java/taintedmagic/common/blocks/BlockShadowmetal.java @@ -18,7 +18,7 @@ public class BlockShadowmetal extends Block } @Override - public boolean isBeaconBase (IBlockAccess w, int x, int y, int z, int x2, int y2, int z2) + public boolean isBeaconBase (IBlockAccess world, int x, int y, int z, int x2, int y2, int z2) { return true; } diff --git a/src/main/java/taintedmagic/common/blocks/BlockWarpwoodLeaves.java b/src/main/java/taintedmagic/common/blocks/BlockWarpwoodLeaves.java index 3dd358f..1e3764c 100644 --- a/src/main/java/taintedmagic/common/blocks/BlockWarpwoodLeaves.java +++ b/src/main/java/taintedmagic/common/blocks/BlockWarpwoodLeaves.java @@ -20,268 +20,285 @@ import net.minecraftforge.common.IShearable; import net.minecraftforge.common.util.ForgeDirection; import taintedmagic.common.TaintedMagic; import taintedmagic.common.registry.BlockRegistry; -import thaumcraft.common.config.ConfigBlocks; public class BlockWarpwoodLeaves extends Block implements IShearable { - int[] adjacentTreeBlocks; - private IIcon opaqueIcon; - private IIcon transparentIcon; + int[] adjacentTreeBlocks; + private IIcon opaqueIcon; + private IIcon transparentIcon; - public BlockWarpwoodLeaves () - { - super(Material.leaves); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setLightOpacity(0); - this.setHardness(0.1F); - this.setStepSound(soundTypeGrass); - this.setBlockName("BlockWarpwoodLeaves"); - } + public BlockWarpwoodLeaves () + { + super(Material.leaves); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setLightOpacity(0); + this.setHardness(0.1F); + this.setStepSound(soundTypeGrass); + this.setBlockName("BlockWarpwoodLeaves"); + } - @Override - @SideOnly (Side.CLIENT) - public boolean shouldSideBeRendered (IBlockAccess w, int x, int y, int z, int s) - { - return !Blocks.leaves.isOpaqueCube() || super.shouldSideBeRendered(w, x, y, z, s); - } + @Override + @SideOnly (Side.CLIENT) + public boolean shouldSideBeRendered (IBlockAccess world, int x, int y, int z, int side) + { + return !Blocks.leaves.isOpaqueCube() || super.shouldSideBeRendered(world, x, y, z, side); + } - @Override - public boolean isOpaqueCube () - { - return Blocks.leaves.isOpaqueCube(); - } + @Override + public boolean isOpaqueCube () + { + return Blocks.leaves.isOpaqueCube(); + } - @Override - public IIcon getIcon (int side, int meta) - { - return !Blocks.leaves.isOpaqueCube() ? transparentIcon : opaqueIcon; - } + @Override + public IIcon getIcon (int side, int meta) + { + return !Blocks.leaves.isOpaqueCube() ? transparentIcon : opaqueIcon; + } - @Override - @SideOnly (Side.CLIENT) - public void registerBlockIcons (IIconRegister ir) - { - opaqueIcon = ir.registerIcon("taintedmagic:BlockWarpwoodLeaves_opaque"); - transparentIcon = ir.registerIcon("taintedmagic:BlockWarpwoodLeaves_transparent"); - } + @Override + @SideOnly (Side.CLIENT) + public void registerBlockIcons (IIconRegister ir) + { + opaqueIcon = ir.registerIcon("taintedmagic:BlockWarpwoodLeaves_opaque"); + transparentIcon = ir.registerIcon("taintedmagic:BlockWarpwoodLeaves_transparent"); + } - public void breakBlock (World w, int x, int y, int z, Block b, int i) - { - byte var7 = 1; - int var8 = var7 + 1; + public void breakBlock (World world, int x, int y, int z, Block block, int i) + { + byte var7 = 1; + int var8 = var7 + 1; - if (w.checkChunksExist(x - var8, y - var8, z - var8, x + var8, y + var8, z + var8)) - { - for (int var9 = -var7; var9 <= var7; var9++) - { - for (int var10 = -var7; var10 <= var7; var10++) - { - for (int var11 = -var7; var11 <= var7; var11++) - { - Block var12 = w.getBlock(x + var9, y + var10, z + var11); + if (world.checkChunksExist(x - var8, y - var8, z - var8, x + var8, y + var8, z + var8)) + { + for (int var9 = -var7; var9 <= var7; var9++) + { + for (int var10 = -var7; var10 <= var7; var10++) + { + for (int var11 = -var7; var11 <= var7; var11++) + { + Block var12 = world.getBlock(x + var9, y + var10, z + var11); - if (var12 == Blocks.air) continue; - var12.beginLeavesDecay(w, x + var9, y + var10, z + var11); - } - } - } - } - } + if (var12 == Blocks.air) continue; + var12.beginLeavesDecay(world, x + var9, y + var10, z + var11); + } + } + } + } + } - public void updateTick (World w, int x, int y, int z, Random r) - { - if (!w.isRemote) - { - int var6 = w.getBlockMetadata(x, y, z); + public void updateTick (World world, int x, int y, int z, Random random) + { + if (!world.isRemote) + { + int var6 = world.getBlockMetadata(x, y, z); - if ( ( (var6 & 0x8) != 0) && ( (var6 & 0x4) == 0)) - { - byte var7 = 4; - int var8 = var7 + 1; - byte var9 = 32; - int var10 = var9 * var9; - int var11 = var9 / 2; + if ( ( (var6 & 0x8) != 0) && ( (var6 & 0x4) == 0)) + { + byte var7 = 4; + int var8 = var7 + 1; + byte var9 = 32; + int var10 = var9 * var9; + int var11 = var9 / 2; - if (this.adjacentTreeBlocks == null) - { - this.adjacentTreeBlocks = new int[var9 * var9 * var9]; - } + if (this.adjacentTreeBlocks == null) + { + this.adjacentTreeBlocks = new int[var9 * var9 * var9]; + } - if (w.checkChunksExist(x - var8, y - var8, z - var8, x + var8, y + var8, z + var8)) - { - for (int var12 = -var7; var12 <= var7; var12++) - { - for (int var13 = -var7; var13 <= var7; var13++) - { - for (int var14 = -var7; var14 <= var7; var14++) - { - Block block = w.getBlock(x + var12, y + var13, z + var14); + if (world.checkChunksExist(x - var8, y - var8, z - var8, x + var8, y + var8, z + var8)) + { + for (int var12 = -var7; var12 <= var7; var12++) + { + for (int var13 = -var7; var13 <= var7; var13++) + { + for (int var14 = -var7; var14 <= var7; var14++) + { + Block block = world.getBlock(x + var12, y + var13, z + var14); - if ( (block != null) && (block.canSustainLeaves(w, x + var12, y + var13, z + var14))) - { - this.adjacentTreeBlocks[ ( (var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11)] = 0; - } - else if ( (block != null) && (block.isLeaves(w, x + var12, y + var13, z + var14))) - { - this.adjacentTreeBlocks[ ( (var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11)] = -2; - } - else - { - this.adjacentTreeBlocks[ ( (var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11)] = -1; - } - } - } - } - int var15 = 0; - for (int var12 = 1; var12 <= 4; var12++) - { - for (int var13 = -var7; var13 <= var7; var13++) - { - for (int var14 = -var7; var14 <= var7; var14++) - { - for (var15 = -var7; var15 <= var7; var15++) - { - if (this.adjacentTreeBlocks[ ( (var13 + var11) * var10 + (var14 + var11) * var9 + var15 + var11)] != var12 - 1) continue; - if (this.adjacentTreeBlocks[ ( (var13 + var11 - 1) * var10 + (var14 + var11) * var9 + var15 + var11)] == -2) - { - this.adjacentTreeBlocks[ ( (var13 + var11 - 1) * var10 + (var14 + var11) * var9 + var15 + var11)] = var12; - } + if ( (block != null) && (block.canSustainLeaves(world, x + var12, y + var13, z + var14))) + { + this.adjacentTreeBlocks[ ( (var12 + var11) * var10 + (var13 + var11) * var9 + var14 + + var11)] = 0; + } + else if ( (block != null) && (block.isLeaves(world, x + var12, y + var13, z + var14))) + { + this.adjacentTreeBlocks[ ( (var12 + var11) * var10 + (var13 + var11) * var9 + var14 + + var11)] = -2; + } + else + { + this.adjacentTreeBlocks[ ( (var12 + var11) * var10 + (var13 + var11) * var9 + var14 + + var11)] = -1; + } + } + } + } + int var15 = 0; + for (int var12 = 1; var12 <= 4; var12++) + { + for (int var13 = -var7; var13 <= var7; var13++) + { + for (int var14 = -var7; var14 <= var7; var14++) + { + for (var15 = -var7; var15 <= var7; var15++) + { + if (this.adjacentTreeBlocks[ ( (var13 + var11) * var10 + (var14 + var11) * var9 + var15 + + var11)] != var12 - 1) + continue; + if (this.adjacentTreeBlocks[ ( (var13 + var11 - 1) * var10 + (var14 + var11) * var9 + var15 + + var11)] == -2) + { + this.adjacentTreeBlocks[ ( (var13 + var11 - 1) * var10 + (var14 + var11) * var9 + var15 + + var11)] = var12; + } - if (this.adjacentTreeBlocks[ ( (var13 + var11 + 1) * var10 + (var14 + var11) * var9 + var15 + var11)] == -2) - { - this.adjacentTreeBlocks[ ( (var13 + var11 + 1) * var10 + (var14 + var11) * var9 + var15 + var11)] = var12; - } + if (this.adjacentTreeBlocks[ ( (var13 + var11 + 1) * var10 + (var14 + var11) * var9 + var15 + + var11)] == -2) + { + this.adjacentTreeBlocks[ ( (var13 + var11 + 1) * var10 + (var14 + var11) * var9 + var15 + + var11)] = var12; + } - if (this.adjacentTreeBlocks[ ( (var13 + var11) * var10 + (var14 + var11 - 1) * var9 + var15 + var11)] == -2) - { - this.adjacentTreeBlocks[ ( (var13 + var11) * var10 + (var14 + var11 - 1) * var9 + var15 + var11)] = var12; - } + if (this.adjacentTreeBlocks[ ( (var13 + var11) * var10 + (var14 + var11 - 1) * var9 + var15 + + var11)] == -2) + { + this.adjacentTreeBlocks[ ( (var13 + var11) * var10 + (var14 + var11 - 1) * var9 + var15 + + var11)] = var12; + } - if (this.adjacentTreeBlocks[ ( (var13 + var11) * var10 + (var14 + var11 + 1) * var9 + var15 + var11)] == -2) - { - this.adjacentTreeBlocks[ ( (var13 + var11) * var10 + (var14 + var11 + 1) * var9 + var15 + var11)] = var12; - } + if (this.adjacentTreeBlocks[ ( (var13 + var11) * var10 + (var14 + var11 + 1) * var9 + var15 + + var11)] == -2) + { + this.adjacentTreeBlocks[ ( (var13 + var11) * var10 + (var14 + var11 + 1) * var9 + var15 + + var11)] = var12; + } - if (this.adjacentTreeBlocks[ ( (var13 + var11) * var10 + (var14 + var11) * var9 + (var15 + var11 - 1))] == -2) - { - this.adjacentTreeBlocks[ ( (var13 + var11) * var10 + (var14 + var11) * var9 + (var15 + var11 - 1))] = var12; - } + if (this.adjacentTreeBlocks[ ( (var13 + var11) * var10 + (var14 + var11) * var9 + + (var15 + var11 - 1))] == -2) + { + this.adjacentTreeBlocks[ ( (var13 + var11) * var10 + (var14 + var11) * var9 + + (var15 + var11 - 1))] = var12; + } - if (this.adjacentTreeBlocks[ ( (var13 + var11) * var10 + (var14 + var11) * var9 + var15 + var11 + 1)] != -2) continue; - this.adjacentTreeBlocks[ ( (var13 + var11) * var10 + (var14 + var11) * var9 + var15 + var11 + 1)] = var12; - } - } - } - } - } + if (this.adjacentTreeBlocks[ ( (var13 + var11) * var10 + (var14 + var11) * var9 + var15 + + var11 + 1)] != -2) + continue; + this.adjacentTreeBlocks[ ( (var13 + var11) * var10 + (var14 + var11) * var9 + var15 + var11 + + 1)] = var12; + } + } + } + } + } - int var12 = this.adjacentTreeBlocks[ (var11 * var10 + var11 * var9 + var11)]; + int var12 = this.adjacentTreeBlocks[ (var11 * var10 + var11 * var9 + var11)]; - if (var12 >= 0) - { - w.setBlock(x, y, z, this, var6 & 0xFFFFFFF7, 3); - } - else - { - removeLeaves(w, x, y, z); - } - } - } - } + if (var12 >= 0) + { + world.setBlock(x, y, z, this, var6 & 0xFFFFFFF7, 3); + } + else + { + removeLeaves(world, x, y, z); + } + } + } + } - private void removeLeaves (World w, int x, int y, int z) - { - dropBlockAsItem(w, x, y, z, w.getBlockMetadata(x, y, z), 0); - w.setBlockToAir(x, y, z); - } + private void removeLeaves (World world, int x, int y, int z) + { + dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0); + world.setBlockToAir(x, y, z); + } - public void dropBlockAsItemWithChance (World w, int x, int y, int z, int m, float f, int i) - { - if ( (!w.isRemote) && ( (m & 0x8) != 0) && ( (m & 0x4) == 0)) - { - if ( ( (m & 0x1) == 0) && (w.rand.nextInt(50) == 0)) - { - dropBlockAsItem(w, x, y, z, new ItemStack(BlockRegistry.BlockWarpwoodSapling)); - } - } - } + public void dropBlockAsItemWithChance (World world, int x, int y, int z, int m, float f, int i) + { + if ( (!world.isRemote) && ( (m & 0x8) != 0) && ( (m & 0x4) == 0)) + { + if ( ( (m & 0x1) == 0) && (world.rand.nextInt(50) == 0)) + { + dropBlockAsItem(world, x, y, z, new ItemStack(BlockRegistry.BlockWarpwoodSapling)); + } + } + } - public void harvestBlock (World w, EntityPlayer p, int x, int y, int z, int i) - { - super.harvestBlock(w, p, x, y, z, i); - } + public void harvestBlock (World world, EntityPlayer player, int x, int y, int z, int i) + { + super.harvestBlock(world, player, x, y, z, i); + } - public int damageDropped (int i) - { - return i & 0x1; - } + public int damageDropped (int i) + { + return i & 0x1; + } - public int quantityDropped (Random r) - { - return 0; - } + public int quantityDropped (Random random) + { + return 0; + } - public Item getItemDropped (int i, Random r, int i2) - { - return Item.getItemById(0); - } + public Item getItemDropped (int i, Random random, int i2) + { + return Item.getItemById(0); + } - @Override - public boolean isLeaves (IBlockAccess w, int x, int y, int z) - { - return true; - } + @Override + public boolean isLeaves (IBlockAccess world, int x, int y, int z) + { + return true; + } - public void beginLeavesDecay (World w, int x, int y, int z) - { - w.setBlockMetadataWithNotify(x, y, z, w.getBlockMetadata(x, y, z) | 0x8, 4); - } + public void beginLeavesDecay (World world, int x, int y, int z) + { + world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) | 0x8, 4); + } - @SideOnly (Side.CLIENT) - public int getBlockColor () - { - return 0xFFFFFF; - } + @SideOnly (Side.CLIENT) + public int getBlockColor () + { + return 0xFFFFFF; + } - public ItemStack getPickBlock (MovingObjectPosition t, World w, int x, int y, int z) - { - int m = w.getBlockMetadata(x, y, z); - return new ItemStack(this, 1, m & 0x1); - } + public ItemStack getPickBlock (MovingObjectPosition mop, World world, int x, int y, int z) + { + int m = world.getBlockMetadata(x, y, z); + return new ItemStack(this, 1, m & 0x1); + } - @SideOnly (Side.CLIENT) - @Override - public int getRenderColor (int m) - { - return 0xFFFFFF; - } + @SideOnly (Side.CLIENT) + @Override + public int getRenderColor (int m) + { + return 0xFFFFFF; + } - @SideOnly (Side.CLIENT) - public int colorMultiplier (IBlockAccess w, int x, int y, int z) - { - return 0xFFFFFF; - } + @SideOnly (Side.CLIENT) + public int colorMultiplier (IBlockAccess world, int x, int y, int z) + { + return 0xFFFFFF; + } - @Override - public boolean isShearable (ItemStack s, IBlockAccess w, int x, int y, int z) - { - return true; - } + @Override + public boolean isShearable (ItemStack stack, IBlockAccess world, int x, int y, int z) + { + return true; + } - public ArrayList onSheared (ItemStack s, IBlockAccess w, int x, int y, int z, int fortune) - { - ArrayList ret = new ArrayList(); - ret.add(new ItemStack(this, 1, w.getBlockMetadata(x, y, z) & 0x3)); - return ret; - } + public ArrayList onSheared (ItemStack stack, IBlockAccess world, int x, int y, int z, int fortune) + { + ArrayList ret = new ArrayList(); + ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z) & 0x3)); + return ret; + } - public int getFlammability (IBlockAccess w, int x, int y, int z, ForgeDirection face) - { - return 0; - } + public int getFlammability (IBlockAccess world, int x, int y, int z, ForgeDirection face) + { + return 0; + } - public int getFireSpreadSpeed (IBlockAccess w, int x, int y, int z, ForgeDirection face) - { - return 0; - } + public int getFireSpreadSpeed (IBlockAccess world, int x, int y, int z, ForgeDirection face) + { + return 0; + } } \ No newline at end of file diff --git a/src/main/java/taintedmagic/common/blocks/BlockWarpwoodLog.java b/src/main/java/taintedmagic/common/blocks/BlockWarpwoodLog.java index b687d67..1e57ef1 100644 --- a/src/main/java/taintedmagic/common/blocks/BlockWarpwoodLog.java +++ b/src/main/java/taintedmagic/common/blocks/BlockWarpwoodLog.java @@ -12,54 +12,54 @@ import taintedmagic.common.TaintedMagic; public class BlockWarpwoodLog extends BlockRotatedPillar { - private IIcon side; - private IIcon top; + private IIcon side; + private IIcon top; - public BlockWarpwoodLog () - { - super(Material.wood); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setHardness(2.5F); - this.setStepSound(soundTypeWood); - this.setBlockName("BlockWarpwoodLog"); - } + public BlockWarpwoodLog () + { + super(Material.wood); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setHardness(2.5F); + this.setStepSound(soundTypeWood); + this.setBlockName("BlockWarpwoodLog"); + } - @SideOnly (Side.CLIENT) - protected IIcon getTopIcon (int i) - { - return this.top; - } + @SideOnly (Side.CLIENT) + protected IIcon getTopIcon (int i) + { + return this.top; + } - @SideOnly (Side.CLIENT) - protected IIcon getSideIcon (int i) - { - return this.side; - } + @SideOnly (Side.CLIENT) + protected IIcon getSideIcon (int i) + { + return this.side; + } - @SideOnly (Side.CLIENT) - public void registerBlockIcons (IIconRegister ir) - { - this.side = ir.registerIcon("taintedmagic:BlockWarpwoodLog_side"); - this.top = ir.registerIcon("taintedmagic:BlockWarpwoodLog_top"); - } + @SideOnly (Side.CLIENT) + public void registerBlockIcons (IIconRegister ir) + { + this.side = ir.registerIcon("taintedmagic:BlockWarpwoodLog_side"); + this.top = ir.registerIcon("taintedmagic:BlockWarpwoodLog_top"); + } - public boolean canSustainLeaves (IBlockAccess w, int x, int y, int z) - { - return true; - } + public boolean canSustainLeaves (IBlockAccess world, int x, int y, int z) + { + return true; + } - public boolean isWood (IBlockAccess w, int x, int y, int z) - { - return true; - } + public boolean isWood (IBlockAccess world, int x, int y, int z) + { + return true; + } - public int getFlammability (IBlockAccess w, int x, int y, int z, ForgeDirection face) - { - return 0; - } + public int getFlammability (IBlockAccess world, int x, int y, int z, ForgeDirection face) + { + return 0; + } - public int getFireSpreadSpeed (IBlockAccess w, int x, int y, int z, ForgeDirection face) - { - return 0; - } + public int getFireSpreadSpeed (IBlockAccess world, int x, int y, int z, ForgeDirection face) + { + return 0; + } } diff --git a/src/main/java/taintedmagic/common/blocks/BlockWarpwoodPlanks.java b/src/main/java/taintedmagic/common/blocks/BlockWarpwoodPlanks.java index 7402233..413d473 100644 --- a/src/main/java/taintedmagic/common/blocks/BlockWarpwoodPlanks.java +++ b/src/main/java/taintedmagic/common/blocks/BlockWarpwoodPlanks.java @@ -6,13 +6,13 @@ import taintedmagic.common.TaintedMagic; public class BlockWarpwoodPlanks extends Block { - public BlockWarpwoodPlanks () - { - super(Material.wood); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setBlockName("BlockWarpwoodPlanks"); - this.setBlockTextureName("taintedmagic:BlockWarpwoodPlanks"); - this.setHardness(0.8F); - this.setStepSound(soundTypeWood); - } + public BlockWarpwoodPlanks () + { + super(Material.wood); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setBlockName("BlockWarpwoodPlanks"); + this.setBlockTextureName("taintedmagic:BlockWarpwoodPlanks"); + this.setHardness(0.8F); + this.setStepSound(soundTypeWood); + } } diff --git a/src/main/java/taintedmagic/common/blocks/BlockWarpwoodSapling.java b/src/main/java/taintedmagic/common/blocks/BlockWarpwoodSapling.java index 455c00e..496bfda 100644 --- a/src/main/java/taintedmagic/common/blocks/BlockWarpwoodSapling.java +++ b/src/main/java/taintedmagic/common/blocks/BlockWarpwoodSapling.java @@ -8,64 +8,62 @@ import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.BlockSapling; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.World; import taintedmagic.common.TaintedMagic; -import taintedmagic.common.registry.BlockRegistry; import taintedmagic.common.world.WorldGenWarpwoodTree; public class BlockWarpwoodSapling extends BlockSapling { - public BlockWarpwoodSapling () - { - super(); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setBlockName("BlockWarpwoodSapling"); - this.setStepSound(soundTypeGrass); - } + public BlockWarpwoodSapling () + { + super(); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setBlockName("BlockWarpwoodSapling"); + this.setStepSound(soundTypeGrass); + } - @Override - public void func_149878_d (World w, int x, int y, int z, Random rand) - { - if (!w.isRemote) - { - int meta = w.getBlockMetadata(x, y, z); + @Override + public void func_149878_d (World world, int x, int y, int z, Random random) + { + if (!world.isRemote) + { + int meta = world.getBlockMetadata(x, y, z); - w.setBlockToAir(x, y, z); + world.setBlockToAir(x, y, z); - WorldGenWarpwoodTree tree = new WorldGenWarpwoodTree(true, 7, 5); + WorldGenWarpwoodTree tree = new WorldGenWarpwoodTree(true, 7, 5); - if (!tree.generate(w, rand, x, y, z)) w.setBlock(x, y, z, this, meta, 2); - } - } + if (!tree.generate(world, random, x, y, z)) world.setBlock(x, y, z, this, meta, 2); + } + } - @Override - @SideOnly (Side.CLIENT) - public void getSubBlocks (Item s, CreativeTabs t, List l) - { - l.add(new ItemStack(this, 1, 0)); - } + @Override + @SideOnly (Side.CLIENT) + public void getSubBlocks (Item item, CreativeTabs tab, List list) + { + list.add(new ItemStack(this, 1, 0)); + } - @Override - public Item getItemDropped (int i, Random random, int i2) - { - return Item.getItemFromBlock(this); - } + @Override + public Item getItemDropped (int i, Random random, int i2) + { + return Item.getItemFromBlock(this); + } - @SideOnly (Side.CLIENT) - @Override - public void registerBlockIcons (IIconRegister ir) - { - this.blockIcon = ir.registerIcon("taintedmagic:BlockWarpwoodSapling"); - } + @SideOnly (Side.CLIENT) + @Override + public void registerBlockIcons (IIconRegister ir) + { + this.blockIcon = ir.registerIcon("taintedmagic:BlockWarpwoodSapling"); + } - @SideOnly (Side.CLIENT) - @Override - public IIcon getIcon (int side, int meta) - { - return this.blockIcon; - } + @SideOnly (Side.CLIENT) + @Override + public IIcon getIcon (int side, int meta) + { + return this.blockIcon; + } } \ No newline at end of file diff --git a/src/main/java/taintedmagic/common/blocks/tile/TileLumos.java b/src/main/java/taintedmagic/common/blocks/tile/TileLumos.java index 26e9ac4..a77ce8d 100644 --- a/src/main/java/taintedmagic/common/blocks/tile/TileLumos.java +++ b/src/main/java/taintedmagic/common/blocks/tile/TileLumos.java @@ -17,70 +17,79 @@ import thaumcraft.common.items.wands.ItemWandCasting; public class TileLumos extends TileEntity { - int ticksExisted; + int ticksExisted; - public TileLumos () - { - } + public TileLumos () + { + } - public boolean canUpdate () - { - return true; - } + public boolean canUpdate () + { + return true; + } - @Override - public void updateEntity () - { - ticksExisted++; + @Override + public void updateEntity () + { + ticksExisted++; - Block b = worldObj.getBlock(xCoord, yCoord, zCoord); - int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); + Block block = worldObj.getBlock(xCoord, yCoord, zCoord); + int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); - if (b instanceof BlockLumos) - { - EntityPlayer p = worldObj.getClosestPlayer(xCoord, yCoord, zCoord, 4); + if (block instanceof BlockLumos) + { + EntityPlayer player = worldObj.getClosestPlayer(xCoord, yCoord, zCoord, 4); - if (meta == 0 && worldObj.rand.nextInt(15) == 0) - { - if (worldObj.isRemote) spawnParticles(); - } - if ( (meta == 1 || meta == 2) && p == null) - { - worldObj.setBlockToAir(xCoord, yCoord, zCoord); - } - else if (meta == 1 && p != null) - { - if (p.getHeldItem() == null || (p.getHeldItem() != null && ! (p.getHeldItem().getItem() instanceof ItemWandCasting))) worldObj.setBlockToAir(xCoord, yCoord, zCoord); - else if (p.getHeldItem() != null && p.getHeldItem().getItem() instanceof ItemWandCasting) - { - ItemStack s = p.getHeldItem(); - ItemWandCasting wand = (ItemWandCasting) s.getItem(); + if (meta == 0 && worldObj.rand.nextInt(15) == 0) + { + if (worldObj.isRemote) spawnParticles(); + } + if ( (meta == 1 || meta == 2) && player == null) + { + worldObj.setBlockToAir(xCoord, yCoord, zCoord); + } + else if (meta == 1 && player != null) + { + if (player.getHeldItem() == null + || (player.getHeldItem() != null && ! (player.getHeldItem().getItem() instanceof ItemWandCasting))) + worldObj.setBlockToAir(xCoord, yCoord, zCoord); + else if (player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemWandCasting) + { + ItemStack stack = player.getHeldItem(); + ItemWandCasting wand = (ItemWandCasting) stack.getItem(); - if (wand.getFocus(s) == null || (wand.getFocus(s) != null && wand.getFocus(s) != ItemRegistry.ItemFocusLumos)) worldObj.setBlockToAir(xCoord, yCoord, zCoord); - } - } - if (meta == 2 && p != null) - { - IInventory baub = BaublesApi.getBaubles(p); - if (baub.getStackInSlot(1) == null && baub.getStackInSlot(2) == null) worldObj.setBlockToAir(xCoord, yCoord, zCoord); - else if ( (baub.getStackInSlot(1) != null && baub.getStackInSlot(2) == null) && ! (baub.getStackInSlot(1).getItem() instanceof ItemLumosRing)) - worldObj.setBlockToAir(xCoord, yCoord, zCoord); - else if ( (baub.getStackInSlot(1) == null && baub.getStackInSlot(2) != null) && ! (baub.getStackInSlot(2).getItem() instanceof ItemLumosRing)) - worldObj.setBlockToAir(xCoord, yCoord, zCoord); - else if ( (baub.getStackInSlot(1) != null && baub.getStackInSlot(2) != null) - && (! (baub.getStackInSlot(1).getItem() instanceof ItemLumosRing) && ! (baub.getStackInSlot(2).getItem() instanceof ItemLumosRing))) - worldObj.setBlockToAir(xCoord, yCoord, zCoord); - } - } - } + if (wand.getFocus(stack) == null + || (wand.getFocus(stack) != null && wand.getFocus(stack) != ItemRegistry.ItemFocusLumos)) + worldObj.setBlockToAir(xCoord, yCoord, zCoord); + } + } + if (meta == 2 && player != null) + { + IInventory baub = BaublesApi.getBaubles(player); + if (baub.getStackInSlot(1) == null && baub.getStackInSlot(2) == null) + worldObj.setBlockToAir(xCoord, yCoord, zCoord); + else if ( (baub.getStackInSlot(1) != null && baub.getStackInSlot(2) == null) + && ! (baub.getStackInSlot(1).getItem() instanceof ItemLumosRing)) + worldObj.setBlockToAir(xCoord, yCoord, zCoord); + else if ( (baub.getStackInSlot(1) == null && baub.getStackInSlot(2) != null) + && ! (baub.getStackInSlot(2).getItem() instanceof ItemLumosRing)) + worldObj.setBlockToAir(xCoord, yCoord, zCoord); + else if ( (baub.getStackInSlot(1) != null && baub.getStackInSlot(2) != null) + && (! (baub.getStackInSlot(1).getItem() instanceof ItemLumosRing) + && ! (baub.getStackInSlot(2).getItem() instanceof ItemLumosRing))) + worldObj.setBlockToAir(xCoord, yCoord, zCoord); + } + } + } - @SideOnly (Side.CLIENT) - void spawnParticles () - { - FXSparkle fx = new FXSparkle(worldObj, (double) xCoord + 0.5D + (worldObj.rand.nextGaussian() * 0.1D), (double) yCoord + 0.5D + (worldObj.rand.nextGaussian() * 0.1D), - (double) zCoord + 0.5D + (worldObj.rand.nextGaussian() * 0.1D), 1.75F, 6, 3 + worldObj.rand.nextInt(2)); - fx.slowdown = true; - fx.setGravity(-0.5F); - ParticleEngine.instance.addEffect(worldObj, fx); - } + @SideOnly (Side.CLIENT) + void spawnParticles () + { + FXSparkle fx = new FXSparkle(worldObj, (double) xCoord + 0.5D + (worldObj.rand.nextGaussian() * 0.1D), + (double) yCoord + 0.5D + (worldObj.rand.nextGaussian() * 0.1D), + (double) zCoord + 0.5D + (worldObj.rand.nextGaussian() * 0.1D), 1.75F, 6, 3 + worldObj.rand.nextInt(2)); + fx.slowdown = true; + fx.setGravity(-0.5F); + ParticleEngine.instance.addEffect(worldObj, fx); + } } \ No newline at end of file diff --git a/src/main/java/taintedmagic/common/entities/EntityDarkMatter.java b/src/main/java/taintedmagic/common/entities/EntityDarkMatter.java index cea6f99..6370ad8 100644 --- a/src/main/java/taintedmagic/common/entities/EntityDarkMatter.java +++ b/src/main/java/taintedmagic/common/entities/EntityDarkMatter.java @@ -11,66 +11,68 @@ import thaumcraft.common.entities.projectile.EntityEldritchOrb; public class EntityDarkMatter extends EntityEldritchOrb { - public float dmg = 0.0F; - public boolean corrosive; + public float dmg = 0.0F; + public boolean corrosive; - public EntityDarkMatter (World w) - { - super(w); - } + public EntityDarkMatter (World world) + { + super(world); + } - public EntityDarkMatter (World w, EntityLivingBase e, float dmg, boolean corrosive) - { - super(w, e); - this.corrosive = corrosive; - this.dmg = dmg; - } + public EntityDarkMatter (World world, EntityLivingBase entity, float dmg, boolean corrosive) + { + super(world, entity); + this.corrosive = corrosive; + this.dmg = dmg; + } - @Override - public boolean shouldRenderInPass (int pass) - { - return pass == 1; - } + @Override + public boolean shouldRenderInPass (int pass) + { + return pass == 1; + } - @Override - protected void onImpact (MovingObjectPosition mop) - { - if (!this.worldObj.isRemote && getThrower() != null) - { - if (mop.entityHit != null) - { - Entity ent = mop.entityHit; - if (ent instanceof EntityLivingBase) - { - ((EntityLivingBase) ent).attackEntityFrom(DamageSource.causeIndirectMagicDamage(getThrower(), ent), this.dmg); - if (this.corrosive) - { - try - { - ((EntityLivingBase) ent).addPotionEffect(new PotionEffect(Potion.wither.id, 160, 1)); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - else - { - try - { - ((EntityLivingBase) ent).addPotionEffect(new PotionEffect(Potion.weakness.id, 160, 1)); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - } - } - this.worldObj.playSoundAtEntity(this, "random.fizz", 0.5F, 2.6F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.8F); - this.ticksExisted = 100; - this.worldObj.setEntityState(this, (byte) 16); - } - setDead(); - } + @Override + protected void onImpact (MovingObjectPosition mop) + { + if (!this.worldObj.isRemote && getThrower() != null) + { + if (mop.entityHit != null) + { + Entity entity = mop.entityHit; + if (entity instanceof EntityLivingBase) + { + ((EntityLivingBase) entity).attackEntityFrom(DamageSource.causeIndirectMagicDamage(getThrower(), entity), + this.dmg); + if (this.corrosive) + { + try + { + ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.wither.id, 160, 1)); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + else + { + try + { + ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.weakness.id, 160, 1)); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + } + } + this.worldObj.playSoundAtEntity(this, "random.fizz", 0.5F, + 2.6F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.8F); + this.ticksExisted = 100; + this.worldObj.setEntityState(this, (byte) 16); + } + setDead(); + } } \ No newline at end of file diff --git a/src/main/java/taintedmagic/common/entities/EntityDiffusion.java b/src/main/java/taintedmagic/common/entities/EntityDiffusion.java index d61cdd5..ffecb57 100644 --- a/src/main/java/taintedmagic/common/entities/EntityDiffusion.java +++ b/src/main/java/taintedmagic/common/entities/EntityDiffusion.java @@ -18,160 +18,162 @@ import thaumcraft.common.Thaumcraft; public class EntityDiffusion extends EntityThrowable { - public static final String TAG_DAMAGE = "dmg"; + public static final String TAG_DAMAGE = "dmg"; - public boolean corrosive = false; - public float dmg = 0.0F; + public boolean corrosive = false; + public float dmg = 0.0F; - public EntityDiffusion (World w) - { - super(w); - } + public EntityDiffusion (World world) + { + super(world); + } - public EntityDiffusion (World w, EntityLivingBase e, float scatter, float dmg, boolean corrosive) - { - super(w, e); - this.corrosive = corrosive; - this.dmg = dmg; - setThrowableHeading(this.motionX, this.motionY, this.motionZ, func_70182_d(), scatter); - } + public EntityDiffusion (World world, EntityLivingBase entity, float scatter, float dmg, boolean corrosive) + { + super(world, entity); + this.corrosive = corrosive; + this.dmg = dmg; + setThrowableHeading(this.motionX, this.motionY, this.motionZ, func_70182_d(), scatter); + } - @Override - public boolean shouldRenderInPass (int pass) - { - return pass == 1; - } + @Override + public boolean shouldRenderInPass (int pass) + { + return pass == 1; + } - protected float getGravityVelocity () - { - return 0.0F; - } + protected float getGravityVelocity () + { + return 0.0F; + } - protected float func_70182_d () - { - return 1.0F; - } + protected float func_70182_d () + { + return 1.0F; + } - public void handleHealthUpdate (byte b) - { - if (b == 16) - { - if (this.worldObj.isRemote) - { - float fx = (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.3F; - float fy = (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.3F; - float fz = (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.3F; - Thaumcraft.proxy.wispFX3(this.worldObj, this.posX + fx, this.posY + fy, this.posZ + fz, this.posX + fx * 8.0F, this.posY + fy * 8.0F, this.posZ + fz * 8.0F, 0.3F, 5, true, 0.02F); - } + public void handleHealthUpdate (byte b) + { + if (b == 16) + { + if (this.worldObj.isRemote) + { + float fx = (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.3F; + float fy = (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.3F; + float fz = (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.3F; + Thaumcraft.proxy.wispFX3(this.worldObj, this.posX + fx, this.posY + fy, this.posZ + fz, this.posX + fx * 8.0F, + this.posY + fy * 8.0F, this.posZ + fz * 8.0F, 0.3F, 5, true, 0.02F); + } + } + else + { + super.handleHealthUpdate(b); + } + } - } - else - { - super.handleHealthUpdate(b); - } - } + public void onUpdate () + { + if (this.ticksExisted > 20) setDead(); - public void onUpdate () - { - if (this.ticksExisted > 20) setDead(); + this.motionX *= 0.95D; + this.motionY *= 0.95D; + this.motionZ *= 0.95D; - this.motionX *= 0.95D; - this.motionY *= 0.95D; - this.motionZ *= 0.95D; + if (this.onGround) + { + this.motionX *= 0.66D; + this.motionY *= 0.66D; + this.motionZ *= 0.66D; + } - if (this.onGround) - { - this.motionX *= 0.66D; - this.motionY *= 0.66D; - this.motionZ *= 0.66D; - } + super.onUpdate(); + } - super.onUpdate(); - } + public void writeSpawnData (ByteBuf buf) + { + buf.writeFloat(this.dmg); + } - public void writeSpawnData (ByteBuf buf) - { - buf.writeFloat(this.dmg); - } + public void readSpawnData (ByteBuf buf) + { + this.dmg = buf.readFloat(); + } - public void readSpawnData (ByteBuf buf) - { - this.dmg = buf.readFloat(); - } + protected void onImpact (MovingObjectPosition mop) + { + if (!this.worldObj.isRemote && getThrower() != null) + { + List entities = + this.worldObj.getEntitiesWithinAABBExcludingEntity(getThrower(), this.boundingBox.expand(1.0D, 1.0D, 1.0D)); - protected void onImpact (MovingObjectPosition mop) - { - if (!this.worldObj.isRemote && getThrower() != null) - { - List l = this.worldObj.getEntitiesWithinAABBExcludingEntity(getThrower(), this.boundingBox.expand(1.0D, 1.0D, 1.0D)); + for (int i = 0; i < entities.size(); i++) + { + Entity entity = (Entity) entities.get(i); + if (entity instanceof EntityLivingBase) + { + if (mop.entityHit != null) + { + ((EntityLivingBase) entity) + .attackEntityFrom(DamageSource.causeIndirectMagicDamage(getThrower(), entity), this.dmg); + if (this.corrosive) + { + try + { + ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.wither.id, 160, 1)); + } + catch (Exception ex) + { + ex.printStackTrace(); + } + } + else + { + try + { + ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.weakness.id, 160, 1)); + } + catch (Exception ex) + { + ex.printStackTrace(); + } + } + } + } + } + } + this.worldObj.setEntityState(this, (byte) 16); + } - for (int i = 0; i < l.size(); i++) - { - Entity e = (Entity) l.get(i); - if (e instanceof EntityLivingBase) - { - if (mop.entityHit != null) - { - ((EntityLivingBase) e).attackEntityFrom(DamageSource.causeIndirectMagicDamage(getThrower(), e), this.dmg); - if (this.corrosive) - { - try - { - ((EntityLivingBase) e).addPotionEffect(new PotionEffect(Potion.wither.id, 160, 1)); - } - catch (Exception ex) - { - ex.printStackTrace(); - } - } - else - { - try - { - ((EntityLivingBase) e).addPotionEffect(new PotionEffect(Potion.weakness.id, 160, 1)); - } - catch (Exception ex) - { - ex.printStackTrace(); - } - } - } - } - } - } - this.worldObj.setEntityState(this, (byte) 16); - } + protected boolean canTriggerWalking () + { + return false; + } - protected boolean canTriggerWalking () - { - return false; - } + @SideOnly (Side.CLIENT) + public float getShadowSize () + { + return 0.1F; + } - @SideOnly (Side.CLIENT) - public float getShadowSize () - { - return 0.1F; - } + public void writeEntityToNBT (NBTTagCompound tag) + { + super.writeEntityToNBT(tag); + tag.setFloat(TAG_DAMAGE, this.dmg); + } - public void writeEntityToNBT (NBTTagCompound cmp) - { - super.writeEntityToNBT(cmp); - cmp.setFloat(TAG_DAMAGE, this.dmg); - } + public void readEntityFromNBT (NBTTagCompound tag) + { + super.readEntityFromNBT(tag); + this.dmg = tag.getInteger(TAG_DAMAGE); + } - public void readEntityFromNBT (NBTTagCompound cmp) - { - super.readEntityFromNBT(cmp); - this.dmg = cmp.getInteger(TAG_DAMAGE); - } + public boolean canBeCollidedWith () + { + return false; + } - public boolean canBeCollidedWith () - { - return false; - } - - public boolean attackEntityFrom (DamageSource s, float f) - { - return false; - } + public boolean attackEntityFrom (DamageSource dmg, float f) + { + return false; + } } diff --git a/src/main/java/taintedmagic/common/entities/EntityHomingShard.java b/src/main/java/taintedmagic/common/entities/EntityHomingShard.java index f25bf35..4c3ebc0 100644 --- a/src/main/java/taintedmagic/common/entities/EntityHomingShard.java +++ b/src/main/java/taintedmagic/common/entities/EntityHomingShard.java @@ -26,177 +26,186 @@ import thaumcraft.common.lib.utils.EntityUtils; */ public class EntityHomingShard extends EntityThrowable implements IEntityAdditionalSpawnData { - Class tClass = null; - boolean persistant = false; + Class targetClass = null; + boolean persistant = false; - int targetID = 0; - EntityLivingBase target; + int targetID = 0; + EntityLivingBase target; - Material[] mats = { Material.plants, Material.air, Material.leaves, Material.portal, Material.vine, Material.web }; + Material[] mats = { Material.plants, Material.air, Material.leaves, Material.portal, Material.vine, Material.web }; - public EntityHomingShard (World w) - { - super(w); - } + public EntityHomingShard (World world) + { + super(world); + } - public EntityHomingShard (World w, EntityLivingBase p, EntityLivingBase t, int strength, boolean b) - { - super(w, p); - this.target = t; - this.tClass = t.getClass(); - this.persistant = b; - setStrength(strength); - Vec3 v = p.getLookVec(); - setLocationAndAngles(p.posX + v.xCoord / 2.0D, p.posY + p.getEyeHeight() + v.yCoord / 2.0D, p.posZ + v.zCoord / 2.0D, p.rotationYaw, p.rotationPitch); - float f = 0.5F; - float ry = p.rotationYaw + (this.rand.nextFloat() - this.rand.nextFloat()) * 60.0F; - float rp = p.rotationPitch + (this.rand.nextFloat() - this.rand.nextFloat()) * 60.0F; - this.motionX = (-MathHelper.sin(ry / 180.0F * (float) Math.PI) * MathHelper.cos(rp / 180.0F * (float) Math.PI) * f); - this.motionZ = (MathHelper.cos(ry / 180.0F * (float) Math.PI) * MathHelper.cos(rp / 180.0F * (float) Math.PI) * f); - this.motionY = (-MathHelper.sin(rp / 180.0F * (float) Math.PI) * f); - } + public EntityHomingShard (World world, EntityLivingBase thrower, EntityLivingBase target, int strength, boolean b) + { + super(world, thrower); + this.target = target; + this.targetClass = target.getClass(); + this.persistant = b; + setStrength(strength); + Vec3 vec = thrower.getLookVec(); + setLocationAndAngles(thrower.posX + vec.xCoord / 2.0D, thrower.posY + thrower.getEyeHeight() + vec.yCoord / 2.0D, + thrower.posZ + vec.zCoord / 2.0D, thrower.rotationYaw, thrower.rotationPitch); + float f = 0.5F; + float ry = thrower.rotationYaw + (this.rand.nextFloat() - this.rand.nextFloat()) * 60.0F; + float rp = thrower.rotationPitch + (this.rand.nextFloat() - this.rand.nextFloat()) * 60.0F; + this.motionX = (-MathHelper.sin(ry / 180.0F * (float) Math.PI) * MathHelper.cos(rp / 180.0F * (float) Math.PI) * f); + this.motionZ = (MathHelper.cos(ry / 180.0F * (float) Math.PI) * MathHelper.cos(rp / 180.0F * (float) Math.PI) * f); + this.motionY = (-MathHelper.sin(rp / 180.0F * (float) Math.PI) * f); + } - @Override - public boolean shouldRenderInPass (int pass) - { - return pass == 1; - } + @Override + public boolean shouldRenderInPass (int pass) + { + return pass == 1; + } - @Override - public void entityInit () - { - super.entityInit(); - this.dataWatcher.addObject(17, (byte) 0); - } + @Override + public void entityInit () + { + super.entityInit(); + this.dataWatcher.addObject(17, (byte) 0); + } - public void setStrength (int str) - { - this.dataWatcher.updateObject(17, Byte.valueOf((byte) str)); - } + public void setStrength (int strength) + { + this.dataWatcher.updateObject(17, Byte.valueOf((byte) strength)); + } - public int getStrength () - { - return this.dataWatcher.getWatchableObjectByte(17); - } + public int getStrength () + { + return this.dataWatcher.getWatchableObjectByte(17); + } - @Override - protected float getGravityVelocity () - { - return 0.0F; - } + @Override + protected float getGravityVelocity () + { + return 0.0F; + } - @Override - public void writeSpawnData (ByteBuf buf) - { - int id = -1; - if (this.target != null) id = this.target.getEntityId(); - buf.writeInt(id); - } + @Override + public void writeSpawnData (ByteBuf buf) + { + int id = -1; + if (this.target != null) id = this.target.getEntityId(); + buf.writeInt(id); + } - @Override - public void readSpawnData (ByteBuf buf) - { - int id = buf.readInt(); - try - { - if (id >= 0) this.target = ((EntityLivingBase) this.worldObj.getEntityByID(id)); - } - catch (Exception e) - { - } - } + @Override + public void readSpawnData (ByteBuf buf) + { + int id = buf.readInt(); + try + { + if (id >= 0) this.target = ((EntityLivingBase) this.worldObj.getEntityByID(id)); + } + catch (Exception e) + { + } + } - @Override - protected void onImpact (MovingObjectPosition mop) - { - if (!this.worldObj.isRemote && mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && (getThrower() == null || (getThrower() != null && mop.entityHit != getThrower()))) - { - mop.entityHit.attackEntityFrom(DamageSource.causeIndirectMagicDamage(this, getThrower()), 2.0F + getStrength() * 0.5F); - this.worldObj.playSoundAtEntity(this, "thaumcraft:zap", 1.0F, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); - this.worldObj.setEntityState(this, (byte) 16); - setDead(); - } + @Override + protected void onImpact (MovingObjectPosition mop) + { + if (!this.worldObj.isRemote && mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY + && (getThrower() == null || (getThrower() != null && mop.entityHit != getThrower()))) + { + mop.entityHit.attackEntityFrom(DamageSource.causeIndirectMagicDamage(this, getThrower()), + 2.0F + getStrength() * 0.5F); + this.worldObj.playSoundAtEntity(this, "thaumcraft:zap", 1.0F, + 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); + this.worldObj.setEntityState(this, (byte) 16); + setDead(); + } - if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) - { - Block b = this.worldObj.getBlock(mop.blockX, mop.blockY, mop.blockZ); + if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + Block block = this.worldObj.getBlock(mop.blockX, mop.blockY, mop.blockZ); - int l = mats.length; - List whitelisted = new ArrayList(l); - for (int i = 0; i < l; i++) - whitelisted.add(mats[i]); + List whitelisted = new ArrayList(mats.length); + for (int i = 0; i < mats.length; i++) + whitelisted.add(mats[i]); - if (!whitelisted.contains(b.getMaterial())) - { - this.motionZ *= -0.8D; - this.motionX *= -0.8D; - this.motionY *= -0.8D; - } - } - } + if (!whitelisted.contains(block.getMaterial())) + { + this.motionZ *= -0.8D; + this.motionX *= -0.8D; + this.motionY *= -0.8D; + } + } + } - @Override - @SideOnly (Side.CLIENT) - public void handleHealthUpdate (byte b) - { - if (b == 16) Thaumcraft.proxy.burst(worldObj, this.posX, this.posY, this.posZ, 0.3F); - else super.handleHealthUpdate(b); - } + @Override + @SideOnly (Side.CLIENT) + public void handleHealthUpdate (byte b) + { + if (b == 16) Thaumcraft.proxy.burst(worldObj, this.posX, this.posY, this.posZ, 0.3F); + else super.handleHealthUpdate(b); + } - @Override - public void onUpdate () - { - double motion = Math.abs(this.motionX) + Math.abs(this.motionY) + Math.abs(this.motionZ); - if (motion > 0.0D && this.worldObj.isRemote) Thaumcraft.proxy.sparkle((float) this.posX + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.25F, (float) this.posY + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.25F, (float) this.posZ + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.25F, 0.5F, 0, 0.0F); + @Override + public void onUpdate () + { + double motion = Math.abs(this.motionX) + Math.abs(this.motionY) + Math.abs(this.motionZ); + if (motion > 0.0D && this.worldObj.isRemote) Thaumcraft.proxy.sparkle( + (float) this.posX + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.25F, + (float) this.posY + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.25F, + (float) this.posZ + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.25F, 0.5F, 0, 0.0F); - super.onUpdate(); + super.onUpdate(); - if (!this.worldObj.isRemote) - { - if (this.persistant && (this.target == null || this.target.isDead || this.target.getDistanceSqToEntity(this) > 1250.0D)) - { - ArrayList ents = EntityUtils.getEntitiesInRange(this.worldObj, this.posX, this.posY, this.posZ, this, this.tClass, 16.0D); + if (!this.worldObj.isRemote) + { + if (this.persistant + && (this.target == null || this.target.isDead || this.target.getDistanceSqToEntity(this) > 1250.0D)) + { + ArrayList ents = EntityUtils.getEntitiesInRange(this.worldObj, this.posX, this.posY, this.posZ, this, + this.targetClass, 16.0D); - for (Entity e : ents) - { - if (e instanceof EntityLivingBase && !e.isDead && (getThrower() == null || e.getEntityId() != getThrower().getEntityId())) - { - this.target = ((EntityLivingBase) e); - break; - } - } - } - if (this.target == null || this.target.isDead) - { - this.worldObj.setEntityState(this, (byte) 16); - setDead(); - } - } + for (Entity entity : ents) + { + if (entity instanceof EntityLivingBase && !entity.isDead + && (getThrower() == null || entity.getEntityId() != getThrower().getEntityId())) + { + this.target = ((EntityLivingBase) entity); + break; + } + } + } + if (this.target == null || this.target.isDead) + { + this.worldObj.setEntityState(this, (byte) 16); + setDead(); + } + } - if (this.ticksExisted > 300) - { - this.worldObj.setEntityState(this, (byte) 16); - setDead(); - } + if (this.ticksExisted > 300) + { + this.worldObj.setEntityState(this, (byte) 16); + setDead(); + } - if (this.ticksExisted % 10 == 0 && this.target != null && !this.target.isDead) - { - double d = getDistanceToEntity(this.target); - double dx = this.target.posX - this.posX; - double dy = this.target.boundingBox.minY + this.target.height * 0.6D - this.posY; - double dz = this.target.posZ - this.posZ; - dx /= d; - dy /= d; - dz /= d; + if (this.ticksExisted % 10 == 0 && this.target != null && !this.target.isDead) + { + double d = getDistanceToEntity(this.target); + double dx = this.target.posX - this.posX; + double dy = this.target.boundingBox.minY + this.target.height * 0.6D - this.posY; + double dz = this.target.posZ - this.posZ; + dx /= d; + dy /= d; + dz /= d; - this.motionX = dx; - this.motionY = dy; - this.motionZ = dz; + this.motionX = dx; + this.motionY = dy; + this.motionZ = dz; - this.worldObj.playSoundAtEntity(this, "taintedmagic:shard", 0.1F, 2.0F * this.worldObj.rand.nextFloat()); - } - this.motionX *= 0.85D; - this.motionY *= 0.85D; - this.motionZ *= 0.85D; - } + this.worldObj.playSoundAtEntity(this, "taintedmagic:shard", 0.1F, 2.0F * this.worldObj.rand.nextFloat()); + } + this.motionX *= 0.85D; + this.motionY *= 0.85D; + this.motionZ *= 0.85D; + } } diff --git a/src/main/java/taintedmagic/common/handler/ConfigHandler.java b/src/main/java/taintedmagic/common/handler/ConfigHandler.java index 4a4e91d..268e8d2 100644 --- a/src/main/java/taintedmagic/common/handler/ConfigHandler.java +++ b/src/main/java/taintedmagic/common/handler/ConfigHandler.java @@ -6,36 +6,64 @@ import thaumcraft.api.wands.FocusUpgradeType; public class ConfigHandler { - public static Configuration config; + public static Configuration config; - public static boolean UPDATE_HANDLER = true; - public static boolean RESEARCH_TAGS = true; - public static boolean CUSTOM_RESEARCH_TAB_BACK = false; - public static double MAGE_MACE_DMG_INC_BASE = 8.0D; - public static float WARP_WAND_REFRESH_BASE = 10000.0F; - public static int FOCUS_UPGRADES_START_ID = 64; + public static boolean NOTIFY_UPDATE = true; - public static void init () - { - TaintedMagic.log.info("Loading config"); + public static boolean RESEARCH_TAGS = true; + public static boolean CUSTOM_RESEARCH_TAB_BACK = false; - config.load(); + public static double MAGE_MACE_DMG_INC_BASE = 8.0D; - UPDATE_HANDLER = config.getBoolean("UPDATE_HANDLER", "misc", true, "Setting this to false will disable ingame chat Tainted Magic update notifications."); + public static float WARP_WAND_REFRESH_BASE = 10000.0F; - RESEARCH_TAGS = config.getBoolean("RESEARCH_TAGS", "research", true, "Setting this to false will disable the '[categoryTM]' tag on Tainted Magic research items."); + public static int SANITY_UPGRADE_ID = 64; + public static int ANTIBODY_UPGRADE_ID = 65; + public static int CORROSIVE_UPGRADE_ID = 66; + public static int PERSISTENT_UPGRADE_ID = 67; + public static int DIFFUSION_UPGRADE_ID = 68; - CUSTOM_RESEARCH_TAB_BACK = config.getBoolean("CUSTOM_RESEARCH_TAB_BACK", "research", false, "Setting this to true will bring back the old Tainted Magic research tab background."); + public static void initConfig () + { + TaintedMagic.log.info("Loading config..."); - MAGE_MACE_DMG_INC_BASE = (double) config - .getFloat("MAGE_MACE_DMG_INC_BASE", "misc", 8.0F, 1.0F, 100.0F, "Defines the base amount of damage to increase wand / staff attack damage by when the Mage's Mace focus is equipped."); + config.load(); - WARP_WAND_REFRESH_BASE = config - .getFloat("WARP_WAND_REFRESH_BASE", "misc", 10000.0F, 100.0F, 100000.0F, "Defines the base refresh period in ticks for the Warpwood Wand. The delay period between refreshs is calculated by dividing this number by the amount of permanant warp the player has accumulated."); + NOTIFY_UPDATE = config.getBoolean("NOTIFY_UPDATE", "misc", true, + "Setting this to false will disable Tainted Magic update notifications."); - FOCUS_UPGRADES_START_ID = config.getInt("FOCUS_UPGRADES_START_ID", "misc", 64, FocusUpgradeType.types.length + 1, Short.MAX_VALUE - - 1, "Defines the starting ID for categoryTM focus upgrades. The first upgrade will be registered under this ID, the next under this ID +1, etc."); + MAGE_MACE_DMG_INC_BASE = (double) config.getFloat("MAGE_MACE_DMG_INC_BASE", "misc", 8.0F, 1.0F, 100.0F, + "Defines the base amount of damage to increase wand / staff attack damage by " + + "when the Mage's Mace focus is equipped."); - config.save(); - } + RESEARCH_TAGS = config.getBoolean("RESEARCH_TAGS", "research", true, + "Setting this to false will disable the '[TM]' tag on Tainted Magic research items."); + + CUSTOM_RESEARCH_TAB_BACK = config.getBoolean("CUSTOM_RESEARCH_TAB_BACK", "research", false, + "Setting this to true will bring back the old Tainted Magic research tab background."); + + WARP_WAND_REFRESH_BASE = config.getFloat("WARP_WAND_REFRESH_BASE", "wands_and_foci", 10000.0F, 100.0F, 100000.0F, + "Defines the base refresh period in ticks for the Warpwood Wand. The delay period between vis refreshes " + + "is calculated by dividing this number by the amount of permanent warp the player has accumulated."); + + /** + * Focus upgrade IDs + */ + SANITY_UPGRADE_ID = config.getInt("SANITY_UPGRADE_ID", "wands_and_foci", 64, FocusUpgradeType.types.length + 1, + Short.MAX_VALUE, "The ID for the Sanity focus upgrade."); + + ANTIBODY_UPGRADE_ID = config.getInt("ANTIBODY_UPGRADE_ID", "wands_and_foci", 65, FocusUpgradeType.types.length + 1, + Short.MAX_VALUE, "The ID for the Antibody focus upgrade."); + + CORROSIVE_UPGRADE_ID = config.getInt("CORROSIVE_UPGRADE_ID", "wands_and_foci", 66, FocusUpgradeType.types.length + 1, + Short.MAX_VALUE, "The ID for the Corrosive focus upgrade."); + + PERSISTENT_UPGRADE_ID = config.getInt("PERSISTENT_UPGRADE_ID", "wands_and_foci", 67, FocusUpgradeType.types.length + 1, + Short.MAX_VALUE, "The ID for the Persistent focus upgrade."); + + DIFFUSION_UPGRADE_ID = config.getInt("DIFFUSION_UPGRADE_ID", "wands_and_foci", 68, FocusUpgradeType.types.length + 1, + Short.MAX_VALUE, "The ID for the Diffusion focus upgrade."); + + config.save(); + } } diff --git a/src/main/java/taintedmagic/common/handler/UpdateHandler.java b/src/main/java/taintedmagic/common/handler/UpdateHandler.java index bad5e8f..1d10b1d 100644 --- a/src/main/java/taintedmagic/common/handler/UpdateHandler.java +++ b/src/main/java/taintedmagic/common/handler/UpdateHandler.java @@ -9,49 +9,50 @@ import taintedmagic.common.lib.LibInfo; public class UpdateHandler { - private static String currentVersion = LibInfo.VERSION; - private static String newestVersion; - public static String updateStatus = null; - public static boolean show = false; + private static String currentVersion = LibInfo.VERSION; + private static String newestVersion; + public static String updateStatus = null; + public static boolean show = false; - public static void init () - { - getNewestVersion(); + public static void checkForUpdate () + { + getNewestVersion(); - if (newestVersion != null) - { - if (newestVersion.equalsIgnoreCase(currentVersion)) - { - show = false; - } - else if (!newestVersion.equalsIgnoreCase(currentVersion)) - { - show = true; - updateStatus = (EnumChatFormatting.RED + "Tainted Magic is out of date! The latest version is " + EnumChatFormatting.GREEN + newestVersion); - TaintedMagic.log.info("Mod out of date! You're still running: " + currentVersion + ", Latest Version: " + newestVersion); - } - } - else - { - show = true; - updateStatus = (EnumChatFormatting.RED + "Tainted Magic failed to connect to update server!"); - TaintedMagic.log.info("Failed to connect to update server..."); - } - } + if (newestVersion != null) + { + if (newestVersion.equalsIgnoreCase(currentVersion)) + { + show = false; + } + else if (!newestVersion.equalsIgnoreCase(currentVersion)) + { + show = true; + updateStatus = (EnumChatFormatting.RED + "Tainted Magic is out of date! The latest version is " + + EnumChatFormatting.GREEN + newestVersion); + TaintedMagic.log.warn("Mod out of date! You're still running " + currentVersion + " ... the latest version is " + + newestVersion); + } + } + else + { + show = true; + updateStatus = (EnumChatFormatting.RED + "Tainted Magic failed to connect to the update server!"); + } + } - private static void getNewestVersion () - { - try - { - URL url = new URL("https://raw.githubusercontent.com/yorkeJohn/Tainted-Magic/master/version.txt"); - Scanner s = new Scanner(url.openStream()); - newestVersion = s.next(); - s.close(); - } - catch (Exception ex) - { - ex.printStackTrace(); - TaintedMagic.log.info("Could not connect to GitHub repository!"); - } - } + private static void getNewestVersion () + { + try + { + URL url = new URL("https://raw.githubusercontent.com/yorkeJohn/Tainted-Magic/master/version.txt"); + Scanner scan = new Scanner(url.openStream()); + newestVersion = scan.next(); + scan.close(); + } + catch (Exception e) + { + e.printStackTrace(); + TaintedMagic.log.error("Could not connect to GitHub repository!"); + } + } } diff --git a/src/main/java/taintedmagic/common/handler/WandHandler.java b/src/main/java/taintedmagic/common/handler/WandHandler.java index dd3dd83..7367601 100644 --- a/src/main/java/taintedmagic/common/handler/WandHandler.java +++ b/src/main/java/taintedmagic/common/handler/WandHandler.java @@ -2,7 +2,6 @@ package taintedmagic.common.handler; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.wands.IWandRodOnUpdate; import thaumcraft.common.Thaumcraft; @@ -11,24 +10,24 @@ import thaumcraft.common.items.wands.ItemWandCasting; public class WandHandler implements IWandRodOnUpdate { - Aspect primals[] = Aspect.getPrimalAspects().toArray(new Aspect[0]); + Aspect primals[] = Aspect.getPrimalAspects().toArray(new Aspect[0]); - public void onUpdate (ItemStack s, EntityPlayer p) - { - if (!p.isPotionActive(Config.potionWarpWardID)) - { - int permwarp = Thaumcraft.proxy.getPlayerKnowledge().getWarpPerm(p.getCommandSenderName()); + public void onUpdate (ItemStack stack, EntityPlayer player) + { + if (!player.isPotionActive(Config.potionWarpWardID)) + { + int permwarp = Thaumcraft.proxy.getPlayerKnowledge().getWarpPerm(player.getCommandSenderName()); - if (permwarp == 0) return; + if (permwarp == 0) return; - // refresh period of base/warp (1/x type relationship) - float base = ConfigHandler.WARP_WAND_REFRESH_BASE; - float T = base / (float) permwarp; + // Exponential decay in the form 1/x + float base = ConfigHandler.WARP_WAND_REFRESH_BASE; + float period = base / (float) permwarp; - int rT = (T < 1.0F) ? 1 : Math.round(T); + int roundPeriod = (period < 1.0F) ? 1 : Math.round(period); - if (p.ticksExisted % rT == 0) for (int i = 0; i < primals.length; i++) - ((ItemWandCasting) s.getItem()).addVis(s, this.primals[i], 1, true); - } - } + if (player.ticksExisted % roundPeriod == 0) for (int i = 0; i < primals.length; i++) + ((ItemWandCasting) stack.getItem()).addVis(stack, this.primals[i], 1, true); + } + } } diff --git a/src/main/java/taintedmagic/common/helper/TaintedMagicHelper.java b/src/main/java/taintedmagic/common/helper/TaintedMagicHelper.java index aa46b5a..21a826a 100644 --- a/src/main/java/taintedmagic/common/helper/TaintedMagicHelper.java +++ b/src/main/java/taintedmagic/common/helper/TaintedMagicHelper.java @@ -13,48 +13,77 @@ import thaumcraft.common.items.wands.ItemWandCasting; public class TaintedMagicHelper { - public static AspectList getPrimals (int amount) - { - return new AspectList().add(Aspect.FIRE, amount).add(Aspect.WATER, amount).add(Aspect.EARTH, amount).add(Aspect.AIR, amount).add(Aspect.ORDER, amount).add(Aspect.ENTROPY, amount); - } + /** + * Returns an aspect list containing the specified amount of each primal aspect. + * + * @param amount The amount of each primal aspect. + */ + public static AspectList getPrimals (int amount) + { + return new AspectList().add(Aspect.FIRE, amount).add(Aspect.WATER, amount).add(Aspect.EARTH, amount) + .add(Aspect.AIR, amount).add(Aspect.ORDER, amount).add(Aspect.ENTROPY, amount); + } - public static boolean consumeVisFromInventory (EntityPlayer p, AspectList l, boolean b) - { - IInventory baubles = BaublesApi.getBaubles(p); + /** + * Returns true if the player has adaquate vis to be consumed from their inventory (wands, baubles, etc) + * + * @param player The player + * @param aspects The cost to be consumed + * @param doit Should the vis actually be consumed + */ + public static boolean consumeVisFromInventory (EntityPlayer player, AspectList aspects, boolean doit) + { + IInventory baubles = BaublesApi.getBaubles(player); - for (int a = 0; a < 4; a++) - { - if (baubles.getStackInSlot(a) != null && baubles.getStackInSlot(a).getItem() instanceof ItemAmuletVis) - { - if ( ((ItemAmuletVis) baubles.getStackInSlot(a).getItem()).consumeAllVis(baubles.getStackInSlot(a), p, l, b, true)) return true; - } + for (int i = 0; i < 4; i++) + { + if (baubles.getStackInSlot(i) != null && baubles.getStackInSlot(i).getItem() instanceof ItemAmuletVis) + { + if ( ((ItemAmuletVis) baubles.getStackInSlot(i).getItem()).consumeAllVis(baubles.getStackInSlot(i), player, + aspects, doit, true)) + return true; + } - } - for (int a = p.inventory.mainInventory.length - 1; a >= 0; a--) - { - ItemStack s = p.inventory.mainInventory[a]; - if (s != null && s.getItem() instanceof ItemWandCasting) - { - if ( ((ItemWandCasting) s.getItem()).consumeAllVis(s, p, l, b, true)) return true; - } - } - return false; - } + } + for (int i = 0; i < player.inventory.mainInventory.length; i++) + { + ItemStack stack = player.inventory.mainInventory[i]; + if (stack != null && stack.getItem() instanceof ItemWandCasting) + { + if ( ((ItemWandCasting) stack.getItem()).consumeAllVis(stack, player, aspects, doit, true)) return true; + } + } + return false; + } - public static Vector3 getVectorBetweenEntities (Entity e, Entity target) - { - Vector3 fromPosition = new Vector3(e.posX, e.posY, e.posZ); - Vector3 toPosition = new Vector3(target.posX, target.posY, target.posZ); - Vector3 dist = fromPosition.sub(toPosition); - dist.normalize(); - return dist; - } + /** + * Gets a vector between two entities. + * + * @param origin The origin entity. + * @param target The target entity. + */ + public static Vector3 getVectorBetweenEntities (Entity origin, Entity target) + { + Vector3 fromPosition = new Vector3(origin.posX, origin.posY, origin.posZ); + Vector3 toPosition = new Vector3(target.posX, target.posY, target.posZ); + Vector3 dist = fromPosition.sub(toPosition); + dist.normalize(); + return dist; + } - public static double getDistanceTo (double x, double y, double z, EntityPlayer p) - { - double distX = p.posX + 0.5D - x; - double distY = p.posY + 0.5D - y; - double distZ = p.posZ + 0.5D - z; - return distX * distX + distY * distY + distZ * distZ; - } + /** + * Gets the distance from the player to a point (x, y, z) + * + * @param player The player. + * @param x The X coordinate. + * @param y The Y coordinate. + * @param z The Z coordinate. + */ + public static double getDistanceTo (EntityPlayer player, double x, double y, double z) + { + double distX = player.posX - x; + double distY = player.posY - y; + double distZ = player.posZ - z; + return distX * distX + distY * distY + distZ * distZ; + } } diff --git a/src/main/java/taintedmagic/common/items/ItemCrimsonBlood.java b/src/main/java/taintedmagic/common/items/ItemCrimsonBlood.java index 269bbc7..dde7c0a 100644 --- a/src/main/java/taintedmagic/common/items/ItemCrimsonBlood.java +++ b/src/main/java/taintedmagic/common/items/ItemCrimsonBlood.java @@ -2,36 +2,25 @@ package taintedmagic.common.items; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumAction; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; -import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.DamageSource; -import net.minecraft.world.Explosion; -import net.minecraft.world.World; import taintedmagic.common.TaintedMagic; -import taintedmagic.common.registry.ItemRegistry; -import thaumcraft.common.config.Config; import thaumcraft.common.config.ConfigItems; public class ItemCrimsonBlood extends Item { - public ItemCrimsonBlood () - { - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setTextureName("taintedmagic:ItemCrimsonBlood"); - this.setUnlocalizedName("ItemCrimsonBlood"); - this.setContainerItem(ConfigItems.itemEssence); - } + public ItemCrimsonBlood () + { + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setTextureName("taintedmagic:ItemCrimsonBlood"); + this.setUnlocalizedName("ItemCrimsonBlood"); + this.setContainerItem(ConfigItems.itemEssence); + } - @SideOnly (Side.CLIENT) - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.uncommon; - } + @SideOnly (Side.CLIENT) + public EnumRarity getRarity (ItemStack stack) + { + return EnumRarity.uncommon; + } } diff --git a/src/main/java/taintedmagic/common/items/ItemFlyteCharm.java b/src/main/java/taintedmagic/common/items/ItemFlyteCharm.java index 8d7692f..fd0dbcc 100644 --- a/src/main/java/taintedmagic/common/items/ItemFlyteCharm.java +++ b/src/main/java/taintedmagic/common/items/ItemFlyteCharm.java @@ -14,7 +14,6 @@ import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.Vec3; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.LivingEvent; import taintedmagic.api.IRenderInventoryItem; @@ -29,8 +28,8 @@ public class ItemFlyteCharm extends Item implements IWarpingGear, IRenderInvento { // Vis used per tick while flying static final AspectList COST = new AspectList().add(Aspect.AIR, 15); - // Magic circle - private static final ResourceLocation circle = new ResourceLocation("taintedmagic:textures/misc/circle.png"); + // Magic circle texture + private static final ResourceLocation MAGIC_CIRCLE = new ResourceLocation("taintedmagic:textures/misc/circle.png"); public ItemFlyteCharm () { @@ -144,7 +143,7 @@ public class ItemFlyteCharm extends Item implements IWarpingGear, IRenderInvento GL11.glScalef(0.4F, 0.4F, 0.4F); GL11.glRotatef(player.ticksExisted + partialTicks, 0F, 1F, 0F); - UtilsFX.bindTexture(circle); + UtilsFX.bindTexture(MAGIC_CIRCLE); t.startDrawingQuads(); t.addVertexWithUV(-1, 0, -1, 0, 0); diff --git a/src/main/java/taintedmagic/common/items/ItemGatekey.java b/src/main/java/taintedmagic/common/items/ItemGatekey.java index 97bcdb1..1d950fd 100644 --- a/src/main/java/taintedmagic/common/items/ItemGatekey.java +++ b/src/main/java/taintedmagic/common/items/ItemGatekey.java @@ -1,18 +1,10 @@ package taintedmagic.common.items; import java.awt.Color; -import java.util.ArrayList; import java.util.List; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; @@ -26,24 +18,17 @@ import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraft.world.WorldProvider; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import taintedmagic.api.IHeldItemHUD; import taintedmagic.client.handler.ClientHandler; import taintedmagic.client.handler.HUDHandler; import taintedmagic.common.TaintedMagic; import thaumcraft.api.IWarpingGear; import thaumcraft.client.fx.ParticleEngine; import thaumcraft.client.fx.particles.FXSparkle; -import thaumcraft.client.lib.UtilsFX; -public class ItemGatekey extends Item implements IWarpingGear +public class ItemGateKey extends Item implements IWarpingGear { IIcon icon; IIcon overlay; @@ -54,15 +39,15 @@ public class ItemGatekey extends Item implements IWarpingGear private static final String TAG_DIM = "dimID"; private static final String TAG_COLOUR = "colour"; - public ItemGatekey () + public ItemGateKey () { this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setUnlocalizedName("ItemGatekey"); + this.setUnlocalizedName("ItemGateKey"); this.setMaxStackSize(1); } @SideOnly (Side.CLIENT) - public EnumRarity getRarity (ItemStack s) + public EnumRarity getRarity (ItemStack stack) { return TaintedMagic.rarityCreation; } @@ -70,8 +55,8 @@ public class ItemGatekey extends Item implements IWarpingGear @SideOnly (Side.CLIENT) public void registerIcons (IIconRegister ir) { - this.icon = ir.registerIcon("taintedmagic:ItemGatekey"); - this.overlay = ir.registerIcon("taintedmagic:ItemGatekey_overlay"); + this.icon = ir.registerIcon("taintedmagic:ItemGateKey"); + this.overlay = ir.registerIcon("taintedmagic:ItemGateKey_overlay"); } @SideOnly (Side.CLIENT) @@ -81,7 +66,7 @@ public class ItemGatekey extends Item implements IWarpingGear } @SideOnly (Side.CLIENT) - public int getRenderPasses (int m) + public int getRenderPasses (int meta) { return 2; } @@ -94,140 +79,140 @@ public class ItemGatekey extends Item implements IWarpingGear } @Override - public int getColorFromItemStack (ItemStack s, int pass) + public int getColorFromItemStack (ItemStack stack, int pass) { - if (pass == 1 && s.stackTagCompound != null) + if (pass == 1 && stack.stackTagCompound != null) { - return Color.HSBtoRGB((float) s.stackTagCompound.getInteger(TAG_COLOUR) / 360F, 1.0F, + return Color.HSBtoRGB((float) stack.stackTagCompound.getInteger(TAG_COLOUR) / 360F, 1.0F, 0.2F * (float) Math.sin((double) ClientHandler.ticks / 150D) + 0.8F); } return 0xFFFFFF; } @Override - public int getWarp (ItemStack s, EntityPlayer p) + public int getWarp (ItemStack stack, EntityPlayer player) { return 3; } @Override - public void addInformation (ItemStack s, EntityPlayer p, List l, boolean b) + public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean b) { - if (s.stackTagCompound != null) + if (stack.stackTagCompound != null) { - l.add(EnumChatFormatting.GREEN + StatCollector.translateToLocal("gatekey.bound")); + list.add(EnumChatFormatting.GREEN + StatCollector.translateToLocal("key.bound")); - int dim = s.stackTagCompound.getInteger(TAG_DIM); - l.add(WorldProvider.getProviderForDimension(dim).getDimensionName()); + int dim = stack.stackTagCompound.getInteger(TAG_DIM); + list.add(WorldProvider.getProviderForDimension(dim).getDimensionName()); - int x = s.stackTagCompound.getInteger(TAG_X); - int y = s.stackTagCompound.getInteger(TAG_Y); - int z = s.stackTagCompound.getInteger(TAG_Z); - l.add(x + ", " + y + ", " + z); + int x = stack.stackTagCompound.getInteger(TAG_X); + int y = stack.stackTagCompound.getInteger(TAG_Y); + int z = stack.stackTagCompound.getInteger(TAG_Z); + list.add(x + ", " + y + ", " + z); } - else l.add(EnumChatFormatting.RED + StatCollector.translateToLocal("gatekey.inactive")); + else list.add(EnumChatFormatting.RED + StatCollector.translateToLocal("key.unbound")); } @Override - public EnumAction getItemUseAction (ItemStack s) + public EnumAction getItemUseAction (ItemStack stack) { return EnumAction.bow; } @Override - public int getMaxItemUseDuration (ItemStack s) + public int getMaxItemUseDuration (ItemStack stack) { return 40; } @Override - public ItemStack onItemRightClick (ItemStack s, World w, EntityPlayer p) + public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player) { - if (s.stackTagCompound != null) p.setItemInUse(s, getMaxItemUseDuration(s)); - return s; + if (stack.stackTagCompound != null) player.setItemInUse(stack, getMaxItemUseDuration(stack)); + return stack; } @Override - public boolean onItemUse (ItemStack s, EntityPlayer p, World w, int x, int y, int z, int face, float hitX, float hitY, - float hitZ) + public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int face, float hitX, + float hitY, float hitZ) { - if (s.stackTagCompound == null) + if (stack.stackTagCompound == null) { - s.stackTagCompound = new NBTTagCompound(); + stack.stackTagCompound = new NBTTagCompound(); - s.stackTagCompound.setInteger(TAG_COLOUR, w.rand.nextInt(360) + 1); + stack.stackTagCompound.setInteger(TAG_COLOUR, world.rand.nextInt(360) + 1); - s.stackTagCompound.setInteger(TAG_X, x); - s.stackTagCompound.setInteger(TAG_Y, y + 1); - s.stackTagCompound.setInteger(TAG_Z, z); - s.stackTagCompound.setInteger(TAG_DIM, w.provider.dimensionId); + stack.stackTagCompound.setInteger(TAG_X, x); + stack.stackTagCompound.setInteger(TAG_Y, y + 1); + stack.stackTagCompound.setInteger(TAG_Z, z); + stack.stackTagCompound.setInteger(TAG_DIM, world.provider.dimensionId); - w.playSoundAtEntity(p, "thaumcraft:wand", 0.5F + ((float) Math.random() * 0.5F), 1.0F); + world.playSoundAtEntity(player, "thaumcraft:wand", 0.5F + ((float) Math.random() * 0.5F), 1.0F); - if (w.isRemote) + if (world.isRemote) { - p.swingItem(); + player.swingItem(); for (int a = 0; a < 9; a++) - sparkle(w, x + 0.5D, y, z + 0.5D); + sparkle(world, x + 0.5D, y, z + 0.5D); } } return false; } @SideOnly (Side.CLIENT) - public void sparkle (World w, double x, double y, double z) + public void sparkle (World world, double x, double y, double z) { - FXSparkle fx = new FXSparkle(w, x + 0.33F * w.rand.nextGaussian(), y + 0.5D + w.rand.nextFloat(), - z + 0.33F * w.rand.nextGaussian(), 1.75F, 6, 3 + w.rand.nextInt(3)); + FXSparkle fx = new FXSparkle(world, x + 0.33F * world.rand.nextGaussian(), y + 0.5D + world.rand.nextFloat(), + z + 0.33F * world.rand.nextGaussian(), 1.75F, 6, 3 + world.rand.nextInt(3)); fx.setGravity(0.1F); - ParticleEngine.instance.addEffect(w, fx); + ParticleEngine.instance.addEffect(world, fx); } @Override - public void onUsingTick (ItemStack s, EntityPlayer p, int i) + public void onUsingTick (ItemStack stack, EntityPlayer player, int i) { - super.onUsingTick(s, p, i); + super.onUsingTick(stack, player, i); - if (p.worldObj.isRemote) sparkle(p.worldObj, p.posX, p.boundingBox.minY, p.posZ); + if (player.worldObj.isRemote) sparkle(player.worldObj, player.posX, player.boundingBox.minY, player.posZ); float f = 1.0F + ((float) Math.random() * 0.25F); - if (p.ticksExisted % 5 == 0) p.worldObj.playSoundAtEntity(p, "thaumcraft:wind", f * 0.1F, f); + if (player.ticksExisted % 5 == 0) player.worldObj.playSoundAtEntity(player, "thaumcraft:wind", f * 0.1F, f); } @Override - public ItemStack onEaten (ItemStack s, World w, EntityPlayer p) + public ItemStack onEaten (ItemStack stack, World world, EntityPlayer player) { - super.onEaten(s, w, p); - if (s.stackTagCompound != null) + super.onEaten(stack, world, player); + if (stack.stackTagCompound != null) { - int x = s.stackTagCompound.getInteger(TAG_X); - int y = s.stackTagCompound.getInteger(TAG_Y); - int z = s.stackTagCompound.getInteger(TAG_Z); - int dim = s.stackTagCompound.getInteger(TAG_DIM); + int x = stack.stackTagCompound.getInteger(TAG_X); + int y = stack.stackTagCompound.getInteger(TAG_Y); + int z = stack.stackTagCompound.getInteger(TAG_Z); + int dim = stack.stackTagCompound.getInteger(TAG_DIM); - if (y > -1 && dim == w.provider.dimensionId && w.getBlock(x, y, z) == Blocks.air - && w.getBlock(x, y + 1, z) == Blocks.air) + if (y > -1 && dim == world.provider.dimensionId && world.getBlock(x, y, z) == Blocks.air + && world.getBlock(x, y + 1, z) == Blocks.air) { - if (!w.isRemote) + if (!world.isRemote) { - if (p instanceof EntityPlayerMP) - ((EntityPlayerMP) p).playerNetServerHandler.setPlayerLocation((double) x + 0.5D, (double) y, - (double) z + 0.5D, p.rotationYaw, p.rotationPitch); - w.playSoundAtEntity(p, "mob.endermen.portal", 5.0F, 1.0F); + if (player instanceof EntityPlayerMP) + ((EntityPlayerMP) player).playerNetServerHandler.setPlayerLocation((double) x + 0.5D, (double) y, + (double) z + 0.5D, player.rotationYaw, player.rotationPitch); + world.playSoundAtEntity(player, "mob.endermen.portal", 5.0F, 1.0F); } try { - p.addPotionEffect(new PotionEffect(Potion.confusion.id, 140, 1)); + player.addPotionEffect(new PotionEffect(Potion.confusion.id, 140, 1)); } catch (Exception e) { e.printStackTrace(); } } - else if (dim != w.provider.dimensionId) HUDHandler - .displayString(EnumChatFormatting.RED + StatCollector.translateToLocal("gatekey.invaliddim"), 300, false); - else HUDHandler.displayString(EnumChatFormatting.RED + StatCollector.translateToLocal("gatekey.error"), 300, false); + else if (dim != world.provider.dimensionId) HUDHandler + .displayString(EnumChatFormatting.RED + StatCollector.translateToLocal("key.invaliddim"), 300, false); + else HUDHandler.displayString(EnumChatFormatting.RED + StatCollector.translateToLocal("key.error"), 300, false); } - return s; + return stack; } } diff --git a/src/main/java/taintedmagic/common/items/ItemMagicFunguar.java b/src/main/java/taintedmagic/common/items/ItemMagicFunguar.java index 21bfecc..81d9876 100644 --- a/src/main/java/taintedmagic/common/items/ItemMagicFunguar.java +++ b/src/main/java/taintedmagic/common/items/ItemMagicFunguar.java @@ -21,53 +21,51 @@ import thaumcraft.common.lib.research.ResearchManager; public class ItemMagicFunguar extends ItemFood { - Aspect[] aspects = new Aspect[]{ - Aspect.AIR, - Aspect.EARTH, - Aspect.FIRE, - Aspect.WATER, - Aspect.ORDER, - Aspect.ENTROPY }; + Aspect aspects[] = Aspect.getPrimalAspects().toArray(new Aspect[0]); - public ItemMagicFunguar (int i, float j, boolean k) - { - super(i, j, k); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setTextureName("taintedmagic:ItemMagicFunguar"); - this.setAlwaysEdible(); - this.setUnlocalizedName("ItemMagicFunguar"); - } + public ItemMagicFunguar (int healAmount, float saturation, boolean b) + { + super(healAmount, saturation, b); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setTextureName("taintedmagic:ItemMagicFunguar"); + this.setAlwaysEdible(); + this.setUnlocalizedName("ItemMagicFunguar"); + } - @Override - protected void onFoodEaten (ItemStack s, World w, EntityPlayer p) - { - super.onFoodEaten(s, w, p); + @Override + protected void onFoodEaten (ItemStack stack, World world, EntityPlayer player) + { + super.onFoodEaten(stack, world, player); - Random r = new Random(); - try - { - p.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, 2)); - p.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 100, 2)); - p.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 100, 2)); - } - catch (Exception e) - { - e.printStackTrace(); - } + Random random = new Random(); + try + { + player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, 2)); + player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 100, 2)); + player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 100, 2)); + } + catch (Exception e) + { + e.printStackTrace(); + } - int i = r.nextInt(aspects.length); + int i = random.nextInt(aspects.length); - if (!w.isRemote) - { - Thaumcraft.proxy.playerKnowledge.addAspectPool(p.getCommandSenderName(), aspects[i], Short.valueOf((short) (1))); - ResearchManager.scheduleSave(p); - PacketHandler.INSTANCE.sendTo(new PacketAspectPool(aspects[i].getTag(), Short.valueOf((short) 1), Short.valueOf(Thaumcraft.proxy.playerKnowledge.getAspectPoolFor(p.getCommandSenderName(), aspects[i]))), (EntityPlayerMP) p); - } - } + if (!world.isRemote) + { + Thaumcraft.proxy.playerKnowledge.addAspectPool(player.getCommandSenderName(), aspects[i], + Short.valueOf((short) (1))); + ResearchManager.scheduleSave(player); + PacketHandler.INSTANCE.sendTo( + new PacketAspectPool(aspects[i].getTag(), Short.valueOf((short) 1), Short.valueOf( + Thaumcraft.proxy.playerKnowledge.getAspectPoolFor(player.getCommandSenderName(), aspects[i]))), + (EntityPlayerMP) player); + } + } - @SideOnly (Side.CLIENT) - public EnumRarity getRarity (ItemStack itemstack) - { - return EnumRarity.uncommon; - } + @SideOnly (Side.CLIENT) + public EnumRarity getRarity (ItemStack stack) + { + return EnumRarity.uncommon; + } } diff --git a/src/main/java/taintedmagic/common/items/ItemMaterial.java b/src/main/java/taintedmagic/common/items/ItemMaterial.java index 9d0c842..eddd781 100644 --- a/src/main/java/taintedmagic/common/items/ItemMaterial.java +++ b/src/main/java/taintedmagic/common/items/ItemMaterial.java @@ -14,88 +14,100 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import taintedmagic.common.TaintedMagic; -import thaumcraft.common.config.ConfigItems; public class ItemMaterial extends Item { - public int SUBTYPES = 13; - public IIcon[] icons = new IIcon[SUBTYPES]; + int SUBTYPES = 13; + /** + * 0 Shadow Metal Ingot + * 1 Shadow-imbued Cloth + * 2 Crimson-stained Cloth + * 3 Warped Unbalanced Shard + * 4 Tainted Unbalanced Shard + * 5 Shard of Creation + * 6 Thaumic Alloy Plate + * 7 Crimson Alloy Plate + * 8 Shadow Metal Nugget + * 9 Primordial Nodule + * 10 Primordial Mote + * 11 Fragment of Creation + * 12 Warping Fertilizer + */ + IIcon[] icons = new IIcon[SUBTYPES]; - public ItemMaterial () - { - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setUnlocalizedName("ItemMaterial"); - this.setHasSubtypes(true); - } + public ItemMaterial () + { + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setUnlocalizedName("ItemMaterial"); + this.setHasSubtypes(true); + } - public EnumRarity getRarity (ItemStack s) - { - int m = s.getItemDamage(); - switch (m) - { - case 0 : - return EnumRarity.uncommon; - case 1 : - return EnumRarity.uncommon; - case 2 : - return EnumRarity.uncommon; - case 3 : - return EnumRarity.common; - case 4 : - return EnumRarity.common; - case 5 : - return TaintedMagic.rarityCreation; - case 6 : - return EnumRarity.uncommon; - case 7 : - return EnumRarity.uncommon; - case 8 : - return EnumRarity.uncommon; - case 9 : - return EnumRarity.epic; - case 10 : - return EnumRarity.epic; - case 11 : - return TaintedMagic.rarityCreation; - case 12: - return EnumRarity.uncommon; - } - return EnumRarity.common; - } + public EnumRarity getRarity (ItemStack stack) + { + int meta = stack.getItemDamage(); + switch (meta) + { + case 0 : + return EnumRarity.uncommon; + case 1 : + return EnumRarity.uncommon; + case 2 : + return EnumRarity.uncommon; + case 3 : + return EnumRarity.common; + case 4 : + return EnumRarity.common; + case 5 : + return TaintedMagic.rarityCreation; + case 6 : + return EnumRarity.uncommon; + case 7 : + return EnumRarity.uncommon; + case 8 : + return EnumRarity.uncommon; + case 9 : + return EnumRarity.epic; + case 10 : + return EnumRarity.epic; + case 11 : + return TaintedMagic.rarityCreation; + case 12 : + return EnumRarity.uncommon; + } + return EnumRarity.common; + } - @SideOnly (Side.CLIENT) - public void registerIcons (IIconRegister ir) - { - for (int i = 0; i < icons.length; i++) - this.icons[i] = ir.registerIcon("taintedmagic:ItemMaterial" + i); - } + @SideOnly (Side.CLIENT) + public void registerIcons (IIconRegister ir) + { + for (int i = 0; i < icons.length; i++) + this.icons[i] = ir.registerIcon("taintedmagic:ItemMaterial" + i); + } - @SideOnly (Side.CLIENT) - public IIcon getIconFromDamage (int i) - { - return this.icons[i]; - } + @SideOnly (Side.CLIENT) + public IIcon getIconFromDamage (int meta) + { + return this.icons[meta]; + } - @Override - public void addInformation (ItemStack s, EntityPlayer p, List l, boolean b) - { - super.addInformation(s, p, l, b); + @Override + public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean b) + { + super.addInformation(stack, player, list, b); - if (s.getItemDamage() == 5) - { - l.add(EnumChatFormatting.LIGHT_PURPLE + StatCollector.translateToLocal("text.shard.1")); - } - } + if (stack.getItemDamage() == 5) + list.add(EnumChatFormatting.LIGHT_PURPLE + StatCollector.translateToLocal("text.shard.1")); + } - @SideOnly (Side.CLIENT) - public void getSubItems (Item item, CreativeTabs c, List l) - { - for (int i = 0; i < SUBTYPES; i++) - l.add(new ItemStack(this, 1, i)); - } + @SideOnly (Side.CLIENT) + public void getSubItems (Item item, CreativeTabs tab, List list) + { + for (int i = 0; i < SUBTYPES; i++) + list.add(new ItemStack(this, 1, i)); + } - public String getUnlocalizedName (ItemStack s) - { - return super.getUnlocalizedName() + "." + s.getItemDamage(); - } + public String getUnlocalizedName (ItemStack stack) + { + return super.getUnlocalizedName() + "." + stack.getItemDamage(); + } } diff --git a/src/main/java/taintedmagic/common/items/ItemNightshadeBerries.java b/src/main/java/taintedmagic/common/items/ItemNightshadeBerries.java index b735bbc..9d63465 100644 --- a/src/main/java/taintedmagic/common/items/ItemNightshadeBerries.java +++ b/src/main/java/taintedmagic/common/items/ItemNightshadeBerries.java @@ -12,25 +12,25 @@ import taintedmagic.common.TaintedMagic; public class ItemNightshadeBerries extends ItemFood { - public ItemNightshadeBerries (int i, float j, boolean k) - { - super(i, j, k); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setUnlocalizedName("ItemNightshadeBerries"); - this.setTextureName("taintedmagic:ItemNightshadeBerries"); - this.setAlwaysEdible(); - } + public ItemNightshadeBerries (int healAmount, float saturation, boolean b) + { + super(healAmount, saturation, b); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setUnlocalizedName("ItemNightshadeBerries"); + this.setTextureName("taintedmagic:ItemNightshadeBerries"); + this.setAlwaysEdible(); + } - @SideOnly (Side.CLIENT) - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.uncommon; - } + @SideOnly (Side.CLIENT) + public EnumRarity getRarity (ItemStack stack) + { + return EnumRarity.uncommon; + } - @Override - protected void onFoodEaten (ItemStack s, World w, EntityPlayer p) - { - super.onFoodEaten(s, w, p); - if (!w.isRemote) p.attackEntityFrom(new DamageSource("nightshade"), Float.MAX_VALUE); - } + @Override + protected void onFoodEaten (ItemStack stack, World world, EntityPlayer player) + { + super.onFoodEaten(stack, world, player); + if (!world.isRemote) player.attackEntityFrom(new DamageSource("nightshade"), Short.MAX_VALUE); + } } diff --git a/src/main/java/taintedmagic/common/items/ItemSalis.java b/src/main/java/taintedmagic/common/items/ItemSalis.java index c9e121d..af9f273 100644 --- a/src/main/java/taintedmagic/common/items/ItemSalis.java +++ b/src/main/java/taintedmagic/common/items/ItemSalis.java @@ -19,8 +19,8 @@ import thaumcraft.client.fx.particles.FXSparkle; public class ItemSalis extends Item { - public int SUBTYPES = 2; - public IIcon[] icons = new IIcon[SUBTYPES]; + int SUBTYPES = 2; + IIcon[] icons = new IIcon[SUBTYPES]; public ItemSalis () { @@ -30,7 +30,7 @@ public class ItemSalis extends Item } @Override - public EnumRarity getRarity (ItemStack s) + public EnumRarity getRarity (ItemStack stack) { return TaintedMagic.rarityCreation; } @@ -43,66 +43,67 @@ public class ItemSalis extends Item } @SideOnly (Side.CLIENT) - public IIcon getIconFromDamage (int i) + public IIcon getIconFromDamage (int meta) { - return this.icons[i]; + return this.icons[meta]; } @SideOnly (Side.CLIENT) - public void getSubItems (Item item, CreativeTabs c, List l) + public void getSubItems (Item item, CreativeTabs tab, List list) { for (int i = 0; i < SUBTYPES; i++) - l.add(new ItemStack(this, 1, i)); + list.add(new ItemStack(this, 1, i)); } - public String getUnlocalizedName (ItemStack s) + public String getUnlocalizedName (ItemStack stack) { - return super.getUnlocalizedName() + "." + s.getItemDamage(); + return super.getUnlocalizedName() + "." + stack.getItemDamage(); } @Override - public ItemStack onItemRightClick (ItemStack s, World w, EntityPlayer p) + public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player) { - int m = s.getItemDamage(); - switch (m) + int meta = stack.getItemDamage(); + switch (meta) { // Weather case 0 : { - w.getWorldInfo().setRainTime(w.isRaining() ? 24000 : 0); - w.getWorldInfo().setRaining(!w.isRaining()); - p.playSound("thaumcraft:wind", 0.3F, 1.0F + w.rand.nextFloat() * 0.5F); - throwParticles(w, p, 7); - p.inventory.decrStackSize(p.inventory.currentItem, 1); - return s; + world.getWorldInfo().setRainTime(world.isRaining() ? 24000 : 0); + world.getWorldInfo().setRaining(!world.isRaining()); + player.playSound("thaumcraft:wind", 0.3F, 1.0F + world.rand.nextFloat() * 0.5F); + throwParticles(world, player, 7); + player.inventory.decrStackSize(player.inventory.currentItem, 1); + return stack; } // Time case 1 : { - w.setWorldTime(w.isDaytime() ? 14000 : 24000); - p.playSound("thaumcraft:wind", 0.3F, 1.0F + w.rand.nextFloat() * 0.5F); - throwParticles(w, p, 6); - p.inventory.decrStackSize(p.inventory.currentItem, 1); - return s; + world.setWorldTime(world.isDaytime() ? 14000 : 24000); + player.playSound("thaumcraft:wind", 0.3F, 1.0F + world.rand.nextFloat() * 0.5F); + throwParticles(world, player, 6); + player.inventory.decrStackSize(player.inventory.currentItem, 1); + return stack; } } - return s; + return stack; } @SideOnly (Side.CLIENT) - private void throwParticles (World w, EntityPlayer p, int colour) + private void throwParticles (World world, EntityPlayer player, int colour) { for (int a = 0; a < 15; a++) { - FXSparkle fx = new FXSparkle(w, p.posX + (w.rand.nextDouble() - w.rand.nextDouble()) * 0.2D, - p.boundingBox.minY + 1.25D + (w.rand.nextDouble() - w.rand.nextDouble()) * 0.2D, - p.posZ + (w.rand.nextDouble() - w.rand.nextDouble()) * 0.2D, 1.75F, colour, 3 + w.rand.nextInt(3)); - Vec3 look = p.getLookVec(); - fx.motionX += (look.xCoord * 0.5D) + (w.rand.nextGaussian() * 0.05D); - fx.motionY += (look.yCoord * 0.5D) + (w.rand.nextGaussian() * 0.05D); - fx.motionZ += (look.zCoord * 0.5D) + (w.rand.nextGaussian() * 0.05D); + FXSparkle fx = new FXSparkle(world, player.posX + (world.rand.nextDouble() - world.rand.nextDouble()) * 0.2D, + player.boundingBox.minY + 1.25D + (world.rand.nextDouble() - world.rand.nextDouble()) * 0.2D, + player.posZ + (world.rand.nextDouble() - world.rand.nextDouble()) * 0.2D, 1.75F, colour, + 3 + world.rand.nextInt(3)); + Vec3 look = player.getLookVec(); + fx.motionX += (look.xCoord * 0.5D) + (world.rand.nextGaussian() * 0.05D); + fx.motionY += (look.yCoord * 0.5D) + (world.rand.nextGaussian() * 0.05D); + fx.motionZ += (look.zCoord * 0.5D) + (world.rand.nextGaussian() * 0.05D); fx.setGravity(0.5F); - ParticleEngine.instance.addEffect(w, fx); + ParticleEngine.instance.addEffect(world, fx); } } } diff --git a/src/main/java/taintedmagic/common/items/ItemVoidBlood.java b/src/main/java/taintedmagic/common/items/ItemVoidBlood.java new file mode 100644 index 0000000..c8dd121 --- /dev/null +++ b/src/main/java/taintedmagic/common/items/ItemVoidBlood.java @@ -0,0 +1,33 @@ +package taintedmagic.common.items; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.RecipeSorter; +import net.minecraftforge.oredict.RecipeSorter.Category; +import taintedmagic.api.RecipeVoidBlood; +import taintedmagic.common.TaintedMagic; +import thaumcraft.common.config.ConfigItems; + +public class ItemVoidBlood extends Item +{ + public ItemVoidBlood () + { + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setTextureName("taintedmagic:ItemVoidBlood"); + this.setUnlocalizedName("ItemVoidBlood"); + this.setContainerItem(ConfigItems.itemEssence); + + GameRegistry.addRecipe(new RecipeVoidBlood()); + RecipeSorter.register("taintedmagic:ItemVoidBlood", RecipeVoidBlood.class, Category.SHAPELESS, ""); + } + + @SideOnly (Side.CLIENT) + public EnumRarity getRarity (ItemStack stack) + { + return EnumRarity.rare; + } +} diff --git a/src/main/java/taintedmagic/common/items/ItemVoidsentBlood.java b/src/main/java/taintedmagic/common/items/ItemVoidsentBlood.java deleted file mode 100644 index 566843f..0000000 --- a/src/main/java/taintedmagic/common/items/ItemVoidsentBlood.java +++ /dev/null @@ -1,38 +0,0 @@ -package taintedmagic.common.items; - -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumAction; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemFood; -import net.minecraft.item.ItemPotion; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.oredict.RecipeSorter; -import net.minecraftforge.oredict.RecipeSorter.Category; -import taintedmagic.api.RecipeVoidsentBlood; -import taintedmagic.common.TaintedMagic; -import thaumcraft.common.config.ConfigItems; - -public class ItemVoidsentBlood extends Item -{ - public ItemVoidsentBlood () - { - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setTextureName("taintedmagic:ItemVoidsentBlood"); - this.setUnlocalizedName("ItemVoidsentBlood"); - this.setContainerItem(ConfigItems.itemEssence); - - GameRegistry.addRecipe(new RecipeVoidsentBlood()); - RecipeSorter.register("taintedmagic:ItemVoidsentBlood", RecipeVoidsentBlood.class, Category.SHAPELESS, ""); - } - - @SideOnly (Side.CLIENT) - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.rare; - } -} diff --git a/src/main/java/taintedmagic/common/items/blocks/ItemBlockShadowOre.java b/src/main/java/taintedmagic/common/items/blocks/ItemBlockShadowOre.java deleted file mode 100644 index 9d0ba93..0000000 --- a/src/main/java/taintedmagic/common/items/blocks/ItemBlockShadowOre.java +++ /dev/null @@ -1,22 +0,0 @@ -package taintedmagic.common.items.blocks; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.block.Block; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; - -public class ItemBlockShadowOre extends ItemBlock -{ - public ItemBlockShadowOre (Block b) - { - super(b); - } - - @SideOnly (Side.CLIENT) - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.uncommon; - } -} diff --git a/src/main/java/taintedmagic/common/items/blocks/ItemBlockWarpwoodSapling.java b/src/main/java/taintedmagic/common/items/blocks/ItemBlockWarpwoodSapling.java deleted file mode 100644 index e942e10..0000000 --- a/src/main/java/taintedmagic/common/items/blocks/ItemBlockWarpwoodSapling.java +++ /dev/null @@ -1,22 +0,0 @@ -package taintedmagic.common.items.blocks; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.block.Block; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; - -public class ItemBlockWarpwoodSapling extends ItemBlock -{ - public ItemBlockWarpwoodSapling (Block b) - { - super(b); - } - - @SideOnly (Side.CLIENT) - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.uncommon; - } -} diff --git a/src/main/java/taintedmagic/common/items/equipment/ItemLumosRing.java b/src/main/java/taintedmagic/common/items/equipment/ItemLumosRing.java index cd89b3b..a47e12e 100644 --- a/src/main/java/taintedmagic/common/items/equipment/ItemLumosRing.java +++ b/src/main/java/taintedmagic/common/items/equipment/ItemLumosRing.java @@ -12,51 +12,51 @@ import taintedmagic.common.TaintedMagic; public class ItemLumosRing extends Item implements IBauble { - public ItemLumosRing () - { - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setTextureName("taintedmagic:ItemLumosRing"); - this.setMaxDamage(-1); - this.setMaxStackSize(1); - this.setUnlocalizedName("ItemLumosRing"); - } + public ItemLumosRing () + { + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setTextureName("taintedmagic:ItemLumosRing"); + this.setMaxDamage(-1); + this.setMaxStackSize(1); + this.setUnlocalizedName("ItemLumosRing"); + } - @SideOnly (Side.CLIENT) - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.uncommon; - } + @SideOnly (Side.CLIENT) + public EnumRarity getRarity (ItemStack stack) + { + return EnumRarity.uncommon; + } - @Override - public boolean canEquip (ItemStack s, EntityLivingBase e) - { - return true; - } + @Override + public boolean canEquip (ItemStack stack, EntityLivingBase entity) + { + return true; + } - @Override - public boolean canUnequip (ItemStack s, EntityLivingBase e) - { - return true; - } + @Override + public boolean canUnequip (ItemStack stack, EntityLivingBase entity) + { + return true; + } - @Override - public BaubleType getBaubleType (ItemStack s) - { - return BaubleType.RING; - } + @Override + public BaubleType getBaubleType (ItemStack stack) + { + return BaubleType.RING; + } - @Override - public void onEquipped (ItemStack s, EntityLivingBase e) - { - } + @Override + public void onEquipped (ItemStack stack, EntityLivingBase entity) + { + } - @Override - public void onUnequipped (ItemStack s, EntityLivingBase e) - { - } + @Override + public void onUnequipped (ItemStack stack, EntityLivingBase entity) + { + } - @Override - public void onWornTick (ItemStack s, EntityLivingBase e) - { - } + @Override + public void onWornTick (ItemStack stack, EntityLivingBase entity) + { + } } diff --git a/src/main/java/taintedmagic/common/items/equipment/ItemShadowFortressArmor.java b/src/main/java/taintedmagic/common/items/equipment/ItemShadowFortressArmor.java index c1626ed..f1a2e92 100644 --- a/src/main/java/taintedmagic/common/items/equipment/ItemShadowFortressArmor.java +++ b/src/main/java/taintedmagic/common/items/equipment/ItemShadowFortressArmor.java @@ -23,103 +23,103 @@ import thaumcraft.common.items.armor.ItemFortressArmor; public class ItemShadowFortressArmor extends ItemFortressArmor implements IWarpingGear, IVisDiscountGear, ISpecialArmor { - public ItemShadowFortressArmor (ArmorMaterial m, int j, int k) - { - super(m, j, k); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - } + public ItemShadowFortressArmor (ArmorMaterial material, int j, int k) + { + super(material, j, k); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + } - @SideOnly (Side.CLIENT) - public void registerIcons (IIconRegister ir) - { - this.iconHelm = ir.registerIcon("taintedmagic:ItemShadowFortressHelmet"); - this.iconChest = ir.registerIcon("taintedmagic:ItemShadowFortressChestplate"); - this.iconLegs = ir.registerIcon("taintedmagic:ItemShadowFortressLeggings"); - } + @SideOnly (Side.CLIENT) + public void registerIcons (IIconRegister ir) + { + this.iconHelm = ir.registerIcon("taintedmagic:ItemShadowFortressHelmet"); + this.iconChest = ir.registerIcon("taintedmagic:ItemShadowFortressChestplate"); + this.iconLegs = ir.registerIcon("taintedmagic:ItemShadowFortressLeggings"); + } - public void addInformation (ItemStack s, EntityPlayer p, List l, boolean b) - { - l.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("tc.visdiscount") + ": " + getVisDiscount(s, p, null) + "%"); - super.addInformation(s, p, l, b); - } + public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean b) + { + list.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("tc.visdiscount") + ": " + + getVisDiscount(stack, player, null) + "%"); + super.addInformation(stack, player, list, b); + } - public String getArmorTexture (ItemStack s, Entity e, int slot, String t) - { - return "taintedmagic:textures/models/ModelShadowFortressArmor.png"; - } + public String getArmorTexture (ItemStack stack, Entity entity, int slot, String type) + { + return "taintedmagic:textures/models/ModelShadowFortressArmor.png"; + } - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.epic; - } + public EnumRarity getRarity (ItemStack stack) + { + return EnumRarity.epic; + } - public boolean getIsRepairable (ItemStack s, ItemStack s2) - { - return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true : super.getIsRepairable(s, s2); - } + public boolean getIsRepairable (ItemStack stack, ItemStack repairItem) + { + return repairItem.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial, 1, 0)) ? true + : super.getIsRepairable(stack, repairItem); + } - @Override - public int getVisDiscount (ItemStack s, EntityPlayer p, Aspect a) - { - return 5; - } + @Override + public int getVisDiscount (ItemStack stack, EntityPlayer player, Aspect aspect) + { + return 5; + } - @Override - public int getWarp (ItemStack s, EntityPlayer p) - { - return 5; - } + @Override + public int getWarp (ItemStack stack, EntityPlayer player) + { + return 5; + } - @Override - public ISpecialArmor.ArmorProperties getProperties (EntityLivingBase p, ItemStack s, DamageSource source, double dmg, int slot) - { - int priority = 0; - double ratio = this.damageReduceAmount / 25.0D; + @Override + public ISpecialArmor.ArmorProperties getProperties (EntityLivingBase entity, ItemStack stack, DamageSource source, + double dmg, int slot) + { + int priority = 0; + double ratio = this.damageReduceAmount / 25.0D; - if (source.isMagicDamage() == true) - { - priority = 1; - ratio = this.damageReduceAmount / 35.0D; - } - else if ( (source.isFireDamage() == true) || (source.isExplosion())) - { - priority = 1; - ratio = this.damageReduceAmount / 20.0D; - } - else if (source.isUnblockable()) - { - priority = 0; - ratio = 0.0D; - } + if (source.isMagicDamage()) + { + priority = 1; + ratio = this.damageReduceAmount / 35.0D; + } + else if (source.isFireDamage() || source.isExplosion()) + { + priority = 1; + ratio = this.damageReduceAmount / 20.0D; + } + else if (source.isUnblockable()) + { + priority = 0; + ratio = 0.0D; + } - if ( (p instanceof EntityPlayer)) - { - double set = 0.875D; - for (int a = 1; a < 4; a++) - { - ItemStack piece = ((EntityPlayer) p).inventory.armorInventory[a]; - if ( (piece != null) && ( (piece.getItem() instanceof ItemFortressArmor))) - { - set += 0.250D; - if ( (piece.hasTagCompound()) && (piece.stackTagCompound.hasKey("mask"))) - { - set += 0.05D; - } - } - } - ratio *= set; - } + if (entity instanceof EntityPlayer) + { + double set = 0.875D; + for (int a = 1; a < 4; a++) + { + ItemStack piece = ((EntityPlayer) entity).inventory.armorInventory[a]; + if (piece != null && piece.getItem() instanceof ItemFortressArmor) + { + set += 0.250D; + if (piece.hasTagCompound() && piece.stackTagCompound.hasKey("mask")) set += 0.05D; + } + } + ratio *= set; + } - return new ISpecialArmor.ArmorProperties(priority, ratio, s.getMaxDamage() + 1 - s.getItemDamage()); - } + return new ISpecialArmor.ArmorProperties(priority, ratio, stack.getMaxDamage() + 1 - stack.getItemDamage()); + } - public int getArmorDisplay (EntityPlayer p, ItemStack s, int slot) - { - return this.damageReduceAmount; - } + public int getArmorDisplay (EntityPlayer player, ItemStack stack, int slot) + { + return this.damageReduceAmount; + } - public void damageArmor (EntityLivingBase e, ItemStack s, DamageSource source, int dmg, int slot) - { - if (source != DamageSource.fall) s.damageItem(dmg, e); - } + public void damageArmor (EntityLivingBase entity, ItemStack stack, DamageSource source, int dmg, int slot) + { + if (source != DamageSource.fall) stack.damageItem(dmg, entity); + } } \ No newline at end of file diff --git a/src/main/java/taintedmagic/common/items/equipment/ItemVoidFortressArmor.java b/src/main/java/taintedmagic/common/items/equipment/ItemVoidFortressArmor.java index e90ad31..c18b9d2 100644 --- a/src/main/java/taintedmagic/common/items/equipment/ItemVoidFortressArmor.java +++ b/src/main/java/taintedmagic/common/items/equipment/ItemVoidFortressArmor.java @@ -15,64 +15,66 @@ import net.minecraft.world.World; import taintedmagic.common.TaintedMagic; import thaumcraft.api.IVisDiscountGear; import thaumcraft.api.IWarpingGear; -import thaumcraft.api.ItemApi; import thaumcraft.api.aspects.Aspect; +import thaumcraft.common.config.ConfigItems; import thaumcraft.common.items.armor.ItemFortressArmor; public class ItemVoidFortressArmor extends ItemFortressArmor implements IWarpingGear, IVisDiscountGear { - public ItemVoidFortressArmor (ArmorMaterial m, int j, int k) - { - super(m, j, k); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - } + public ItemVoidFortressArmor (ArmorMaterial material, int j, int k) + { + super(material, j, k); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + } - @SideOnly (Side.CLIENT) - public void registerIcons (IIconRegister ir) - { - this.iconHelm = ir.registerIcon("taintedmagic:ItemVoidFortressHelmet"); - this.iconChest = ir.registerIcon("taintedmagic:ItemVoidFortressChestplate"); - this.iconLegs = ir.registerIcon("taintedmagic:ItemVoidFortressLeggings"); - } + @SideOnly (Side.CLIENT) + public void registerIcons (IIconRegister ir) + { + this.iconHelm = ir.registerIcon("taintedmagic:ItemVoidFortressHelmet"); + this.iconChest = ir.registerIcon("taintedmagic:ItemVoidFortressChestplate"); + this.iconLegs = ir.registerIcon("taintedmagic:ItemVoidFortressLeggings"); + } - public void addInformation (ItemStack s, EntityPlayer p, List l, boolean b) - { - l.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("tc.visdiscount") + ": " + getVisDiscount(s, p, null) + "%"); - super.addInformation(s, p, l, b); - } + public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean b) + { + list.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("tc.visdiscount") + ": " + + getVisDiscount(stack, player, null) + "%"); + super.addInformation(stack, player, list, b); + } - public String getArmorTexture (ItemStack s, Entity e, int slot, String t) - { - return "taintedmagic:textures/models/ModelVoidFortressArmor.png"; - } + public String getArmorTexture (ItemStack stack, Entity entity, int slot, String type) + { + return "taintedmagic:textures/models/ModelVoidFortressArmor.png"; + } - public boolean getIsRepairable (ItemStack s, ItemStack s2) - { - return s2.isItemEqual(ItemApi.getItem("itemResource", 16)) ? true : super.getIsRepairable(s, s2); - } + public boolean getIsRepairable (ItemStack stack, ItemStack repairItem) + { + return repairItem.isItemEqual(new ItemStack(ConfigItems.itemResource, 1, 16)) ? true + : super.getIsRepairable(stack, repairItem); + } - public void onUpdate (ItemStack s, World w, Entity e, int j, boolean k) - { - super.onUpdate(s, w, e, j, k); + public void onUpdate (ItemStack stack, World world, Entity entity, int i, boolean b) + { + super.onUpdate(stack, world, entity, i, b); + if (!world.isRemote && stack.isItemDamaged() && entity.ticksExisted % 20 == 0 && entity instanceof EntityLivingBase) + stack.damageItem(-1, (EntityLivingBase) entity); + } - if ( (!w.isRemote) && (s.isItemDamaged()) && (e.ticksExisted % 20 == 0) && ( (e instanceof EntityLivingBase))) s.damageItem(-1, (EntityLivingBase) e); - } + public void onArmorTick (World world, EntityPlayer player, ItemStack stack) + { + super.onArmorTick(world, player, stack); + if (!world.isRemote && stack.isItemDamaged() && player.ticksExisted % 20 == 0) stack.damageItem(-1, player); + } - public void onArmorTick (World w, EntityPlayer p, ItemStack s) - { - super.onArmorTick(w, p, s); - if ( (!w.isRemote) && (s.getItemDamage() > 0) && (p.ticksExisted % 20 == 0)) s.damageItem(-1, p); - } + @Override + public int getWarp (ItemStack stack, EntityPlayer player) + { + return 3; + } - @Override - public int getWarp (ItemStack s, EntityPlayer p) - { - return 3; - } - - @Override - public int getVisDiscount (ItemStack s, EntityPlayer p, Aspect a) - { - return 5; - } + @Override + public int getVisDiscount (ItemStack stack, EntityPlayer player, Aspect aspect) + { + return 5; + } } \ No newline at end of file diff --git a/src/main/java/taintedmagic/common/items/equipment/ItemVoidmetalGoggles.java b/src/main/java/taintedmagic/common/items/equipment/ItemVoidmetalGoggles.java index 0f80086..e4bced1 100644 --- a/src/main/java/taintedmagic/common/items/equipment/ItemVoidmetalGoggles.java +++ b/src/main/java/taintedmagic/common/items/equipment/ItemVoidmetalGoggles.java @@ -16,51 +16,51 @@ import thaumcraft.common.items.armor.ItemGoggles; public class ItemVoidmetalGoggles extends ItemGoggles implements IWarpingGear { - public ItemVoidmetalGoggles (ArmorMaterial m, int j, int k) - { - super(m, j, k); - this.setMaxDamage(250); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setUnlocalizedName("ItemVoidmetalGoggles"); - } + public ItemVoidmetalGoggles (ArmorMaterial material, int j, int k) + { + super(material, j, k); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setUnlocalizedName("ItemVoidmetalGoggles"); + } - @SideOnly (Side.CLIENT) - public void registerIcons (IIconRegister ir) - { - this.icon = ir.registerIcon("taintedmagic:ItemVoidmetalGoggles"); - } + @SideOnly (Side.CLIENT) + public void registerIcons (IIconRegister ir) + { + this.icon = ir.registerIcon("taintedmagic:ItemVoidmetalGoggles"); + } - public String getArmorTexture (ItemStack s, Entity e, int slot, String type) - { - return "taintedmagic:textures/models/ModelVoidmetalGoggles.png"; - } + public String getArmorTexture (ItemStack stack, Entity entity, int slot, String type) + { + return "taintedmagic:textures/models/ModelVoidmetalGoggles.png"; + } - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.rare; - } + public EnumRarity getRarity (ItemStack stack) + { + return EnumRarity.rare; + } - @Override - public int getWarp (ItemStack s, EntityPlayer p) - { - return 5; - } + @Override + public int getWarp (ItemStack stack, EntityPlayer player) + { + return 5; + } - @Override - public int getVisDiscount (ItemStack stack, EntityPlayer player, Aspect aspect) - { - return 10; - } + @Override + public int getVisDiscount (ItemStack stack, EntityPlayer player, Aspect aspect) + { + return 12; + } - public void onUpdate (ItemStack s, World w, Entity e, int j, boolean k) - { - super.onUpdate(s, w, e, j, k); - if (!w.isRemote && s.isItemDamaged() && e.ticksExisted % 20 == 0 && e instanceof EntityLivingBase) s.damageItem(-1, (EntityLivingBase) e); - } + public void onUpdate (ItemStack stack, World world, Entity entity, int i, boolean b) + { + super.onUpdate(stack, world, entity, i, b); + if (!world.isRemote && stack.isItemDamaged() && entity.ticksExisted % 20 == 0 && entity instanceof EntityLivingBase) + stack.damageItem(-1, (EntityLivingBase) entity); + } - public void onArmorTick (World w, EntityPlayer p, ItemStack s) - { - super.onArmorTick(w, p, s); - if (!w.isRemote && s.getItemDamage() > 0 && p.ticksExisted % 20 == 0) s.damageItem(-1, p); - } + public void onArmorTick (World world, EntityPlayer player, ItemStack stack) + { + super.onArmorTick(world, player, stack); + if (!world.isRemote && stack.isItemDamaged() && player.ticksExisted % 20 == 0) stack.damageItem(-1, player); + } } diff --git a/src/main/java/taintedmagic/common/items/equipment/ItemVoidwalkerBoots.java b/src/main/java/taintedmagic/common/items/equipment/ItemVoidwalkerBoots.java index 76fe2aa..38668de 100644 --- a/src/main/java/taintedmagic/common/items/equipment/ItemVoidwalkerBoots.java +++ b/src/main/java/taintedmagic/common/items/equipment/ItemVoidwalkerBoots.java @@ -2,6 +2,7 @@ package taintedmagic.common.items.equipment; import java.util.List; +import baubles.common.lib.PlayerHandler; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -33,9 +34,9 @@ import thaumcraft.common.items.armor.Hover; public class ItemVoidwalkerBoots extends ItemArmor implements IVisDiscountGear, IWarpingGear, IRunicArmor, IRepairable, ISpecialArmor { - public ItemVoidwalkerBoots (ArmorMaterial m, int j, int k) + public ItemVoidwalkerBoots (ArmorMaterial material, int j, int k) { - super(m, j, k); + super(material, j, k); this.setCreativeTab(TaintedMagic.tabTaintedMagic); this.setUnlocalizedName("ItemVoidwalkerBoots"); this.setTextureName("taintedmagic:ItemVoidwalkerBoots"); @@ -43,47 +44,47 @@ public class ItemVoidwalkerBoots extends ItemArmor MinecraftForge.EVENT_BUS.register(this); } - public String getArmorTexture (ItemStack s, Entity e, int slot, String t) + public String getArmorTexture (ItemStack stack, Entity entity, int slot, String type) { return "taintedmagic:textures/models/ModelVoidwalkerBoots.png"; } - public EnumRarity getRarity (ItemStack s) + public EnumRarity getRarity (ItemStack stack) { return EnumRarity.epic; } @Override - public int getRunicCharge (ItemStack s) + public int getRunicCharge (ItemStack stack) { return 0; } @Override - public int getWarp (ItemStack s, EntityPlayer p) + public int getWarp (ItemStack stack, EntityPlayer player) { return 5; } @Override - public int getVisDiscount (ItemStack s, EntityPlayer p, Aspect a) + public int getVisDiscount (ItemStack stack, EntityPlayer player, Aspect aspect) { return 5; } @Override - public ISpecialArmor.ArmorProperties getProperties (EntityLivingBase e, ItemStack s, DamageSource source, double dmg, - int slot) + public ISpecialArmor.ArmorProperties getProperties (EntityLivingBase entity, ItemStack stack, DamageSource source, + double dmg, int slot) { int priority = 0; double ratio = this.damageReduceAmount / 90.0D; - if (source.isMagicDamage() == true) + if (source.isMagicDamage()) { priority = 1; ratio = this.damageReduceAmount / 80.0D; } - else if ( (source.isFireDamage() == true) || (source.isExplosion())) + else if (source.isFireDamage() || source.isExplosion()) { priority = 1; ratio = this.damageReduceAmount / 80.0D; @@ -93,72 +94,69 @@ public class ItemVoidwalkerBoots extends ItemArmor priority = 0; ratio = 0.0D; } - return new ISpecialArmor.ArmorProperties(priority, ratio, s.getMaxDamage() + 1 - s.getItemDamage()); + return new ISpecialArmor.ArmorProperties(priority, ratio, stack.getMaxDamage() + 1 - stack.getItemDamage()); } @Override - public int getArmorDisplay (EntityPlayer p, ItemStack s, int slot) + public int getArmorDisplay (EntityPlayer player, ItemStack stack, int slot) { return this.damageReduceAmount; } @Override - public void damageArmor (EntityLivingBase e, ItemStack s, DamageSource source, int dmg, int slot) + public void damageArmor (EntityLivingBase entity, ItemStack stack, DamageSource source, int dmg, int slot) { - if (source != DamageSource.fall) s.damageItem(dmg, e); + if (source != DamageSource.fall) stack.damageItem(dmg, entity); } @Override - public void addInformation (ItemStack s, EntityPlayer p, List l, boolean b) + public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean b) { - l.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("tc.visdiscount") + ": " - + getVisDiscount(s, p, null) + "%"); + list.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("tc.visdiscount") + ": " + + getVisDiscount(stack, player, null) + "%"); } - public void onUpdate (ItemStack s, World w, Entity e, int j, boolean k) + public void onUpdate (ItemStack stack, World world, Entity entity, int j, boolean k) { - super.onUpdate(s, w, e, j, k); - - if ( (!w.isRemote) && (s.isItemDamaged()) && (e.ticksExisted % 20 == 0) && ( (e instanceof EntityLivingBase))) - s.damageItem(-1, (EntityLivingBase) e); + super.onUpdate(stack, world, entity, j, k); + if (!world.isRemote && stack.isItemDamaged() && entity.ticksExisted % 20 == 0 && entity instanceof EntityLivingBase) + stack.damageItem(-1, (EntityLivingBase) entity); } - public void onArmorTick (World w, EntityPlayer p, ItemStack s) + public void onArmorTick (World world, EntityPlayer player, ItemStack stack) { - super.onArmorTick(w, p, s); - if ( (!w.isRemote) && (s.getItemDamage() > 0) && (p.ticksExisted % 20 == 0)) s.damageItem(-1, p); + super.onArmorTick(world, player, stack); + if (!world.isRemote && stack.isItemDamaged() && player.ticksExisted % 20 == 0) stack.damageItem(-1, player); - double motion = Math.abs(p.motionX) + Math.abs(p.motionZ) + Math.abs(0.5 * p.motionY); - if (w.isRemote && (motion > .1D || !p.onGround) && w.rand.nextInt(5) == 0) particles(w, p); + double motion = Math.abs(player.motionX) + Math.abs(player.motionZ) + Math.abs(0.5 * player.motionY); + if (world.isRemote && (motion > 0.1D || !player.onGround) && world.rand.nextInt(5) == 0) particles(world, player); - if (p.moveForward > 0.0F) + if (player.moveForward > 0.0F) { - if ( (p.worldObj.isRemote) && (!p.isSneaking())) + if (player.worldObj.isRemote && !player.isSneaking()) { - if (!Thaumcraft.instance.entityEventHandler.prevStep.containsKey(Integer.valueOf(p.getEntityId()))) + if (!Thaumcraft.instance.entityEventHandler.prevStep.containsKey(Integer.valueOf(player.getEntityId()))) { - Thaumcraft.instance.entityEventHandler.prevStep.put(Integer.valueOf(p.getEntityId()), - Float.valueOf(p.stepHeight)); + Thaumcraft.instance.entityEventHandler.prevStep.put(Integer.valueOf(player.getEntityId()), + Float.valueOf(player.stepHeight)); } - p.stepHeight = 1.0F; + player.stepHeight = 1.0F; } - if (p.onGround || p.capabilities.isFlying) + if (player.onGround || player.capabilities.isFlying) { - float bonus = 0.20F; - p.moveFlying(0.0F, 1.0F, p.capabilities.isFlying ? (bonus - 0.075F) : bonus); - p.jumpMovementFactor = 0.00002F; - } - else if (Hover.getHover(p.getEntityId())) - { - p.jumpMovementFactor = 0.03F; - } - else - { - p.jumpMovementFactor = 0.05F; + float mul = 0.2F; + ItemStack sash = PlayerHandler.getPlayerBaubles(player).getStackInSlot(3); + if (sash != null && sash.getItem() instanceof ItemVoidwalkerSash && ItemVoidwalkerSash.isSpeedEnabled(sash)) + mul += 0.2F; + + player.moveFlying(0.0F, 1.0F, player.capabilities.isFlying ? (mul - 0.075F) : mul); + player.jumpMovementFactor = 0.00002F; } + else if (Hover.getHover(player.getEntityId())) player.jumpMovementFactor = 0.03F; + else player.jumpMovementFactor = 0.05F; } - if (p.fallDistance > 3.0F) p.fallDistance = 0.0F; + if (player.fallDistance > 3.0F) player.fallDistance = 1.0F; } @SubscribeEvent @@ -168,20 +166,24 @@ public class ItemVoidwalkerBoots extends ItemArmor { EntityPlayer player = (EntityPlayer) event.entity; - if (player.inventory.armorItemInSlot(0) != null - && player.inventory.armorItemInSlot(0).getItem() == ItemRegistry.ItemVoidwalkerBoots) - { - event.entityLiving.motionY += 0.35D; - } + double mul = 0.0D; + + ItemStack boots = player.inventory.armorItemInSlot(0); + ItemStack sash = PlayerHandler.getPlayerBaubles(player).getStackInSlot(3); + if (boots != null && boots.getItem() == ItemRegistry.ItemVoidwalkerBoots) mul += 0.35D; + if (sash != null && sash.getItem() instanceof ItemVoidwalkerSash && ItemVoidwalkerSash.isSpeedEnabled(sash)) + mul += 0.15D; + + player.motionY += mul; } } @SideOnly (Side.CLIENT) - private void particles (World w, EntityPlayer p) + private void particles (World world, EntityPlayer player) { - FXWispEG ef = new FXWispEG(w, (double) (p.posX + ( (Math.random() - Math.random()) * 0.5F)), - (double) (p.boundingBox.minY + .05F + ( (Math.random() - Math.random()) * 0.1F)), - (double) (p.posZ + ( (Math.random() - Math.random()) * 0.5F)), p); - ParticleEngine.instance.addEffect(w, ef); + FXWispEG fx = new FXWispEG(world, (double) (player.posX + ( (Math.random() - Math.random()) * 0.5F)), + (double) (player.boundingBox.minY + .05F + ( (Math.random() - Math.random()) * 0.1F)), + (double) (player.posZ + ( (Math.random() - Math.random()) * 0.5F)), player); + ParticleEngine.instance.addEffect(world, fx); } } diff --git a/src/main/java/taintedmagic/common/items/equipment/ItemVoidwalkerSash.java b/src/main/java/taintedmagic/common/items/equipment/ItemVoidwalkerSash.java index e4ce07f..b13eae3 100644 --- a/src/main/java/taintedmagic/common/items/equipment/ItemVoidwalkerSash.java +++ b/src/main/java/taintedmagic/common/items/equipment/ItemVoidwalkerSash.java @@ -1,12 +1,8 @@ package taintedmagic.common.items.equipment; -import java.util.List; - import baubles.api.BaubleType; import baubles.api.IBauble; -import baubles.common.lib.PlayerHandler; import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; @@ -16,168 +12,111 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.living.LivingEvent; import taintedmagic.client.handler.HUDHandler; import taintedmagic.common.TaintedMagic; import thaumcraft.api.IRunicArmor; import thaumcraft.api.IWarpingGear; import thaumcraft.api.ItemRunic; import thaumcraft.common.Thaumcraft; -import thaumcraft.common.items.armor.Hover; public class ItemVoidwalkerSash extends ItemRunic implements IRunicArmor, IWarpingGear, IBauble { - public static final String TAG_MODE = "mode"; + public static final String TAG_MODE = "mode"; - public ItemVoidwalkerSash () - { - super(20); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setTextureName("taintedmagic:ItemVoidwalkerSash"); - this.setMaxDamage(-1); - this.setMaxStackSize(1); - this.setUnlocalizedName("ItemVoidwalkerSash"); + public ItemVoidwalkerSash () + { + super(20); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setTextureName("taintedmagic:ItemVoidwalkerSash"); + this.setMaxDamage(-1); + this.setMaxStackSize(1); + this.setUnlocalizedName("ItemVoidwalkerSash"); - MinecraftForge.EVENT_BUS.register(this); - FMLCommonHandler.instance().bus().register(this); - } + MinecraftForge.EVENT_BUS.register(this); + FMLCommonHandler.instance().bus().register(this); + } - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.epic; - } + public EnumRarity getRarity (ItemStack stack) + { + return EnumRarity.epic; + } - @Override - public int getWarp (ItemStack s, EntityPlayer p) - { - return 2; - } + @Override + public int getWarp (ItemStack stack, EntityPlayer player) + { + return 2; + } - @Override - public int getRunicCharge (ItemStack s) - { - return 20; - } + @Override + public int getRunicCharge (ItemStack stack) + { + return 20; + } - @Override - public boolean canEquip (ItemStack s, EntityLivingBase e) - { - return true; - } + @Override + public boolean canEquip (ItemStack stack, EntityLivingBase entity) + { + return true; + } - @Override - public boolean canUnequip (ItemStack s, EntityLivingBase e) - { - return true; - } + @Override + public boolean canUnequip (ItemStack stack, EntityLivingBase entity) + { + return true; + } - @Override - public BaubleType getBaubleType (ItemStack s) - { - return BaubleType.BELT; - } + @Override + public BaubleType getBaubleType (ItemStack stack) + { + return BaubleType.BELT; + } - @Override - public void onEquipped (ItemStack s, EntityLivingBase e) - { - Thaumcraft.instance.runicEventHandler.isDirty = true; - } + @Override + public void onEquipped (ItemStack stack, EntityLivingBase entity) + { + Thaumcraft.instance.runicEventHandler.isDirty = true; + } - @Override - public void onUnequipped (ItemStack s, EntityLivingBase e) - { - Thaumcraft.instance.runicEventHandler.isDirty = true; - } + @Override + public void onUnequipped (ItemStack stack, EntityLivingBase entity) + { + Thaumcraft.instance.runicEventHandler.isDirty = true; + } - public void addInformation (ItemStack s, EntityPlayer p, List l, boolean b) - { - l.add( (hasSpeedBoost(s) ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + StatCollector.translateToLocal("text.sash.mode")); - } + @Override + public void onWornTick (ItemStack stack, EntityLivingBase entity) + { + } - @Override - public void onWornTick (ItemStack s, EntityLivingBase e) - { - EntityPlayer p = (EntityPlayer) e; - if (p.inventory.armorItemInSlot(0) != null && p.inventory.armorItemInSlot(0).getItem() instanceof ItemVoidwalkerBoots) - { - if (hasSpeedBoost(s)) - { - if (p.moveForward > 0.0F) - { - if (p.worldObj.isRemote && !p.isSneaking()) - { - if (!Thaumcraft.instance.entityEventHandler.prevStep.containsKey(Integer.valueOf(p.getEntityId()))) - { - Thaumcraft.instance.entityEventHandler.prevStep.put(Integer.valueOf(p.getEntityId()), Float.valueOf(p.stepHeight)); - } - p.stepHeight = 1.0F; - } + @Override + public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player) + { + if (!world.isRemote && player.isSneaking()) + { + if (stack.stackTagCompound == null) + { + stack.setTagCompound(new NBTTagCompound()); + stack.stackTagCompound.setBoolean(TAG_MODE, true); + } + if (stack.stackTagCompound != null) + { + stack.stackTagCompound.setBoolean(TAG_MODE, !stack.stackTagCompound.getBoolean(TAG_MODE)); + if (isSpeedEnabled(stack)) + HUDHandler.displayString(EnumChatFormatting.GREEN + StatCollector.translateToLocal("text.sash.speed.on"), + 300, false); + else HUDHandler.displayString(EnumChatFormatting.RED + StatCollector.translateToLocal("text.sash.speed.off"), + 300, false); + } + } + return stack; + } - if (p.onGround || p.capabilities.isFlying) - { - float bonus = 0.25F; - p.moveFlying(0.0F, 1.0F, p.capabilities.isFlying ? (bonus - 0.050F) : bonus); - } - else if (Hover.getHover(p.getEntityId())) - { - p.jumpMovementFactor = 0.015F; - - } - else - { - p.jumpMovementFactor = 0.025F; - } - } - if (p.fallDistance > 3.0F) p.fallDistance = 0.0F; - } - } - } - - @SubscribeEvent - public void onPlayerJump (LivingEvent.LivingJumpEvent event) - { - if (event.entityLiving instanceof EntityPlayer) - { - EntityPlayer player = (EntityPlayer) event.entityLiving; - ItemStack sash = PlayerHandler.getPlayerBaubles(player).getStackInSlot(3); - ItemStack boots = player.inventory.armorItemInSlot(0); - if (sash != null && sash.getItem() instanceof ItemVoidwalkerSash) - { - if (boots != null && boots.getItem() instanceof ItemVoidwalkerBoots) - { - if (hasSpeedBoost(sash)) - { - player.motionY += 0.15F; - } - } - } - } - } - - @Override - public ItemStack onItemRightClick (ItemStack s, World w, EntityPlayer p) - { - if (!w.isRemote && p.isSneaking()) - { - if (s.stackTagCompound == null) - { - s.setTagCompound(new NBTTagCompound()); - s.stackTagCompound.setBoolean(TAG_MODE, false); - } - if (s.stackTagCompound != null) - { - s.stackTagCompound.setBoolean(TAG_MODE, !s.stackTagCompound.getBoolean(TAG_MODE)); - HUDHandler.displayString( (hasSpeedBoost(s) ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + StatCollector.translateToLocal("text.sash.mode") + " " - + StatCollector.translateToLocal(hasSpeedBoost(s) ? "text.sash.on" : "text.sash.off"), 300, true); - } - } - return s; - } - - public boolean hasSpeedBoost (ItemStack s) - { - if (s.stackTagCompound == null) return true; - - else return s.stackTagCompound.getBoolean(TAG_MODE); - } + /** + * Returns true if the speed boost feature is enabled. + */ + public static boolean isSpeedEnabled (ItemStack stack) + { + if (stack.stackTagCompound == null) return true; + else return stack.stackTagCompound.getBoolean(TAG_MODE); + } } diff --git a/src/main/java/taintedmagic/common/items/equipment/ItemWarpedGoggles.java b/src/main/java/taintedmagic/common/items/equipment/ItemWarpedGoggles.java index 86fde71..af1b9fd 100644 --- a/src/main/java/taintedmagic/common/items/equipment/ItemWarpedGoggles.java +++ b/src/main/java/taintedmagic/common/items/equipment/ItemWarpedGoggles.java @@ -14,38 +14,38 @@ import thaumcraft.common.items.armor.ItemGoggles; public class ItemWarpedGoggles extends ItemGoggles implements IWarpingGear { - public ItemWarpedGoggles (ArmorMaterial m, int j, int k) - { - super(m, j, k); - this.setMaxDamage(500); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setUnlocalizedName("ItemWarpedGoggles"); - } + public ItemWarpedGoggles (ArmorMaterial material, int j, int k) + { + super(material, j, k); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setUnlocalizedName("ItemWarpedGoggles"); + } - @SideOnly (Side.CLIENT) - public void registerIcons (IIconRegister ir) - { - this.icon = ir.registerIcon("taintedmagic:ItemWarpedGoggles"); - } + @SideOnly (Side.CLIENT) + public void registerIcons (IIconRegister ir) + { + this.icon = ir.registerIcon("taintedmagic:ItemWarpedGoggles"); + } - public String getArmorTexture (ItemStack s, Entity e, int slot, String type) - { - return "taintedmagic:textures/models/ModelWarpedGoggles.png"; - } + public String getArmorTexture (ItemStack stack, Entity entity, int slot, String type) + { + return "taintedmagic:textures/models/ModelWarpedGoggles.png"; + } - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.rare; - } + public EnumRarity getRarity (ItemStack stack) + { + return EnumRarity.rare; + } - @Override - public int getWarp (ItemStack s, EntityPlayer p) - { - return 1; - } + @Override + public int getWarp (ItemStack stack, EntityPlayer player) + { + return 1; + } - public boolean getIsRepairable (ItemStack s, ItemStack s2) - { - return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true : super.getIsRepairable(s, s2); - } + public boolean getIsRepairable (ItemStack stack, ItemStack repairItem) + { + return repairItem.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial, 1, 0)) ? true + : super.getIsRepairable(stack, repairItem); + } } diff --git a/src/main/java/taintedmagic/common/items/tools/ItemHollowDagger.java b/src/main/java/taintedmagic/common/items/tools/ItemHollowDagger.java index e4441a1..8902bf6 100644 --- a/src/main/java/taintedmagic/common/items/tools/ItemHollowDagger.java +++ b/src/main/java/taintedmagic/common/items/tools/ItemHollowDagger.java @@ -8,18 +8,18 @@ import thaumcraft.api.IRepairable; public class ItemHollowDagger extends ItemSword implements IRepairable { - public ItemHollowDagger (ToolMaterial m) - { - super(m); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setUnlocalizedName("ItemHollowDagger"); - this.setMaxStackSize(1); - this.setTextureName("taintedmagic:ItemHollowDagger"); - } + public ItemHollowDagger (ToolMaterial material) + { + super(material); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setUnlocalizedName("ItemHollowDagger"); + this.setMaxStackSize(1); + this.setTextureName("taintedmagic:ItemHollowDagger"); + } - @Override - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.uncommon; - } + @Override + public EnumRarity getRarity (ItemStack stack) + { + return EnumRarity.uncommon; + } } diff --git a/src/main/java/taintedmagic/common/items/tools/ItemKatana.java b/src/main/java/taintedmagic/common/items/tools/ItemKatana.java index c213b45..c23827b 100644 --- a/src/main/java/taintedmagic/common/items/tools/ItemKatana.java +++ b/src/main/java/taintedmagic/common/items/tools/ItemKatana.java @@ -20,7 +20,6 @@ import net.minecraft.item.EnumAction; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.server.MinecraftServer; @@ -50,386 +49,402 @@ import thaumcraft.common.entities.projectile.EntityExplosiveOrb; public class ItemKatana extends Item implements IWarpingGear, IRepairable, IRenderInventoryItem, IHeldItemHUD { - public static final int SUBTYPES = 3; + public static final int SUBTYPES = 3; - public static final ResourceLocation textureThaumium = new ResourceLocation("taintedmagic:textures/models/ModelKatanaThaumium.png"); - public static final ResourceLocation textureVoidmetal = new ResourceLocation("taintedmagic:textures/models/ModelKatanaVoidmetal.png"); - public static final ResourceLocation textureShadowmetal = new ResourceLocation("taintedmagic:textures/models/ModelKatanaShadowmetal.png"); + public static final ResourceLocation TEXTURE_THAUMIUM = + new ResourceLocation("taintedmagic:textures/models/ModelKatanaThaumium.png"); + public static final ResourceLocation TEXTURE_VOIDMETAL = + new ResourceLocation("taintedmagic:textures/models/ModelKatanaVoidmetal.png"); + public static final ResourceLocation TEXTURE_SHADOWMETAL = + new ResourceLocation("taintedmagic:textures/models/ModelKatanaShadowmetal.png"); - public static final ModelKatana katana = new ModelKatana(); - public static final ModelSaya saya = new ModelSaya(); + public static final ModelKatana KATANA = new ModelKatana(); + public static final ModelSaya SAYA = new ModelSaya(); - int ticksInUse = 0; + int ticksInUse = 0; - public ItemKatana () - { - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setUnlocalizedName("ItemKatana"); - this.setHasSubtypes(true); - this.setMaxStackSize(1); - } + public ItemKatana () + { + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setUnlocalizedName("ItemKatana"); + this.setHasSubtypes(true); + this.setMaxStackSize(1); + } - @Override - public boolean hitEntity (ItemStack s, EntityLivingBase e, EntityLivingBase p) - { - if (!e.worldObj.isRemote && (! (e instanceof EntityPlayer) || ! (p instanceof EntityPlayer) || MinecraftServer.getServer().isPVPEnabled())) - { - try - { - if (s.getItemDamage() == 1) - { - e.addPotionEffect(new PotionEffect(Potion.weakness.getId(), 60)); - e.addPotionEffect(new PotionEffect(Potion.hunger.getId(), 120)); - } - if (s.getItemDamage() == 2) - { - e.addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId(), 120, 2)); - e.addPotionEffect(new PotionEffect(Config.potionBlurredID, 120)); - } - } - catch (Exception ex) - { - } - if (hasAnyInscription(s)) - { - switch (getInscription(s)) - { - case 0 : - { - e.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) p).setFireDamage().setDamageBypassesArmor(), getAttackDamage(s)); - e.setFire(5); - break; - } - case 1 : - { - e.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) p).setMagicDamage().setDamageBypassesArmor(), getAttackDamage(s)); + @Override + public boolean hitEntity (ItemStack stack, EntityLivingBase entity, EntityLivingBase player) + { + if (!entity.worldObj.isRemote && (! (entity instanceof EntityPlayer) || ! (player instanceof EntityPlayer) + || MinecraftServer.getServer().isPVPEnabled())) + { + try + { + if (stack.getItemDamage() == 1) + { + entity.addPotionEffect(new PotionEffect(Potion.weakness.getId(), 60)); + entity.addPotionEffect(new PotionEffect(Potion.hunger.getId(), 120)); + } + if (stack.getItemDamage() == 2) + { + entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId(), 120, 2)); + entity.addPotionEffect(new PotionEffect(Config.potionBlurredID, 120)); + } + } + catch (Exception e) + { + } - try - { - e.addPotionEffect(new PotionEffect(Potion.weakness.id, 160)); - } - catch (Exception ex) - { - } - break; - } - case 2 : - { - e.attackEntityFrom(DamageSource.wither.setMagicDamage().setDamageBypassesArmor(), getAttackDamage(s)); + if (hasAnyInscription(stack)) + { + switch (getInscription(stack)) + { + case 0 : + { + entity.attackEntityFrom( + DamageSource.causePlayerDamage((EntityPlayer) player).setFireDamage().setDamageBypassesArmor(), + getAttackDamage(stack)); + entity.setFire(5); + break; + } + case 1 : + { + entity.attackEntityFrom( + DamageSource.causePlayerDamage((EntityPlayer) player).setMagicDamage().setDamageBypassesArmor(), + getAttackDamage(stack)); - try - { - e.addPotionEffect(new PotionEffect(Potion.wither.id, 60)); - } - catch (Exception ex) - { - } - break; - } - } - } - else e.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) p), getAttackDamage(s)); - } - p.worldObj.playSoundAtEntity(p, "thaumcraft:swing", 0.5F + (float) Math.random(), 0.5F + (float) Math.random()); - return super.hitEntity(s, e, p); - } + try + { + entity.addPotionEffect(new PotionEffect(Potion.weakness.id, 160)); + } + catch (Exception e) + { + } + break; + } + case 2 : + { + entity.attackEntityFrom(DamageSource.wither.setMagicDamage().setDamageBypassesArmor(), + getAttackDamage(stack)); - @Override - public boolean isFull3D () - { - return true; - } + try + { + entity.addPotionEffect(new PotionEffect(Potion.wither.id, 60)); + } + catch (Exception ex) + { + } + break; + } + } + } + else entity.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) player), getAttackDamage(stack)); + } + player.worldObj.playSoundAtEntity(player, "thaumcraft:swing", 0.5F + (float) Math.random(), + 0.5F + (float) Math.random()); + return super.hitEntity(stack, entity, player); + } - @Override - public boolean canHarvestBlock (Block b, ItemStack s) - { - return false; - } + @Override + public boolean isFull3D () + { + return true; + } - @Override - public EnumAction getItemUseAction (ItemStack s) - { - return EnumAction.bow; - } + @Override + public boolean canHarvestBlock (Block block, ItemStack stack) + { + return false; + } - @SideOnly (Side.CLIENT) - public void getSubItems (Item i, CreativeTabs c, List l) - { - for (int a = 0; a < SUBTYPES; a++) - l.add(new ItemStack(this, 1, a)); - } + @Override + public EnumAction getItemUseAction (ItemStack stack) + { + return EnumAction.bow; + } - public String getUnlocalizedName (ItemStack s) - { - return super.getUnlocalizedName() + "." + s.getItemDamage(); - } + @SideOnly (Side.CLIENT) + public void getSubItems (Item item, CreativeTabs tab, List list) + { + for (int a = 0; a < SUBTYPES; a++) + list.add(new ItemStack(this, 1, a)); + } - @Override - public void addInformation (ItemStack s, EntityPlayer p, List l, boolean b) - { - if (s.getItemDamage() == 1) l.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("enchantment.special.sapgreat")); - l.add(" "); - l.add("\u00A79+" + getAttackDamage(s) + " " + StatCollector.translateToLocal("text.attackdamage")); + public String getUnlocalizedName (ItemStack stack) + { + return super.getUnlocalizedName() + "." + stack.getItemDamage(); + } - if (s.hasTagCompound() && s.stackTagCompound.hasKey("inscription")) - { - l.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("text.katana.inscription." + s.stackTagCompound.getInteger("inscription"))); - } - } + @Override + public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean b) + { + if (stack.getItemDamage() == 1) + list.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("enchantment.special.sapgreat")); + list.add(" "); + list.add("\u00A79+" + getAttackDamage(stack) + " " + StatCollector.translateToLocal("text.attackdamage")); - @Override - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.uncommon; - } + if (stack.hasTagCompound() && stack.stackTagCompound.hasKey("inscription")) + list.add(EnumChatFormatting.GOLD + StatCollector + .translateToLocal("text.katana.inscription." + stack.stackTagCompound.getInteger("inscription"))); + } - public float getAttackDamage (ItemStack s) - { - switch (s.getItemDamage()) - { - case 0 : - return 14.25F; - case 1 : - return 17.5F; - case 2 : - return 20.75F; - } - return 0; - } + @Override + public EnumRarity getRarity (ItemStack stack) + { + return EnumRarity.uncommon; + } - @Override - public int getMaxItemUseDuration (ItemStack s) - { - return 72000; - } + public float getAttackDamage (ItemStack stack) + { + switch (stack.getItemDamage()) + { + case 0 : + return 14.25F; + case 1 : + return 17.5F; + case 2 : + return 20.75F; + } + return 0; + } - @Override - public ItemStack onItemRightClick (ItemStack s, World w, EntityPlayer p) - { - p.setItemInUse(s, getMaxItemUseDuration(s)); - return s; - } + @Override + public int getMaxItemUseDuration (ItemStack stack) + { + return 72000; + } - @Override - public void onUsingTick (ItemStack s, EntityPlayer p, int i) - { - super.onUsingTick(s, p, i); + @Override + public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player) + { + player.setItemInUse(stack, getMaxItemUseDuration(stack)); + return stack; + } - this.ticksInUse = getMaxItemUseDuration(s) - i; + @Override + public void onUsingTick (ItemStack stack, EntityPlayer player, int i) + { + super.onUsingTick(stack, player, i); - float j = 1.0F + ((float) Math.random() * 0.25F); - if (p.ticksExisted % 5 == 0) p.worldObj.playSoundAtEntity(p, "thaumcraft:wind", j * 0.1F, j); - } + this.ticksInUse = getMaxItemUseDuration(stack) - i; - @Override - public void onPlayerStoppedUsing (ItemStack s, World w, EntityPlayer p, int i) - { - super.onPlayerStoppedUsing(s, w, p, i); - Random r = new Random(); + float j = 1.0F + ((float) Math.random() * 0.25F); + if (player.ticksExisted % 5 == 0) player.worldObj.playSoundAtEntity(player, "thaumcraft:wind", j * 0.1F, j); + } - if (isFullyCharged(p) && (!hasAnyInscription(s) || p.isSneaking() || getInscription(s) == 2)) - { - boolean leech = (getInscription(s) == 2 && isFullyCharged(p)); - boolean b = false; + @Override + public void onPlayerStoppedUsing (ItemStack stack, World world, EntityPlayer player, int i) + { + super.onPlayerStoppedUsing(stack, world, player, i); - if (w.isRemote) - { - MovingObjectPosition mop = Minecraft.getMinecraft().objectMouseOver; - float mul = 2.0F; + Random random = new Random(); - if (mop.entityHit != null) PacketHandler.INSTANCE.sendToServer(new PacketKatanaAttack(mop.entityHit, p, this.getAttackDamage(s) * mul, leech)); - p.swingItem(); - } - p.worldObj.playSoundAtEntity(p, "thaumcraft:swing", 0.5F + (float) Math.random(), 0.5F + (float) Math.random()); - } - else if (hasAnyInscription(s) && isFullyCharged(p) && !p.isSneaking()) - { - switch (getInscription(s)) - { - case 0 : - { - EntityExplosiveOrb proj = new EntityExplosiveOrb(w, p); - proj.strength = getAttackDamage(s) * .25F; - proj.posX += proj.motionX; - proj.posY += proj.motionY; - proj.posZ += proj.motionZ; - if (!w.isRemote) w.spawnEntityInWorld(proj); - p.swingItem(); - break; - } - case 1 : - { - List ents = w - .getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(p.posX, p.posY, p.posZ, p.posX + 1, p.posY + 1, p.posZ + 1).expand(10.0D, 10.0D, 10.0D)); - if (ents != null && ents.size() > 0) - { - for (int a = 0; a < ents.size(); a++) - { - EntityLivingBase e = ents.get(a); + if (isFullyCharged(player) && (!hasAnyInscription(stack) || player.isSneaking() || getInscription(stack) == 2)) + { + boolean leech = (getInscription(stack) == 2 && isFullyCharged(player)); - if (e != p && e.isEntityAlive() && !e.isEntityInvulnerable()) - { - double dist = TaintedMagicHelper.getDistanceTo(e.posX, e.posY, e.posZ, p); - e.attackEntityFrom(DamageSource.magic, getAttackDamage(s) * 0.25F); - Vector3 movement = TaintedMagicHelper.getVectorBetweenEntities(e, p); - e.addVelocity(movement.x * 5.0D, 1.5D, movement.z * 5.0D); - if (w.isRemote) ItemFocusShockwave.spawnParticles(w, p, e); - } - } - } - w.playSoundAtEntity(p, "taintedmagic:shockwave", 5.0F, 1.5F * (float) Math.random()); - p.swingItem(); - break; - } - default : - break; - } - } - } + if (world.isRemote) + { + MovingObjectPosition mop = Minecraft.getMinecraft().objectMouseOver; + float mul = 2.0F; - private boolean isFullyCharged (EntityPlayer p) - { - float f = Math.min((float) this.ticksInUse / 10.0F, 1.0F); + if (mop.entityHit != null) PacketHandler.INSTANCE + .sendToServer(new PacketKatanaAttack(mop.entityHit, player, this.getAttackDamage(stack) * mul, leech)); + player.swingItem(); + } + player.worldObj.playSoundAtEntity(player, "thaumcraft:swing", 0.5F + (float) Math.random(), + 0.5F + (float) Math.random()); + } + else if (hasAnyInscription(stack) && isFullyCharged(player) && !player.isSneaking()) + { + switch (getInscription(stack)) + { + case 0 : + { + EntityExplosiveOrb proj = new EntityExplosiveOrb(world, player); + proj.strength = getAttackDamage(stack) * .25F; + proj.posX += proj.motionX; + proj.posY += proj.motionY; + proj.posZ += proj.motionZ; - if (f == 1.0F) return true; - else return false; - } + if (!world.isRemote) world.spawnEntityInWorld(proj); + player.swingItem(); - @Override - public void renderHUD (ScaledResolution res, EntityPlayer p, ItemStack s, float partialTicks, float fract) - { - Tessellator t = Tessellator.instance; + break; + } + case 1 : + { + List ents = world.getEntitiesWithinAABB(EntityLivingBase.class, + AxisAlignedBB.getBoundingBox(player.posX, player.posY, player.posZ, player.posX + 1, player.posY + 1, + player.posZ + 1).expand(10.0D, 10.0D, 10.0D)); + if (ents != null && ents.size() > 0) + { + for (int a = 0; a < ents.size(); a++) + { + EntityLivingBase entity = ents.get(a); - float tickFract = Math.min((float) p.getItemInUseDuration() / 10.0F, 1.0F); + if (entity != player && entity.isEntityAlive() && !entity.isEntityInvulnerable()) + { + entity.attackEntityFrom(DamageSource.magic, getAttackDamage(stack) * 0.25F); - int x = res.getScaledWidth() / 2 + 725; - int x2 = x + 16; - int y = res.getScaledHeight() / 2 + (p.capabilities.isCreativeMode ? 805 : 755); - int y2 = y + 16; + Vector3 movement = TaintedMagicHelper.getVectorBetweenEntities(entity, player); + entity.addVelocity(movement.x * 5.0D, 1.5D, movement.z * 5.0D); - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + if (world.isRemote) ItemFocusShockwave.spawnParticles(world, player, entity); + } + } + } + world.playSoundAtEntity(player, "taintedmagic:shockwave", 5.0F, 1.5F * (float) Math.random()); + player.swingItem(); + break; + } + default : + break; + } + } + } - float sc = 0.315F; - GL11.glScalef(sc, sc, sc); + private boolean isFullyCharged (EntityPlayer player) + { + float f = Math.min((float) this.ticksInUse / 10.0F, 1.0F); + if (f == 1.0F) return true; + else return false; + } - UtilsFX.bindTexture(new ResourceLocation("thaumcraft:textures/misc/script.png")); + @Override + public void renderHUD (ScaledResolution res, EntityPlayer player, ItemStack stack, float partialTicks, float fract) + { + Tessellator t = Tessellator.instance; - for (int rune = 0; rune < 16; rune++) - { - float red = MathHelper.sin( (p.ticksExisted + rune * 5) / 5.0F) * 0.1F + 0.8F; - float green = MathHelper.sin( (p.ticksExisted + rune * 5) / 7.0F) * 0.1F + 0.7F; - float alpha = MathHelper.sin( (p.ticksExisted + rune * 5) / 10.0F) * 0.3F; + float tickFract = Math.min((float) player.getItemInUseDuration() / 10.0F, 1.0F); - float f = 0.0625F * rune; - float f1 = f + 0.0625F; - float f2 = 0.0F; - float f3 = 1.0F; + int x = res.getScaledWidth() / 2 + 725; + int x2 = x + 16; + int y = res.getScaledHeight() / 2 + (player.capabilities.isCreativeMode ? 805 : 755); + int y2 = y + 16; - t.startDrawingQuads(); + GL11.glPushMatrix(); + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - t.setBrightness(240); - t.setColorRGBA_F(red, green, 0.4F, (alpha + 0.7F) * fract); - t.addVertexWithUV(x + (rune * 16) - alpha, y2 + alpha, 0, f, f3); - t.addVertexWithUV(x2 + (rune * 16) + alpha, y2 + alpha, 0, f1, f3); - t.addVertexWithUV(x2 + (rune * 16) + alpha, y - alpha, 0, f1, f2); - t.addVertexWithUV(x + (rune * 16) - alpha, y - alpha, 0, f, f2); + float scale = 0.315F; + GL11.glScalef(scale, scale, scale); - t.draw(); + UtilsFX.bindTexture(new ResourceLocation("thaumcraft:textures/misc/script.png")); - if ((int) (16 * tickFract) > rune) - { - t.startDrawingQuads(); + for (int rune = 0; rune < 16; rune++) + { + float red = MathHelper.sin( (player.ticksExisted + rune * 5) / 5.0F) * 0.1F + 0.8F; + float green = MathHelper.sin( (player.ticksExisted + rune * 5) / 7.0F) * 0.1F + 0.7F; + float alpha = MathHelper.sin( (player.ticksExisted + rune * 5) / 10.0F) * 0.3F; - t.setBrightness(240); - t.setColorRGBA_F(1.0F - (0.0625F * rune), 0.0F + (0.0625F * rune), 0.0F, 0.9F + alpha); - t.addVertexWithUV(x + (rune * 16) - alpha, y2 + alpha, 0, f, f3); - t.addVertexWithUV(x2 + (rune * 16) + alpha, y2 + alpha, 0, f1, f3); - t.addVertexWithUV(x2 + (rune * 16) + alpha, y - alpha, 0, f1, f2); - t.addVertexWithUV(x + (rune * 16) - alpha, y - alpha, 0, f, f2); + float f = 0.0625F * rune; + float f1 = f + 0.0625F; + float f2 = 0.0F; + float f3 = 1.0F; - t.draw(); - } - } - GL11.glDisable(GL11.GL_BLEND); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); - } + t.startDrawingQuads(); - public static boolean hasAnyInscription (ItemStack s) - { - return s.hasTagCompound() && s.stackTagCompound.hasKey("inscription"); - } + t.setBrightness(240); + t.setColorRGBA_F(red, green, 0.4F, (alpha + 0.7F) * fract); + t.addVertexWithUV(x + (rune * 16) - alpha, y2 + alpha, 0, f, f3); + t.addVertexWithUV(x2 + (rune * 16) + alpha, y2 + alpha, 0, f1, f3); + t.addVertexWithUV(x2 + (rune * 16) + alpha, y - alpha, 0, f1, f2); + t.addVertexWithUV(x + (rune * 16) - alpha, y - alpha, 0, f, f2); - public static int getInscription (ItemStack s) - { - if (s.hasTagCompound() && s.stackTagCompound.hasKey("inscription")) return s.stackTagCompound.getInteger("inscription"); - else return 0; - } + t.draw(); - public static ResourceLocation getTexture (ItemStack s) - { - switch (s.getItemDamage()) - { - case 0 : - return textureThaumium; - case 1 : - return textureVoidmetal; - case 2 : - return textureShadowmetal; - } - return null; - } + if ((int) (16 * tickFract) > rune) + { + t.startDrawingQuads(); - @Override - public int getWarp (ItemStack s, EntityPlayer p) - { - return s.getItemDamage() == 0 ? 0 : s.getItemDamage() == 1 ? 3 : 7; - } + t.setBrightness(240); + t.setColorRGBA_F(1.0F - (0.0625F * rune), 0.0F + (0.0625F * rune), 0.0F, 0.9F + alpha); + t.addVertexWithUV(x + (rune * 16) - alpha, y2 + alpha, 0, f, f3); + t.addVertexWithUV(x2 + (rune * 16) + alpha, y2 + alpha, 0, f1, f3); + t.addVertexWithUV(x2 + (rune * 16) + alpha, y - alpha, 0, f1, f2); + t.addVertexWithUV(x + (rune * 16) - alpha, y - alpha, 0, f, f2); - @Override - public void render (EntityPlayer p, ItemStack s, float pT) - { - GL11.glPushMatrix(); + t.draw(); + } + } + GL11.glDisable(GL11.GL_BLEND); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + } - int light = p.getBrightnessForRender(0); - int lightmapX = light % 65536; - int lightmapY = light / 65536; - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY); + public static boolean hasAnyInscription (ItemStack stack) + { + return stack.hasTagCompound() && stack.stackTagCompound.hasKey("inscription"); + } - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + public static int getInscription (ItemStack stack) + { + if (stack.hasTagCompound() && stack.stackTagCompound.hasKey("inscription")) + return stack.stackTagCompound.getInteger("inscription"); + else return 0; + } - GL11.glPushMatrix(); + public static ResourceLocation getTexture (ItemStack stack) + { + switch (stack.getItemDamage()) + { + case 0 : + return TEXTURE_THAUMIUM; + case 1 : + return TEXTURE_VOIDMETAL; + case 2 : + return TEXTURE_SHADOWMETAL; + } + return null; + } - GL11.glScalef(0.5F, 0.5F, 0.5F); - GL11.glRotatef(55, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(180, 0.0F, 1.0F, 0.0F); + @Override + public int getWarp (ItemStack stack, EntityPlayer player) + { + return stack.getItemDamage() == 0 ? 0 : stack.getItemDamage() == 1 ? 3 : 7; + } - GL11.glTranslatef(-0.6F, 2.25F, 1.25F); + @Override + public void render (EntityPlayer player, ItemStack stack, float partialTicks) + { + GL11.glPushMatrix(); - Minecraft.getMinecraft().renderEngine.bindTexture(getTexture(s)); - saya.render(0.0625F); + int light = player.getBrightnessForRender(0); + int lightmapX = light % 65536; + int lightmapY = light / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY); - GL11.glPopMatrix(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - if (p.getHeldItem() == null || p.getHeldItem() != s) - { - GL11.glPushMatrix(); + GL11.glPushMatrix(); - GL11.glScalef(0.5F, 0.5F, 0.5F); - GL11.glRotatef(55, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(180, 0.0F, 1.0F, 0.0F); + GL11.glScalef(0.5F, 0.5F, 0.5F); + GL11.glRotatef(55, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(180, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(-0.6F, 2.25F, 1.25F); + GL11.glTranslatef(-0.6F, 2.25F, 1.25F); - Minecraft.getMinecraft().renderEngine.bindTexture(getTexture(s)); - katana.render(0.0625F); + Minecraft.getMinecraft().renderEngine.bindTexture(getTexture(stack)); + SAYA.render(0.0625F); - GL11.glPopMatrix(); - } + GL11.glPopMatrix(); - GL11.glPopMatrix(); - } + if (player.getHeldItem() == null || player.getHeldItem() != stack) + { + GL11.glPushMatrix(); + + GL11.glScalef(0.5F, 0.5F, 0.5F); + GL11.glRotatef(55, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(180, 0.0F, 1.0F, 0.0F); + + GL11.glTranslatef(-0.6F, 2.25F, 1.25F); + + Minecraft.getMinecraft().renderEngine.bindTexture(getTexture(stack)); + KATANA.render(0.0625F); + + GL11.glPopMatrix(); + } + GL11.glPopMatrix(); + } } diff --git a/src/main/java/taintedmagic/common/items/tools/ItemPrimordialEdge.java b/src/main/java/taintedmagic/common/items/tools/ItemPrimordialEdge.java index 2ea8c32..df420c7 100644 --- a/src/main/java/taintedmagic/common/items/tools/ItemPrimordialEdge.java +++ b/src/main/java/taintedmagic/common/items/tools/ItemPrimordialEdge.java @@ -24,104 +24,107 @@ import thaumcraft.api.IWarpingGear; public class ItemPrimordialEdge extends ItemSword implements IWarpingGear, IRepairable { - public ItemPrimordialEdge (ToolMaterial m) - { - super(m); - this.setTextureName("taintedmagic:ItemPrimordialEdge"); - this.setUnlocalizedName("ItemPrimordialEdge"); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - } + public ItemPrimordialEdge (ToolMaterial material) + { + super(material); + this.setTextureName("taintedmagic:ItemPrimordialEdge"); + this.setUnlocalizedName("ItemPrimordialEdge"); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + } - public EnumAction getItemUseAction (ItemStack s) - { - return EnumAction.block; - } + public EnumAction getItemUseAction (ItemStack stack) + { + return EnumAction.block; + } - public EnumRarity getRarity (ItemStack s) - { - return TaintedMagic.rarityCreation; - } + public EnumRarity getRarity (ItemStack stack) + { + return TaintedMagic.rarityCreation; + } - public boolean hitEntity (ItemStack s, EntityLivingBase e, EntityLivingBase p) - { - super.hitEntity(s, e, p); + public boolean hitEntity (ItemStack stack, EntityLivingBase entity, EntityLivingBase player) + { + super.hitEntity(stack, entity, player); - try - { - e.addPotionEffect(new PotionEffect(Potion.wither.id, 5, 1)); - e.addPotionEffect(new PotionEffect(Potion.weakness.id, 5, 1)); - p.worldObj.playSoundAtEntity(p, "thaumcraft:swing", 1.0F, 1.0F); - } - catch (Exception ex) - { - ex.printStackTrace(); - } - return true; - } + try + { + entity.addPotionEffect(new PotionEffect(Potion.wither.id, 5, 1)); + entity.addPotionEffect(new PotionEffect(Potion.weakness.id, 5, 1)); + } + catch (Exception e) + { + } - @Override - public ItemStack onItemRightClick (ItemStack s, World w, EntityPlayer p) - { - p.setItemInUse(s, this.getMaxItemUseDuration(s)); - return s; - } + player.worldObj.playSoundAtEntity(player, "thaumcraft:swing", 1.0F, 1.0F); - @Override - public void onUsingTick (ItemStack s, EntityPlayer p, int count) - { - Iterator i$; + return true; + } - List ents = p.worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(p.posX, p.posY, p.posZ, p.posX + 1, p.posY + 1, p.posZ + 1).expand(15.0D, 15.0D, 15.0D)); + @Override + public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player) + { + player.setItemInUse(stack, this.getMaxItemUseDuration(stack)); + return stack; + } - p.worldObj.playSoundAtEntity(p, "thaumcraft:brain", 0.05F, 0.5F); - if ( (ents != null) && (ents.size() > 0)) for (i$ = ents.iterator(); i$.hasNext();) - { - Object ent = i$.next(); - Entity eo = (Entity) ent; + @Override + public void onUsingTick (ItemStack stack, EntityPlayer player, int i) + { + // Based off of hungry node + Iterator i$; - if (eo != p) - { - if ( (eo.isEntityAlive()) && (!eo.isEntityInvulnerable())) - { - double d = TaintedMagicHelper.getDistanceTo(eo.posX, eo.posY, eo.posZ, p); - if (d < 2.0D) eo.attackEntityFrom(DamageSource.magic, 5.0F); + List ents = player.worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB + .getBoundingBox(player.posX, player.posY, player.posZ, player.posX + 1, player.posY + 1, player.posZ + 1) + .expand(15.0D, 15.0D, 15.0D)); - } - double var3 = (p.posX + 0.5D - eo.posX) / 20.0D; - double var5 = (p.posY + 0.5D - eo.posY) / 20.0D; - double var7 = (p.posZ + 0.5D - eo.posZ) / 20.0D; - double var9 = Math.sqrt(var3 * var3 + var5 * var5 + var7 * var7); - double var11 = 1.0D - var9; + player.worldObj.playSoundAtEntity(player, "thaumcraft:brain", 0.05F, 0.5F); - if (var11 > 0.0D) - { - var11 *= var11; - eo.motionX += var3 / var9 * var11 * 0.20D; - eo.motionY += var5 / var9 * var11 * 0.30D; - eo.motionZ += var7 / var9 * var11 * 0.20D; - } - } - } - } + if (ents != null && ents.size() > 0) for (i$ = ents.iterator(); i$.hasNext();) + { + Object next = i$.next(); + Entity entity = (Entity) next; - @Override - public void onUpdate (ItemStack s, World w, Entity e, int i, boolean b) - { - if ( (!w.isRemote) && (s.isItemDamaged()) && (e.ticksExisted % 20 == 0)) - { - s.damageItem(-1, (EntityLivingBase) e); - } - } + if (entity != player) + { + if (entity.isEntityAlive() && !entity.isEntityInvulnerable()) + { + double dist = TaintedMagicHelper.getDistanceTo(player, entity.posX, entity.posY, entity.posZ); + if (dist < 2.0D) entity.attackEntityFrom(DamageSource.magic, 5.0F); + } - @Override - public void addInformation (ItemStack s, EntityPlayer p, List l, boolean b) - { - l.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("text.eldritchsapping")); - } + double x = (player.posX + 0.5D - entity.posX) / 20.0D; + double y = (player.posY + 0.5D - entity.posY) / 20.0D; + double z = (player.posZ + 0.5D - entity.posZ) / 20.0D; + double vec = Math.sqrt(x * x + y * y + z * z); + double vec2 = 1.0D - vec; - @Override - public int getWarp (ItemStack s, EntityPlayer p) - { - return 5; - } + if (vec2 > 0.0D) + { + vec2 *= vec2; + entity.motionX += x / vec * vec2 * 0.20D; + entity.motionY += y / vec * vec2 * 0.30D; + entity.motionZ += z / vec * vec2 * 0.20D; + } + } + } + } + + @Override + public void onUpdate (ItemStack stack, World world, Entity entity, int i, boolean b) + { + if (!world.isRemote && stack.isItemDamaged() && entity.ticksExisted % 20 == 0) + stack.damageItem(-1, (EntityLivingBase) entity); + } + + @Override + public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean b) + { + list.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("text.eldritchsapping")); + } + + @Override + public int getWarp (ItemStack stack, EntityPlayer player) + { + return 5; + } } diff --git a/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalAxe.java b/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalAxe.java index e0730b6..b7e0fa0 100644 --- a/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalAxe.java +++ b/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalAxe.java @@ -9,22 +9,23 @@ import thaumcraft.api.IRepairable; public class ItemShadowmetalAxe extends ItemAxe implements IRepairable { - public ItemShadowmetalAxe (ToolMaterial m) - { - super(m); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setTextureName("taintedmagic:ItemShadowmetalAxe"); - this.setUnlocalizedName("ItemShadowmetalAxe"); - } + public ItemShadowmetalAxe (ToolMaterial material) + { + super(material); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setTextureName("taintedmagic:ItemShadowmetalAxe"); + this.setUnlocalizedName("ItemShadowmetalAxe"); + } - public boolean getIsRepairable (ItemStack s, ItemStack s2) - { - return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true : super.getIsRepairable(s, s2); - } + public boolean getIsRepairable (ItemStack stack, ItemStack repairItem) + { + return repairItem.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial, 1, 0)) ? true + : super.getIsRepairable(stack, repairItem); + } - @Override - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.uncommon; - } + @Override + public EnumRarity getRarity (ItemStack stack) + { + return EnumRarity.uncommon; + } } diff --git a/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalHoe.java b/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalHoe.java index 6bf07ea..3ed77b9 100644 --- a/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalHoe.java +++ b/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalHoe.java @@ -17,58 +17,65 @@ import thaumcraft.api.IRepairable; public class ItemShadowmetalHoe extends ItemHoe implements IRepairable { - public ItemShadowmetalHoe (ToolMaterial m) - { - super(m); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setTextureName("taintedmagic:ItemShadowmetalHoe"); - this.setUnlocalizedName("ItemShadowmetalHoe"); - MinecraftForge.EVENT_BUS.register(this); - FMLCommonHandler.instance().bus().register(this); - } + public ItemShadowmetalHoe (ToolMaterial material) + { + super(material); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setTextureName("taintedmagic:ItemShadowmetalHoe"); + this.setUnlocalizedName("ItemShadowmetalHoe"); - public boolean getIsRepairable (ItemStack s, ItemStack s2) - { - return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true : super.getIsRepairable(s, s2); - } + MinecraftForge.EVENT_BUS.register(this); + FMLCommonHandler.instance().bus().register(this); + } - @Override - public boolean onItemUse (ItemStack s, EntityPlayer p, World w, int x, int y, int z, int i, float a, float b, float c) - { - super.onItemUse(s, p, w, x, y, z, i, a, b, c); - if (!p.worldObj.isRemote) - { - Block block = Blocks.dirt; + public boolean getIsRepairable (ItemStack stack, ItemStack repairItem) + { + return repairItem.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial, 1, 0)) ? true + : super.getIsRepairable(stack, repairItem); + } - if (p.worldObj.getBlock(x, y, z) == Blocks.farmland) - { - p.worldObj.setBlock(x, y, z, Blocks.dirt); - s.damageItem(1, p); - w.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), block.stepSound.getStepResourcePath(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F); - } - else if (p.worldObj.getBlock(x, y, z) == Blocks.dirt || p.worldObj.getBlock(x, y, z) == Blocks.grass) - { - p.worldObj.setBlock(x, y, z, Blocks.farmland); - s.damageItem(1, p); - w.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), block.stepSound.getStepResourcePath(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F); - } - } - if (p.worldObj.getBlock(x, y, z) == Blocks.dirt || p.worldObj.getBlock(x, y, z) == Blocks.grass || p.worldObj.getBlock(x, y, z) == Blocks.farmland) p.swingItem(); - return false; - } + @Override + public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int i, float f, float f1, + float f2) + { + super.onItemUse(stack, player, world, x, y, z, i, f, f1, f2); - @SubscribeEvent - public void useHoe (UseHoeEvent event) - { - if (event.current.getItem() == ItemRegistry.ItemShadowmetalHoe) - { - event.setCanceled(true); - } - } + if (!player.worldObj.isRemote) + { + Block dirt = Blocks.dirt; - @Override - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.uncommon; - } + if (player.worldObj.getBlock(x, y, z) == Blocks.farmland) + { + player.worldObj.setBlock(x, y, z, Blocks.dirt); + stack.damageItem(1, player); + world.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), + dirt.stepSound.getStepResourcePath(), (dirt.stepSound.getVolume() + 1.0F) / 2.0F, + dirt.stepSound.getPitch() * 0.8F); + } + else if (player.worldObj.getBlock(x, y, z) == Blocks.dirt || player.worldObj.getBlock(x, y, z) == Blocks.grass) + { + player.worldObj.setBlock(x, y, z, Blocks.farmland); + stack.damageItem(1, player); + world.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), + dirt.stepSound.getStepResourcePath(), (dirt.stepSound.getVolume() + 1.0F) / 2.0F, + dirt.stepSound.getPitch() * 0.8F); + } + } + if (player.worldObj.getBlock(x, y, z) == Blocks.dirt || player.worldObj.getBlock(x, y, z) == Blocks.grass + || player.worldObj.getBlock(x, y, z) == Blocks.farmland) + player.swingItem(); + return false; + } + + @SubscribeEvent + public void useHoe (UseHoeEvent event) + { + if (event.current.getItem() == ItemRegistry.ItemShadowmetalHoe) event.setCanceled(true); + } + + @Override + public EnumRarity getRarity (ItemStack stack) + { + return EnumRarity.uncommon; + } } diff --git a/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalPick.java b/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalPick.java index 4de0563..5276da8 100644 --- a/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalPick.java +++ b/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalPick.java @@ -9,22 +9,23 @@ import thaumcraft.api.IRepairable; public class ItemShadowmetalPick extends ItemPickaxe implements IRepairable { - public ItemShadowmetalPick (ToolMaterial m) - { - super(m); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setTextureName("taintedmagic:ItemShadowmetalPick"); - this.setUnlocalizedName("ItemShadowmetalPick"); - } + public ItemShadowmetalPick (ToolMaterial material) + { + super(material); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setTextureName("taintedmagic:ItemShadowmetalPick"); + this.setUnlocalizedName("ItemShadowmetalPick"); + } - public boolean getIsRepairable (ItemStack s, ItemStack s2) - { - return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true : super.getIsRepairable(s, s2); - } + public boolean getIsRepairable (ItemStack stack, ItemStack repairItem) + { + return repairItem.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial, 1, 0)) ? true + : super.getIsRepairable(stack, repairItem); + } - @Override - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.uncommon; - } + @Override + public EnumRarity getRarity (ItemStack stack) + { + return EnumRarity.uncommon; + } } diff --git a/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalSpade.java b/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalSpade.java index 77a0c26..dc3f7ba 100644 --- a/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalSpade.java +++ b/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalSpade.java @@ -9,22 +9,23 @@ import thaumcraft.api.IRepairable; public class ItemShadowmetalSpade extends ItemSpade implements IRepairable { - public ItemShadowmetalSpade (ToolMaterial m) - { - super(m); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setTextureName("taintedmagic:ItemShadowmetalSpade"); - this.setUnlocalizedName("ItemShadowmetalSpade"); - } + public ItemShadowmetalSpade (ToolMaterial material) + { + super(material); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setTextureName("taintedmagic:ItemShadowmetalSpade"); + this.setUnlocalizedName("ItemShadowmetalSpade"); + } - public boolean getIsRepairable (ItemStack s, ItemStack s2) - { - return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true : super.getIsRepairable(s, s2); - } + public boolean getIsRepairable (ItemStack stack, ItemStack repairItem) + { + return repairItem.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial, 1, 0)) ? true + : super.getIsRepairable(stack, repairItem); + } - @Override - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.uncommon; - } + @Override + public EnumRarity getRarity (ItemStack stack) + { + return EnumRarity.uncommon; + } } diff --git a/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalSword.java b/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalSword.java index 2850188..d1906fb 100644 --- a/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalSword.java +++ b/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalSword.java @@ -9,22 +9,23 @@ import thaumcraft.api.IRepairable; public class ItemShadowmetalSword extends ItemSword implements IRepairable { - public ItemShadowmetalSword (ToolMaterial m) - { - super(m); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setTextureName("taintedmagic:ItemShadowmetalSword"); - this.setUnlocalizedName("ItemShadowmetalSword"); - } + public ItemShadowmetalSword (ToolMaterial m) + { + super(m); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setTextureName("taintedmagic:ItemShadowmetalSword"); + this.setUnlocalizedName("ItemShadowmetalSword"); + } - public boolean getIsRepairable (ItemStack s, ItemStack s2) - { - return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true : super.getIsRepairable(s, s2); - } + public boolean getIsRepairable (ItemStack stack, ItemStack repairItem) + { + return repairItem.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial, 1, 0)) ? true + : super.getIsRepairable(stack, repairItem); + } - @Override - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.uncommon; - } + @Override + public EnumRarity getRarity (ItemStack stack) + { + return EnumRarity.uncommon; + } } diff --git a/src/main/java/taintedmagic/common/items/tools/ItemThaumicDisassembler.java b/src/main/java/taintedmagic/common/items/tools/ItemThaumicDisassembler.java index 651fb47..c44d2fc 100644 --- a/src/main/java/taintedmagic/common/items/tools/ItemThaumicDisassembler.java +++ b/src/main/java/taintedmagic/common/items/tools/ItemThaumicDisassembler.java @@ -1,15 +1,8 @@ package taintedmagic.common.items.tools; -import java.util.ArrayList; import java.util.List; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.ScaledResolution; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -22,7 +15,6 @@ import net.minecraft.util.DamageSource; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import taintedmagic.api.IHeldItemHUD; import taintedmagic.client.handler.HUDHandler; import taintedmagic.common.TaintedMagic; import thaumcraft.api.aspects.Aspect; @@ -31,160 +23,144 @@ import thaumcraft.common.items.wands.WandManager; public class ItemThaumicDisassembler extends Item { - public static final String TAG_MODE = "mode"; - public static List data = new ArrayList(); + public static final String TAG_MODE = "mode"; - public ItemThaumicDisassembler () - { - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setMaxDamage(500); - this.setMaxStackSize(1); - this.setUnlocalizedName("ItemThaumicDisassembler"); - this.setTextureName("taintedmagic:ItemThaumicDisassembler"); - } + public ItemThaumicDisassembler () + { + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setMaxDamage(500); + this.setMaxStackSize(1); + this.setUnlocalizedName("ItemThaumicDisassembler"); + this.setTextureName("taintedmagic:ItemThaumicDisassembler"); + } - @Override - public boolean canHarvestBlock (Block b, ItemStack s) - { - return b != Blocks.bedrock; - } + @Override + public boolean canHarvestBlock (Block block, ItemStack stack) + { + return block != Blocks.bedrock; + } - @Override - public void addInformation (ItemStack s, EntityPlayer p, List l, boolean b) - { - super.addInformation(s, p, l, b); + @Override + public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean b) + { + super.addInformation(stack, player, list, b); - l.add(StatCollector.translateToLocal("text.disassembler.mode") + ": " + getModeName(s)); - l.add(StatCollector.translateToLocal("text.disassembler.efficiency") + ": " + (getMode(s) == 3 ? "\u00A7c" : "\u00A7a") + getEfficiency(s)); - l.add(" "); - l.add("\u00A79" + "+20 " + StatCollector.translateToLocal("text.attackdamage")); - } + list.add(StatCollector.translateToLocal("text.disassembler.mode") + ": " + getModeName(stack)); + list.add(StatCollector.translateToLocal("text.disassembler.efficiency") + ": " + + (getMode(stack) == 3 ? "\u00A7c" : "\u00A7a") + getEfficiency(stack)); + list.add(" "); + list.add("\u00A79" + "+20 " + StatCollector.translateToLocal("text.attackdamage")); + } - @Override - public boolean hitEntity (ItemStack s, EntityLivingBase e, EntityLivingBase p) - { - e.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) p), 20); - s.damageItem(2, p); - return false; - } + @Override + public boolean hitEntity (ItemStack stack, EntityLivingBase entity, EntityLivingBase player) + { + entity.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) player), 20); + stack.damageItem(2, player); + return false; + } - @Override - public float getDigSpeed (ItemStack s, Block b, int meta) - { - return getEfficiency(s); - } + @Override + public float getDigSpeed (ItemStack stack, Block block, int meta) + { + return getEfficiency(stack); + } - @Override - public boolean onBlockDestroyed (ItemStack s, World w, Block b, int x, int y, int z, EntityLivingBase e) - { - if (b.getBlockHardness(w, x, y, z) != 0.0D) s.damageItem(1, e); - return true; - } + @Override + public boolean onBlockDestroyed (ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase entity) + { + if (block.getBlockHardness(world, x, y, z) != 0.0D) stack.damageItem(1, entity); + return true; + } - @Override - public boolean onBlockStartBreak (ItemStack s, int x, int y, int z, EntityPlayer p) - { - super.onBlockStartBreak(s, x, y, z, p); + @Override + public EnumRarity getRarity (ItemStack stack) + { + return EnumRarity.uncommon; + } - if (!p.worldObj.isRemote) - { - Block block = p.worldObj.getBlock(x, y, z); - int meta = p.worldObj.getBlockMetadata(x, y, z); + @Override + public boolean isFull3D () + { + return true; + } - if (block == Blocks.lit_redstone_ore) block = Blocks.redstone_ore; + @Override + public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player) + { + if (!world.isRemote && player.isSneaking()) + { + if (stack.stackTagCompound == null) stack.setTagCompound(new NBTTagCompound()); + int mode = getMode(stack); - ItemStack stack = new ItemStack(block, 1, meta); - } - return false; - } + stack.stackTagCompound.setInteger(TAG_MODE, mode < 3 ? mode + 1 : 0); - @Override - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.uncommon; - } + String str = EnumChatFormatting.GRAY + StatCollector.translateToLocal("text.disassembler.mode") + ": " + + getModeName(mode) + (mode == 3 ? "\u00A7c" : "\u00A7a") + " (" + getEfficiency(mode) + ")"; + HUDHandler.displayString(str, 300, false); + } + return stack; + } - @Override - public boolean isFull3D () - { - return true; - } + public static int getEfficiency (int mode) + { + switch (mode) + { + case 0 : + return 20; + case 1 : + return 8; + case 2 : + return 128; + case 3 : + return 0; + } + return 0; + } - @Override - public ItemStack onItemRightClick (ItemStack s, World w, EntityPlayer p) - { - if (!w.isRemote && p.isSneaking()) - { - if (s.stackTagCompound == null) s.setTagCompound(new NBTTagCompound()); - s.stackTagCompound.setInteger(TAG_MODE, getMode(s) < 3 ? getMode(s) + 1 : 0); + public static int getEfficiency (ItemStack stack) + { + return getEfficiency(getMode(stack)); + } - int mode = getMode(s); - String str = EnumChatFormatting.GRAY + StatCollector.translateToLocal("text.disassembler.mode") + ": " + getModeName(mode) + (mode == 3 ? "\u00A7c" : "\u00A7a") + " (" - + getEfficiency(mode) + ")"; - HUDHandler.displayString(str, 300, false); - } + public static int getMode (ItemStack stack) + { + if (stack.stackTagCompound == null) return 0; + return stack.stackTagCompound.getInteger(TAG_MODE); + } - return s; - } + public static String getModeName (int mode) + { + switch (mode) + { + case 0 : + return "\u00A7a" + StatCollector.translateToLocal("text.disassembler.normal"); + case 1 : + return "\u00A7a" + StatCollector.translateToLocal("text.disassembler.slow"); + case 2 : + return "\u00A7a" + StatCollector.translateToLocal("text.disassembler.fast"); + case 3 : + return "\u00A7c" + StatCollector.translateToLocal("text.disassembler.off"); + } + return null; + } - public static int getEfficiency (int mode) - { - switch (mode) - { - case 0 : - return 20; - case 1 : - return 8; - case 2 : - return 128; - case 3 : - return 0; - } - return 0; - } + public static String getModeName (ItemStack stack) + { + return getModeName(getMode(stack)); + } - public static int getEfficiency (ItemStack s) - { - return getEfficiency(getMode(s)); - } - - public static int getMode (ItemStack s) - { - if (s.stackTagCompound == null) return 0; - return s.stackTagCompound.getInteger(TAG_MODE); - } - - public static String getModeName (int mode) - { - switch (mode) - { - case 0 : - return "\u00A7a" + StatCollector.translateToLocal("text.disassembler.normal"); - case 1 : - return "\u00A7a" + StatCollector.translateToLocal("text.disassembler.slow"); - case 2 : - return "\u00A7a" + StatCollector.translateToLocal("text.disassembler.fast"); - case 3 : - return "\u00A7c" + StatCollector.translateToLocal("text.disassembler.off"); - } - return null; - } - - public static String getModeName (ItemStack s) - { - return getModeName(getMode(s)); - } - - public void onUpdate (ItemStack s, World w, Entity e, int i, boolean b) - { - super.onUpdate(s, w, e, i, b); - if (e instanceof EntityPlayer) - { - EntityPlayer p = (EntityPlayer) e; - if (!w.isRemote && s.isItemDamaged() && e.ticksExisted % 20 == 0) - { - if (WandManager.consumeVisFromInventory(p, new AspectList().add(Aspect.ENTROPY, 5))) s.damageItem(-1, (EntityLivingBase) e); - } - } - } + public void onUpdate (ItemStack stack, World world, Entity entity, int i, boolean b) + { + super.onUpdate(stack, world, entity, i, b); + if (entity instanceof EntityPlayer) + { + EntityPlayer player = (EntityPlayer) entity; + if (!world.isRemote && stack.isItemDamaged() && entity.ticksExisted % 20 == 0) + { + if (WandManager.consumeVisFromInventory(player, new AspectList().add(Aspect.ENTROPY, 5))) + stack.damageItem(-1, (EntityLivingBase) entity); + } + } + } } \ No newline at end of file diff --git a/src/main/java/taintedmagic/common/items/wand/ItemWandCap.java b/src/main/java/taintedmagic/common/items/wand/ItemWandCap.java index 8657962..c6c7420 100644 --- a/src/main/java/taintedmagic/common/items/wand/ItemWandCap.java +++ b/src/main/java/taintedmagic/common/items/wand/ItemWandCap.java @@ -14,43 +14,43 @@ import taintedmagic.common.TaintedMagic; public class ItemWandCap extends Item { - public int SUBTYPES = 4; - public IIcon[] icons = new IIcon[SUBTYPES]; + int SUBTYPES = 4; + IIcon[] icons = new IIcon[SUBTYPES]; - public ItemWandCap () - { - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setUnlocalizedName("ItemWandCap"); - this.setHasSubtypes(true); - } + public ItemWandCap () + { + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setUnlocalizedName("ItemWandCap"); + this.setHasSubtypes(true); + } - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.uncommon; - } + public EnumRarity getRarity (ItemStack stack) + { + return EnumRarity.uncommon; + } - @SideOnly (Side.CLIENT) - public void registerIcons (IIconRegister ir) - { - for (int i = 0; i < icons.length; i++) - this.icons[i] = ir.registerIcon("taintedmagic:ItemWandCap" + i); - } + @SideOnly (Side.CLIENT) + public void registerIcons (IIconRegister ir) + { + for (int i = 0; i < icons.length; i++) + this.icons[i] = ir.registerIcon("taintedmagic:ItemWandCap" + i); + } - @SideOnly (Side.CLIENT) - public IIcon getIconFromDamage (int i) - { - return this.icons[i]; - } + @SideOnly (Side.CLIENT) + public IIcon getIconFromDamage (int i) + { + return this.icons[i]; + } - @SideOnly (Side.CLIENT) - public void getSubItems (Item item, CreativeTabs c, List l) - { - for (int i = 0; i < SUBTYPES; i++) - l.add(new ItemStack(this, 1, i)); - } + @SideOnly (Side.CLIENT) + public void getSubItems (Item item, CreativeTabs tab, List list) + { + for (int i = 0; i < SUBTYPES; i++) + list.add(new ItemStack(this, 1, i)); + } - public String getUnlocalizedName (ItemStack s) - { - return super.getUnlocalizedName() + "." + s.getItemDamage(); - } + public String getUnlocalizedName (ItemStack stack) + { + return super.getUnlocalizedName() + "." + stack.getItemDamage(); + } } diff --git a/src/main/java/taintedmagic/common/items/wand/ItemWandRod.java b/src/main/java/taintedmagic/common/items/wand/ItemWandRod.java index efcbb02..c36dcc4 100644 --- a/src/main/java/taintedmagic/common/items/wand/ItemWandRod.java +++ b/src/main/java/taintedmagic/common/items/wand/ItemWandRod.java @@ -14,43 +14,43 @@ import taintedmagic.common.TaintedMagic; public class ItemWandRod extends Item { - public int SUBTYPES = 2; - public IIcon[] icons = new IIcon[SUBTYPES]; + int SUBTYPES = 2; + IIcon[] icons = new IIcon[SUBTYPES]; - public ItemWandRod () - { - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setUnlocalizedName("ItemWandRod"); - this.setHasSubtypes(true); - } + public ItemWandRod () + { + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setUnlocalizedName("ItemWandRod"); + this.setHasSubtypes(true); + } - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.uncommon; - } + public EnumRarity getRarity (ItemStack stack) + { + return EnumRarity.uncommon; + } - @SideOnly (Side.CLIENT) - public void registerIcons (IIconRegister ir) - { - for (int i = 0; i < icons.length; i++) - this.icons[i] = ir.registerIcon("taintedmagic:ItemWandRod" + i); - } + @SideOnly (Side.CLIENT) + public void registerIcons (IIconRegister ir) + { + for (int i = 0; i < icons.length; i++) + this.icons[i] = ir.registerIcon("taintedmagic:ItemWandRod" + i); + } - @SideOnly (Side.CLIENT) - public IIcon getIconFromDamage (int i) - { - return this.icons[i]; - } + @SideOnly (Side.CLIENT) + public IIcon getIconFromDamage (int i) + { + return this.icons[i]; + } - @SideOnly (Side.CLIENT) - public void getSubItems (Item item, CreativeTabs c, List l) - { - for (int i = 0; i < SUBTYPES; i++) - l.add(new ItemStack(this, 1, i)); - } + @SideOnly (Side.CLIENT) + public void getSubItems (Item item, CreativeTabs tab, List list) + { + for (int i = 0; i < SUBTYPES; i++) + list.add(new ItemStack(this, 1, i)); + } - public String getUnlocalizedName (ItemStack s) - { - return super.getUnlocalizedName() + "." + s.getItemDamage(); - } + public String getUnlocalizedName (ItemStack stack) + { + return super.getUnlocalizedName() + "." + stack.getItemDamage(); + } } diff --git a/src/main/java/taintedmagic/common/items/wand/foci/FocusUpgrades.java b/src/main/java/taintedmagic/common/items/wand/foci/FocusUpgrades.java deleted file mode 100644 index 90438f9..0000000 --- a/src/main/java/taintedmagic/common/items/wand/foci/FocusUpgrades.java +++ /dev/null @@ -1,35 +0,0 @@ -package taintedmagic.common.items.wand.foci; - -import net.minecraft.util.ResourceLocation; -import taintedmagic.common.handler.ConfigHandler; -import thaumcraft.api.aspects.Aspect; -import thaumcraft.api.aspects.AspectList; -import thaumcraft.api.wands.FocusUpgradeType; - -public class FocusUpgrades -{ - public static FocusUpgradeType sanity; - public static FocusUpgradeType antibody; - public static FocusUpgradeType corrosive; - public static FocusUpgradeType persistent; - public static FocusUpgradeType diffusion; - - public static void init () - { - int id = ConfigHandler.FOCUS_UPGRADES_START_ID; - sanity = new FocusUpgradeType(id, new ResourceLocation("taintedmagic:textures/foci/IconSanity.png"), "focus.upgrade.sanity.name", "focus.upgrade.sanity.text", - new AspectList().add(Aspect.MIND, 1).add(Aspect.HEAL, 1)); - - antibody = new FocusUpgradeType(id++, new ResourceLocation("taintedmagic:textures/foci/IconAntibody.png"), "focus.upgrade.antibody.name", "focus.upgrade.antibody.text", - new AspectList().add(Aspect.TAINT, 1).add(Aspect.HEAL, 1)); - - corrosive = new FocusUpgradeType(id++, new ResourceLocation("taintedmagic:textures/foci/IconCorrosive.png"), "focus.upgrade.corrosive.name", "focus.upgrade.corrosive.text", - new AspectList().add(Aspect.TAINT, 1).add(Aspect.POISON, 1)); - - persistent = new FocusUpgradeType(id++, new ResourceLocation("taintedmagic:textures/foci/IconPersistent.png"), "focus.upgrade.persistent.name", "focus.upgrade.persistent.text", - new AspectList().add(Aspect.ARMOR, 1).add(Aspect.MOTION, 1).add(Aspect.ENERGY, 1)); - - diffusion = new FocusUpgradeType(id++, new ResourceLocation("taintedmagic:textures/foci/IconDiffusion.png"), "focus.upgrade.diffusion.name", "focus.upgrade.diffusion.text", - new AspectList().add(Aspect.DARKNESS, 1).add(Aspect.ELDRITCH, 2).add(Aspect.AURA, 4)); - } -} diff --git a/src/main/java/taintedmagic/common/items/wand/foci/TMFocusUpgrades.java b/src/main/java/taintedmagic/common/items/wand/foci/TMFocusUpgrades.java new file mode 100644 index 0000000..11ff764 --- /dev/null +++ b/src/main/java/taintedmagic/common/items/wand/foci/TMFocusUpgrades.java @@ -0,0 +1,41 @@ +package taintedmagic.common.items.wand.foci; + +import net.minecraft.util.ResourceLocation; +import taintedmagic.common.handler.ConfigHandler; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; +import thaumcraft.api.wands.FocusUpgradeType; + +public class TMFocusUpgrades +{ + public static FocusUpgradeType sanity; + public static FocusUpgradeType antibody; + public static FocusUpgradeType corrosive; + public static FocusUpgradeType persistent; + public static FocusUpgradeType diffusion; + + public static void initFocusUpgrades () + { + sanity = new FocusUpgradeType(ConfigHandler.SANITY_UPGRADE_ID, + new ResourceLocation("taintedmagic:textures/foci/IconSanity.png"), "focus.upgrade.sanity.name", + "focus.upgrade.sanity.text", new AspectList().add(Aspect.MIND, 1).add(Aspect.HEAL, 1)); + + antibody = new FocusUpgradeType(ConfigHandler.ANTIBODY_UPGRADE_ID, + new ResourceLocation("taintedmagic:textures/foci/IconAntibody.png"), "focus.upgrade.antibody.name", + "focus.upgrade.antibody.text", new AspectList().add(Aspect.TAINT, 1).add(Aspect.HEAL, 1)); + + corrosive = new FocusUpgradeType(ConfigHandler.CORROSIVE_UPGRADE_ID, + new ResourceLocation("taintedmagic:textures/foci/IconCorrosive.png"), "focus.upgrade.corrosive.name", + "focus.upgrade.corrosive.text", new AspectList().add(Aspect.TAINT, 1).add(Aspect.POISON, 1)); + + persistent = new FocusUpgradeType(ConfigHandler.PERSISTENT_UPGRADE_ID, + new ResourceLocation("taintedmagic:textures/foci/IconPersistent.png"), "focus.upgrade.persistent.name", + "focus.upgrade.persistent.text", + new AspectList().add(Aspect.ARMOR, 1).add(Aspect.MOTION, 1).add(Aspect.ENERGY, 1)); + + diffusion = new FocusUpgradeType(ConfigHandler.DIFFUSION_UPGRADE_ID, + new ResourceLocation("taintedmagic:textures/foci/IconDiffusion.png"), "focus.upgrade.diffusion.name", + "focus.upgrade.diffusion.text", + new AspectList().add(Aspect.DARKNESS, 1).add(Aspect.ELDRITCH, 2).add(Aspect.AURA, 4)); + } +} diff --git a/src/main/java/taintedmagic/common/lib/LibInfo.java b/src/main/java/taintedmagic/common/lib/LibInfo.java index 3686b38..7261dc1 100644 --- a/src/main/java/taintedmagic/common/lib/LibInfo.java +++ b/src/main/java/taintedmagic/common/lib/LibInfo.java @@ -2,8 +2,9 @@ package taintedmagic.common.lib; public class LibInfo { - public static final String MODID = "TaintedMagic"; - public static final String NAME = "Tainted Magic"; - public static final String VERSION = "r7.82"; - public static final String DEPENDENCIES = "required-after:Forge@[10.13.2.1291,);required-after:Thaumcraft@[4.2.3.5,);after:ThaumicTinkerer"; + public static final String MODID = "TaintedMagic"; + public static final String NAME = "Tainted Magic"; + public static final String VERSION = "r7.82"; + public static final String DEPENDENCIES = + "required-after:Forge@[10.13.4.1448,);required-after:Thaumcraft@[4.2.3.5,);after:ThaumicTinkerer"; } diff --git a/src/main/java/taintedmagic/common/network/PacketHandler.java b/src/main/java/taintedmagic/common/network/PacketHandler.java index e06600e..d982170 100644 --- a/src/main/java/taintedmagic/common/network/PacketHandler.java +++ b/src/main/java/taintedmagic/common/network/PacketHandler.java @@ -9,7 +9,7 @@ public class PacketHandler { public static final SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel(LibInfo.MODID.toLowerCase()); - public static void init () + public static void initPackets () { INSTANCE.registerMessage(PacketKatanaAttack.class, PacketKatanaAttack.class, 0, Side.SERVER); } diff --git a/src/main/java/taintedmagic/common/network/PacketKatanaAttack.java b/src/main/java/taintedmagic/common/network/PacketKatanaAttack.java index 163a1f4..b53c12e 100644 --- a/src/main/java/taintedmagic/common/network/PacketKatanaAttack.java +++ b/src/main/java/taintedmagic/common/network/PacketKatanaAttack.java @@ -13,62 +13,63 @@ import net.minecraftforge.common.DimensionManager; public class PacketKatanaAttack implements IMessage, IMessageHandler { - private int entityID; - private int playerID; - private int dimensionID; - private float dmg; - private boolean leech; + private int entityID; + private int playerID; + private int dimensionID; + private float dmg; + private boolean leech; - public PacketKatanaAttack () - { - } + public PacketKatanaAttack () + { + } - public PacketKatanaAttack (Entity e, EntityPlayer p, float dmg, boolean leech) - { - this.entityID = e.getEntityId(); - this.playerID = p.getEntityId(); - this.dimensionID = e.dimension; - this.dmg = dmg; - this.leech = leech; - } + public PacketKatanaAttack (Entity entity, EntityPlayer player, float dmg, boolean leech) + { + this.entityID = entity.getEntityId(); + this.playerID = player.getEntityId(); + this.dimensionID = entity.dimension; + this.dmg = dmg; + this.leech = leech; + } - @Override - public IMessage onMessage (PacketKatanaAttack message, MessageContext ctx) - { - World w = DimensionManager.getWorld(message.dimensionID); - if (w == null) return null; + @Override + public IMessage onMessage (PacketKatanaAttack message, MessageContext ctx) + { + World world = DimensionManager.getWorld(message.dimensionID); + if (world == null) return null; - Entity e = w.getEntityByID(message.entityID); - Entity p = w.getEntityByID(message.playerID); + Entity entity = world.getEntityByID(message.entityID); + Entity player = world.getEntityByID(message.playerID); - if (e != null && e instanceof EntityLivingBase && p != null && p instanceof EntityPlayer) e.attackEntityFrom(DamageSource.causeIndirectMagicDamage(p, e), message.dmg); + if (entity != null && entity instanceof EntityLivingBase && player != null && player instanceof EntityPlayer) + entity.attackEntityFrom(DamageSource.causeIndirectMagicDamage(player, entity), message.dmg); - if (message.leech && p instanceof EntityPlayer) - { - ((EntityPlayer) p).heal(message.dmg * 0.25F); - w.playSoundAtEntity(p, "thaumcraft:runicShieldEffect", 0.5F, 0.5F + ((float) Math.random() * 0.5F)); - } + if (message.leech && player instanceof EntityPlayer) + { + ((EntityPlayer) player).heal(message.dmg * 0.25F); + world.playSoundAtEntity(player, "thaumcraft:runicShieldEffect", 0.5F, 0.5F + ((float) Math.random() * 0.5F)); + } - return null; - } + return null; + } - @Override - public void fromBytes (ByteBuf buf) - { - this.entityID = buf.readInt(); - this.playerID = buf.readInt(); - this.dimensionID = buf.readInt(); - this.dmg = buf.readFloat(); - this.leech = buf.readBoolean(); - } + @Override + public void fromBytes (ByteBuf buf) + { + this.entityID = buf.readInt(); + this.playerID = buf.readInt(); + this.dimensionID = buf.readInt(); + this.dmg = buf.readFloat(); + this.leech = buf.readBoolean(); + } - @Override - public void toBytes (ByteBuf buf) - { - buf.writeInt(this.entityID); - buf.writeInt(this.playerID); - buf.writeInt(this.dimensionID); - buf.writeFloat(this.dmg); - buf.writeBoolean(this.leech); - } + @Override + public void toBytes (ByteBuf buf) + { + buf.writeInt(this.entityID); + buf.writeInt(this.playerID); + buf.writeInt(this.dimensionID); + buf.writeFloat(this.dmg); + buf.writeBoolean(this.leech); + } } diff --git a/src/main/java/taintedmagic/common/registry/BlockRegistry.java b/src/main/java/taintedmagic/common/registry/BlockRegistry.java index 3c6c73d..7e8f8cc 100644 --- a/src/main/java/taintedmagic/common/registry/BlockRegistry.java +++ b/src/main/java/taintedmagic/common/registry/BlockRegistry.java @@ -11,49 +11,49 @@ import taintedmagic.common.blocks.BlockWarpwoodLog; import taintedmagic.common.blocks.BlockWarpwoodPlanks; import taintedmagic.common.blocks.BlockWarpwoodSapling; import taintedmagic.common.blocks.tile.TileLumos; -import taintedmagic.common.items.blocks.ItemBlockShadowOre; -import taintedmagic.common.items.blocks.ItemBlockWarpwoodSapling; public class BlockRegistry { - public static Block BlockShadowOre; - public static Block BlockWarpwoodLog; - public static Block BlockWarpwoodLeaves; - public static Block BlockWarpwoodSapling; - public static Block BlockShadowmetal; - public static Block BlockWarpwoodPlanks; - public static Block BlockLumos; - public static Block BlockNightshadeBush; + public static Block BlockShadowOre; + public static Block BlockShadowmetal; - public static void init () - { - BlockShadowOre = new BlockShadowOre(); - GameRegistry.registerBlock(BlockShadowOre, ItemBlockShadowOre.class, "BlockShadowOre"); + public static Block BlockWarpwoodLog; + public static Block BlockWarpwoodLeaves; + public static Block BlockWarpwoodSapling; + public static Block BlockWarpwoodPlanks; + public static Block BlockNightshadeBush; - BlockWarpwoodLog = new BlockWarpwoodLog(); - GameRegistry.registerBlock(BlockWarpwoodLog, "BlockWarpwoodLog"); + public static Block BlockLumos; - BlockShadowmetal = new BlockShadowmetal(); - GameRegistry.registerBlock(BlockShadowmetal, "BlockShadowmetal"); + public static void initBlocks () + { + BlockShadowOre = new BlockShadowOre(); + GameRegistry.registerBlock(BlockShadowOre, "BlockShadowOre"); - BlockWarpwoodPlanks = new BlockWarpwoodPlanks(); - GameRegistry.registerBlock(BlockWarpwoodPlanks, "BlockWarpwoodPlanks"); + BlockShadowmetal = new BlockShadowmetal(); + GameRegistry.registerBlock(BlockShadowmetal, "BlockShadowmetal"); - BlockWarpwoodLeaves = new BlockWarpwoodLeaves(); - GameRegistry.registerBlock(BlockWarpwoodLeaves, "BlockWarpwoodLeaves"); + BlockWarpwoodLog = new BlockWarpwoodLog(); + GameRegistry.registerBlock(BlockWarpwoodLog, "BlockWarpwoodLog"); - BlockWarpwoodSapling = new BlockWarpwoodSapling(); - GameRegistry.registerBlock(BlockWarpwoodSapling, ItemBlockWarpwoodSapling.class, "BlockWarpwoodSapling"); + BlockWarpwoodPlanks = new BlockWarpwoodPlanks(); + GameRegistry.registerBlock(BlockWarpwoodPlanks, "BlockWarpwoodPlanks"); - BlockLumos = new BlockLumos(); - GameRegistry.registerBlock(BlockLumos, "BlockLumos"); + BlockWarpwoodLeaves = new BlockWarpwoodLeaves(); + GameRegistry.registerBlock(BlockWarpwoodLeaves, "BlockWarpwoodLeaves"); - BlockNightshadeBush = new BlockNightshadeBush(); - GameRegistry.registerBlock(BlockNightshadeBush, "BlockNightshadeBush"); - } + BlockWarpwoodSapling = new BlockWarpwoodSapling(); + GameRegistry.registerBlock(BlockWarpwoodSapling, "BlockWarpwoodSapling"); - public static void initTiles () - { - GameRegistry.registerTileEntity(TileLumos.class, "TileLumos"); - } + BlockNightshadeBush = new BlockNightshadeBush(); + GameRegistry.registerBlock(BlockNightshadeBush, "BlockNightshadeBush"); + + BlockLumos = new BlockLumos(); + GameRegistry.registerBlock(BlockLumos, "BlockLumos"); + } + + public static void initTiles () + { + GameRegistry.registerTileEntity(TileLumos.class, "TileLumos"); + } } \ No newline at end of file diff --git a/src/main/java/taintedmagic/common/registry/ItemRegistry.java b/src/main/java/taintedmagic/common/registry/ItemRegistry.java index 617fc8a..f456cb8 100644 --- a/src/main/java/taintedmagic/common/registry/ItemRegistry.java +++ b/src/main/java/taintedmagic/common/registry/ItemRegistry.java @@ -2,7 +2,6 @@ package taintedmagic.common.registry; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.item.Item; -import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.item.ItemAxe; import net.minecraft.item.ItemHoe; import net.minecraft.item.ItemPickaxe; @@ -13,12 +12,12 @@ import net.minecraft.util.ResourceLocation; import taintedmagic.common.handler.WandHandler; import taintedmagic.common.items.ItemCrimsonBlood; import taintedmagic.common.items.ItemFlyteCharm; -import taintedmagic.common.items.ItemGatekey; +import taintedmagic.common.items.ItemGateKey; import taintedmagic.common.items.ItemMagicFunguar; import taintedmagic.common.items.ItemMaterial; import taintedmagic.common.items.ItemNightshadeBerries; import taintedmagic.common.items.ItemSalis; -import taintedmagic.common.items.ItemVoidsentBlood; +import taintedmagic.common.items.ItemVoidBlood; import taintedmagic.common.items.equipment.ItemLumosRing; import taintedmagic.common.items.equipment.ItemShadowFortressArmor; import taintedmagic.common.items.equipment.ItemVoidFortressArmor; @@ -43,7 +42,8 @@ import taintedmagic.common.items.wand.foci.ItemFocusMageMace; import taintedmagic.common.items.wand.foci.ItemFocusShockwave; import taintedmagic.common.items.wand.foci.ItemFocusTaintSwarm; import taintedmagic.common.items.wand.foci.ItemFocusVisShard; -import taintedmagic.common.lib.LibToolMaterials; +import taintedmagic.common.lib.LibMaterials; +import thaumcraft.api.ThaumcraftApi; import thaumcraft.api.wands.StaffRod; import thaumcraft.api.wands.WandCap; import thaumcraft.api.wands.WandRod; @@ -53,11 +53,11 @@ public class ItemRegistry public static Item ItemMagicFunguar; public static Item ItemNightshadeBerries; public static Item ItemMaterial; - public static Item ItemVoidsentBlood; + public static Item ItemVoidBlood; public static Item ItemCrimsonBlood; public static Item ItemFlyteCharm; public static Item ItemSalis; - public static Item ItemGatekey; + public static Item ItemGateKey; // Wand public static Item ItemWandRod; @@ -111,13 +111,13 @@ public class ItemRegistry public static Item ItemKatana; - public static void init () + public static void initItems () { ItemMaterial = new ItemMaterial(); GameRegistry.registerItem(ItemMaterial, "ItemMaterial"); - ItemVoidsentBlood = new ItemVoidsentBlood(); - GameRegistry.registerItem(ItemVoidsentBlood, "ItemVoidsentBlood"); + ItemVoidBlood = new ItemVoidBlood(); + GameRegistry.registerItem(ItemVoidBlood, "ItemVoidBlood"); ItemCrimsonBlood = new ItemCrimsonBlood(); GameRegistry.registerItem(ItemCrimsonBlood, "ItemCrimsonBlood"); @@ -134,45 +134,45 @@ public class ItemRegistry ItemSalis = new ItemSalis(); GameRegistry.registerItem(ItemSalis, "ItemSalis"); - ItemGatekey = new ItemGatekey(); - GameRegistry.registerItem(ItemGatekey, "ItemGatekey"); + ItemGateKey = new ItemGateKey(); + GameRegistry.registerItem(ItemGateKey, "ItemGateKey"); // Armor and Baubles - ItemWarpedGoggles = new ItemWarpedGoggles(LibToolMaterials.armorMatSpecial, 4, 0); + ItemWarpedGoggles = new ItemWarpedGoggles(LibMaterials.armorMatWarped, 4, 0); GameRegistry.registerItem(ItemWarpedGoggles, "ItemWarpedGoggles"); - ItemVoidFortressHelmet = new ItemVoidFortressArmor(LibToolMaterials.armorMatVoidFortress, 4, 0) - .setUnlocalizedName("ItemVoidFortressHelmet"); + ItemVoidFortressHelmet = + new ItemVoidFortressArmor(LibMaterials.armorMatVoidFortress, 4, 0).setUnlocalizedName("ItemVoidFortressHelmet"); GameRegistry.registerItem(ItemVoidFortressHelmet, "ItemVoidFortressHelmet"); - ItemVoidFortressChestplate = new ItemVoidFortressArmor(LibToolMaterials.armorMatVoidFortress, 4, 1) + ItemVoidFortressChestplate = new ItemVoidFortressArmor(LibMaterials.armorMatVoidFortress, 4, 1) .setUnlocalizedName("ItemVoidFortressChestplate"); GameRegistry.registerItem(ItemVoidFortressChestplate, "ItemVoidFortressChestplate"); - ItemVoidFortressLeggings = new ItemVoidFortressArmor(LibToolMaterials.armorMatVoidFortress, 4, 2) + ItemVoidFortressLeggings = new ItemVoidFortressArmor(LibMaterials.armorMatVoidFortress, 4, 2) .setUnlocalizedName("ItemVoidFortressLeggings"); GameRegistry.registerItem(ItemVoidFortressLeggings, "ItemVoidFortressLeggings"); ItemVoidwalkerBoots = - new ItemVoidwalkerBoots(LibToolMaterials.armorMatSpecial, 4, 3).setUnlocalizedName("ItemVoidwalkerBoots"); + new ItemVoidwalkerBoots(LibMaterials.armorMatVoidwalker, 4, 3).setUnlocalizedName("ItemVoidwalkerBoots"); GameRegistry.registerItem(ItemVoidwalkerBoots, "ItemVoidwalkerBoots"); ItemVoidwalkerSash = new ItemVoidwalkerSash(); GameRegistry.registerItem(ItemVoidwalkerSash, "ItemVoidwalkerSash"); - ItemShadowFortressHelmet = new ItemShadowFortressArmor(LibToolMaterials.armorMatShadowFortress, 4, 0) + ItemShadowFortressHelmet = new ItemShadowFortressArmor(LibMaterials.armorMatShadowFortress, 4, 0) .setUnlocalizedName("ItemShadowFortressHelmet"); GameRegistry.registerItem(ItemShadowFortressHelmet, "ItemShadowFortressHelmet"); - ItemShadowFortressChestplate = new ItemShadowFortressArmor(LibToolMaterials.armorMatShadowFortress, 4, 1) + ItemShadowFortressChestplate = new ItemShadowFortressArmor(LibMaterials.armorMatShadowFortress, 4, 1) .setUnlocalizedName("ItemShadowFortressChestplate"); GameRegistry.registerItem(ItemShadowFortressChestplate, "ItemShadowFortressChestplate"); - ItemShadowFortressLeggings = new ItemShadowFortressArmor(LibToolMaterials.armorMatShadowFortress, 4, 2) + ItemShadowFortressLeggings = new ItemShadowFortressArmor(LibMaterials.armorMatShadowFortress, 4, 2) .setUnlocalizedName("ItemShadowFortressLeggings"); GameRegistry.registerItem(ItemShadowFortressLeggings, "ItemShadowFortressLeggings"); - ItemVoidmetalGoggles = new ItemVoidmetalGoggles(ArmorMaterial.IRON, 4, 0); + ItemVoidmetalGoggles = new ItemVoidmetalGoggles(ThaumcraftApi.armorMatSpecial, 4, 0); GameRegistry.registerItem(ItemVoidmetalGoggles, "ItemVoidmetalGoggles"); ItemLumosRing = new ItemLumosRing(); @@ -229,25 +229,25 @@ public class ItemRegistry ItemThaumicDisassembler = new ItemThaumicDisassembler(); GameRegistry.registerItem(ItemThaumicDisassembler, "ItemThaumicDisassembler"); - ItemHollowDagger = new ItemHollowDagger(LibToolMaterials.toolMatHollow); + ItemHollowDagger = new ItemHollowDagger(LibMaterials.toolMatHollow); GameRegistry.registerItem(ItemHollowDagger, "ItemHollowDagger"); - ItemShadowmetalHoe = new ItemShadowmetalHoe(LibToolMaterials.toolMatShadow); + ItemShadowmetalHoe = new ItemShadowmetalHoe(LibMaterials.toolMatShadow); GameRegistry.registerItem(ItemShadowmetalHoe, "ItemShadowmetalHoe"); - ItemShadowmetalPick = new ItemShadowmetalPick(LibToolMaterials.toolMatShadow); + ItemShadowmetalPick = new ItemShadowmetalPick(LibMaterials.toolMatShadow); GameRegistry.registerItem(ItemShadowmetalPick, "ItemShadowmetalPick"); - ItemShadowmetalAxe = new ItemShadowmetalAxe(LibToolMaterials.toolMatShadow); + ItemShadowmetalAxe = new ItemShadowmetalAxe(LibMaterials.toolMatShadow); GameRegistry.registerItem(ItemShadowmetalAxe, "ItemShadowmetalAxe"); - ItemShadowmetalSpade = new ItemShadowmetalSpade(LibToolMaterials.toolMatShadow); + ItemShadowmetalSpade = new ItemShadowmetalSpade(LibMaterials.toolMatShadow); GameRegistry.registerItem(ItemShadowmetalSpade, "ItemShadowmetalSpade"); - ItemShadowmetalSword = new ItemShadowmetalSword(LibToolMaterials.toolMatShadow); + ItemShadowmetalSword = new ItemShadowmetalSword(LibMaterials.toolMatShadow); GameRegistry.registerItem(ItemShadowmetalSword, "ItemShadowmetalSword"); - ItemPrimordialEdge = new ItemPrimordialEdge(LibToolMaterials.toolMatPrimal); + ItemPrimordialEdge = new ItemPrimordialEdge(LibMaterials.toolMatPrimal); GameRegistry.registerItem(ItemPrimordialEdge, "ItemPrimordialEdge"); ItemKatana = new ItemKatana(); diff --git a/src/main/java/taintedmagic/common/registry/OreDictRegistry.java b/src/main/java/taintedmagic/common/registry/OreDictRegistry.java index a926be8..da9cff2 100644 --- a/src/main/java/taintedmagic/common/registry/OreDictRegistry.java +++ b/src/main/java/taintedmagic/common/registry/OreDictRegistry.java @@ -5,13 +5,13 @@ import net.minecraftforge.oredict.OreDictionary; public class OreDictRegistry { - public static void init () - { - OreDictionary.registerOre("oreShadow", new ItemStack(BlockRegistry.BlockShadowOre)); - OreDictionary.registerOre("logWood", new ItemStack(BlockRegistry.BlockWarpwoodLog)); - OreDictionary.registerOre("treeSapling", new ItemStack(BlockRegistry.BlockWarpwoodSapling)); - OreDictionary.registerOre("ingotShadow", new ItemStack(ItemRegistry.ItemMaterial)); - OreDictionary.registerOre("plankWood", new ItemStack(BlockRegistry.BlockWarpwoodPlanks)); - OreDictionary.registerOre("blockShadow", new ItemStack(BlockRegistry.BlockShadowmetal)); - } + public static void initOreDict () + { + OreDictionary.registerOre("oreShadow", new ItemStack(BlockRegistry.BlockShadowOre)); + OreDictionary.registerOre("logWood", new ItemStack(BlockRegistry.BlockWarpwoodLog)); + OreDictionary.registerOre("treeSapling", new ItemStack(BlockRegistry.BlockWarpwoodSapling)); + OreDictionary.registerOre("ingotShadow", new ItemStack(ItemRegistry.ItemMaterial)); + OreDictionary.registerOre("plankWood", new ItemStack(BlockRegistry.BlockWarpwoodPlanks)); + OreDictionary.registerOre("blockShadow", new ItemStack(BlockRegistry.BlockShadowmetal)); + } } diff --git a/src/main/java/taintedmagic/common/registry/RecipeRegistry.java b/src/main/java/taintedmagic/common/registry/RecipeRegistry.java index c6a15b3..1bb2914 100644 --- a/src/main/java/taintedmagic/common/registry/RecipeRegistry.java +++ b/src/main/java/taintedmagic/common/registry/RecipeRegistry.java @@ -16,7 +16,7 @@ import thaumcraft.common.config.ConfigItems; public class RecipeRegistry { - public static void init () + public static void initRecipes () { initCrafting(); initSmelting(); @@ -30,38 +30,48 @@ public class RecipeRegistry */ public static void initCrafting () { + // Shadow Metal Block GameRegistry.addShapedRecipe(new ItemStack(BlockRegistry.BlockShadowmetal), "AAA", "AAA", "AAA", 'A', new ItemStack(ItemRegistry.ItemMaterial)); + // Shadow Metal Ingot from nuggets GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.ItemMaterial, 1, 0), "AAA", "AAA", "AAA", 'A', new ItemStack(ItemRegistry.ItemMaterial, 1, 8)); + // Shadow Metal Ingots from block GameRegistry.addRecipe(new ItemStack(ItemRegistry.ItemMaterial, 9), "A", 'A', new ItemStack(BlockRegistry.BlockShadowmetal)); + // Shadow Metal Nuggets GameRegistry.addRecipe(new ItemStack(ItemRegistry.ItemMaterial, 9, 8), "A", 'A', new ItemStack(ItemRegistry.ItemMaterial, 1, 0)); + // Shadow Metal Pick ResearchRegistry.recipes.put("ItemShadowmetalPick", GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.ItemShadowmetalPick), "AAA", " B ", " B ", 'A', new ItemStack(ItemRegistry.ItemMaterial), 'B', new ItemStack(Items.stick))); + // Shadow Metal Axe ResearchRegistry.recipes.put("ItemShadowmetalAxe", GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.ItemShadowmetalAxe), "AA", "BA", "B ", 'A', new ItemStack(ItemRegistry.ItemMaterial), 'B', new ItemStack(Items.stick))); + // Shadow Metal Spade ResearchRegistry.recipes.put("ItemShadowmetalSpade", GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.ItemShadowmetalSpade), "A", "B", "B", 'A', new ItemStack(ItemRegistry.ItemMaterial), 'B', new ItemStack(Items.stick))); + // Shadow Metal Hoe ResearchRegistry.recipes.put("ItemShadowmetalHoe", GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.ItemShadowmetalHoe), "AA", "B ", "B ", 'A', new ItemStack(ItemRegistry.ItemMaterial), 'B', new ItemStack(Items.stick))); + // Shadow Metal Sword ResearchRegistry.recipes.put("ItemShadowmetalSword", GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.ItemShadowmetalSword), "A", "A", "B", 'A', new ItemStack(ItemRegistry.ItemMaterial), 'B', new ItemStack(Items.stick))); + // Warpwood Planks ResearchRegistry.recipes.put("BlockWarpwoodPlanks", GameRegistry.addShapedRecipe( new ItemStack(BlockRegistry.BlockWarpwoodPlanks, 4), "A", 'A', new ItemStack(BlockRegistry.BlockWarpwoodLog))); } @@ -71,6 +81,7 @@ public class RecipeRegistry */ public static void initSmelting () { + // Shadow Metal Ingot GameRegistry.addSmelting(BlockRegistry.BlockShadowOre, new ItemStack(ItemRegistry.ItemMaterial), 2.0F); } @@ -79,6 +90,7 @@ public class RecipeRegistry */ public static void initInfusion () { + // Shockwave Focus ResearchRegistry.recipes.put("ItemFocusShockwave", ThaumcraftApi.addInfusionCraftingRecipe("FOCUSSHOCKWAVE", new ItemStack(ItemRegistry.ItemFocusShockwave), 6, new AspectList() @@ -88,15 +100,17 @@ public class RecipeRegistry new ItemStack(ConfigItems.itemShard, 1, 0), new ItemStack(Blocks.tnt), new ItemStack(Items.gunpowder), new ItemStack(ConfigItems.itemShard, 1, 0) })); + // Edge of the Primordials ResearchRegistry.recipes.put("ItemPrimordialEdge", ThaumcraftApi.addInfusionCraftingRecipe("PRIMALBLADE", new ItemStack(ItemRegistry.ItemPrimordialEdge), 8, new AspectList().add(Aspect.WEAPON, 65) .add(Aspect.ELDRITCH, 46).add(Aspect.DARKNESS, 16).add(Aspect.METAL, 60).add(Aspect.VOID, 56), new ItemStack(ConfigItems.itemSwordVoid), new ItemStack[]{ new ItemStack(ItemRegistry.ItemMaterial, 1, 5), new ItemStack(ConfigItems.itemShard, 1, 0), new ItemStack(ConfigItems.itemShard, 1, 1), new ItemStack(ConfigItems.itemShard, 1, 2), - new ItemStack(ItemRegistry.ItemMaterial, 1, 10), new ItemStack(ConfigItems.itemShard, 1, 3), + new ItemStack(ConfigItems.itemShard, 1, 6), new ItemStack(ConfigItems.itemShard, 1, 3), new ItemStack(ConfigItems.itemShard, 1, 4), new ItemStack(ConfigItems.itemShard, 1, 5) })); + // Mage's Mace Focus ResearchRegistry.recipes.put("ItemFocusMageMace", ThaumcraftApi.addInfusionCraftingRecipe("MACEFOCUS", new ItemStack(ItemRegistry.ItemFocusMageMace), 3, new AspectList() @@ -107,6 +121,7 @@ public class RecipeRegistry new ItemStack(Items.iron_sword), new ItemStack(Items.quartz), new ItemStack(ConfigItems.itemShard, 1, 5), new ItemStack(Items.quartz) })); + // Crimson Blade ResearchRegistry.recipes.put("ItemSwordCrimson", ThaumcraftApi.addInfusionCraftingRecipe("CRIMSONBLADE", new ItemStack(ConfigItems.itemSwordCrimson), 7, new AspectList().add(Aspect.WEAPON, 32).add(Aspect.METAL, 16).add(Aspect.ENTROPY, 8) @@ -114,17 +129,19 @@ public class RecipeRegistry new ItemStack(ConfigItems.itemSwordVoid), new ItemStack[]{ new ItemStack(ItemRegistry.ItemCrimsonBlood), new ItemStack(ItemRegistry.ItemCrimsonBlood), new ItemStack(ItemRegistry.ItemCrimsonBlood) })); + // Voidwalker's Sash ResearchRegistry.recipes.put("ItemVoidwalkerSash", ThaumcraftApi.addInfusionCraftingRecipe( "VOIDSASH", new ItemStack(ItemRegistry.ItemVoidwalkerSash, 1), 7, new AspectList().add(Aspect.VOID, 56) .add(Aspect.MAGIC, 40).add(Aspect.ARMOR, 66).add(Aspect.TRAVEL, 16).add(Aspect.FLIGHT, 10), new ItemStack(ConfigItems.itemGirdleRunic), - new ItemStack[]{ new ItemStack(ConfigItems.itemEldritchObject, 1, 3), + new ItemStack[]{ new ItemStack(ItemRegistry.ItemMaterial, 1, 10), new ItemStack(ConfigItems.itemResource, 1, 16), new ItemStack(ItemRegistry.ItemMaterial), new ItemStack(ConfigItems.itemResource, 1, 16), new ItemStack(ItemRegistry.ItemMaterial, 1, 1), new ItemStack(ConfigItems.itemResource, 1, 16), new ItemStack(ItemRegistry.ItemMaterial), new ItemStack(ConfigItems.itemResource, 1, 16), })); + // Shard of Creation ResearchRegistry.recipes.put("ItemMaterial:5", ThaumcraftApi.addInfusionCraftingRecipe( "CREATIONSHARD", new ItemStack(ItemRegistry.ItemMaterial, 1, 5), 8, TaintedMagicHelper.getPrimals(46) @@ -136,6 +153,7 @@ public class RecipeRegistry new ItemStack(ConfigItems.itemShard, 1, 3), new ItemStack(ConfigItems.itemShard, 1, 4), new ItemStack(ConfigItems.itemShard, 1, 5) })); + // Warpwood Wand Rod ResearchRegistry.recipes.put("ItemWandRod:0", ThaumcraftApi.addInfusionCraftingRecipe("ROD_warpwood", new ItemStack(ItemRegistry.ItemWandRod), 8, new AspectList().add(Aspect.ELDRITCH, 65).add(Aspect.DARKNESS, 30) .add(Aspect.TREE, 12).add(Aspect.MAGIC, 45).add(Aspect.AURA, 35), @@ -145,12 +163,14 @@ public class RecipeRegistry new ItemStack(ConfigItems.itemZombieBrain), new ItemStack(ItemRegistry.ItemMaterial), new ItemStack(ItemRegistry.ItemMaterial, 1, 3), new ItemStack(ConfigItems.itemResource, 1, 16) })); + // Void Fortress Helm Goggles ResearchRegistry.recipes.put("ItemVoidFortressHelmet:goggles", ThaumcraftApi.addInfusionCraftingRecipe("HELMGOGGLES", new Object[]{ "goggles", new NBTTagByte((byte) 1) }, 5, new AspectList().add(Aspect.SENSES, 32).add(Aspect.AURA, 16).add(Aspect.ARMOR, 16), new ItemStack(ItemRegistry.ItemVoidFortressHelmet, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{ new ItemStack(Items.slime_ball), new ItemStack(ConfigItems.itemGoggles) })); + // Void Fortress Helm Grinning Devil Mask ResearchRegistry.recipes.put("ItemVoidFortressHelmet:mask0", ThaumcraftApi.addInfusionCraftingRecipe("MASKGRINNINGDEVIL", new Object[]{ "mask", new NBTTagInt(0) }, 8, new AspectList().add(Aspect.MIND, 64).add(Aspect.HEAL, 64).add(Aspect.ARMOR, 16), @@ -159,6 +179,7 @@ public class RecipeRegistry new ItemStack(Items.leather), new ItemStack(ConfigBlocks.blockCustomPlant, 1, 2), new ItemStack(ConfigItems.itemZombieBrain), new ItemStack(Items.iron_ingot) })); + // Void Fortress Helm Angry Ghost Mask ResearchRegistry.recipes.put("ItemVoidFortressHelmet:mask1", ThaumcraftApi.addInfusionCraftingRecipe("MASKANGRYGHOST", new Object[]{ "mask", new NBTTagInt(1) }, 8, new AspectList().add(Aspect.ENTROPY, 64).add(Aspect.DEATH, 64).add(Aspect.ARMOR, 16), @@ -167,6 +188,7 @@ public class RecipeRegistry new ItemStack(Items.leather), new ItemStack(Items.poisonous_potato), new ItemStack(Items.skull, 1, 1), new ItemStack(Items.iron_ingot) })); + // Void Fortress Helm Sipping Fiend Mask ResearchRegistry.recipes.put("ItemVoidFortressHelmet:mask2", ThaumcraftApi.addInfusionCraftingRecipe("MASKSIPPINGFIEND", new Object[]{ "mask", new NBTTagInt(2) }, 8, new AspectList().add(Aspect.UNDEAD, 64).add(Aspect.LIFE, 64).add(Aspect.ARMOR, 16), @@ -175,6 +197,7 @@ public class RecipeRegistry new ItemStack(Items.leather), new ItemStack(Items.ghast_tear), new ItemStack(Items.milk_bucket), new ItemStack(Items.iron_ingot) })); + // Void Fortress Helmet ResearchRegistry.recipes.put("ItemVoidFortressHelmet", ThaumcraftApi.addInfusionCraftingRecipe("VOIDFORTRESS", new ItemStack(ItemRegistry.ItemVoidFortressHelmet), 6, new AspectList().add(Aspect.METAL, 24).add(Aspect.ARMOR, 16).add(Aspect.MAGIC, 8).add(Aspect.ELDRITCH, 16) @@ -183,6 +206,7 @@ public class RecipeRegistry new ItemStack[]{ new ItemStack(ConfigItems.itemResource, 1, 16), new ItemStack(ConfigItems.itemResource, 1, 16), new ItemStack(Items.gold_ingot), new ItemStack(Items.gold_ingot), new ItemStack(Items.emerald) })); + // Void Fortress Chestplate ResearchRegistry.recipes.put("ItemVoidFortressChestplate", ThaumcraftApi.addInfusionCraftingRecipe("VOIDFORTRESS", new ItemStack(ItemRegistry.ItemVoidFortressChestplate), 6, new AspectList().add(Aspect.METAL, 24) .add(Aspect.ARMOR, 24).add(Aspect.MAGIC, 8).add(Aspect.ELDRITCH, 16).add(Aspect.VOID, 24), @@ -191,6 +215,7 @@ public class RecipeRegistry new ItemStack(ConfigItems.itemResource, 1, 16), new ItemStack(ConfigItems.itemResource, 1, 16), new ItemStack(Items.gold_ingot), new ItemStack(Items.leather) })); + // Void Fortress Leggings ResearchRegistry.recipes.put("ItemVoidFortressLeggings", ThaumcraftApi.addInfusionCraftingRecipe("VOIDFORTRESS", new ItemStack(ItemRegistry.ItemVoidFortressLeggings), 6, new AspectList().add(Aspect.METAL, 24) .add(Aspect.ARMOR, 20).add(Aspect.MAGIC, 8).add(Aspect.ELDRITCH, 16).add(Aspect.VOID, 20), @@ -199,13 +224,15 @@ public class RecipeRegistry new ItemStack(ConfigItems.itemResource, 1, 16), new ItemStack(Items.gold_ingot), new ItemStack(Items.leather) })); + // Warped Goggles ResearchRegistry.recipes.put("ItemWarpedGoggles", ThaumcraftApi.addInfusionCraftingRecipe("WARPEDGOGGLES", new ItemStack(ItemRegistry.ItemWarpedGoggles), 3, new AspectList().add(Aspect.ELDRITCH, 35).add(Aspect.DARKNESS, 12).add(Aspect.MAGIC, 16) .add(Aspect.ARMOR, 8), - new ItemStack(ConfigItems.itemGoggles), new ItemStack[]{ new ItemStack(ItemRegistry.ItemMaterial, 1, 8), - new ItemStack(ConfigItems.itemWispEssence, 1, OreDictionary.WILDCARD_VALUE) })); + new ItemStack(ConfigItems.itemGoggles, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{ + new ItemStack(ItemRegistry.ItemMaterial, 1, 0), new ItemStack(ConfigItems.itemNugget, 1, 5) })); + // Shadow Metal Wand Cap ResearchRegistry.recipes.put("ItemWandCap:0", ThaumcraftApi.addInfusionCraftingRecipe("CAP_shadowmetal", new ItemStack(ItemRegistry.ItemWandCap), 8, new AspectList().add(Aspect.ELDRITCH, 55).add(Aspect.DARKNESS, 47) .add(Aspect.MAGIC, 52).add(Aspect.METAL, 45).add(Aspect.VOID, 55), @@ -215,6 +242,7 @@ public class RecipeRegistry new ItemStack(ItemRegistry.ItemMaterial, 1, 9), new ItemStack(ItemRegistry.ItemMaterial), new ItemStack(ConfigItems.itemResource, 1, 16), new ItemStack(ItemRegistry.ItemMaterial) })); + // Taint Swarm Focus ResearchRegistry.recipes.put("ItemFocusTaintSwarm", ThaumcraftApi.addInfusionCraftingRecipe("TAINTFOCUS", new ItemStack(ItemRegistry.ItemFocusTaintSwarm), 4, new AspectList().add(Aspect.TAINT, 45).add(Aspect.LIFE, 24) .add(Aspect.MOTION, 24).add(Aspect.MAGIC, 16).add(Aspect.DEATH, 37), @@ -224,6 +252,7 @@ public class RecipeRegistry new ItemStack(ConfigItems.itemResource, 1, 11), new ItemStack(ItemRegistry.ItemMaterial, 1, 4), new ItemStack(ConfigItems.itemBottleTaint), new ItemStack(ItemRegistry.ItemMaterial, 1, 4) })); + // Dark Matter Focus ResearchRegistry.recipes.put("ItemFocusDarkMatter", ThaumcraftApi.addInfusionCraftingRecipe("ELDRITCHFOCUS", new ItemStack(ItemRegistry.ItemFocusDarkMatter), 6, new AspectList().add(Aspect.ELDRITCH, 64) .add(Aspect.DARKNESS, 32).add(Aspect.MAGIC, 32).add(Aspect.DEATH, 32).add(Aspect.VOID, 32), @@ -236,6 +265,7 @@ public class RecipeRegistry new ItemStack(ConfigItems.itemBucketDeath), new ItemStack(ItemRegistry.ItemMaterial, 1, 3), new ItemStack(ConfigItems.itemResource, 1, 16) })); + // Crimson Alloy Plate ResearchRegistry.recipes.put("ItemMaterial:7", ThaumcraftApi.addInfusionCraftingRecipe("KNIGHTROBES", new ItemStack(ItemRegistry.ItemMaterial, 9, 7), 2, new AspectList().add(Aspect.HUNGER, 4).add(Aspect.METAL, 8).add(Aspect.MAGIC, 6), @@ -245,6 +275,7 @@ public class RecipeRegistry new ItemStack(ItemRegistry.ItemCrimsonBlood), new ItemStack(Items.gold_nugget), new ItemStack(ItemRegistry.ItemCrimsonBlood), new ItemStack(Items.gold_nugget) })); + // Boots of the Voidwalker ResearchRegistry.recipes.put("ItemVoidwalkerBoots", ThaumcraftApi.addInfusionCraftingRecipe("VOIDWALKERBOOTS", new ItemStack(ItemRegistry.ItemVoidwalkerBoots), 8, new AspectList().add(Aspect.DARKNESS, 42) .add(Aspect.VOID, 56).add(Aspect.ELDRITCH, 38).add(Aspect.ARMOR, 60).add(Aspect.TRAVEL, 45), @@ -257,6 +288,7 @@ public class RecipeRegistry new ItemStack(ItemRegistry.ItemMaterial), new ItemStack(ItemRegistry.ItemMaterial, 1, 1), new ItemStack(ConfigItems.itemResource, 1, 16) })); + // Salis Tempestas ResearchRegistry.recipes.put("ItemSalis:0", ThaumcraftApi.addInfusionCraftingRecipe("SKYSALT", new ItemStack(ItemRegistry.ItemSalis, 3, 0), 7, new AspectList().add(Aspect.AURA, 20).add(Aspect.WEATHER, 30).add(Aspect.WATER, 30), @@ -264,12 +296,14 @@ public class RecipeRegistry new ItemStack[]{ new ItemStack(ItemRegistry.ItemMaterial, 1, 11), new ItemStack(ConfigItems.itemNugget, 1, 5) })); + // Salis Aevus ResearchRegistry.recipes.put("ItemSalis:1", ThaumcraftApi.addInfusionCraftingRecipe("TIMESALT", new ItemStack(ItemRegistry.ItemSalis, 3, 1), 7, new AspectList().add(Aspect.AURA, 20).add(Aspect.LIGHT, 30).add(Aspect.DARKNESS, 30), new ItemStack(ConfigItems.itemResource, 1, 14), new ItemStack[]{ new ItemStack(ItemRegistry.ItemMaterial, 1, 11), new ItemStack(Items.gold_nugget) })); + // Thaumic Disassembler ResearchRegistry.recipes.put("ItemThaumicDisassembler", ThaumcraftApi.addInfusionCraftingRecipe("THAUMICDISASSEMBLER", new ItemStack(ItemRegistry.ItemThaumicDisassembler), 3, new AspectList().add(Aspect.METAL, 22).add(Aspect.TOOL, 24).add(Aspect.WEAPON, 14).add(Aspect.MECHANISM, 12), @@ -279,12 +313,14 @@ public class RecipeRegistry new ItemStack(Items.diamond), new ItemStack(ConfigItems.itemSwordVoid), new ItemStack(ConfigItems.itemResource, 1, 2), new ItemStack(ConfigItems.itemAxeVoid) })); + // Shadow Fortress Helm Goggles ResearchRegistry.recipes.put("ItemShadowFortressHelmet:goggles", ThaumcraftApi.addInfusionCraftingRecipe("HELMGOGGLES", new Object[]{ "goggles", new NBTTagByte((byte) 1) }, 5, new AspectList().add(Aspect.SENSES, 32).add(Aspect.AURA, 16).add(Aspect.ARMOR, 16), new ItemStack(ItemRegistry.ItemShadowFortressHelmet, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{ new ItemStack(Items.slime_ball), new ItemStack(ConfigItems.itemGoggles) })); + // Shadow Fortress Helm Grinning Devil Mask ResearchRegistry.recipes.put("ItemShadowFortressHelmet:mask0", ThaumcraftApi.addInfusionCraftingRecipe("MASKGRINNINGDEVIL", new Object[]{ "mask", new NBTTagInt(0) }, 8, new AspectList().add(Aspect.MIND, 64).add(Aspect.HEAL, 64).add(Aspect.ARMOR, 16), @@ -293,6 +329,7 @@ public class RecipeRegistry new ItemStack(Items.leather), new ItemStack(ConfigBlocks.blockCustomPlant, 1, 2), new ItemStack(ConfigItems.itemZombieBrain), new ItemStack(Items.iron_ingot) })); + // Shadow Fortress Helm Angry Ghost Mask ResearchRegistry.recipes.put("ItemShadowFortressHelmet:mask1", ThaumcraftApi.addInfusionCraftingRecipe("MASKANGRYGHOST", new Object[]{ "mask", new NBTTagInt(1) }, 8, new AspectList().add(Aspect.ENTROPY, 64).add(Aspect.DEATH, 64).add(Aspect.ARMOR, 16), @@ -301,6 +338,7 @@ public class RecipeRegistry new ItemStack(Items.leather), new ItemStack(Items.poisonous_potato), new ItemStack(Items.skull, 1, 1), new ItemStack(Items.iron_ingot) })); + // Shadow Fortress Helm Sipping Fiend Mask ResearchRegistry.recipes.put("ItemShadowFortressHelmet:mask2", ThaumcraftApi.addInfusionCraftingRecipe("MASKSIPPINGFIEND", new Object[]{ "mask", new NBTTagInt(2) }, 8, new AspectList().add(Aspect.UNDEAD, 64).add(Aspect.LIFE, 64).add(Aspect.ARMOR, 16), @@ -309,6 +347,7 @@ public class RecipeRegistry new ItemStack(Items.leather), new ItemStack(Items.ghast_tear), new ItemStack(Items.milk_bucket), new ItemStack(Items.iron_ingot) })); + // Shadow Fortress Helmet ResearchRegistry.recipes.put("ItemShadowFortressHelmet", ThaumcraftApi.addInfusionCraftingRecipe("SHADOWFORTRESS", new ItemStack(ItemRegistry.ItemShadowFortressHelmet), 7, new AspectList().add(Aspect.METAL, 28).add(Aspect.ARMOR, 20).add(Aspect.MAGIC, 12).add(Aspect.DARKNESS, 30) @@ -317,6 +356,7 @@ public class RecipeRegistry new ItemStack[]{ new ItemStack(BlockRegistry.BlockShadowmetal), new ItemStack(BlockRegistry.BlockShadowmetal), new ItemStack(Items.gold_ingot), new ItemStack(Items.gold_ingot), new ItemStack(Items.emerald) })); + // Shadow Fortress Chestplate ResearchRegistry.recipes.put("ItemShadowFortressChestplate", ThaumcraftApi.addInfusionCraftingRecipe("SHADOWFORTRESS", new ItemStack(ItemRegistry.ItemShadowFortressChestplate), 7, new AspectList().add(Aspect.METAL, 38) .add(Aspect.ARMOR, 26).add(Aspect.MAGIC, 18).add(Aspect.DARKNESS, 34).add(Aspect.VOID, 26), @@ -325,6 +365,7 @@ public class RecipeRegistry new ItemStack(BlockRegistry.BlockShadowmetal), new ItemStack(BlockRegistry.BlockShadowmetal), new ItemStack(Items.gold_ingot), new ItemStack(Items.leather) })); + // Shadow Fortress Leggings ResearchRegistry.recipes.put("ItemShadowFortressLeggings", ThaumcraftApi.addInfusionCraftingRecipe("SHADOWFORTRESS", new ItemStack(ItemRegistry.ItemShadowFortressLeggings), 7, new AspectList().add(Aspect.METAL, 32) @@ -334,6 +375,7 @@ public class RecipeRegistry new ItemStack(BlockRegistry.BlockShadowmetal), new ItemStack(BlockRegistry.BlockShadowmetal), new ItemStack(Items.gold_ingot), new ItemStack(Items.leather) })); + // Thaumium Fortress Blade ResearchRegistry.recipes.put("ItemKatana:0", ThaumcraftApi.addInfusionCraftingRecipe("THAUMIUMKATANA", new ItemStack(ItemRegistry.ItemKatana, 1, 0), 3, new AspectList().add(Aspect.METAL, 42).add(Aspect.WEAPON, 45).add(Aspect.MAGIC, 22), @@ -345,6 +387,7 @@ public class RecipeRegistry new ItemStack(Items.emerald), new ItemStack(Items.iron_ingot), new ItemStack(ConfigItems.itemResource, 1, 2) })); + // Void Metal Fortress Blade ResearchRegistry.recipes.put("ItemKatana:1", ThaumcraftApi.addInfusionCraftingRecipe("VOIDMETALKATANA", new ItemStack(ItemRegistry.ItemKatana, 1, 1), 6, new AspectList().add(Aspect.METAL, 52).add(Aspect.WEAPON, 55) .add(Aspect.MAGIC, 32).add(Aspect.VOID, 46).add(Aspect.ELDRITCH, 12), @@ -356,6 +399,7 @@ public class RecipeRegistry new ItemStack(Items.emerald), new ItemStack(Items.iron_ingot), new ItemStack(ConfigItems.itemResource, 1, 16) })); + // Shadow Metal Fortress Blade ResearchRegistry.recipes.put("ItemKatana:2", ThaumcraftApi.addInfusionCraftingRecipe("SHADOWMETALKATANA", new ItemStack(ItemRegistry.ItemKatana, 1, 2), 7, new AspectList().add(Aspect.METAL, 62).add(Aspect.WEAPON, 65) .add(Aspect.MAGIC, 42).add(Aspect.VOID, 16).add(Aspect.DARKNESS, 46), @@ -367,17 +411,19 @@ public class RecipeRegistry new ItemStack(Items.emerald), new ItemStack(Items.iron_ingot), new ItemStack(ItemRegistry.ItemMaterial, 1, 0) })); + // Flyte Charm ResearchRegistry.recipes.put("ItemFlyteCharm", ThaumcraftApi.addInfusionCraftingRecipe("FLYTECHARM", new ItemStack(ItemRegistry.ItemFlyteCharm, 1, 0), 7, new AspectList().add(Aspect.FLIGHT, 86) .add(Aspect.AURA, 56).add(Aspect.SENSES, 25).add(Aspect.MAGIC, 48).add(Aspect.ENERGY, 65), new ItemStack(ConfigItems.itemPrimalArrow, 1, 0), - new ItemStack[]{ new ItemStack(ItemRegistry.ItemMaterial, 1, 9), new ItemStack(Items.gold_ingot), + new ItemStack[]{ new ItemStack(ItemRegistry.ItemMaterial, 1, 5), new ItemStack(Items.gold_ingot), new ItemStack(ConfigItems.itemShard, 1, 0), new ItemStack(Items.iron_ingot), - new ItemStack(ItemRegistry.ItemMaterial, 1, 5), new ItemStack(Items.gold_ingot), + new ItemStack(Items.feather), new ItemStack(Items.gold_ingot), new ItemStack(ConfigItems.itemShard, 1, 0), new ItemStack(Items.iron_ingot) })); - ResearchRegistry.recipes.put("ItemGatekey", - ThaumcraftApi.addInfusionCraftingRecipe("GATEKEY", new ItemStack(ItemRegistry.ItemGatekey, 1, 0), 7, + // Celestial Gate Key + ResearchRegistry.recipes.put("ItemGateKey", + ThaumcraftApi.addInfusionCraftingRecipe("GATEKEY", new ItemStack(ItemRegistry.ItemGateKey, 1, 0), 7, new AspectList() .add(Aspect.MOTION, 40).add(Aspect.AURA, 20).add(Aspect.TRAVEL, 25).add(Aspect.MAGIC, 30), new ItemStack(Items.gold_ingot), @@ -386,13 +432,14 @@ public class RecipeRegistry new ItemStack(Items.feather), new ItemStack(Items.iron_ingot), new ItemStack(ConfigItems.itemShard, 1, 6), new ItemStack(Items.ender_pearl) })); + // Void Metal Goggles ResearchRegistry.recipes.put("ItemVoidmetalGoggles", ThaumcraftApi.addInfusionCraftingRecipe("VOIDGOGGLES", new ItemStack(ItemRegistry.ItemVoidmetalGoggles), 5, new AspectList().add(Aspect.VOID, 40).add(Aspect.SENSES, 35).add(Aspect.ARMOR, 20), - new ItemStack(ItemRegistry.ItemWarpedGoggles, 1, OreDictionary.WILDCARD_VALUE), - new ItemStack[]{ new ItemStack(ConfigItems.itemResource, 1, 16), - new ItemStack(ConfigItems.itemResource, 1, 16) })); + new ItemStack(ItemRegistry.ItemWarpedGoggles, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{ + new ItemStack(ConfigItems.itemResource, 1, 16), new ItemStack(ConfigItems.itemNugget, 1, 5) })); + // Ring of Lumos ResearchRegistry.recipes.put("ItemLumosRing", ThaumcraftApi.addInfusionCraftingRecipe("LUMOSRING", new ItemStack(ItemRegistry.ItemLumosRing), 1, new AspectList().add(Aspect.LIGHT, 35).add(Aspect.SENSES, 25).add(Aspect.AURA, 10), @@ -461,78 +508,91 @@ public class RecipeRegistry */ public static void initArcane () { + // Crimson-stained Cloth ResearchRegistry.recipes.put("ItemMaterial:2", ThaumcraftApi.addShapelessArcaneCraftingRecipe("CRIMSONROBES", new ItemStack(ItemRegistry.ItemMaterial, 1, 2), new AspectList().add(Aspect.FIRE, 5).add(Aspect.ENTROPY, 5), new ItemStack(ItemRegistry.ItemCrimsonBlood), new ItemStack(ConfigItems.itemResource, 1, 7), new ItemStack(Items.gold_nugget))); - ResearchRegistry.recipes.put("ItemMaterial:12", - ThaumcraftApi.addShapelessArcaneCraftingRecipe("WARPTREE", new ItemStack(ItemRegistry.ItemMaterial, 1, 12), - new AspectList().add(Aspect.ENTROPY, 150), new ItemStack(ConfigItems.itemZombieBrain), - new ItemStack(ItemRegistry.ItemMaterial, 1, 3), - new ItemStack(ConfigItems.itemWispEssence, 1, OreDictionary.WILDCARD_VALUE))); + // Warping Fertilizer + ResearchRegistry.recipes.put("ItemMaterial:12", ThaumcraftApi.addShapelessArcaneCraftingRecipe("WARPTREE", + new ItemStack(ItemRegistry.ItemMaterial, 1, 12), new AspectList().add(Aspect.ENTROPY, 150), + new ItemStack(ConfigItems.itemZombieBrain), new ItemStack(ItemRegistry.ItemMaterial, 1, 3), + new ItemStack(ConfigItems.itemWispEssence, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.dye, 1, 15))); + // Thaumic Alloy Plate ResearchRegistry.recipes.put("ItemMaterial:6", ThaumcraftApi.addArcaneCraftingRecipe("THAUMICDISASSEMBLER", new ItemStack(ItemRegistry.ItemMaterial, 1, 6), new AspectList().add(Aspect.ORDER, 50).add(Aspect.ENTROPY, 50), "BAB", "A A", "BAB", 'A', new ItemStack(ConfigItems.itemResource, 1, 2), 'B', new ItemStack(ConfigItems.itemResource, 1, 16))); + // Crimson Cult Hood ResearchRegistry.recipes.put("ItemHelmetCultistRobe", ThaumcraftApi.addArcaneCraftingRecipe("CRIMSONROBES", new ItemStack(ConfigItems.itemHelmetCultistRobe), new AspectList().add(Aspect.FIRE, 5).add(Aspect.ENTROPY, 5), "AAA", "A A", 'A', new ItemStack(ItemRegistry.ItemMaterial, 1, 2))); + // Crimson Cult Robe ResearchRegistry.recipes.put("ItemChestCultistRobe", ThaumcraftApi.addArcaneCraftingRecipe("CRIMSONROBES", new ItemStack(ConfigItems.itemChestCultistRobe), new AspectList().add(Aspect.FIRE, 10).add(Aspect.ENTROPY, 10), "A A", "CAC", "ABA", 'A', new ItemStack(ItemRegistry.ItemMaterial, 1, 2), 'B', new ItemStack(Items.gold_ingot), 'C', new ItemStack(Items.iron_ingot))); + // Crimson Cult Leggings ResearchRegistry.recipes.put("ItemLegsCultistRobe", ThaumcraftApi.addArcaneCraftingRecipe("CRIMSONROBES", new ItemStack(ConfigItems.itemLegsCultistRobe), new AspectList().add(Aspect.FIRE, 8).add(Aspect.ENTROPY, 8), "ABA", "ACA", "A A", 'A', new ItemStack(ItemRegistry.ItemMaterial, 1, 2), 'B', new ItemStack(Items.gold_ingot), 'C', new ItemStack(Items.iron_ingot))); + // Crimson Cult Boots ResearchRegistry.recipes.put("ItemBootsCultist", ThaumcraftApi.addArcaneCraftingRecipe("CRIMSONROBES", new ItemStack(ConfigItems.itemBootsCultist), new AspectList().add(Aspect.FIRE, 5).add(Aspect.ENTROPY, 5), "A A", "A A", 'A', new ItemStack(ItemRegistry.ItemMaterial, 1, 2))); + // Warpwood Staff Core ResearchRegistry.recipes.put("ItemWandRod:1", ThaumcraftApi.addArcaneCraftingRecipe("ROD_warpwood_staff", new ItemStack(ItemRegistry.ItemWandRod, 1, 1), TaintedMagicHelper.getPrimals(120), " A", " B ", "B ", 'A', - new ItemStack(ConfigItems.itemEldritchObject, 1, 3), 'B', new ItemStack(ItemRegistry.ItemWandRod, 1, 0))); + new ItemStack(ItemRegistry.ItemMagicFunguar, 1, 10), 'B', new ItemStack(ItemRegistry.ItemWandRod, 1, 0))); + // Crimson Cult Helm ResearchRegistry.recipes.put("ItemHelmetCultistPlate", ThaumcraftApi.addArcaneCraftingRecipe("KNIGHTROBES", new ItemStack(ConfigItems.itemHelmetCultistPlate), new AspectList().add(Aspect.EARTH, 5).add(Aspect.FIRE, 5).add(Aspect.ENTROPY, 5), "ABA", "C C", 'A', new ItemStack(ItemRegistry.ItemMaterial, 1, 7), 'B', new ItemStack(Items.gold_ingot), 'C', new ItemStack(Items.iron_ingot))); + // Crimson Cult Chestplate ResearchRegistry.recipes.put("ItemChestCultistPlate", ThaumcraftApi.addArcaneCraftingRecipe("KNIGHTROBES", new ItemStack(ConfigItems.itemChestCultistPlate), new AspectList().add(Aspect.EARTH, 10).add(Aspect.FIRE, 10).add(Aspect.ENTROPY, 10), "A A", "ABA", "BBB", 'A', new ItemStack(Items.iron_ingot), 'B', new ItemStack(ItemRegistry.ItemMaterial, 1, 7))); + // Crimson Cult Greaves ResearchRegistry.recipes.put("ItemLegsCultistPlate", ThaumcraftApi.addArcaneCraftingRecipe("KNIGHTROBES", new ItemStack(ConfigItems.itemLegsCultistPlate), new AspectList().add(Aspect.EARTH, 8).add(Aspect.FIRE, 8).add(Aspect.ENTROPY, 8), "ABA", "ACA", " C ", 'A', new ItemStack(Items.iron_ingot), 'B', new ItemStack(Items.gold_ingot), 'C', new ItemStack(ItemRegistry.ItemMaterial, 1, 7))); + // Crimson Praetor Helm ResearchRegistry.recipes.put("ItemHelmetCultistLeaderPlate", ThaumcraftApi.addArcaneCraftingRecipe("PRAETORARMOR", new ItemStack(ConfigItems.itemHelmetCultistLeaderPlate), new AspectList().add(Aspect.ORDER, 15).add(Aspect.ENTROPY, 15).add(Aspect.FIRE, 15), "BCB", "DAD", "BCB", 'A', new ItemStack(ConfigItems.itemHelmetCultistPlate), 'B', new ItemStack(Items.iron_ingot), 'C', new ItemStack(ItemRegistry.ItemMaterial, 1, 7), 'D', new ItemStack(Items.gold_ingot))); + // Crimson Praetor Chestplate ResearchRegistry.recipes.put("ItemChestCultistLeaderPlate", ThaumcraftApi.addArcaneCraftingRecipe("PRAETORARMOR", new ItemStack(ConfigItems.itemChestCultistLeaderPlate), new AspectList().add(Aspect.ORDER, 25).add(Aspect.ENTROPY, 25).add(Aspect.FIRE, 25), "BBB", "CAC", "CDC", 'A', new ItemStack(ConfigItems.itemChestCultistPlate), 'B', new ItemStack(Items.iron_ingot), 'C', new ItemStack(ItemRegistry.ItemMaterial, 1, 7), 'D', new ItemStack(Items.gold_ingot))); + // Crimson Praetor Greaves ResearchRegistry.recipes.put("ItemLegsCultistLeaderPlate", ThaumcraftApi.addArcaneCraftingRecipe("PRAETORARMOR", new ItemStack(ConfigItems.itemLegsCultistLeaderPlate), new AspectList().add(Aspect.ORDER, 20).add(Aspect.ENTROPY, 20).add(Aspect.FIRE, 20), "CDC", "BAB", @@ -540,6 +600,7 @@ public class RecipeRegistry new ItemStack(ItemRegistry.ItemMaterial, 1, 7), 'C', new ItemStack(Items.iron_ingot), 'D', new ItemStack(Items.gold_ingot))); + // Shadow-imbued Cloth ResearchRegistry.recipes.put("ItemMaterial:1", ThaumcraftApi.addArcaneCraftingRecipe("SHADOWCLOTH", new ItemStack(ItemRegistry.ItemMaterial, 1, 1), new AspectList().add(Aspect.ORDER, 1).add(Aspect.WATER, 1).add(Aspect.EARTH, 1).add(Aspect.AIR, 1) @@ -547,28 +608,33 @@ public class RecipeRegistry " A ", "ABA", " A ", 'A', new ItemStack(ItemRegistry.ItemMaterial, 1, 8), 'B', new ItemStack(ConfigItems.itemResource, 1, 7))); + // Magic Funguar ResearchRegistry.recipes.put("ItemMagicFunguar", ThaumcraftApi.addShapelessArcaneCraftingRecipe("MAGICFUNGUAR", new ItemStack(ItemRegistry.ItemMagicFunguar), TaintedMagicHelper.getPrimals(1), new ItemStack(ConfigBlocks.blockCustomPlant, 1, 5), new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE), Items.glowstone_dust)); + // Hollow Dagger ResearchRegistry.recipes.put("ItemHollowDagger", ThaumcraftApi.addArcaneCraftingRecipe("HOLLOWDAGGER", new ItemStack(ItemRegistry.ItemHollowDagger), - new AspectList().add(Aspect.ENTROPY, 85), " A", "EBD", "C ", 'A', + new AspectList().add(Aspect.ENTROPY, 85), " A", " BD", "C ", 'A', new ItemStack(ConfigItems.itemWandRod, 1, 7), 'B', new ItemStack(ConfigBlocks.blockMagicalLog, 1, 0), - 'C', Items.stick, 'D', ConfigItems.itemNugget, 'E', Items.string)); + 'C', Items.stick, 'D', ConfigItems.itemNugget)); + // Cloth Wand Cap ResearchRegistry.recipes.put("ItemWandCap:1", ThaumcraftApi.addArcaneCraftingRecipe( "CAP_cloth", new ItemStack(ItemRegistry.ItemWandCap, 1, 1), new AspectList().add(Aspect.EARTH, 10) .add(Aspect.FIRE, 10).add(Aspect.ENTROPY, 10).add(Aspect.ORDER, 10), "AAA", "A A", 'A', new ItemStack(ConfigItems.itemResource, 1, 7))); + // Crimson-stained Cloth Wand Cap ResearchRegistry.recipes.put("ItemWandCap:2", ThaumcraftApi.addArcaneCraftingRecipe("CAP_crimsoncloth", new ItemStack(ItemRegistry.ItemWandCap, 1, 2), new AspectList().add(Aspect.FIRE, 25).add(Aspect.ENTROPY, 25).add(Aspect.ORDER, 25), "AAA", "ABA", 'A', new ItemStack(ItemRegistry.ItemMaterial, 1, 2), 'B', new ItemStack(ConfigItems.itemResource, 1, 14))); + // Shadow-imbued Cloth Wand Cap ResearchRegistry.recipes.put("ItemWandCap:3", ThaumcraftApi.addArcaneCraftingRecipe("CAP_shadowcloth", new ItemStack(ItemRegistry.ItemWandCap, 1, 3), new AspectList().add(Aspect.EARTH, 55).add(Aspect.FIRE, 55).add(Aspect.ENTROPY, 55).add(Aspect.ORDER, @@ -576,6 +642,7 @@ public class RecipeRegistry "AAA", "ABA", 'A', new ItemStack(ItemRegistry.ItemMaterial, 1, 1), 'B', new ItemStack(ConfigItems.itemResource, 1, 14))); + // Vis Shard Focus ResearchRegistry.recipes.put("ItemFocusVisShard", ThaumcraftApi.addArcaneCraftingRecipe("FOCUSSHARD", new ItemStack(ItemRegistry.ItemFocusVisShard), new AspectList().add(Aspect.AIR, 46).add(Aspect.ENTROPY, 38).add(Aspect.ORDER, 22), "BDC", "DAD", "CDB", @@ -583,51 +650,64 @@ public class RecipeRegistry 'C', new ItemStack(ItemRegistry.ItemMaterial, 1, 4), 'D', new ItemStack(ConfigItems.itemWispEssence, 1, OreDictionary.WILDCARD_VALUE))); + // Lumos Focus ResearchRegistry.recipes.put("ItemFocusLumos", ThaumcraftApi.addArcaneCraftingRecipe("FOCUSLUMOS", new ItemStack(ItemRegistry.ItemFocusLumos), new AspectList().add(Aspect.AIR, 52).add(Aspect.FIRE, 56).add(Aspect.ORDER, 28), "BDC", "DAD", "CDB", 'A', new ItemStack(ConfigItems.itemResource, 1, 3), 'B', new ItemStack(ConfigItems.itemResource, 1, 1), 'C', new ItemStack(ConfigItems.itemShard, 1, 6), 'D', new ItemStack(Items.glowstone_dust))); + // Primordial Nodule ResearchRegistry.recipes.put("ItemMaterial:9", ThaumcraftApi.addShapelessArcaneCraftingRecipe("BREAKPEARL", new ItemStack(ItemRegistry.ItemMaterial, 3, 9), new AspectList().add(Aspect.ENTROPY, 25), new ItemStack(ConfigItems.itemEldritchObject, 1, 3))); + // Primordial Mote ResearchRegistry.recipes.put("ItemMaterial:10", ThaumcraftApi.addShapelessArcaneCraftingRecipe("BREAKPEARL", new ItemStack(ItemRegistry.ItemMaterial, 3, 10), new AspectList().add(Aspect.ENTROPY, 15), new ItemStack(ItemRegistry.ItemMaterial, 1, 9))); + // Fragment of Creation ResearchRegistry.recipes.put("ItemMaterial:11", ThaumcraftApi.addShapelessArcaneCraftingRecipe("CREATIONSHARD", new ItemStack(ItemRegistry.ItemMaterial, 9, 11), new AspectList().add(Aspect.ENTROPY, 99), new ItemStack(ItemRegistry.ItemMaterial, 1, 5))); - ResearchRegistry.recipes.put("ItemVoidsentBlood", - ThaumcraftApi.addArcaneCraftingRecipe("VOIDSENTBLOOD", new ItemStack(ItemRegistry.ItemVoidsentBlood), + // Void Blood + ResearchRegistry.recipes.put("ItemVoidBlood", + ThaumcraftApi.addArcaneCraftingRecipe("VOIDBLOOD", new ItemStack(ItemRegistry.ItemVoidBlood), new AspectList().add(Aspect.ORDER, 35).add(Aspect.ENTROPY, 25), " B ", "CAC", " D ", 'A', new ItemStack(ItemRegistry.ItemCrimsonBlood), 'B', new ItemStack(ItemRegistry.ItemMaterial, 1, 10), 'C', new ItemStack(ConfigItems.itemResource, 1, 17), 'D', new ItemStack(ConfigItems.itemWispEssence, 1, OreDictionary.WILDCARD_VALUE))); } + /** + * Crucible recipes + */ public static void initCrucible () { + // Warped Unbalanced Shard ResearchRegistry.recipes.put("ItemMaterial:3", ThaumcraftApi.addCrucibleRecipe("UNBALANCEDSHARDS", new ItemStack(ItemRegistry.ItemMaterial, 1, 3), new ItemStack(ConfigItems.itemShard, 1, 6), new AspectList().merge(Aspect.ELDRITCH, 4))); + // Tainted Unbalanced Shard ResearchRegistry.recipes.put("ItemMaterial:4", ThaumcraftApi.addCrucibleRecipe("UNBALANCEDSHARDS", new ItemStack(ItemRegistry.ItemMaterial, 1, 4), new ItemStack(ConfigItems.itemShard, 1, 6), new AspectList().merge(Aspect.TAINT, 4))); + // Shadow Ore ResearchRegistry.recipes.put("BlockShadowOre", ThaumcraftApi.addCrucibleRecipe("SHADOWMETAL", new ItemStack(BlockRegistry.BlockShadowOre), new ItemStack(Blocks.stone), new AspectList().merge(Aspect.DARKNESS, 2).merge(Aspect.METAL, 5).merge(Aspect.MAGIC, 1))); + // Vishroom with Brown Mushroom ResearchRegistry.recipes.put("Vishroom_brown", ThaumcraftApi.addCrucibleRecipe("VISHROOMCRAFT", new ItemStack(ConfigBlocks.blockCustomPlant, 1, 5), new ItemStack(Blocks.brown_mushroom), new AspectList().merge(Aspect.MAGIC, 3).merge(Aspect.POISON, 1))); + // Vishroom with Red Mushroom ResearchRegistry.recipes.put("Vishroom_red", ThaumcraftApi.addCrucibleRecipe("VISHROOMCRAFT", new ItemStack(ConfigBlocks.blockCustomPlant, 1, 5), new ItemStack(Blocks.red_mushroom), new AspectList().merge(Aspect.MAGIC, 3).merge(Aspect.POISON, 1))); diff --git a/src/main/java/taintedmagic/common/registry/ResearchRegistry.java b/src/main/java/taintedmagic/common/registry/ResearchRegistry.java index 88ad524..11bfb37 100644 --- a/src/main/java/taintedmagic/common/registry/ResearchRegistry.java +++ b/src/main/java/taintedmagic/common/registry/ResearchRegistry.java @@ -5,12 +5,11 @@ import java.util.HashMap; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.util.ResourceLocation; -import taintedmagic.common.TaintedMagic; +import taintedmagic.common.handler.ConfigHandler; import taintedmagic.common.helper.TaintedMagicHelper; import taintedmagic.common.research.TMResearchItem; import taintedmagic.common.research.ThaumcraftResearchItem; import thaumcraft.api.ItemApi; -import thaumcraft.api.ThaumcraftApi; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.crafting.CrucibleRecipe; @@ -30,7 +29,7 @@ public class ResearchRegistry public static void initResearch () { ResearchCategories.registerCategory(categoryTM, new ResourceLocation("taintedmagic:textures/misc/tab_tm.png"), - TaintedMagic.configHandler.CUSTOM_RESEARCH_TAB_BACK + ConfigHandler.CUSTOM_RESEARCH_TAB_BACK ? new ResourceLocation("taintedmagic:textures/gui/gui_tm_researchback.png") : new ResourceLocation("thaumcraft:textures/gui/gui_researchback.png")); @@ -131,11 +130,11 @@ public class ResearchRegistry r.setParents("KNIGHTROBES").setParentsHidden("CRIMSONROBES", "TMELDRITCHMAJOR", "VOIDMETAL").setConcealed() .registerResearchItem(); - r = new TMResearchItem("VOIDSENTBLOOD", + r = new TMResearchItem("VOIDBLOOD", new AspectList().add(Aspect.VOID, 14).add(Aspect.DARKNESS, 8).add(Aspect.ARMOR, 18).add(Aspect.AURA, 4), -2, -5, - new ItemStack(ItemRegistry.ItemVoidsentBlood), 0, 3); - r.setPages(new ResearchPage("1"), arcanePage("ItemVoidsentBlood")); - r.setSecondary().setParents("HOLLOWDAGGER").setParentsHidden("ELDRITCHMAJOR", "PRIMPEARL").setConcealed() + new ItemStack(ItemRegistry.ItemVoidBlood), 0, 3); + r.setPages(new ResearchPage("1"), arcanePage("ItemVoidBlood")); + r.setSecondary().setParents("HOLLOWDAGGER").setParentsHidden("ELDRITCHMAJOR", "BREAKPEARL").setConcealed() .registerResearchItem(); r = new TMResearchItem("VOIDWALKERBOOTS", @@ -310,11 +309,10 @@ public class ResearchRegistry r = new TMResearchItem("FOCUSSHARD", new AspectList().add(Aspect.CRYSTAL, 2).add(Aspect.MAGIC, 4).add(Aspect.MOTION, 6), 6, 1, new ItemStack(ItemRegistry.ItemFocusVisShard), 0, 0); r.setPages(new ResearchPage("1"), arcanePage("ItemFocusVisShard")); - r.setParents("UNBALANCEDSHARDS").setParentsHidden("FOCUSFIRE").setConcealed().setSecondary() - .registerResearchItem(); + r.setParents("UNBALANCEDSHARDS").setParentsHidden("FOCUSFIRE").setConcealed().setSecondary().registerResearchItem(); - r = new TMResearchItem("TAINTFOCUS", new AspectList().add(Aspect.TAINT, 4).add(Aspect.LIFE, 4).add(Aspect.MOTION, 4), - 5, 2, new ItemStack(ItemRegistry.ItemFocusTaintSwarm), 3, 3); + r = new TMResearchItem("TAINTFOCUS", new AspectList().add(Aspect.TAINT, 4).add(Aspect.LIFE, 4).add(Aspect.MOTION, 4), 5, + 2, new ItemStack(ItemRegistry.ItemFocusTaintSwarm), 3, 3); r.setPages(new ResearchPage("1"), infusionPage("ItemFocusTaintSwarm")); r.setParentsHidden("INFUSION", "BOTTLETAINT").setParents("FOCUSSHARD").setConcealed().registerResearchItem(); @@ -337,8 +335,8 @@ public class ResearchRegistry r = new TMResearchItem("GATEKEY", new AspectList().add(Aspect.TRAVEL, 30).add(Aspect.EXCHANGE, 15).add(Aspect.AURA, 20).add(Aspect.FLIGHT, 10), 9, - -4, new ItemStack(ItemRegistry.ItemGatekey), 3, 0); - r.setPages(new ResearchPage("1"), infusionPage("ItemGatekey")); + -4, new ItemStack(ItemRegistry.ItemGateKey), 3, 0); + r.setPages(new ResearchPage("1"), infusionPage("ItemGateKey")); r.setParents("CREATION").setConcealed().registerResearchItem(); } diff --git a/src/main/java/taintedmagic/common/registry/TMEntityRegistry.java b/src/main/java/taintedmagic/common/registry/TMEntityRegistry.java index 0e3cdfb..62795b0 100644 --- a/src/main/java/taintedmagic/common/registry/TMEntityRegistry.java +++ b/src/main/java/taintedmagic/common/registry/TMEntityRegistry.java @@ -8,11 +8,12 @@ import taintedmagic.common.entities.EntityHomingShard; public class TMEntityRegistry { - public static void init () - { - int ID = 0; - EntityRegistry.registerModEntity(EntityDarkMatter.class, "EntityDarkMatter", ID++, TaintedMagic.instance, 64, 21, true); - EntityRegistry.registerModEntity(EntityHomingShard.class, "EntityHomingShard", ID++, TaintedMagic.instance, 64, 3, true); - EntityRegistry.registerModEntity(EntityDiffusion.class, "EntityDiffusion", ID++, TaintedMagic.instance, 64, 20, true); - } + public static void initEntities () + { + int ID = 0; + EntityRegistry.registerModEntity(EntityDarkMatter.class, "EntityDarkMatter", ID++, TaintedMagic.instance, 64, 21, true); + EntityRegistry.registerModEntity(EntityHomingShard.class, "EntityHomingShard", ID++, TaintedMagic.instance, 64, 3, + true); + EntityRegistry.registerModEntity(EntityDiffusion.class, "EntityDiffusion", ID++, TaintedMagic.instance, 64, 20, true); + } } diff --git a/src/main/java/taintedmagic/common/research/TMResearchItem.java b/src/main/java/taintedmagic/common/research/TMResearchItem.java index 4a12181..d3ece38 100644 --- a/src/main/java/taintedmagic/common/research/TMResearchItem.java +++ b/src/main/java/taintedmagic/common/research/TMResearchItem.java @@ -5,78 +5,76 @@ import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; -import taintedmagic.common.TaintedMagic; +import taintedmagic.common.handler.ConfigHandler; import taintedmagic.common.registry.ResearchRegistry; import thaumcraft.api.ThaumcraftApi; import thaumcraft.api.aspects.AspectList; -import thaumcraft.api.research.ResearchCategories; import thaumcraft.api.research.ResearchItem; import thaumcraft.api.research.ResearchPage; public class TMResearchItem extends ResearchItem { - int warp = 0; + int warp = 0; - public TMResearchItem (String key, String category) - { - super(key, category); - } + public TMResearchItem (String key, String category) + { + super(key, category); + } - public TMResearchItem (String key, AspectList tags, int col, int row, ItemStack icon, int complex, int warp) - { - super(key, ResearchRegistry.categoryTM, tags, col, row, complex, icon); - this.warp = warp; - } + public TMResearchItem (String key, AspectList tags, int col, int row, ItemStack icon, int complexity, int warp) + { + super(key, ResearchRegistry.categoryTM, tags, col, row, complexity, icon); + this.warp = warp; + } - public TMResearchItem (String key, AspectList tags, int col, int row, ResourceLocation icon, int complex, int warp) - { - super(key, ResearchRegistry.categoryTM, tags, col, row, complex, icon); - this.warp = warp; - } + public TMResearchItem (String key, AspectList tags, int col, int row, ResourceLocation icon, int complexity, int warp) + { + super(key, ResearchRegistry.categoryTM, tags, col, row, complexity, icon); + this.warp = warp; + } - @SideOnly (Side.CLIENT) - public String getName () - { - return StatCollector.translateToLocal("tm.name." + this.key); - } + @SideOnly (Side.CLIENT) + public String getName () + { + return StatCollector.translateToLocal("tm.name." + this.key); + } - @SideOnly (Side.CLIENT) - public String getText () - { - return (TaintedMagic.configHandler.RESEARCH_TAGS ? "[TM] " : "") + StatCollector.translateToLocal(new StringBuilder("tm.tag.").append(this.key).toString()); - } + @SideOnly (Side.CLIENT) + public String getText () + { + return (ConfigHandler.RESEARCH_TAGS ? "[TM] " : "") + + StatCollector.translateToLocal(new StringBuilder("tm.tag.").append(this.key).toString()); + } - @Override - public ResearchItem setPages (ResearchPage... par) - { - for (ResearchPage page : par) - { - if (page.type == ResearchPage.PageType.TEXT) - { - page.text = ("tm.text." + this.key + "." + page.text); - } - if (page.type != ResearchPage.PageType.INFUSION_CRAFTING) continue; - if ( (this.parentsHidden == null) || (this.parentsHidden.length == 0)) - { - this.parentsHidden = new String[]{ "INFUSION" }; - } - else - { - String[] newParents = new String[this.parentsHidden.length + 1]; - newParents[0] = "INFUSION"; - for (int i = 0; i < this.parentsHidden.length; i++) - newParents[ (i + 1)] = this.parentsHidden[i]; - this.parentsHidden = newParents; - } - } - return super.setPages(par); - } + @Override + public ResearchItem setPages (ResearchPage... pages) + { + for (ResearchPage page : pages) + { + if (page.type == ResearchPage.PageType.TEXT) page.text = ("tm.text." + this.key + "." + page.text); - @Override - public ResearchItem registerResearchItem () - { - super.registerResearchItem(); - if (warp > 0) ThaumcraftApi.addWarpToResearch(key, warp); - return this; - } + if (page.type != ResearchPage.PageType.INFUSION_CRAFTING) continue; + + if (this.parentsHidden == null || this.parentsHidden.length == 0) this.parentsHidden = new String[]{ "INFUSION" }; + else + { + String[] newParents = new String[this.parentsHidden.length + 1]; + newParents[0] = "INFUSION"; + + for (int i = 0; i < this.parentsHidden.length; i++) + newParents[ (i + 1)] = this.parentsHidden[i]; + + this.parentsHidden = newParents; + } + } + return super.setPages(pages); + } + + @Override + public ResearchItem registerResearchItem () + { + super.registerResearchItem(); + if (warp > 0) ThaumcraftApi.addWarpToResearch(key, warp); + return this; + } } \ No newline at end of file diff --git a/src/main/java/taintedmagic/common/research/ThaumcraftResearchItem.java b/src/main/java/taintedmagic/common/research/ThaumcraftResearchItem.java index 6539a45..a2e57bd 100644 --- a/src/main/java/taintedmagic/common/research/ThaumcraftResearchItem.java +++ b/src/main/java/taintedmagic/common/research/ThaumcraftResearchItem.java @@ -12,81 +12,80 @@ import thaumcraft.api.research.ResearchItem; import thaumcraft.api.research.ResearchPage; /** - * This class was created by as part of the Thaumic Exploration mod. - * It is being distributed as part of Tainted Magic + * This class was created by as part of Thaumic Exploration. + * It is being distributed as part of Tainted Magic. */ public class ThaumcraftResearchItem extends ResearchItem { - public ResearchItem original; + public ResearchItem original; - public ThaumcraftResearchItem (String tag, String origin, String originCategory, int col, int row, ResourceLocation icon) - { - super(tag, ResearchRegistry.categoryTM, new AspectList(), col, row, 1, icon); - original = ((ResearchCategoryList) ResearchCategories.researchCategories.get(originCategory)).research.get(origin); - bindToOriginal(); - setStub(); - setHidden(); + public ThaumcraftResearchItem (String tag, String origin, String originCategory, int col, int row, ResourceLocation icon) + { + super(tag, ResearchRegistry.categoryTM, new AspectList(), col, row, 1, icon); + original = ((ResearchCategoryList) ResearchCategories.researchCategories.get(originCategory)).research.get(origin); + bindToOriginal(); + setStub(); + setHidden(); + } - } + public ThaumcraftResearchItem (String tag, String origin, String originCategory, int col, int row, ItemStack icon) + { + super(tag, ResearchRegistry.categoryTM, new AspectList(), col, row, 1, icon); + original = ((ResearchCategoryList) ResearchCategories.researchCategories.get(originCategory)).research.get(origin); + bindToOriginal(); + setStub(); + setHidden(); + } - public ThaumcraftResearchItem (String tag, String origin, String originCategory, int col, int row, ItemStack icon) - { - super(tag, ResearchRegistry.categoryTM, new AspectList(), col, row, 1, icon); - original = ((ResearchCategoryList) ResearchCategories.researchCategories.get(originCategory)).research.get(origin); - bindToOriginal(); - setStub(); - setHidden(); - } + private void bindToOriginal () + { + if (original.siblings == null) original.setSiblings(new String[]{ key }); + else + { + String[] family = original.siblings; + String[] newFamily = new String[family.length + 1]; + for (int x = 0; x < family.length; x++) + { + newFamily[x] = family[x]; + } + newFamily[family.length] = key; + original.setSiblings(newFamily); + } + if (original.isSecondary()) + { + this.setSecondary(); + } + } - private void bindToOriginal () - { - if (original.siblings == null) original.setSiblings(new String[]{ key }); - else - { - String[] family = original.siblings; - String[] newFamily = new String[family.length + 1]; - for (int x = 0; x < family.length; x++) - { - newFamily[x] = family[x]; - } - newFamily[family.length] = key; - original.setSiblings(newFamily); - } - if (original.isSecondary()) - { - this.setSecondary(); - } - } + public ResearchPage[] getPages () + { + return original.getPages(); + } - public ResearchPage[] getPages () - { - return original.getPages(); - } + @SideOnly (Side.CLIENT) + public String getName () + { + return original.getName(); + } - @SideOnly (Side.CLIENT) - public String getName () - { - return original.getName(); - } + @SideOnly (Side.CLIENT) + public String getText () + { + return original.getText(); + } - @SideOnly (Side.CLIENT) - public String getText () - { - return original.getText(); - } + public boolean isStub () + { + return true; + } - public boolean isStub () - { - return true; - } + public boolean isHidden () + { + return true; + } - public boolean isHidden () - { - return true; - } - - public int getComplexity () - { - return 1; - } + public int getComplexity () + { + return 1; + } } \ No newline at end of file diff --git a/src/main/java/taintedmagic/common/world/WorldGenWarpwoodTree.java b/src/main/java/taintedmagic/common/world/WorldGenWarpwoodTree.java index 79e8ce5..8363580 100644 --- a/src/main/java/taintedmagic/common/world/WorldGenWarpwoodTree.java +++ b/src/main/java/taintedmagic/common/world/WorldGenWarpwoodTree.java @@ -11,197 +11,198 @@ import net.minecraft.world.gen.feature.WorldGenAbstractTree; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.common.util.ForgeDirection; import taintedmagic.common.registry.BlockRegistry; -import thaumcraft.common.config.ConfigBlocks; -import thaumcraft.common.lib.world.ThaumcraftWorldGenerator; import thaumcraft.common.lib.world.WorldGenCustomFlowers; /** - * Modified copy of WorldGenSilverwoodTrees.class + * This class is based off of WorldGenSilverwoodTrees.class created by as part of Thaumcraft 4. */ public class WorldGenWarpwoodTree extends WorldGenAbstractTree { - private Block trunk; - private Block leaves; - private final int minTreeHeight; - private final int randomTreeHeight; - boolean worldgen = false; + private Block trunk; + private Block leaves; + private final int minTreeHeight; + private final int randomTreeHeight; + boolean worldgen = false; - public WorldGenWarpwoodTree (boolean doBlockNotify, int minTreeHeight, int randomTreeHeight) - { - super(doBlockNotify); - this.worldgen = !doBlockNotify; - this.minTreeHeight = minTreeHeight; - this.randomTreeHeight = randomTreeHeight; - this.trunk = BlockRegistry.BlockWarpwoodLog; - this.leaves = BlockRegistry.BlockWarpwoodLeaves; - } + public WorldGenWarpwoodTree (boolean doBlockNotify, int minTreeHeight, int randomTreeHeight) + { + super(doBlockNotify); + this.worldgen = !doBlockNotify; + this.minTreeHeight = minTreeHeight; + this.randomTreeHeight = randomTreeHeight; + this.trunk = BlockRegistry.BlockWarpwoodLog; + this.leaves = BlockRegistry.BlockWarpwoodLeaves; + } - public boolean generate (World world, Random random, int x, int y, int z) - { - int height = random.nextInt(this.randomTreeHeight) + this.minTreeHeight; - boolean flag = true; - if (y >= 1 && y + height + 1 <= 256) - { - for (int i1 = y; i1 <= y + 1 + height; ++i1) - { - byte spread = 1; - if (i1 == y) - { - spread = 0; - } + public boolean generate (World world, Random random, int x, int y, int z) + { + int height = random.nextInt(this.randomTreeHeight) + this.minTreeHeight; + boolean flag = true; + if (y >= 1 && y + height + 1 <= 256) + { + for (int i1 = y; i1 <= y + 1 + height; ++i1) + { + byte spread = 1; + if (i1 == y) + { + spread = 0; + } - if (i1 >= y + 1 + height - 2) - { - spread = 3; - } + if (i1 >= y + 1 + height - 2) + { + spread = 3; + } - for (int j1 = x - spread; j1 <= x + spread && flag; ++j1) - { - for (int k1 = z - spread; k1 <= z + spread && flag; ++k1) - { - if (i1 >= 0 && i1 < 256) - { - Block block = world.getBlock(j1, i1, k1); - if (!block.isAir(world, j1, i1, k1) && !block.isLeaves(world, j1, i1, k1) && !block.isReplaceable(world, j1, i1, k1) && i1 > y) - { - flag = false; - } - } - else - { - flag = false; - } - } - } - } + for (int j1 = x - spread; j1 <= x + spread && flag; ++j1) + { + for (int k1 = z - spread; k1 <= z + spread && flag; ++k1) + { + if (i1 >= 0 && i1 < 256) + { + Block block = world.getBlock(j1, i1, k1); + if (!block.isAir(world, j1, i1, k1) && !block.isLeaves(world, j1, i1, k1) + && !block.isReplaceable(world, j1, i1, k1) && i1 > y) + { + flag = false; + } + } + else + { + flag = false; + } + } + } + } - if (!flag) - { - return false; - } - else - { - Block block1 = world.getBlock(x, y - 1, z); - boolean isSoil = block1.canSustainPlant(world, x, y - 1, z, ForgeDirection.UP, (BlockSapling) Blocks.sapling); - if (isSoil && y < 256 - height - 1) - { - block1.onPlantGrow(world, x, y - 1, z, x, y, z); - int start = y + height - 5; - int end = y + height + 3 + random.nextInt(3); + if (!flag) + { + return false; + } + else + { + Block block1 = world.getBlock(x, y - 1, z); + boolean isSoil = block1.canSustainPlant(world, x, y - 1, z, ForgeDirection.UP, (BlockSapling) Blocks.sapling); + if (isSoil && y < 256 - height - 1) + { + block1.onPlantGrow(world, x, y - 1, z, x, y, z); + int start = y + height - 5; + int end = y + height + 3 + random.nextInt(3); - int k2; - for (k2 = start; k2 <= end; ++k2) - { - int cty = MathHelper.clamp_int(k2, y + height - 3, y + height); + int k2; + for (k2 = start; k2 <= end; ++k2) + { + int cty = MathHelper.clamp_int(k2, y + height - 3, y + height); - for (int xx = x - 5; xx <= x + 5; ++xx) - { - for (int zz = z - 5; zz <= z + 5; ++zz) - { - double d3 = (double) (xx - x); - double d4 = (double) (k2 - cty); - double d5 = (double) (zz - z); - double dist = d3 * d3 + d4 * d4 + d5 * d5; - if (dist < (double) (10 + random.nextInt(8)) && world.getBlock(xx, k2, zz).canBeReplacedByLeaves(world, xx, k2, zz)) - { - this.setBlockAndNotifyAdequately(world, xx, k2, zz, this.leaves, 1); - } - } - } - } + for (int xx = x - 5; xx <= x + 5; ++xx) + { + for (int zz = z - 5; zz <= z + 5; ++zz) + { + double d3 = (double) (xx - x); + double d4 = (double) (k2 - cty); + double d5 = (double) (zz - z); + double dist = d3 * d3 + d4 * d4 + d5 * d5; + if (dist < (double) (10 + random.nextInt(8)) + && world.getBlock(xx, k2, zz).canBeReplacedByLeaves(world, xx, k2, zz)) + { + this.setBlockAndNotifyAdequately(world, xx, k2, zz, this.leaves, 1); + } + } + } + } - int chance = (int) ((double) height * 1.5D); - boolean lastblock = false; + int chance = (int) ((double) height * 1.5D); + boolean lastblock = false; - for (k2 = 0; k2 < height; ++k2) - { - Block block2 = world.getBlock(x, y + k2, z); - if (block2.isAir(world, x, y + k2, z) || block2.isLeaves(world, x, y + k2, z) || block2.isReplaceable(world, x, y + k2, z)) - { - this.setBlockAndNotifyAdequately(world, x, y + k2, z, this.trunk, 1); - this.setBlockAndNotifyAdequately(world, x - 1, y + k2, z, this.trunk, 1); - this.setBlockAndNotifyAdequately(world, x + 1, y + k2, z, this.trunk, 1); - this.setBlockAndNotifyAdequately(world, x, y + k2, z - 1, this.trunk, 1); - this.setBlockAndNotifyAdequately(world, x, y + k2, z + 1, this.trunk, 1); - } - } + for (k2 = 0; k2 < height; ++k2) + { + Block block2 = world.getBlock(x, y + k2, z); + if (block2.isAir(world, x, y + k2, z) || block2.isLeaves(world, x, y + k2, z) + || block2.isReplaceable(world, x, y + k2, z)) + { + this.setBlockAndNotifyAdequately(world, x, y + k2, z, this.trunk, 1); + this.setBlockAndNotifyAdequately(world, x - 1, y + k2, z, this.trunk, 1); + this.setBlockAndNotifyAdequately(world, x + 1, y + k2, z, this.trunk, 1); + this.setBlockAndNotifyAdequately(world, x, y + k2, z - 1, this.trunk, 1); + this.setBlockAndNotifyAdequately(world, x, y + k2, z + 1, this.trunk, 1); + } + } - this.setBlockAndNotifyAdequately(world, x, y + k2, z, this.trunk, 1); - this.setBlockAndNotifyAdequately(world, x - 1, y, z - 1, this.trunk, 1); - this.setBlockAndNotifyAdequately(world, x + 1, y, z + 1, this.trunk, 1); - this.setBlockAndNotifyAdequately(world, x - 1, y, z + 1, this.trunk, 1); - this.setBlockAndNotifyAdequately(world, x + 1, y, z - 1, this.trunk, 1); - if (random.nextInt(3) != 0) - { - this.setBlockAndNotifyAdequately(world, x - 1, y + 1, z - 1, this.trunk, 1); - } + this.setBlockAndNotifyAdequately(world, x, y + k2, z, this.trunk, 1); + this.setBlockAndNotifyAdequately(world, x - 1, y, z - 1, this.trunk, 1); + this.setBlockAndNotifyAdequately(world, x + 1, y, z + 1, this.trunk, 1); + this.setBlockAndNotifyAdequately(world, x - 1, y, z + 1, this.trunk, 1); + this.setBlockAndNotifyAdequately(world, x + 1, y, z - 1, this.trunk, 1); + if (random.nextInt(3) != 0) + { + this.setBlockAndNotifyAdequately(world, x - 1, y + 1, z - 1, this.trunk, 1); + } - if (random.nextInt(3) != 0) - { - this.setBlockAndNotifyAdequately(world, x + 1, y + 1, z + 1, this.trunk, 1); - } + if (random.nextInt(3) != 0) + { + this.setBlockAndNotifyAdequately(world, x + 1, y + 1, z + 1, this.trunk, 1); + } - if (random.nextInt(3) != 0) - { - this.setBlockAndNotifyAdequately(world, x - 1, y + 1, z + 1, this.trunk, 1); - } + if (random.nextInt(3) != 0) + { + this.setBlockAndNotifyAdequately(world, x - 1, y + 1, z + 1, this.trunk, 1); + } - if (random.nextInt(3) != 0) - { - this.setBlockAndNotifyAdequately(world, x + 1, y + 1, z - 1, this.trunk, 1); - } + if (random.nextInt(3) != 0) + { + this.setBlockAndNotifyAdequately(world, x + 1, y + 1, z - 1, this.trunk, 1); + } - this.setBlockAndNotifyAdequately(world, x - 2, y, z, this.trunk, 5); - this.setBlockAndNotifyAdequately(world, x + 2, y, z, this.trunk, 5); - this.setBlockAndNotifyAdequately(world, x, y, z - 2, this.trunk, 9); - this.setBlockAndNotifyAdequately(world, x, y, z + 2, this.trunk, 9); - this.setBlockAndNotifyAdequately(world, x - 2, y - 1, z, this.trunk, 1); - this.setBlockAndNotifyAdequately(world, x + 2, y - 1, z, this.trunk, 1); - this.setBlockAndNotifyAdequately(world, x, y - 1, z - 2, this.trunk, 1); - this.setBlockAndNotifyAdequately(world, x, y - 1, z + 2, this.trunk, 1); - this.setBlockAndNotifyAdequately(world, x - 1, y + (height - 4), z - 1, this.trunk, 1); - this.setBlockAndNotifyAdequately(world, x + 1, y + (height - 4), z + 1, this.trunk, 1); - this.setBlockAndNotifyAdequately(world, x - 1, y + (height - 4), z + 1, this.trunk, 1); - this.setBlockAndNotifyAdequately(world, x + 1, y + (height - 4), z - 1, this.trunk, 1); - if (random.nextInt(3) == 0) - { - this.setBlockAndNotifyAdequately(world, x - 1, y + (height - 5), z - 1, this.trunk, 1); - } + this.setBlockAndNotifyAdequately(world, x - 2, y, z, this.trunk, 5); + this.setBlockAndNotifyAdequately(world, x + 2, y, z, this.trunk, 5); + this.setBlockAndNotifyAdequately(world, x, y, z - 2, this.trunk, 9); + this.setBlockAndNotifyAdequately(world, x, y, z + 2, this.trunk, 9); + this.setBlockAndNotifyAdequately(world, x - 2, y - 1, z, this.trunk, 1); + this.setBlockAndNotifyAdequately(world, x + 2, y - 1, z, this.trunk, 1); + this.setBlockAndNotifyAdequately(world, x, y - 1, z - 2, this.trunk, 1); + this.setBlockAndNotifyAdequately(world, x, y - 1, z + 2, this.trunk, 1); + this.setBlockAndNotifyAdequately(world, x - 1, y + (height - 4), z - 1, this.trunk, 1); + this.setBlockAndNotifyAdequately(world, x + 1, y + (height - 4), z + 1, this.trunk, 1); + this.setBlockAndNotifyAdequately(world, x - 1, y + (height - 4), z + 1, this.trunk, 1); + this.setBlockAndNotifyAdequately(world, x + 1, y + (height - 4), z - 1, this.trunk, 1); + if (random.nextInt(3) == 0) + { + this.setBlockAndNotifyAdequately(world, x - 1, y + (height - 5), z - 1, this.trunk, 1); + } - if (random.nextInt(3) == 0) - { - this.setBlockAndNotifyAdequately(world, x + 1, y + (height - 5), z + 1, this.trunk, 1); - } + if (random.nextInt(3) == 0) + { + this.setBlockAndNotifyAdequately(world, x + 1, y + (height - 5), z + 1, this.trunk, 1); + } - if (random.nextInt(3) == 0) - { - this.setBlockAndNotifyAdequately(world, x - 1, y + (height - 5), z + 1, this.trunk, 1); - } + if (random.nextInt(3) == 0) + { + this.setBlockAndNotifyAdequately(world, x - 1, y + (height - 5), z + 1, this.trunk, 1); + } - if (random.nextInt(3) == 0) - { - this.setBlockAndNotifyAdequately(world, x + 1, y + (height - 5), z - 1, this.trunk, 1); - } + if (random.nextInt(3) == 0) + { + this.setBlockAndNotifyAdequately(world, x + 1, y + (height - 5), z - 1, this.trunk, 1); + } - this.setBlockAndNotifyAdequately(world, x - 2, y + (height - 4), z, this.trunk, 5); - this.setBlockAndNotifyAdequately(world, x + 2, y + (height - 4), z, this.trunk, 5); - this.setBlockAndNotifyAdequately(world, x, y + (height - 4), z - 2, this.trunk, 9); - this.setBlockAndNotifyAdequately(world, x, y + (height - 4), z + 2, this.trunk, 9); + this.setBlockAndNotifyAdequately(world, x - 2, y + (height - 4), z, this.trunk, 5); + this.setBlockAndNotifyAdequately(world, x + 2, y + (height - 4), z, this.trunk, 5); + this.setBlockAndNotifyAdequately(world, x, y + (height - 4), z - 2, this.trunk, 9); + this.setBlockAndNotifyAdequately(world, x, y + (height - 4), z + 2, this.trunk, 9); - WorldGenerator flowers = new WorldGenCustomFlowers(BlockRegistry.BlockNightshadeBush, 0); - flowers.generate(world, random, x, y, z); + WorldGenerator flowers = new WorldGenCustomFlowers(BlockRegistry.BlockNightshadeBush, 0); + flowers.generate(world, random, x, y, z); - return true; - } - else - { - return false; - } - } - } - else - { - return false; - } - } + return true; + } + else + { + return false; + } + } + } + else + { + return false; + } + } } \ No newline at end of file diff --git a/src/main/resources/assets/taintedmagic/textures/items/ItemVoidsentBlood.png b/src/main/resources/assets/taintedmagic/textures/items/ItemVoidBlood.png similarity index 100% rename from src/main/resources/assets/taintedmagic/textures/items/ItemVoidsentBlood.png rename to src/main/resources/assets/taintedmagic/textures/items/ItemVoidBlood.png