From 32dc71f8b39900e6effb213368e785b480ccb214 Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Wed, 1 Feb 2023 20:43:11 +0000 Subject: [PATCH] SA --- .../java/taintedmagic/api/IBloodlust.java | 6 +- .../taintedmagic/api/RecipeVoidsentBlood.java | 98 +- .../java/taintedmagic/client/ClientProxy.java | 101 +- .../client/handler/HUDHandler.java | 34 +- .../client/model/ModelKatana.java | 67 +- .../taintedmagic/client/model/ModelSaya.java | 45 +- .../renderer/RenderEntityHomingShard.java | 107 +- .../renderer/RenderEntityTaintBubble.java | 100 +- .../client/renderer/RenderItemKatana.java | 262 ++- .../java/taintedmagic/common/CommonProxy.java | 32 +- .../taintedmagic/common/TaintedMagic.java | 105 +- .../common/blocks/BlockShadowOre.java | 20 +- .../common/blocks/BlockShadowmetal.java | 42 +- .../common/blocks/BlockWarpwoodLeaves.java | 437 +++-- .../common/blocks/BlockWarpwoodLog.java | 89 +- .../common/blocks/BlockWarpwoodPlanks.java | 22 +- .../common/blocks/BlockWarpwoodSapling.java | 92 +- .../entities/EntityEldritchOrbAttack.java | 105 +- .../common/entities/EntityHomingShard.java | 281 ++- .../common/entities/EntityTaintBubble.java | 240 ++- .../common/handler/ConfigHandler.java | 42 +- .../handler/TaintedMagicEventHandler.java | 419 ++--- .../common/handler/UpdateHandler.java | 90 +- .../common/handler/WandUpdateHandler.java | 48 +- .../common/helper/TaintedMagicHelper.java | 44 +- .../common/items/ItemMagicFunguar.java | 87 +- .../common/items/ItemMaterial.java | 120 +- .../common/items/ItemVoidsentBlood.java | 34 +- .../items/blocks/ItemBlockShadowOre.java | 21 +- .../blocks/ItemBlockWarpwoodSapling.java | 25 +- .../equipment/ItemShadowFortressArmor.java | 171 +- .../equipment/ItemVoidFortressArmor.java | 116 +- .../items/equipment/ItemVoidmetalGoggles.java | 78 +- .../items/equipment/ItemVoidwalkerBoots.java | 213 +-- .../items/equipment/ItemVoidwalkerSash.java | 246 ++- .../items/equipment/ItemWarpedGoggles.java | 77 +- .../common/items/tools/ItemCrystalDagger.java | 30 +- .../common/items/tools/ItemKatana.java | 796 ++++----- .../items/tools/ItemPrimordialEdge.java | 182 +- .../items/tools/ItemShadowmetalAxe.java | 41 +- .../items/tools/ItemShadowmetalHoe.java | 109 +- .../items/tools/ItemShadowmetalPick.java | 35 +- .../items/tools/ItemShadowmetalSpade.java | 41 +- .../items/tools/ItemShadowmetalSword.java | 41 +- .../items/tools/ItemThaumicDisassembler.java | 287 ++- .../common/items/wand/ItemWandCap.java | 63 +- .../common/items/wand/ItemWandRod.java | 72 +- .../items/wand/foci/ItemFocusEldritch.java | 204 +-- .../items/wand/foci/ItemFocusMageMace.java | 182 +- .../items/wand/foci/ItemFocusMeteorology.java | 108 +- .../items/wand/foci/ItemFocusTaint.java | 240 ++- .../wand/foci/ItemFocusTaintedBlast.java | 206 +-- .../common/items/wand/foci/ItemFocusTime.java | 122 +- .../items/wand/foci/ItemFocusVisShard.java | 155 +- .../common/lib/LibCreativeTab.java | 74 +- .../taintedmagic/common/lib/LibStrings.java | 12 +- .../common/lib/LibToolMaterials.java | 38 +- .../common/network/PacketHandler.java | 16 +- .../common/network/PacketKatanaAttack.java | 99 +- .../common/registry/BlockRegistry.java | 60 +- .../common/registry/ItemRegistry.java | 272 +-- .../common/registry/ModEntityRegistry.java | 38 +- .../registry/OreDictionaryRegistry.java | 21 +- .../common/registry/RecipeRegistry.java | 1557 ++++++++++------- .../common/registry/ResearchRegistry.java | 893 +++++++--- .../research/TaintedMagicResearchItem.java | 92 +- .../research/ThaumcraftResearchItem.java | 133 +- .../common/world/WorldGenWarpwoodTree.java | 887 ++++------ 68 files changed, 5635 insertions(+), 5587 deletions(-) diff --git a/src/main/java/taintedmagic/api/IBloodlust.java b/src/main/java/taintedmagic/api/IBloodlust.java index a88a5cf..65de749 100644 --- a/src/main/java/taintedmagic/api/IBloodlust.java +++ b/src/main/java/taintedmagic/api/IBloodlust.java @@ -1,11 +1,7 @@ package taintedmagic.api; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - /** * Interface implemented by Bloodlust weapons */ -public interface IBloodlust -{ +public interface IBloodlust { } diff --git a/src/main/java/taintedmagic/api/RecipeVoidsentBlood.java b/src/main/java/taintedmagic/api/RecipeVoidsentBlood.java index a98697c..bcfe531 100644 --- a/src/main/java/taintedmagic/api/RecipeVoidsentBlood.java +++ b/src/main/java/taintedmagic/api/RecipeVoidsentBlood.java @@ -2,10 +2,10 @@ package taintedmagic.api; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; -import net.minecraft.item.ItemSword; import net.minecraft.item.crafting.IRecipe; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; + import taintedmagic.common.items.ItemVoidsentBlood; import thaumcraft.common.items.armor.ItemCultistLeaderArmor; import thaumcraft.common.items.armor.ItemCultistPlateArmor; @@ -14,59 +14,59 @@ import thaumcraft.common.items.armor.ItemCultistRobeArmor; /** * Custom recipe for aplpying Voidsent Blood to Cult Attire */ -public class RecipeVoidsentBlood implements IRecipe -{ - @Override - public boolean matches (InventoryCrafting inv, World w) - { - boolean foundBlood = false; - boolean foundArmor = false; +public class RecipeVoidsentBlood implements IRecipe { - for (int i = 0; i < inv.getSizeInventory(); i++) - { - ItemStack s = inv.getStackInSlot(i); + @Override + public boolean matches(InventoryCrafting inv, World w) { + boolean foundBlood = false; + boolean foundArmor = false; - if (s != null) - { - if (s.getItem() instanceof ItemVoidsentBlood && !foundBlood) foundBlood = true; - else if ( (s.getItem() instanceof ItemCultistRobeArmor || s.getItem() instanceof ItemCultistPlateArmor || s.getItem() instanceof ItemCultistLeaderArmor) && !foundArmor) foundArmor = true; + for (int i = 0; i < inv.getSizeInventory(); i++) { + ItemStack s = inv.getStackInSlot(i); - else return false; - } - } - return foundBlood && foundArmor; - } + if (s != null) { + if (s.getItem() instanceof ItemVoidsentBlood && !foundBlood) foundBlood = true; + else if ((s.getItem() instanceof ItemCultistRobeArmor || s.getItem() instanceof ItemCultistPlateArmor + || s.getItem() instanceof ItemCultistLeaderArmor) && !foundArmor) + foundArmor = true; - @Override - public ItemStack getCraftingResult (InventoryCrafting inv) - { - ItemStack copy = null; - ItemStack armor = null; - ItemStack blood = null; + else return false; + } + } + return foundBlood && foundArmor; + } - for (int i = 0; i < inv.getSizeInventory(); i++) - { - if (inv.getStackInSlot(i) != null && (inv.getStackInSlot(i).getItem() instanceof ItemCultistRobeArmor || inv.getStackInSlot(i).getItem() instanceof ItemCultistPlateArmor || inv.getStackInSlot(i).getItem() instanceof ItemCultistLeaderArmor)) armor = inv.getStackInSlot(i); - else if (inv.getStackInSlot(i) != null && inv.getStackInSlot(i).getItem() instanceof ItemVoidsentBlood) blood = inv.getStackInSlot(i); - } - 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()); - if (copy.getTagCompound() != null) copy.getTagCompound().setBoolean("voidtouched", true); - } - return copy; - } + @Override + public ItemStack getCraftingResult(InventoryCrafting inv) { + ItemStack copy = null; + ItemStack armor = null; + ItemStack blood = null; - @Override - public int getRecipeSize () - { - return 10; - } + for (int i = 0; i < inv.getSizeInventory(); i++) { + if (inv.getStackInSlot(i) != null && (inv.getStackInSlot(i).getItem() instanceof ItemCultistRobeArmor + || inv.getStackInSlot(i).getItem() instanceof ItemCultistPlateArmor + || inv.getStackInSlot(i).getItem() instanceof ItemCultistLeaderArmor)) + armor = inv.getStackInSlot(i); + else if (inv.getStackInSlot(i) != null && inv.getStackInSlot(i).getItem() instanceof ItemVoidsentBlood) + blood = inv.getStackInSlot(i); + } + 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()); + if (copy.getTagCompound() != null) copy.getTagCompound().setBoolean("voidtouched", true); + } + return copy; + } - @Override - public ItemStack getRecipeOutput () - { - return null; - } + @Override + public int getRecipeSize() { + return 10; + } + + @Override + public ItemStack getRecipeOutput() { + return null; + } } diff --git a/src/main/java/taintedmagic/client/ClientProxy.java b/src/main/java/taintedmagic/client/ClientProxy.java index dbb6545..eb4456e 100644 --- a/src/main/java/taintedmagic/client/ClientProxy.java +++ b/src/main/java/taintedmagic/client/ClientProxy.java @@ -1,13 +1,11 @@ package taintedmagic.client; -import java.util.Random; - import net.minecraft.client.Minecraft; -import net.minecraft.client.particle.EntityFX; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.common.MinecraftForge; + import taintedmagic.client.handler.HUDHandler; import taintedmagic.client.renderer.RenderEntityHomingShard; import taintedmagic.client.renderer.RenderEntityTaintBubble; @@ -23,63 +21,64 @@ import thaumcraft.client.fx.particles.FXWisp; import thaumcraft.client.renderers.entity.RenderEldritchOrb; import thaumcraft.codechicken.lib.vec.Vector3; import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.relauncher.ReflectionHelper; -public class ClientProxy extends CommonProxy -{ - @Override - public void initRenders () - { - // Entities - RenderingRegistry.registerEntityRenderingHandler(EntityTaintBubble.class, new RenderEntityTaintBubble()); - RenderingRegistry.registerEntityRenderingHandler(EntityEldritchOrbAttack.class, new RenderEldritchOrb()); - RenderingRegistry.registerEntityRenderingHandler(EntityHomingShard.class, new RenderEntityHomingShard()); +public class ClientProxy extends CommonProxy { - // Items - MinecraftForgeClient.registerItemRenderer(ItemRegistry.ItemKatana, new RenderItemKatana()); - } + @Override + public void initRenders() { + // Entities + RenderingRegistry.registerEntityRenderingHandler(EntityTaintBubble.class, new RenderEntityTaintBubble()); + RenderingRegistry.registerEntityRenderingHandler(EntityEldritchOrbAttack.class, new RenderEldritchOrb()); + RenderingRegistry.registerEntityRenderingHandler(EntityHomingShard.class, new RenderEntityHomingShard()); - @Override - public EntityPlayer getClientPlayer () - { - return Minecraft.getMinecraft().thePlayer; - } + // Items + MinecraftForgeClient.registerItemRenderer(ItemRegistry.ItemKatana, new RenderItemKatana()); + } - @Override - public void registerClientHandlers () - { - MinecraftForge.EVENT_BUS.register(new HUDHandler()); - } + @Override + public EntityPlayer getClientPlayer() { + return Minecraft.getMinecraft().thePlayer; + } - @Override - public void spawnShockwaveParticles (World w) - { - EntityPlayer p = getClientPlayer(); + @Override + public void registerClientHandlers() { + MinecraftForge.EVENT_BUS.register(new HUDHandler()); + } - double xp = 0; - double zp = 0; + @Override + public void spawnShockwaveParticles(World w) { + EntityPlayer p = getClientPlayer(); - for (int i = 1; i < 360; i++) - { - for (int j = 0; j < 5; j++) - { - xp = (Math.cos(i * Math.PI / 180F)); - zp = (Math.sin(i * Math.PI / 180F)); + double xp = 0; + double zp = 0; - float red = (0.05F + p.worldObj.rand.nextFloat() * 0.1F); - float blue = (0.1F + p.worldObj.rand.nextFloat() * 0.1F); + for (int i = 1; i < 360; i++) { + for (int j = 0; j < 5; j++) { + xp = (Math.cos(i * Math.PI / 180F)); + zp = (Math.sin(i * Math.PI / 180F)); - double off = Math.random() * 0.1; + float red = (0.05F + p.worldObj.rand.nextFloat() * 0.1F); + float blue = (0.1F + p.worldObj.rand.nextFloat() * 0.1F); - FXWisp ef = new FXWisp(w, p.posX + xp + off, p.posY - 1, p.posZ + zp + off, 2.0F * (float) Math.random(), red, 0.0F, blue); - ef.setGravity(0.0F); - ef.shrink = true; - ef.noClip = true; - Vector3 movement = TaintedMagicHelper.getDistanceBetween(ef, p); - ef.addVelocity(movement.x * 2.5, 0, movement.z * 2.5); + double off = Math.random() * 0.1; - ParticleEngine.instance.addEffect(w, ef); - } - } - } + FXWisp ef = new FXWisp( + w, + p.posX + xp + off, + p.posY - 1, + p.posZ + zp + off, + 2.0F * (float) Math.random(), + red, + 0.0F, + blue); + ef.setGravity(0.0F); + ef.shrink = true; + ef.noClip = true; + Vector3 movement = TaintedMagicHelper.getDistanceBetween(ef, p); + ef.addVelocity(movement.x * 2.5, 0, movement.z * 2.5); + + ParticleEngine.instance.addEffect(w, ef); + } + } + } } diff --git a/src/main/java/taintedmagic/client/handler/HUDHandler.java b/src/main/java/taintedmagic/client/handler/HUDHandler.java index a2d73e4..5fdcf9b 100644 --- a/src/main/java/taintedmagic/client/handler/HUDHandler.java +++ b/src/main/java/taintedmagic/client/handler/HUDHandler.java @@ -5,27 +5,25 @@ import net.minecraft.client.gui.ScaledResolution; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; + import taintedmagic.common.items.tools.ItemKatana; import taintedmagic.common.items.tools.ItemThaumicDisassembler; import cpw.mods.fml.common.eventhandler.SubscribeEvent; -public class HUDHandler -{ - @SubscribeEvent - public void onDrawScreen (RenderGameOverlayEvent.Post event) - { - if (event.type == ElementType.ALL) - { - Minecraft mc = Minecraft.getMinecraft(); - EntityPlayer p = mc.thePlayer; - ScaledResolution r = event.resolution; - float pt = event.partialTicks; +public class HUDHandler { - if (mc.currentScreen == null) - { - ItemKatana.renderHUD(r, p, pt); - ItemThaumicDisassembler.renderHUD(r, p, pt); - } - } - } + @SubscribeEvent + public void onDrawScreen(RenderGameOverlayEvent.Post event) { + if (event.type == ElementType.ALL) { + Minecraft mc = Minecraft.getMinecraft(); + EntityPlayer p = mc.thePlayer; + ScaledResolution r = event.resolution; + float pt = event.partialTicks; + + if (mc.currentScreen == null) { + ItemKatana.renderHUD(r, p, pt); + ItemThaumicDisassembler.renderHUD(r, p, pt); + } + } + } } diff --git a/src/main/java/taintedmagic/client/model/ModelKatana.java b/src/main/java/taintedmagic/client/model/ModelKatana.java index 306601f..1aa8cd8 100644 --- a/src/main/java/taintedmagic/client/model/ModelKatana.java +++ b/src/main/java/taintedmagic/client/model/ModelKatana.java @@ -1,48 +1,43 @@ package taintedmagic.client.model; -import org.lwjgl.opengl.GL11; - import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; /** * katana - wiiv Created using Tabula 4.1.1 */ -public class ModelKatana extends ModelBase -{ - public ModelRenderer blade; - public ModelRenderer grip1; - public ModelRenderer grip2; +public class ModelKatana extends ModelBase { - 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 ModelRenderer blade; + public ModelRenderer grip1; + public ModelRenderer grip2; - public void render (float size) - { - this.blade.render(size); - this.grip1.render(size); - } + 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); + } - /** - * 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; - } + 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 207ac93..f63355a 100644 --- a/src/main/java/taintedmagic/client/model/ModelSaya.java +++ b/src/main/java/taintedmagic/client/model/ModelSaya.java @@ -6,31 +6,28 @@ import net.minecraft.client.model.ModelRenderer; /** * katana - wiiv Created using Tabula 4.1.1 */ -public class ModelSaya extends ModelBase -{ - public ModelRenderer saya; +public class ModelSaya extends ModelBase { - 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 ModelRenderer saya; - public void render (float size) - { - this.saya.render(size); - } + 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); + } - /** - * 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/RenderEntityHomingShard.java b/src/main/java/taintedmagic/client/renderer/RenderEntityHomingShard.java index e27b655..e42c9e2 100644 --- a/src/main/java/taintedmagic/client/renderer/RenderEntityHomingShard.java +++ b/src/main/java/taintedmagic/client/renderer/RenderEntityHomingShard.java @@ -1,7 +1,5 @@ package taintedmagic.client.renderer; -import java.util.Random; - import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.texture.TextureMap; @@ -14,76 +12,71 @@ import taintedmagic.common.entities.EntityHomingShard; import thaumcraft.client.fx.ParticleEngine; /** - * 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 class RenderEntityHomingShard extends Render { - public void renderEntityAt (EntityHomingShard e, double x, double y, double z, float fq, float pt) - { - Tessellator t = Tessellator.instance; + public RenderEntityHomingShard() { + super(); + this.shadowSize = 0.0F; + } - GL11.glPushMatrix(); - GL11.glDepthMask(false); - GL11.glEnable(3042); - GL11.glBlendFunc(770, 771); + public void renderEntityAt(EntityHomingShard e, double x, double y, double z, float fq, float pt) { + Tessellator t = Tessellator.instance; - bindTexture(ParticleEngine.particleTexture); + GL11.glPushMatrix(); + GL11.glDepthMask(false); + GL11.glEnable(3042); + GL11.glBlendFunc(770, 771); - float f2 = (8 + e.ticksExisted % 8) / 16.0F; - float f3 = f2 + 0.0625F; - float f4 = 0.25F; - float f5 = f4 + 0.0625F; + bindTexture(ParticleEngine.particleTexture); - float f6 = 1.0F; - float f7 = 0.5F; - float f8 = 0.5F; + float f2 = (8 + e.ticksExisted % 8) / 16.0F; + float f3 = f2 + 0.0625F; + float f4 = 0.25F; + float f5 = f4 + 0.0625F; - GL11.glColor4f(0.405F, 0.075F, 0.525F, 1.0F); + float f6 = 1.0F; + float f7 = 0.5F; + float f8 = 0.5F; - 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()); + GL11.glColor4f(0.405F, 0.075F, 0.525F, 1.0F); - t.startDrawingQuads(); + 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()); - t.setColorRGBA_F(0.405F, 0.075F, 0.525F, 1.0F); - t.setNormal(0.0F, 1.0F, 0.0F); - t.setBrightness(240); + t.startDrawingQuads(); - 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); + t.setColorRGBA_F(0.405F, 0.075F, 0.525F, 1.0F); + t.setNormal(0.0F, 1.0F, 0.0F); + t.setBrightness(240); - t.draw(); + 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.glPopMatrix(); + t.draw(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glBlendFunc(770, 771); - GL11.glDisable(3042); - GL11.glDisable(32826); + GL11.glPopMatrix(); - GL11.glDepthMask(true); - GL11.glPopMatrix(); - } + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glBlendFunc(770, 771); + GL11.glDisable(3042); + GL11.glDisable(32826); - public void doRender (Entity e, double x, double y, double z, float f, float pt) - { - renderEntityAt((EntityHomingShard) e, x, y, z, f, pt); - } + GL11.glDepthMask(true); + GL11.glPopMatrix(); + } - protected ResourceLocation getEntityTexture (Entity e) - { - return TextureMap.locationBlocksTexture; - } + public void doRender(Entity e, double x, double y, double z, float f, float pt) { + renderEntityAt((EntityHomingShard) e, x, y, z, f, pt); + } + + protected ResourceLocation getEntityTexture(Entity e) { + return TextureMap.locationBlocksTexture; + } } diff --git a/src/main/java/taintedmagic/client/renderer/RenderEntityTaintBubble.java b/src/main/java/taintedmagic/client/renderer/RenderEntityTaintBubble.java index fb2a56c..2c04208 100644 --- a/src/main/java/taintedmagic/client/renderer/RenderEntityTaintBubble.java +++ b/src/main/java/taintedmagic/client/renderer/RenderEntityTaintBubble.java @@ -12,68 +12,66 @@ import org.lwjgl.opengl.GL11; import taintedmagic.common.entities.EntityTaintBubble; -public class RenderEntityTaintBubble extends Render -{ - private static final ResourceLocation texture = new ResourceLocation("taintedmagic:textures/entities/EntityTaintBubble.png"); - private Random random = new Random(); +public class RenderEntityTaintBubble extends Render { - public RenderEntityTaintBubble () - { - this.shadowSize = 0.0F; - } + private static final ResourceLocation texture = new ResourceLocation( + "taintedmagic:textures/entities/EntityTaintBubble.png"); + private Random random = new Random(); - @Override - public void doRender (Entity e, double x, double y, double z, float f, float pt) - { - Tessellator t = Tessellator.instance; - EntityTaintBubble bubble = (EntityTaintBubble) e; + public RenderEntityTaintBubble() { + this.shadowSize = 0.0F; + } - GL11.glPushMatrix(); - GL11.glTranslated(x, y, z); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); - GL11.glDepthMask(true); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F); + @Override + public void doRender(Entity e, double x, double y, double z, float f, float pt) { + Tessellator t = Tessellator.instance; + EntityTaintBubble bubble = (EntityTaintBubble) e; - Minecraft.getMinecraft().renderEngine.bindTexture(texture); + GL11.glPushMatrix(); + GL11.glTranslated(x, y, z); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); + GL11.glDepthMask(true); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F); - int p = (int) (7.0F * ((float) bubble.ticksExisted / (float) bubble.duration)); - float f2 = 0; - float f3 = 1; - float f4 = p / 8.0F; - float f5 = (p + 1) / 8.0F; + Minecraft.getMinecraft().renderEngine.bindTexture(texture); - float f6 = 1.0F; - float f7 = 0.5F; - float f8 = 0.5F; + int p = (int) (7.0F * ((float) bubble.ticksExisted / (float) bubble.duration)); + float f2 = 0; + float f3 = 1; + float f4 = p / 8.0F; + float f5 = (p + 1) / 8.0F; - float s = 0.25F; + float f6 = 1.0F; + float f7 = 0.5F; + float f8 = 0.5F; - GL11.glScalef(s, s, s); + float s = 0.25F; - 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(s, s, s); - t.startDrawingQuads(); - t.setBrightness(240); - t.setNormal(0.0F, 1.0F, 0.0F); - t.setColorRGBA_F(1.0F, 1.0F, 1.0F, 0.9F); + 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.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); + t.startDrawingQuads(); + t.setBrightness(240); + t.setNormal(0.0F, 1.0F, 0.0F); + t.setColorRGBA_F(1.0F, 1.0F, 1.0F, 0.9F); - t.draw(); + 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.glDisable(GL11.GL_BLEND); - GL11.glDisable(32826); - GL11.glPopMatrix(); - } + t.draw(); - @Override - protected ResourceLocation getEntityTexture (Entity e) - { - return null; - } -} \ No newline at end of file + GL11.glDisable(GL11.GL_BLEND); + GL11.glDisable(32826); + GL11.glPopMatrix(); + } + + @Override + protected ResourceLocation getEntityTexture(Entity e) { + return null; + } +} diff --git a/src/main/java/taintedmagic/client/renderer/RenderItemKatana.java b/src/main/java/taintedmagic/client/renderer/RenderItemKatana.java index 37fabca..98fce3f 100644 --- a/src/main/java/taintedmagic/client/renderer/RenderItemKatana.java +++ b/src/main/java/taintedmagic/client/renderer/RenderItemKatana.java @@ -16,167 +16,147 @@ import thaumcraft.client.lib.UtilsFX; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -@SideOnly (Side.CLIENT) -public class RenderItemKatana implements IItemRenderer -{ - @Override - public boolean handleRenderType (ItemStack s, ItemRenderType t) - { - return true; - } +@SideOnly(Side.CLIENT) +public class RenderItemKatana implements IItemRenderer { - @Override - public boolean shouldUseRenderHelper (ItemRenderType t, ItemStack s, ItemRendererHelper h) - { - return true; - } + @Override + public boolean handleRenderType(ItemStack s, ItemRenderType t) { + return true; + } - @Override - public void renderItem (ItemRenderType t, ItemStack s, Object... data) - { - EntityPlayer p = TaintedMagic.proxy.getClientPlayer(); + @Override + public boolean shouldUseRenderHelper(ItemRenderType t, ItemStack s, ItemRendererHelper h) { + return true; + } - GL11.glPushMatrix(); + @Override + public void renderItem(ItemRenderType t, ItemStack s, Object... data) { + EntityPlayer p = TaintedMagic.proxy.getClientPlayer(); - GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glPushMatrix(); - GL11.glScalef(1.4F, 1.4F, 1.4F); + GL11.glDisable(GL11.GL_CULL_FACE); - if ( (p.getHeldItem() == null || p.getHeldItem() != s) && t != ItemRenderType.EQUIPPED) - { - GL11.glPushMatrix(); + GL11.glScalef(1.4F, 1.4F, 1.4F); - if (t == 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) - { - GL11.glScalef(0.4F, 0.4F, 0.4F); - GL11.glRotatef(-65, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(-50, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(1F, 1F, 0.0F); - } - else - { - GL11.glTranslatef(0.0F, -0.7F, 0.0F); - } - Minecraft.getMinecraft().renderEngine.bindTexture(ItemKatana.getTexture(s)); - ItemKatana.saya.render(0.0625F); - GL11.glPopMatrix(); - } + if ((p.getHeldItem() == null || p.getHeldItem() != s) && t != ItemRenderType.EQUIPPED) { + GL11.glPushMatrix(); - GL11.glPushMatrix(); + if (t == 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) { + GL11.glScalef(0.4F, 0.4F, 0.4F); + GL11.glRotatef(-65, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(-50, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(1F, 1F, 0.0F); + } else { + GL11.glTranslatef(0.0F, -0.7F, 0.0F); + } + Minecraft.getMinecraft().renderEngine.bindTexture(ItemKatana.getTexture(s)); + ItemKatana.saya.render(0.0625F); + GL11.glPopMatrix(); + } - if (t == 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); - } + GL11.glPushMatrix(); - else if (t == ItemRenderType.EQUIPPED_FIRST_PERSON) - { - if (p.isUsingItem()) - { - GL11.glTranslatef(5.0F, 1.0F, -0.2F); - GL11.glRotatef(155.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-20.0F, 1.0F, 0.0F, 0.0F); - GL11.glTranslatef(0.0F, -0.25F, 0.0F); - } - GL11.glScalef(1.5F, 1.5F, 1.5F); - GL11.glTranslatef(2.0F, 1.85F, -0.25F); - GL11.glRotatef(-10F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-10F, 0.0F, 0.0F, 1.0F); - } - else if (t == ItemRenderType.INVENTORY) - { - GL11.glScalef(0.4F, 0.4F, 0.4F); - GL11.glRotatef(-65, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(-50, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(1F, 1F, 0.0F); - } - else - { - GL11.glRotatef(60, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(-40, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(70, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(0.0F, 2F, 0.65F); - } + if (t == 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); + } - Minecraft.getMinecraft().renderEngine.bindTexture(ItemKatana.getTexture(s)); + else if (t == ItemRenderType.EQUIPPED_FIRST_PERSON) { + if (p.isUsingItem()) { + GL11.glTranslatef(5.0F, 1.0F, -0.2F); + GL11.glRotatef(155.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-20.0F, 1.0F, 0.0F, 0.0F); + GL11.glTranslatef(0.0F, -0.25F, 0.0F); + } + GL11.glScalef(1.5F, 1.5F, 1.5F); + GL11.glTranslatef(2.0F, 1.85F, -0.25F); + GL11.glRotatef(-10F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-10F, 0.0F, 0.0F, 1.0F); + } else if (t == ItemRenderType.INVENTORY) { + GL11.glScalef(0.4F, 0.4F, 0.4F); + GL11.glRotatef(-65, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(-50, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(1F, 1F, 0.0F); + } else { + GL11.glRotatef(60, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(-40, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(70, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(0.0F, 2F, 0.65F); + } - ItemKatana.katana.render(0.0625F); + Minecraft.getMinecraft().renderEngine.bindTexture(ItemKatana.getTexture(s)); - // Runes - if (ItemKatana.hasAnyInscription(s)) - { - GL11.glPushMatrix(); - int j = 200; - int k = j % 65536; - int l = j / 65536; - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, k / 1.0F, l / 1.0F); + ItemKatana.katana.render(0.0625F); - GL11.glEnable(GL11.GL_BLEND); + // Runes + if (ItemKatana.hasAnyInscription(s)) { + GL11.glPushMatrix(); + int j = 200; + int k = j % 65536; + int l = j / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, k / 1.0F, l / 1.0F); - GL11.glBlendFunc(770, 1); - GL11.glRotated(90.0D, 0.0D, 1.0D, 0.0D); - for (int a = 0; a < 14; a++) - { - int rune = (a * 3) % 16; - drawRune(-1.65D + a * 0.14D, 0D, -0.03D, rune, p); - } - 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); - } - GL11.glBlendFunc(770, 771); - GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_BLEND); - GL11.glPopMatrix(); - } + GL11.glBlendFunc(770, 1); + GL11.glRotated(90.0D, 0.0D, 1.0D, 0.0D); + for (int a = 0; a < 14; a++) { + int rune = (a * 3) % 16; + drawRune(-1.65D + a * 0.14D, 0D, -0.03D, rune, p); + } + 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); + } + GL11.glBlendFunc(770, 771); + GL11.glDisable(GL11.GL_BLEND); - GL11.glPopMatrix(); + GL11.glPopMatrix(); + } - GL11.glScalef(1.0F, 1.0F, 1.0F); - GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glPopMatrix(); - GL11.glPopMatrix(); - } + GL11.glScalef(1.0F, 1.0F, 1.0F); + GL11.glEnable(GL11.GL_CULL_FACE); - /** - * TC method to draw runes on runed staves - */ - public static void drawRune (double x, double y, double z, int rune, EntityPlayer player) - { - GL11.glPushMatrix(); - UtilsFX.bindTexture("textures/misc/script.png"); - float r = MathHelper.sin( (player.ticksExisted + rune * 5) / 5.0F) * 0.1F + 0.88F; - float g = MathHelper.sin( (player.ticksExisted + rune * 5) / 7.0F) * 0.1F + 0.63F; - float alpha = MathHelper.sin( (player.ticksExisted + rune * 5) / 10.0F) * 0.3F; + GL11.glPopMatrix(); + } - GL11.glColor4f(r, g, 0.2F, alpha + 0.6F); - GL11.glRotated(90.0D, 0.0D, 0.0D, 1.0D); - GL11.glTranslated(x, y, z); + /** + * TC method to draw runes on runed staves + */ + public static void drawRune(double x, double y, double z, int rune, EntityPlayer player) { + GL11.glPushMatrix(); + UtilsFX.bindTexture("textures/misc/script.png"); + float r = MathHelper.sin((player.ticksExisted + rune * 5) / 5.0F) * 0.1F + 0.88F; + float g = MathHelper.sin((player.ticksExisted + rune * 5) / 7.0F) * 0.1F + 0.63F; + float alpha = MathHelper.sin((player.ticksExisted + rune * 5) / 10.0F) * 0.3F; - Tessellator tessellator = Tessellator.instance; - float f = 0.0625F * rune; - float f1 = f + 0.0625F; - float f2 = 0.0F; - float f3 = 1.0F; - tessellator.startDrawingQuads(); - tessellator.setColorRGBA_F(r, g, 0.2F, alpha + 0.6F); - tessellator.addVertexWithUV(-0.06D - alpha / 40.0F, 0.06D + alpha / 40.0F, 0.0D, f1, f3); - tessellator.addVertexWithUV(0.06D + alpha / 40.0F, 0.06D + alpha / 40.0F, 0.0D, f1, f2); - tessellator.addVertexWithUV(0.06D + alpha / 40.0F, -0.06D - alpha / 40.0F, 0.0D, f, f2); - tessellator.addVertexWithUV(-0.06D - alpha / 40.0F, -0.06D - alpha / 40.0F, 0.0D, f, f3); - tessellator.draw(); + GL11.glColor4f(r, g, 0.2F, alpha + 0.6F); + GL11.glRotated(90.0D, 0.0D, 0.0D, 1.0D); + GL11.glTranslated(x, y, z); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glPopMatrix(); - } -} \ No newline at end of file + Tessellator tessellator = Tessellator.instance; + float f = 0.0625F * rune; + float f1 = f + 0.0625F; + float f2 = 0.0F; + float f3 = 1.0F; + tessellator.startDrawingQuads(); + tessellator.setColorRGBA_F(r, g, 0.2F, alpha + 0.6F); + tessellator.addVertexWithUV(-0.06D - alpha / 40.0F, 0.06D + alpha / 40.0F, 0.0D, f1, f3); + tessellator.addVertexWithUV(0.06D + alpha / 40.0F, 0.06D + alpha / 40.0F, 0.0D, f1, f2); + tessellator.addVertexWithUV(0.06D + alpha / 40.0F, -0.06D - alpha / 40.0F, 0.0D, f, f2); + tessellator.addVertexWithUV(-0.06D - alpha / 40.0F, -0.06D - alpha / 40.0F, 0.0D, f, f3); + tessellator.draw(); + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/taintedmagic/common/CommonProxy.java b/src/main/java/taintedmagic/common/CommonProxy.java index ab98b55..7baab9a 100644 --- a/src/main/java/taintedmagic/common/CommonProxy.java +++ b/src/main/java/taintedmagic/common/CommonProxy.java @@ -1,33 +1,17 @@ package taintedmagic.common; -import taintedmagic.common.registry.ItemRegistry; -import thaumcraft.api.aspects.AspectList; -import thaumcraft.common.Thaumcraft; -import thaumcraft.common.items.wands.WandManager; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import net.minecraftforge.client.MinecraftForgeClient; -import cpw.mods.fml.client.registry.RenderingRegistry; -public class CommonProxy -{ - public void initRenders () - { - } +public class CommonProxy { - public EntityPlayer getClientPlayer () - { - return null; - } + public void initRenders() {} - public void registerClientHandlers () - { - } + public EntityPlayer getClientPlayer() { + return null; + } - public void spawnShockwaveParticles (World w) - { - } + public void registerClientHandlers() {} + + public void spawnShockwaveParticles(World w) {} } diff --git a/src/main/java/taintedmagic/common/TaintedMagic.java b/src/main/java/taintedmagic/common/TaintedMagic.java index 0d63e95..60d407e 100644 --- a/src/main/java/taintedmagic/common/TaintedMagic.java +++ b/src/main/java/taintedmagic/common/TaintedMagic.java @@ -1,19 +1,15 @@ package taintedmagic.common; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; -import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; import net.minecraftforge.common.util.EnumHelper; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import taintedmagic.api.IBloodlust; import taintedmagic.common.handler.ConfigHandler; import taintedmagic.common.handler.TaintedMagicEventHandler; import taintedmagic.common.handler.UpdateHandler; @@ -26,8 +22,6 @@ import taintedmagic.common.registry.ModEntityRegistry; import taintedmagic.common.registry.OreDictionaryRegistry; import taintedmagic.common.registry.RecipeRegistry; import taintedmagic.common.registry.ResearchRegistry; -import thaumcraft.api.aspects.Aspect; -import thaumcraft.api.aspects.AspectList; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; @@ -36,72 +30,73 @@ import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; -@Mod (modid = LibStrings.MODID, name = LibStrings.NAME, version = LibStrings.VERSION, dependencies = LibStrings.DEPENDENCIES) -public class TaintedMagic -{ - @Mod.Instance ("TaintedMagic") - public static TaintedMagic instance; +@Mod( + modid = LibStrings.MODID, + name = LibStrings.NAME, + version = LibStrings.VERSION, + dependencies = LibStrings.DEPENDENCIES) +public class TaintedMagic { + + @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 final String MOD_ID = "TaintedMagic"; public static final String MOD_NAME = "Tainted Magic"; public static final String VERSION = "GRADLETOKEN_VERSION"; public static final String DEPENDENCIES = "required-after:Forge@[10.13.4.1448,);required-after:Thaumcraft@[4.2.3.5,)"; - public static TaintedMagicEventHandler taintedMagicEvents; - public static CreativeTabs tabTaintedMagic = new LibCreativeTab(); - public static ConfigHandler configHandler; - public static final Logger log = LogManager.getLogger("TAINTEDMAGIC"); - public static EnumRarity rarityCreation = EnumHelper.addRarity("CREATION", EnumChatFormatting.GOLD, "Creation"); + public static TaintedMagicEventHandler taintedMagicEvents; + public static CreativeTabs tabTaintedMagic = new LibCreativeTab(); + public static ConfigHandler configHandler; + public static final Logger log = LogManager.getLogger("TAINTEDMAGIC"); + 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("Please stand back... Pre-initializing Tainted Magic!"); - // Config - configHandler.config = new Configuration(event.getSuggestedConfigurationFile()); - configHandler.init(); + // Config + configHandler.config = new Configuration(event.getSuggestedConfigurationFile()); + configHandler.init(); - proxy.registerClientHandlers(); + proxy.registerClientHandlers(); - PacketHandler.init(); - ItemRegistry.init(); - BlockRegistry.init(); - ModEntityRegistry.init(); - RecipeRegistry.init(); + PacketHandler.init(); + ItemRegistry.init(); + BlockRegistry.init(); + ModEntityRegistry.init(); + RecipeRegistry.init(); - OreDictionaryRegistry.init(); + OreDictionaryRegistry.init(); - if (configHandler.useUpdateHandler) UpdateHandler.init(); - } + if (configHandler.useUpdateHandler) UpdateHandler.init(); + } - // 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("Things seem to be going smoothly... Initializing Tainted Magic!"); - taintedMagicEvents = new TaintedMagicEventHandler(); + taintedMagicEvents = new TaintedMagicEventHandler(); - MinecraftForge.EVENT_BUS.register(taintedMagicEvents); - FMLCommonHandler.instance().bus().register(taintedMagicEvents); + MinecraftForge.EVENT_BUS.register(taintedMagicEvents); + FMLCommonHandler.instance().bus().register(taintedMagicEvents); - proxy.initRenders(); - } + proxy.initRenders(); + } - // Post init - @EventHandler - public static void postInit (FMLPostInitializationEvent event) - { - log.info("Almost done... Post-initializing Tainted Magic!"); + // Post init + @EventHandler + public static void postInit(FMLPostInitializationEvent event) { + log.info("Almost done... Post-initializing Tainted Magic!"); - ResearchRegistry.initResearch(); + ResearchRegistry.initResearch(); - log.info("Phew! Tainted Magic has finished loading, enjoy!"); - } + log.info("Phew! Tainted Magic has finished loading, enjoy!"); + } } diff --git a/src/main/java/taintedmagic/common/blocks/BlockShadowOre.java b/src/main/java/taintedmagic/common/blocks/BlockShadowOre.java index 542f86d..3d2ad00 100644 --- a/src/main/java/taintedmagic/common/blocks/BlockShadowOre.java +++ b/src/main/java/taintedmagic/common/blocks/BlockShadowOre.java @@ -2,16 +2,16 @@ package taintedmagic.common.blocks; import net.minecraft.block.Block; import net.minecraft.block.material.Material; + 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 class BlockShadowOre extends Block { + + 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 31ad851..7f14cae 100644 --- a/src/main/java/taintedmagic/common/blocks/BlockShadowmetal.java +++ b/src/main/java/taintedmagic/common/blocks/BlockShadowmetal.java @@ -1,34 +1,24 @@ package taintedmagic.common.blocks; -import java.util.List; - -import taintedmagic.common.TaintedMagic; import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; import net.minecraft.world.IBlockAccess; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -public class BlockShadowmetal extends Block -{ - public BlockShadowmetal () - { - super(Material.iron); - this.setHardness(5.0F); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setBlockTextureName("taintedmagic:BlockShadowmetal"); - this.setBlockName("BlockShadowmetal"); - this.setStepSound(soundTypeMetal); - } +import taintedmagic.common.TaintedMagic; - @Override - public boolean isBeaconBase (IBlockAccess w, int x, int y, int z, int x2, int y2, int z2) - { - return true; - } +public class BlockShadowmetal extends Block { + + public BlockShadowmetal() { + super(Material.iron); + this.setHardness(5.0F); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setBlockTextureName("taintedmagic:BlockShadowmetal"); + this.setBlockName("BlockShadowmetal"); + this.setStepSound(soundTypeMetal); + } + + @Override + public boolean isBeaconBase(IBlockAccess w, 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 6582028..1d43517 100644 --- a/src/main/java/taintedmagic/common/blocks/BlockWarpwoodLeaves.java +++ b/src/main/java/taintedmagic/common/blocks/BlockWarpwoodLeaves.java @@ -16,273 +16,254 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.IShearable; import net.minecraftforge.common.util.ForgeDirection; + import taintedmagic.common.TaintedMagic; import taintedmagic.common.registry.BlockRegistry; -import thaumcraft.common.Thaumcraft; import thaumcraft.common.config.ConfigBlocks; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class BlockWarpwoodLeaves extends Block implements IShearable -{ - int[] adjacentTreeBlocks; - private IIcon opaqueIcon; - private IIcon transparentIcon; +public class BlockWarpwoodLeaves extends Block implements IShearable { - public BlockWarpwoodLeaves () - { - super(Material.leaves); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setLightOpacity(0); - this.setHardness(0.1F); - this.setStepSound(ConfigBlocks.blockTaint.stepSound); - this.setBlockName("BlockWarpwoodLeaves"); - } + int[] adjacentTreeBlocks; + private IIcon opaqueIcon; + private IIcon transparentIcon; - @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); - } + public BlockWarpwoodLeaves() { + super(Material.leaves); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setLightOpacity(0); + this.setHardness(0.1F); + this.setStepSound(ConfigBlocks.blockTaint.stepSound); + this.setBlockName("BlockWarpwoodLeaves"); + } - @Override - public boolean isOpaqueCube () - { - return Blocks.leaves.isOpaqueCube(); - } + @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 - public IIcon getIcon (int side, int meta) - { - return !Blocks.leaves.isOpaqueCube() ? transparentIcon : opaqueIcon; - } + @Override + public boolean isOpaqueCube() { + return Blocks.leaves.isOpaqueCube(); + } - @Override - @SideOnly (Side.CLIENT) - public void registerBlockIcons (IIconRegister ir) - { - opaqueIcon = ir.registerIcon("taintedmagic:BlockWarpwoodLeaves_opaque"); - transparentIcon = ir.registerIcon("taintedmagic:BlockWarpwoodLeaves_transparent"); - } + @Override + public IIcon getIcon(int side, int meta) { + return !Blocks.leaves.isOpaqueCube() ? transparentIcon : opaqueIcon; + } - public void breakBlock (World w, int x, int y, int z, Block b, int i) - { - byte var7 = 1; - int var8 = var7 + 1; + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister ir) { + opaqueIcon = ir.registerIcon("taintedmagic:BlockWarpwoodLeaves_opaque"); + transparentIcon = ir.registerIcon("taintedmagic:BlockWarpwoodLeaves_transparent"); + } - 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); + public void breakBlock(World w, int x, int y, int z, Block b, int i) { + byte var7 = 1; + int var8 = var7 + 1; - if (var12 == Blocks.air) continue; - var12.beginLeavesDecay(w, x + var9, y + var10, z + var11); - } - } - } - } - } + 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); - public void updateTick (World w, int x, int y, int z, Random r) - { - if (!w.isRemote) - { - int var6 = w.getBlockMetadata(x, y, z); + if (var12 == Blocks.air) continue; + var12.beginLeavesDecay(w, x + var9, y + var10, z + var11); + } + } + } + } + } - 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; + public void updateTick(World w, int x, int y, int z, Random r) { + if (!w.isRemote) { + int var6 = w.getBlockMetadata(x, y, z); - if (this.adjacentTreeBlocks == null) - { - this.adjacentTreeBlocks = new int[var9 * var9 * var9]; - } + 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 (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 (this.adjacentTreeBlocks == null) { + this.adjacentTreeBlocks = new int[var9 * var9 * var9]; + } - 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 (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 (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(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 (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 + 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) * 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 + 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) 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) { + this.adjacentTreeBlocks[((var13 + var11) * var10 + (var14 + var11) * var9 + + (var15 + var11 - 1))] = var12; + } - int var12 = this.adjacentTreeBlocks[ (var11 * var10 + var11 * var9 + var11)]; + 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 (var12 >= 0) - { - w.setBlock(x, y, z, this, var6 & 0xFFFFFFF7, 3); - } - else - { - removeLeaves(w, x, y, z); - } - } - } - } + int var12 = this.adjacentTreeBlocks[(var11 * var10 + var11 * var9 + var11)]; - 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); - } + if (var12 >= 0) { + w.setBlock(x, y, z, this, var6 & 0xFFFFFFF7, 3); + } else { + removeLeaves(w, 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)); - } - } - } + 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); + } - 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 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 int damageDropped (int i) - { - return i & 0x1; - } + public void harvestBlock(World w, EntityPlayer p, int x, int y, int z, int i) { + super.harvestBlock(w, p, x, y, z, i); + } - public int quantityDropped (Random r) - { - return 0; - } + public int damageDropped(int i) { + return i & 0x1; + } - public Item getItemDropped (int i, Random r, int i2) - { - return Item.getItemById(0); - } + public int quantityDropped(Random r) { + return 0; + } - @Override - public boolean isLeaves (IBlockAccess w, int x, int y, int z) - { - return true; - } + public Item getItemDropped(int i, Random r, int i2) { + return Item.getItemById(0); + } - public void beginLeavesDecay (World w, int x, int y, int z) - { - w.setBlockMetadataWithNotify(x, y, z, w.getBlockMetadata(x, y, z) | 0x8, 4); - } + @Override + public boolean isLeaves(IBlockAccess w, int x, int y, int z) { + return true; + } - @SideOnly (Side.CLIENT) - public int getBlockColor () - { - return 0xFFFFFF; - } + public void beginLeavesDecay(World w, int x, int y, int z) { + w.setBlockMetadataWithNotify(x, y, z, w.getBlockMetadata(x, y, z) | 0x8, 4); + } - 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); - } + @SideOnly(Side.CLIENT) + public int getBlockColor() { + return 0xFFFFFF; + } - @SideOnly (Side.CLIENT) - @Override - public int getRenderColor (int m) - { - 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); + } - @SideOnly (Side.CLIENT) - public int colorMultiplier (IBlockAccess w, int x, int y, int z) - { - return 0xFFFFFF; - } + @SideOnly(Side.CLIENT) + @Override + public int getRenderColor(int m) { + return 0xFFFFFF; + } - @Override - public boolean isShearable (ItemStack s, IBlockAccess w, int x, int y, int z) - { - return true; - } + @SideOnly(Side.CLIENT) + public int colorMultiplier(IBlockAccess w, int x, int y, int z) { + return 0xFFFFFF; + } - 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; - } + @Override + public boolean isShearable(ItemStack s, IBlockAccess w, int x, int y, int z) { + return true; + } - public int getFlammability (IBlockAccess w, int x, int y, int z, ForgeDirection face) - { - return 0; - } + 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 int getFireSpreadSpeed (IBlockAccess w, int x, int y, int z, ForgeDirection face) - { - return 0; - } -} \ No newline at end of file + public int getFlammability(IBlockAccess w, 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; + } +} diff --git a/src/main/java/taintedmagic/common/blocks/BlockWarpwoodLog.java b/src/main/java/taintedmagic/common/blocks/BlockWarpwoodLog.java index 914d701..ed58de0 100644 --- a/src/main/java/taintedmagic/common/blocks/BlockWarpwoodLog.java +++ b/src/main/java/taintedmagic/common/blocks/BlockWarpwoodLog.java @@ -1,71 +1,58 @@ package taintedmagic.common.blocks; -import java.util.Random; - -import taintedmagic.common.TaintedMagic; -import taintedmagic.common.registry.BlockRegistry; -import thaumcraft.common.config.ConfigItems; -import net.minecraft.block.Block; import net.minecraft.block.BlockRotatedPillar; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.item.Item; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraftforge.common.util.ForgeDirection; + +import taintedmagic.common.TaintedMagic; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class BlockWarpwoodLog extends BlockRotatedPillar -{ - private IIcon side; - private IIcon top; +public class BlockWarpwoodLog extends BlockRotatedPillar { - public BlockWarpwoodLog () - { - super(Material.wood); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setHardness(2.5F); - this.setStepSound(soundTypeWood); - this.setBlockName("BlockWarpwoodLog"); - } + private IIcon side; + private IIcon top; - @SideOnly (Side.CLIENT) - protected IIcon getTopIcon (int i) - { - return this.top; - } + public BlockWarpwoodLog() { + super(Material.wood); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setHardness(2.5F); + this.setStepSound(soundTypeWood); + this.setBlockName("BlockWarpwoodLog"); + } - @SideOnly (Side.CLIENT) - protected IIcon getSideIcon (int i) - { - return this.side; - } + @SideOnly(Side.CLIENT) + protected IIcon getTopIcon(int i) { + return this.top; + } - @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) + protected IIcon getSideIcon(int i) { + return this.side; + } - public boolean canSustainLeaves (IBlockAccess w, int x, int y, int z) - { - return true; - } + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister ir) { + this.side = ir.registerIcon("taintedmagic:BlockWarpwoodLog_side"); + this.top = ir.registerIcon("taintedmagic:BlockWarpwoodLog_top"); + } - public boolean isWood (IBlockAccess w, int x, int y, int z) - { - return true; - } + public boolean canSustainLeaves(IBlockAccess w, int x, int y, int z) { + return true; + } - public int getFlammability (IBlockAccess w, int x, int y, int z, ForgeDirection face) - { - return 0; - } + public boolean isWood(IBlockAccess w, int x, int y, int z) { + return true; + } - public int getFireSpreadSpeed (IBlockAccess w, int x, int y, int z, ForgeDirection face) - { - return 0; - } + public int getFlammability(IBlockAccess w, 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; + } } diff --git a/src/main/java/taintedmagic/common/blocks/BlockWarpwoodPlanks.java b/src/main/java/taintedmagic/common/blocks/BlockWarpwoodPlanks.java index 7402233..1fecb30 100644 --- a/src/main/java/taintedmagic/common/blocks/BlockWarpwoodPlanks.java +++ b/src/main/java/taintedmagic/common/blocks/BlockWarpwoodPlanks.java @@ -2,17 +2,17 @@ package taintedmagic.common.blocks; import net.minecraft.block.Block; import net.minecraft.block.material.Material; + 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 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); + } } diff --git a/src/main/java/taintedmagic/common/blocks/BlockWarpwoodSapling.java b/src/main/java/taintedmagic/common/blocks/BlockWarpwoodSapling.java index ac2704d..7ce48e7 100644 --- a/src/main/java/taintedmagic/common/blocks/BlockWarpwoodSapling.java +++ b/src/main/java/taintedmagic/common/blocks/BlockWarpwoodSapling.java @@ -4,72 +4,66 @@ import java.util.List; import java.util.Random; import net.minecraft.block.BlockSapling; -import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; import net.minecraft.world.World; + import taintedmagic.common.TaintedMagic; import taintedmagic.common.registry.BlockRegistry; import taintedmagic.common.world.WorldGenWarpwoodTree; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class BlockWarpwoodSapling extends BlockSapling -{ - public BlockWarpwoodSapling () - { - super(); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setBlockName("BlockWarpwoodSapling"); - this.setStepSound(soundTypeGrass); - } +public class BlockWarpwoodSapling extends BlockSapling { - @Override - public void func_149878_d (World world, int x, int y, int z, Random rand) - { - if (!world.isRemote) - { - int meta = world.getBlockMetadata(x, y, z); + public BlockWarpwoodSapling() { + super(); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setBlockName("BlockWarpwoodSapling"); + this.setStepSound(soundTypeGrass); + } - world.setBlockToAir(x, y, z); + @Override + public void func_149878_d(World world, int x, int y, int z, Random rand) { + if (!world.isRemote) { + int meta = world.getBlockMetadata(x, y, z); - WorldGenWarpwoodTree tree = new WorldGenWarpwoodTree(true, BlockRegistry.BlockWarpwoodLog, BlockRegistry.BlockWarpwoodLeaves); + world.setBlockToAir(x, y, z); - if (!tree.generate(world, rand, x, y, z)) - { - world.setBlock(x, y, z, this, meta, 2); - } - } - } + WorldGenWarpwoodTree tree = new WorldGenWarpwoodTree( + true, + BlockRegistry.BlockWarpwoodLog, + BlockRegistry.BlockWarpwoodLeaves); - @Override - @SideOnly (Side.CLIENT) - public void getSubBlocks (Item s, CreativeTabs t, List l) - { - l.add(new ItemStack(this, 1, 0)); - } + if (!tree.generate(world, rand, x, y, z)) { + world.setBlock(x, y, z, this, meta, 2); + } + } + } - @Override - public Item getItemDropped (int i, Random random, int i2) - { - return Item.getItemFromBlock(this); - } + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item s, CreativeTabs t, List l) { + l.add(new ItemStack(this, 1, 0)); + } - @SideOnly (Side.CLIENT) - @Override - public void registerBlockIcons (IIconRegister ir) - { - this.blockIcon = ir.registerIcon("taintedmagic:BlockWarpwoodSapling"); - } + @Override + public Item getItemDropped(int i, Random random, int i2) { + return Item.getItemFromBlock(this); + } - @SideOnly (Side.CLIENT) - @Override - public IIcon getIcon (int side, int meta) - { - return this.blockIcon; - } -} \ No newline at end of file + @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; + } +} diff --git a/src/main/java/taintedmagic/common/entities/EntityEldritchOrbAttack.java b/src/main/java/taintedmagic/common/entities/EntityEldritchOrbAttack.java index f783c57..ccaacdf 100644 --- a/src/main/java/taintedmagic/common/entities/EntityEldritchOrbAttack.java +++ b/src/main/java/taintedmagic/common/entities/EntityEldritchOrbAttack.java @@ -1,73 +1,60 @@ package taintedmagic.common.entities; -import java.util.List; - import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.DamageSource; -import net.minecraft.util.EntityDamageSourceIndirect; import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.MovingObjectPosition.MovingObjectType; import net.minecraft.world.World; + import thaumcraft.common.entities.projectile.EntityEldritchOrb; -public class EntityEldritchOrbAttack extends EntityEldritchOrb -{ - public float dmg = 10F; - public boolean corrosive; +public class EntityEldritchOrbAttack extends EntityEldritchOrb { - public EntityEldritchOrbAttack (World w) - { - super(w); - } + public float dmg = 10F; + public boolean corrosive; - public EntityEldritchOrbAttack (World w, EntityLivingBase e, boolean corrosive) - { - super(w, e); - this.corrosive = corrosive; - } + public EntityEldritchOrbAttack(World w) { + super(w); + } - @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(); - } -} \ No newline at end of file + public EntityEldritchOrbAttack(World w, EntityLivingBase e, boolean corrosive) { + super(w, e); + this.corrosive = corrosive; + } + + @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(); + } +} diff --git a/src/main/java/taintedmagic/common/entities/EntityHomingShard.java b/src/main/java/taintedmagic/common/entities/EntityHomingShard.java index 1be24eb..9fdb4b7 100644 --- a/src/main/java/taintedmagic/common/entities/EntityHomingShard.java +++ b/src/main/java/taintedmagic/common/entities/EntityHomingShard.java @@ -1,7 +1,5 @@ package taintedmagic.common.entities; -import io.netty.buffer.ByteBuf; - import java.util.ArrayList; import net.minecraft.entity.Entity; @@ -12,171 +10,172 @@ import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; import net.minecraft.world.World; + import thaumcraft.common.Thaumcraft; import thaumcraft.common.lib.utils.EntityUtils; import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import io.netty.buffer.ByteBuf; /** - * this class is based off of EntityHomingShard.class created by as - * part of Thaumcraft 5 + * this class is based off of EntityHomingShard.class created by as part of Thaumcraft 5 */ -public class EntityHomingShard extends EntityThrowable implements IEntityAdditionalSpawnData -{ - Class tClass = null; - boolean persistant = false; +public class EntityHomingShard extends EntityThrowable implements IEntityAdditionalSpawnData { - int targetID = 0; - EntityLivingBase target; + Class tClass = null; + boolean persistant = false; - public EntityHomingShard (World w) - { - super(w); - } + int targetID = 0; + EntityLivingBase target; - 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 w) { + super(w); + } - @Override - public void entityInit () - { - super.entityInit(); - this.dataWatcher.addObject(17, (byte) 0); - } + 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 void setStrength (int str) - { - this.dataWatcher.updateObject(17, Byte.valueOf((byte) str)); - } + @Override + public void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(17, (byte) 0); + } - public int getStrength () - { - return this.dataWatcher.getWatchableObjectByte(17); - } + public void setStrength(int str) { + this.dataWatcher.updateObject(17, Byte.valueOf((byte) str)); + } - @Override - protected float getGravityVelocity () - { - return 0.0F; - } + public int getStrength() { + return this.dataWatcher.getWatchableObjectByte(17); + } - @Override - public void writeSpawnData (ByteBuf buf) - { - int id = -1; - if (this.target != null) id = this.target.getEntityId(); - buf.writeInt(id); - } + @Override + protected float getGravityVelocity() { + return 0.0F; + } - @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 writeSpawnData(ByteBuf buf) { + int id = -1; + if (this.target != null) id = this.target.getEntityId(); + buf.writeInt(id); + } - @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 + public void readSpawnData(ByteBuf buf) { + int id = buf.readInt(); + try { + if (id >= 0) this.target = ((EntityLivingBase) this.worldObj.getEntityByID(id)); + } catch (Exception e) {} + } - if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && this.worldObj.getBlock(mop.blockX, mop.blockY, mop.blockZ).isOpaqueCube()) - { - this.motionZ *= -0.5D; - this.motionX *= -0.5D; - this.motionY *= -0.5D; - } - } + @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 - @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); - } + if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK + && this.worldObj.getBlock(mop.blockX, mop.blockY, mop.blockZ).isOpaqueCube()) { + this.motionZ *= -0.5D; + this.motionX *= -0.5D; + this.motionY *= -0.5D; + } + } - @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 + @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); + } - super.onUpdate(); + @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); - 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); + super.onUpdate(); - 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(); - } - } + 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.ticksExisted > 300) - { - this.worldObj.setEntityState(this, (byte) 16); - setDead(); - } + 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(); + } + } - if (this.ticksExisted % 20 == 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 > 300) { + this.worldObj.setEntityState(this, (byte) 16); + setDead(); + } - this.motionX = dx; - this.motionY = dy; - this.motionZ = dz; + if (this.ticksExisted % 20 == 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.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.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; + } } diff --git a/src/main/java/taintedmagic/common/entities/EntityTaintBubble.java b/src/main/java/taintedmagic/common/entities/EntityTaintBubble.java index b367d0b..27b6adf 100644 --- a/src/main/java/taintedmagic/common/entities/EntityTaintBubble.java +++ b/src/main/java/taintedmagic/common/entities/EntityTaintBubble.java @@ -1,18 +1,10 @@ package taintedmagic.common.entities; -import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import io.netty.buffer.ByteBuf; - import java.util.List; -import java.util.Random; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.projectile.EntityThrowable; -import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; @@ -20,152 +12,126 @@ import net.minecraft.util.DamageSource; import net.minecraft.util.EntityDamageSourceIndirect; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import thaumcraft.api.potions.PotionFluxTaint; -import thaumcraft.common.Thaumcraft; -import thaumcraft.common.config.Config; -public class EntityTaintBubble extends EntityThrowable implements IEntityAdditionalSpawnData -{ - public static final String TAG_DURATION = "duration"; - public static final String TAG_DAMAGE = "damage"; +import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import io.netty.buffer.ByteBuf; - public boolean corrosive = false; - public int duration = 20; - public float damage = 5F; +public class EntityTaintBubble extends EntityThrowable implements IEntityAdditionalSpawnData { - public EntityTaintBubble (World w) - { - super(w); - } + public static final String TAG_DURATION = "duration"; + public static final String TAG_DAMAGE = "damage"; - public EntityTaintBubble (World w, EntityLivingBase e, float scatter, boolean corrosive) - { - super(w, e); - this.corrosive = corrosive; - setThrowableHeading(this.motionX, this.motionY, this.motionZ, func_70182_d(), scatter); - } + public boolean corrosive = false; + public int duration = 20; + public float damage = 5F; - protected float getGravityVelocity () - { - return 0.0F; - } + public EntityTaintBubble(World w) { + super(w); + } - protected float func_70182_d () - { - return 1.0F; - } + public EntityTaintBubble(World w, EntityLivingBase e, float scatter, boolean corrosive) { + super(w, e); + this.corrosive = corrosive; + setThrowableHeading(this.motionX, this.motionY, this.motionZ, func_70182_d(), scatter); + } - public void onUpdate () - { - if (this.ticksExisted > this.duration) setDead(); + protected float getGravityVelocity() { + return 0.0F; + } - if (this.duration <= 20) - { - this.motionX *= 0.95D; - this.motionY *= 0.95D; - this.motionZ *= 0.95D; - } - else - { - this.motionX *= 0.975D; - this.motionY *= 0.975D; - this.motionZ *= 0.975D; - } + protected float func_70182_d() { + return 1.0F; + } - if (this.onGround) - { - this.motionX *= 0.66D; - this.motionY *= 0.66D; - this.motionZ *= 0.66D; - } - super.onUpdate(); - } + public void onUpdate() { + if (this.ticksExisted > this.duration) setDead(); - public void writeSpawnData (ByteBuf data) - { - data.writeByte(this.duration); - } + if (this.duration <= 20) { + this.motionX *= 0.95D; + this.motionY *= 0.95D; + this.motionZ *= 0.95D; + } else { + this.motionX *= 0.975D; + this.motionY *= 0.975D; + this.motionZ *= 0.975D; + } - public void readSpawnData (ByteBuf data) - { - this.duration = data.readByte(); - } + if (this.onGround) { + this.motionX *= 0.66D; + this.motionY *= 0.66D; + this.motionZ *= 0.66D; + } + super.onUpdate(); + } - protected void onImpact (MovingObjectPosition mop) - { - if ( (!this.worldObj.isRemote) && (getThrower() != null)) - { - List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(getThrower(), this.boundingBox.expand(1.0D, 1.0D, 1.0D)); + public void writeSpawnData(ByteBuf data) { + data.writeByte(this.duration); + } - for (int i = 0; i < list.size(); i++) - { - Entity ent = (Entity) list.get(i); - if (ent instanceof EntityLivingBase) - { - if (mop.entityHit != null) - { - ((EntityLivingBase) ent).attackEntityFrom(new EntityDamageSourceIndirect("taint", this, getThrower()).setMagicDamage(), this.damage); - if (this.corrosive) - { - try - { - ((EntityLivingBase) ent).addPotionEffect(new PotionEffect(Potion.wither.id, 100, 1)); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - else - { - try - { - ((EntityLivingBase) ent).addPotionEffect(new PotionEffect(Potion.poison.id, 100, 1)); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - } - } - } - } - setDead(); - } + public void readSpawnData(ByteBuf data) { + this.duration = data.readByte(); + } - protected boolean canTriggerWalking () - { - return false; - } + protected void onImpact(MovingObjectPosition mop) { + if ((!this.worldObj.isRemote) && (getThrower() != null)) { + List list = this.worldObj + .getEntitiesWithinAABBExcludingEntity(getThrower(), this.boundingBox.expand(1.0D, 1.0D, 1.0D)); - @SideOnly (Side.CLIENT) - public float getShadowSize () - { - return 0.1F; - } + for (int i = 0; i < list.size(); i++) { + Entity ent = (Entity) list.get(i); + if (ent instanceof EntityLivingBase) { + if (mop.entityHit != null) { + ((EntityLivingBase) ent).attackEntityFrom( + new EntityDamageSourceIndirect("taint", this, getThrower()).setMagicDamage(), + this.damage); + if (this.corrosive) { + try { + ((EntityLivingBase) ent).addPotionEffect(new PotionEffect(Potion.wither.id, 100, 1)); + } catch (Exception e) { + e.printStackTrace(); + } + } else { + try { + ((EntityLivingBase) ent).addPotionEffect(new PotionEffect(Potion.poison.id, 100, 1)); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + } + } + } + setDead(); + } - public void writeEntityToNBT (NBTTagCompound cmp) - { - super.writeEntityToNBT(cmp); - cmp.setFloat(TAG_DAMAGE, this.damage); - cmp.setInteger(TAG_DURATION, this.duration); - } + protected boolean canTriggerWalking() { + return false; + } - public void readEntityFromNBT (NBTTagCompound cmp) - { - super.readEntityFromNBT(cmp); - this.damage = cmp.getInteger(TAG_DAMAGE); - this.duration = cmp.getInteger(TAG_DURATION); - } + @SideOnly(Side.CLIENT) + public float getShadowSize() { + return 0.1F; + } - public boolean canBeCollidedWith () - { - return false; - } + public void writeEntityToNBT(NBTTagCompound cmp) { + super.writeEntityToNBT(cmp); + cmp.setFloat(TAG_DAMAGE, this.damage); + cmp.setInteger(TAG_DURATION, this.duration); + } - public boolean attackEntityFrom (DamageSource s, float f) - { - return false; - } + public void readEntityFromNBT(NBTTagCompound cmp) { + super.readEntityFromNBT(cmp); + this.damage = cmp.getInteger(TAG_DAMAGE); + this.duration = cmp.getInteger(TAG_DURATION); + } + + public boolean canBeCollidedWith() { + return false; + } + + public boolean attackEntityFrom(DamageSource s, float f) { + return false; + } } diff --git a/src/main/java/taintedmagic/common/handler/ConfigHandler.java b/src/main/java/taintedmagic/common/handler/ConfigHandler.java index f944702..f4bc588 100644 --- a/src/main/java/taintedmagic/common/handler/ConfigHandler.java +++ b/src/main/java/taintedmagic/common/handler/ConfigHandler.java @@ -1,27 +1,35 @@ package taintedmagic.common.handler; import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; + import taintedmagic.common.TaintedMagic; -public class ConfigHandler -{ - public static Configuration config; +public class ConfigHandler { - public static boolean useUpdateHandler = true; - public static boolean researchTags = true; - public static boolean useCustomResearchTabBackground = false; - - public static void init () - { - TaintedMagic.log.info("Loading config"); + public static Configuration config; - config.load(); + public static boolean useUpdateHandler = true; + public static boolean researchTags = true; + public static boolean useCustomResearchTabBackground = false; - useUpdateHandler = config.getBoolean("use_update_handler", "misc", true, "Should update notifications be enabled?"); - researchTags = config.getBoolean("research_tags", "research", true, "Setting this to false will disable the '[TaintedMagic]' tag on the research"); - useCustomResearchTabBackground = config.getBoolean("use_custom_research_tab_background", "research", false, "Setting this to true will enable the old custom tab background"); + public static void init() { + TaintedMagic.log.info("Loading config"); - config.save(); - } + config.load(); + + useUpdateHandler = config + .getBoolean("use_update_handler", "misc", true, "Should update notifications be enabled?"); + researchTags = config.getBoolean( + "research_tags", + "research", + true, + "Setting this to false will disable the '[TaintedMagic]' tag on the research"); + useCustomResearchTabBackground = config.getBoolean( + "use_custom_research_tab_background", + "research", + false, + "Setting this to true will enable the old custom tab background"); + + config.save(); + } } diff --git a/src/main/java/taintedmagic/common/handler/TaintedMagicEventHandler.java b/src/main/java/taintedmagic/common/handler/TaintedMagicEventHandler.java index 0e3becf..ca66e57 100644 --- a/src/main/java/taintedmagic/common/handler/TaintedMagicEventHandler.java +++ b/src/main/java/taintedmagic/common/handler/TaintedMagicEventHandler.java @@ -16,12 +16,12 @@ import net.minecraft.nbt.NBTTagList; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraftforge.event.entity.living.LivingAttackEvent; import net.minecraftforge.event.entity.living.LivingDropsEvent; import net.minecraftforge.event.entity.living.LivingEvent; import net.minecraftforge.event.entity.player.ItemTooltipEvent; + import taintedmagic.api.IBloodlust; import taintedmagic.common.items.wand.foci.ItemFocusMageMace; import taintedmagic.common.registry.ItemRegistry; @@ -42,233 +42,238 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.PlayerEvent; import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent; -public class TaintedMagicEventHandler -{ - Random randy = new Random(); +public class TaintedMagicEventHandler { - @SubscribeEvent - public void livingTick (LivingEvent.LivingUpdateEvent event) - { - if (event.entity instanceof EntityPlayer) - { - EntityPlayer p = (EntityPlayer) event.entity; - updateAttackDamage(p); + Random randy = new Random(); - for (int i = 0; i < p.inventory.getSizeInventory(); i++) - { - if (p.inventory.getStackInSlot(i) != null && p.inventory.getStackInSlot(i).stackTagCompound != null && p.inventory.getStackInSlot(i).stackTagCompound.getBoolean("voidtouched")) - { - ItemStack s = p.inventory.getStackInSlot(i); - if (!p.worldObj.isRemote && s.isItemDamaged() && p.ticksExisted % 20 == 0) s.damageItem(-1, (EntityLivingBase) p); - } - } - } - } + @SubscribeEvent + public void livingTick(LivingEvent.LivingUpdateEvent event) { + if (event.entity instanceof EntityPlayer) { + EntityPlayer p = (EntityPlayer) event.entity; + updateAttackDamage(p); - /* - * Used to upate the attack damage for the Mage's Mace focus - */ - public void updateAttackDamage (EntityPlayer p) - { - if (!p.worldObj.isRemote) - { - IInventory inv = p.inventory; + for (int i = 0; i < p.inventory.getSizeInventory(); i++) { + if (p.inventory.getStackInSlot(i) != null && p.inventory.getStackInSlot(i).stackTagCompound != null + && p.inventory.getStackInSlot(i).stackTagCompound.getBoolean("voidtouched")) { + ItemStack s = p.inventory.getStackInSlot(i); + if (!p.worldObj.isRemote && s.isItemDamaged() && p.ticksExisted % 20 == 0) + s.damageItem(-1, (EntityLivingBase) p); + } + } + } + } - for (int i = 0; i < inv.getSizeInventory(); i++) - { - if (inv.getStackInSlot(i) != null && inv.getStackInSlot(i).getItem() instanceof ItemWandCasting) - { - ItemStack s = inv.getStackInSlot(i); - ItemWandCasting wand = (ItemWandCasting) inv.getStackInSlot(i).getItem(); + /* + * Used to upate the attack damage for the Mage's Mace focus + */ + public void updateAttackDamage(EntityPlayer p) { + if (!p.worldObj.isRemote) { + IInventory inv = p.inventory; - if (wand.getFocus(s) != null && wand.getFocus(s) == ItemRegistry.ItemFocusMageMace && wand.getRod(s) instanceof WandRod) - { - NBTTagList tags = new NBTTagList(); - NBTTagCompound tag = new NBTTagCompound(); - tag.setString("AttributeName", SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName()); + for (int i = 0; i < inv.getSizeInventory(); i++) { + if (inv.getStackInSlot(i) != null && inv.getStackInSlot(i).getItem() instanceof ItemWandCasting) { + ItemStack s = inv.getStackInSlot(i); + ItemWandCasting wand = (ItemWandCasting) inv.getStackInSlot(i).getItem(); - UUID u = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF"); - AttributeModifier am = new AttributeModifier(u, "Weapon modifier", 15.0D + wand.getFocusPotency(s), 0); + if (wand.getFocus(s) != null && wand.getFocus(s) == ItemRegistry.ItemFocusMageMace + && wand.getRod(s) instanceof WandRod) { + NBTTagList tags = new NBTTagList(); + NBTTagCompound tag = new NBTTagCompound(); + tag.setString( + "AttributeName", + SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName()); - tag.setString("Name", am.getName()); - tag.setDouble("Amount", am.getAmount()); - tag.setInteger("Operation", am.getOperation()); - tag.setLong("UUIDMost", am.getID().getMostSignificantBits()); - tag.setLong("UUIDLeast", am.getID().getLeastSignificantBits()); + UUID u = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF"); + AttributeModifier am = new AttributeModifier( + u, + "Weapon modifier", + 15.0D + wand.getFocusPotency(s), + 0); - tags.appendTag(tag); - s.stackTagCompound.setTag("AttributeModifiers", tags); - } - else if (wand.getRod(s) instanceof WandRod) - { - if (!s.hasTagCompound()) - { - s.setTagCompound(new NBTTagCompound()); - } - s.stackTagCompound.removeTag("AttributeModifiers"); - } - if (wand.getFocus(s) != null && wand.getFocus(s) == ItemRegistry.ItemFocusMageMace && wand.getRod(s) instanceof StaffRod) - { - NBTTagList tags = new NBTTagList(); - NBTTagCompound tag = new NBTTagCompound(); - tag.setString("AttributeName", SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName()); + tag.setString("Name", am.getName()); + tag.setDouble("Amount", am.getAmount()); + tag.setInteger("Operation", am.getOperation()); + tag.setLong("UUIDMost", am.getID().getMostSignificantBits()); + tag.setLong("UUIDLeast", am.getID().getLeastSignificantBits()); - UUID u = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF"); - AttributeModifier am = new AttributeModifier(u, "Weapon modifier", 21.0D + wand.getFocusPotency(s), 0); + tags.appendTag(tag); + s.stackTagCompound.setTag("AttributeModifiers", tags); + } else if (wand.getRod(s) instanceof WandRod) { + if (!s.hasTagCompound()) { + s.setTagCompound(new NBTTagCompound()); + } + s.stackTagCompound.removeTag("AttributeModifiers"); + } + if (wand.getFocus(s) != null && wand.getFocus(s) == ItemRegistry.ItemFocusMageMace + && wand.getRod(s) instanceof StaffRod) { + NBTTagList tags = new NBTTagList(); + NBTTagCompound tag = new NBTTagCompound(); + tag.setString( + "AttributeName", + SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName()); - tag.setString("Name", am.getName()); - tag.setDouble("Amount", am.getAmount()); - tag.setInteger("Operation", am.getOperation()); - tag.setLong("UUIDMost", am.getID().getMostSignificantBits()); - tag.setLong("UUIDLeast", am.getID().getLeastSignificantBits()); + UUID u = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF"); + AttributeModifier am = new AttributeModifier( + u, + "Weapon modifier", + 21.0D + wand.getFocusPotency(s), + 0); - tags.appendTag(tag); - s.stackTagCompound.setTag("AttributeModifiers", tags); - } - else if (wand.getRod(s) instanceof StaffRod) - { - NBTTagList tags = new NBTTagList(); - NBTTagCompound tag = new NBTTagCompound(); - tag.setString("AttributeName", SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName()); + tag.setString("Name", am.getName()); + tag.setDouble("Amount", am.getAmount()); + tag.setInteger("Operation", am.getOperation()); + tag.setLong("UUIDMost", am.getID().getMostSignificantBits()); + tag.setLong("UUIDLeast", am.getID().getLeastSignificantBits()); - UUID u = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF"); - AttributeModifier am = new AttributeModifier(u, "Weapon modifier", 6.0D, 0); + tags.appendTag(tag); + s.stackTagCompound.setTag("AttributeModifiers", tags); + } else if (wand.getRod(s) instanceof StaffRod) { + NBTTagList tags = new NBTTagList(); + NBTTagCompound tag = new NBTTagCompound(); + tag.setString( + "AttributeName", + SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName()); - tag.setString("Name", am.getName()); - tag.setDouble("Amount", am.getAmount()); - tag.setInteger("Operation", am.getOperation()); - tag.setLong("UUIDMost", am.getID().getMostSignificantBits()); - tag.setLong("UUIDLeast", am.getID().getLeastSignificantBits()); + UUID u = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF"); + AttributeModifier am = new AttributeModifier(u, "Weapon modifier", 6.0D, 0); - tags.appendTag(tag); - s.stackTagCompound.setTag("AttributeModifiers", tags); - } - } - } - } - } + tag.setString("Name", am.getName()); + tag.setDouble("Amount", am.getAmount()); + tag.setInteger("Operation", am.getOperation()); + tag.setLong("UUIDMost", am.getID().getMostSignificantBits()); + tag.setLong("UUIDLeast", am.getID().getLeastSignificantBits()); - @SubscribeEvent - public void entityAttacked (LivingAttackEvent event) - { - if (event.source.getEntity() instanceof EntityPlayer) - { - EntityPlayer p = (EntityPlayer) event.source.getEntity(); - if (p.getHeldItem() != null && p.getHeldItem().getItem() instanceof ItemWandCasting) - { - ItemStack s = p.getHeldItem(); - ItemWandCasting wand = (ItemWandCasting) s.getItem(); + tags.appendTag(tag); + s.stackTagCompound.setTag("AttributeModifiers", tags); + } + } + } + } + } - if (wand.getFocus(s) != null && wand.getFocus(s) instanceof ItemFocusMageMace) - { - final AspectList aspects = new AspectList().add(Aspect.EARTH, 20).add(Aspect.ENTROPY, 20).add(Aspect.ORDER, 20); - if (wand.consumeAllVis(s, p, aspects, true, false)) - { - wand.consumeAllVis(s, p, aspects, true, false); - } - else - { - event.setCanceled(true); - } - } - } - } - } + @SubscribeEvent + public void entityAttacked(LivingAttackEvent event) { + if (event.source.getEntity() instanceof EntityPlayer) { + EntityPlayer p = (EntityPlayer) event.source.getEntity(); + if (p.getHeldItem() != null && p.getHeldItem().getItem() instanceof ItemWandCasting) { + ItemStack s = p.getHeldItem(); + ItemWandCasting wand = (ItemWandCasting) s.getItem(); - @SubscribeEvent - public void onPlayerLogin (PlayerEvent.PlayerLoggedInEvent event) - { - if (UpdateHandler.show) event.player.addChatMessage(new ChatComponentText(UpdateHandler.updateStatus)); - } + if (wand.getFocus(s) != null && wand.getFocus(s) instanceof ItemFocusMageMace) { + final AspectList aspects = new AspectList().add(Aspect.EARTH, 20).add(Aspect.ENTROPY, 20) + .add(Aspect.ORDER, 20); + if (wand.consumeAllVis(s, p, aspects, true, false)) { + wand.consumeAllVis(s, p, aspects, true, false); + } else { + event.setCanceled(true); + } + } + } + } + } - @SubscribeEvent - public void onCrafting (ItemCraftedEvent event) - { - if (event.crafting == new ItemStack(ItemRegistry.ItemWandCap, 1, 0)) - { - EntityItem ent = event.player.entityDropItem(new ItemStack(ConfigItems.itemEldritchObject, 1, 3), 0); - ent.motionY += randy.nextFloat() * 0.05F; - ent.motionX += (randy.nextFloat() - randy.nextFloat()) * 0.1F; - ent.motionZ += (randy.nextFloat() - randy.nextFloat()) * 0.1F; - } - if (event.crafting == new ItemStack(ItemRegistry.ItemWandRod, 1, 0)) - { - EntityItem ent = event.player.entityDropItem(new ItemStack(ConfigItems.itemEldritchObject, 1, 3), 0); - ent.motionY += randy.nextFloat() * 0.05F; - ent.motionX += (randy.nextFloat() - randy.nextFloat()) * 0.1F; - ent.motionZ += (randy.nextFloat() - randy.nextFloat()) * 0.1F; - } - if (event.crafting.getItem() == ItemRegistry.ItemMaterial && event.crafting.getItemDamage() == 5) giveResearch(event.player); - } + @SubscribeEvent + public void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent event) { + if (UpdateHandler.show) event.player.addChatMessage(new ChatComponentText(UpdateHandler.updateStatus)); + } - public void giveResearch (EntityPlayer player) - { - if ( (!ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "CREATION") && (ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "CREATIONSHARD") && !player.worldObj.isRemote))) - { - Thaumcraft.proxy.getResearchManager().completeResearch(player, "CREATION"); - PacketHandler.INSTANCE.sendTo(new PacketResearchComplete("CREATION"), (EntityPlayerMP) player); - player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("text.1"))); - player.playSound("thaumcraft:wind", 1.0F, 5.0F); - try - { - player.addPotionEffect(new PotionEffect(Potion.blindness.id, 80, 0)); - player.addPotionEffect(new PotionEffect(Config.potionBlurredID, 200, 0)); - } - catch (Exception e) - { - e.printStackTrace(); - } - if ( (!ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "OUTERREV") && (ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "CREATION") && !player.worldObj.isRemote))) - { - Thaumcraft.proxy.getResearchManager().completeResearch(player, "OUTERREV"); - PacketHandler.INSTANCE.sendTo(new PacketResearchComplete("OUTERREV"), (EntityPlayerMP) player); - } - } - } + @SubscribeEvent + public void onCrafting(ItemCraftedEvent event) { + if (event.crafting == new ItemStack(ItemRegistry.ItemWandCap, 1, 0)) { + EntityItem ent = event.player.entityDropItem(new ItemStack(ConfigItems.itemEldritchObject, 1, 3), 0); + ent.motionY += randy.nextFloat() * 0.05F; + ent.motionX += (randy.nextFloat() - randy.nextFloat()) * 0.1F; + ent.motionZ += (randy.nextFloat() - randy.nextFloat()) * 0.1F; + } + if (event.crafting == new ItemStack(ItemRegistry.ItemWandRod, 1, 0)) { + EntityItem ent = event.player.entityDropItem(new ItemStack(ConfigItems.itemEldritchObject, 1, 3), 0); + ent.motionY += randy.nextFloat() * 0.05F; + ent.motionX += (randy.nextFloat() - randy.nextFloat()) * 0.1F; + ent.motionZ += (randy.nextFloat() - randy.nextFloat()) * 0.1F; + } + if (event.crafting.getItem() == ItemRegistry.ItemMaterial && event.crafting.getItemDamage() == 5) + giveResearch(event.player); + } - @SubscribeEvent - public void livingDrop (LivingDropsEvent event) - { - if (event.source.getEntity() instanceof EntityPlayer) - { - EntityPlayer p = (EntityPlayer) event.source.getEntity(); - if (p.getHeldItem() != null && (p.getHeldItem().getItem() instanceof IBloodlust || p.getHeldItem().getItem() instanceof ItemCrimsonSword)) - { - Random r = new Random(); - ItemStack drops = new ItemStack(ItemRegistry.ItemMaterial, r.nextInt(5), 7); - addDropItem(event, drops); - } - else if (p.getHeldItem() != null && p.getHeldItem().getItem() instanceof ItemWandCasting && ((ItemWandCasting) p.getHeldItem().getItem()).getFocus(p.getHeldItem()) != null && ((ItemWandCasting) p.getHeldItem().getItem()).getFocus(p.getHeldItem()).isUpgradedWith( ((ItemWandCasting) p.getHeldItem().getItem()).getFocusItem(p.getHeldItem()), ItemFocusMageMace.bloodlust)) - { - Random r = new Random(); - ItemStack drops = new ItemStack(ItemRegistry.ItemMaterial, r.nextInt(5), 7); - addDropItem(event, drops); - } - } - } + public void giveResearch(EntityPlayer player) { + if ((!ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "CREATION") + && (ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "CREATIONSHARD") + && !player.worldObj.isRemote))) { + Thaumcraft.proxy.getResearchManager().completeResearch(player, "CREATION"); + PacketHandler.INSTANCE.sendTo(new PacketResearchComplete("CREATION"), (EntityPlayerMP) player); + player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("text.1"))); + player.playSound("thaumcraft:wind", 1.0F, 5.0F); + try { + player.addPotionEffect(new PotionEffect(Potion.blindness.id, 80, 0)); + player.addPotionEffect(new PotionEffect(Config.potionBlurredID, 200, 0)); + } catch (Exception e) { + e.printStackTrace(); + } + if ((!ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "OUTERREV") + && (ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "CREATION") + && !player.worldObj.isRemote))) { + Thaumcraft.proxy.getResearchManager().completeResearch(player, "OUTERREV"); + PacketHandler.INSTANCE.sendTo(new PacketResearchComplete("OUTERREV"), (EntityPlayerMP) player); + } + } + } - public void addDropItem (LivingDropsEvent event, ItemStack drop) - { - EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, drop); - entityitem.delayBeforeCanPickup = 10; - event.drops.add(entityitem); - } + @SubscribeEvent + public void livingDrop(LivingDropsEvent event) { + if (event.source.getEntity() instanceof EntityPlayer) { + EntityPlayer p = (EntityPlayer) event.source.getEntity(); + if (p.getHeldItem() != null && (p.getHeldItem().getItem() instanceof IBloodlust + || p.getHeldItem().getItem() instanceof ItemCrimsonSword)) { + Random r = new Random(); + ItemStack drops = new ItemStack(ItemRegistry.ItemMaterial, r.nextInt(5), 7); + addDropItem(event, drops); + } else if (p.getHeldItem() != null && p.getHeldItem().getItem() instanceof ItemWandCasting + && ((ItemWandCasting) p.getHeldItem().getItem()).getFocus(p.getHeldItem()) != null + && ((ItemWandCasting) p.getHeldItem().getItem()).getFocus(p.getHeldItem()).isUpgradedWith( + ((ItemWandCasting) p.getHeldItem().getItem()).getFocusItem(p.getHeldItem()), + ItemFocusMageMace.bloodlust)) { + Random r = new Random(); + ItemStack drops = new ItemStack(ItemRegistry.ItemMaterial, r.nextInt(5), 7); + addDropItem(event, drops); + } + } + } - @SubscribeEvent - public void tooltipEvent (ItemTooltipEvent event) - { - if (event.itemStack.getItem() instanceof ItemFocusMageMace) - { - if (event.toolTip.contains(StatCollector.translateToLocal("item.Focus.cost1"))) - { - event.toolTip.remove(StatCollector.translateToLocal("item.Focus.cost1")); - event.toolTip.add(1, StatCollector.translateToLocal("item.Focus.cost3")); - } - } - if (event.itemStack.getItem() instanceof IBloodlust) event.toolTip.add("\u00A74" + StatCollector.translateToLocal("text.bloodlust")); - if (event.itemStack.getItem() instanceof ItemCrimsonSword) event.toolTip.add("\u00A74" + StatCollector.translateToLocal("text.bloodlust")); - if ( (event.itemStack.getItem() instanceof ItemFocusMageMace && ((ItemFocusBasic) event.itemStack.getItem()).isUpgradedWith(event.itemStack, ItemFocusMageMace.bloodlust)) || (event.itemStack.getItem() instanceof ItemWandCasting && ((ItemWandCasting) event.itemStack.getItem()).getFocus(event.itemStack) != null && ((ItemWandCasting) event.itemStack.getItem()).getFocus(event.itemStack) instanceof ItemFocusMageMace && ((ItemWandCasting) event.itemStack.getItem()).getFocus(event.itemStack).isUpgradedWith( ((ItemWandCasting) event.itemStack.getItem()).getFocusItem(event.itemStack), ItemFocusMageMace.bloodlust))) event.toolTip.add("\u00A74" + StatCollector.translateToLocal("text.bloodlust")); + public void addDropItem(LivingDropsEvent event, ItemStack drop) { + EntityItem entityitem = new EntityItem( + event.entityLiving.worldObj, + event.entityLiving.posX, + event.entityLiving.posY, + event.entityLiving.posZ, + drop); + entityitem.delayBeforeCanPickup = 10; + event.drops.add(entityitem); + } - if (event.itemStack.stackTagCompound != null && event.itemStack.stackTagCompound.getBoolean("voidtouched")) event.toolTip.add("\u00A75" + StatCollector.translateToLocal("text.voidtouched")); - } + @SubscribeEvent + public void tooltipEvent(ItemTooltipEvent event) { + if (event.itemStack.getItem() instanceof ItemFocusMageMace) { + if (event.toolTip.contains(StatCollector.translateToLocal("item.Focus.cost1"))) { + event.toolTip.remove(StatCollector.translateToLocal("item.Focus.cost1")); + event.toolTip.add(1, StatCollector.translateToLocal("item.Focus.cost3")); + } + } + if (event.itemStack.getItem() instanceof IBloodlust) + event.toolTip.add("\u00A74" + StatCollector.translateToLocal("text.bloodlust")); + if (event.itemStack.getItem() instanceof ItemCrimsonSword) + event.toolTip.add("\u00A74" + StatCollector.translateToLocal("text.bloodlust")); + if ((event.itemStack.getItem() instanceof ItemFocusMageMace && ((ItemFocusBasic) event.itemStack.getItem()) + .isUpgradedWith(event.itemStack, ItemFocusMageMace.bloodlust)) + || (event.itemStack.getItem() instanceof ItemWandCasting + && ((ItemWandCasting) event.itemStack.getItem()).getFocus(event.itemStack) != null + && ((ItemWandCasting) event.itemStack.getItem()) + .getFocus(event.itemStack) instanceof ItemFocusMageMace + && ((ItemWandCasting) event.itemStack.getItem()).getFocus(event.itemStack).isUpgradedWith( + ((ItemWandCasting) event.itemStack.getItem()).getFocusItem(event.itemStack), + ItemFocusMageMace.bloodlust))) + event.toolTip.add("\u00A74" + StatCollector.translateToLocal("text.bloodlust")); + + if (event.itemStack.stackTagCompound != null && event.itemStack.stackTagCompound.getBoolean("voidtouched")) + event.toolTip.add("\u00A75" + StatCollector.translateToLocal("text.voidtouched")); + } } diff --git a/src/main/java/taintedmagic/common/handler/UpdateHandler.java b/src/main/java/taintedmagic/common/handler/UpdateHandler.java index e3994e1..d6debf5 100644 --- a/src/main/java/taintedmagic/common/handler/UpdateHandler.java +++ b/src/main/java/taintedmagic/common/handler/UpdateHandler.java @@ -1,60 +1,52 @@ package taintedmagic.common.handler; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; import java.net.URL; import java.util.Scanner; -import taintedmagic.common.TaintedMagic; -import taintedmagic.common.lib.LibStrings; import net.minecraft.util.EnumChatFormatting; -public class UpdateHandler -{ - private static String currentVersion = LibStrings.VERSION; - private static String newestVersion; - public static String updateStatus = null; - public static boolean show = false; +import taintedmagic.common.TaintedMagic; +import taintedmagic.common.lib.LibStrings; - public static void init () - { - getNewestVersion(); +public class UpdateHandler { - 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..."); - } - } + private static String currentVersion = LibStrings.VERSION; + private static String newestVersion; + public static String updateStatus = null; + public static boolean show = false; - 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!"); - } - } + public static void init() { + 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..."); + } + } + + 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!"); + } + } } diff --git a/src/main/java/taintedmagic/common/handler/WandUpdateHandler.java b/src/main/java/taintedmagic/common/handler/WandUpdateHandler.java index 018010d..eb87970 100644 --- a/src/main/java/taintedmagic/common/handler/WandUpdateHandler.java +++ b/src/main/java/taintedmagic/common/handler/WandUpdateHandler.java @@ -1,45 +1,33 @@ package taintedmagic.common.handler; -import java.util.ArrayList; -import java.util.Random; - import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.world.World; -import taintedmagic.common.TaintedMagic; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.wands.IWandRodOnUpdate; import thaumcraft.common.Thaumcraft; import thaumcraft.common.config.Config; import thaumcraft.common.items.wands.ItemWandCasting; -import thaumcraft.common.lib.potions.PotionWarpWard; -import net.minecraft.entity.player.EntityPlayer; -public class WandUpdateHandler implements IWandRodOnUpdate -{ - Aspect aspect; - Aspect primals[] = Aspect.getPrimalAspects().toArray(new Aspect[0]); +public class WandUpdateHandler implements IWandRodOnUpdate { - public void onUpdate (ItemStack itemstack, EntityPlayer player) - { - if (!player.isPotionActive(Config.potionWarpWardID)) - { - int permwarp = Thaumcraft.proxy.getPlayerKnowledge().getWarpPerm(player.getCommandSenderName()); + Aspect aspect; + Aspect primals[] = Aspect.getPrimalAspects().toArray(new Aspect[0]); - int x = permwarp; - if (x == 0) x++; + public void onUpdate(ItemStack itemstack, EntityPlayer player) { + if (!player.isPotionActive(Config.potionWarpWardID)) { + int permwarp = Thaumcraft.proxy.getPlayerKnowledge().getWarpPerm(player.getCommandSenderName()); - int y = Math.max( (200 - x), 50); + int x = permwarp; + if (x == 0) x++; - if (player.ticksExisted % y == 0) - { - for (int i = 0; i < primals.length; i++) - { - ((ItemWandCasting) itemstack.getItem()).addVis(itemstack, this.primals[i], 1, true); - } - } - } - } + int y = Math.max((200 - x), 50); + + if (player.ticksExisted % y == 0) { + for (int i = 0; i < primals.length; i++) { + ((ItemWandCasting) itemstack.getItem()).addVis(itemstack, 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 e8da81c..d337aed 100644 --- a/src/main/java/taintedmagic/common/helper/TaintedMagicHelper.java +++ b/src/main/java/taintedmagic/common/helper/TaintedMagicHelper.java @@ -2,34 +2,30 @@ package taintedmagic.common.helper; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Vec3; -import taintedmagic.api.IBloodlust; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.codechicken.lib.vec.Vector3; -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); - } +public class TaintedMagicHelper { - public static Vector3 getDistanceBetween (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; - } + 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 double getDistanceTo (double x, double y, double z, EntityPlayer p) - { - double var7 = p.posX + 0.5D - x; - double var9 = p.posY + 0.5D - y; - double var11 = p.posZ + 0.5D - z; - return var7 * var7 + var9 * var9 + var11 * var11; - } + public static Vector3 getDistanceBetween(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; + } + + public static double getDistanceTo(double x, double y, double z, EntityPlayer p) { + double var7 = p.posX + 0.5D - x; + double var9 = p.posY + 0.5D - y; + double var11 = p.posZ + 0.5D - z; + return var7 * var7 + var9 * var9 + var11 * var11; + } } diff --git a/src/main/java/taintedmagic/common/items/ItemMagicFunguar.java b/src/main/java/taintedmagic/common/items/ItemMagicFunguar.java index 5b872d2..1294caa 100644 --- a/src/main/java/taintedmagic/common/items/ItemMagicFunguar.java +++ b/src/main/java/taintedmagic/common/items/ItemMagicFunguar.java @@ -10,6 +10,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; + import taintedmagic.common.TaintedMagic; import thaumcraft.api.aspects.Aspect; import thaumcraft.common.Thaumcraft; @@ -19,55 +20,51 @@ import thaumcraft.common.lib.research.ResearchManager; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class ItemMagicFunguar extends ItemFood -{ - Aspect[] aspects = new Aspect[]{ - Aspect.AIR, - Aspect.EARTH, - Aspect.FIRE, - Aspect.WATER, - Aspect.ORDER, - Aspect.ENTROPY }; +public class ItemMagicFunguar extends ItemFood { - 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"); - } + Aspect[] aspects = new Aspect[] { Aspect.AIR, Aspect.EARTH, Aspect.FIRE, Aspect.WATER, Aspect.ORDER, + Aspect.ENTROPY }; - @Override - protected void onFoodEaten (ItemStack s, World w, EntityPlayer p) - { - super.onFoodEaten(s, w, p); + 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"); + } - 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(); - } + @Override + protected void onFoodEaten(ItemStack s, World w, EntityPlayer p) { + super.onFoodEaten(s, w, p); - int i = r.nextInt(aspects.length); + 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(); + } - 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); - } - } + int i = r.nextInt(aspects.length); - @SideOnly (Side.CLIENT) - public EnumRarity getRarity (ItemStack itemstack) - { - return EnumRarity.uncommon; - } + 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); + } + } + + @SideOnly(Side.CLIENT) + public EnumRarity getRarity(ItemStack itemstack) { + return EnumRarity.uncommon; + } } diff --git a/src/main/java/taintedmagic/common/items/ItemMaterial.java b/src/main/java/taintedmagic/common/items/ItemMaterial.java index 5366176..89466f9 100644 --- a/src/main/java/taintedmagic/common/items/ItemMaterial.java +++ b/src/main/java/taintedmagic/common/items/ItemMaterial.java @@ -2,85 +2,73 @@ package taintedmagic.common.items; import java.util.List; -import taintedmagic.common.TaintedMagic; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; + +import taintedmagic.common.TaintedMagic; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class ItemMaterial extends Item -{ - public int SUBTYPES = 9; - public IIcon[] icons = new IIcon[SUBTYPES]; +public class ItemMaterial extends Item { - public ItemMaterial () - { - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setUnlocalizedName("ItemMaterial"); - this.setHasSubtypes(true); - } + public int SUBTYPES = 9; + public IIcon[] icons = new IIcon[SUBTYPES]; - 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; - } - return EnumRarity.common; - } + public ItemMaterial() { + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setUnlocalizedName("ItemMaterial"); + this.setHasSubtypes(true); + } - @SideOnly (Side.CLIENT) - public void registerIcons (IIconRegister ir) - { - for (int i = 0; i < icons.length; i++) - this.icons[i] = ir.registerIcon("taintedmagic:ItemMaterial" + i); - } + 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; + } + return EnumRarity.common; + } - @SideOnly (Side.CLIENT) - public IIcon getIconFromDamage (int i) - { - return this.icons[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 void getSubItems (Item item, CreativeTabs c, List l) - { - /** - * 0: Shadowmetal 1: Shadow Cloth 2: Crimson Cloth 3: Warped Shard 4: - * Fluxed Shard 5: Creation Shard 6: Thaumic Alloy 7: Crystal Blood 8: - * Crimson Plating - */ - for (int i = 0; i < SUBTYPES; i++) - l.add(new ItemStack(this, 1, i)); - } + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int i) { + return this.icons[i]; + } - public String getUnlocalizedName (ItemStack s) - { - return super.getUnlocalizedName() + "." + s.getItemDamage(); - } + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs c, List l) { + /** + * 0: Shadowmetal 1: Shadow Cloth 2: Crimson Cloth 3: Warped Shard 4: Fluxed Shard 5: Creation Shard 6: Thaumic + * Alloy 7: Crystal Blood 8: Crimson Plating + */ + for (int i = 0; i < SUBTYPES; i++) l.add(new ItemStack(this, 1, i)); + } + + public String getUnlocalizedName(ItemStack s) { + return super.getUnlocalizedName() + "." + s.getItemDamage(); + } } diff --git a/src/main/java/taintedmagic/common/items/ItemVoidsentBlood.java b/src/main/java/taintedmagic/common/items/ItemVoidsentBlood.java index 205f2a7..14592d0 100644 --- a/src/main/java/taintedmagic/common/items/ItemVoidsentBlood.java +++ b/src/main/java/taintedmagic/common/items/ItemVoidsentBlood.java @@ -1,36 +1,30 @@ package taintedmagic.common.items; -import java.util.List; - -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; import net.minecraftforge.oredict.RecipeSorter; import net.minecraftforge.oredict.RecipeSorter.Category; + import taintedmagic.api.RecipeVoidsentBlood; import taintedmagic.common.TaintedMagic; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class ItemVoidsentBlood extends Item -{ - public ItemVoidsentBlood () - { - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setTextureName("taintedmagic:ItemVoidsentBlood"); - this.setUnlocalizedName("ItemVoidsentBlood"); +public class ItemVoidsentBlood extends Item { - GameRegistry.addRecipe(new RecipeVoidsentBlood()); - RecipeSorter.register("taintedmagic:ItemVoidsentBlood", RecipeVoidsentBlood.class, Category.SHAPELESS, ""); - } + public ItemVoidsentBlood() { + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setTextureName("taintedmagic:ItemVoidsentBlood"); + this.setUnlocalizedName("ItemVoidsentBlood"); - @SideOnly (Side.CLIENT) - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.uncommon; - } + GameRegistry.addRecipe(new RecipeVoidsentBlood()); + RecipeSorter.register("taintedmagic:ItemVoidsentBlood", RecipeVoidsentBlood.class, Category.SHAPELESS, ""); + } + + @SideOnly(Side.CLIENT) + public EnumRarity getRarity(ItemStack s) { + return EnumRarity.uncommon; + } } diff --git a/src/main/java/taintedmagic/common/items/blocks/ItemBlockShadowOre.java b/src/main/java/taintedmagic/common/items/blocks/ItemBlockShadowOre.java index 2286fb8..9dd1945 100644 --- a/src/main/java/taintedmagic/common/items/blocks/ItemBlockShadowOre.java +++ b/src/main/java/taintedmagic/common/items/blocks/ItemBlockShadowOre.java @@ -4,19 +4,18 @@ import net.minecraft.block.Block; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class ItemBlockShadowOre extends ItemBlock -{ - public ItemBlockShadowOre (Block b) - { - super(b); - } +public class ItemBlockShadowOre extends ItemBlock { - @SideOnly (Side.CLIENT) - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.uncommon; - } + 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 index e942e10..312e0f6 100644 --- a/src/main/java/taintedmagic/common/items/blocks/ItemBlockWarpwoodSapling.java +++ b/src/main/java/taintedmagic/common/items/blocks/ItemBlockWarpwoodSapling.java @@ -1,22 +1,21 @@ 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); - } +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; - @SideOnly (Side.CLIENT) - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.uncommon; - } +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/ItemShadowFortressArmor.java b/src/main/java/taintedmagic/common/items/equipment/ItemShadowFortressArmor.java index e054f4e..ec8e023 100644 --- a/src/main/java/taintedmagic/common/items/equipment/ItemShadowFortressArmor.java +++ b/src/main/java/taintedmagic/common/items/equipment/ItemShadowFortressArmor.java @@ -2,8 +2,6 @@ package taintedmagic.common.items.equipment; import java.util.List; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -14,113 +12,102 @@ import net.minecraft.util.DamageSource; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraftforge.common.ISpecialArmor; + import taintedmagic.common.TaintedMagic; import taintedmagic.common.registry.ItemRegistry; import thaumcraft.api.IVisDiscountGear; import thaumcraft.api.IWarpingGear; -import thaumcraft.api.ItemApi; import thaumcraft.api.aspects.Aspect; import thaumcraft.common.items.armor.ItemFortressArmor; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; -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 class ItemShadowFortressArmor extends ItemFortressArmor + implements IWarpingGear, IVisDiscountGear, ISpecialArmor { - @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 ItemShadowFortressArmor(ArmorMaterial m, int j, int k) { + super(m, j, k); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + } - 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); - } + @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 String getArmorTexture (ItemStack s, Entity e, int slot, String t) - { - return "taintedmagic:textures/models/ModelShadowFortressArmor.png"; - } + 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 EnumRarity getRarity (ItemStack s) - { - return EnumRarity.epic; - } + public String getArmorTexture(ItemStack s, Entity e, int slot, String t) { + return "taintedmagic:textures/models/ModelShadowFortressArmor.png"; + } - public boolean getIsRepairable (ItemStack s, ItemStack s2) - { - return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true : super.getIsRepairable(s, s2); - } + public EnumRarity getRarity(ItemStack s) { + return EnumRarity.epic; + } - @Override - public int getVisDiscount (ItemStack s, EntityPlayer p, Aspect a) - { - return 5; - } + public boolean getIsRepairable(ItemStack s, ItemStack s2) { + return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true + : super.getIsRepairable(s, s2); + } - @Override - public int getWarp (ItemStack s, EntityPlayer p) - { - return 5; - } + @Override + public int getVisDiscount(ItemStack s, EntityPlayer p, Aspect a) { + 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 int getWarp(ItemStack s, EntityPlayer p) { + return 5; + } - 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; - } + @Override + public ISpecialArmor.ArmorProperties getProperties(EntityLivingBase p, ItemStack s, DamageSource source, double dmg, + int slot) { + int priority = 0; + double ratio = this.damageReduceAmount / 25.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 (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; + } - return new ISpecialArmor.ArmorProperties(priority, ratio, s.getMaxDamage() + 1 - s.getItemDamage()); - } + 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; + } - public int getArmorDisplay (EntityPlayer p, ItemStack s, int slot) - { - return this.damageReduceAmount; - } + return new ISpecialArmor.ArmorProperties(priority, ratio, s.getMaxDamage() + 1 - s.getItemDamage()); + } - public void damageArmor (EntityLivingBase e, ItemStack s, DamageSource source, int dmg, int slot) - { - if (source != DamageSource.fall) s.damageItem(dmg, e); - } -} \ No newline at end of file + public int getArmorDisplay(EntityPlayer p, ItemStack s, 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); + } +} diff --git a/src/main/java/taintedmagic/common/items/equipment/ItemVoidFortressArmor.java b/src/main/java/taintedmagic/common/items/equipment/ItemVoidFortressArmor.java index 2995ac3..093a91f 100644 --- a/src/main/java/taintedmagic/common/items/equipment/ItemVoidFortressArmor.java +++ b/src/main/java/taintedmagic/common/items/equipment/ItemVoidFortressArmor.java @@ -2,81 +2,75 @@ package taintedmagic.common.items.equipment; import java.util.List; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemArmor.ArmorMaterial; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; +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.items.armor.ItemFortressArmor; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.ItemArmor; -import net.minecraft.item.ItemArmor.ArmorMaterial; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -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 class ItemVoidFortressArmor extends ItemFortressArmor implements IWarpingGear, IVisDiscountGear { - @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 ItemVoidFortressArmor(ArmorMaterial m, int j, int k) { + super(m, j, k); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + } - 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); - } + @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 String getArmorTexture (ItemStack s, Entity e, int slot, String t) - { - return "taintedmagic:textures/models/ModelVoidFortressArmor.png"; - } + 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 boolean getIsRepairable (ItemStack s, ItemStack s2) - { - return s2.isItemEqual(ItemApi.getItem("itemResource", 16)) ? true : super.getIsRepairable(s, s2); - } + public String getArmorTexture(ItemStack s, Entity e, int slot, String t) { + return "taintedmagic:textures/models/ModelVoidFortressArmor.png"; + } - public void onUpdate (ItemStack s, World w, Entity e, int j, boolean k) - { - super.onUpdate(s, w, e, j, k); + public boolean getIsRepairable(ItemStack s, ItemStack s2) { + return s2.isItemEqual(ItemApi.getItem("itemResource", 16)) ? true : super.getIsRepairable(s, s2); + } - if ( (!w.isRemote) && (s.isItemDamaged()) && (e.ticksExisted % 20 == 0) && ( (e instanceof EntityLivingBase))) s.damageItem(-1, (EntityLivingBase) e); - } + public void onUpdate(ItemStack s, World w, Entity e, int j, boolean k) { + super.onUpdate(s, w, e, j, k); - 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); - } + if ((!w.isRemote) && (s.isItemDamaged()) && (e.ticksExisted % 20 == 0) && ((e instanceof EntityLivingBase))) + s.damageItem(-1, (EntityLivingBase) e); + } - @Override - public int getWarp (ItemStack s, EntityPlayer p) - { - return 3; - } + 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 getVisDiscount (ItemStack s, EntityPlayer p, Aspect a) - { - return 5; - } -} \ No newline at end of file + @Override + public int getWarp(ItemStack s, EntityPlayer p) { + return 3; + } + + @Override + public int getVisDiscount(ItemStack s, EntityPlayer p, Aspect a) { + return 5; + } +} diff --git a/src/main/java/taintedmagic/common/items/equipment/ItemVoidmetalGoggles.java b/src/main/java/taintedmagic/common/items/equipment/ItemVoidmetalGoggles.java index 2c4345a..80e3d7c 100644 --- a/src/main/java/taintedmagic/common/items/equipment/ItemVoidmetalGoggles.java +++ b/src/main/java/taintedmagic/common/items/equipment/ItemVoidmetalGoggles.java @@ -8,6 +8,7 @@ import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.item.ItemStack; import net.minecraft.world.World; + import taintedmagic.common.TaintedMagic; import thaumcraft.api.IWarpingGear; import thaumcraft.api.aspects.Aspect; @@ -15,53 +16,46 @@ import thaumcraft.common.items.armor.ItemGoggles; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -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 class ItemVoidmetalGoggles extends ItemGoggles implements IWarpingGear { - @SideOnly (Side.CLIENT) - public void registerIcons (IIconRegister ir) - { - this.icon = ir.registerIcon("taintedmagic:ItemVoidmetalGoggles"); - } + public ItemVoidmetalGoggles(ArmorMaterial m, int j, int k) { + super(m, j, k); + this.setMaxDamage(250); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setUnlocalizedName("ItemVoidmetalGoggles"); + } - public String getArmorTexture (ItemStack s, Entity e, int slot, String type) - { - return "taintedmagic:textures/models/ModelVoidmetalGoggles.png"; - } + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister ir) { + this.icon = ir.registerIcon("taintedmagic:ItemVoidmetalGoggles"); + } - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.rare; - } + public String getArmorTexture(ItemStack s, Entity e, int slot, String type) { + return "taintedmagic:textures/models/ModelVoidmetalGoggles.png"; + } - @Override - public int getWarp (ItemStack s, EntityPlayer p) - { - return 5; - } + public EnumRarity getRarity(ItemStack s) { + return EnumRarity.rare; + } - @Override - public int getVisDiscount (ItemStack stack, EntityPlayer player, Aspect aspect) - { - return 10; - } + @Override + public int getWarp(ItemStack s, EntityPlayer p) { + return 5; + } - 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); - } + @Override + public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) { + return 10; + } - 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 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 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); + } } diff --git a/src/main/java/taintedmagic/common/items/equipment/ItemVoidwalkerBoots.java b/src/main/java/taintedmagic/common/items/equipment/ItemVoidwalkerBoots.java index 7e9ae0d..5880279 100644 --- a/src/main/java/taintedmagic/common/items/equipment/ItemVoidwalkerBoots.java +++ b/src/main/java/taintedmagic/common/items/equipment/ItemVoidwalkerBoots.java @@ -8,13 +8,12 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.DamageSource; import net.minecraft.world.World; import net.minecraftforge.common.ISpecialArmor; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.event.entity.living.LivingEvent; + import taintedmagic.common.TaintedMagic; import taintedmagic.common.registry.ItemRegistry; import thaumcraft.api.IRepairable; @@ -26,140 +25,116 @@ import thaumcraft.common.Thaumcraft; import thaumcraft.common.items.armor.Hover; import cpw.mods.fml.common.eventhandler.SubscribeEvent; -public class ItemVoidwalkerBoots extends ItemArmor implements IVisDiscountGear, IWarpingGear, IRunicArmor, IRepairable, ISpecialArmor -{ - public ItemVoidwalkerBoots (ArmorMaterial m, int j, int k) - { - super(m, j, k); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setUnlocalizedName("ItemVoidwalkerBoots"); - this.setTextureName("taintedmagic:ItemVoidwalkerBoots"); +public class ItemVoidwalkerBoots extends ItemArmor + implements IVisDiscountGear, IWarpingGear, IRunicArmor, IRepairable, ISpecialArmor { - MinecraftForge.EVENT_BUS.register(this); - } + public ItemVoidwalkerBoots(ArmorMaterial m, int j, int k) { + super(m, j, k); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setUnlocalizedName("ItemVoidwalkerBoots"); + this.setTextureName("taintedmagic:ItemVoidwalkerBoots"); - public String getArmorTexture (ItemStack s, Entity e, int slot, String t) - { - return "taintedmagic:textures/models/ModelVoidwalkerBoots.png"; - } + MinecraftForge.EVENT_BUS.register(this); + } - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.epic; - } + public String getArmorTexture(ItemStack s, Entity e, int slot, String t) { + return "taintedmagic:textures/models/ModelVoidwalkerBoots.png"; + } - @Override - public int getRunicCharge (ItemStack s) - { - return 0; - } + public EnumRarity getRarity(ItemStack s) { + return EnumRarity.epic; + } - @Override - public int getWarp (ItemStack s, EntityPlayer p) - { - return 5; - } + @Override + public int getRunicCharge(ItemStack s) { + return 0; + } - @Override - public int getVisDiscount (ItemStack s, EntityPlayer p, Aspect a) - { - return 5; - } + @Override + public int getWarp(ItemStack s, EntityPlayer p) { + return 5; + } - @Override - public ISpecialArmor.ArmorProperties getProperties (EntityLivingBase e, ItemStack s, DamageSource source, double dmg, int slot) - { - int priority = 0; - double ratio = this.damageReduceAmount / 90.0D; + @Override + public int getVisDiscount(ItemStack s, EntityPlayer p, Aspect a) { + return 5; + } - if (source.isMagicDamage() == true) - { - priority = 1; - ratio = this.damageReduceAmount / 80.0D; - } - else if ( (source.isFireDamage() == true) || (source.isExplosion())) - { - priority = 1; - ratio = this.damageReduceAmount / 80.0D; - } - else if (source.isUnblockable()) - { - priority = 0; - ratio = 0.0D; - } - return new ISpecialArmor.ArmorProperties(priority, ratio, s.getMaxDamage() + 1 - s.getItemDamage()); - } + @Override + public ISpecialArmor.ArmorProperties getProperties(EntityLivingBase e, ItemStack s, DamageSource source, double dmg, + int slot) { + int priority = 0; + double ratio = this.damageReduceAmount / 90.0D; - @Override - public int getArmorDisplay (EntityPlayer p, ItemStack s, int slot) - { - return this.damageReduceAmount; - } + if (source.isMagicDamage() == true) { + priority = 1; + ratio = this.damageReduceAmount / 80.0D; + } else if ((source.isFireDamage() == true) || (source.isExplosion())) { + priority = 1; + ratio = this.damageReduceAmount / 80.0D; + } else if (source.isUnblockable()) { + priority = 0; + ratio = 0.0D; + } + return new ISpecialArmor.ArmorProperties(priority, ratio, s.getMaxDamage() + 1 - s.getItemDamage()); + } - @Override - public void damageArmor (EntityLivingBase e, ItemStack s, DamageSource source, int dmg, int slot) - { - if (source != DamageSource.fall) s.damageItem(dmg, e); - } + @Override + public int getArmorDisplay(EntityPlayer p, ItemStack s, int slot) { + return this.damageReduceAmount; + } - @Override - public void addInformation (ItemStack s, EntityPlayer p, List l, boolean b) - { - } + @Override + public void damageArmor(EntityLivingBase e, ItemStack s, DamageSource source, int dmg, int slot) { + if (source != DamageSource.fall) s.damageItem(dmg, e); + } - public void onUpdate (ItemStack s, World w, Entity e, int j, boolean k) - { - super.onUpdate(s, w, e, j, k); + @Override + public void addInformation(ItemStack s, EntityPlayer p, List l, boolean b) {} - if ( (!w.isRemote) && (s.isItemDamaged()) && (e.ticksExisted % 20 == 0) && ( (e instanceof EntityLivingBase))) s.damageItem(-1, (EntityLivingBase) e); - } + public void onUpdate(ItemStack s, World w, Entity e, int j, boolean k) { + super.onUpdate(s, w, e, j, k); - 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); + if ((!w.isRemote) && (s.isItemDamaged()) && (e.ticksExisted % 20 == 0) && ((e instanceof EntityLivingBase))) + s.damageItem(-1, (EntityLivingBase) e); + } - 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; - } + 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); - if (p.onGround || p.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; + 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; + } - } - else - { - p.jumpMovementFactor = 0.05F; - } - } - if (p.fallDistance > 0.0F) p.fallDistance = 0.0F; - } + if (p.onGround || p.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; - @SubscribeEvent - public void playerJumps (LivingEvent.LivingJumpEvent event) - { - if (event.entity instanceof EntityPlayer) - { - EntityPlayer player = (EntityPlayer) event.entity; + } else { + p.jumpMovementFactor = 0.05F; + } + } + if (p.fallDistance > 0.0F) p.fallDistance = 0.0F; + } - if (player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(0).getItem() == ItemRegistry.ItemVoidwalkerBoots) - { - event.entityLiving.motionY += 0.35D; - } - } - } + @SubscribeEvent + public void playerJumps(LivingEvent.LivingJumpEvent event) { + if (event.entity instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) event.entity; + + if (player.inventory.armorItemInSlot(0) != null + && player.inventory.armorItemInSlot(0).getItem() == ItemRegistry.ItemVoidwalkerBoots) { + event.entityLiving.motionY += 0.35D; + } + } + } } diff --git a/src/main/java/taintedmagic/common/items/equipment/ItemVoidwalkerSash.java b/src/main/java/taintedmagic/common/items/equipment/ItemVoidwalkerSash.java index 499952e..496026e 100644 --- a/src/main/java/taintedmagic/common/items/equipment/ItemVoidwalkerSash.java +++ b/src/main/java/taintedmagic/common/items/equipment/ItemVoidwalkerSash.java @@ -7,12 +7,11 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -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 net.minecraftforge.event.entity.living.LivingHurtEvent; + import taintedmagic.common.TaintedMagic; import thaumcraft.api.IRunicArmor; import thaumcraft.api.IWarpingGear; @@ -24,157 +23,132 @@ import baubles.api.IBauble; import baubles.common.lib.PlayerHandler; 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; -public class ItemVoidwalkerSash extends ItemRunic implements IRunicArmor, IWarpingGear, IBauble -{ - public static final String TAG_MODE = "mode"; +public class ItemVoidwalkerSash extends ItemRunic implements IRunicArmor, IWarpingGear, IBauble { - public ItemVoidwalkerSash () - { - super(20); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setTextureName("taintedmagic:ItemVoidwalkerSash"); - this.setMaxDamage(-1); - this.setMaxStackSize(1); - this.setUnlocalizedName("ItemVoidwalkerSash"); + public static final String TAG_MODE = "mode"; - MinecraftForge.EVENT_BUS.register(this); - FMLCommonHandler.instance().bus().register(this); - } + public ItemVoidwalkerSash() { + super(20); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setTextureName("taintedmagic:ItemVoidwalkerSash"); + this.setMaxDamage(-1); + this.setMaxStackSize(1); + this.setUnlocalizedName("ItemVoidwalkerSash"); - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.epic; - } + MinecraftForge.EVENT_BUS.register(this); + FMLCommonHandler.instance().bus().register(this); + } - @Override - public int getWarp (ItemStack s, EntityPlayer p) - { - return 2; - } + public EnumRarity getRarity(ItemStack s) { + return EnumRarity.epic; + } - @Override - public int getRunicCharge (ItemStack s) - { - return 20; - } + @Override + public int getWarp(ItemStack s, EntityPlayer p) { + return 2; + } - @Override - public boolean canEquip (ItemStack s, EntityLivingBase e) - { - return true; - } + @Override + public int getRunicCharge(ItemStack s) { + return 20; + } - @Override - public boolean canUnequip (ItemStack s, EntityLivingBase e) - { - return true; - } + @Override + public boolean canEquip(ItemStack s, EntityLivingBase e) { + return true; + } - @Override - public BaubleType getBaubleType (ItemStack s) - { - return BaubleType.BELT; - } + @Override + public boolean canUnequip(ItemStack s, EntityLivingBase e) { + return true; + } - @Override - public void onEquipped (ItemStack s, EntityLivingBase e) - { - Thaumcraft.instance.runicEventHandler.isDirty = true; - } + @Override + public BaubleType getBaubleType(ItemStack s) { + return BaubleType.BELT; + } - @Override - public void onUnequipped (ItemStack s, EntityLivingBase e) - { - Thaumcraft.instance.runicEventHandler.isDirty = true; - } + @Override + public void onEquipped(ItemStack s, EntityLivingBase e) { + Thaumcraft.instance.runicEventHandler.isDirty = true; + } - public void addInformation (ItemStack s, EntityPlayer p, List l, boolean b) - { - l.add("\u00A78" + StatCollector.translateToLocal("text.sash.mode") + (hasSpeedBoost(s) ? " \u00A7a" : " \u00A7c") + StatCollector.translateToLocal(hasSpeedBoost(s) ? "text.sash.on" : "text.sash.off")); - } + @Override + public void onUnequipped(ItemStack s, EntityLivingBase e) { + Thaumcraft.instance.runicEventHandler.isDirty = true; + } - @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; - } + public void addInformation(ItemStack s, EntityPlayer p, List l, boolean b) { + l.add( + "\u00A78" + StatCollector.translateToLocal("text.sash.mode") + + (hasSpeedBoost(s) ? " \u00A7a" : " \u00A7c") + + StatCollector.translateToLocal(hasSpeedBoost(s) ? "text.sash.on" : "text.sash.off")); + } - if (p.onGround || p.capabilities.isFlying) - { - float bonus = 0.4F; - p.moveFlying(0.0F, 1.0F, p.capabilities.isFlying ? (bonus - 0.050F) : bonus); - } - else if (Hover.getHover(p.getEntityId())) - { - p.jumpMovementFactor = 0.015F; + @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; + } - } - else - { - p.jumpMovementFactor = 0.025F; - } - } - if (p.fallDistance > 0.0F) p.fallDistance = 0.0F; - } - } - } + if (p.onGround || p.capabilities.isFlying) { + float bonus = 0.4F; + p.moveFlying(0.0F, 1.0F, p.capabilities.isFlying ? (bonus - 0.050F) : bonus); + } else if (Hover.getHover(p.getEntityId())) { + p.jumpMovementFactor = 0.015F; - @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; - } - } - } - } - } + } else { + p.jumpMovementFactor = 0.025F; + } + } + if (p.fallDistance > 0.0F) p.fallDistance = 0.0F; + } + } + } - @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)); - } - return s; - } + @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; + } + } + } + } + } - public boolean hasSpeedBoost (ItemStack s) - { - if (s.stackTagCompound == null) return true; + @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)); + } + return s; + } - else return s.stackTagCompound.getBoolean(TAG_MODE); - } + public boolean hasSpeedBoost(ItemStack s) { + if (s.stackTagCompound == null) return true; + + else return s.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 649d712..d8ee681 100644 --- a/src/main/java/taintedmagic/common/items/equipment/ItemWarpedGoggles.java +++ b/src/main/java/taintedmagic/common/items/equipment/ItemWarpedGoggles.java @@ -1,66 +1,47 @@ package taintedmagic.common.items.equipment; -import java.util.List; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; import net.minecraft.item.EnumRarity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; + import taintedmagic.common.TaintedMagic; import taintedmagic.common.registry.ItemRegistry; -import thaumcraft.api.IGoggles; -import thaumcraft.api.IRepairable; -import thaumcraft.api.IVisDiscountGear; import thaumcraft.api.IWarpingGear; -import thaumcraft.api.aspects.Aspect; -import thaumcraft.api.nodes.IRevealer; -import thaumcraft.common.config.ConfigItems; import thaumcraft.common.items.armor.ItemGoggles; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; -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 class ItemWarpedGoggles extends ItemGoggles implements IWarpingGear { - @SideOnly (Side.CLIENT) - public void registerIcons (IIconRegister ir) - { - this.icon = ir.registerIcon("taintedmagic:ItemWarpedGoggles"); - } + public ItemWarpedGoggles(ArmorMaterial m, int j, int k) { + super(m, j, k); + this.setMaxDamage(500); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setUnlocalizedName("ItemWarpedGoggles"); + } - public String getArmorTexture (ItemStack s, Entity e, int slot, String type) - { - return "taintedmagic:textures/models/ModelWarpedGoggles.png"; - } + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister ir) { + this.icon = ir.registerIcon("taintedmagic:ItemWarpedGoggles"); + } - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.rare; - } + public String getArmorTexture(ItemStack s, Entity e, int slot, String type) { + return "taintedmagic:textures/models/ModelWarpedGoggles.png"; + } - @Override - public int getWarp (ItemStack s, EntityPlayer p) - { - return 1; - } + public EnumRarity getRarity(ItemStack s) { + return EnumRarity.rare; + } - public boolean getIsRepairable (ItemStack s, ItemStack s2) - { - return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true : super.getIsRepairable(s, s2); - } + @Override + public int getWarp(ItemStack s, EntityPlayer p) { + return 1; + } + + public boolean getIsRepairable(ItemStack s, ItemStack s2) { + return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true + : super.getIsRepairable(s, s2); + } } diff --git a/src/main/java/taintedmagic/common/items/tools/ItemCrystalDagger.java b/src/main/java/taintedmagic/common/items/tools/ItemCrystalDagger.java index dc770f6..852cbbc 100644 --- a/src/main/java/taintedmagic/common/items/tools/ItemCrystalDagger.java +++ b/src/main/java/taintedmagic/common/items/tools/ItemCrystalDagger.java @@ -1,27 +1,25 @@ package taintedmagic.common.items.tools; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemSword; + import taintedmagic.api.IBloodlust; import taintedmagic.common.TaintedMagic; import thaumcraft.api.IRepairable; -public class ItemCrystalDagger extends ItemSword implements IBloodlust, IRepairable -{ - public ItemCrystalDagger (ToolMaterial m) - { - super(m); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setUnlocalizedName("ItemCrystalDagger"); - this.setMaxStackSize(1); - this.setTextureName("taintedmagic:ItemCrystalDagger"); - } +public class ItemCrystalDagger extends ItemSword implements IBloodlust, IRepairable { - @Override - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.uncommon; - } + public ItemCrystalDagger(ToolMaterial m) { + super(m); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setUnlocalizedName("ItemCrystalDagger"); + this.setMaxStackSize(1); + this.setTextureName("taintedmagic:ItemCrystalDagger"); + } + + @Override + public EnumRarity getRarity(ItemStack s) { + 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 dfb4631..a662cd6 100644 --- a/src/main/java/taintedmagic/common/items/tools/ItemKatana.java +++ b/src/main/java/taintedmagic/common/items/tools/ItemKatana.java @@ -15,7 +15,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; @@ -36,8 +35,8 @@ import taintedmagic.client.model.ModelKatana; import taintedmagic.client.model.ModelSaya; import taintedmagic.common.TaintedMagic; import taintedmagic.common.entities.EntityTaintBubble; -import taintedmagic.common.network.PacketKatanaAttack; import taintedmagic.common.network.PacketHandler; +import taintedmagic.common.network.PacketKatanaAttack; import thaumcraft.api.IRepairable; import thaumcraft.api.IWarpingGear; import thaumcraft.common.config.Config; @@ -46,420 +45,381 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class ItemKatana extends Item implements IWarpingGear, IRepairable -{ - 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 ModelKatana katana = new ModelKatana(); - public static final ModelSaya saya = new ModelSaya(); - - public static boolean equipped = false; - public static float ticksEquipped = 0F; - - public int ticksInUse = 0; - - public ItemKatana () - { - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setUnlocalizedName("ItemKatana"); - this.setHasSubtypes(true); - this.setMaxStackSize(1); - - MinecraftForge.EVENT_BUS.register(this); - } - - @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)); - - try - { - e.addPotionEffect(new PotionEffect(Config.potionTaintPoisonID, 100)); - } - catch (Exception ex) - { - } - break; - } - case 2 : - { - e.attackEntityFrom(DamageSource.wither.setMagicDamage().setDamageBypassesArmor(), getAttackDamage(s)); - - 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); - } - - @Override - public boolean isFull3D () - { - return true; - } - - @Override - public boolean canHarvestBlock (Block b, ItemStack s) - { - return false; - } - - @Override - public EnumAction getItemUseAction (ItemStack s) - { - return EnumAction.bow; - } - - @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)); - } - - public String getUnlocalizedName (ItemStack s) - { - return super.getUnlocalizedName() + "." + s.getItemDamage(); - } - - @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")); - - if (s.hasTagCompound() && s.stackTagCompound.hasKey("inscription")) - { - l.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("text.katana.inscription." + s.stackTagCompound.getInteger("inscription"))); - } - } - - @Override - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.uncommon; - } - - public float getAttackDamage (ItemStack s) - { - switch (s.getItemDamage()) - { - case 0 : - return 14.25F; - case 1 : - return 17.55F; - case 2 : - return 20.75F; - } - return 0; - } - - @Override - public int getMaxItemUseDuration (ItemStack s) - { - return 72000; - } - - @Override - public ItemStack onItemRightClick (ItemStack s, World w, EntityPlayer p) - { - p.setItemInUse(s, getMaxItemUseDuration(s)); - return s; - } - - @Override - public void onUsingTick (ItemStack s, EntityPlayer p, int i) - { - super.onUsingTick(s, p, i); - - this.ticksInUse = getMaxItemUseDuration(s) - 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); - } - - @Override - public void onPlayerStoppedUsing (ItemStack s, World w, EntityPlayer p, int i) - { - super.onPlayerStoppedUsing(s, w, p, i); - Random r = new Random(); - - if (!hasAnyInscription(s) || !isFullyCharged(p) || p.isSneaking() || getInscription(s) == 2) - { - boolean leech = (getInscription(s) == 2 && isFullyCharged(p)); - boolean b = false; - - if (w.isRemote) - { - MovingObjectPosition mop = Minecraft.getMinecraft().objectMouseOver; - float mul = Math.min(1.0F + (float) this.ticksInUse / 40.0F, 2.0F); - - 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.posX += proj.motionX; - proj.posY += proj.motionY; - proj.posZ += proj.motionZ; - if (!w.isRemote) w.spawnEntityInWorld(proj); - p.swingItem(); - break; - } - case 1 : - { - for (int a = 0; a < 50; a++) - { - EntityTaintBubble proj = new EntityTaintBubble(w, p, 5.0F, false); - proj.posX += proj.motionX; - proj.posY += proj.motionY; - proj.posZ += proj.motionZ; - proj.damage = getAttackDamage(s) * 0.2F; - if (!w.isRemote) w.spawnEntityInWorld(proj); - p.swingItem(); - } - break; - } - default : - break; - } - } - } - - private boolean isFullyCharged (EntityPlayer p) - { - float f = Math.min((float) this.ticksInUse / 15.0F, 2.0F); - - if (f == 2.0F) return true; - else return false; - } - - @SideOnly (Side.CLIENT) - @SubscribeEvent - public void onPlayerRender (RenderPlayerEvent.Specials.Post event) - { - if (event.entityLiving.getActivePotionEffect(Potion.invisibility) != null) return; - - EntityPlayer p = event.entityPlayer; - - for (int i = 0; i < p.inventory.getSizeInventory(); i++) - { - if (p.inventory.getStackInSlot(i) != null && p.inventory.getStackInSlot(i).getItem() instanceof ItemKatana) - { - ItemStack s = p.inventory.getStackInSlot(i); - - GL11.glPushMatrix(); - - int light = p.getBrightnessForRender(0); - int lightmapX = light % 65536; - int lightmapY = light / 65536; - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY); - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - - 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(s)); - saya.render(0.0625F); - - GL11.glPopMatrix(); - - if (p.getHeldItem() == null || p.getHeldItem() != s) - { - 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(s)); - katana.render(0.0625F); - - GL11.glPopMatrix(); - } - - GL11.glPopMatrix(); - - break; - } - } - } - - @SideOnly (Side.CLIENT) - public static void renderHUD (ScaledResolution r, EntityPlayer p, float pt) - { - Minecraft mc = Minecraft.getMinecraft(); - ItemStack s = mc.thePlayer.getCurrentEquippedItem(); - Tessellator t = Tessellator.instance; - - boolean b = false; - - if (s != null && s.getItem() instanceof ItemKatana) b = true; - else b = false; - - float time = 30F; - if (b) ticksEquipped = Math.min(time, ticksEquipped + pt); - else ticksEquipped = Math.max(0F, ticksEquipped - pt); - - float defAlpha = 0F; - float fract = ticksEquipped / time; - float a = fract; - - if (b || ticksEquipped != 0) - { - float tickFract = Math.min((float) p.getItemInUseDuration() / 30.0F, 1.0F); - - int x = r.getScaledWidth() / 2 + 725; - int x2 = x + 16; - int y = r.getScaledHeight() / 2 + (p.capabilities.isCreativeMode ? 805 : 755); - int y2 = y + 16; - - 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); - - float sc = 0.315F; - - GL11.glScalef(sc, sc, sc); - - mc.renderEngine.bindTexture(new ResourceLocation("thaumcraft:textures/misc/script.png")); - - 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 f = 0.0625F * rune; - float f1 = f + 0.0625F; - float f2 = 0.0F; - float f3 = 1.0F; - - t.startDrawingQuads(); - - t.setBrightness(240); - t.setColorRGBA_F(red, green, 0.4F, (alpha + 0.7F) * a); - 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); - - t.draw(); - - if ((int) (16 * tickFract) > rune) - { - t.startDrawingQuads(); - - 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); - - t.draw(); - } - } - GL11.glDisable(GL11.GL_BLEND); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); - } - } - - public static boolean hasAnyInscription (ItemStack s) - { - return s.hasTagCompound() && s.stackTagCompound.hasKey("inscription"); - } - - public static int getInscription (ItemStack s) - { - if (s.hasTagCompound() && s.stackTagCompound.hasKey("inscription")) return s.stackTagCompound.getInteger("inscription"); - else return 0; - } - - public static ResourceLocation getTexture (ItemStack s) - { - switch (s.getItemDamage()) - { - case 0 : - return textureThaumium; - case 1 : - return textureVoidmetal; - case 2 : - return textureShadowmetal; - } - return null; - } - - @Override - public int getWarp (ItemStack s, EntityPlayer p) - { - return s.getItemDamage() == 0 ? 0 : s.getItemDamage() == 1 ? 3 : 7; - } +public class ItemKatana extends Item implements IWarpingGear, IRepairable { + + 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 ModelKatana katana = new ModelKatana(); + public static final ModelSaya saya = new ModelSaya(); + + public static boolean equipped = false; + public static float ticksEquipped = 0F; + + public int ticksInUse = 0; + + public ItemKatana() { + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setUnlocalizedName("ItemKatana"); + this.setHasSubtypes(true); + this.setMaxStackSize(1); + + MinecraftForge.EVENT_BUS.register(this); + } + + @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)); + + try { + e.addPotionEffect(new PotionEffect(Config.potionTaintPoisonID, 100)); + } catch (Exception ex) {} + break; + } + case 2: { + e.attackEntityFrom( + DamageSource.wither.setMagicDamage().setDamageBypassesArmor(), + getAttackDamage(s)); + + 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); + } + + @Override + public boolean isFull3D() { + return true; + } + + @Override + public boolean canHarvestBlock(Block b, ItemStack s) { + return false; + } + + @Override + public EnumAction getItemUseAction(ItemStack s) { + return EnumAction.bow; + } + + @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)); + } + + public String getUnlocalizedName(ItemStack s) { + return super.getUnlocalizedName() + "." + s.getItemDamage(); + } + + @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")); + + if (s.hasTagCompound() && s.stackTagCompound.hasKey("inscription")) { + l.add( + EnumChatFormatting.GOLD + StatCollector.translateToLocal( + "text.katana.inscription." + s.stackTagCompound.getInteger("inscription"))); + } + } + + @Override + public EnumRarity getRarity(ItemStack s) { + return EnumRarity.uncommon; + } + + public float getAttackDamage(ItemStack s) { + switch (s.getItemDamage()) { + case 0: + return 14.25F; + case 1: + return 17.55F; + case 2: + return 20.75F; + } + return 0; + } + + @Override + public int getMaxItemUseDuration(ItemStack s) { + return 72000; + } + + @Override + public ItemStack onItemRightClick(ItemStack s, World w, EntityPlayer p) { + p.setItemInUse(s, getMaxItemUseDuration(s)); + return s; + } + + @Override + public void onUsingTick(ItemStack s, EntityPlayer p, int i) { + super.onUsingTick(s, p, i); + + this.ticksInUse = getMaxItemUseDuration(s) - 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); + } + + @Override + public void onPlayerStoppedUsing(ItemStack s, World w, EntityPlayer p, int i) { + super.onPlayerStoppedUsing(s, w, p, i); + Random r = new Random(); + + if (!hasAnyInscription(s) || !isFullyCharged(p) || p.isSneaking() || getInscription(s) == 2) { + boolean leech = (getInscription(s) == 2 && isFullyCharged(p)); + boolean b = false; + + if (w.isRemote) { + MovingObjectPosition mop = Minecraft.getMinecraft().objectMouseOver; + float mul = Math.min(1.0F + (float) this.ticksInUse / 40.0F, 2.0F); + + 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.posX += proj.motionX; + proj.posY += proj.motionY; + proj.posZ += proj.motionZ; + if (!w.isRemote) w.spawnEntityInWorld(proj); + p.swingItem(); + break; + } + case 1: { + for (int a = 0; a < 50; a++) { + EntityTaintBubble proj = new EntityTaintBubble(w, p, 5.0F, false); + proj.posX += proj.motionX; + proj.posY += proj.motionY; + proj.posZ += proj.motionZ; + proj.damage = getAttackDamage(s) * 0.2F; + if (!w.isRemote) w.spawnEntityInWorld(proj); + p.swingItem(); + } + break; + } + default: + break; + } + } + } + + private boolean isFullyCharged(EntityPlayer p) { + float f = Math.min((float) this.ticksInUse / 15.0F, 2.0F); + + if (f == 2.0F) return true; + else return false; + } + + @SideOnly(Side.CLIENT) + @SubscribeEvent + public void onPlayerRender(RenderPlayerEvent.Specials.Post event) { + if (event.entityLiving.getActivePotionEffect(Potion.invisibility) != null) return; + + EntityPlayer p = event.entityPlayer; + + for (int i = 0; i < p.inventory.getSizeInventory(); i++) { + if (p.inventory.getStackInSlot(i) != null + && p.inventory.getStackInSlot(i).getItem() instanceof ItemKatana) { + ItemStack s = p.inventory.getStackInSlot(i); + + GL11.glPushMatrix(); + + int light = p.getBrightnessForRender(0); + int lightmapX = light % 65536; + int lightmapY = light / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY); + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + 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(s)); + saya.render(0.0625F); + + GL11.glPopMatrix(); + + if (p.getHeldItem() == null || p.getHeldItem() != s) { + 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(s)); + katana.render(0.0625F); + + GL11.glPopMatrix(); + } + + GL11.glPopMatrix(); + + break; + } + } + } + + @SideOnly(Side.CLIENT) + public static void renderHUD(ScaledResolution r, EntityPlayer p, float pt) { + Minecraft mc = Minecraft.getMinecraft(); + ItemStack s = mc.thePlayer.getCurrentEquippedItem(); + Tessellator t = Tessellator.instance; + + boolean b = false; + + if (s != null && s.getItem() instanceof ItemKatana) b = true; + else b = false; + + float time = 30F; + if (b) ticksEquipped = Math.min(time, ticksEquipped + pt); + else ticksEquipped = Math.max(0F, ticksEquipped - pt); + + float defAlpha = 0F; + float fract = ticksEquipped / time; + float a = fract; + + if (b || ticksEquipped != 0) { + float tickFract = Math.min((float) p.getItemInUseDuration() / 30.0F, 1.0F); + + int x = r.getScaledWidth() / 2 + 725; + int x2 = x + 16; + int y = r.getScaledHeight() / 2 + (p.capabilities.isCreativeMode ? 805 : 755); + int y2 = y + 16; + + 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); + + float sc = 0.315F; + + GL11.glScalef(sc, sc, sc); + + mc.renderEngine.bindTexture(new ResourceLocation("thaumcraft:textures/misc/script.png")); + + 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 f = 0.0625F * rune; + float f1 = f + 0.0625F; + float f2 = 0.0F; + float f3 = 1.0F; + + t.startDrawingQuads(); + + t.setBrightness(240); + t.setColorRGBA_F(red, green, 0.4F, (alpha + 0.7F) * a); + 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); + + t.draw(); + + if ((int) (16 * tickFract) > rune) { + t.startDrawingQuads(); + + 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); + + t.draw(); + } + } + GL11.glDisable(GL11.GL_BLEND); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + } + } + + public static boolean hasAnyInscription(ItemStack s) { + return s.hasTagCompound() && s.stackTagCompound.hasKey("inscription"); + } + + public static int getInscription(ItemStack s) { + if (s.hasTagCompound() && s.stackTagCompound.hasKey("inscription")) + return s.stackTagCompound.getInteger("inscription"); + else return 0; + } + + public static ResourceLocation getTexture(ItemStack s) { + switch (s.getItemDamage()) { + case 0: + return textureThaumium; + case 1: + return textureVoidmetal; + case 2: + return textureShadowmetal; + } + return null; + } + + @Override + public int getWarp(ItemStack s, EntityPlayer p) { + return s.getItemDamage() == 0 ? 0 : s.getItemDamage() == 1 ? 3 : 7; + } } diff --git a/src/main/java/taintedmagic/common/items/tools/ItemPrimordialEdge.java b/src/main/java/taintedmagic/common/items/tools/ItemPrimordialEdge.java index e592198..7bb0d52 100644 --- a/src/main/java/taintedmagic/common/items/tools/ItemPrimordialEdge.java +++ b/src/main/java/taintedmagic/common/items/tools/ItemPrimordialEdge.java @@ -17,122 +17,106 @@ import net.minecraft.util.DamageSource; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import taintedmagic.api.IBloodlust; + import taintedmagic.common.TaintedMagic; import thaumcraft.api.IRepairable; 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 class ItemPrimordialEdge extends ItemSword implements IWarpingGear, IRepairable { - public EnumAction getItemUseAction (ItemStack s) - { - return EnumAction.block; - } + public ItemPrimordialEdge(ToolMaterial m) { + super(m); + this.setTextureName("taintedmagic:ItemPrimordialEdge"); + this.setUnlocalizedName("ItemPrimordialEdge"); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + } - public EnumRarity getRarity (ItemStack s) - { - return TaintedMagic.rarityCreation; - } + public EnumAction getItemUseAction(ItemStack s) { + return EnumAction.block; + } - public boolean hitEntity (ItemStack s, EntityLivingBase e, EntityLivingBase p) - { - super.hitEntity(s, e, p); + public EnumRarity getRarity(ItemStack s) { + return TaintedMagic.rarityCreation; + } - 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; - } + public boolean hitEntity(ItemStack s, EntityLivingBase e, EntityLivingBase p) { + super.hitEntity(s, e, p); - @Override - public ItemStack onItemRightClick (ItemStack s, World w, EntityPlayer p) - { - p.setItemInUse(s, this.getMaxItemUseDuration(s)); - return s; - } + 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; + } - @Override - public void onUsingTick (ItemStack s, EntityPlayer p, int count) - { - Iterator i$; + @Override + public ItemStack onItemRightClick(ItemStack s, World w, EntityPlayer p) { + p.setItemInUse(s, this.getMaxItemUseDuration(s)); + return s; + } - 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 void onUsingTick(ItemStack s, EntityPlayer p, int count) { + Iterator i$; - 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; + 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)); - if (eo != p) - { - if ( (eo.isEntityAlive()) && (!eo.isEntityInvulnerable())) - { - double d = pointDistanceSpace(eo.posX, eo.posY, eo.posZ, p); - if (d < 2.0D) - { - eo.attackEntityFrom(DamageSource.magic, 1.0F); - } + 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; - } - 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; + if (eo != p) { + if ((eo.isEntityAlive()) && (!eo.isEntityInvulnerable())) { + double d = pointDistanceSpace(eo.posX, eo.posY, eo.posZ, p); + if (d < 2.0D) { + eo.attackEntityFrom(DamageSource.magic, 1.0F); + } - 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; - } - } - } - } + } + 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; - @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 (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; + } + } + } + } - public double pointDistanceSpace (double x, double y, double z, EntityPlayer p) - { - double xvar = p.posX + 0.5D - x; - double yvar = p.posY + 0.5D - y; - double zvar = p.posZ + 0.5D - z; - return xvar * xvar + yvar * yvar + zvar * zvar; - } + @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); + } + } - @Override - public void addInformation (ItemStack s, EntityPlayer p, List l, boolean b) - { - l.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("text.eldritchsapping")); - } + public double pointDistanceSpace(double x, double y, double z, EntityPlayer p) { + double xvar = p.posX + 0.5D - x; + double yvar = p.posY + 0.5D - y; + double zvar = p.posZ + 0.5D - z; + return xvar * xvar + yvar * yvar + zvar * zvar; + } - @Override - public int getWarp (ItemStack s, EntityPlayer p) - { - return 5; - } + @Override + public void addInformation(ItemStack s, EntityPlayer p, List l, boolean b) { + l.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("text.eldritchsapping")); + } + + @Override + public int getWarp(ItemStack s, EntityPlayer p) { + 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 67b8964..3ec0b94 100644 --- a/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalAxe.java +++ b/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalAxe.java @@ -1,30 +1,29 @@ package taintedmagic.common.items.tools; -import taintedmagic.common.TaintedMagic; -import taintedmagic.common.registry.ItemRegistry; -import thaumcraft.api.IRepairable; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemAxe; import net.minecraft.item.ItemStack; -public class ItemShadowmetalAxe extends ItemAxe implements IRepairable -{ - public ItemShadowmetalAxe (ToolMaterial m) - { - super(m); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setTextureName("taintedmagic:ItemShadowmetalAxe"); - this.setUnlocalizedName("ItemShadowmetalAxe"); - } +import taintedmagic.common.TaintedMagic; +import taintedmagic.common.registry.ItemRegistry; +import thaumcraft.api.IRepairable; - public boolean getIsRepairable (ItemStack s, ItemStack s2) - { - return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true : super.getIsRepairable(s, s2); - } +public class ItemShadowmetalAxe extends ItemAxe implements IRepairable { - @Override - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.uncommon; - } + public ItemShadowmetalAxe(ToolMaterial m) { + super(m); + 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); + } + + @Override + public EnumRarity getRarity(ItemStack s) { + 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 43e53b6..da61cb9 100644 --- a/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalHoe.java +++ b/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalHoe.java @@ -9,66 +9,73 @@ import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.UseHoeEvent; + import taintedmagic.common.TaintedMagic; import taintedmagic.common.registry.ItemRegistry; import thaumcraft.api.IRepairable; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.eventhandler.SubscribeEvent; -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 class ItemShadowmetalHoe extends ItemHoe implements IRepairable { - public boolean getIsRepairable (ItemStack s, ItemStack s2) - { - return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true : super.getIsRepairable(s, s2); - } + 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); + } - @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 s, ItemStack s2) { + return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true + : super.getIsRepairable(s, s2); + } - 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 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; - @SubscribeEvent - public void useHoe (UseHoeEvent event) - { - if (event.current.getItem() == ItemRegistry.ItemShadowmetalHoe) - { - event.setCanceled(true); - } - } + 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 EnumRarity getRarity (ItemStack s) - { - return EnumRarity.uncommon; - } + @SubscribeEvent + public void useHoe(UseHoeEvent event) { + if (event.current.getItem() == ItemRegistry.ItemShadowmetalHoe) { + event.setCanceled(true); + } + } + + @Override + public EnumRarity getRarity(ItemStack s) { + 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..4018313 100644 --- a/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalPick.java +++ b/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalPick.java @@ -3,28 +3,27 @@ package taintedmagic.common.items.tools; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemStack; + import taintedmagic.common.TaintedMagic; import taintedmagic.common.registry.ItemRegistry; 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 class ItemShadowmetalPick extends ItemPickaxe implements IRepairable { - public boolean getIsRepairable (ItemStack s, ItemStack s2) - { - return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true : super.getIsRepairable(s, s2); - } + public ItemShadowmetalPick(ToolMaterial m) { + super(m); + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setTextureName("taintedmagic:ItemShadowmetalPick"); + this.setUnlocalizedName("ItemShadowmetalPick"); + } - @Override - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.uncommon; - } + public boolean getIsRepairable(ItemStack s, ItemStack s2) { + return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true + : super.getIsRepairable(s, s2); + } + + @Override + public EnumRarity getRarity(ItemStack s) { + 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 8f23404..5164880 100644 --- a/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalSpade.java +++ b/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalSpade.java @@ -1,30 +1,29 @@ package taintedmagic.common.items.tools; -import taintedmagic.common.TaintedMagic; -import taintedmagic.common.registry.ItemRegistry; -import thaumcraft.api.IRepairable; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemSpade; import net.minecraft.item.ItemStack; -public class ItemShadowmetalSpade extends ItemSpade implements IRepairable -{ - public ItemShadowmetalSpade (ToolMaterial m) - { - super(m); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setTextureName("taintedmagic:ItemShadowmetalSpade"); - this.setUnlocalizedName("ItemShadowmetalSpade"); - } +import taintedmagic.common.TaintedMagic; +import taintedmagic.common.registry.ItemRegistry; +import thaumcraft.api.IRepairable; - public boolean getIsRepairable (ItemStack s, ItemStack s2) - { - return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true : super.getIsRepairable(s, s2); - } +public class ItemShadowmetalSpade extends ItemSpade implements IRepairable { - @Override - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.uncommon; - } + public ItemShadowmetalSpade(ToolMaterial m) { + super(m); + 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); + } + + @Override + public EnumRarity getRarity(ItemStack s) { + 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 8fd4f00..2f98512 100644 --- a/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalSword.java +++ b/src/main/java/taintedmagic/common/items/tools/ItemShadowmetalSword.java @@ -1,30 +1,29 @@ package taintedmagic.common.items.tools; -import taintedmagic.common.TaintedMagic; -import taintedmagic.common.registry.ItemRegistry; -import thaumcraft.api.IRepairable; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemSword; -public class ItemShadowmetalSword extends ItemSword implements IRepairable -{ - public ItemShadowmetalSword (ToolMaterial m) - { - super(m); - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setTextureName("taintedmagic:ItemShadowmetalSword"); - this.setUnlocalizedName("ItemShadowmetalSword"); - } +import taintedmagic.common.TaintedMagic; +import taintedmagic.common.registry.ItemRegistry; +import thaumcraft.api.IRepairable; - public boolean getIsRepairable (ItemStack s, ItemStack s2) - { - return (s2.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial)) && s2.getItemDamage() == 0) ? true : super.getIsRepairable(s, s2); - } +public class ItemShadowmetalSword extends ItemSword implements IRepairable { - @Override - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.uncommon; - } + 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); + } + + @Override + public EnumRarity getRarity(ItemStack s) { + 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 9f8ab42..3dbf801 100644 --- a/src/main/java/taintedmagic/common/items/tools/ItemThaumicDisassembler.java +++ b/src/main/java/taintedmagic/common/items/tools/ItemThaumicDisassembler.java @@ -28,178 +28,171 @@ import thaumcraft.common.items.wands.WandManager; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class ItemThaumicDisassembler extends Item -{ - public static final String TAG_MODE = "mode"; +public class ItemThaumicDisassembler extends Item { - public ItemThaumicDisassembler () - { - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setMaxDamage(500); - this.setMaxStackSize(1); - this.setUnlocalizedName("ItemThaumicDisassembler"); - this.setTextureName("taintedmagic:ItemThaumicDisassembler"); - } + public static final String TAG_MODE = "mode"; - @Override - public boolean canHarvestBlock (Block b, ItemStack s) - { - return b != Blocks.bedrock; - } + public ItemThaumicDisassembler() { + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setMaxDamage(500); + this.setMaxStackSize(1); + this.setUnlocalizedName("ItemThaumicDisassembler"); + this.setTextureName("taintedmagic:ItemThaumicDisassembler"); + } - @Override - public void addInformation (ItemStack s, EntityPlayer p, List l, boolean b) - { - super.addInformation(s, p, l, b); + @Override + public boolean canHarvestBlock(Block b, ItemStack s) { + return b != Blocks.bedrock; + } - l.add("\u00A78" + StatCollector.translateToLocal("text.mode") + ": " + getModeName(s)); - l.add("\u00A78" + StatCollector.translateToLocal("text.efficiency") + ": " + (getMode(s) == 3 ? "\u00A7c" : "\u00A7a") + getEfficiency(s)); - l.add(" "); - l.add("\u00A79" + "+20 " + StatCollector.translateToLocal("text.attackdamage")); - } + @Override + public void addInformation(ItemStack s, EntityPlayer p, List l, boolean b) { + super.addInformation(s, p, l, b); - @Override - public boolean hitEntity (ItemStack s, EntityLivingBase e, EntityLivingBase p) - { - e.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) p), 20); - s.damageItem(2, p); - return false; - } + l.add("\u00A78" + StatCollector.translateToLocal("text.mode") + ": " + getModeName(s)); + l.add( + "\u00A78" + StatCollector.translateToLocal("text.efficiency") + + ": " + + (getMode(s) == 3 ? "\u00A7c" : "\u00A7a") + + getEfficiency(s)); + l.add(" "); + l.add("\u00A79" + "+20 " + StatCollector.translateToLocal("text.attackdamage")); + } - @Override - public float getDigSpeed (ItemStack s, Block b, int meta) - { - return getEfficiency(s); - } + @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 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 float getDigSpeed(ItemStack s, Block b, int meta) { + return getEfficiency(s); + } - @Override - public boolean onBlockStartBreak (ItemStack s, int x, int y, int z, EntityPlayer p) - { - super.onBlockStartBreak(s, x, y, z, p); + @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; + } - if (!p.worldObj.isRemote) - { - Block block = p.worldObj.getBlock(x, y, z); - int meta = p.worldObj.getBlockMetadata(x, y, z); + @Override + public boolean onBlockStartBreak(ItemStack s, int x, int y, int z, EntityPlayer p) { + super.onBlockStartBreak(s, x, y, z, p); - if (block == Blocks.lit_redstone_ore) block = Blocks.redstone_ore; + if (!p.worldObj.isRemote) { + Block block = p.worldObj.getBlock(x, y, z); + int meta = p.worldObj.getBlockMetadata(x, y, z); - ItemStack stack = new ItemStack(block, 1, meta); - } - return false; - } + if (block == Blocks.lit_redstone_ore) block = Blocks.redstone_ore; - @Override - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.uncommon; - } + ItemStack stack = new ItemStack(block, 1, meta); + } + return false; + } - @Override - public boolean isFull3D () - { - return true; - } + @Override + public EnumRarity getRarity(ItemStack s) { + return EnumRarity.uncommon; + } - @Override - public ItemStack onItemRightClick (ItemStack s, World w, EntityPlayer p) - { - if (!w.isRemote && p.isSneaking()) toggleMode(s); + @Override + public boolean isFull3D() { + return true; + } - return s; - } + @Override + public ItemStack onItemRightClick(ItemStack s, World w, EntityPlayer p) { + if (!w.isRemote && p.isSneaking()) toggleMode(s); - public static int getEfficiency (ItemStack s) - { - switch (getMode(s)) - { - case 0 : - return 20; - case 1 : - return 8; - case 2 : - return 128; - case 3 : - return 0; - } - return 0; - } + return s; + } - public static int getMode (ItemStack s) - { - if (s.stackTagCompound == null) return 0; - return s.stackTagCompound.getInteger(TAG_MODE); - } + public static int getEfficiency(ItemStack s) { + switch (getMode(s)) { + case 0: + return 20; + case 1: + return 8; + case 2: + return 128; + case 3: + return 0; + } + return 0; + } - public static String getModeName (ItemStack s) - { - int mode = getMode(s); + public static int getMode(ItemStack s) { + if (s.stackTagCompound == null) return 0; + return s.stackTagCompound.getInteger(TAG_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) { + int mode = getMode(s); - public void toggleMode (ItemStack s) - { - if (s.stackTagCompound == null) s.setTagCompound(new NBTTagCompound()); - s.stackTagCompound.setInteger(TAG_MODE, getMode(s) < 3 ? getMode(s) + 1 : 0); - } + 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 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 toggleMode(ItemStack s) { + if (s.stackTagCompound == null) s.setTagCompound(new NBTTagCompound()); + s.stackTagCompound.setInteger(TAG_MODE, getMode(s) < 3 ? getMode(s) + 1 : 0); + } - @SideOnly (Side.CLIENT) - public static void renderHUD (ScaledResolution resolution, EntityPlayer player, float partialTicks) - { - Minecraft mc = Minecraft.getMinecraft(); - EntityPlayer p = TaintedMagic.proxy.getClientPlayer(); - ItemStack s = mc.thePlayer.getCurrentEquippedItem(); - FontRenderer f = mc.fontRenderer; + 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); + } + } + } - if (s != null && s.getItem() instanceof ItemThaumicDisassembler) - { - String str = "\u00A78" + StatCollector.translateToLocal("text.mode") + ": " + getModeName(s) + (getMode(s) == 3 ? "\u00A7c" : "\u00A7a") + " (" + getEfficiency(s) + ")"; + @SideOnly(Side.CLIENT) + public static void renderHUD(ScaledResolution resolution, EntityPlayer player, float partialTicks) { + Minecraft mc = Minecraft.getMinecraft(); + EntityPlayer p = TaintedMagic.proxy.getClientPlayer(); + ItemStack s = mc.thePlayer.getCurrentEquippedItem(); + FontRenderer f = mc.fontRenderer; - 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); - GL11.glTranslated(0, -15, 0); + if (s != null && s.getItem() instanceof ItemThaumicDisassembler) { + String str = "\u00A78" + StatCollector.translateToLocal("text.mode") + + ": " + + getModeName(s) + + (getMode(s) == 3 ? "\u00A7c" : "\u00A7a") + + " (" + + getEfficiency(s) + + ")"; - GL11.glScalef(0.8F, 0.8F, 0.8F); + 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); + GL11.glTranslated(0, -15, 0); - f.drawStringWithShadow(str, resolution.getScaledWidth() / 2 + 100, resolution.getScaledHeight() / 2 + (p.capabilities.isCreativeMode ? 230 : 212), 0xFFFFFF); + GL11.glScalef(0.8F, 0.8F, 0.8F); - GL11.glDisable(GL11.GL_BLEND); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); - } - } + f.drawStringWithShadow( + str, + resolution.getScaledWidth() / 2 + 100, + resolution.getScaledHeight() / 2 + (p.capabilities.isCreativeMode ? 230 : 212), + 0xFFFFFF); + + GL11.glDisable(GL11.GL_BLEND); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + } + } } diff --git a/src/main/java/taintedmagic/common/items/wand/ItemWandCap.java b/src/main/java/taintedmagic/common/items/wand/ItemWandCap.java index a967322..3b61cdf 100644 --- a/src/main/java/taintedmagic/common/items/wand/ItemWandCap.java +++ b/src/main/java/taintedmagic/common/items/wand/ItemWandCap.java @@ -8,49 +8,42 @@ import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; + import taintedmagic.common.TaintedMagic; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class ItemWandCap extends Item -{ - public int SUBTYPES = 4; - public IIcon[] icons = new IIcon[SUBTYPES]; +public class ItemWandCap extends Item { - public ItemWandCap () - { - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setUnlocalizedName("ItemWandCap"); - this.setHasSubtypes(true); - } + public int SUBTYPES = 4; + public IIcon[] icons = new IIcon[SUBTYPES]; - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.uncommon; - } + public ItemWandCap() { + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setUnlocalizedName("ItemWandCap"); + this.setHasSubtypes(true); + } - @SideOnly (Side.CLIENT) - public void registerIcons (IIconRegister ir) - { - for (int i = 0; i < icons.length; i++) - this.icons[i] = ir.registerIcon("taintedmagic:ItemWandCap" + i); - } + public EnumRarity getRarity(ItemStack s) { + return EnumRarity.uncommon; + } - @SideOnly (Side.CLIENT) - public IIcon getIconFromDamage (int i) - { - return this.icons[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 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 IIcon getIconFromDamage(int i) { + return this.icons[i]; + } - public String getUnlocalizedName (ItemStack s) - { - return super.getUnlocalizedName() + "." + s.getItemDamage(); - } + @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)); + } + + public String getUnlocalizedName(ItemStack s) { + return super.getUnlocalizedName() + "." + s.getItemDamage(); + } } diff --git a/src/main/java/taintedmagic/common/items/wand/ItemWandRod.java b/src/main/java/taintedmagic/common/items/wand/ItemWandRod.java index b959a2c..f5139f3 100644 --- a/src/main/java/taintedmagic/common/items/wand/ItemWandRod.java +++ b/src/main/java/taintedmagic/common/items/wand/ItemWandRod.java @@ -2,58 +2,48 @@ package taintedmagic.common.items.wand; import java.util.List; -import taintedmagic.common.TaintedMagic; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; -public class ItemWandRod extends Item -{ - public int SUBTYPES = 2; - public IIcon[] icons = new IIcon[SUBTYPES]; +import taintedmagic.common.TaintedMagic; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; - public ItemWandRod () - { - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setUnlocalizedName("ItemWandRod"); - this.setHasSubtypes(true); - } +public class ItemWandRod extends Item { - public EnumRarity getRarity (ItemStack s) - { - return EnumRarity.uncommon; - } + public int SUBTYPES = 2; + public IIcon[] icons = new IIcon[SUBTYPES]; - @SideOnly (Side.CLIENT) - public void registerIcons (IIconRegister ir) - { - for (int i = 0; i < icons.length; i++) - this.icons[i] = ir.registerIcon("taintedmagic:ItemWandRod" + i); - } + public ItemWandRod() { + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setUnlocalizedName("ItemWandRod"); + this.setHasSubtypes(true); + } - @SideOnly (Side.CLIENT) - public IIcon getIconFromDamage (int i) - { - return this.icons[i]; - } + public EnumRarity getRarity(ItemStack s) { + return EnumRarity.uncommon; + } - @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 registerIcons(IIconRegister ir) { + for (int i = 0; i < icons.length; i++) this.icons[i] = ir.registerIcon("taintedmagic:ItemWandRod" + i); + } - public String getUnlocalizedName (ItemStack s) - { - return super.getUnlocalizedName() + "." + s.getItemDamage(); - } + @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)); + } + + public String getUnlocalizedName(ItemStack s) { + return super.getUnlocalizedName() + "." + s.getItemDamage(); + } } diff --git a/src/main/java/taintedmagic/common/items/wand/foci/ItemFocusEldritch.java b/src/main/java/taintedmagic/common/items/wand/foci/ItemFocusEldritch.java index 9af5403..25a8a21 100644 --- a/src/main/java/taintedmagic/common/items/wand/foci/ItemFocusEldritch.java +++ b/src/main/java/taintedmagic/common/items/wand/foci/ItemFocusEldritch.java @@ -4,149 +4,119 @@ import java.util.Random; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; -import net.minecraft.util.ChatComponentText; import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; -import net.minecraft.util.Vec3; import net.minecraft.world.World; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + import taintedmagic.common.TaintedMagic; import taintedmagic.common.entities.EntityEldritchOrbAttack; -import taintedmagic.common.entities.EntityTaintBubble; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.wands.FocusUpgradeType; import thaumcraft.api.wands.ItemFocusBasic; import thaumcraft.common.Thaumcraft; -import thaumcraft.common.entities.monster.EntityEldritchGuardian; -import thaumcraft.common.entities.projectile.EntityEldritchOrb; -import thaumcraft.common.entities.projectile.EntityEmber; import thaumcraft.common.items.wands.ItemWandCasting; -import thaumcraft.common.items.wands.WandManager; -import thaumcraft.common.lib.network.PacketHandler; -import thaumcraft.common.lib.network.misc.PacketMiscEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; -public class ItemFocusEldritch extends ItemFocusBasic -{ - public static FocusUpgradeType sanity = new FocusUpgradeType(57, 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)); - IIcon depthIcon = null; +public class ItemFocusEldritch extends ItemFocusBasic { - private static final AspectList costBase = new AspectList().add(Aspect.ENTROPY, 20).add(Aspect.FIRE, 20); - private static final AspectList costSane = new AspectList().add(Aspect.ENTROPY, 20).add(Aspect.FIRE, 50).add(Aspect.ORDER, 20); - private static final AspectList costCorrosive = new AspectList().add(Aspect.ENTROPY, 50).add(Aspect.FIRE, 20).add(Aspect.WATER, 20); + public static FocusUpgradeType sanity = new FocusUpgradeType( + 57, + 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)); + IIcon depthIcon = null; - long soundDelay = 0L; + private static final AspectList costBase = new AspectList().add(Aspect.ENTROPY, 20).add(Aspect.FIRE, 20); + private static final AspectList costSane = new AspectList().add(Aspect.ENTROPY, 20).add(Aspect.FIRE, 50) + .add(Aspect.ORDER, 20); + private static final AspectList costCorrosive = new AspectList().add(Aspect.ENTROPY, 50).add(Aspect.FIRE, 20) + .add(Aspect.WATER, 20); - public ItemFocusEldritch () - { - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setUnlocalizedName("ItemFocusEldritch"); - } + long soundDelay = 0L; - @SideOnly (Side.CLIENT) - public void registerIcons (IIconRegister ir) - { - this.icon = ir.registerIcon("taintedmagic:ItemFocusEldritch"); - this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusEldritch_depth"); - } + public ItemFocusEldritch() { + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setUnlocalizedName("ItemFocusEldritch"); + } - public IIcon getFocusDepthLayerIcon (ItemStack s) - { - return this.depthIcon; - } + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister ir) { + this.icon = ir.registerIcon("taintedmagic:ItemFocusEldritch"); + this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusEldritch_depth"); + } - public String getSortingHelper (ItemStack s) - { - return "ELDRITCH" + super.getSortingHelper(s); - } + public IIcon getFocusDepthLayerIcon(ItemStack s) { + return this.depthIcon; + } - public int getFocusColor (ItemStack s) - { - return 0x000018; - } + public String getSortingHelper(ItemStack s) { + return "ELDRITCH" + super.getSortingHelper(s); + } - public AspectList getVisCost (ItemStack s) - { - return isUpgradedWith(s, ItemFocusTaint.corrosive) ? costCorrosive : isUpgradedWith(s, sanity) ? costSane : costBase; - } + public int getFocusColor(ItemStack s) { + return 0x000018; + } - public int getActivationCooldown (ItemStack s) - { - return 600; - } + public AspectList getVisCost(ItemStack s) { + return isUpgradedWith(s, ItemFocusTaint.corrosive) ? costCorrosive + : isUpgradedWith(s, sanity) ? costSane : costBase; + } - public boolean isVisCostPerTick (ItemStack s) - { - return false; - } + public int getActivationCooldown(ItemStack s) { + return 600; + } - public ItemFocusBasic.WandFocusAnimation getAnimation (ItemStack s) - { - return ItemFocusBasic.WandFocusAnimation.WAVE; - } + public boolean isVisCostPerTick(ItemStack s) { + return false; + } - public ItemStack onFocusRightClick (ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop) - { - ItemWandCasting wand = (ItemWandCasting) s.getItem(); + public ItemFocusBasic.WandFocusAnimation getAnimation(ItemStack s) { + return ItemFocusBasic.WandFocusAnimation.WAVE; + } - if (!w.isRemote) - { - int potency = wand.getFocusPotency(s); - if (wand.consumeAllVis(s, p, getVisCost(s), true, false)) - { - EntityEldritchOrbAttack orb = null; - orb = new EntityEldritchOrbAttack(w, p, isUpgradedWith(wand.getFocusItem(s), ItemFocusTaint.corrosive)); - orb.dmg = (10F + potency); - w.spawnEntityInWorld(orb); - if (!isUpgradedWith(wand.getFocusItem(s), sanity)) - { - Random rand = new Random(); - int randomInt = rand.nextInt(10); - if (randomInt == 5) - { - Thaumcraft.addStickyWarpToPlayer(p, 1); - } - } - } - w.playSoundAtEntity(p, "thaumcraft:egattack", 0.4F, 1.0F + w.rand.nextFloat() * 0.1F); - } - p.swingItem(); - return s; - } + public ItemStack onFocusRightClick(ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop) { + ItemWandCasting wand = (ItemWandCasting) s.getItem(); - public FocusUpgradeType[] getPossibleUpgradesByRank (ItemStack s, int rank) - { - switch (rank) - { - case 1 : - return new FocusUpgradeType[]{ - FocusUpgradeType.frugal, - FocusUpgradeType.potency }; - case 2 : - return new FocusUpgradeType[]{ - FocusUpgradeType.frugal, - FocusUpgradeType.potency }; - case 3 : - return new FocusUpgradeType[]{ - FocusUpgradeType.frugal, - FocusUpgradeType.potency, - ItemFocusTaint.corrosive }; - case 4 : - return new FocusUpgradeType[]{ - FocusUpgradeType.frugal, - FocusUpgradeType.potency }; - case 5 : - return new FocusUpgradeType[]{ - FocusUpgradeType.frugal, - FocusUpgradeType.potency, - this.sanity }; - } - return null; - } + if (!w.isRemote) { + int potency = wand.getFocusPotency(s); + if (wand.consumeAllVis(s, p, getVisCost(s), true, false)) { + EntityEldritchOrbAttack orb = null; + orb = new EntityEldritchOrbAttack(w, p, isUpgradedWith(wand.getFocusItem(s), ItemFocusTaint.corrosive)); + orb.dmg = (10F + potency); + w.spawnEntityInWorld(orb); + if (!isUpgradedWith(wand.getFocusItem(s), sanity)) { + Random rand = new Random(); + int randomInt = rand.nextInt(10); + if (randomInt == 5) { + Thaumcraft.addStickyWarpToPlayer(p, 1); + } + } + } + w.playSoundAtEntity(p, "thaumcraft:egattack", 0.4F, 1.0F + w.rand.nextFloat() * 0.1F); + } + p.swingItem(); + return s; + } + + public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack s, int rank) { + switch (rank) { + case 1: + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency }; + case 2: + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency }; + case 3: + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency, + ItemFocusTaint.corrosive }; + case 4: + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency }; + case 5: + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency, this.sanity }; + } + return null; + } } diff --git a/src/main/java/taintedmagic/common/items/wand/foci/ItemFocusMageMace.java b/src/main/java/taintedmagic/common/items/wand/foci/ItemFocusMageMace.java index 38a090f..79f5512 100644 --- a/src/main/java/taintedmagic/common/items/wand/foci/ItemFocusMageMace.java +++ b/src/main/java/taintedmagic/common/items/wand/foci/ItemFocusMageMace.java @@ -11,127 +11,113 @@ import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import net.minecraftforge.event.entity.living.LivingEvent; + import taintedmagic.common.TaintedMagic; -import taintedmagic.common.registry.ItemRegistry; import thaumcraft.api.ThaumcraftApiHelper; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.wands.FocusUpgradeType; import thaumcraft.api.wands.ItemFocusBasic; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class ItemFocusMageMace extends ItemFocusBasic -{ - public IIcon depthIcon = null; - public IIcon ornIcon = null; +public class ItemFocusMageMace extends ItemFocusBasic { - public int dmg; + public IIcon depthIcon = null; + public IIcon ornIcon = null; - public static FocusUpgradeType bloodlust = new FocusUpgradeType(58, new ResourceLocation("taintedmagic", "textures/misc/IconBloodlust.png"), "focus.upgrade.bloodlust.name", "focus.upgrade.bloodlust.text", new AspectList().add(Aspect.WEAPON, 1).add(Aspect.HEAL, 1)); - public static final AspectList costBase = new AspectList().add(Aspect.ENTROPY, 50); - public static final AspectList costBloodlust = new AspectList().add(Aspect.ENTROPY, 50).add(Aspect.ORDER, 20).add(Aspect.FIRE, 50); + public int dmg; - public ItemFocusMageMace () - { - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setUnlocalizedName("ItemFocusMageMace"); - } + public static FocusUpgradeType bloodlust = new FocusUpgradeType( + 58, + new ResourceLocation("taintedmagic", "textures/misc/IconBloodlust.png"), + "focus.upgrade.bloodlust.name", + "focus.upgrade.bloodlust.text", + new AspectList().add(Aspect.WEAPON, 1).add(Aspect.HEAL, 1)); + public static final AspectList costBase = new AspectList().add(Aspect.ENTROPY, 50); + public static final AspectList costBloodlust = new AspectList().add(Aspect.ENTROPY, 50).add(Aspect.ORDER, 20) + .add(Aspect.FIRE, 50); - @SideOnly (Side.CLIENT) - public void registerIcons (IIconRegister ir) - { - this.icon = ir.registerIcon("taintedmagic:ItemFocusMageMace"); - this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusMageMace_depth"); - this.ornIcon = ir.registerIcon("taintedmagic:ItemFocusMageMace_orn"); - } + public ItemFocusMageMace() { + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setUnlocalizedName("ItemFocusMageMace"); + } - public IIcon getFocusDepthLayerIcon (ItemStack s) - { - return this.depthIcon; - } + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister ir) { + this.icon = ir.registerIcon("taintedmagic:ItemFocusMageMace"); + this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusMageMace_depth"); + this.ornIcon = ir.registerIcon("taintedmagic:ItemFocusMageMace_orn"); + } - public IIcon getOrnament (ItemStack s) - { - return this.ornIcon; - } + public IIcon getFocusDepthLayerIcon(ItemStack s) { + return this.depthIcon; + } - public String getSortingHelper (ItemStack s) - { - return "MACE" + super.getSortingHelper(s); - } + public IIcon getOrnament(ItemStack s) { + return this.ornIcon; + } - public int getFocusColor (ItemStack s) - { - return 3289650; - } + public String getSortingHelper(ItemStack s) { + return "MACE" + super.getSortingHelper(s); + } - public AspectList getVisCost (ItemStack s) - { - return this.isUpgradedWith(s, bloodlust) ? this.costBloodlust : this.costBase; - } + public int getFocusColor(ItemStack s) { + return 3289650; + } - public int getActivationCooldown (ItemStack s) - { - return -1; - } + public AspectList getVisCost(ItemStack s) { + return this.isUpgradedWith(s, bloodlust) ? this.costBloodlust : this.costBase; + } - public boolean isVisCostPerTick (ItemStack s) - { - return false; - } + public int getActivationCooldown(ItemStack s) { + return -1; + } - public ItemFocusBasic.WandFocusAnimation getAnimation (ItemStack s) - { - return WandFocusAnimation.WAVE; - } + public boolean isVisCostPerTick(ItemStack s) { + return false; + } - public ItemStack onFocusRightClick (ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop) - { - return s; - } + public ItemFocusBasic.WandFocusAnimation getAnimation(ItemStack s) { + return WandFocusAnimation.WAVE; + } - @Override - public void addInformation (ItemStack s, EntityPlayer p, List l, boolean b) - { - super.addInformation(s, p, l, b); - l.add(" "); - l.add(EnumChatFormatting.BLUE + "+" + new String(this.isUpgradedWith(s, FocusUpgradeType.potency) ? Integer.toString(15 + this.getUpgradeLevel(s, FocusUpgradeType.potency)) : "15") + " " + StatCollector.translateToLocal("text.attackdamageequipped")); - } + public ItemStack onFocusRightClick(ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop) { + return s; + } - public FocusUpgradeType[] getPossibleUpgradesByRank (ItemStack s, int rank) - { - switch (rank) - { - case 1 : - return new FocusUpgradeType[]{ - FocusUpgradeType.frugal, - FocusUpgradeType.potency }; - case 2 : - return new FocusUpgradeType[]{ - FocusUpgradeType.frugal, - FocusUpgradeType.potency }; - case 3 : - return new FocusUpgradeType[]{ - FocusUpgradeType.frugal, - FocusUpgradeType.potency }; - case 4 : - return new FocusUpgradeType[]{ - FocusUpgradeType.frugal, - FocusUpgradeType.potency }; - case 5 : - return new FocusUpgradeType[]{ - FocusUpgradeType.frugal, - FocusUpgradeType.potency, - this.bloodlust }; - } - return null; - } + @Override + public void addInformation(ItemStack s, EntityPlayer p, List l, boolean b) { + super.addInformation(s, p, l, b); + l.add(" "); + l.add( + EnumChatFormatting.BLUE + "+" + + new String( + this.isUpgradedWith(s, FocusUpgradeType.potency) + ? Integer.toString(15 + this.getUpgradeLevel(s, FocusUpgradeType.potency)) + : "15") + + " " + + StatCollector.translateToLocal("text.attackdamageequipped")); + } - public boolean canApplyUpgrade (ItemStack s, EntityPlayer p, FocusUpgradeType t, int rank) - { - return (!t.equals(this.bloodlust)) || (ThaumcraftApiHelper.isResearchComplete(p.getCommandSenderName(), "BLOODLUSTUPGRADE")); - } + public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack s, int rank) { + switch (rank) { + case 1: + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency }; + case 2: + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency }; + case 3: + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency }; + case 4: + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency }; + case 5: + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency, this.bloodlust }; + } + return null; + } + + public boolean canApplyUpgrade(ItemStack s, EntityPlayer p, FocusUpgradeType t, int rank) { + return (!t.equals(this.bloodlust)) + || (ThaumcraftApiHelper.isResearchComplete(p.getCommandSenderName(), "BLOODLUSTUPGRADE")); + } } diff --git a/src/main/java/taintedmagic/common/items/wand/foci/ItemFocusMeteorology.java b/src/main/java/taintedmagic/common/items/wand/foci/ItemFocusMeteorology.java index b44f011..628a32e 100644 --- a/src/main/java/taintedmagic/common/items/wand/foci/ItemFocusMeteorology.java +++ b/src/main/java/taintedmagic/common/items/wand/foci/ItemFocusMeteorology.java @@ -7,6 +7,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; + import taintedmagic.common.TaintedMagic; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; @@ -16,76 +17,67 @@ import thaumcraft.common.items.wands.WandManager; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class ItemFocusMeteorology extends ItemFocusBasic -{ - IIcon depthIcon = null; +public class ItemFocusMeteorology extends ItemFocusBasic { - private static final AspectList costBase = new AspectList().add(Aspect.AIR, 1000).add(Aspect.WATER, 1000).add(Aspect.FIRE, 1000).add(Aspect.EARTH, 1000).add(Aspect.ORDER, 1000).add(Aspect.ENTROPY, 1000); + IIcon depthIcon = null; - public ItemFocusMeteorology () - { - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setUnlocalizedName("ItemFocusMeteorology"); - } + private static final AspectList costBase = new AspectList().add(Aspect.AIR, 1000).add(Aspect.WATER, 1000) + .add(Aspect.FIRE, 1000).add(Aspect.EARTH, 1000).add(Aspect.ORDER, 1000).add(Aspect.ENTROPY, 1000); - @SideOnly (Side.CLIENT) - public void registerIcons (IIconRegister ir) - { - this.icon = ir.registerIcon("taintedmagic:ItemFocusMeteorology"); - this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusMeteorology_depth"); - } + public ItemFocusMeteorology() { + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setUnlocalizedName("ItemFocusMeteorology"); + } - public IIcon getFocusDepthLayerIcon (ItemStack s) - { - return this.depthIcon; - } + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister ir) { + this.icon = ir.registerIcon("taintedmagic:ItemFocusMeteorology"); + this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusMeteorology_depth"); + } - public String getSortingHelper (ItemStack s) - { - return "RAIN" + super.getSortingHelper(s); - } + public IIcon getFocusDepthLayerIcon(ItemStack s) { + return this.depthIcon; + } - public int getFocusColor (ItemStack s) - { - return 0x23D9EA; - } + public String getSortingHelper(ItemStack s) { + return "RAIN" + super.getSortingHelper(s); + } - public AspectList getVisCost (ItemStack s) - { - return new AspectList().add(Aspect.AIR, 1000).add(Aspect.WATER, 1000).add(Aspect.FIRE, 1000).add(Aspect.EARTH, 1000).add(Aspect.ORDER, 1000).add(Aspect.ENTROPY, 1000); - } + public int getFocusColor(ItemStack s) { + return 0x23D9EA; + } - public int getActivationCooldown (ItemStack s) - { - return 1; - } + public AspectList getVisCost(ItemStack s) { + return new AspectList().add(Aspect.AIR, 1000).add(Aspect.WATER, 1000).add(Aspect.FIRE, 1000) + .add(Aspect.EARTH, 1000).add(Aspect.ORDER, 1000).add(Aspect.ENTROPY, 1000); + } - public boolean isVisCostPerTick (ItemStack s) - { - return false; - } + public int getActivationCooldown(ItemStack s) { + return 1; + } - public ItemFocusBasic.WandFocusAnimation getAnimation (ItemStack s) - { - return ItemFocusBasic.WandFocusAnimation.WAVE; - } + public boolean isVisCostPerTick(ItemStack s) { + return false; + } - public ItemStack onFocusRightClick (ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop) - { - WandManager.setCooldown(p, 30000); - ItemWandCasting wand = (ItemWandCasting) s.getItem(); - wand.consumeAllVis(s, p, getVisCost(s), true, false); + public ItemFocusBasic.WandFocusAnimation getAnimation(ItemStack s) { + return ItemFocusBasic.WandFocusAnimation.WAVE; + } - w.getWorldInfo().setRainTime(w.isRaining() ? 24000 : 0); - w.getWorldInfo().setRaining(!w.isRaining()); + public ItemStack onFocusRightClick(ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop) { + WandManager.setCooldown(p, 30000); + ItemWandCasting wand = (ItemWandCasting) s.getItem(); + wand.consumeAllVis(s, p, getVisCost(s), true, false); - p.playSound("thaumcraft:wand", 0.5F, 1.0F); - return s; - } + w.getWorldInfo().setRainTime(w.isRaining() ? 24000 : 0); + w.getWorldInfo().setRaining(!w.isRaining()); - @SideOnly (Side.CLIENT) - public EnumRarity getRarity (ItemStack s) - { - return TaintedMagic.rarityCreation; - } + p.playSound("thaumcraft:wand", 0.5F, 1.0F); + return s; + } + + @SideOnly(Side.CLIENT) + public EnumRarity getRarity(ItemStack s) { + return TaintedMagic.rarityCreation; + } } diff --git a/src/main/java/taintedmagic/common/items/wand/foci/ItemFocusTaint.java b/src/main/java/taintedmagic/common/items/wand/foci/ItemFocusTaint.java index f1e94ad..894c882 100644 --- a/src/main/java/taintedmagic/common/items/wand/foci/ItemFocusTaint.java +++ b/src/main/java/taintedmagic/common/items/wand/foci/ItemFocusTaint.java @@ -11,157 +11,139 @@ import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.ResourceLocation; import net.minecraft.util.Vec3; import net.minecraft.world.World; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + import taintedmagic.common.TaintedMagic; import taintedmagic.common.entities.EntityTaintBubble; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.wands.FocusUpgradeType; import thaumcraft.api.wands.ItemFocusBasic; -import thaumcraft.common.Thaumcraft; import thaumcraft.common.config.Config; -import thaumcraft.common.entities.projectile.EntityEmber; import thaumcraft.common.items.wands.ItemWandCasting; import thaumcraft.common.items.wands.WandManager; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; -public class ItemFocusTaint extends ItemFocusBasic -{ - public static FocusUpgradeType tainturgy = new FocusUpgradeType(55, new ResourceLocation("taintedmagic", "textures/foci/IconTainturgy.png"), "focus.upgrade.tainturgy.name", "focus.upgrade.tainturgy.text", new AspectList().add(Aspect.TAINT, 1).add(Aspect.HEAL, 1)); - public static FocusUpgradeType corrosive = new FocusUpgradeType(56, 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)); - IIcon depthIcon = null; +public class ItemFocusTaint extends ItemFocusBasic { - private static final AspectList costBase = new AspectList().add(Aspect.EARTH, 10).add(Aspect.WATER, 10); - private static final AspectList costTainturgist = new AspectList().add(Aspect.EARTH, 10).add(Aspect.WATER, 10).add(Aspect.ORDER, 10); + public static FocusUpgradeType tainturgy = new FocusUpgradeType( + 55, + new ResourceLocation("taintedmagic", "textures/foci/IconTainturgy.png"), + "focus.upgrade.tainturgy.name", + "focus.upgrade.tainturgy.text", + new AspectList().add(Aspect.TAINT, 1).add(Aspect.HEAL, 1)); + public static FocusUpgradeType corrosive = new FocusUpgradeType( + 56, + 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)); + IIcon depthIcon = null; - public ItemFocusTaint () - { - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setUnlocalizedName("ItemFocusTaint"); - } + private static final AspectList costBase = new AspectList().add(Aspect.EARTH, 10).add(Aspect.WATER, 10); + private static final AspectList costTainturgist = new AspectList().add(Aspect.EARTH, 10).add(Aspect.WATER, 10) + .add(Aspect.ORDER, 10); - @SideOnly (Side.CLIENT) - public void registerIcons (IIconRegister ir) - { - this.icon = ir.registerIcon("taintedmagic:ItemFocusTaint"); - this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusTaint_depth"); - } + public ItemFocusTaint() { + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setUnlocalizedName("ItemFocusTaint"); + } - public IIcon getFocusDepthLayerIcon (ItemStack s) - { - return this.depthIcon; - } + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister ir) { + this.icon = ir.registerIcon("taintedmagic:ItemFocusTaint"); + this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusTaint_depth"); + } - public String getSortingHelper (ItemStack s) - { - return "TAINT" + super.getSortingHelper(s); - } + public IIcon getFocusDepthLayerIcon(ItemStack s) { + return this.depthIcon; + } - public int getFocusColor (ItemStack s) - { - return 8073200; - } + public String getSortingHelper(ItemStack s) { + return "TAINT" + super.getSortingHelper(s); + } - public AspectList getVisCost (ItemStack s) - { - return isUpgradedWith(s, tainturgy) ? costTainturgist : costBase; - } + public int getFocusColor(ItemStack s) { + return 8073200; + } - public int getActivationCooldown (ItemStack s) - { - return -1; - } + public AspectList getVisCost(ItemStack s) { + return isUpgradedWith(s, tainturgy) ? costTainturgist : costBase; + } - public boolean isVisCostPerTick (ItemStack s) - { - return true; - } + public int getActivationCooldown(ItemStack s) { + return -1; + } - public ItemFocusBasic.WandFocusAnimation getAnimation (ItemStack s) - { - return ItemFocusBasic.WandFocusAnimation.CHARGE; - } + public boolean isVisCostPerTick(ItemStack s) { + return true; + } - public ItemStack onFocusRightClick (ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop) - { - ItemWandCasting wand = (ItemWandCasting) s.getItem(); - p.setItemInUse(s, 2147483647); - WandManager.setCooldown(p, -1); - return s; - } + public ItemFocusBasic.WandFocusAnimation getAnimation(ItemStack s) { + return ItemFocusBasic.WandFocusAnimation.CHARGE; + } - public void onUsingFocusTick (ItemStack s, EntityPlayer p, int count) - { - ItemWandCasting wand = (ItemWandCasting) s.getItem(); - if (!wand.consumeAllVis(s, p, getVisCost(s), false, false)) - { - p.stopUsingItem(); - return; - } - int range = 8; - Vec3 vec3d = p.getLook(range); - if (!p.worldObj.isRemote && p.ticksExisted % 5 == 0) p.worldObj.playSoundAtEntity(p, "thaumcraft:bubble", 0.33F, 5.0F * (float) Math.random()); + public ItemStack onFocusRightClick(ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop) { + ItemWandCasting wand = (ItemWandCasting) s.getItem(); + p.setItemInUse(s, 2147483647); + WandManager.setCooldown(p, -1); + return s; + } - int potency = wand.getFocusPotency(s); - if ( (!p.worldObj.isRemote) && (wand.consumeAllVis(s, p, getVisCost(s), true, false))) - { - float scatter = isUpgradedWith(wand.getFocusItem(s), FocusUpgradeType.enlarge) ? 15.0F : 8.0F; - for (int a = 0; a < 2 + wand.getFocusPotency(s); a++) - { - EntityTaintBubble orb = new EntityTaintBubble(p.worldObj, p, scatter, isUpgradedWith(wand.getFocusItem(s), this.corrosive)); - orb.posX += orb.motionX; - orb.posY += orb.motionY; - orb.posZ += orb.motionZ; - orb.damage = 5F + potency; - p.worldObj.spawnEntityInWorld(orb); - if (!isUpgradedWith(wand.getFocusItem(s), tainturgy)) - { - Random rand = new Random(); - int randomInt = rand.nextInt(150); - if (randomInt == 9) - { - try - { - p.addPotionEffect(new PotionEffect(Config.potionVisExhaustID, 1000, 2)); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - } - } - } - } + public void onUsingFocusTick(ItemStack s, EntityPlayer p, int count) { + ItemWandCasting wand = (ItemWandCasting) s.getItem(); + if (!wand.consumeAllVis(s, p, getVisCost(s), false, false)) { + p.stopUsingItem(); + return; + } + int range = 8; + Vec3 vec3d = p.getLook(range); + if (!p.worldObj.isRemote && p.ticksExisted % 5 == 0) + p.worldObj.playSoundAtEntity(p, "thaumcraft:bubble", 0.33F, 5.0F * (float) Math.random()); - public FocusUpgradeType[] getPossibleUpgradesByRank (ItemStack s, int rank) - { - switch (rank) - { - case 1 : - return new FocusUpgradeType[]{ - FocusUpgradeType.frugal, - FocusUpgradeType.potency }; - case 2 : - return new FocusUpgradeType[]{ - FocusUpgradeType.frugal, - FocusUpgradeType.potency }; - case 3 : - return new FocusUpgradeType[]{ - FocusUpgradeType.frugal, - FocusUpgradeType.potency, - tainturgy }; - case 4 : - return new FocusUpgradeType[]{ - FocusUpgradeType.frugal, - FocusUpgradeType.potency, - FocusUpgradeType.enlarge }; - case 5 : - return new FocusUpgradeType[]{ - FocusUpgradeType.frugal, - FocusUpgradeType.potency, - corrosive }; - } - return null; - } + int potency = wand.getFocusPotency(s); + if ((!p.worldObj.isRemote) && (wand.consumeAllVis(s, p, getVisCost(s), true, false))) { + float scatter = isUpgradedWith(wand.getFocusItem(s), FocusUpgradeType.enlarge) ? 15.0F : 8.0F; + for (int a = 0; a < 2 + wand.getFocusPotency(s); a++) { + EntityTaintBubble orb = new EntityTaintBubble( + p.worldObj, + p, + scatter, + isUpgradedWith(wand.getFocusItem(s), this.corrosive)); + orb.posX += orb.motionX; + orb.posY += orb.motionY; + orb.posZ += orb.motionZ; + orb.damage = 5F + potency; + p.worldObj.spawnEntityInWorld(orb); + if (!isUpgradedWith(wand.getFocusItem(s), tainturgy)) { + Random rand = new Random(); + int randomInt = rand.nextInt(150); + if (randomInt == 9) { + try { + p.addPotionEffect(new PotionEffect(Config.potionVisExhaustID, 1000, 2)); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + } + } + } + + public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack s, int rank) { + switch (rank) { + case 1: + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency }; + case 2: + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency }; + case 3: + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency, tainturgy }; + case 4: + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency, + FocusUpgradeType.enlarge }; + case 5: + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency, corrosive }; + } + return null; + } } diff --git a/src/main/java/taintedmagic/common/items/wand/foci/ItemFocusTaintedBlast.java b/src/main/java/taintedmagic/common/items/wand/foci/ItemFocusTaintedBlast.java index 63fb5fb..439f699 100644 --- a/src/main/java/taintedmagic/common/items/wand/foci/ItemFocusTaintedBlast.java +++ b/src/main/java/taintedmagic/common/items/wand/foci/ItemFocusTaintedBlast.java @@ -13,6 +13,7 @@ import net.minecraft.util.IIcon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.StatCollector; import net.minecraft.world.World; + import taintedmagic.common.TaintedMagic; import taintedmagic.common.helper.TaintedMagicHelper; import thaumcraft.api.aspects.Aspect; @@ -24,130 +25,115 @@ import thaumcraft.common.items.wands.ItemWandCasting; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class ItemFocusTaintedBlast extends ItemFocusBasic -{ - private static final AspectList costBase = new AspectList().add(Aspect.ENTROPY, 500).add(Aspect.EARTH, 500).add(Aspect.WATER, 500); +public class ItemFocusTaintedBlast extends ItemFocusBasic { - public static IIcon depthIcon; - public static IIcon ornIcon; + private static final AspectList costBase = new AspectList().add(Aspect.ENTROPY, 500).add(Aspect.EARTH, 500) + .add(Aspect.WATER, 500); - public ItemFocusTaintedBlast () - { - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setUnlocalizedName("ItemFocusTaintedBlast"); - } + public static IIcon depthIcon; + public static IIcon ornIcon; - @SideOnly (Side.CLIENT) - public void registerIcons (IIconRegister ir) - { - this.icon = ir.registerIcon("taintedmagic:ItemFocusTaintedBlast"); - this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusTaint_depth"); - this.ornIcon = ir.registerIcon("taintedmagic:ItemFocusTaintedBlast_orn"); - } + public ItemFocusTaintedBlast() { + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setUnlocalizedName("ItemFocusTaintedBlast"); + } - public IIcon getFocusDepthLayerIcon (ItemStack s) - { - return this.depthIcon; - } + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister ir) { + this.icon = ir.registerIcon("taintedmagic:ItemFocusTaintedBlast"); + this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusTaint_depth"); + this.ornIcon = ir.registerIcon("taintedmagic:ItemFocusTaintedBlast_orn"); + } - public IIcon getOrnament (ItemStack s) - { - return this.ornIcon; - } + public IIcon getFocusDepthLayerIcon(ItemStack s) { + return this.depthIcon; + } - public String getSortingHelper (ItemStack s) - { - return "SHOCKWAVE" + super.getSortingHelper(s); - } + public IIcon getOrnament(ItemStack s) { + return this.ornIcon; + } - public int getFocusColor (ItemStack s) - { - return 13107455; - } + public String getSortingHelper(ItemStack s) { + return "SHOCKWAVE" + super.getSortingHelper(s); + } - public AspectList getVisCost (ItemStack s) - { - return costBase; - } + public int getFocusColor(ItemStack s) { + return 13107455; + } - public int getActivationCooldown (ItemStack s) - { - return 15000; - } + public AspectList getVisCost(ItemStack s) { + return costBase; + } - public boolean isVisCostPerTick (ItemStack s) - { - return false; - } + public int getActivationCooldown(ItemStack s) { + return 15000; + } - public ItemFocusBasic.WandFocusAnimation getAnimation (ItemStack s) - { - return ItemFocusBasic.WandFocusAnimation.WAVE; - } + public boolean isVisCostPerTick(ItemStack s) { + return false; + } - @Override - public void addInformation (ItemStack s, EntityPlayer p, List l, boolean b) - { - super.addInformation(s, p, l, b); - l.add(" "); - l.add(EnumChatFormatting.BLUE + "+" + new String(this.isUpgradedWith(s, FocusUpgradeType.enlarge) ? Integer.toString(15 + this.getUpgradeLevel(s, FocusUpgradeType.enlarge)) : "15") + " " + StatCollector.translateToLocal("text.radius")); - } + public ItemFocusBasic.WandFocusAnimation getAnimation(ItemStack s) { + return ItemFocusBasic.WandFocusAnimation.WAVE; + } - public ItemStack onFocusRightClick (ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop) - { - ItemWandCasting wand = (ItemWandCasting) s.getItem(); + @Override + public void addInformation(ItemStack s, EntityPlayer p, List l, boolean b) { + super.addInformation(s, p, l, b); + l.add(" "); + l.add( + EnumChatFormatting.BLUE + "+" + + new String( + this.isUpgradedWith(s, FocusUpgradeType.enlarge) + ? Integer.toString(15 + this.getUpgradeLevel(s, FocusUpgradeType.enlarge)) + : "15") + + " " + + StatCollector.translateToLocal("text.radius")); + } - int pot = wand.getFocusPotency(s); - if (wand.consumeAllVis(s, p, getVisCost(s), true, false)) - { - List ents = w.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(p.posX, p.posY, p.posZ, p.posX + 1, p.posY + 1, p.posZ + 1).expand(15.0D + this.getUpgradeLevel(s, FocusUpgradeType.enlarge), 15.0D + this.getUpgradeLevel(s, FocusUpgradeType.enlarge), 15.0D + this.getUpgradeLevel(s, FocusUpgradeType.enlarge))); - if (ents != null && ents.size() > 0) - { - for (int a = 0; a < ents.size(); a++) - { - EntityLivingBase e = ents.get(a); + public ItemStack onFocusRightClick(ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop) { + ItemWandCasting wand = (ItemWandCasting) s.getItem(); - if (e != p && e.isEntityAlive() && !e.isEntityInvulnerable()) - { - double dist = TaintedMagicHelper.getDistanceTo(e.posX, e.posY, e.posZ, p); - if (dist < 7.0D) e.attackEntityFrom(DamageSource.magic, 2.0F); - Vector3 movement = TaintedMagicHelper.getDistanceBetween(e, p); - e.addVelocity(movement.x * 3, 0.8, movement.z * 3); - } - } - } - w.playSoundAtEntity(p, "taintedmagic:shockwave", 5.0F, 1.0F * (float) Math.random()); - TaintedMagic.proxy.spawnShockwaveParticles(p.worldObj); - return s; - } - return null; - } + int pot = wand.getFocusPotency(s); + if (wand.consumeAllVis(s, p, getVisCost(s), true, false)) { + List ents = w.getEntitiesWithinAABB( + EntityLivingBase.class, + AxisAlignedBB.getBoundingBox(p.posX, p.posY, p.posZ, p.posX + 1, p.posY + 1, p.posZ + 1).expand( + 15.0D + this.getUpgradeLevel(s, FocusUpgradeType.enlarge), + 15.0D + this.getUpgradeLevel(s, FocusUpgradeType.enlarge), + 15.0D + this.getUpgradeLevel(s, FocusUpgradeType.enlarge))); + if (ents != null && ents.size() > 0) { + for (int a = 0; a < ents.size(); a++) { + EntityLivingBase e = ents.get(a); - public FocusUpgradeType[] getPossibleUpgradesByRank (ItemStack s, int rank) - { - switch (rank) - { - case 1 : - return new FocusUpgradeType[]{ - FocusUpgradeType.frugal, - FocusUpgradeType.enlarge }; - case 2 : - return new FocusUpgradeType[]{ - FocusUpgradeType.frugal, - FocusUpgradeType.enlarge }; - case 3 : - return new FocusUpgradeType[]{ - FocusUpgradeType.frugal, - FocusUpgradeType.enlarge }; - case 4 : - return new FocusUpgradeType[]{ - FocusUpgradeType.frugal, - FocusUpgradeType.enlarge }; - case 5 : - return new FocusUpgradeType[]{ - FocusUpgradeType.frugal, - FocusUpgradeType.enlarge }; - } - return null; - } + if (e != p && e.isEntityAlive() && !e.isEntityInvulnerable()) { + double dist = TaintedMagicHelper.getDistanceTo(e.posX, e.posY, e.posZ, p); + if (dist < 7.0D) e.attackEntityFrom(DamageSource.magic, 2.0F); + Vector3 movement = TaintedMagicHelper.getDistanceBetween(e, p); + e.addVelocity(movement.x * 3, 0.8, movement.z * 3); + } + } + } + w.playSoundAtEntity(p, "taintedmagic:shockwave", 5.0F, 1.0F * (float) Math.random()); + TaintedMagic.proxy.spawnShockwaveParticles(p.worldObj); + return s; + } + return null; + } + + public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack s, int rank) { + switch (rank) { + case 1: + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.enlarge }; + case 2: + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.enlarge }; + case 3: + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.enlarge }; + case 4: + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.enlarge }; + case 5: + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.enlarge }; + } + return null; + } } diff --git a/src/main/java/taintedmagic/common/items/wand/foci/ItemFocusTime.java b/src/main/java/taintedmagic/common/items/wand/foci/ItemFocusTime.java index 5cb8580..465e35e 100644 --- a/src/main/java/taintedmagic/common/items/wand/foci/ItemFocusTime.java +++ b/src/main/java/taintedmagic/common/items/wand/foci/ItemFocusTime.java @@ -9,6 +9,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; + import taintedmagic.common.TaintedMagic; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; @@ -18,84 +19,73 @@ import thaumcraft.common.items.wands.WandManager; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class ItemFocusTime extends ItemFocusBasic -{ - IIcon depthIcon = null; +public class ItemFocusTime extends ItemFocusBasic { - private static final AspectList costBase = new AspectList().add(Aspect.AIR, 1000).add(Aspect.WATER, 1000).add(Aspect.FIRE, 1000).add(Aspect.EARTH, 1000).add(Aspect.ORDER, 1000).add(Aspect.ENTROPY, 1000); + IIcon depthIcon = null; - public ItemFocusTime () - { - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setUnlocalizedName("ItemFocusTime"); - } + private static final AspectList costBase = new AspectList().add(Aspect.AIR, 1000).add(Aspect.WATER, 1000) + .add(Aspect.FIRE, 1000).add(Aspect.EARTH, 1000).add(Aspect.ORDER, 1000).add(Aspect.ENTROPY, 1000); - @SideOnly (Side.CLIENT) - public void registerIcons (IIconRegister ir) - { - this.icon = ir.registerIcon("taintedmagic:ItemFocusTime"); - this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusMeteorology_depth"); - } + public ItemFocusTime() { + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setUnlocalizedName("ItemFocusTime"); + } - public IIcon getFocusDepthLayerIcon (ItemStack s) - { - return this.depthIcon; - } + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister ir) { + this.icon = ir.registerIcon("taintedmagic:ItemFocusTime"); + this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusMeteorology_depth"); + } - public String getSortingHelper (ItemStack s) - { - return "TIME" + super.getSortingHelper(s); - } + public IIcon getFocusDepthLayerIcon(ItemStack s) { + return this.depthIcon; + } - public int getFocusColor (ItemStack s) - { - EntityPlayer player = TaintedMagic.proxy.getClientPlayer(); - return player == null ? 0xFFFFFF : Color.HSBtoRGB(player.ticksExisted * 16 % 360 / 360F, 1F, 1F); - } + public String getSortingHelper(ItemStack s) { + return "TIME" + super.getSortingHelper(s); + } - public AspectList getVisCost (ItemStack s) - { - return new AspectList().add(Aspect.AIR, 1000).add(Aspect.WATER, 1000).add(Aspect.FIRE, 1000).add(Aspect.EARTH, 1000).add(Aspect.ORDER, 1000).add(Aspect.ENTROPY, 1000); - } + public int getFocusColor(ItemStack s) { + EntityPlayer player = TaintedMagic.proxy.getClientPlayer(); + return player == null ? 0xFFFFFF : Color.HSBtoRGB(player.ticksExisted * 16 % 360 / 360F, 1F, 1F); + } - public int getActivationCooldown (ItemStack s) - { - return 1; - } + public AspectList getVisCost(ItemStack s) { + return new AspectList().add(Aspect.AIR, 1000).add(Aspect.WATER, 1000).add(Aspect.FIRE, 1000) + .add(Aspect.EARTH, 1000).add(Aspect.ORDER, 1000).add(Aspect.ENTROPY, 1000); + } - public boolean isVisCostPerTick (ItemStack s) - { - return false; - } + public int getActivationCooldown(ItemStack s) { + return 1; + } - public ItemFocusBasic.WandFocusAnimation getAnimation (ItemStack s) - { - return ItemFocusBasic.WandFocusAnimation.WAVE; - } + public boolean isVisCostPerTick(ItemStack s) { + return false; + } - public ItemStack onFocusRightClick (ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop) - { - WandManager.setCooldown(p, 30000); - ItemWandCasting wand = (ItemWandCasting) s.getItem(); + public ItemFocusBasic.WandFocusAnimation getAnimation(ItemStack s) { + return ItemFocusBasic.WandFocusAnimation.WAVE; + } - if (wand.consumeAllVis(s, p, getVisCost(s), true, false)) - { - w.setWorldTime(w.isDaytime() ? 14000 : 0); - p.playSound("thaumcraft:wand", 0.5F, 1.0F); - } - return s; - } + public ItemStack onFocusRightClick(ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop) { + WandManager.setCooldown(p, 30000); + ItemWandCasting wand = (ItemWandCasting) s.getItem(); - @Override - public int getColorFromItemStack (ItemStack s, int i) - { - EntityPlayer p = TaintedMagic.proxy.getClientPlayer(); - return p == null ? 0xFFFFFF : Color.HSBtoRGB(p.ticksExisted * 16 % 360 / 360F, 1F, 1F); - } + if (wand.consumeAllVis(s, p, getVisCost(s), true, false)) { + w.setWorldTime(w.isDaytime() ? 14000 : 0); + p.playSound("thaumcraft:wand", 0.5F, 1.0F); + } + return s; + } - @SideOnly (Side.CLIENT) - public EnumRarity getRarity (ItemStack s) - { - return TaintedMagic.rarityCreation; - } + @Override + public int getColorFromItemStack(ItemStack s, int i) { + EntityPlayer p = TaintedMagic.proxy.getClientPlayer(); + return p == null ? 0xFFFFFF : Color.HSBtoRGB(p.ticksExisted * 16 % 360 / 360F, 1F, 1F); + } + + @SideOnly(Side.CLIENT) + public EnumRarity getRarity(ItemStack s) { + return TaintedMagic.rarityCreation; + } } diff --git a/src/main/java/taintedmagic/common/items/wand/foci/ItemFocusVisShard.java b/src/main/java/taintedmagic/common/items/wand/foci/ItemFocusVisShard.java index a1bc878..5aa85de 100644 --- a/src/main/java/taintedmagic/common/items/wand/foci/ItemFocusVisShard.java +++ b/src/main/java/taintedmagic/common/items/wand/foci/ItemFocusVisShard.java @@ -1,7 +1,5 @@ package taintedmagic.common.items.wand.foci; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -10,6 +8,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; + import taintedmagic.common.TaintedMagic; import taintedmagic.common.entities.EntityHomingShard; import thaumcraft.api.aspects.Aspect; @@ -18,99 +17,89 @@ import thaumcraft.api.wands.FocusUpgradeType; import thaumcraft.api.wands.ItemFocusBasic; import thaumcraft.common.items.wands.ItemWandCasting; import thaumcraft.common.lib.utils.EntityUtils; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; /** - * this class is based off of ItemFocusShard.class created by as part - * of Thaumcraft 5 + * this class is based off of ItemFocusShard.class created by as part of Thaumcraft 5 */ -public class ItemFocusVisShard extends ItemFocusBasic -{ - private static final AspectList cost = new AspectList().add(Aspect.FIRE, 1).add(Aspect.ENTROPY, 1).add(Aspect.AIR, 1); - private static final AspectList costPersistant = new AspectList().add(Aspect.FIRE, 1).add(Aspect.ENTROPY, 1).add(Aspect.WATER, 1).add(Aspect.AIR, 1); +public class ItemFocusVisShard extends ItemFocusBasic { - public static FocusUpgradeType persistant = new FocusUpgradeType(69, new ResourceLocation("taintedmagic:textures/foci/IconPersistant.png"), "focus.upgrade.persistant.name", "focus.upgrade.persistant.text", new AspectList().add(Aspect.ARMOR, 1).add(Aspect.MOTION, 1).add(Aspect.ENERGY, 1)); + private static final AspectList cost = new AspectList().add(Aspect.FIRE, 1).add(Aspect.ENTROPY, 1) + .add(Aspect.AIR, 1); + private static final AspectList costPersistant = new AspectList().add(Aspect.FIRE, 1).add(Aspect.ENTROPY, 1) + .add(Aspect.WATER, 1).add(Aspect.AIR, 1); - public ItemFocusVisShard () - { - this.setCreativeTab(TaintedMagic.tabTaintedMagic); - this.setUnlocalizedName("ItemFocusVisShard"); - } + public static FocusUpgradeType persistant = new FocusUpgradeType( + 69, + new ResourceLocation("taintedmagic:textures/foci/IconPersistant.png"), + "focus.upgrade.persistant.name", + "focus.upgrade.persistant.text", + new AspectList().add(Aspect.ARMOR, 1).add(Aspect.MOTION, 1).add(Aspect.ENERGY, 1)); - @SideOnly (Side.CLIENT) - public void registerIcons (IIconRegister ir) - { - this.icon = ir.registerIcon("taintedmagic:ItemFocusVisShard"); - } + public ItemFocusVisShard() { + this.setCreativeTab(TaintedMagic.tabTaintedMagic); + this.setUnlocalizedName("ItemFocusVisShard"); + } - public String getSortingHelper (ItemStack s) - { - return "SHARD" + super.getSortingHelper(s); - } + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister ir) { + this.icon = ir.registerIcon("taintedmagic:ItemFocusVisShard"); + } - public int getFocusColor (ItemStack s) - { - return 10037693; - } + public String getSortingHelper(ItemStack s) { + return "SHARD" + super.getSortingHelper(s); + } - public int getActivationCooldown (ItemStack s) - { - return 300; - } + public int getFocusColor(ItemStack s) { + return 10037693; + } - public ItemFocusBasic.WandFocusAnimation getAnimation (ItemStack s) - { - return ItemFocusBasic.WandFocusAnimation.WAVE; - } + public int getActivationCooldown(ItemStack s) { + return 300; + } - public ItemStack onFocusRightClick (ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop) - { - ItemWandCasting wand = (ItemWandCasting) s.getItem(); + public ItemFocusBasic.WandFocusAnimation getAnimation(ItemStack s) { + return ItemFocusBasic.WandFocusAnimation.WAVE; + } - Entity look = EntityUtils.getPointedEntity(p.worldObj, p, 0.0D, 32.0D, 1.1F); - if (look != null && look instanceof EntityLivingBase) - { - if (!w.isRemote) - { - EntityHomingShard blast = new EntityHomingShard(w, p, (EntityLivingBase) look, wand.getFocusPotency(s), isUpgradedWith(wand.getFocusItem(s), persistant)); - w.spawnEntityInWorld(blast); - w.playSoundAtEntity(blast, "taintedmagic:shard", 0.3F, 1.1F + w.rand.nextFloat() * 0.1F); - } - p.swingItem(); - } - return s; - } + public ItemStack onFocusRightClick(ItemStack s, World w, EntityPlayer p, MovingObjectPosition mop) { + ItemWandCasting wand = (ItemWandCasting) s.getItem(); - public AspectList getVisCost (ItemStack s) - { - return isUpgradedWith(s, persistant) ? costPersistant : cost; - } + Entity look = EntityUtils.getPointedEntity(p.worldObj, p, 0.0D, 32.0D, 1.1F); + if (look != null && look instanceof EntityLivingBase) { + if (!w.isRemote) { + EntityHomingShard blast = new EntityHomingShard( + w, + p, + (EntityLivingBase) look, + wand.getFocusPotency(s), + isUpgradedWith(wand.getFocusItem(s), persistant)); + w.spawnEntityInWorld(blast); + w.playSoundAtEntity(blast, "taintedmagic:shard", 0.3F, 1.1F + w.rand.nextFloat() * 0.1F); + } + p.swingItem(); + } + return s; + } - public FocusUpgradeType[] getPossibleUpgradesByRank (ItemStack s, int r) - { - switch (r) - { - case 1 : - return new FocusUpgradeType[]{ - FocusUpgradeType.frugal, - FocusUpgradeType.potency }; - case 2 : - return new FocusUpgradeType[]{ - FocusUpgradeType.frugal, - FocusUpgradeType.potency }; - case 3 : - return new FocusUpgradeType[]{ - FocusUpgradeType.frugal, - FocusUpgradeType.potency }; - case 4 : - return new FocusUpgradeType[]{ - FocusUpgradeType.frugal, - FocusUpgradeType.potency }; - case 5 : - return new FocusUpgradeType[]{ - FocusUpgradeType.frugal, - FocusUpgradeType.potency, - persistant }; - } - return null; - } + public AspectList getVisCost(ItemStack s) { + return isUpgradedWith(s, persistant) ? costPersistant : cost; + } + + public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack s, int r) { + switch (r) { + case 1: + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency }; + case 2: + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency }; + case 3: + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency }; + case 4: + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency }; + case 5: + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency, persistant }; + } + return null; + } } diff --git a/src/main/java/taintedmagic/common/lib/LibCreativeTab.java b/src/main/java/taintedmagic/common/lib/LibCreativeTab.java index dcfd4d8..420f2a2 100644 --- a/src/main/java/taintedmagic/common/lib/LibCreativeTab.java +++ b/src/main/java/taintedmagic/common/lib/LibCreativeTab.java @@ -6,59 +6,55 @@ import java.util.List; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import taintedmagic.common.TaintedMagic; + import taintedmagic.common.helper.TaintedMagicHelper; import taintedmagic.common.registry.ItemRegistry; import thaumcraft.common.config.ConfigItems; import thaumcraft.common.items.wands.ItemWandCasting; -public class LibCreativeTab extends CreativeTabs -{ - public List list = new ArrayList(); +public class LibCreativeTab extends CreativeTabs { - public LibCreativeTab () - { - super(LibStrings.MODID); - } + public List list = new ArrayList(); - @Override - public void displayAllReleventItems (List l) - { - super.displayAllReleventItems(l); - ItemStack wand = new ItemStack(ConfigItems.itemWandCasting); - ItemWandCasting wand2 = (ItemWandCasting) wand.getItem(); + public LibCreativeTab() { + super(LibStrings.MODID); + } - wand2.setCap(wand, ItemRegistry.WAND_CAP_SHADOWMETAL); - wand2.setRod(wand, ItemRegistry.STAFF_ROD_WARPWOOD); - wand2.storeAllVis(wand, TaintedMagicHelper.getPrimals(50000)); + @Override + public void displayAllReleventItems(List l) { + super.displayAllReleventItems(l); + ItemStack wand = new ItemStack(ConfigItems.itemWandCasting); + ItemWandCasting wand2 = (ItemWandCasting) wand.getItem(); - if (l != null) l.add(0, wand); + wand2.setCap(wand, ItemRegistry.WAND_CAP_SHADOWMETAL); + wand2.setRod(wand, ItemRegistry.STAFF_ROD_WARPWOOD); + wand2.storeAllVis(wand, TaintedMagicHelper.getPrimals(50000)); - ItemStack wand3 = new ItemStack(ConfigItems.itemWandCasting); - ItemWandCasting wand4 = (ItemWandCasting) wand.getItem(); + if (l != null) l.add(0, wand); - wand4.setCap(wand3, ItemRegistry.WAND_CAP_SHADOWMETAL); - wand4.setRod(wand3, ItemRegistry.WAND_ROD_WARPWOOD); - wand4.storeAllVis(wand3, TaintedMagicHelper.getPrimals(25000)); + ItemStack wand3 = new ItemStack(ConfigItems.itemWandCasting); + ItemWandCasting wand4 = (ItemWandCasting) wand.getItem(); - if (l != null) l.add(1, wand3); - } + wand4.setCap(wand3, ItemRegistry.WAND_CAP_SHADOWMETAL); + wand4.setRod(wand3, ItemRegistry.WAND_ROD_WARPWOOD); + wand4.storeAllVis(wand3, TaintedMagicHelper.getPrimals(25000)); - @Override - public ItemStack getIconItemStack () - { - ItemStack wand = new ItemStack(ConfigItems.itemWandCasting); - ItemWandCasting wand2 = (ItemWandCasting) wand.getItem(); + if (l != null) l.add(1, wand3); + } - wand2.setCap(wand, ItemRegistry.WAND_CAP_SHADOWMETAL); - wand2.setRod(wand, ItemRegistry.WAND_ROD_WARPWOOD); + @Override + public ItemStack getIconItemStack() { + ItemStack wand = new ItemStack(ConfigItems.itemWandCasting); + ItemWandCasting wand2 = (ItemWandCasting) wand.getItem(); - return wand; - } + wand2.setCap(wand, ItemRegistry.WAND_CAP_SHADOWMETAL); + wand2.setRod(wand, ItemRegistry.WAND_ROD_WARPWOOD); - @Override - public Item getTabIconItem () - { - return null; - } + return wand; + } + + @Override + public Item getTabIconItem() { + return null; + } } diff --git a/src/main/java/taintedmagic/common/lib/LibStrings.java b/src/main/java/taintedmagic/common/lib/LibStrings.java index 0793cb2..ae22ebc 100644 --- a/src/main/java/taintedmagic/common/lib/LibStrings.java +++ b/src/main/java/taintedmagic/common/lib/LibStrings.java @@ -1,9 +1,9 @@ package taintedmagic.common.lib; -public class LibStrings -{ - public static final String MODID = "TaintedMagic"; - public static final String NAME = "Tainted Magic"; - public static final String VERSION = "r7.6"; - public static final String DEPENDENCIES = "required-after:Forge@[10.13.2.1291,);required-after:Thaumcraft@[4.2.3.5,);after:ThaumicTinkerer"; +public class LibStrings { + + public static final String MODID = "TaintedMagic"; + public static final String NAME = "Tainted Magic"; + public static final String VERSION = "r7.6"; + public static final String DEPENDENCIES = "required-after:Forge@[10.13.2.1291,);required-after:Thaumcraft@[4.2.3.5,);after:ThaumicTinkerer"; } diff --git a/src/main/java/taintedmagic/common/lib/LibToolMaterials.java b/src/main/java/taintedmagic/common/lib/LibToolMaterials.java index 6850aac..d22298f 100644 --- a/src/main/java/taintedmagic/common/lib/LibToolMaterials.java +++ b/src/main/java/taintedmagic/common/lib/LibToolMaterials.java @@ -4,31 +4,19 @@ import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraftforge.common.util.EnumHelper; -public class LibToolMaterials -{ - public static ToolMaterial toolMatCrystal = EnumHelper.addToolMaterial("CRYSTAL", 3, 2000, 16.0F, 2.0F, 30); - public static ToolMaterial toolMatShadow = EnumHelper.addToolMaterial("SHADOW", 3, 2200, 17.0F, 6.0F, 30); - public static ToolMaterial toolMatPrimal = EnumHelper.addToolMaterial("PRIMAL", 3, 512, 16.0F, 14.5F, 28); +public class LibToolMaterials { - public static ArmorMaterial armorMatShadow = EnumHelper.addArmorMaterial("SHADOW", 800, new int[]{ - 4, - 8, - 6, - 2 }, 25); - public static ArmorMaterial armorMatSpecial = EnumHelper.addArmorMaterial("SPECIAL", 500, new int[]{ - 4, - 6, - 6, - 4 }, 25); - public static ArmorMaterial armorMatVoidFortress = EnumHelper.addArmorMaterial("VOIDFORTRESS", 300, new int[]{ - 4, - 8, - 6, - 0 }, 20); + public static ToolMaterial toolMatCrystal = EnumHelper.addToolMaterial("CRYSTAL", 3, 2000, 16.0F, 2.0F, 30); + public static ToolMaterial toolMatShadow = EnumHelper.addToolMaterial("SHADOW", 3, 2200, 17.0F, 6.0F, 30); + public static ToolMaterial toolMatPrimal = EnumHelper.addToolMaterial("PRIMAL", 3, 512, 16.0F, 14.5F, 28); - public static ArmorMaterial armorMatShadowFortress = EnumHelper.addArmorMaterial("SHADOWFORTRESS", 2500, new int[]{ - 4, - 10, - 6, - 0 }, 30); + public static ArmorMaterial armorMatShadow = EnumHelper + .addArmorMaterial("SHADOW", 800, new int[] { 4, 8, 6, 2 }, 25); + public static ArmorMaterial armorMatSpecial = EnumHelper + .addArmorMaterial("SPECIAL", 500, new int[] { 4, 6, 6, 4 }, 25); + public static ArmorMaterial armorMatVoidFortress = EnumHelper + .addArmorMaterial("VOIDFORTRESS", 300, new int[] { 4, 8, 6, 0 }, 20); + + public static ArmorMaterial armorMatShadowFortress = EnumHelper + .addArmorMaterial("SHADOWFORTRESS", 2500, new int[] { 4, 10, 6, 0 }, 30); } diff --git a/src/main/java/taintedmagic/common/network/PacketHandler.java b/src/main/java/taintedmagic/common/network/PacketHandler.java index d55bce3..c2f388b 100644 --- a/src/main/java/taintedmagic/common/network/PacketHandler.java +++ b/src/main/java/taintedmagic/common/network/PacketHandler.java @@ -5,13 +5,13 @@ import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; import cpw.mods.fml.relauncher.Side; -public class PacketHandler -{ - public static final SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel(LibStrings.MODID.toLowerCase()); +public class PacketHandler { - public static void init () - { - int i = 0; - INSTANCE.registerMessage(PacketKatanaAttack.class, PacketKatanaAttack.class, i++, Side.SERVER); - } + public static final SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE + .newSimpleChannel(LibStrings.MODID.toLowerCase()); + + public static void init() { + int i = 0; + INSTANCE.registerMessage(PacketKatanaAttack.class, PacketKatanaAttack.class, i++, Side.SERVER); + } } diff --git a/src/main/java/taintedmagic/common/network/PacketKatanaAttack.java b/src/main/java/taintedmagic/common/network/PacketKatanaAttack.java index 41a2ebf..d6f0ae6 100644 --- a/src/main/java/taintedmagic/common/network/PacketKatanaAttack.java +++ b/src/main/java/taintedmagic/common/network/PacketKatanaAttack.java @@ -1,74 +1,69 @@ package taintedmagic.common.network; -import io.netty.buffer.ByteBuf; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.DamageSource; import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; + import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import io.netty.buffer.ByteBuf; -public class PacketKatanaAttack implements IMessage, IMessageHandler -{ - private int entityID; - private int playerID; - private int dimensionID; - private float dmg; - private boolean leech; +public class PacketKatanaAttack implements IMessage, IMessageHandler { - public PacketKatanaAttack () - { - } + private int entityID; + private int playerID; + private int dimensionID; + private float dmg; + private boolean leech; - 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() {} - @Override - public IMessage onMessage (PacketKatanaAttack message, MessageContext ctx) - { - World w = DimensionManager.getWorld(message.dimensionID); - if (w == null) return null; + 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; + } - Entity e = w.getEntityByID(message.entityID); - Entity p = w.getEntityByID(message.playerID); + @Override + public IMessage onMessage(PacketKatanaAttack message, MessageContext ctx) { + World w = DimensionManager.getWorld(message.dimensionID); + if (w == null) return null; - if (e != null && e instanceof EntityLivingBase && p != null && p instanceof EntityPlayer) e.attackEntityFrom(DamageSource.causeIndirectMagicDamage(p, e), message.dmg); + Entity e = w.getEntityByID(message.entityID); + Entity p = w.getEntityByID(message.playerID); - if (message.leech && p instanceof EntityPlayer) - { - ((EntityPlayer) p).heal(message.dmg * 0.25F); - w.playSoundAtEntity(p, "thaumcraft:wand", 0.5F, 0.5F + ((float) Math.random() * 0.5F)); - } + if (e != null && e instanceof EntityLivingBase && p != null && p instanceof EntityPlayer) + e.attackEntityFrom(DamageSource.causeIndirectMagicDamage(p, e), message.dmg); - return null; - } + if (message.leech && p instanceof EntityPlayer) { + ((EntityPlayer) p).heal(message.dmg * 0.25F); + w.playSoundAtEntity(p, "thaumcraft:wand", 0.5F, 0.5F + ((float) Math.random() * 0.5F)); + } - @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(); - } + return null; + } - @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 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); + } } diff --git a/src/main/java/taintedmagic/common/registry/BlockRegistry.java b/src/main/java/taintedmagic/common/registry/BlockRegistry.java index dd72e52..d91bb4b 100644 --- a/src/main/java/taintedmagic/common/registry/BlockRegistry.java +++ b/src/main/java/taintedmagic/common/registry/BlockRegistry.java @@ -1,6 +1,7 @@ package taintedmagic.common.registry; import net.minecraft.block.Block; + import taintedmagic.common.blocks.BlockShadowOre; import taintedmagic.common.blocks.BlockShadowmetal; import taintedmagic.common.blocks.BlockWarpwoodLeaves; @@ -11,39 +12,38 @@ import taintedmagic.common.items.blocks.ItemBlockShadowOre; import taintedmagic.common.items.blocks.ItemBlockWarpwoodSapling; import cpw.mods.fml.common.registry.GameRegistry; -public class BlockRegistry -{ - public static void init () - { - // Shadow Ore - BlockShadowOre = new BlockShadowOre(); - GameRegistry.registerBlock(BlockShadowOre, ItemBlockShadowOre.class, "BlockShadowOre"); +public class BlockRegistry { - // Warpwood Log - BlockWarpwoodLog = new BlockWarpwoodLog(); - GameRegistry.registerBlock(BlockWarpwoodLog, "BlockWarpwoodLog"); + public static void init() { + // Shadow Ore + BlockShadowOre = new BlockShadowOre(); + GameRegistry.registerBlock(BlockShadowOre, ItemBlockShadowOre.class, "BlockShadowOre"); - // Block of Shadowmetal - BlockShadowmetal = new BlockShadowmetal(); - GameRegistry.registerBlock(BlockShadowmetal, "BlockShadowmetal"); + // Warpwood Log + BlockWarpwoodLog = new BlockWarpwoodLog(); + GameRegistry.registerBlock(BlockWarpwoodLog, "BlockWarpwoodLog"); - // Warpwood Planks - BlockWarpwoodPlanks = new BlockWarpwoodPlanks(); - GameRegistry.registerBlock(BlockWarpwoodPlanks, "BlockWarpwoodPlanks"); + // Block of Shadowmetal + BlockShadowmetal = new BlockShadowmetal(); + GameRegistry.registerBlock(BlockShadowmetal, "BlockShadowmetal"); - // Warpwood Leaves - BlockWarpwoodLeaves = new BlockWarpwoodLeaves(); - GameRegistry.registerBlock(BlockWarpwoodLeaves, "BlockWarpwoodLeaves"); + // Warpwood Planks + BlockWarpwoodPlanks = new BlockWarpwoodPlanks(); + GameRegistry.registerBlock(BlockWarpwoodPlanks, "BlockWarpwoodPlanks"); - // Warpwood Sapling - BlockWarpwoodSapling = new BlockWarpwoodSapling(); - GameRegistry.registerBlock(BlockWarpwoodSapling, ItemBlockWarpwoodSapling.class, "BlockWarpwoodSapling"); - } + // Warpwood Leaves + BlockWarpwoodLeaves = new BlockWarpwoodLeaves(); + GameRegistry.registerBlock(BlockWarpwoodLeaves, "BlockWarpwoodLeaves"); - public static Block BlockShadowOre; - public static Block BlockWarpwoodLog; - public static Block BlockWarpwoodLeaves; - public static Block BlockWarpwoodSapling; - public static Block BlockShadowmetal; - public static Block BlockWarpwoodPlanks; -} \ No newline at end of file + // Warpwood Sapling + BlockWarpwoodSapling = new BlockWarpwoodSapling(); + GameRegistry.registerBlock(BlockWarpwoodSapling, ItemBlockWarpwoodSapling.class, "BlockWarpwoodSapling"); + } + + public static Block BlockShadowOre; + public static Block BlockWarpwoodLog; + public static Block BlockWarpwoodLeaves; + public static Block BlockWarpwoodSapling; + public static Block BlockShadowmetal; + public static Block BlockWarpwoodPlanks; +} diff --git a/src/main/java/taintedmagic/common/registry/ItemRegistry.java b/src/main/java/taintedmagic/common/registry/ItemRegistry.java index 4ba94f2..8a41b4e 100644 --- a/src/main/java/taintedmagic/common/registry/ItemRegistry.java +++ b/src/main/java/taintedmagic/common/registry/ItemRegistry.java @@ -9,6 +9,7 @@ import net.minecraft.item.ItemSpade; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemSword; import net.minecraft.util.ResourceLocation; + import taintedmagic.common.handler.WandUpdateHandler; import taintedmagic.common.items.ItemMagicFunguar; import taintedmagic.common.items.ItemMaterial; @@ -43,179 +44,200 @@ import thaumcraft.api.wands.WandCap; import thaumcraft.api.wands.WandRod; import cpw.mods.fml.common.registry.GameRegistry; -public class ItemRegistry -{ - public static void init () - { - ItemMaterial = new ItemMaterial(); - GameRegistry.registerItem(ItemMaterial, "ItemMaterial"); +public class ItemRegistry { - ItemVoidsentBlood = new ItemVoidsentBlood(); - GameRegistry.registerItem(ItemVoidsentBlood, "ItemVoidsentBlood"); + public static void init() { + ItemMaterial = new ItemMaterial(); + GameRegistry.registerItem(ItemMaterial, "ItemMaterial"); - ItemMagicFunguar = new ItemMagicFunguar(5, 1.0F, false); - GameRegistry.registerItem(ItemMagicFunguar, "ItemMagicFunguar"); + ItemVoidsentBlood = new ItemVoidsentBlood(); + GameRegistry.registerItem(ItemVoidsentBlood, "ItemVoidsentBlood"); - // Armor - ItemWarpedGoggles = new ItemWarpedGoggles(LibToolMaterials.armorMatSpecial, 4, 0); - GameRegistry.registerItem(ItemWarpedGoggles, "ItemWarpedGoggles"); + ItemMagicFunguar = new ItemMagicFunguar(5, 1.0F, false); + GameRegistry.registerItem(ItemMagicFunguar, "ItemMagicFunguar"); - ItemVoidFortressHelmet = new ItemVoidFortressArmor(LibToolMaterials.armorMatVoidFortress, 4, 0).setUnlocalizedName("ItemVoidFortressHelmet"); - GameRegistry.registerItem(ItemVoidFortressHelmet, "ItemVoidFortressHelmet"); + // Armor + ItemWarpedGoggles = new ItemWarpedGoggles(LibToolMaterials.armorMatSpecial, 4, 0); + GameRegistry.registerItem(ItemWarpedGoggles, "ItemWarpedGoggles"); - ItemVoidFortressChestplate = new ItemVoidFortressArmor(LibToolMaterials.armorMatVoidFortress, 4, 1).setUnlocalizedName("ItemVoidFortressChestplate"); - GameRegistry.registerItem(ItemVoidFortressChestplate, "ItemVoidFortressChestplate"); + ItemVoidFortressHelmet = new ItemVoidFortressArmor(LibToolMaterials.armorMatVoidFortress, 4, 0) + .setUnlocalizedName("ItemVoidFortressHelmet"); + GameRegistry.registerItem(ItemVoidFortressHelmet, "ItemVoidFortressHelmet"); - ItemVoidFortressLeggings = new ItemVoidFortressArmor(LibToolMaterials.armorMatVoidFortress, 4, 2).setUnlocalizedName("ItemVoidFortressLeggings"); - GameRegistry.registerItem(ItemVoidFortressLeggings, "ItemVoidFortressLeggings"); + ItemVoidFortressChestplate = new ItemVoidFortressArmor(LibToolMaterials.armorMatVoidFortress, 4, 1) + .setUnlocalizedName("ItemVoidFortressChestplate"); + GameRegistry.registerItem(ItemVoidFortressChestplate, "ItemVoidFortressChestplate"); - ItemVoidwalkerBoots = new ItemVoidwalkerBoots(LibToolMaterials.armorMatSpecial, 4, 3).setUnlocalizedName("ItemVoidwalkerBoots"); - GameRegistry.registerItem(ItemVoidwalkerBoots, "ItemVoidwalkerBoots"); + ItemVoidFortressLeggings = new ItemVoidFortressArmor(LibToolMaterials.armorMatVoidFortress, 4, 2) + .setUnlocalizedName("ItemVoidFortressLeggings"); + GameRegistry.registerItem(ItemVoidFortressLeggings, "ItemVoidFortressLeggings"); - ItemVoidwalkerSash = new ItemVoidwalkerSash(); - GameRegistry.registerItem(ItemVoidwalkerSash, "ItemVoidwalkerSash"); + ItemVoidwalkerBoots = new ItemVoidwalkerBoots(LibToolMaterials.armorMatSpecial, 4, 3) + .setUnlocalizedName("ItemVoidwalkerBoots"); + GameRegistry.registerItem(ItemVoidwalkerBoots, "ItemVoidwalkerBoots"); - ItemShadowFortressHelmet = new ItemShadowFortressArmor(LibToolMaterials.armorMatShadowFortress, 4, 0).setUnlocalizedName("ItemShadowFortressHelmet"); - GameRegistry.registerItem(ItemShadowFortressHelmet, "ItemShadowFortressHelmet"); + ItemVoidwalkerSash = new ItemVoidwalkerSash(); + GameRegistry.registerItem(ItemVoidwalkerSash, "ItemVoidwalkerSash"); - ItemShadowFortressChestplate = new ItemShadowFortressArmor(LibToolMaterials.armorMatShadowFortress, 4, 1).setUnlocalizedName("ItemShadowFortressChestplate"); - GameRegistry.registerItem(ItemShadowFortressChestplate, "ItemShadowFortressChestplate"); + ItemShadowFortressHelmet = new ItemShadowFortressArmor(LibToolMaterials.armorMatShadowFortress, 4, 0) + .setUnlocalizedName("ItemShadowFortressHelmet"); + GameRegistry.registerItem(ItemShadowFortressHelmet, "ItemShadowFortressHelmet"); - ItemShadowFortressLeggings = new ItemShadowFortressArmor(LibToolMaterials.armorMatShadowFortress, 4, 2).setUnlocalizedName("ItemShadowFortressLeggings"); - GameRegistry.registerItem(ItemShadowFortressLeggings, "ItemShadowFortressLeggings"); + ItemShadowFortressChestplate = new ItemShadowFortressArmor(LibToolMaterials.armorMatShadowFortress, 4, 1) + .setUnlocalizedName("ItemShadowFortressChestplate"); + GameRegistry.registerItem(ItemShadowFortressChestplate, "ItemShadowFortressChestplate"); - ItemVoidmetalGoggles = new ItemVoidmetalGoggles(ArmorMaterial.IRON, 4, 0); - GameRegistry.registerItem(ItemVoidmetalGoggles, "ItemVoidmetalGoggles"); + ItemShadowFortressLeggings = new ItemShadowFortressArmor(LibToolMaterials.armorMatShadowFortress, 4, 2) + .setUnlocalizedName("ItemShadowFortressLeggings"); + GameRegistry.registerItem(ItemShadowFortressLeggings, "ItemShadowFortressLeggings"); - // Wands and Staves - ItemWandRod = new ItemWandRod(); - GameRegistry.registerItem(ItemWandRod, "ItemWandRod"); + ItemVoidmetalGoggles = new ItemVoidmetalGoggles(ArmorMaterial.IRON, 4, 0); + GameRegistry.registerItem(ItemVoidmetalGoggles, "ItemVoidmetalGoggles"); - WAND_ROD_WARPWOOD = new WandRod("warpwood", 250, new ItemStack(ItemWandRod, 1, 0), 16, new WandUpdateHandler(), new ResourceLocation("taintedmagic:textures/models/ModelWAND_ROD_WARPWOOD.png")); - WAND_ROD_WARPWOOD.setGlowing(true); + // Wands and Staves + ItemWandRod = new ItemWandRod(); + GameRegistry.registerItem(ItemWandRod, "ItemWandRod"); - STAFF_ROD_WARPWOOD = new StaffRod("warpwood", 500, new ItemStack(ItemWandRod, 1, 1), 20, new WandUpdateHandler(), new ResourceLocation("taintedmagic:textures/models/ModelWAND_ROD_WARPWOOD.png")); - STAFF_ROD_WARPWOOD.setRunes(true); - STAFF_ROD_WARPWOOD.setGlowing(true); + WAND_ROD_WARPWOOD = new WandRod( + "warpwood", + 250, + new ItemStack(ItemWandRod, 1, 0), + 16, + new WandUpdateHandler(), + new ResourceLocation("taintedmagic:textures/models/ModelWAND_ROD_WARPWOOD.png")); + WAND_ROD_WARPWOOD.setGlowing(true); - ItemWandCap = new ItemWandCap(); - GameRegistry.registerItem(ItemWandCap, "ItemWandCap"); + STAFF_ROD_WARPWOOD = new StaffRod( + "warpwood", + 500, + new ItemStack(ItemWandRod, 1, 1), + 20, + new WandUpdateHandler(), + new ResourceLocation("taintedmagic:textures/models/ModelWAND_ROD_WARPWOOD.png")); + STAFF_ROD_WARPWOOD.setRunes(true); + STAFF_ROD_WARPWOOD.setGlowing(true); - WAND_CAP_SHADOWMETAL = new WandCap("shadowmetal", 0.70F, new ItemStack(ItemWandCap, 1, 0), 12); - WAND_CAP_SHADOWMETAL.setTexture(new ResourceLocation("taintedmagic:textures/models/ModelWAND_CAP_SHADOWMETAL.png")); + ItemWandCap = new ItemWandCap(); + GameRegistry.registerItem(ItemWandCap, "ItemWandCap"); - WAND_CAP_CLOTH = new WandCap("cloth", 0.95F, new ItemStack(ItemWandCap, 1, 1), 3); - WAND_CAP_CLOTH.setTexture(new ResourceLocation("taintedmagic:textures/models/ModelWAND_CAP_CLOTH.png")); + WAND_CAP_SHADOWMETAL = new WandCap("shadowmetal", 0.70F, new ItemStack(ItemWandCap, 1, 0), 12); + WAND_CAP_SHADOWMETAL + .setTexture(new ResourceLocation("taintedmagic:textures/models/ModelWAND_CAP_SHADOWMETAL.png")); - WAND_CAP_CRIMSON_CLOTH = new WandCap("crimsoncloth", 0.85F, new ItemStack(ItemWandCap, 1, 2), 5); - WAND_CAP_CRIMSON_CLOTH.setTexture(new ResourceLocation("taintedmagic:textures/models/ModelWAND_CAP_CRIMSON_CLOTH.png")); + WAND_CAP_CLOTH = new WandCap("cloth", 0.95F, new ItemStack(ItemWandCap, 1, 1), 3); + WAND_CAP_CLOTH.setTexture(new ResourceLocation("taintedmagic:textures/models/ModelWAND_CAP_CLOTH.png")); - WAND_CAP_SHADOW_CLOTH = new WandCap("shadowcloth", 0.90F, new ItemStack(ItemWandCap, 1, 3), 3); - WAND_CAP_SHADOW_CLOTH.setTexture(new ResourceLocation("taintedmagic:textures/models/ModelWAND_CAP_SHADOW_CLOTH.png")); + WAND_CAP_CRIMSON_CLOTH = new WandCap("crimsoncloth", 0.85F, new ItemStack(ItemWandCap, 1, 2), 5); + WAND_CAP_CRIMSON_CLOTH + .setTexture(new ResourceLocation("taintedmagic:textures/models/ModelWAND_CAP_CRIMSON_CLOTH.png")); - // Foci - ItemFocusTaint = new ItemFocusTaint(); - GameRegistry.registerItem(ItemFocusTaint, "ItemFocusTaint"); + WAND_CAP_SHADOW_CLOTH = new WandCap("shadowcloth", 0.90F, new ItemStack(ItemWandCap, 1, 3), 3); + WAND_CAP_SHADOW_CLOTH + .setTexture(new ResourceLocation("taintedmagic:textures/models/ModelWAND_CAP_SHADOW_CLOTH.png")); - ItemFocusEldritch = new ItemFocusEldritch(); - GameRegistry.registerItem(ItemFocusEldritch, "ItemFocusEldritch"); + // Foci + ItemFocusTaint = new ItemFocusTaint(); + GameRegistry.registerItem(ItemFocusTaint, "ItemFocusTaint"); - ItemFocusMeteorology = new ItemFocusMeteorology(); - GameRegistry.registerItem(ItemFocusMeteorology, "ItemFocusMeteorology"); + ItemFocusEldritch = new ItemFocusEldritch(); + GameRegistry.registerItem(ItemFocusEldritch, "ItemFocusEldritch"); - ItemFocusTime = new ItemFocusTime(); - GameRegistry.registerItem(ItemFocusTime, "ItemFocusTime"); + ItemFocusMeteorology = new ItemFocusMeteorology(); + GameRegistry.registerItem(ItemFocusMeteorology, "ItemFocusMeteorology"); - ItemFocusMageMace = new ItemFocusMageMace(); - GameRegistry.registerItem(ItemFocusMageMace, "ItemFocusMageMace"); + ItemFocusTime = new ItemFocusTime(); + GameRegistry.registerItem(ItemFocusTime, "ItemFocusTime"); - ItemFocusTaintedBlast = new ItemFocusTaintedBlast(); - GameRegistry.registerItem(ItemFocusTaintedBlast, "ItemFocusTaintedBlast"); + ItemFocusMageMace = new ItemFocusMageMace(); + GameRegistry.registerItem(ItemFocusMageMace, "ItemFocusMageMace"); - ItemFocusVisShard = new ItemFocusVisShard(); - GameRegistry.registerItem(ItemFocusVisShard, "ItemFocusVisShard"); + ItemFocusTaintedBlast = new ItemFocusTaintedBlast(); + GameRegistry.registerItem(ItemFocusTaintedBlast, "ItemFocusTaintedBlast"); - // Tools - ItemThaumicDisassembler = new ItemThaumicDisassembler(); - GameRegistry.registerItem(ItemThaumicDisassembler, "ItemThaumicDisassembler"); + ItemFocusVisShard = new ItemFocusVisShard(); + GameRegistry.registerItem(ItemFocusVisShard, "ItemFocusVisShard"); - ItemCrystalDagger = new ItemCrystalDagger(LibToolMaterials.toolMatCrystal); - GameRegistry.registerItem(ItemCrystalDagger, "ItemCrystalDagger"); + // Tools + ItemThaumicDisassembler = new ItemThaumicDisassembler(); + GameRegistry.registerItem(ItemThaumicDisassembler, "ItemThaumicDisassembler"); - ItemShadowmetalHoe = new ItemShadowmetalHoe(LibToolMaterials.toolMatShadow); - GameRegistry.registerItem(ItemShadowmetalHoe, "ItemShadowmetalHoe"); + ItemCrystalDagger = new ItemCrystalDagger(LibToolMaterials.toolMatCrystal); + GameRegistry.registerItem(ItemCrystalDagger, "ItemCrystalDagger"); - ItemShadowmetalPick = new ItemShadowmetalPick(LibToolMaterials.toolMatShadow); - GameRegistry.registerItem(ItemShadowmetalPick, "ItemShadowmetalPick"); + ItemShadowmetalHoe = new ItemShadowmetalHoe(LibToolMaterials.toolMatShadow); + GameRegistry.registerItem(ItemShadowmetalHoe, "ItemShadowmetalHoe"); - ItemShadowmetalAxe = new ItemShadowmetalAxe(LibToolMaterials.toolMatShadow); - GameRegistry.registerItem(ItemShadowmetalAxe, "ItemShadowmetalAxe"); + ItemShadowmetalPick = new ItemShadowmetalPick(LibToolMaterials.toolMatShadow); + GameRegistry.registerItem(ItemShadowmetalPick, "ItemShadowmetalPick"); - ItemShadowmetalSpade = new ItemShadowmetalSpade(LibToolMaterials.toolMatShadow); - GameRegistry.registerItem(ItemShadowmetalSpade, "ItemShadowmetalSpade"); + ItemShadowmetalAxe = new ItemShadowmetalAxe(LibToolMaterials.toolMatShadow); + GameRegistry.registerItem(ItemShadowmetalAxe, "ItemShadowmetalAxe"); - ItemShadowmetalSword = new ItemShadowmetalSword(LibToolMaterials.toolMatShadow); - GameRegistry.registerItem(ItemShadowmetalSword, "ItemShadowmetalSword"); + ItemShadowmetalSpade = new ItemShadowmetalSpade(LibToolMaterials.toolMatShadow); + GameRegistry.registerItem(ItemShadowmetalSpade, "ItemShadowmetalSpade"); - ItemPrimordialEdge = new ItemPrimordialEdge(LibToolMaterials.toolMatPrimal); - GameRegistry.registerItem(ItemPrimordialEdge, "ItemPrimordialEdge"); + ItemShadowmetalSword = new ItemShadowmetalSword(LibToolMaterials.toolMatShadow); + GameRegistry.registerItem(ItemShadowmetalSword, "ItemShadowmetalSword"); - ItemKatana = new ItemKatana(); - GameRegistry.registerItem(ItemKatana, "ItemKatana"); - } + ItemPrimordialEdge = new ItemPrimordialEdge(LibToolMaterials.toolMatPrimal); + GameRegistry.registerItem(ItemPrimordialEdge, "ItemPrimordialEdge"); - public static Item ItemMagicFunguar; - public static Item ItemMaterial; - public static Item ItemVoidsentBlood; + ItemKatana = new ItemKatana(); + GameRegistry.registerItem(ItemKatana, "ItemKatana"); + } - // Wand - public static Item ItemWandRod; + public static Item ItemMagicFunguar; + public static Item ItemMaterial; + public static Item ItemVoidsentBlood; - public static WandRod WAND_ROD_WARPWOOD; - public static StaffRod STAFF_ROD_WARPWOOD; + // Wand + public static Item ItemWandRod; - public static Item ItemWandCap; + public static WandRod WAND_ROD_WARPWOOD; + public static StaffRod STAFF_ROD_WARPWOOD; - public static WandCap WAND_CAP_SHADOWMETAL; - public static WandCap WAND_CAP_CLOTH; - public static WandCap WAND_CAP_CRIMSON_CLOTH; - public static WandCap WAND_CAP_SHADOW_CLOTH; + public static Item ItemWandCap; - // Foci - public static Item ItemFocusTaint; - public static Item ItemFocusEldritch; - public static Item ItemFocusMeteorology; - public static Item ItemFocusTime; - public static Item ItemFocusMageMace; - public static Item ItemFocusTaintedBlast; - public static Item ItemFocusVisShard; + public static WandCap WAND_CAP_SHADOWMETAL; + public static WandCap WAND_CAP_CLOTH; + public static WandCap WAND_CAP_CRIMSON_CLOTH; + public static WandCap WAND_CAP_SHADOW_CLOTH; - // Armor and Baubles - public static Item ItemWarpedGoggles; - public static Item ItemVoidmetalGoggles; + // Foci + public static Item ItemFocusTaint; + public static Item ItemFocusEldritch; + public static Item ItemFocusMeteorology; + public static Item ItemFocusTime; + public static Item ItemFocusMageMace; + public static Item ItemFocusTaintedBlast; + public static Item ItemFocusVisShard; - public static Item ItemVoidwalkerBoots; - public static Item ItemVoidwalkerSash; + // Armor and Baubles + public static Item ItemWarpedGoggles; + public static Item ItemVoidmetalGoggles; - public static Item ItemVoidFortressHelmet; - public static Item ItemVoidFortressChestplate; - public static Item ItemVoidFortressLeggings; + public static Item ItemVoidwalkerBoots; + public static Item ItemVoidwalkerSash; - public static Item ItemShadowFortressHelmet; - public static Item ItemShadowFortressChestplate; - public static Item ItemShadowFortressLeggings; + public static Item ItemVoidFortressHelmet; + public static Item ItemVoidFortressChestplate; + public static Item ItemVoidFortressLeggings; - // Tools - public static Item ItemThaumicDisassembler; - public static Item ItemCrystalDagger; + public static Item ItemShadowFortressHelmet; + public static Item ItemShadowFortressChestplate; + public static Item ItemShadowFortressLeggings; - public static ItemHoe ItemShadowmetalHoe; - public static ItemPickaxe ItemShadowmetalPick; - public static ItemSpade ItemShadowmetalSpade; - public static ItemAxe ItemShadowmetalAxe; - public static ItemSword ItemShadowmetalSword; + // Tools + public static Item ItemThaumicDisassembler; + public static Item ItemCrystalDagger; - public static ItemSword ItemPrimordialEdge; + public static ItemHoe ItemShadowmetalHoe; + public static ItemPickaxe ItemShadowmetalPick; + public static ItemSpade ItemShadowmetalSpade; + public static ItemAxe ItemShadowmetalAxe; + public static ItemSword ItemShadowmetalSword; - public static Item ItemKatana; + public static ItemSword ItemPrimordialEdge; + + public static Item ItemKatana; } diff --git a/src/main/java/taintedmagic/common/registry/ModEntityRegistry.java b/src/main/java/taintedmagic/common/registry/ModEntityRegistry.java index 81045f2..fdf37b8 100644 --- a/src/main/java/taintedmagic/common/registry/ModEntityRegistry.java +++ b/src/main/java/taintedmagic/common/registry/ModEntityRegistry.java @@ -6,13 +6,33 @@ import taintedmagic.common.entities.EntityHomingShard; import taintedmagic.common.entities.EntityTaintBubble; import cpw.mods.fml.common.registry.EntityRegistry; -public class ModEntityRegistry -{ - public static void init () - { - int id = 0; - EntityRegistry.registerModEntity(EntityTaintBubble.class, "EntityTaintBubble", id++, TaintedMagic.instance, 64, 20, true); - EntityRegistry.registerModEntity(EntityEldritchOrbAttack.class, "EntityEldritchOrbAttack", id++, TaintedMagic.instance, 64, 21, true); - EntityRegistry.registerModEntity(EntityHomingShard.class, "EntityHomingShard", id++, TaintedMagic.instance, 64, 3, true); - } +public class ModEntityRegistry { + + public static void init() { + int id = 0; + EntityRegistry.registerModEntity( + EntityTaintBubble.class, + "EntityTaintBubble", + id++, + TaintedMagic.instance, + 64, + 20, + true); + EntityRegistry.registerModEntity( + EntityEldritchOrbAttack.class, + "EntityEldritchOrbAttack", + id++, + TaintedMagic.instance, + 64, + 21, + true); + EntityRegistry.registerModEntity( + EntityHomingShard.class, + "EntityHomingShard", + id++, + TaintedMagic.instance, + 64, + 3, + true); + } } diff --git a/src/main/java/taintedmagic/common/registry/OreDictionaryRegistry.java b/src/main/java/taintedmagic/common/registry/OreDictionaryRegistry.java index 28c21ab..8610619 100644 --- a/src/main/java/taintedmagic/common/registry/OreDictionaryRegistry.java +++ b/src/main/java/taintedmagic/common/registry/OreDictionaryRegistry.java @@ -3,15 +3,14 @@ package taintedmagic.common.registry; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; -public class OreDictionaryRegistry -{ - 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 class OreDictionaryRegistry { + + 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)); + } } diff --git a/src/main/java/taintedmagic/common/registry/RecipeRegistry.java b/src/main/java/taintedmagic/common/registry/RecipeRegistry.java index 432c387..68700ad 100644 --- a/src/main/java/taintedmagic/common/registry/RecipeRegistry.java +++ b/src/main/java/taintedmagic/common/registry/RecipeRegistry.java @@ -5,11 +5,9 @@ import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.nbt.NBTTagByte; import net.minecraft.nbt.NBTTagInt; -import net.minecraftforge.oredict.OreDictionary; -import taintedmagic.common.TaintedMagic; + import thaumcraft.api.ItemApi; import thaumcraft.api.ThaumcraftApi; import thaumcraft.api.aspects.Aspect; @@ -18,659 +16,900 @@ import thaumcraft.common.config.ConfigBlocks; import thaumcraft.common.config.ConfigItems; import cpw.mods.fml.common.registry.GameRegistry; -public class RecipeRegistry -{ - public static void init () - { - initCrafting(); - initSmelting(); - initCrucible(); - initInfusion(); - initArcane(); - } - - public static void initCrafting () - { - ResearchRegistry.recipes.put("BlockShadowmetal", GameRegistry.addShapedRecipe(new ItemStack(Item.getItemFromBlock(BlockRegistry.BlockShadowmetal)), new Object[]{ - "AAA", - "AAA", - "AAA", - Character.valueOf('A'), - new ItemStack(ItemRegistry.ItemMaterial) })); - - ResearchRegistry.recipes.put("ItemShadowmetalPick", GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.ItemShadowmetalPick), new Object[]{ - "AAA", - " B ", - " B ", - Character.valueOf('A'), - new ItemStack(ItemRegistry.ItemMaterial), - Character.valueOf('B'), - new ItemStack(Items.stick) })); - - ResearchRegistry.recipes.put("ItemShadowmetalAxe", CraftingManager.getInstance().addRecipe(new ItemStack(ItemRegistry.ItemShadowmetalAxe), new Object[]{ - "AA", - "BA", - "B ", - Character.valueOf('A'), - new ItemStack(ItemRegistry.ItemMaterial), - Character.valueOf('B'), - new ItemStack(Items.stick) })); - - ResearchRegistry.recipes.put("ItemShadowmetalSpade", CraftingManager.getInstance().addRecipe(new ItemStack(ItemRegistry.ItemShadowmetalSpade), new Object[]{ - "A", - "B", - "B", - Character.valueOf('A'), - new ItemStack(ItemRegistry.ItemMaterial), - Character.valueOf('B'), - new ItemStack(Items.stick) })); - - ResearchRegistry.recipes.put("ItemShadowmetalHoe", CraftingManager.getInstance().addRecipe(new ItemStack(ItemRegistry.ItemShadowmetalHoe), new Object[]{ - "AA", - "B ", - "B ", - Character.valueOf('A'), - new ItemStack(ItemRegistry.ItemMaterial), - Character.valueOf('B'), - new ItemStack(Items.stick) })); - - ResearchRegistry.recipes.put("ItemShadowmetalSword", GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.ItemShadowmetalSword), new Object[]{ - "A", - "A", - "B", - Character.valueOf('A'), - new ItemStack(ItemRegistry.ItemMaterial), - Character.valueOf('B'), - new ItemStack(Items.stick) })); - - GameRegistry.addRecipe(new ItemStack(ItemRegistry.ItemMaterial, 9), new Object[]{ - "A", - Character.valueOf('A'), - new ItemStack(BlockRegistry.BlockShadowmetal) }); - - ResearchRegistry.recipes.put("BlockWarpwoodPlanks", CraftingManager.getInstance().addRecipe(new ItemStack(BlockRegistry.BlockWarpwoodPlanks, 4), new Object[]{ - "A", - Character.valueOf('A'), - new ItemStack(BlockRegistry.BlockWarpwoodLog) })); - } - - public static void initSmelting () - { - GameRegistry.addSmelting(BlockRegistry.BlockShadowOre, new ItemStack(ItemRegistry.ItemMaterial), 2.0F); - } - - public static void initInfusion () - { - ResearchRegistry.recipes.put("ItemFocusTaintedBlast", ThaumcraftApi.addInfusionCraftingRecipe("FOCUSTAINTEDBLAST", new ItemStack(ItemRegistry.ItemFocusTaintedBlast), 6, new AspectList().add(Aspect.WEAPON, 30).add(Aspect.MOTION, 24).add(Aspect.TAINT, 42).add(Aspect.MAGIC, 38), new ItemStack(ItemRegistry.ItemFocusTaint), new ItemStack[]{ - new ItemStack(Blocks.tnt), - ItemApi.getItem("itemBottleTaint", 0), - ItemApi.getItem("itemResource", 11), - ItemApi.getItem("itemResource", 15), - ItemApi.getItem("itemBottleTaint", 0), - new ItemStack(Blocks.tnt), - ItemApi.getItem("itemBottleTaint", 0), - ItemApi.getItem("itemResource", 11), - ItemApi.getItem("itemResource", 15), - ItemApi.getItem("itemBottleTaint", 0) })); - - 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), ItemApi.getItem("itemSwordVoid", 0), new ItemStack[]{ - ItemApi.getItem("itemPrimalCrusher", 0), - ItemApi.getBlock("blockCrystal", 0), - ItemApi.getBlock("blockCrystal", 1), - ItemApi.getBlock("blockCrystal", 2), - ItemApi.getBlock("blockCrystal", 3), - ItemApi.getBlock("blockCrystal", 4), - ItemApi.getBlock("blockCrystal", 5) })); - - ResearchRegistry.recipes.put("ItemFocusMageMace", ThaumcraftApi.addInfusionCraftingRecipe("MACEFOCUS", new ItemStack(ItemRegistry.ItemFocusMageMace), 3, new AspectList().add(Aspect.WEAPON, 32).add(Aspect.METAL, 8).add(Aspect.ENTROPY, 18).add(Aspect.MAGIC, 26), new ItemStack(BlockRegistry.BlockShadowmetal), new ItemStack[]{ - new ItemStack(Items.gold_ingot), - new ItemStack(Items.quartz), - ItemApi.getItem("itemShard", 5), - new ItemStack(Items.quartz), - new ItemStack(Items.diamond_sword), - new ItemStack(Items.quartz), - ItemApi.getItem("itemShard", 5), - new ItemStack(Items.quartz) })); - - 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).add(Aspect.ELDRITCH, 18).add(Aspect.VOID, 32), ItemApi.getItem("itemSwordVoid", 0), new ItemStack[]{ - new ItemStack(ItemRegistry.ItemCrystalDagger), - new ItemStack(ItemRegistry.ItemMaterial, 1, 7), - new ItemStack(ItemRegistry.ItemMaterial, 1, 8), - new ItemStack(ItemRegistry.ItemMaterial, 1, 7), - new ItemStack(ItemRegistry.ItemMaterial, 1, 2), - new ItemStack(ItemRegistry.ItemMaterial, 1, 7), - new ItemStack(ItemRegistry.ItemMaterial, 1, 8), - new ItemStack(ItemRegistry.ItemMaterial, 1, 7) })); - - 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, 64).add(Aspect.TRAVEL, 16).add(Aspect.FLIGHT, 10), ItemApi.getItem("itemGirdleRunic", 0), new ItemStack[]{ - ItemApi.getItem("itemEldritchObject", 3), - ItemApi.getItem("itemResource", 16), - new ItemStack(ItemRegistry.ItemMaterial), - ItemApi.getItem("itemResource", 16), - new ItemStack(ItemRegistry.ItemMaterial, 1, 1), - ItemApi.getItem("itemResource", 16), - new ItemStack(ItemRegistry.ItemMaterial), - ItemApi.getItem("itemResource", 16), })); - - ResearchRegistry.recipes.put("ItemMaterial:5", ThaumcraftApi.addInfusionCraftingRecipe("CREATIONSHARD", new ItemStack(ItemRegistry.ItemMaterial, 2, 5), 8, new AspectList().add(Aspect.ELDRITCH, 64).add(Aspect.VOID, 64).add(Aspect.MAGIC, 64), ItemApi.getItem("itemEldritchObject", 3), new ItemStack[]{ - new ItemStack(Items.nether_star), - ItemApi.getBlock("blockCrystal", 0), - ItemApi.getBlock("blockCrystal", 1), - ItemApi.getBlock("blockCrystal", 2), - ItemApi.getBlock("blockCrystal", 3), - ItemApi.getBlock("blockCrystal", 4), - ItemApi.getBlock("blockCrystal", 5) })); - - ResearchRegistry.recipes.put("BlockWarpwoodSapling", ThaumcraftApi.addInfusionCraftingRecipe("WARPTREE", new ItemStack(BlockRegistry.BlockWarpwoodSapling), 3, new AspectList().add(Aspect.ELDRITCH, 8).add(Aspect.TREE, 8).add(Aspect.DARKNESS, 8), new ItemStack(Blocks.sapling, 1, Short.MAX_VALUE), new ItemStack[]{ - new ItemStack(ItemRegistry.ItemMaterial, 1, 3), - ItemApi.getItem("itemZombieBrain", 0), - new ItemStack(ItemRegistry.ItemMaterial, 1, 3), - ItemApi.getItem("itemZombieBrain", 0) })); - - ResearchRegistry.recipes.put("ItemWandRod:0", ThaumcraftApi.addInfusionCraftingRecipe("ROD_warpwood", new ItemStack(ItemRegistry.ItemWandRod), 8, new AspectList().add(Aspect.ELDRITCH, 64).add(Aspect.DARKNESS, 32).add(Aspect.TREE, 32).add(Aspect.MAGIC, 64), new ItemStack(BlockRegistry.BlockWarpwoodLog), new ItemStack[]{ - ItemApi.getItem("itemEldritchObject", 3), - new ItemStack(ItemRegistry.ItemMaterial), - new ItemStack(ItemRegistry.ItemMaterial, 1, 3), - ItemApi.getItem("itemResource", 16), - ItemApi.getItem("itemZombieBrain", 0), - new ItemStack(ItemRegistry.ItemMaterial), - new ItemStack(ItemRegistry.ItemMaterial, 1, 3), - ItemApi.getItem("itemResource", 16) })); - - 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, 32767), new ItemStack[]{ - new ItemStack(Items.slime_ball), - ItemApi.getItem("itemGoggles", 0) })); - - 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), new ItemStack(ItemRegistry.ItemVoidFortressHelmet, 1, 32767), new ItemStack[]{ - new ItemStack(Items.dye, 1, 0), - new ItemStack(Items.iron_ingot), - new ItemStack(Items.leather), - ItemApi.getBlock("blockCustomPlant", 2), - ItemApi.getItem("itemZombieBrain", 0), - new ItemStack(Items.iron_ingot) })); - - 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), new ItemStack(ItemRegistry.ItemVoidFortressHelmet, 1, 32767), new ItemStack[]{ - new ItemStack(Items.dye, 1, 15), - new ItemStack(Items.iron_ingot), - new ItemStack(Items.leather), - new ItemStack(Items.poisonous_potato), - new ItemStack(Items.skull, 1, 1), - new ItemStack(Items.iron_ingot) })); - - 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), new ItemStack(ItemRegistry.ItemVoidFortressHelmet, 1, 32767), new ItemStack[]{ - new ItemStack(Items.dye, 1, 1), - new ItemStack(Items.iron_ingot), - new ItemStack(Items.leather), - new ItemStack(Items.ghast_tear), - new ItemStack(Items.milk_bucket), - new ItemStack(Items.iron_ingot) })); - - 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).add(Aspect.VOID, 16), ItemApi.getItem("itemHelmetVoid", 0), new ItemStack[]{ - ItemApi.getItem("itemResource", 16), - ItemApi.getItem("itemResource", 16), - new ItemStack(Items.gold_ingot), - new ItemStack(Items.gold_ingot), - new ItemStack(Items.emerald) })); - - 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), ItemApi.getItem("itemChestVoid", 0), new ItemStack[]{ - ItemApi.getItem("itemResource", 16), - ItemApi.getItem("itemResource", 16), - ItemApi.getItem("itemResource", 16), - ItemApi.getItem("itemResource", 16), - new ItemStack(Items.gold_ingot), - new ItemStack(Items.leather) })); - - 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), ItemApi.getItem("itemLegsVoid", 0), new ItemStack[]{ - ItemApi.getItem("itemResource", 16), - ItemApi.getItem("itemResource", 16), - ItemApi.getItem("itemResource", 16), - new ItemStack(Items.gold_ingot), - new ItemStack(Items.leather) })); - - ResearchRegistry.recipes.put("ItemWarpedGoggles", ThaumcraftApi.addInfusionCraftingRecipe("WARPEDGOGGLES", new ItemStack(ItemRegistry.ItemWarpedGoggles), 3, new AspectList().add(Aspect.ELDRITCH, 32).add(Aspect.DARKNESS, 16).add(Aspect.MAGIC, 16).add(Aspect.ARMOR, 8), ItemApi.getItem("itemGoggles", 0), new ItemStack[]{ - new ItemStack(ItemRegistry.ItemMaterial, 1, 0), - new ItemStack(ItemRegistry.ItemMaterial, 1, 0) })); - - ResearchRegistry.recipes.put("ItemWandCap:0", ThaumcraftApi.addInfusionCraftingRecipe("CAP_shadowmetal", new ItemStack(ItemRegistry.ItemWandCap), 8, new AspectList().add(Aspect.ELDRITCH, 64).add(Aspect.DARKNESS, 64).add(Aspect.MAGIC, 64).add(Aspect.METAL, 64).add(Aspect.VOID, 64), ItemApi.getItem("itemWandCap", 7), new ItemStack[]{ - new ItemStack(ItemRegistry.ItemMaterial, 1, 3), - new ItemStack(ItemRegistry.ItemMaterial), - ItemApi.getItem("itemResource", 16), - new ItemStack(ItemRegistry.ItemMaterial), - ItemApi.getItem("itemEldritchObject", 3), - new ItemStack(ItemRegistry.ItemMaterial), - ItemApi.getItem("itemResource", 16), - new ItemStack(ItemRegistry.ItemMaterial) })); - - ResearchRegistry.recipes.put("ItemFocusTaint", ThaumcraftApi.addInfusionCraftingRecipe("TAINTFOCUS", new ItemStack(ItemRegistry.ItemFocusTaint), 4, new AspectList().add(Aspect.TAINT, 64).add(Aspect.WATER, 64).add(Aspect.MAGIC, 64).add(Aspect.SLIME, 64), ItemApi.getItem("itemFocusPech", 0), new ItemStack[]{ - ItemApi.getItem("itemResource", 11), - new ItemStack(ItemRegistry.ItemMaterial, 1, 4), - ItemApi.getItem("itemBottleTaint", 0), - new ItemStack(ItemRegistry.ItemMaterial, 1, 4), - ItemApi.getItem("itemResource", 11), - new ItemStack(ItemRegistry.ItemMaterial, 1, 4), - ItemApi.getItem("itemBottleTaint", 0), - new ItemStack(ItemRegistry.ItemMaterial, 1, 4) })); - - ResearchRegistry.recipes.put("ItemFocusEldritch", ThaumcraftApi.addInfusionCraftingRecipe("ELDRITCHFOCUS", new ItemStack(ItemRegistry.ItemFocusEldritch), 6, new AspectList().add(Aspect.ELDRITCH, 64).add(Aspect.DARKNESS, 64).add(Aspect.MAGIC, 64).add(Aspect.AIR, 64), new ItemStack(ItemRegistry.ItemMaterial, 1, 5), new ItemStack[]{ - ItemApi.getItem("itemFocusPortableHole", 0), - ItemApi.getItem("itemResource", 16), - ItemApi.getItem("itemEldritchObject", 0), - ItemApi.getItem("itemResource", 16), - ItemApi.getItem("itemResource", 15), - ItemApi.getItem("itemResource", 16), - ItemApi.getItem("itemEldritchObject", 0), - ItemApi.getItem("itemResource", 16) })); - - ResearchRegistry.recipes.put("ItemMaterial:8", ThaumcraftApi.addInfusionCraftingRecipe("KNIGHTROBES", new ItemStack(ItemRegistry.ItemMaterial, 1, 8), 2, new AspectList().add(Aspect.DARKNESS, 8).add(Aspect.METAL, 8).add(Aspect.MAGIC, 8), new ItemStack(Items.iron_ingot), new ItemStack[]{ - new ItemStack(ItemRegistry.ItemMaterial, 1, 7), - new ItemStack(ItemRegistry.ItemMaterial, 1, 7), - new ItemStack(ItemRegistry.ItemMaterial, 1, 7), - new ItemStack(ItemRegistry.ItemMaterial, 1, 7) })); - - ResearchRegistry.recipes.put("ItemHelmetCultistLeaderPlate", ThaumcraftApi.addInfusionCraftingRecipe("PRAETORARMOR", ItemApi.getItem("itemHelmetCultistLeaderPlate", 0), 6, new AspectList().add(Aspect.DARKNESS, 64).add(Aspect.METAL, 64).add(Aspect.MAGIC, 64).add(Aspect.ELDRITCH, 4), ItemApi.getItem("itemHelmetCultistPlate", 0), new ItemStack[]{ - new ItemStack(Items.gold_ingot), - new ItemStack(ItemRegistry.ItemMaterial, 1, 8), - new ItemStack(ItemRegistry.ItemMaterial, 1, 2), - new ItemStack(ItemRegistry.ItemMaterial, 1, 8), - new ItemStack(Items.gold_ingot), - new ItemStack(ItemRegistry.ItemMaterial, 1, 8), - new ItemStack(ItemRegistry.ItemMaterial, 1, 2), - new ItemStack(ItemRegistry.ItemMaterial, 1, 8) })); - - ResearchRegistry.recipes.put("ItemChestCultistLeaderPlate", ThaumcraftApi.addInfusionCraftingRecipe("PRAETORARMOR", ItemApi.getItem("itemChestCultistLeaderPlate", 0), 6, new AspectList().add(Aspect.DARKNESS, 64).add(Aspect.METAL, 64).add(Aspect.MAGIC, 64).add(Aspect.ELDRITCH, 4), ItemApi.getItem("itemChestCultistPlate", 0), new ItemStack[]{ - new ItemStack(Items.gold_ingot), - new ItemStack(ItemRegistry.ItemMaterial, 1, 8), - new ItemStack(ItemRegistry.ItemMaterial, 1, 2), - new ItemStack(ItemRegistry.ItemMaterial, 1, 8), - new ItemStack(Items.gold_ingot), - new ItemStack(ItemRegistry.ItemMaterial, 1, 8), - new ItemStack(ItemRegistry.ItemMaterial, 1, 2), - new ItemStack(ItemRegistry.ItemMaterial, 1, 8) })); - - ResearchRegistry.recipes.put("ItemLegsCultistLeaderPlate", ThaumcraftApi.addInfusionCraftingRecipe("PRAETORARMOR", ItemApi.getItem("itemLegsCultistLeaderPlate", 0), 6, new AspectList().add(Aspect.DARKNESS, 64).add(Aspect.METAL, 64).add(Aspect.MAGIC, 64).add(Aspect.ELDRITCH, 4), ItemApi.getItem("itemLegsCultistPlate", 0), new ItemStack[]{ - new ItemStack(Items.gold_ingot), - new ItemStack(ItemRegistry.ItemMaterial, 1, 8), - new ItemStack(ItemRegistry.ItemMaterial, 1, 2), - new ItemStack(ItemRegistry.ItemMaterial, 1, 8), - new ItemStack(Items.gold_ingot), - new ItemStack(ItemRegistry.ItemMaterial, 1, 8), - new ItemStack(ItemRegistry.ItemMaterial, 1, 2), - new ItemStack(ItemRegistry.ItemMaterial, 1, 8) })); - - ResearchRegistry.recipes.put("ItemVoidwalkerBoots", ThaumcraftApi.addInfusionCraftingRecipe("VOIDWALKERBOOTS", new ItemStack(ItemRegistry.ItemVoidwalkerBoots), 8, new AspectList().add(Aspect.DARKNESS, 64).add(Aspect.VOID, 64).add(Aspect.ELDRITCH, 64).add(Aspect.ARMOR, 64).add(Aspect.TRAVEL, 64), ItemApi.getItem("itemBootsTraveller", 0), new ItemStack[]{ - ItemApi.getItem("itemEldritchObject", 0), - ItemApi.getItem("itemResource", 16), - new ItemStack(ItemRegistry.ItemMaterial, 1, 1), - new ItemStack(ItemRegistry.ItemMaterial), - new ItemStack(ItemRegistry.ItemMaterial, 1, 1), - ItemApi.getItem("itemResource", 16), - ItemApi.getItem("itemEldritchObject", 0), - ItemApi.getItem("itemResource", 16), - new ItemStack(ItemRegistry.ItemMaterial, 1, 1), - new ItemStack(ItemRegistry.ItemMaterial), - new ItemStack(ItemRegistry.ItemMaterial, 1, 1), - ItemApi.getItem("itemResource", 16) })); - - ResearchRegistry.recipes.put("ItemFocusTime", ThaumcraftApi.addInfusionCraftingRecipe("FOCUSTIME", new ItemStack(ItemRegistry.ItemFocusTime), 7, new AspectList().add(Aspect.VOID, 32).add(Aspect.ELDRITCH, 32).add(Aspect.LIGHT, 32).add(Aspect.DARKNESS, 32), new ItemStack(ItemRegistry.ItemMaterial, 1, 5), new ItemStack[]{ - new ItemStack(Items.clock), - ItemApi.getBlock("blockCrystal", 0), - ItemApi.getItem("itemFocusPortableHole", 0), - ItemApi.getBlock("blockCrystal", 0) })); - - ResearchRegistry.recipes.put("ItemFocusMeteorology", ThaumcraftApi.addInfusionCraftingRecipe("FOCUSWEATHER", new ItemStack(ItemRegistry.ItemFocusMeteorology), 7, new AspectList().add(Aspect.VOID, 32).add(Aspect.ELDRITCH, 32).add(Aspect.WATER, 32).add(Aspect.WEATHER, 32), new ItemStack(ItemRegistry.ItemMaterial, 1, 5), new ItemStack[]{ - ItemApi.getItem("itemFocusShock", 0), - ItemApi.getBlock("blockCrystal", 2), - ItemApi.getItem("itemFocusFrost", 0), - ItemApi.getBlock("blockCrystal", 2) })); - - ResearchRegistry.recipes.put("ItemThaumicDisassembler", ThaumcraftApi.addInfusionCraftingRecipe("THAUMICDISASSEMBLER", new ItemStack(ItemRegistry.ItemThaumicDisassembler), 3, new AspectList().add(Aspect.METAL, 16).add(Aspect.TOOL, 16).add(Aspect.WEAPON, 16).add(Aspect.VOID, 16), new ItemStack(ItemRegistry.ItemMaterial, 1, 6), new ItemStack[]{ - ItemApi.getItem("itemPickVoid", 0), - ItemApi.getItem("itemResource", 2), - ItemApi.getItem("itemShovelVoid", 0), - ItemApi.getItem("itemResource", 2), - ItemApi.getItem("itemSwordVoid", 0), - ItemApi.getItem("itemResource", 2), - ItemApi.getItem("itemAxeVoid", 0), - ItemApi.getItem("itemResource", 2) })); - - 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, 32767), new ItemStack[]{ - new ItemStack(Items.slime_ball), - ItemApi.getItem("itemGoggles", 0) })); - - 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), new ItemStack(ItemRegistry.ItemShadowFortressHelmet, 1, 32767), new ItemStack[]{ - new ItemStack(Items.dye, 1, 0), - new ItemStack(Items.iron_ingot), - new ItemStack(Items.leather), - ItemApi.getBlock("blockCustomPlant", 2), - ItemApi.getItem("itemZombieBrain", 0), - new ItemStack(Items.iron_ingot) })); - - 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), new ItemStack(ItemRegistry.ItemShadowFortressHelmet, 1, 32767), new ItemStack[]{ - new ItemStack(Items.dye, 1, 15), - new ItemStack(Items.iron_ingot), - new ItemStack(Items.leather), - new ItemStack(Items.poisonous_potato), - new ItemStack(Items.skull, 1, 1), - new ItemStack(Items.iron_ingot) })); - - 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), new ItemStack(ItemRegistry.ItemShadowFortressHelmet, 1, 32767), new ItemStack[]{ - new ItemStack(Items.dye, 1, 1), - new ItemStack(Items.iron_ingot), - new ItemStack(Items.leather), - new ItemStack(Items.ghast_tear), - new ItemStack(Items.milk_bucket), - new ItemStack(Items.iron_ingot) })); - - ResearchRegistry.recipes.put("ItemShadowFortressHelmet", ThaumcraftApi.addInfusionCraftingRecipe("SHADOWFORTRESSARMOR", new ItemStack(ItemRegistry.ItemShadowFortressHelmet), 7, new AspectList().add(Aspect.METAL, 28).add(Aspect.ARMOR, 20).add(Aspect.MAGIC, 12).add(Aspect.DARKNESS, 30).add(Aspect.VOID, 22), ItemApi.getItem("itemHelmetVoid", 0), new ItemStack[]{ - new ItemStack(BlockRegistry.BlockShadowmetal), - new ItemStack(BlockRegistry.BlockShadowmetal), - new ItemStack(Items.gold_ingot), - new ItemStack(Items.gold_ingot), - new ItemStack(Items.emerald) })); - - ResearchRegistry.recipes.put("ItemShadowFortressChestplate", ThaumcraftApi.addInfusionCraftingRecipe("SHADOWFORTRESSARMOR", 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), ItemApi.getItem("itemChestVoid", 0), new ItemStack[]{ - new ItemStack(BlockRegistry.BlockShadowmetal), - new ItemStack(BlockRegistry.BlockShadowmetal), - new ItemStack(BlockRegistry.BlockShadowmetal), - new ItemStack(BlockRegistry.BlockShadowmetal), - new ItemStack(Items.gold_ingot), - new ItemStack(Items.leather) })); - - ResearchRegistry.recipes.put("ItemShadowFortressLeggings", ThaumcraftApi.addInfusionCraftingRecipe("SHADOWFORTRESSARMOR", new ItemStack(ItemRegistry.ItemShadowFortressLeggings), 7, new AspectList().add(Aspect.METAL, 32).add(Aspect.ARMOR, 24).add(Aspect.MAGIC, 16).add(Aspect.DARKNESS, 32).add(Aspect.VOID, 24), ItemApi.getItem("itemLegsVoid", 0), new ItemStack[]{ - new ItemStack(BlockRegistry.BlockShadowmetal), - new ItemStack(BlockRegistry.BlockShadowmetal), - new ItemStack(BlockRegistry.BlockShadowmetal), - new ItemStack(Items.gold_ingot), - new ItemStack(Items.leather) })); - - ResearchRegistry.recipes.put("ItemKatana:0", ThaumcraftApi.addInfusionCraftingRecipe("THAUMIUMKATANA", new ItemStack(ItemRegistry.ItemKatana, 1, 0), 3, new AspectList().add(Aspect.METAL, 48).add(Aspect.WEAPON, 48).add(Aspect.MAGIC, 32), new ItemStack(ConfigItems.itemSwordThaumium), new ItemStack[]{ - new ItemStack(Blocks.obsidian), - new ItemStack(ConfigItems.itemResource, 1, 2), - new ItemStack(Items.gold_ingot), - new ItemStack(Items.emerald), - new ItemStack(Items.iron_ingot), - new ItemStack(ConfigItems.itemResource, 1, 2), - new ItemStack(Blocks.obsidian), - new ItemStack(ConfigItems.itemResource, 1, 2), - new ItemStack(Items.gold_ingot), - new ItemStack(Items.emerald), - new ItemStack(Items.iron_ingot), - new ItemStack(ConfigItems.itemResource, 1, 2) })); - - ResearchRegistry.recipes.put("ItemKatana:1", ThaumcraftApi.addInfusionCraftingRecipe("VOIDMETALKATANA", new ItemStack(ItemRegistry.ItemKatana, 1, 1), 6, new AspectList().add(Aspect.METAL, 48).add(Aspect.WEAPON, 48).add(Aspect.MAGIC, 42).add(Aspect.VOID, 46).add(Aspect.ELDRITCH, 12), new ItemStack(ConfigItems.itemSwordVoid), new ItemStack[]{ - new ItemStack(Blocks.obsidian), - new ItemStack(ConfigItems.itemResource, 1, 16), - new ItemStack(Items.gold_ingot), - new ItemStack(Items.emerald), - new ItemStack(Items.iron_ingot), - new ItemStack(ConfigItems.itemResource, 1, 16), - new ItemStack(Blocks.obsidian), - new ItemStack(ConfigItems.itemResource, 1, 16), - new ItemStack(Items.gold_ingot), - new ItemStack(Items.emerald), - new ItemStack(Items.iron_ingot), - new ItemStack(ConfigItems.itemResource, 1, 16) })); - - ResearchRegistry.recipes.put("ItemKatana:2", ThaumcraftApi.addInfusionCraftingRecipe("SHADOWMETALKATANA", new ItemStack(ItemRegistry.ItemKatana, 1, 2), 7, new AspectList().add(Aspect.METAL, 48).add(Aspect.WEAPON, 48).add(Aspect.MAGIC, 32).add(Aspect.VOID, 16).add(Aspect.DARKNESS, 46), new ItemStack(ItemRegistry.ItemShadowmetalSword), new ItemStack[]{ - new ItemStack(Blocks.obsidian), - new ItemStack(ItemRegistry.ItemMaterial, 1, 0), - new ItemStack(Items.iron_ingot), - new ItemStack(Items.emerald), - new ItemStack(Items.iron_ingot), - new ItemStack(ItemRegistry.ItemMaterial, 1, 0), - new ItemStack(Blocks.obsidian), - new ItemStack(ItemRegistry.ItemMaterial, 1, 0), - new ItemStack(Items.iron_ingot), - new ItemStack(Items.emerald), - new ItemStack(Items.iron_ingot), - new ItemStack(ItemRegistry.ItemMaterial, 1, 0) })); - - /** - * The ItemKatanaThaumium recipes are for the thaumonomicon - */ - ResearchRegistry.recipes.put("ItemKatanaThaumium:inscription0", ThaumcraftApi.addInfusionCraftingRecipe("INSCRIPTIONFIRE", new Object[]{ - "inscription", - new NBTTagInt(0) }, 8, new AspectList().add(Aspect.FIRE, 64).add(Aspect.LIGHT, 64).add(Aspect.METAL, 16), new ItemStack(ItemRegistry.ItemKatana, 1, 0), new ItemStack[]{ - ItemApi.getItem("itemFocusFire", 0), - new ItemStack(Items.coal), - new ItemStack(Blocks.netherrack), - new ItemStack(Items.fire_charge), - new ItemStack(Items.blaze_powder), - ItemApi.getItem("itemResource", 1) })); - - ResearchRegistry.recipes.put("ItemKatanaThaumium:inscription1", ThaumcraftApi.addInfusionCraftingRecipe("INSCRIPTIONTAINT", new Object[]{ - "inscription", - new NBTTagInt(1) }, 8, new AspectList().add(Aspect.TAINT, 64).add(Aspect.FLESH, 64).add(Aspect.METAL, 16), new ItemStack(ItemRegistry.ItemKatana, 1, 0), new ItemStack[]{ - new ItemStack(ItemRegistry.ItemFocusTaint), - new ItemStack(ItemRegistry.ItemMaterial, 1, 4), - ItemApi.getBlock("blockJar", 1), - ItemApi.getBlock("blockCustomPlant", 5), - ItemApi.getItem("itemBottleTaint", 0), - ItemApi.getItem("itemResource", 11) })); - - ResearchRegistry.recipes.put("ItemKatanaThaumium:inscription2", ThaumcraftApi.addInfusionCraftingRecipe("INSCRIPTIONUNDEAD", new Object[]{ - "inscription", - new NBTTagInt(2) }, 8, new AspectList().add(Aspect.HEAL, 64).add(Aspect.UNDEAD, 64).add(Aspect.METAL, 16), new ItemStack(ItemRegistry.ItemKatana, 1, 0), new ItemStack[]{ - new ItemStack(ConfigItems.itemZombieBrain), - new ItemStack(Items.bone), - new ItemStack(Items.rotten_flesh), - new ItemStack(Items.fermented_spider_eye), - new ItemStack(ConfigItems.itemFocusPech), - new ItemStack(ConfigItems.itemBathSalts) })); - - ResearchRegistry.recipes.put("ItemKatana:inscription0", ThaumcraftApi.addInfusionCraftingRecipe("INSCRIPTIONFIRE", new Object[]{ - "inscription", - new NBTTagInt(0) }, 8, new AspectList().add(Aspect.FIRE, 64).add(Aspect.LIGHT, 64).add(Aspect.METAL, 16), new ItemStack(ItemRegistry.ItemKatana, 1, 32767), new ItemStack[]{ - ItemApi.getItem("itemFocusFire", 0), - new ItemStack(Items.coal), - new ItemStack(Blocks.netherrack), - new ItemStack(Items.fire_charge), - new ItemStack(Items.blaze_powder), - ItemApi.getItem("itemResource", 1) })); - - ResearchRegistry.recipes.put("ItemKatana:inscription1", ThaumcraftApi.addInfusionCraftingRecipe("INSCRIPTIONTAINT", new Object[]{ - "inscription", - new NBTTagInt(1) }, 8, new AspectList().add(Aspect.TAINT, 64).add(Aspect.FLESH, 64).add(Aspect.METAL, 16), new ItemStack(ItemRegistry.ItemKatana, 1, 32767), new ItemStack[]{ - new ItemStack(ItemRegistry.ItemFocusTaint), - new ItemStack(ItemRegistry.ItemMaterial, 1, 4), - ItemApi.getBlock("blockJar", 1), - ItemApi.getBlock("blockCustomPlant", 5), - ItemApi.getItem("itemBottleTaint", 0), - ItemApi.getItem("itemResource", 11) })); - - ResearchRegistry.recipes.put("ItemKatana:inscription2", ThaumcraftApi.addInfusionCraftingRecipe("INSCRIPTIONUNDEAD", new Object[]{ - "inscription", - new NBTTagInt(2) }, 8, new AspectList().add(Aspect.HEAL, 64).add(Aspect.UNDEAD, 64).add(Aspect.METAL, 16), new ItemStack(ItemRegistry.ItemKatana, 1, 32767), new ItemStack[]{ - new ItemStack(ConfigItems.itemZombieBrain), - new ItemStack(Items.bone), - new ItemStack(Items.rotten_flesh), - new ItemStack(Items.fermented_spider_eye), - new ItemStack(ConfigItems.itemFocusPech), - new ItemStack(ConfigItems.itemBathSalts) })); - - ResearchRegistry.recipes.put("ItemVoidmetalGoggles", ThaumcraftApi.addInfusionCraftingRecipe("VOIDGOGGLES", new ItemStack(ItemRegistry.ItemVoidmetalGoggles), 5, new AspectList().add(Aspect.VOID, 42).add(Aspect.SENSES, 38).add(Aspect.DARKNESS, 16).add(Aspect.CRYSTAL, 6).add(Aspect.ARMOR, 24), new ItemStack(ItemRegistry.ItemWarpedGoggles, 1, 32767), new ItemStack[]{ - new ItemStack(ConfigItems.itemResource, 1, 16), - new ItemStack(ConfigItems.itemResource, 1, 16), - new ItemStack(ConfigItems.itemResource, 1, 7), - new ItemStack(ConfigItems.itemResource, 1, 7), - new ItemStack(ConfigItems.itemShard, 1, 6) })); - } - - public static void initArcane () - { - ResearchRegistry.recipes.put("ItemMaterial:2", ThaumcraftApi.addArcaneCraftingRecipe("CRIMSONROBES", new ItemStack(ItemRegistry.ItemMaterial, 1, 2), new AspectList().add(Aspect.ORDER, 5).add(Aspect.WATER, 5).add(Aspect.EARTH, 5).add(Aspect.AIR, 5).add(Aspect.FIRE, 5).add(Aspect.ENTROPY, 5), new Object[]{ - " A ", - "ABA", - " A ", - Character.valueOf('A'), - new ItemStack(ItemRegistry.ItemMaterial, 1, 7), - Character.valueOf('B'), - ItemApi.getItem("itemResource", 7) })); - - ResearchRegistry.recipes.put("ItemMaterial:6", ThaumcraftApi.addArcaneCraftingRecipe("THAUMICDISASSEMBLER", new ItemStack(ItemRegistry.ItemMaterial, 1, 6), new AspectList().add(Aspect.ORDER, 50).add(Aspect.ENTROPY, 50), new Object[]{ - "BAB", - "ACA", - "BAB", - Character.valueOf('A'), - ItemApi.getItem("itemResource", 2), - Character.valueOf('B'), - ItemApi.getItem("itemResource", 16), - Character.valueOf('C'), - new ItemStack(Items.diamond) })); - - ResearchRegistry.recipes.put("ItemHelmetCultistRobe", ThaumcraftApi.addArcaneCraftingRecipe("CRIMSONROBES", ItemApi.getItem("itemHelmetCultistRobe", 0), new AspectList().add(Aspect.ORDER, 5).add(Aspect.WATER, 5).add(Aspect.EARTH, 5).add(Aspect.AIR, 5).add(Aspect.FIRE, 5).add(Aspect.ENTROPY, 5), new Object[]{ - "AAA", - "ABA", - Character.valueOf('A'), - new ItemStack(ItemRegistry.ItemMaterial, 1, 2), - Character.valueOf('B'), - new ItemStack(Items.iron_ingot) })); - - ResearchRegistry.recipes.put("ItemChestCultistRobe", ThaumcraftApi.addArcaneCraftingRecipe("CRIMSONROBES", ItemApi.getItem("itemChestCultistRobe", 0), new AspectList().add(Aspect.ORDER, 5).add(Aspect.WATER, 5).add(Aspect.EARTH, 5).add(Aspect.AIR, 5).add(Aspect.FIRE, 5).add(Aspect.ENTROPY, 5), new Object[]{ - "A A", - "AAA", - "ABA", - Character.valueOf('A'), - new ItemStack(ItemRegistry.ItemMaterial, 1, 2), - Character.valueOf('B'), - new ItemStack(Items.gold_ingot) })); - - ResearchRegistry.recipes.put("ItemLegsCultistRobe", ThaumcraftApi.addArcaneCraftingRecipe("CRIMSONROBES", ItemApi.getItem("itemLegsCultistRobe", 0), new AspectList().add(Aspect.ORDER, 5).add(Aspect.WATER, 5).add(Aspect.EARTH, 5).add(Aspect.AIR, 5).add(Aspect.FIRE, 5).add(Aspect.ENTROPY, 5), new Object[]{ - "ABA", - "ACA", - "A A", - Character.valueOf('A'), - new ItemStack(ItemRegistry.ItemMaterial, 1, 2), - Character.valueOf('B'), - new ItemStack(Items.gold_ingot), - Character.valueOf('C'), - new ItemStack(Items.iron_ingot) })); - - ResearchRegistry.recipes.put("ItemBootsCultist", ThaumcraftApi.addArcaneCraftingRecipe("CRIMSONROBES", ItemApi.getItem("itemBootsCultist", 0), new AspectList().add(Aspect.ORDER, 5).add(Aspect.WATER, 5).add(Aspect.EARTH, 5).add(Aspect.AIR, 5).add(Aspect.FIRE, 5).add(Aspect.ENTROPY, 5), new Object[]{ - "A A", - "A A", - Character.valueOf('A'), - new ItemStack(ItemRegistry.ItemMaterial, 1, 2) })); - - ResearchRegistry.recipes.put("ItemWandRod:1", ThaumcraftApi.addArcaneCraftingRecipe("ROD_warpwood_staff", new ItemStack(ItemRegistry.ItemWandRod, 1, 1), new AspectList().add(Aspect.ORDER, 120).add(Aspect.WATER, 120).add(Aspect.EARTH, 120).add(Aspect.AIR, 120).add(Aspect.FIRE, 120).add(Aspect.ENTROPY, 120), new Object[]{ - " A", - " B ", - "B ", - Character.valueOf('A'), - new ItemStack(ConfigItems.itemEldritchObject, 1, 3), - Character.valueOf('B'), - new ItemStack(ItemRegistry.ItemWandRod, 1, 0) })); - - ResearchRegistry.recipes.put("ItemHelmetCultistPlate", ThaumcraftApi.addArcaneCraftingRecipe("KNIGHTROBES", ItemApi.getItem("itemHelmetCultistPlate", 0), new AspectList().add(Aspect.ORDER, 5).add(Aspect.WATER, 5).add(Aspect.EARTH, 5).add(Aspect.AIR, 5).add(Aspect.FIRE, 5).add(Aspect.ENTROPY, 5), new Object[]{ - "ABA", - "A A", - Character.valueOf('A'), - new ItemStack(ItemRegistry.ItemMaterial, 1, 8), - Character.valueOf('B'), - new ItemStack(ItemRegistry.ItemMaterial, 1, 2) })); - - ResearchRegistry.recipes.put("ItemChestCultistPlate", ThaumcraftApi.addArcaneCraftingRecipe("KNIGHTROBES", ItemApi.getItem("itemChestCultistPlate", 0), new AspectList().add(Aspect.ORDER, 5).add(Aspect.WATER, 5).add(Aspect.EARTH, 5).add(Aspect.AIR, 5).add(Aspect.FIRE, 5).add(Aspect.ENTROPY, 5), new Object[]{ - "A A", - "ABA", - "ABA", - Character.valueOf('A'), - new ItemStack(ItemRegistry.ItemMaterial, 1, 8), - Character.valueOf('B'), - new ItemStack(ItemRegistry.ItemMaterial, 1, 2) })); - - ResearchRegistry.recipes.put("ItemLegsCultistPlate", ThaumcraftApi.addArcaneCraftingRecipe("KNIGHTROBES", ItemApi.getItem("itemLegsCultistPlate", 0), new AspectList().add(Aspect.ORDER, 5).add(Aspect.WATER, 5).add(Aspect.EARTH, 5).add(Aspect.AIR, 5).add(Aspect.FIRE, 5).add(Aspect.ENTROPY, 5), new Object[]{ - "AAA", - "A A", - "B B", - Character.valueOf('A'), - new ItemStack(ItemRegistry.ItemMaterial, 1, 8), - Character.valueOf('B'), - new ItemStack(ItemRegistry.ItemMaterial, 1, 2) })); - - 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).add(Aspect.FIRE, 1).add(Aspect.ENTROPY, 1), new Object[]{ - " A ", - "BBB", - " A ", - Character.valueOf('A'), - new ItemStack(ItemRegistry.ItemMaterial), - Character.valueOf('B'), - ItemApi.getItem("itemResource", 7) })); - - ResearchRegistry.recipes.put("ItemMagicFunguar", ThaumcraftApi.addShapelessArcaneCraftingRecipe("MAGICFUNGUAR", new ItemStack(ItemRegistry.ItemMagicFunguar), new AspectList().add(Aspect.ORDER, 1).add(Aspect.WATER, 1).add(Aspect.EARTH, 1).add(Aspect.AIR, 1).add(Aspect.FIRE, 1).add(Aspect.ENTROPY, 1), new Object[]{ - new ItemStack(ConfigBlocks.blockCustomPlant, 1, 5), - new ItemStack(ConfigItems.itemShard, 1, 32767), - new ItemStack(Blocks.brown_mushroom), - new ItemStack(Blocks.red_mushroom), - new ItemStack(Items.blaze_powder) })); - - ResearchRegistry.recipes.put("ItemCrystalDagger", ThaumcraftApi.addArcaneCraftingRecipe("CRIMSONROBES", new ItemStack(ItemRegistry.ItemCrystalDagger), new AspectList().add(Aspect.EARTH, 85).add(Aspect.FIRE, 85).add(Aspect.ENTROPY, 85), new Object[]{ - " A", - " B ", - "C ", - Character.valueOf('A'), - ItemApi.getItem("itemResource", 16), - Character.valueOf('B'), - ItemApi.getBlock("blockTube", 7), - Character.valueOf('C'), - "logWood" })); - - 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), new Object[]{ - "AAA", - "A A", - Character.valueOf('A'), - ItemApi.getItem("itemResource", 7) })); - - ResearchRegistry.recipes.put("ItemWandCap:2", ThaumcraftApi.addArcaneCraftingRecipe("CAP_crimsoncloth", new ItemStack(ItemRegistry.ItemWandCap, 1, 2), new AspectList().add(Aspect.EARTH, 25).add(Aspect.FIRE, 25).add(Aspect.ENTROPY, 25).add(Aspect.ORDER, 25), new Object[]{ - "AAA", - "ABA", - Character.valueOf('A'), - new ItemStack(ItemRegistry.ItemMaterial, 1, 2), - Character.valueOf('B'), - ItemApi.getItem("itemResource", 14) })); - - 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, 55), new Object[]{ - "AAA", - "ABA", - Character.valueOf('A'), - new ItemStack(ItemRegistry.ItemMaterial, 1, 1), - Character.valueOf('B'), - ItemApi.getItem("itemResource", 14) })); - - 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), new Object[]{ - "BDC", - "DAD", - "CDB", - 'A', - new ItemStack(ConfigItems.itemResource, 1, 3), - 'B', - new ItemStack(ConfigItems.itemShard, 1, 6), - 'C', - new ItemStack(ItemRegistry.ItemMaterial, 1, 4), - 'D', - new ItemStack(ConfigItems.itemWispEssence, 1, 32767) })); - } - - public static void initCrucible () - { - ResearchRegistry.recipes.put("ItemMaterial:3", ThaumcraftApi.addCrucibleRecipe("EVILSHARDS", new ItemStack(ItemRegistry.ItemMaterial, 1, 3), ItemApi.getItem("itemShard", 6), new AspectList().merge(Aspect.ELDRITCH, 4))); - ResearchRegistry.recipes.put("ItemMaterial:4", ThaumcraftApi.addCrucibleRecipe("EVILSHARDS", new ItemStack(ItemRegistry.ItemMaterial, 1, 4), ItemApi.getItem("itemShard", 6), new AspectList().merge(Aspect.TAINT, 4))); - ResearchRegistry.recipes.put("BlockShadowOre", ThaumcraftApi.addCrucibleRecipe("SHADOWMETAL", new ItemStack(BlockRegistry.BlockShadowOre), new ItemStack(Blocks.stone), new AspectList().merge(Aspect.VOID, 2).merge(Aspect.DARKNESS, 4).merge(Aspect.METAL, 6).merge(Aspect.MAGIC, 8))); - ResearchRegistry.recipes.put("ItemVoidsentBlood", ThaumcraftApi.addCrucibleRecipe("VOIDSENTBLOOD", new ItemStack(ItemRegistry.ItemVoidsentBlood), new ItemStack(ItemRegistry.ItemMaterial, 1, 7), new AspectList().merge(Aspect.VOID, 12).merge(Aspect.DARKNESS, 4).merge(Aspect.AURA, 6).merge(Aspect.ARMOR, 8))); - } -} \ No newline at end of file +public class RecipeRegistry { + + public static void init() { + initCrafting(); + initSmelting(); + initCrucible(); + initInfusion(); + initArcane(); + } + + public static void initCrafting() { + ResearchRegistry.recipes.put( + "BlockShadowmetal", + GameRegistry.addShapedRecipe( + new ItemStack(Item.getItemFromBlock(BlockRegistry.BlockShadowmetal)), + new Object[] { "AAA", "AAA", "AAA", Character.valueOf('A'), + new ItemStack(ItemRegistry.ItemMaterial) })); + + ResearchRegistry.recipes.put( + "ItemShadowmetalPick", + GameRegistry.addShapedRecipe( + new ItemStack(ItemRegistry.ItemShadowmetalPick), + new Object[] { "AAA", " B ", " B ", Character.valueOf('A'), + new ItemStack(ItemRegistry.ItemMaterial), Character.valueOf('B'), + new ItemStack(Items.stick) })); + + ResearchRegistry.recipes.put( + "ItemShadowmetalAxe", + CraftingManager.getInstance().addRecipe( + new ItemStack(ItemRegistry.ItemShadowmetalAxe), + new Object[] { "AA", "BA", "B ", Character.valueOf('A'), + new ItemStack(ItemRegistry.ItemMaterial), Character.valueOf('B'), + new ItemStack(Items.stick) })); + + ResearchRegistry.recipes.put( + "ItemShadowmetalSpade", + CraftingManager.getInstance().addRecipe( + new ItemStack(ItemRegistry.ItemShadowmetalSpade), + new Object[] { "A", "B", "B", Character.valueOf('A'), new ItemStack(ItemRegistry.ItemMaterial), + Character.valueOf('B'), new ItemStack(Items.stick) })); + + ResearchRegistry.recipes.put( + "ItemShadowmetalHoe", + CraftingManager.getInstance().addRecipe( + new ItemStack(ItemRegistry.ItemShadowmetalHoe), + new Object[] { "AA", "B ", "B ", Character.valueOf('A'), + new ItemStack(ItemRegistry.ItemMaterial), Character.valueOf('B'), + new ItemStack(Items.stick) })); + + ResearchRegistry.recipes.put( + "ItemShadowmetalSword", + GameRegistry.addShapedRecipe( + new ItemStack(ItemRegistry.ItemShadowmetalSword), + new Object[] { "A", "A", "B", Character.valueOf('A'), new ItemStack(ItemRegistry.ItemMaterial), + Character.valueOf('B'), new ItemStack(Items.stick) })); + + GameRegistry.addRecipe( + new ItemStack(ItemRegistry.ItemMaterial, 9), + new Object[] { "A", Character.valueOf('A'), new ItemStack(BlockRegistry.BlockShadowmetal) }); + + ResearchRegistry.recipes.put( + "BlockWarpwoodPlanks", + CraftingManager.getInstance().addRecipe( + new ItemStack(BlockRegistry.BlockWarpwoodPlanks, 4), + new Object[] { "A", Character.valueOf('A'), new ItemStack(BlockRegistry.BlockWarpwoodLog) })); + } + + public static void initSmelting() { + GameRegistry.addSmelting(BlockRegistry.BlockShadowOre, new ItemStack(ItemRegistry.ItemMaterial), 2.0F); + } + + public static void initInfusion() { + ResearchRegistry.recipes.put( + "ItemFocusTaintedBlast", + ThaumcraftApi.addInfusionCraftingRecipe( + "FOCUSTAINTEDBLAST", + new ItemStack(ItemRegistry.ItemFocusTaintedBlast), + 6, + new AspectList().add(Aspect.WEAPON, 30).add(Aspect.MOTION, 24).add(Aspect.TAINT, 42) + .add(Aspect.MAGIC, 38), + new ItemStack(ItemRegistry.ItemFocusTaint), + new ItemStack[] { new ItemStack(Blocks.tnt), ItemApi.getItem("itemBottleTaint", 0), + ItemApi.getItem("itemResource", 11), ItemApi.getItem("itemResource", 15), + ItemApi.getItem("itemBottleTaint", 0), new ItemStack(Blocks.tnt), + ItemApi.getItem("itemBottleTaint", 0), ItemApi.getItem("itemResource", 11), + ItemApi.getItem("itemResource", 15), ItemApi.getItem("itemBottleTaint", 0) })); + + 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), + ItemApi.getItem("itemSwordVoid", 0), + new ItemStack[] { ItemApi.getItem("itemPrimalCrusher", 0), ItemApi.getBlock("blockCrystal", 0), + ItemApi.getBlock("blockCrystal", 1), ItemApi.getBlock("blockCrystal", 2), + ItemApi.getBlock("blockCrystal", 3), ItemApi.getBlock("blockCrystal", 4), + ItemApi.getBlock("blockCrystal", 5) })); + + ResearchRegistry.recipes.put( + "ItemFocusMageMace", + ThaumcraftApi.addInfusionCraftingRecipe( + "MACEFOCUS", + new ItemStack(ItemRegistry.ItemFocusMageMace), + 3, + new AspectList().add(Aspect.WEAPON, 32).add(Aspect.METAL, 8).add(Aspect.ENTROPY, 18) + .add(Aspect.MAGIC, 26), + new ItemStack(BlockRegistry.BlockShadowmetal), + new ItemStack[] { new ItemStack(Items.gold_ingot), new ItemStack(Items.quartz), + ItemApi.getItem("itemShard", 5), new ItemStack(Items.quartz), + new ItemStack(Items.diamond_sword), new ItemStack(Items.quartz), + ItemApi.getItem("itemShard", 5), new ItemStack(Items.quartz) })); + + 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) + .add(Aspect.ELDRITCH, 18).add(Aspect.VOID, 32), + ItemApi.getItem("itemSwordVoid", 0), + new ItemStack[] { new ItemStack(ItemRegistry.ItemCrystalDagger), + new ItemStack(ItemRegistry.ItemMaterial, 1, 7), + new ItemStack(ItemRegistry.ItemMaterial, 1, 8), + new ItemStack(ItemRegistry.ItemMaterial, 1, 7), + new ItemStack(ItemRegistry.ItemMaterial, 1, 2), + new ItemStack(ItemRegistry.ItemMaterial, 1, 7), + new ItemStack(ItemRegistry.ItemMaterial, 1, 8), + new ItemStack(ItemRegistry.ItemMaterial, 1, 7) })); + + 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, 64) + .add(Aspect.TRAVEL, 16).add(Aspect.FLIGHT, 10), + ItemApi.getItem("itemGirdleRunic", 0), + new ItemStack[] { ItemApi.getItem("itemEldritchObject", 3), ItemApi.getItem("itemResource", 16), + new ItemStack(ItemRegistry.ItemMaterial), ItemApi.getItem("itemResource", 16), + new ItemStack(ItemRegistry.ItemMaterial, 1, 1), ItemApi.getItem("itemResource", 16), + new ItemStack(ItemRegistry.ItemMaterial), ItemApi.getItem("itemResource", 16), })); + + ResearchRegistry.recipes.put( + "ItemMaterial:5", + ThaumcraftApi.addInfusionCraftingRecipe( + "CREATIONSHARD", + new ItemStack(ItemRegistry.ItemMaterial, 2, 5), + 8, + new AspectList().add(Aspect.ELDRITCH, 64).add(Aspect.VOID, 64).add(Aspect.MAGIC, 64), + ItemApi.getItem("itemEldritchObject", 3), + new ItemStack[] { new ItemStack(Items.nether_star), ItemApi.getBlock("blockCrystal", 0), + ItemApi.getBlock("blockCrystal", 1), ItemApi.getBlock("blockCrystal", 2), + ItemApi.getBlock("blockCrystal", 3), ItemApi.getBlock("blockCrystal", 4), + ItemApi.getBlock("blockCrystal", 5) })); + + ResearchRegistry.recipes.put( + "BlockWarpwoodSapling", + ThaumcraftApi.addInfusionCraftingRecipe( + "WARPTREE", + new ItemStack(BlockRegistry.BlockWarpwoodSapling), + 3, + new AspectList().add(Aspect.ELDRITCH, 8).add(Aspect.TREE, 8).add(Aspect.DARKNESS, 8), + new ItemStack(Blocks.sapling, 1, Short.MAX_VALUE), + new ItemStack[] { new ItemStack(ItemRegistry.ItemMaterial, 1, 3), + ItemApi.getItem("itemZombieBrain", 0), new ItemStack(ItemRegistry.ItemMaterial, 1, 3), + ItemApi.getItem("itemZombieBrain", 0) })); + + ResearchRegistry.recipes.put( + "ItemWandRod:0", + ThaumcraftApi.addInfusionCraftingRecipe( + "ROD_warpwood", + new ItemStack(ItemRegistry.ItemWandRod), + 8, + new AspectList().add(Aspect.ELDRITCH, 64).add(Aspect.DARKNESS, 32).add(Aspect.TREE, 32) + .add(Aspect.MAGIC, 64), + new ItemStack(BlockRegistry.BlockWarpwoodLog), + new ItemStack[] { ItemApi.getItem("itemEldritchObject", 3), + new ItemStack(ItemRegistry.ItemMaterial), + new ItemStack(ItemRegistry.ItemMaterial, 1, 3), ItemApi.getItem("itemResource", 16), + ItemApi.getItem("itemZombieBrain", 0), new ItemStack(ItemRegistry.ItemMaterial), + new ItemStack(ItemRegistry.ItemMaterial, 1, 3), ItemApi.getItem("itemResource", 16) })); + + 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, 32767), + new ItemStack[] { new ItemStack(Items.slime_ball), ItemApi.getItem("itemGoggles", 0) })); + + 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), + new ItemStack(ItemRegistry.ItemVoidFortressHelmet, 1, 32767), + new ItemStack[] { new ItemStack(Items.dye, 1, 0), new ItemStack(Items.iron_ingot), + new ItemStack(Items.leather), ItemApi.getBlock("blockCustomPlant", 2), + ItemApi.getItem("itemZombieBrain", 0), new ItemStack(Items.iron_ingot) })); + + 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), + new ItemStack(ItemRegistry.ItemVoidFortressHelmet, 1, 32767), + new ItemStack[] { new ItemStack(Items.dye, 1, 15), new ItemStack(Items.iron_ingot), + new ItemStack(Items.leather), new ItemStack(Items.poisonous_potato), + new ItemStack(Items.skull, 1, 1), new ItemStack(Items.iron_ingot) })); + + 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), + new ItemStack(ItemRegistry.ItemVoidFortressHelmet, 1, 32767), + new ItemStack[] { new ItemStack(Items.dye, 1, 1), new ItemStack(Items.iron_ingot), + new ItemStack(Items.leather), new ItemStack(Items.ghast_tear), + new ItemStack(Items.milk_bucket), new ItemStack(Items.iron_ingot) })); + + 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).add(Aspect.VOID, 16), + ItemApi.getItem("itemHelmetVoid", 0), + new ItemStack[] { ItemApi.getItem("itemResource", 16), ItemApi.getItem("itemResource", 16), + new ItemStack(Items.gold_ingot), new ItemStack(Items.gold_ingot), + new ItemStack(Items.emerald) })); + + 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), + ItemApi.getItem("itemChestVoid", 0), + new ItemStack[] { ItemApi.getItem("itemResource", 16), ItemApi.getItem("itemResource", 16), + ItemApi.getItem("itemResource", 16), ItemApi.getItem("itemResource", 16), + new ItemStack(Items.gold_ingot), new ItemStack(Items.leather) })); + + 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), + ItemApi.getItem("itemLegsVoid", 0), + new ItemStack[] { ItemApi.getItem("itemResource", 16), ItemApi.getItem("itemResource", 16), + ItemApi.getItem("itemResource", 16), new ItemStack(Items.gold_ingot), + new ItemStack(Items.leather) })); + + ResearchRegistry.recipes.put( + "ItemWarpedGoggles", + ThaumcraftApi.addInfusionCraftingRecipe( + "WARPEDGOGGLES", + new ItemStack(ItemRegistry.ItemWarpedGoggles), + 3, + new AspectList().add(Aspect.ELDRITCH, 32).add(Aspect.DARKNESS, 16).add(Aspect.MAGIC, 16) + .add(Aspect.ARMOR, 8), + ItemApi.getItem("itemGoggles", 0), + new ItemStack[] { new ItemStack(ItemRegistry.ItemMaterial, 1, 0), + new ItemStack(ItemRegistry.ItemMaterial, 1, 0) })); + + ResearchRegistry.recipes.put( + "ItemWandCap:0", + ThaumcraftApi.addInfusionCraftingRecipe( + "CAP_shadowmetal", + new ItemStack(ItemRegistry.ItemWandCap), + 8, + new AspectList().add(Aspect.ELDRITCH, 64).add(Aspect.DARKNESS, 64).add(Aspect.MAGIC, 64) + .add(Aspect.METAL, 64).add(Aspect.VOID, 64), + ItemApi.getItem("itemWandCap", 7), + new ItemStack[] { new ItemStack(ItemRegistry.ItemMaterial, 1, 3), + new ItemStack(ItemRegistry.ItemMaterial), ItemApi.getItem("itemResource", 16), + new ItemStack(ItemRegistry.ItemMaterial), ItemApi.getItem("itemEldritchObject", 3), + new ItemStack(ItemRegistry.ItemMaterial), ItemApi.getItem("itemResource", 16), + new ItemStack(ItemRegistry.ItemMaterial) })); + + ResearchRegistry.recipes.put( + "ItemFocusTaint", + ThaumcraftApi.addInfusionCraftingRecipe( + "TAINTFOCUS", + new ItemStack(ItemRegistry.ItemFocusTaint), + 4, + new AspectList().add(Aspect.TAINT, 64).add(Aspect.WATER, 64).add(Aspect.MAGIC, 64) + .add(Aspect.SLIME, 64), + ItemApi.getItem("itemFocusPech", 0), + new ItemStack[] { ItemApi.getItem("itemResource", 11), + new ItemStack(ItemRegistry.ItemMaterial, 1, 4), ItemApi.getItem("itemBottleTaint", 0), + new ItemStack(ItemRegistry.ItemMaterial, 1, 4), ItemApi.getItem("itemResource", 11), + new ItemStack(ItemRegistry.ItemMaterial, 1, 4), ItemApi.getItem("itemBottleTaint", 0), + new ItemStack(ItemRegistry.ItemMaterial, 1, 4) })); + + ResearchRegistry.recipes.put( + "ItemFocusEldritch", + ThaumcraftApi.addInfusionCraftingRecipe( + "ELDRITCHFOCUS", + new ItemStack(ItemRegistry.ItemFocusEldritch), + 6, + new AspectList().add(Aspect.ELDRITCH, 64).add(Aspect.DARKNESS, 64).add(Aspect.MAGIC, 64) + .add(Aspect.AIR, 64), + new ItemStack(ItemRegistry.ItemMaterial, 1, 5), + new ItemStack[] { ItemApi.getItem("itemFocusPortableHole", 0), + ItemApi.getItem("itemResource", 16), ItemApi.getItem("itemEldritchObject", 0), + ItemApi.getItem("itemResource", 16), ItemApi.getItem("itemResource", 15), + ItemApi.getItem("itemResource", 16), ItemApi.getItem("itemEldritchObject", 0), + ItemApi.getItem("itemResource", 16) })); + + ResearchRegistry.recipes.put( + "ItemMaterial:8", + ThaumcraftApi.addInfusionCraftingRecipe( + "KNIGHTROBES", + new ItemStack(ItemRegistry.ItemMaterial, 1, 8), + 2, + new AspectList().add(Aspect.DARKNESS, 8).add(Aspect.METAL, 8).add(Aspect.MAGIC, 8), + new ItemStack(Items.iron_ingot), + new ItemStack[] { new ItemStack(ItemRegistry.ItemMaterial, 1, 7), + new ItemStack(ItemRegistry.ItemMaterial, 1, 7), + new ItemStack(ItemRegistry.ItemMaterial, 1, 7), + new ItemStack(ItemRegistry.ItemMaterial, 1, 7) })); + + ResearchRegistry.recipes.put( + "ItemHelmetCultistLeaderPlate", + ThaumcraftApi.addInfusionCraftingRecipe( + "PRAETORARMOR", + ItemApi.getItem("itemHelmetCultistLeaderPlate", 0), + 6, + new AspectList().add(Aspect.DARKNESS, 64).add(Aspect.METAL, 64).add(Aspect.MAGIC, 64) + .add(Aspect.ELDRITCH, 4), + ItemApi.getItem("itemHelmetCultistPlate", 0), + new ItemStack[] { new ItemStack(Items.gold_ingot), + new ItemStack(ItemRegistry.ItemMaterial, 1, 8), + new ItemStack(ItemRegistry.ItemMaterial, 1, 2), + new ItemStack(ItemRegistry.ItemMaterial, 1, 8), new ItemStack(Items.gold_ingot), + new ItemStack(ItemRegistry.ItemMaterial, 1, 8), + new ItemStack(ItemRegistry.ItemMaterial, 1, 2), + new ItemStack(ItemRegistry.ItemMaterial, 1, 8) })); + + ResearchRegistry.recipes.put( + "ItemChestCultistLeaderPlate", + ThaumcraftApi.addInfusionCraftingRecipe( + "PRAETORARMOR", + ItemApi.getItem("itemChestCultistLeaderPlate", 0), + 6, + new AspectList().add(Aspect.DARKNESS, 64).add(Aspect.METAL, 64).add(Aspect.MAGIC, 64) + .add(Aspect.ELDRITCH, 4), + ItemApi.getItem("itemChestCultistPlate", 0), + new ItemStack[] { new ItemStack(Items.gold_ingot), + new ItemStack(ItemRegistry.ItemMaterial, 1, 8), + new ItemStack(ItemRegistry.ItemMaterial, 1, 2), + new ItemStack(ItemRegistry.ItemMaterial, 1, 8), new ItemStack(Items.gold_ingot), + new ItemStack(ItemRegistry.ItemMaterial, 1, 8), + new ItemStack(ItemRegistry.ItemMaterial, 1, 2), + new ItemStack(ItemRegistry.ItemMaterial, 1, 8) })); + + ResearchRegistry.recipes.put( + "ItemLegsCultistLeaderPlate", + ThaumcraftApi.addInfusionCraftingRecipe( + "PRAETORARMOR", + ItemApi.getItem("itemLegsCultistLeaderPlate", 0), + 6, + new AspectList().add(Aspect.DARKNESS, 64).add(Aspect.METAL, 64).add(Aspect.MAGIC, 64) + .add(Aspect.ELDRITCH, 4), + ItemApi.getItem("itemLegsCultistPlate", 0), + new ItemStack[] { new ItemStack(Items.gold_ingot), + new ItemStack(ItemRegistry.ItemMaterial, 1, 8), + new ItemStack(ItemRegistry.ItemMaterial, 1, 2), + new ItemStack(ItemRegistry.ItemMaterial, 1, 8), new ItemStack(Items.gold_ingot), + new ItemStack(ItemRegistry.ItemMaterial, 1, 8), + new ItemStack(ItemRegistry.ItemMaterial, 1, 2), + new ItemStack(ItemRegistry.ItemMaterial, 1, 8) })); + + ResearchRegistry.recipes.put( + "ItemVoidwalkerBoots", + ThaumcraftApi.addInfusionCraftingRecipe( + "VOIDWALKERBOOTS", + new ItemStack(ItemRegistry.ItemVoidwalkerBoots), + 8, + new AspectList().add(Aspect.DARKNESS, 64).add(Aspect.VOID, 64).add(Aspect.ELDRITCH, 64) + .add(Aspect.ARMOR, 64).add(Aspect.TRAVEL, 64), + ItemApi.getItem("itemBootsTraveller", 0), + new ItemStack[] { ItemApi.getItem("itemEldritchObject", 0), ItemApi.getItem("itemResource", 16), + new ItemStack(ItemRegistry.ItemMaterial, 1, 1), + new ItemStack(ItemRegistry.ItemMaterial), + new ItemStack(ItemRegistry.ItemMaterial, 1, 1), ItemApi.getItem("itemResource", 16), + ItemApi.getItem("itemEldritchObject", 0), ItemApi.getItem("itemResource", 16), + new ItemStack(ItemRegistry.ItemMaterial, 1, 1), + new ItemStack(ItemRegistry.ItemMaterial), + new ItemStack(ItemRegistry.ItemMaterial, 1, 1), ItemApi.getItem("itemResource", 16) })); + + ResearchRegistry.recipes.put( + "ItemFocusTime", + ThaumcraftApi.addInfusionCraftingRecipe( + "FOCUSTIME", + new ItemStack(ItemRegistry.ItemFocusTime), + 7, + new AspectList().add(Aspect.VOID, 32).add(Aspect.ELDRITCH, 32).add(Aspect.LIGHT, 32) + .add(Aspect.DARKNESS, 32), + new ItemStack(ItemRegistry.ItemMaterial, 1, 5), + new ItemStack[] { new ItemStack(Items.clock), ItemApi.getBlock("blockCrystal", 0), + ItemApi.getItem("itemFocusPortableHole", 0), ItemApi.getBlock("blockCrystal", 0) })); + + ResearchRegistry.recipes.put( + "ItemFocusMeteorology", + ThaumcraftApi.addInfusionCraftingRecipe( + "FOCUSWEATHER", + new ItemStack(ItemRegistry.ItemFocusMeteorology), + 7, + new AspectList().add(Aspect.VOID, 32).add(Aspect.ELDRITCH, 32).add(Aspect.WATER, 32) + .add(Aspect.WEATHER, 32), + new ItemStack(ItemRegistry.ItemMaterial, 1, 5), + new ItemStack[] { ItemApi.getItem("itemFocusShock", 0), ItemApi.getBlock("blockCrystal", 2), + ItemApi.getItem("itemFocusFrost", 0), ItemApi.getBlock("blockCrystal", 2) })); + + ResearchRegistry.recipes.put( + "ItemThaumicDisassembler", + ThaumcraftApi.addInfusionCraftingRecipe( + "THAUMICDISASSEMBLER", + new ItemStack(ItemRegistry.ItemThaumicDisassembler), + 3, + new AspectList().add(Aspect.METAL, 16).add(Aspect.TOOL, 16).add(Aspect.WEAPON, 16) + .add(Aspect.VOID, 16), + new ItemStack(ItemRegistry.ItemMaterial, 1, 6), + new ItemStack[] { ItemApi.getItem("itemPickVoid", 0), ItemApi.getItem("itemResource", 2), + ItemApi.getItem("itemShovelVoid", 0), ItemApi.getItem("itemResource", 2), + ItemApi.getItem("itemSwordVoid", 0), ItemApi.getItem("itemResource", 2), + ItemApi.getItem("itemAxeVoid", 0), ItemApi.getItem("itemResource", 2) })); + + 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, 32767), + new ItemStack[] { new ItemStack(Items.slime_ball), ItemApi.getItem("itemGoggles", 0) })); + + 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), + new ItemStack(ItemRegistry.ItemShadowFortressHelmet, 1, 32767), + new ItemStack[] { new ItemStack(Items.dye, 1, 0), new ItemStack(Items.iron_ingot), + new ItemStack(Items.leather), ItemApi.getBlock("blockCustomPlant", 2), + ItemApi.getItem("itemZombieBrain", 0), new ItemStack(Items.iron_ingot) })); + + 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), + new ItemStack(ItemRegistry.ItemShadowFortressHelmet, 1, 32767), + new ItemStack[] { new ItemStack(Items.dye, 1, 15), new ItemStack(Items.iron_ingot), + new ItemStack(Items.leather), new ItemStack(Items.poisonous_potato), + new ItemStack(Items.skull, 1, 1), new ItemStack(Items.iron_ingot) })); + + 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), + new ItemStack(ItemRegistry.ItemShadowFortressHelmet, 1, 32767), + new ItemStack[] { new ItemStack(Items.dye, 1, 1), new ItemStack(Items.iron_ingot), + new ItemStack(Items.leather), new ItemStack(Items.ghast_tear), + new ItemStack(Items.milk_bucket), new ItemStack(Items.iron_ingot) })); + + ResearchRegistry.recipes.put( + "ItemShadowFortressHelmet", + ThaumcraftApi.addInfusionCraftingRecipe( + "SHADOWFORTRESSARMOR", + new ItemStack(ItemRegistry.ItemShadowFortressHelmet), + 7, + new AspectList().add(Aspect.METAL, 28).add(Aspect.ARMOR, 20).add(Aspect.MAGIC, 12) + .add(Aspect.DARKNESS, 30).add(Aspect.VOID, 22), + ItemApi.getItem("itemHelmetVoid", 0), + new ItemStack[] { new ItemStack(BlockRegistry.BlockShadowmetal), + new ItemStack(BlockRegistry.BlockShadowmetal), new ItemStack(Items.gold_ingot), + new ItemStack(Items.gold_ingot), new ItemStack(Items.emerald) })); + + ResearchRegistry.recipes.put( + "ItemShadowFortressChestplate", + ThaumcraftApi.addInfusionCraftingRecipe( + "SHADOWFORTRESSARMOR", + 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), + ItemApi.getItem("itemChestVoid", 0), + new ItemStack[] { new ItemStack(BlockRegistry.BlockShadowmetal), + new ItemStack(BlockRegistry.BlockShadowmetal), + new ItemStack(BlockRegistry.BlockShadowmetal), + new ItemStack(BlockRegistry.BlockShadowmetal), new ItemStack(Items.gold_ingot), + new ItemStack(Items.leather) })); + + ResearchRegistry.recipes.put( + "ItemShadowFortressLeggings", + ThaumcraftApi.addInfusionCraftingRecipe( + "SHADOWFORTRESSARMOR", + new ItemStack(ItemRegistry.ItemShadowFortressLeggings), + 7, + new AspectList().add(Aspect.METAL, 32).add(Aspect.ARMOR, 24).add(Aspect.MAGIC, 16) + .add(Aspect.DARKNESS, 32).add(Aspect.VOID, 24), + ItemApi.getItem("itemLegsVoid", 0), + new ItemStack[] { new ItemStack(BlockRegistry.BlockShadowmetal), + new ItemStack(BlockRegistry.BlockShadowmetal), + new ItemStack(BlockRegistry.BlockShadowmetal), new ItemStack(Items.gold_ingot), + new ItemStack(Items.leather) })); + + ResearchRegistry.recipes.put( + "ItemKatana:0", + ThaumcraftApi.addInfusionCraftingRecipe( + "THAUMIUMKATANA", + new ItemStack(ItemRegistry.ItemKatana, 1, 0), + 3, + new AspectList().add(Aspect.METAL, 48).add(Aspect.WEAPON, 48).add(Aspect.MAGIC, 32), + new ItemStack(ConfigItems.itemSwordThaumium), + new ItemStack[] { new ItemStack(Blocks.obsidian), new ItemStack(ConfigItems.itemResource, 1, 2), + new ItemStack(Items.gold_ingot), new ItemStack(Items.emerald), + new ItemStack(Items.iron_ingot), new ItemStack(ConfigItems.itemResource, 1, 2), + new ItemStack(Blocks.obsidian), new ItemStack(ConfigItems.itemResource, 1, 2), + new ItemStack(Items.gold_ingot), new ItemStack(Items.emerald), + new ItemStack(Items.iron_ingot), new ItemStack(ConfigItems.itemResource, 1, 2) })); + + ResearchRegistry.recipes.put( + "ItemKatana:1", + ThaumcraftApi.addInfusionCraftingRecipe( + "VOIDMETALKATANA", + new ItemStack(ItemRegistry.ItemKatana, 1, 1), + 6, + new AspectList().add(Aspect.METAL, 48).add(Aspect.WEAPON, 48).add(Aspect.MAGIC, 42) + .add(Aspect.VOID, 46).add(Aspect.ELDRITCH, 12), + new ItemStack(ConfigItems.itemSwordVoid), + new ItemStack[] { new ItemStack(Blocks.obsidian), + new ItemStack(ConfigItems.itemResource, 1, 16), new ItemStack(Items.gold_ingot), + new ItemStack(Items.emerald), new ItemStack(Items.iron_ingot), + new ItemStack(ConfigItems.itemResource, 1, 16), new ItemStack(Blocks.obsidian), + new ItemStack(ConfigItems.itemResource, 1, 16), new ItemStack(Items.gold_ingot), + new ItemStack(Items.emerald), new ItemStack(Items.iron_ingot), + new ItemStack(ConfigItems.itemResource, 1, 16) })); + + ResearchRegistry.recipes.put( + "ItemKatana:2", + ThaumcraftApi.addInfusionCraftingRecipe( + "SHADOWMETALKATANA", + new ItemStack(ItemRegistry.ItemKatana, 1, 2), + 7, + new AspectList().add(Aspect.METAL, 48).add(Aspect.WEAPON, 48).add(Aspect.MAGIC, 32) + .add(Aspect.VOID, 16).add(Aspect.DARKNESS, 46), + new ItemStack(ItemRegistry.ItemShadowmetalSword), + new ItemStack[] { new ItemStack(Blocks.obsidian), + new ItemStack(ItemRegistry.ItemMaterial, 1, 0), new ItemStack(Items.iron_ingot), + new ItemStack(Items.emerald), new ItemStack(Items.iron_ingot), + new ItemStack(ItemRegistry.ItemMaterial, 1, 0), new ItemStack(Blocks.obsidian), + new ItemStack(ItemRegistry.ItemMaterial, 1, 0), new ItemStack(Items.iron_ingot), + new ItemStack(Items.emerald), new ItemStack(Items.iron_ingot), + new ItemStack(ItemRegistry.ItemMaterial, 1, 0) })); + + /** + * The ItemKatanaThaumium recipes are for the thaumonomicon + */ + ResearchRegistry.recipes.put( + "ItemKatanaThaumium:inscription0", + ThaumcraftApi.addInfusionCraftingRecipe( + "INSCRIPTIONFIRE", + new Object[] { "inscription", new NBTTagInt(0) }, + 8, + new AspectList().add(Aspect.FIRE, 64).add(Aspect.LIGHT, 64).add(Aspect.METAL, 16), + new ItemStack(ItemRegistry.ItemKatana, 1, 0), + new ItemStack[] { ItemApi.getItem("itemFocusFire", 0), new ItemStack(Items.coal), + new ItemStack(Blocks.netherrack), new ItemStack(Items.fire_charge), + new ItemStack(Items.blaze_powder), ItemApi.getItem("itemResource", 1) })); + + ResearchRegistry.recipes.put( + "ItemKatanaThaumium:inscription1", + ThaumcraftApi.addInfusionCraftingRecipe( + "INSCRIPTIONTAINT", + new Object[] { "inscription", new NBTTagInt(1) }, + 8, + new AspectList().add(Aspect.TAINT, 64).add(Aspect.FLESH, 64).add(Aspect.METAL, 16), + new ItemStack(ItemRegistry.ItemKatana, 1, 0), + new ItemStack[] { new ItemStack(ItemRegistry.ItemFocusTaint), + new ItemStack(ItemRegistry.ItemMaterial, 1, 4), ItemApi.getBlock("blockJar", 1), + ItemApi.getBlock("blockCustomPlant", 5), ItemApi.getItem("itemBottleTaint", 0), + ItemApi.getItem("itemResource", 11) })); + + ResearchRegistry.recipes.put( + "ItemKatanaThaumium:inscription2", + ThaumcraftApi.addInfusionCraftingRecipe( + "INSCRIPTIONUNDEAD", + new Object[] { "inscription", new NBTTagInt(2) }, + 8, + new AspectList().add(Aspect.HEAL, 64).add(Aspect.UNDEAD, 64).add(Aspect.METAL, 16), + new ItemStack(ItemRegistry.ItemKatana, 1, 0), + new ItemStack[] { new ItemStack(ConfigItems.itemZombieBrain), new ItemStack(Items.bone), + new ItemStack(Items.rotten_flesh), new ItemStack(Items.fermented_spider_eye), + new ItemStack(ConfigItems.itemFocusPech), new ItemStack(ConfigItems.itemBathSalts) })); + + ResearchRegistry.recipes.put( + "ItemKatana:inscription0", + ThaumcraftApi.addInfusionCraftingRecipe( + "INSCRIPTIONFIRE", + new Object[] { "inscription", new NBTTagInt(0) }, + 8, + new AspectList().add(Aspect.FIRE, 64).add(Aspect.LIGHT, 64).add(Aspect.METAL, 16), + new ItemStack(ItemRegistry.ItemKatana, 1, 32767), + new ItemStack[] { ItemApi.getItem("itemFocusFire", 0), new ItemStack(Items.coal), + new ItemStack(Blocks.netherrack), new ItemStack(Items.fire_charge), + new ItemStack(Items.blaze_powder), ItemApi.getItem("itemResource", 1) })); + + ResearchRegistry.recipes.put( + "ItemKatana:inscription1", + ThaumcraftApi.addInfusionCraftingRecipe( + "INSCRIPTIONTAINT", + new Object[] { "inscription", new NBTTagInt(1) }, + 8, + new AspectList().add(Aspect.TAINT, 64).add(Aspect.FLESH, 64).add(Aspect.METAL, 16), + new ItemStack(ItemRegistry.ItemKatana, 1, 32767), + new ItemStack[] { new ItemStack(ItemRegistry.ItemFocusTaint), + new ItemStack(ItemRegistry.ItemMaterial, 1, 4), ItemApi.getBlock("blockJar", 1), + ItemApi.getBlock("blockCustomPlant", 5), ItemApi.getItem("itemBottleTaint", 0), + ItemApi.getItem("itemResource", 11) })); + + ResearchRegistry.recipes.put( + "ItemKatana:inscription2", + ThaumcraftApi.addInfusionCraftingRecipe( + "INSCRIPTIONUNDEAD", + new Object[] { "inscription", new NBTTagInt(2) }, + 8, + new AspectList().add(Aspect.HEAL, 64).add(Aspect.UNDEAD, 64).add(Aspect.METAL, 16), + new ItemStack(ItemRegistry.ItemKatana, 1, 32767), + new ItemStack[] { new ItemStack(ConfigItems.itemZombieBrain), new ItemStack(Items.bone), + new ItemStack(Items.rotten_flesh), new ItemStack(Items.fermented_spider_eye), + new ItemStack(ConfigItems.itemFocusPech), new ItemStack(ConfigItems.itemBathSalts) })); + + ResearchRegistry.recipes.put( + "ItemVoidmetalGoggles", + ThaumcraftApi.addInfusionCraftingRecipe( + "VOIDGOGGLES", + new ItemStack(ItemRegistry.ItemVoidmetalGoggles), + 5, + new AspectList().add(Aspect.VOID, 42).add(Aspect.SENSES, 38).add(Aspect.DARKNESS, 16) + .add(Aspect.CRYSTAL, 6).add(Aspect.ARMOR, 24), + new ItemStack(ItemRegistry.ItemWarpedGoggles, 1, 32767), + new ItemStack[] { new ItemStack(ConfigItems.itemResource, 1, 16), + new ItemStack(ConfigItems.itemResource, 1, 16), + new ItemStack(ConfigItems.itemResource, 1, 7), + new ItemStack(ConfigItems.itemResource, 1, 7), + new ItemStack(ConfigItems.itemShard, 1, 6) })); + } + + public static void initArcane() { + ResearchRegistry.recipes.put( + "ItemMaterial:2", + ThaumcraftApi.addArcaneCraftingRecipe( + "CRIMSONROBES", + new ItemStack(ItemRegistry.ItemMaterial, 1, 2), + new AspectList().add(Aspect.ORDER, 5).add(Aspect.WATER, 5).add(Aspect.EARTH, 5) + .add(Aspect.AIR, 5).add(Aspect.FIRE, 5).add(Aspect.ENTROPY, 5), + new Object[] { " A ", "ABA", " A ", Character.valueOf('A'), + new ItemStack(ItemRegistry.ItemMaterial, 1, 7), Character.valueOf('B'), + ItemApi.getItem("itemResource", 7) })); + + ResearchRegistry.recipes.put( + "ItemMaterial:6", + ThaumcraftApi.addArcaneCraftingRecipe( + "THAUMICDISASSEMBLER", + new ItemStack(ItemRegistry.ItemMaterial, 1, 6), + new AspectList().add(Aspect.ORDER, 50).add(Aspect.ENTROPY, 50), + new Object[] { "BAB", "ACA", "BAB", Character.valueOf('A'), ItemApi.getItem("itemResource", 2), + Character.valueOf('B'), ItemApi.getItem("itemResource", 16), Character.valueOf('C'), + new ItemStack(Items.diamond) })); + + ResearchRegistry.recipes.put( + "ItemHelmetCultistRobe", + ThaumcraftApi.addArcaneCraftingRecipe( + "CRIMSONROBES", + ItemApi.getItem("itemHelmetCultistRobe", 0), + new AspectList().add(Aspect.ORDER, 5).add(Aspect.WATER, 5).add(Aspect.EARTH, 5) + .add(Aspect.AIR, 5).add(Aspect.FIRE, 5).add(Aspect.ENTROPY, 5), + new Object[] { "AAA", "ABA", Character.valueOf('A'), + new ItemStack(ItemRegistry.ItemMaterial, 1, 2), Character.valueOf('B'), + new ItemStack(Items.iron_ingot) })); + + ResearchRegistry.recipes.put( + "ItemChestCultistRobe", + ThaumcraftApi.addArcaneCraftingRecipe( + "CRIMSONROBES", + ItemApi.getItem("itemChestCultistRobe", 0), + new AspectList().add(Aspect.ORDER, 5).add(Aspect.WATER, 5).add(Aspect.EARTH, 5) + .add(Aspect.AIR, 5).add(Aspect.FIRE, 5).add(Aspect.ENTROPY, 5), + new Object[] { "A A", "AAA", "ABA", Character.valueOf('A'), + new ItemStack(ItemRegistry.ItemMaterial, 1, 2), Character.valueOf('B'), + new ItemStack(Items.gold_ingot) })); + + ResearchRegistry.recipes.put( + "ItemLegsCultistRobe", + ThaumcraftApi.addArcaneCraftingRecipe( + "CRIMSONROBES", + ItemApi.getItem("itemLegsCultistRobe", 0), + new AspectList().add(Aspect.ORDER, 5).add(Aspect.WATER, 5).add(Aspect.EARTH, 5) + .add(Aspect.AIR, 5).add(Aspect.FIRE, 5).add(Aspect.ENTROPY, 5), + new Object[] { "ABA", "ACA", "A A", Character.valueOf('A'), + new ItemStack(ItemRegistry.ItemMaterial, 1, 2), Character.valueOf('B'), + new ItemStack(Items.gold_ingot), Character.valueOf('C'), + new ItemStack(Items.iron_ingot) })); + + ResearchRegistry.recipes.put( + "ItemBootsCultist", + ThaumcraftApi.addArcaneCraftingRecipe( + "CRIMSONROBES", + ItemApi.getItem("itemBootsCultist", 0), + new AspectList().add(Aspect.ORDER, 5).add(Aspect.WATER, 5).add(Aspect.EARTH, 5) + .add(Aspect.AIR, 5).add(Aspect.FIRE, 5).add(Aspect.ENTROPY, 5), + new Object[] { "A A", "A A", Character.valueOf('A'), + new ItemStack(ItemRegistry.ItemMaterial, 1, 2) })); + + ResearchRegistry.recipes.put( + "ItemWandRod:1", + ThaumcraftApi.addArcaneCraftingRecipe( + "ROD_warpwood_staff", + new ItemStack(ItemRegistry.ItemWandRod, 1, 1), + new AspectList().add(Aspect.ORDER, 120).add(Aspect.WATER, 120).add(Aspect.EARTH, 120) + .add(Aspect.AIR, 120).add(Aspect.FIRE, 120).add(Aspect.ENTROPY, 120), + new Object[] { " A", " B ", "B ", Character.valueOf('A'), + new ItemStack(ConfigItems.itemEldritchObject, 1, 3), Character.valueOf('B'), + new ItemStack(ItemRegistry.ItemWandRod, 1, 0) })); + + ResearchRegistry.recipes.put( + "ItemHelmetCultistPlate", + ThaumcraftApi.addArcaneCraftingRecipe( + "KNIGHTROBES", + ItemApi.getItem("itemHelmetCultistPlate", 0), + new AspectList().add(Aspect.ORDER, 5).add(Aspect.WATER, 5).add(Aspect.EARTH, 5) + .add(Aspect.AIR, 5).add(Aspect.FIRE, 5).add(Aspect.ENTROPY, 5), + new Object[] { "ABA", "A A", Character.valueOf('A'), + new ItemStack(ItemRegistry.ItemMaterial, 1, 8), Character.valueOf('B'), + new ItemStack(ItemRegistry.ItemMaterial, 1, 2) })); + + ResearchRegistry.recipes.put( + "ItemChestCultistPlate", + ThaumcraftApi.addArcaneCraftingRecipe( + "KNIGHTROBES", + ItemApi.getItem("itemChestCultistPlate", 0), + new AspectList().add(Aspect.ORDER, 5).add(Aspect.WATER, 5).add(Aspect.EARTH, 5) + .add(Aspect.AIR, 5).add(Aspect.FIRE, 5).add(Aspect.ENTROPY, 5), + new Object[] { "A A", "ABA", "ABA", Character.valueOf('A'), + new ItemStack(ItemRegistry.ItemMaterial, 1, 8), Character.valueOf('B'), + new ItemStack(ItemRegistry.ItemMaterial, 1, 2) })); + + ResearchRegistry.recipes.put( + "ItemLegsCultistPlate", + ThaumcraftApi.addArcaneCraftingRecipe( + "KNIGHTROBES", + ItemApi.getItem("itemLegsCultistPlate", 0), + new AspectList().add(Aspect.ORDER, 5).add(Aspect.WATER, 5).add(Aspect.EARTH, 5) + .add(Aspect.AIR, 5).add(Aspect.FIRE, 5).add(Aspect.ENTROPY, 5), + new Object[] { "AAA", "A A", "B B", Character.valueOf('A'), + new ItemStack(ItemRegistry.ItemMaterial, 1, 8), Character.valueOf('B'), + new ItemStack(ItemRegistry.ItemMaterial, 1, 2) })); + + 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).add(Aspect.FIRE, 1).add(Aspect.ENTROPY, 1), + new Object[] { " A ", "BBB", " A ", Character.valueOf('A'), + new ItemStack(ItemRegistry.ItemMaterial), Character.valueOf('B'), + ItemApi.getItem("itemResource", 7) })); + + ResearchRegistry.recipes.put( + "ItemMagicFunguar", + ThaumcraftApi.addShapelessArcaneCraftingRecipe( + "MAGICFUNGUAR", + new ItemStack(ItemRegistry.ItemMagicFunguar), + new AspectList().add(Aspect.ORDER, 1).add(Aspect.WATER, 1).add(Aspect.EARTH, 1) + .add(Aspect.AIR, 1).add(Aspect.FIRE, 1).add(Aspect.ENTROPY, 1), + new Object[] { new ItemStack(ConfigBlocks.blockCustomPlant, 1, 5), + new ItemStack(ConfigItems.itemShard, 1, 32767), new ItemStack(Blocks.brown_mushroom), + new ItemStack(Blocks.red_mushroom), new ItemStack(Items.blaze_powder) })); + + ResearchRegistry.recipes.put( + "ItemCrystalDagger", + ThaumcraftApi.addArcaneCraftingRecipe( + "CRIMSONROBES", + new ItemStack(ItemRegistry.ItemCrystalDagger), + new AspectList().add(Aspect.EARTH, 85).add(Aspect.FIRE, 85).add(Aspect.ENTROPY, 85), + new Object[] { " A", " B ", "C ", Character.valueOf('A'), ItemApi.getItem("itemResource", 16), + Character.valueOf('B'), ItemApi.getBlock("blockTube", 7), Character.valueOf('C'), + "logWood" })); + + 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), + new Object[] { "AAA", "A A", Character.valueOf('A'), ItemApi.getItem("itemResource", 7) })); + + ResearchRegistry.recipes.put( + "ItemWandCap:2", + ThaumcraftApi.addArcaneCraftingRecipe( + "CAP_crimsoncloth", + new ItemStack(ItemRegistry.ItemWandCap, 1, 2), + new AspectList().add(Aspect.EARTH, 25).add(Aspect.FIRE, 25).add(Aspect.ENTROPY, 25) + .add(Aspect.ORDER, 25), + new Object[] { "AAA", "ABA", Character.valueOf('A'), + new ItemStack(ItemRegistry.ItemMaterial, 1, 2), Character.valueOf('B'), + ItemApi.getItem("itemResource", 14) })); + + 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, 55), + new Object[] { "AAA", "ABA", Character.valueOf('A'), + new ItemStack(ItemRegistry.ItemMaterial, 1, 1), Character.valueOf('B'), + ItemApi.getItem("itemResource", 14) })); + + 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), + new Object[] { "BDC", "DAD", "CDB", 'A', new ItemStack(ConfigItems.itemResource, 1, 3), 'B', + new ItemStack(ConfigItems.itemShard, 1, 6), 'C', + new ItemStack(ItemRegistry.ItemMaterial, 1, 4), 'D', + new ItemStack(ConfigItems.itemWispEssence, 1, 32767) })); + } + + public static void initCrucible() { + ResearchRegistry.recipes.put( + "ItemMaterial:3", + ThaumcraftApi.addCrucibleRecipe( + "EVILSHARDS", + new ItemStack(ItemRegistry.ItemMaterial, 1, 3), + ItemApi.getItem("itemShard", 6), + new AspectList().merge(Aspect.ELDRITCH, 4))); + ResearchRegistry.recipes.put( + "ItemMaterial:4", + ThaumcraftApi.addCrucibleRecipe( + "EVILSHARDS", + new ItemStack(ItemRegistry.ItemMaterial, 1, 4), + ItemApi.getItem("itemShard", 6), + new AspectList().merge(Aspect.TAINT, 4))); + ResearchRegistry.recipes.put( + "BlockShadowOre", + ThaumcraftApi.addCrucibleRecipe( + "SHADOWMETAL", + new ItemStack(BlockRegistry.BlockShadowOre), + new ItemStack(Blocks.stone), + new AspectList().merge(Aspect.VOID, 2).merge(Aspect.DARKNESS, 4).merge(Aspect.METAL, 6) + .merge(Aspect.MAGIC, 8))); + ResearchRegistry.recipes.put( + "ItemVoidsentBlood", + ThaumcraftApi.addCrucibleRecipe( + "VOIDSENTBLOOD", + new ItemStack(ItemRegistry.ItemVoidsentBlood), + new ItemStack(ItemRegistry.ItemMaterial, 1, 7), + new AspectList().merge(Aspect.VOID, 12).merge(Aspect.DARKNESS, 4).merge(Aspect.AURA, 6) + .merge(Aspect.ARMOR, 8))); + } +} diff --git a/src/main/java/taintedmagic/common/registry/ResearchRegistry.java b/src/main/java/taintedmagic/common/registry/ResearchRegistry.java index 6581513..b0f3cf2 100644 --- a/src/main/java/taintedmagic/common/registry/ResearchRegistry.java +++ b/src/main/java/taintedmagic/common/registry/ResearchRegistry.java @@ -1,18 +1,11 @@ package taintedmagic.common.registry; -import java.util.ArrayList; import java.util.HashMap; -import org.lwjgl.opengl.GL11; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; -import net.minecraft.item.crafting.RecipesWeapons; -import net.minecraft.nbt.NBTTagByte; import net.minecraft.util.ResourceLocation; + import taintedmagic.common.TaintedMagic; import taintedmagic.common.helper.TaintedMagicHelper; import taintedmagic.common.research.TaintedMagicResearchItem; @@ -23,287 +16,707 @@ import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.crafting.CrucibleRecipe; import thaumcraft.api.crafting.IArcaneRecipe; -import thaumcraft.api.crafting.InfusionEnchantmentRecipe; import thaumcraft.api.crafting.InfusionRecipe; -import thaumcraft.api.research.ResearchPage.PageType; import thaumcraft.api.research.*; -import thaumcraft.client.lib.UtilsFX; -import thaumcraft.common.Thaumcraft; import thaumcraft.common.config.ConfigItems; -public class ResearchRegistry -{ - public static final String TM = "TM"; - public static HashMap recipes = new HashMap(); +public class ResearchRegistry { - public static ItemStack getOriginalItem (String name, String category) - { - return ((ResearchCategoryList) ResearchCategories.researchCategories.get(category)).research.get(name).icon_item; - } + public static final String TM = "TM"; + public static HashMap recipes = new HashMap(); - public static void initResearch () - { - ResearchCategories.registerCategory(TM, new ResourceLocation("taintedmagic:textures/misc/IconThaumonomiconTab.png"), TaintedMagic.configHandler.useCustomResearchTabBackground ? new ResourceLocation("taintedmagic:textures/gui/GUIThaumonomiconTab.png") : new ResourceLocation("thaumcraft:textures/gui/gui_researchback.png")); + public static ItemStack getOriginalItem(String name, String category) { + return ((ResearchCategoryList) ResearchCategories.researchCategories.get(category)).research + .get(name).icon_item; + } - /** - * Thaumcraft research items - */ - new ThaumcraftResearchItem("TMELDRITCHMAJOR", TM, "ELDRITCHMAJOR", "ELDRITCH", 6, -7, new ResourceLocation("thaumcraft:textures/misc/r_eldritchmajor.png")).setSpecial().setConcealed().setRound().registerResearchItem(); + public static void initResearch() { + ResearchCategories.registerCategory( + TM, + new ResourceLocation("taintedmagic:textures/misc/IconThaumonomiconTab.png"), + TaintedMagic.configHandler.useCustomResearchTabBackground + ? new ResourceLocation("taintedmagic:textures/gui/GUIThaumonomiconTab.png") + : new ResourceLocation("thaumcraft:textures/gui/gui_researchback.png")); - /** - * Tainted Magic research items - */ - new TaintedMagicResearchItem("TAINTEDMAGIC", TM, new AspectList(), 2, -1, 0, new ItemStack(ConfigItems.itemResource, 1, 13)).setRound().setAutoUnlock().setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage("2") }).registerResearchItem(); + /** + * Thaumcraft research items + */ + new ThaumcraftResearchItem( + "TMELDRITCHMAJOR", + TM, + "ELDRITCHMAJOR", + "ELDRITCH", + 6, + -7, + new ResourceLocation("thaumcraft:textures/misc/r_eldritchmajor.png")).setSpecial().setConcealed() + .setRound().registerResearchItem(); - new TaintedMagicResearchItem("SHADOWMETAL", TM, new AspectList().add(Aspect.METAL, 1).add(Aspect.DARKNESS, 1).add(Aspect.MAGIC, 1), 0, 1, 0, new ItemStack(BlockRegistry.BlockShadowOre)).setParents("TAINTEDMAGIC").setConcealed().setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((CrucibleRecipe) recipes.get("BlockShadowOre")), - new ResearchPage(new ItemStack(BlockRegistry.BlockShadowOre)), - new ResearchPage((IRecipe) recipes.get("BlockShadowmetal")), - new ResearchPage((IRecipe) recipes.get("ItemShadowmetalPick")), - new ResearchPage((IRecipe) recipes.get("ItemShadowmetalSpade")), - new ResearchPage((IRecipe) recipes.get("ItemShadowmetalAxe")), - new ResearchPage((IRecipe) recipes.get("ItemShadowmetalHoe")), - new ResearchPage((IRecipe) recipes.get("ItemShadowmetalSword")) }).registerResearchItem(); + /** + * Tainted Magic research items + */ + new TaintedMagicResearchItem( + "TAINTEDMAGIC", + TM, + new AspectList(), + 2, + -1, + 0, + new ItemStack(ConfigItems.itemResource, 1, 13)).setRound().setAutoUnlock() + .setPages(new ResearchPage[] { new ResearchPage("1"), new ResearchPage("2") }) + .registerResearchItem(); - ThaumcraftApi.addWarpToResearch("SHADOWMETAL", 2); + new TaintedMagicResearchItem( + "SHADOWMETAL", + TM, + new AspectList().add(Aspect.METAL, 1).add(Aspect.DARKNESS, 1).add(Aspect.MAGIC, 1), + 0, + 1, + 0, + new ItemStack(BlockRegistry.BlockShadowOre)) + .setParents("TAINTEDMAGIC").setConcealed() + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((CrucibleRecipe) recipes.get("BlockShadowOre")), + new ResearchPage(new ItemStack(BlockRegistry.BlockShadowOre)), + new ResearchPage((IRecipe) recipes.get("BlockShadowmetal")), + new ResearchPage((IRecipe) recipes.get("ItemShadowmetalPick")), + new ResearchPage((IRecipe) recipes.get("ItemShadowmetalSpade")), + new ResearchPage((IRecipe) recipes.get("ItemShadowmetalAxe")), + new ResearchPage((IRecipe) recipes.get("ItemShadowmetalHoe")), + new ResearchPage((IRecipe) recipes.get("ItemShadowmetalSword")) }) + .registerResearchItem(); - new TaintedMagicResearchItem("CAP_shadowmetal", TM, new AspectList().add(Aspect.METAL, 4).add(Aspect.DARKNESS, 4).add(Aspect.ELDRITCH, 4).add(Aspect.MAGIC, 4), -2, -2, 0, new ItemStack(ItemRegistry.ItemWandCap, 1, 0)).setParents(new String[]{ - "SHADOWMETAL", - "CAP_void", - "PRIMPEARL" }).setComplexity(2).setParentsHidden("SHADOWCLOTH").setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((InfusionRecipe) recipes.get("ItemWandCap:0")) }).setConcealed().registerResearchItem(); + ThaumcraftApi.addWarpToResearch("SHADOWMETAL", 2); - ThaumcraftApi.addWarpToResearch("CAPSHADOWMETAL", 5); + new TaintedMagicResearchItem( + "CAP_shadowmetal", + TM, + new AspectList().add(Aspect.METAL, 4).add(Aspect.DARKNESS, 4).add(Aspect.ELDRITCH, 4) + .add(Aspect.MAGIC, 4), + -2, + -2, + 0, + new ItemStack(ItemRegistry.ItemWandCap, 1, 0)) + .setParents(new String[] { "SHADOWMETAL", "CAP_void", "PRIMPEARL" }).setComplexity(2) + .setParentsHidden("SHADOWCLOTH") + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((InfusionRecipe) recipes.get("ItemWandCap:0")) }) + .setConcealed().registerResearchItem(); - new TaintedMagicResearchItem("SHADOWCLOTH", TM, new AspectList().add(Aspect.CLOTH, 1).add(Aspect.DARKNESS, 1), -1, 2, 0, new ItemStack(ItemRegistry.ItemMaterial, 1, 1)).setConcealed().setSecondary().setParents(new String[]{ - "ENCHFABRIC", - "SHADOWMETAL" }).setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((IArcaneRecipe) recipes.get("ItemMaterial:1")) }).registerResearchItem(); + ThaumcraftApi.addWarpToResearch("CAPSHADOWMETAL", 5); - new TaintedMagicResearchItem("ROD_warpwood", TM, new AspectList().add(Aspect.TREE, 4).add(Aspect.DARKNESS, 4).add(Aspect.ELDRITCH, 4), 8, -2, 0, new ItemStack(ItemRegistry.ItemWandRod, 1, 0)).setParents(new String[]{ - "WARPTREE", - "VOIDMETAL", - "PRIMPEARL", - "ROD_primal_staff" }).setParentsHidden("SHADOWMETAL").setConcealed().setComplexity(3).setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((InfusionRecipe) recipes.get("ItemWandRod:0")), - new ResearchPage("2") }).registerResearchItem(); - ThaumcraftApi.addWarpToResearch("WANDRODWARP", 3); + new TaintedMagicResearchItem( + "SHADOWCLOTH", + TM, + new AspectList().add(Aspect.CLOTH, 1).add(Aspect.DARKNESS, 1), + -1, + 2, + 0, + new ItemStack(ItemRegistry.ItemMaterial, 1, 1)).setConcealed().setSecondary() + .setParents(new String[] { "ENCHFABRIC", "SHADOWMETAL" }) + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((IArcaneRecipe) recipes.get("ItemMaterial:1")) }) + .registerResearchItem(); - new TaintedMagicResearchItem("ROD_warpwood_staff", TM, new AspectList().add(Aspect.TREE, 4).add(Aspect.DARKNESS, 4).add(Aspect.ELDRITCH, 4), 9, -2, 0, new ItemStack(ItemRegistry.ItemWandRod, 1, 1)).setConcealed().setParents("ROD_warpwood").setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((IArcaneRecipe) recipes.get("ItemWandRod:1")) }).setSecondary().registerResearchItem(); + new TaintedMagicResearchItem( + "ROD_warpwood", + TM, + new AspectList().add(Aspect.TREE, 4).add(Aspect.DARKNESS, 4).add(Aspect.ELDRITCH, 4), + 8, + -2, + 0, + new ItemStack(ItemRegistry.ItemWandRod, 1, 0)) + .setParents(new String[] { "WARPTREE", "VOIDMETAL", "PRIMPEARL", "ROD_primal_staff" }) + .setParentsHidden("SHADOWMETAL").setConcealed().setComplexity(3) + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((InfusionRecipe) recipes.get("ItemWandRod:0")), + new ResearchPage("2") }) + .registerResearchItem(); + ThaumcraftApi.addWarpToResearch("WANDRODWARP", 3); - new TaintedMagicResearchItem("EVILSHARDS", TM, new AspectList().add(Aspect.CRYSTAL, 4).add(Aspect.DARKNESS, 4), 4, 0, 0, new ItemStack(ItemRegistry.ItemMaterial, 1, 4)).setParents("TAINTEDMAGIC").setConcealed().setSecondary().setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((CrucibleRecipe) recipes.get("ItemMaterial:3")), - new ResearchPage((CrucibleRecipe) recipes.get("ItemMaterial:4")) }).registerResearchItem(); + new TaintedMagicResearchItem( + "ROD_warpwood_staff", + TM, + new AspectList().add(Aspect.TREE, 4).add(Aspect.DARKNESS, 4).add(Aspect.ELDRITCH, 4), + 9, + -2, + 0, + new ItemStack(ItemRegistry.ItemWandRod, 1, 1)) + .setConcealed().setParents("ROD_warpwood") + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((IArcaneRecipe) recipes.get("ItemWandRod:1")) }) + .setSecondary().registerResearchItem(); - new TaintedMagicResearchItem("WARPTREE", TM, new AspectList().add(Aspect.ELDRITCH, 4).add(Aspect.DARKNESS, 4).add(Aspect.TAINT, 4).add(Aspect.TREE, 4), 6, -1, 0, new ItemStack(BlockRegistry.BlockWarpwoodSapling)).setParentsHidden("SHADOWMETAL").setParents("EVILSHARDS").setConcealed().setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((InfusionRecipe) recipes.get("BlockWarpwoodSapling")), - new ResearchPage((IRecipe) recipes.get("BlockWarpwoodPlanks")) }).registerResearchItem(); - ThaumcraftApi.addWarpToResearch("WARPTREE", 3); + new TaintedMagicResearchItem( + "EVILSHARDS", + TM, + new AspectList().add(Aspect.CRYSTAL, 4).add(Aspect.DARKNESS, 4), + 4, + 0, + 0, + new ItemStack(ItemRegistry.ItemMaterial, 1, 4)) + .setParents("TAINTEDMAGIC").setConcealed().setSecondary() + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((CrucibleRecipe) recipes.get("ItemMaterial:3")), + new ResearchPage((CrucibleRecipe) recipes.get("ItemMaterial:4")) }) + .registerResearchItem(); - new TaintedMagicResearchItem("CRIMSONROBES", TM, new AspectList().add(Aspect.CLOTH, 4).add(Aspect.EXCHANGE, 4).add(Aspect.ARMOR, 4), -2, -5, 0, new ItemStack(ItemRegistry.ItemMaterial, 1, 2)).setParents("CRYSTALDAGGER").setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((IArcaneRecipe) recipes.get("ItemMaterial:2")), - new ResearchPage((IArcaneRecipe) recipes.get("ItemHelmetCultistRobe")), - new ResearchPage((IArcaneRecipe) recipes.get("ItemChestCultistRobe")), - new ResearchPage((IArcaneRecipe) recipes.get("ItemLegsCultistRobe")), - new ResearchPage((IArcaneRecipe) recipes.get("ItemBootsCultist")) }).setConcealed().registerResearchItem(); + new TaintedMagicResearchItem( + "WARPTREE", + TM, + new AspectList().add(Aspect.ELDRITCH, 4).add(Aspect.DARKNESS, 4).add(Aspect.TAINT, 4) + .add(Aspect.TREE, 4), + 6, + -1, + 0, + new ItemStack(BlockRegistry.BlockWarpwoodSapling)).setParentsHidden("SHADOWMETAL") + .setParents("EVILSHARDS").setConcealed() + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((InfusionRecipe) recipes.get("BlockWarpwoodSapling")), + new ResearchPage((IRecipe) recipes.get("BlockWarpwoodPlanks")) }) + .registerResearchItem(); + ThaumcraftApi.addWarpToResearch("WARPTREE", 3); - new TaintedMagicResearchItem("VOIDFORTRESS", TM, new AspectList().add(Aspect.ARMOR, 5).add(Aspect.ELDRITCH, 3).add(Aspect.DARKNESS, 3).add(Aspect.VOID, 5), 7, -8, 0, new ItemStack(ItemRegistry.ItemVoidFortressHelmet)).setParentsHidden(new String[]{ - "ARMORVOIDFORTRESS", - "ARMORFORTRESS", }).setParents(new String[]{ "TMELDRITCHMAJOR" }).setConcealed().setSecondary().setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((InfusionRecipe) recipes.get("ItemVoidFortressHelmet")), - new ResearchPage((InfusionRecipe) recipes.get("ItemVoidFortressChestplate")), - new ResearchPage((InfusionRecipe) recipes.get("ItemVoidFortressLeggings")) }).registerResearchItem(); + new TaintedMagicResearchItem( + "CRIMSONROBES", + TM, + new AspectList().add(Aspect.CLOTH, 4).add(Aspect.EXCHANGE, 4).add(Aspect.ARMOR, 4), + -2, + -5, + 0, + new ItemStack(ItemRegistry.ItemMaterial, 1, 2)) + .setParents("CRYSTALDAGGER") + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((IArcaneRecipe) recipes.get("ItemMaterial:2")), + new ResearchPage((IArcaneRecipe) recipes.get("ItemHelmetCultistRobe")), + new ResearchPage((IArcaneRecipe) recipes.get("ItemChestCultistRobe")), + new ResearchPage((IArcaneRecipe) recipes.get("ItemLegsCultistRobe")), + new ResearchPage((IArcaneRecipe) recipes.get("ItemBootsCultist")) }) + .setConcealed().registerResearchItem(); - new TaintedMagicResearchItem("WARPEDGOGGLES", TM, new AspectList().add(Aspect.ARMOR, 4).add(Aspect.ELDRITCH, 4).add(Aspect.DARKNESS, 4).add(Aspect.ARMOR, 4), 2, 3, 0, new ItemStack(ItemRegistry.ItemWarpedGoggles)).setParentsHidden(new String[]{ - "TAINTEDMAGIC", - "GOGGLES", }).setConcealed().setSecondary().setParents("SHADOWMETAL").setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((InfusionRecipe) recipes.get("ItemWarpedGoggles")) }).registerResearchItem(); + new TaintedMagicResearchItem( + "VOIDFORTRESS", + TM, + new AspectList().add(Aspect.ARMOR, 5).add(Aspect.ELDRITCH, 3).add(Aspect.DARKNESS, 3) + .add(Aspect.VOID, 5), + 7, + -8, + 0, + new ItemStack(ItemRegistry.ItemVoidFortressHelmet)) + .setParentsHidden(new String[] { "ARMORVOIDFORTRESS", "ARMORFORTRESS", }) + .setParents(new String[] { "TMELDRITCHMAJOR" }).setConcealed().setSecondary() + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((InfusionRecipe) recipes.get("ItemVoidFortressHelmet")), + new ResearchPage((InfusionRecipe) recipes.get("ItemVoidFortressChestplate")), + new ResearchPage((InfusionRecipe) recipes.get("ItemVoidFortressLeggings")) }) + .registerResearchItem(); - new TaintedMagicResearchItem("TAINTFOCUS", TM, new AspectList().add(Aspect.TAINT, 4).add(Aspect.WATER, 4).add(Aspect.SLIME, 4).add(Aspect.AIR, 4), 5, 2, 0, new ItemStack(ItemRegistry.ItemFocusTaint)).setParentsHidden(new String[]{ - "SHADOWMETAL", - "TAINTEDMAGIC", - "INFUSION", - "BOTTLETAINT", - "FOCUSFIRE" }).setParents(new String[]{ "EVILSHARDS" }).setConcealed().setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((InfusionRecipe) recipes.get("ItemFocusTaint")) }).registerResearchItem(); - ThaumcraftApi.addWarpToResearch("TAINTFOCUS", 4); + new TaintedMagicResearchItem( + "WARPEDGOGGLES", + TM, + new AspectList().add(Aspect.ARMOR, 4).add(Aspect.ELDRITCH, 4).add(Aspect.DARKNESS, 4) + .add(Aspect.ARMOR, 4), + 2, + 3, + 0, + new ItemStack(ItemRegistry.ItemWarpedGoggles)) + .setParentsHidden(new String[] { "TAINTEDMAGIC", "GOGGLES", }).setConcealed().setSecondary() + .setParents("SHADOWMETAL") + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((InfusionRecipe) recipes.get("ItemWarpedGoggles")) }) + .registerResearchItem(); - new TaintedMagicResearchItem("ELDRITCHFOCUS", TM, new AspectList().add(Aspect.ELDRITCH, 22).add(Aspect.ENTROPY, 14).add(Aspect.AIR, 4).add(Aspect.DARKNESS, 6), 8, -4, 0, new ItemStack(ItemRegistry.ItemFocusEldritch)).setParentsHidden(new String[]{ - "SHADOWMETAL", - "EVILSHARDS", - "FOCUSFIRE", - "INFUSION" }).setParents("CREATIONSHARD").setConcealed().setSecondary().setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((InfusionRecipe) recipes.get("ItemFocusEldritch")), - new ResearchPage("2") }).registerResearchItem(); - ThaumcraftApi.addWarpToResearch("ELDRITCHFOCUS", 2); + new TaintedMagicResearchItem( + "TAINTFOCUS", + TM, + new AspectList().add(Aspect.TAINT, 4).add(Aspect.WATER, 4).add(Aspect.SLIME, 4).add(Aspect.AIR, 4), + 5, + 2, + 0, + new ItemStack(ItemRegistry.ItemFocusTaint)) + .setParentsHidden( + new String[] { "SHADOWMETAL", "TAINTEDMAGIC", "INFUSION", "BOTTLETAINT", "FOCUSFIRE" }) + .setParents(new String[] { "EVILSHARDS" }).setConcealed() + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((InfusionRecipe) recipes.get("ItemFocusTaint")) }) + .registerResearchItem(); + ThaumcraftApi.addWarpToResearch("TAINTFOCUS", 4); - new TaintedMagicResearchItem("KNIGHTROBES", TM, new AspectList().add(Aspect.CLOTH, 4).add(Aspect.DARKNESS, 4).add(Aspect.ARMOR, 4), -4, -4, 0, new ItemStack(ItemRegistry.ItemMaterial, 1, 8)).setParentsHidden("ELDRITCHMINOR").setParents("CRIMSONROBES").setConcealed().setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((InfusionRecipe) recipes.get("ItemMaterial:8")), - new ResearchPage((IArcaneRecipe) recipes.get("ItemHelmetCultistPlate")), - new ResearchPage((IArcaneRecipe) recipes.get("ItemChestCultistPlate")), - new ResearchPage((IArcaneRecipe) recipes.get("ItemLegsCultistPlate")) }).registerResearchItem(); + new TaintedMagicResearchItem( + "ELDRITCHFOCUS", + TM, + new AspectList().add(Aspect.ELDRITCH, 22).add(Aspect.ENTROPY, 14).add(Aspect.AIR, 4) + .add(Aspect.DARKNESS, 6), + 8, + -4, + 0, + new ItemStack(ItemRegistry.ItemFocusEldritch)) + .setParentsHidden(new String[] { "SHADOWMETAL", "EVILSHARDS", "FOCUSFIRE", "INFUSION" }) + .setParents("CREATIONSHARD").setConcealed().setSecondary() + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((InfusionRecipe) recipes.get("ItemFocusEldritch")), + new ResearchPage("2") }) + .registerResearchItem(); + ThaumcraftApi.addWarpToResearch("ELDRITCHFOCUS", 2); - new TaintedMagicResearchItem("PRAETORARMOR", TM, new AspectList().add(Aspect.CLOTH, 4).add(Aspect.DARKNESS, 4).add(Aspect.ARMOR, 4).add(Aspect.ELDRITCH, 4), -6, -4, 0, ItemApi.getItem("itemHelmetCultistLeaderPlate", 0)).setParents("KNIGHTROBES").setParentsHidden(new String[]{ - "CRIMSONROBES", - "TMELDRITCHMAJOR", - "VOIDMETAL" }).setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((InfusionRecipe) recipes.get("ItemHelmetCultistLeaderPlate")), - new ResearchPage((InfusionRecipe) recipes.get("ItemChestCultistLeaderPlate")), - new ResearchPage((InfusionRecipe) recipes.get("ItemLegsCultistLeaderPlate")) }).setConcealed().registerResearchItem(); + new TaintedMagicResearchItem( + "KNIGHTROBES", + TM, + new AspectList().add(Aspect.CLOTH, 4).add(Aspect.DARKNESS, 4).add(Aspect.ARMOR, 4), + -4, + -4, + 0, + new ItemStack(ItemRegistry.ItemMaterial, 1, 8)).setParentsHidden("ELDRITCHMINOR") + .setParents("CRIMSONROBES").setConcealed() + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((InfusionRecipe) recipes.get("ItemMaterial:8")), + new ResearchPage((IArcaneRecipe) recipes.get("ItemHelmetCultistPlate")), + new ResearchPage((IArcaneRecipe) recipes.get("ItemChestCultistPlate")), + new ResearchPage((IArcaneRecipe) recipes.get("ItemLegsCultistPlate")) }) + .registerResearchItem(); - new TaintedMagicResearchItem("VOIDSENTBLOOD", TM, new AspectList().add(Aspect.VOID, 14).add(Aspect.DARKNESS, 8).add(Aspect.ARMOR, 18).add(Aspect.AURA, 4), -7, -5, 0, new ItemStack(ItemRegistry.ItemVoidsentBlood)).setSecondary().setParents("PRAETORARMOR").setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((CrucibleRecipe) recipes.get("ItemVoidsentBlood")) }).registerResearchItem(); + new TaintedMagicResearchItem( + "PRAETORARMOR", + TM, + new AspectList().add(Aspect.CLOTH, 4).add(Aspect.DARKNESS, 4).add(Aspect.ARMOR, 4) + .add(Aspect.ELDRITCH, 4), + -6, + -4, + 0, + ItemApi.getItem("itemHelmetCultistLeaderPlate", 0)).setParents("KNIGHTROBES") + .setParentsHidden(new String[] { "CRIMSONROBES", "TMELDRITCHMAJOR", "VOIDMETAL" }) + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((InfusionRecipe) recipes.get("ItemHelmetCultistLeaderPlate")), + new ResearchPage((InfusionRecipe) recipes.get("ItemChestCultistLeaderPlate")), + new ResearchPage((InfusionRecipe) recipes.get("ItemLegsCultistLeaderPlate")) }) + .setConcealed().registerResearchItem(); - new TaintedMagicResearchItem("VOIDWALKERBOOTS", TM, new AspectList().add(Aspect.MAGIC, 4).add(Aspect.DARKNESS, 8).add(Aspect.ARMOR, 8).add(Aspect.ELDRITCH, 8), 4, -8, 0, new ItemStack(ItemRegistry.ItemVoidwalkerBoots)).setParentsHidden(new String[]{ - "TMELDRITCHMAJOR", - "BOOTSTRAVELLER", - "EVILSHARDS", - "SHADOWCLOTH", - "ARMORVOIDFORTRESS" }).setConcealed().setParents(new String[]{ "TMELDRITCHMAJOR" }).setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((InfusionRecipe) recipes.get("ItemVoidwalkerBoots")) }).registerResearchItem(); - ThaumcraftApi.addWarpToResearch("VOIDWALKERBOOTS", 3); + new TaintedMagicResearchItem( + "VOIDSENTBLOOD", + TM, + new AspectList().add(Aspect.VOID, 14).add(Aspect.DARKNESS, 8).add(Aspect.ARMOR, 18).add(Aspect.AURA, 4), + -7, + -5, + 0, + new ItemStack(ItemRegistry.ItemVoidsentBlood)) + .setSecondary().setParents("PRAETORARMOR") + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((CrucibleRecipe) recipes.get("ItemVoidsentBlood")) }) + .registerResearchItem(); - new TaintedMagicResearchItem("CREATIONSHARD", TM, TaintedMagicHelper.getPrimals(16), 8, -5, 0, new ItemStack(ItemRegistry.ItemMaterial, 1, 5)).setConcealed().setParents("TMELDRITCHMAJOR").setParentsHidden("PRIMPEARL").setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((InfusionRecipe) recipes.get("ItemMaterial:5")) }).setSecondary().registerResearchItem(); - ThaumcraftApi.addWarpToResearch("CREATIONSHARD", 5); + new TaintedMagicResearchItem( + "VOIDWALKERBOOTS", + TM, + new AspectList().add(Aspect.MAGIC, 4).add(Aspect.DARKNESS, 8).add(Aspect.ARMOR, 8) + .add(Aspect.ELDRITCH, 8), + 4, + -8, + 0, + new ItemStack(ItemRegistry.ItemVoidwalkerBoots)) + .setParentsHidden( + new String[] { "TMELDRITCHMAJOR", "BOOTSTRAVELLER", "EVILSHARDS", "SHADOWCLOTH", + "ARMORVOIDFORTRESS" }) + .setConcealed().setParents(new String[] { "TMELDRITCHMAJOR" }) + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((InfusionRecipe) recipes.get("ItemVoidwalkerBoots")) }) + .registerResearchItem(); + ThaumcraftApi.addWarpToResearch("VOIDWALKERBOOTS", 3); - new TaintedMagicResearchItem("CREATION", TM, new AspectList().add(Aspect.MAGIC, 4), 10, -6, 0, new ResourceLocation("taintedmagic:textures/misc/IconCREATION.png")).setParents("CREATIONSHARD").setConcealed().setRound().setSpecial().setHidden().setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage("2"), - new ResearchPage("3"), - new ResearchPage("4"), - new ResearchPage("5") }).registerResearchItem(); - ThaumcraftApi.addWarpToResearch("CREATION", 5); + new TaintedMagicResearchItem( + "CREATIONSHARD", + TM, + TaintedMagicHelper.getPrimals(16), + 8, + -5, + 0, + new ItemStack(ItemRegistry.ItemMaterial, 1, 5)).setConcealed().setParents("TMELDRITCHMAJOR") + .setParentsHidden("PRIMPEARL") + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((InfusionRecipe) recipes.get("ItemMaterial:5")) }) + .setSecondary().registerResearchItem(); + ThaumcraftApi.addWarpToResearch("CREATIONSHARD", 5); - new TaintedMagicResearchItem("FOCUSTIME", TM, new AspectList().add(Aspect.FIRE, 4).add(Aspect.WATER, 8).add(Aspect.EARTH, 4).add(Aspect.AIR, 4).add(Aspect.ORDER, 4).add(Aspect.ENTROPY, 4).add(Aspect.EXCHANGE, 4), 11, -8, 0, new ItemStack(ItemRegistry.ItemFocusTime)).setConcealed().setParents("CREATION").setParentsHidden("FOCUSPORTABLEHOLE", "FOCUSFIRE").setComplexity(3).setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((InfusionRecipe) recipes.get("ItemFocusTime")) }).registerResearchItem(); - ThaumcraftApi.addWarpToResearch("FOCUSTIME", 3); + new TaintedMagicResearchItem( + "CREATION", + TM, + new AspectList().add(Aspect.MAGIC, 4), + 10, + -6, + 0, + new ResourceLocation("taintedmagic:textures/misc/IconCREATION.png")).setParents("CREATIONSHARD") + .setConcealed().setRound().setSpecial().setHidden() + .setPages( + new ResearchPage[] { new ResearchPage("1"), new ResearchPage("2"), + new ResearchPage("3"), new ResearchPage("4"), new ResearchPage("5") }) + .registerResearchItem(); + ThaumcraftApi.addWarpToResearch("CREATION", 5); - new TaintedMagicResearchItem("FOCUSWEATHER", TM, new AspectList().add(Aspect.FIRE, 4).add(Aspect.WATER, 8).add(Aspect.EARTH, 4).add(Aspect.AIR, 4).add(Aspect.ORDER, 4).add(Aspect.ENTROPY, 4).add(Aspect.WEATHER, 4), 12, -7, 0, new ItemStack(ItemRegistry.ItemFocusMeteorology)).setParentsHidden(new String[]{ - "FOCUSFROST", - "FOCUSSHOCK" }).setConcealed().setParents("CREATION").setComplexity(3).setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((InfusionRecipe) recipes.get("ItemFocusMeteorology")) }).registerResearchItem(); - ThaumcraftApi.addWarpToResearch("FOCUSWEATHER", 3); + new TaintedMagicResearchItem( + "FOCUSTIME", + TM, + new AspectList().add(Aspect.FIRE, 4).add(Aspect.WATER, 8).add(Aspect.EARTH, 4).add(Aspect.AIR, 4) + .add(Aspect.ORDER, 4).add(Aspect.ENTROPY, 4).add(Aspect.EXCHANGE, 4), + 11, + -8, + 0, + new ItemStack(ItemRegistry.ItemFocusTime)).setConcealed().setParents("CREATION") + .setParentsHidden("FOCUSPORTABLEHOLE", "FOCUSFIRE").setComplexity(3) + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((InfusionRecipe) recipes.get("ItemFocusTime")) }) + .registerResearchItem(); + ThaumcraftApi.addWarpToResearch("FOCUSTIME", 3); - new TaintedMagicResearchItem("THAUMICDISASSEMBLER", TM, new AspectList().add(Aspect.METAL, 4).add(Aspect.WEAPON, 8).add(Aspect.TOOL, 4), 5, -6, 0, new ItemStack(ItemRegistry.ItemThaumicDisassembler)).setParentsHidden(new String[]{ - "THAUMIUM", - "VOIDMETAL" }).setConcealed().setParents("TMELDRITCHMAJOR").setComplexity(2).setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((InfusionRecipe) recipes.get("ItemThaumicDisassembler")), - new ResearchPage((IArcaneRecipe) recipes.get("ItemMaterial:6")), - new ResearchPage("2") }).registerResearchItem(); + new TaintedMagicResearchItem( + "FOCUSWEATHER", + TM, + new AspectList().add(Aspect.FIRE, 4).add(Aspect.WATER, 8).add(Aspect.EARTH, 4).add(Aspect.AIR, 4) + .add(Aspect.ORDER, 4).add(Aspect.ENTROPY, 4).add(Aspect.WEATHER, 4), + 12, + -7, + 0, + new ItemStack(ItemRegistry.ItemFocusMeteorology)) + .setParentsHidden(new String[] { "FOCUSFROST", "FOCUSSHOCK" }).setConcealed() + .setParents("CREATION").setComplexity(3) + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((InfusionRecipe) recipes.get("ItemFocusMeteorology")) }) + .registerResearchItem(); + ThaumcraftApi.addWarpToResearch("FOCUSWEATHER", 3); - new TaintedMagicResearchItem("VOIDSASH", TM, new AspectList().add(Aspect.VOID, 4).add(Aspect.METAL, 8).add(Aspect.ARMOR, 4), 3, -8, 0, new ItemStack(ItemRegistry.ItemVoidwalkerSash)).setParentsHidden("PRIMPEARL").setParents("VOIDWALKERBOOTS").setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((InfusionRecipe) recipes.get("ItemVoidwalkerSash")) }).setConcealed().setSecondary().registerResearchItem(); + new TaintedMagicResearchItem( + "THAUMICDISASSEMBLER", + TM, + new AspectList().add(Aspect.METAL, 4).add(Aspect.WEAPON, 8).add(Aspect.TOOL, 4), + 5, + -6, + 0, + new ItemStack(ItemRegistry.ItemThaumicDisassembler)) + .setParentsHidden(new String[] { "THAUMIUM", "VOIDMETAL" }).setConcealed() + .setParents("TMELDRITCHMAJOR").setComplexity(2) + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((InfusionRecipe) recipes.get("ItemThaumicDisassembler")), + new ResearchPage((IArcaneRecipe) recipes.get("ItemMaterial:6")), + new ResearchPage("2") }) + .registerResearchItem(); - new TaintedMagicResearchItem("MAGICFUNGUAR", TM, new AspectList().add(Aspect.MAGIC, 2).add(Aspect.HUNGER, 4).add(Aspect.PLANT, 2), 3, -2, 0, new ItemStack(ItemRegistry.ItemMagicFunguar)).setSecondary().setParents("TAINTEDMAGIC").setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((IArcaneRecipe) recipes.get("ItemMagicFunguar")) }).setConcealed().registerResearchItem(); + new TaintedMagicResearchItem( + "VOIDSASH", + TM, + new AspectList().add(Aspect.VOID, 4).add(Aspect.METAL, 8).add(Aspect.ARMOR, 4), + 3, + -8, + 0, + new ItemStack(ItemRegistry.ItemVoidwalkerSash)).setParentsHidden("PRIMPEARL") + .setParents("VOIDWALKERBOOTS") + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((InfusionRecipe) recipes.get("ItemVoidwalkerSash")) }) + .setConcealed().setSecondary().registerResearchItem(); - new TaintedMagicResearchItem("CRYSTALDAGGER", TM, new AspectList().add(Aspect.WEAPON, 4).add(Aspect.FIRE, 4).add(Aspect.HEAL, 4), 0, -3, 0, new ItemStack(ItemRegistry.ItemCrystalDagger, 1, 7)).setParentsHidden("ENCHFABRIC", "ESSENTIACRYSTAL", "VOIDMETAL").setParents("TAINTEDMAGIC").setComplexity(2).setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((IArcaneRecipe) recipes.get("ItemCrystalDagger")) }).registerResearchItem(); - ThaumcraftApi.addWarpToResearch("CRYSTALDAGGER", 2); + new TaintedMagicResearchItem( + "MAGICFUNGUAR", + TM, + new AspectList().add(Aspect.MAGIC, 2).add(Aspect.HUNGER, 4).add(Aspect.PLANT, 2), + 3, + -2, + 0, + new ItemStack(ItemRegistry.ItemMagicFunguar)) + .setSecondary().setParents("TAINTEDMAGIC") + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((IArcaneRecipe) recipes.get("ItemMagicFunguar")) }) + .setConcealed().registerResearchItem(); - new TaintedMagicResearchItem("MACEFOCUS", TM, new AspectList().add(Aspect.ENTROPY, 1).add(Aspect.EARTH, 1).add(Aspect.WEAPON, 1).add(Aspect.MAGIC, 1), 0, 4, 0, new ItemStack(ItemRegistry.ItemFocusMageMace)).setParents("SHADOWMETAL").setConcealed().setComplexity(2).setParentsHidden("FOCUSFIRE").setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((InfusionRecipe) recipes.get("ItemFocusMageMace")) }).registerResearchItem(); + new TaintedMagicResearchItem( + "CRYSTALDAGGER", + TM, + new AspectList().add(Aspect.WEAPON, 4).add(Aspect.FIRE, 4).add(Aspect.HEAL, 4), + 0, + -3, + 0, + new ItemStack(ItemRegistry.ItemCrystalDagger, 1, 7)) + .setParentsHidden("ENCHFABRIC", "ESSENTIACRYSTAL", "VOIDMETAL").setParents("TAINTEDMAGIC") + .setComplexity(2) + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((IArcaneRecipe) recipes.get("ItemCrystalDagger")) }) + .registerResearchItem(); + ThaumcraftApi.addWarpToResearch("CRYSTALDAGGER", 2); - new TaintedMagicResearchItem("CRIMSONBLADE", TM, new AspectList().add(Aspect.ENTROPY, 8).add(Aspect.ELDRITCH, 2).add(Aspect.WEAPON, 16).add(Aspect.VOID, 6), -7, -3, 0, ItemApi.getItem("itemSwordCrimson", 0)).setParents("PRAETORARMOR").setConcealed().setComplexity(3).setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((InfusionRecipe) recipes.get("ItemSwordCrimson")) }).setSecondary().registerResearchItem(); - ThaumcraftApi.addWarpToResearch("CRIMSONBLADE", 3); + new TaintedMagicResearchItem( + "MACEFOCUS", + TM, + new AspectList().add(Aspect.ENTROPY, 1).add(Aspect.EARTH, 1).add(Aspect.WEAPON, 1).add(Aspect.MAGIC, 1), + 0, + 4, + 0, + new ItemStack(ItemRegistry.ItemFocusMageMace)).setParents("SHADOWMETAL").setConcealed().setComplexity(2) + .setParentsHidden("FOCUSFIRE") + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((InfusionRecipe) recipes.get("ItemFocusMageMace")) }) + .registerResearchItem(); - new TaintedMagicResearchItem("SHADOWFORTRESSARMOR", TM, new AspectList().add(Aspect.METAL, 4).add(Aspect.DARKNESS, 8).add(Aspect.ARMOR, 8).add(Aspect.VOID, 2), -3, -1, 0, new ItemStack(ItemRegistry.ItemShadowFortressHelmet)).setParents("SHADOWMETAL").setConcealed().setComplexity(3).setParentsHidden("VOIDFORTRESS", "TMELDRITCHMAJOR", "EVILSHARDS").setSecondary().setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((InfusionRecipe) recipes.get("ItemShadowFortressHelmet")), - new ResearchPage((InfusionRecipe) recipes.get("ItemShadowFortressChestplate")), - new ResearchPage((InfusionRecipe) recipes.get("ItemShadowFortressLeggings")) }).registerResearchItem(); - ThaumcraftApi.addWarpToResearch("SHADOWFORTRESSARMOR", 3); + new TaintedMagicResearchItem( + "CRIMSONBLADE", + TM, + new AspectList().add(Aspect.ENTROPY, 8).add(Aspect.ELDRITCH, 2).add(Aspect.WEAPON, 16) + .add(Aspect.VOID, 6), + -7, + -3, + 0, + ItemApi.getItem("itemSwordCrimson", 0)) + .setParents("PRAETORARMOR").setConcealed().setComplexity(3) + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((InfusionRecipe) recipes.get("ItemSwordCrimson")) }) + .setSecondary().registerResearchItem(); + ThaumcraftApi.addWarpToResearch("CRIMSONBLADE", 3); - new TaintedMagicResearchItem("CAP_cloth", TM, new AspectList().add(Aspect.MAGIC, 4).add(Aspect.CLOTH, 4), 7, 5, 0, new ItemStack(ItemRegistry.ItemWandCap, 1, 1)).setParentsHidden("CAP_gold", "ENCHFABRIC").setConcealed().setSecondary().setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((IArcaneRecipe) recipes.get("ItemWandCap:1")) }).registerResearchItem(); + new TaintedMagicResearchItem( + "SHADOWFORTRESSARMOR", + TM, + new AspectList().add(Aspect.METAL, 4).add(Aspect.DARKNESS, 8).add(Aspect.ARMOR, 8).add(Aspect.VOID, 2), + -3, + -1, + 0, + new ItemStack(ItemRegistry.ItemShadowFortressHelmet)).setParents("SHADOWMETAL").setConcealed() + .setComplexity(3).setParentsHidden("VOIDFORTRESS", "TMELDRITCHMAJOR", "EVILSHARDS") + .setSecondary() + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((InfusionRecipe) recipes.get("ItemShadowFortressHelmet")), + new ResearchPage((InfusionRecipe) recipes.get("ItemShadowFortressChestplate")), + new ResearchPage((InfusionRecipe) recipes.get("ItemShadowFortressLeggings")) }) + .registerResearchItem(); + ThaumcraftApi.addWarpToResearch("SHADOWFORTRESSARMOR", 3); - new TaintedMagicResearchItem("CAP_crimsoncloth", TM, new AspectList().add(Aspect.MAGIC, 8).add(Aspect.CLOTH, 4).add(Aspect.HEAL, 8), -1, -6, 0, new ItemStack(ItemRegistry.ItemWandCap, 1, 2)).setParentsHidden("CAP_cloth").setSecondary().setConcealed().setParents("CRIMSONROBES").setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((IArcaneRecipe) recipes.get("ItemWandCap:2")) }).registerResearchItem(); + new TaintedMagicResearchItem( + "CAP_cloth", + TM, + new AspectList().add(Aspect.MAGIC, 4).add(Aspect.CLOTH, 4), + 7, + 5, + 0, + new ItemStack(ItemRegistry.ItemWandCap, 1, 1)).setParentsHidden("CAP_gold", "ENCHFABRIC").setConcealed() + .setSecondary() + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((IArcaneRecipe) recipes.get("ItemWandCap:1")) }) + .registerResearchItem(); - new TaintedMagicResearchItem("CAP_shadowcloth", TM, new AspectList().add(Aspect.MAGIC, 16).add(Aspect.CLOTH, 8).add(Aspect.VOID, 16).add(Aspect.DARKNESS, 8), -2, 3, 0, new ItemStack(ItemRegistry.ItemWandCap, 1, 3)).setParentsHidden("CAP_cloth", "CAP_thaumium").setSecondary().setConcealed().setParents("SHADOWCLOTH").setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((IArcaneRecipe) recipes.get("ItemWandCap:3")) }).registerResearchItem(); - ThaumcraftApi.addWarpToResearch("CAPSHADOWCLOTH", 1); + new TaintedMagicResearchItem( + "CAP_crimsoncloth", + TM, + new AspectList().add(Aspect.MAGIC, 8).add(Aspect.CLOTH, 4).add(Aspect.HEAL, 8), + -1, + -6, + 0, + new ItemStack(ItemRegistry.ItemWandCap, 1, 2)).setParentsHidden("CAP_cloth").setSecondary() + .setConcealed().setParents("CRIMSONROBES") + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((IArcaneRecipe) recipes.get("ItemWandCap:2")) }) + .registerResearchItem(); - new TaintedMagicResearchItem("FOCUSTAINTEDBLAST", TM, new AspectList().add(Aspect.MAGIC, 20).add(Aspect.TAINT, 12).add(Aspect.AIR, 6).add(Aspect.MOTION, 12), 5, 3, 0, new ItemStack(ItemRegistry.ItemFocusTaintedBlast)).setParentsHidden("FOCUSFIRE", "ELDRITCHMINOR", "FOCUSSHOCK").setConcealed().setParents("TAINTFOCUS").setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((InfusionRecipe) recipes.get("ItemFocusTaintedBlast")) }).setSecondary().registerResearchItem(); - ThaumcraftApi.addWarpToResearch("FOCUSTAINTEDBLAST", 2); + new TaintedMagicResearchItem( + "CAP_shadowcloth", + TM, + new AspectList().add(Aspect.MAGIC, 16).add(Aspect.CLOTH, 8).add(Aspect.VOID, 16) + .add(Aspect.DARKNESS, 8), + -2, + 3, + 0, + new ItemStack(ItemRegistry.ItemWandCap, 1, 3)).setParentsHidden("CAP_cloth", "CAP_thaumium") + .setSecondary().setConcealed().setParents("SHADOWCLOTH") + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((IArcaneRecipe) recipes.get("ItemWandCap:3")) }) + .registerResearchItem(); + ThaumcraftApi.addWarpToResearch("CAPSHADOWCLOTH", 1); - new TaintedMagicResearchItem("PRIMALBLADE", TM, new AspectList().add(Aspect.MAGIC, 1).add(Aspect.ELDRITCH, 1).add(Aspect.WEAPON, 1).add(Aspect.VOID, 1).add(Aspect.AURA, 1), 11, -5, 0, new ItemStack(ItemRegistry.ItemPrimordialEdge)).setParentsHidden("VOIDMETAL", "PRIMALCRUSHER", "EVILSHARDS", "CRYSTALDAGGER").setConcealed().setParents("CREATION").setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((InfusionRecipe) recipes.get("ItemPrimordialEdge")) }).registerResearchItem(); - ThaumcraftApi.addWarpToResearch("PRIMALBLADE", 4); + new TaintedMagicResearchItem( + "FOCUSTAINTEDBLAST", + TM, + new AspectList().add(Aspect.MAGIC, 20).add(Aspect.TAINT, 12).add(Aspect.AIR, 6).add(Aspect.MOTION, 12), + 5, + 3, + 0, + new ItemStack(ItemRegistry.ItemFocusTaintedBlast)) + .setParentsHidden("FOCUSFIRE", "ELDRITCHMINOR", "FOCUSSHOCK").setConcealed() + .setParents("TAINTFOCUS") + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((InfusionRecipe) recipes.get("ItemFocusTaintedBlast")) }) + .setSecondary().registerResearchItem(); + ThaumcraftApi.addWarpToResearch("FOCUSTAINTEDBLAST", 2); - new TaintedMagicResearchItem("BLOODLUSTUPGRADE", TM, new AspectList().add(Aspect.MAGIC, 4).add(Aspect.HEAL, 8).add(Aspect.WEAPON, 8), 1, -4, 0, new ResourceLocation("taintedmagic:textures/foci/IconBloodlust.png")).setParentsHidden("MACEFOCUS", "FOCALMANIPULATION").setConcealed().setParents("CRYSTALDAGGER").setSecondary().setPages(new ResearchPage[]{ new ResearchPage("1") }).registerResearchItem(); + new TaintedMagicResearchItem( + "PRIMALBLADE", + TM, + new AspectList().add(Aspect.MAGIC, 1).add(Aspect.ELDRITCH, 1).add(Aspect.WEAPON, 1).add(Aspect.VOID, 1) + .add(Aspect.AURA, 1), + 11, + -5, + 0, + new ItemStack(ItemRegistry.ItemPrimordialEdge)) + .setParentsHidden("VOIDMETAL", "PRIMALCRUSHER", "EVILSHARDS", "CRYSTALDAGGER").setConcealed() + .setParents("CREATION") + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((InfusionRecipe) recipes.get("ItemPrimordialEdge")) }) + .registerResearchItem(); + ThaumcraftApi.addWarpToResearch("PRIMALBLADE", 4); - new TaintedMagicResearchItem("THAUMIUMKATANA", TM, new AspectList().add(Aspect.METAL, 8).add(Aspect.MAGIC, 4).add(Aspect.WEAPON, 6), 7, 1, 0, new ItemStack(ItemRegistry.ItemKatana, 1, 0)).setParentsHidden("ARMORFORTRESS").setConcealed().setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((InfusionRecipe) recipes.get("ItemKatana:0")) }).registerResearchItem(); + new TaintedMagicResearchItem( + "BLOODLUSTUPGRADE", + TM, + new AspectList().add(Aspect.MAGIC, 4).add(Aspect.HEAL, 8).add(Aspect.WEAPON, 8), + 1, + -4, + 0, + new ResourceLocation("taintedmagic:textures/foci/IconBloodlust.png")) + .setParentsHidden("MACEFOCUS", "FOCALMANIPULATION").setConcealed().setParents("CRYSTALDAGGER") + .setSecondary().setPages(new ResearchPage[] { new ResearchPage("1") }).registerResearchItem(); - new TaintedMagicResearchItem("VOIDMETALKATANA", TM, new AspectList().add(Aspect.METAL, 16).add(Aspect.MAGIC, 8).add(Aspect.WEAPON, 12).add(Aspect.VOID, 12), 7, -9, 0, new ItemStack(ItemRegistry.ItemKatana, 1, 1)).setParentsHidden("THAUMIUMKATANA").setParents("VOIDFORTRESS").setConcealed().setSecondary().setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((InfusionRecipe) recipes.get("ItemKatana:1")) }).registerResearchItem(); - ThaumcraftApi.addWarpToResearch("VOIDMETALKATANA", 4); + new TaintedMagicResearchItem( + "THAUMIUMKATANA", + TM, + new AspectList().add(Aspect.METAL, 8).add(Aspect.MAGIC, 4).add(Aspect.WEAPON, 6), + 7, + 1, + 0, + new ItemStack(ItemRegistry.ItemKatana, 1, 0)) + .setParentsHidden("ARMORFORTRESS").setConcealed() + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((InfusionRecipe) recipes.get("ItemKatana:0")) }) + .registerResearchItem(); - new TaintedMagicResearchItem("SHADOWMETALKATANA", TM, new AspectList().add(Aspect.METAL, 16).add(Aspect.MAGIC, 8).add(Aspect.WEAPON, 12).add(Aspect.VOID, 12).add(Aspect.DARKNESS, 14), -4, -1, 0, new ItemStack(ItemRegistry.ItemKatana, 1, 2)).setParentsHidden("VOIDMETALKATANA").setParents("SHADOWFORTRESSARMOR").setConcealed().setSecondary().setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((InfusionRecipe) recipes.get("ItemKatana:2")) }).registerResearchItem(); - ThaumcraftApi.addWarpToResearch("SHADOWMETALKATANA", 6); + new TaintedMagicResearchItem( + "VOIDMETALKATANA", + TM, + new AspectList().add(Aspect.METAL, 16).add(Aspect.MAGIC, 8).add(Aspect.WEAPON, 12).add(Aspect.VOID, 12), + 7, + -9, + 0, + new ItemStack(ItemRegistry.ItemKatana, 1, 1)).setParentsHidden("THAUMIUMKATANA") + .setParents("VOIDFORTRESS").setConcealed().setSecondary() + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((InfusionRecipe) recipes.get("ItemKatana:1")) }) + .registerResearchItem(); + ThaumcraftApi.addWarpToResearch("VOIDMETALKATANA", 4); - new TaintedMagicResearchItem("INSCRIPTIONFIRE", TM, new AspectList().add(Aspect.FIRE, 8).add(Aspect.LIGHT, 4).add(Aspect.METAL, 6), 9, 1, 0, new ResourceLocation("taintedmagic:textures/misc/IconINSCRIPTIONFIRE.png")).setParents("THAUMIUMKATANA").setParentsHidden("FOCUSFIRE").setConcealed().setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((InfusionRecipe) recipes.get("ItemKatanaThaumium:inscription0")) }).setSecondary().registerResearchItem(); + new TaintedMagicResearchItem( + "SHADOWMETALKATANA", + TM, + new AspectList().add(Aspect.METAL, 16).add(Aspect.MAGIC, 8).add(Aspect.WEAPON, 12).add(Aspect.VOID, 12) + .add(Aspect.DARKNESS, 14), + -4, + -1, + 0, + new ItemStack(ItemRegistry.ItemKatana, 1, 2)).setParentsHidden("VOIDMETALKATANA") + .setParents("SHADOWFORTRESSARMOR").setConcealed().setSecondary() + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((InfusionRecipe) recipes.get("ItemKatana:2")) }) + .registerResearchItem(); + ThaumcraftApi.addWarpToResearch("SHADOWMETALKATANA", 6); - new TaintedMagicResearchItem("INSCRIPTIONTAINT", TM, new AspectList().add(Aspect.TAINT, 8).add(Aspect.FLESH, 4).add(Aspect.METAL, 6), 9, 2, 0, new ResourceLocation("taintedmagic:textures/misc/IconINSCRIPTIONTAINT.png")).setParents("THAUMIUMKATANA").setParentsHidden("TAINTFOCUS").setConcealed().setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((InfusionRecipe) recipes.get("ItemKatanaThaumium:inscription1")) }).setSecondary().registerResearchItem(); - ThaumcraftApi.addWarpToResearch("INSCRIPTIONTAINT", 2); + new TaintedMagicResearchItem( + "INSCRIPTIONFIRE", + TM, + new AspectList().add(Aspect.FIRE, 8).add(Aspect.LIGHT, 4).add(Aspect.METAL, 6), + 9, + 1, + 0, + new ResourceLocation("taintedmagic:textures/misc/IconINSCRIPTIONFIRE.png")).setParents("THAUMIUMKATANA") + .setParentsHidden("FOCUSFIRE").setConcealed() + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage( + (InfusionRecipe) recipes.get("ItemKatanaThaumium:inscription0")) }) + .setSecondary().registerResearchItem(); - new TaintedMagicResearchItem("INSCRIPTIONUNDEAD", TM, new AspectList().add(Aspect.HEAL, 8).add(Aspect.UNDEAD, 4).add(Aspect.METAL, 6), 8, 3, 0, new ResourceLocation("taintedmagic:textures/misc/IconINSCRIPTIONUNDEAD.png")).setParents("THAUMIUMKATANA").setParentsHidden("BATHSALTS").setConcealed().setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((InfusionRecipe) recipes.get("ItemKatanaThaumium:inscription2")) }).setSecondary().registerResearchItem(); - ThaumcraftApi.addWarpToResearch("INSCRIPTIONUNDEAD", 5); + new TaintedMagicResearchItem( + "INSCRIPTIONTAINT", + TM, + new AspectList().add(Aspect.TAINT, 8).add(Aspect.FLESH, 4).add(Aspect.METAL, 6), + 9, + 2, + 0, + new ResourceLocation("taintedmagic:textures/misc/IconINSCRIPTIONTAINT.png")) + .setParents("THAUMIUMKATANA").setParentsHidden("TAINTFOCUS").setConcealed() + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage( + (InfusionRecipe) recipes.get("ItemKatanaThaumium:inscription1")) }) + .setSecondary().registerResearchItem(); + ThaumcraftApi.addWarpToResearch("INSCRIPTIONTAINT", 2); - new TaintedMagicResearchItem("VOIDGOGGLES", TM, new AspectList().add(Aspect.VOID, 8).add(Aspect.DARKNESS, 4).add(Aspect.MAGIC, 6).add(Aspect.SENSES, 12).add(Aspect.CRYSTAL, 2), 3, 5, 0, new ItemStack(ItemRegistry.ItemVoidmetalGoggles)).setParents("WARPEDGOGGLES").setParentsHidden("VOIDMETAL").setConcealed().setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((InfusionRecipe) recipes.get("ItemVoidmetalGoggles")) }).setSecondary().registerResearchItem(); - ThaumcraftApi.addWarpToResearch("VOIDGOGGLES", 2); + new TaintedMagicResearchItem( + "INSCRIPTIONUNDEAD", + TM, + new AspectList().add(Aspect.HEAL, 8).add(Aspect.UNDEAD, 4).add(Aspect.METAL, 6), + 8, + 3, + 0, + new ResourceLocation("taintedmagic:textures/misc/IconINSCRIPTIONUNDEAD.png")) + .setParents("THAUMIUMKATANA").setParentsHidden("BATHSALTS").setConcealed() + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage( + (InfusionRecipe) recipes.get("ItemKatanaThaumium:inscription2")) }) + .setSecondary().registerResearchItem(); + ThaumcraftApi.addWarpToResearch("INSCRIPTIONUNDEAD", 5); - new TaintedMagicResearchItem("FOCUSSHARD", TM, new AspectList().add(Aspect.CRYSTAL, 2).add(Aspect.MAGIC, 4).add(Aspect.MOTION, 6), 3, 1, 0, new ItemStack(ItemRegistry.ItemFocusVisShard)).setParents("EVILSHARDS").setParentsHidden("FOCUSFIRE").setConcealed().setPages(new ResearchPage[]{ - new ResearchPage("1"), - new ResearchPage((IArcaneRecipe) recipes.get("ItemFocusVisShard")) }).setSecondary().registerResearchItem(); - } + new TaintedMagicResearchItem( + "VOIDGOGGLES", + TM, + new AspectList().add(Aspect.VOID, 8).add(Aspect.DARKNESS, 4).add(Aspect.MAGIC, 6).add(Aspect.SENSES, 12) + .add(Aspect.CRYSTAL, 2), + 3, + 5, + 0, + new ItemStack(ItemRegistry.ItemVoidmetalGoggles)).setParents("WARPEDGOGGLES") + .setParentsHidden("VOIDMETAL").setConcealed() + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((InfusionRecipe) recipes.get("ItemVoidmetalGoggles")) }) + .setSecondary().registerResearchItem(); + ThaumcraftApi.addWarpToResearch("VOIDGOGGLES", 2); + + new TaintedMagicResearchItem( + "FOCUSSHARD", + TM, + new AspectList().add(Aspect.CRYSTAL, 2).add(Aspect.MAGIC, 4).add(Aspect.MOTION, 6), + 3, + 1, + 0, + new ItemStack(ItemRegistry.ItemFocusVisShard)).setParents("EVILSHARDS").setParentsHidden("FOCUSFIRE") + .setConcealed() + .setPages( + new ResearchPage[] { new ResearchPage("1"), + new ResearchPage((IArcaneRecipe) recipes.get("ItemFocusVisShard")) }) + .setSecondary().registerResearchItem(); + } } diff --git a/src/main/java/taintedmagic/common/research/TaintedMagicResearchItem.java b/src/main/java/taintedmagic/common/research/TaintedMagicResearchItem.java index 9a849c7..8c55b4a 100644 --- a/src/main/java/taintedmagic/common/research/TaintedMagicResearchItem.java +++ b/src/main/java/taintedmagic/common/research/TaintedMagicResearchItem.java @@ -3,6 +3,7 @@ package taintedmagic.common.research; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; + import taintedmagic.common.TaintedMagic; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchItem; @@ -10,58 +11,49 @@ import thaumcraft.api.research.ResearchPage; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class TaintedMagicResearchItem extends ResearchItem -{ - public TaintedMagicResearchItem (String key, String category) - { - super(key, category); - } +public class TaintedMagicResearchItem extends ResearchItem { - public TaintedMagicResearchItem (String key, String category, AspectList tags, int col, int row, int complex, ItemStack icon) - { - super(key, category, tags, col, row, complex, icon); - } + public TaintedMagicResearchItem(String key, String category) { + super(key, category); + } - public TaintedMagicResearchItem (String key, String category, AspectList tags, int col, int row, int complex, ResourceLocation icon) - { - super(key, category, tags, col, row, complex, icon); - } + public TaintedMagicResearchItem(String key, String category, AspectList tags, int col, int row, int complex, + ItemStack icon) { + super(key, category, tags, col, row, complex, icon); + } - @SideOnly (Side.CLIENT) - public String getName () - { - return StatCollector.translateToLocal("tm.name." + this.key); - } + public TaintedMagicResearchItem(String key, String category, AspectList tags, int col, int row, int complex, + ResourceLocation icon) { + super(key, category, tags, col, row, complex, icon); + } - @SideOnly (Side.CLIENT) - public String getText () - { - return (TaintedMagic.configHandler.researchTags ? "[TM] " : "") + StatCollector.translateToLocal(new StringBuilder("tm.tag.").append(this.key).toString()); - } + @SideOnly(Side.CLIENT) + public String getName() { + return StatCollector.translateToLocal("tm.name." + this.key); + } - @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); - } -} \ No newline at end of file + @SideOnly(Side.CLIENT) + public String getText() { + return (TaintedMagic.configHandler.researchTags ? "[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); + } +} diff --git a/src/main/java/taintedmagic/common/research/ThaumcraftResearchItem.java b/src/main/java/taintedmagic/common/research/ThaumcraftResearchItem.java index b7ff5e5..b1581d0 100644 --- a/src/main/java/taintedmagic/common/research/ThaumcraftResearchItem.java +++ b/src/main/java/taintedmagic/common/research/ThaumcraftResearchItem.java @@ -1,91 +1,84 @@ package taintedmagic.common.research; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; + import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchCategories; +import thaumcraft.api.research.ResearchCategoryList; import thaumcraft.api.research.ResearchItem; import thaumcraft.api.research.ResearchPage; -import thaumcraft.api.research.ResearchCategoryList; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; /** - * 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 the Thaumic Exploration mod. It is being distributed as part of + * Tainted Magic */ -public class ThaumcraftResearchItem extends ResearchItem -{ - public ResearchItem original; +public class ThaumcraftResearchItem extends ResearchItem { - public ThaumcraftResearchItem (String tag, String category, String origin, String originCategory, int col, int row, ResourceLocation icon) - { - super(tag, category, new AspectList(), col, row, 1, icon); - original = ((ResearchCategoryList) ResearchCategories.researchCategories.get(originCategory)).research.get(origin); - bindToOriginal(); - setStub(); - setHidden(); + public ResearchItem original; - } + public ThaumcraftResearchItem(String tag, String category, String origin, String originCategory, int col, int row, + ResourceLocation icon) { + super(tag, category, new AspectList(), col, row, 1, icon); + original = ((ResearchCategoryList) ResearchCategories.researchCategories.get(originCategory)).research + .get(origin); + bindToOriginal(); + setStub(); + setHidden(); - public ThaumcraftResearchItem (String tag, String category, String origin, String originCategory, int col, int row, ItemStack icon) - { - super(tag, category, 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(); - } - } + public ThaumcraftResearchItem(String tag, String category, String origin, String originCategory, int col, int row, + ItemStack icon) { + super(tag, category, new AspectList(), col, row, 1, icon); + original = ((ResearchCategoryList) ResearchCategories.researchCategories.get(originCategory)).research + .get(origin); + bindToOriginal(); + setStub(); + setHidden(); + } - public ResearchPage[] getPages () - { - return original.getPages(); - } + 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(); + } + } - @SideOnly (Side.CLIENT) - public String getName () - { - return original.getName(); - } + public ResearchPage[] getPages() { + return original.getPages(); + } - @SideOnly (Side.CLIENT) - public String getText () - { - return original.getText(); - } + @SideOnly(Side.CLIENT) + public String getName() { + return original.getName(); + } - public boolean isStub () - { - return true; - } + @SideOnly(Side.CLIENT) + public String getText() { + return original.getText(); + } - public boolean isHidden () - { - return true; - } + public boolean isStub() { + return true; + } - public int getComplexity () - { - return 1; - } -} \ No newline at end of file + public boolean isHidden() { + return true; + } + + public int getComplexity() { + return 1; + } +} diff --git a/src/main/java/taintedmagic/common/world/WorldGenWarpwoodTree.java b/src/main/java/taintedmagic/common/world/WorldGenWarpwoodTree.java index beef7f1..8954efe 100644 --- a/src/main/java/taintedmagic/common/world/WorldGenWarpwoodTree.java +++ b/src/main/java/taintedmagic/common/world/WorldGenWarpwoodTree.java @@ -1,585 +1,450 @@ package taintedmagic.common.world; +import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.BlockSapling; -import net.minecraft.init.Blocks; -import net.minecraft.util.Direction; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenAbstractTree; -import net.minecraft.world.gen.feature.WorldGenBigTree; -import net.minecraftforge.common.IPlantable; import net.minecraftforge.common.util.ForgeDirection; -import java.util.Random; - import taintedmagic.common.registry.BlockRegistry; /** * Copy of WorldGenBigTree.class */ -public class WorldGenWarpwoodTree extends WorldGenAbstractTree -{ - public Block trunk; - public Block leaves; +public class WorldGenWarpwoodTree extends WorldGenAbstractTree { - /** - * Contains three sets of two values that provide complimentary indices for - * a given 'major' index - 1 and 2 for 0, 0 and 2 for 1, and 0 and 1 for 2. - */ - static final byte[] otherCoordPairs = new byte[]{ - (byte) 2, - (byte) 0, - (byte) 0, - (byte) 1, - (byte) 2, - (byte) 1 }; - /** random seed for GenBigTree */ - Random rand = new Random(); - /** Reference to the World object. */ - World worldObj; - int[] basePos = new int[]{ - 0, - 0, - 0 }; - int heightLimit; - int height; - double heightAttenuation = 0.618D; - double branchDensity = 1.0D; - double branchSlope = 0.381D; - double scaleWidth = 1.0D; - double leafDensity = 1.0D; - /** - * Currently always 1, can be set to 2 in the class constructor to generate - * a double-sized tree trunk for big trees. - */ - int trunkSize = 1; - /** Sets the limit of the random value used to initialize the height limit. */ - int heightLimitLimit = 12; - /** - * Sets the distance limit for how far away the generator will populate - * leaves from the base leaf node. - */ - int leafDistanceLimit = 4; - /** Contains a list of a points at which to generate groups of leaves. */ - int[][] leafNodes; - /**private static final String __OBFID = "CL_00000400";*/ + public Block trunk; + public Block leaves; - public WorldGenWarpwoodTree (boolean b, Block trunk, Block leaves) - { - super(b); - this.trunk = trunk; - this.leaves = leaves; - } + /** + * Contains three sets of two values that provide complimentary indices for a given 'major' index - 1 and 2 for 0, 0 + * and 2 for 1, and 0 and 1 for 2. + */ + static final byte[] otherCoordPairs = new byte[] { (byte) 2, (byte) 0, (byte) 0, (byte) 1, (byte) 2, (byte) 1 }; + /** random seed for GenBigTree */ + Random rand = new Random(); + /** Reference to the World object. */ + World worldObj; + int[] basePos = new int[] { 0, 0, 0 }; + int heightLimit; + int height; + double heightAttenuation = 0.618D; + double branchDensity = 1.0D; + double branchSlope = 0.381D; + double scaleWidth = 1.0D; + double leafDensity = 1.0D; + /** + * Currently always 1, can be set to 2 in the class constructor to generate a double-sized tree trunk for big trees. + */ + int trunkSize = 1; + /** Sets the limit of the random value used to initialize the height limit. */ + int heightLimitLimit = 12; + /** + * Sets the distance limit for how far away the generator will populate leaves from the base leaf node. + */ + int leafDistanceLimit = 4; + /** Contains a list of a points at which to generate groups of leaves. */ + int[][] leafNodes; - /** - * Generates a list of leaf nodes for the tree, to be populated by - * generateLeaves. - */ - void generateLeafNodeList () - { - this.height = (int) ((double) this.heightLimit * this.heightAttenuation); + /** private static final String __OBFID = "CL_00000400"; */ - if (this.height >= this.heightLimit) - { - this.height = this.heightLimit - 1; - } + public WorldGenWarpwoodTree(boolean b, Block trunk, Block leaves) { + super(b); + this.trunk = trunk; + this.leaves = leaves; + } - int i = (int) (1.382D + Math.pow(this.leafDensity * (double) this.heightLimit / 13.0D, 2.0D)); + /** + * Generates a list of leaf nodes for the tree, to be populated by generateLeaves. + */ + void generateLeafNodeList() { + this.height = (int) ((double) this.heightLimit * this.heightAttenuation); - if (i < 1) - { - i = 1; - } + if (this.height >= this.heightLimit) { + this.height = this.heightLimit - 1; + } - int[][] aint = new int[i * this.heightLimit][4]; - int j = this.basePos[1] + this.heightLimit - this.leafDistanceLimit; - int k = 1; - int l = this.basePos[1] + this.height; - int i1 = j - this.basePos[1]; - aint[0][0] = this.basePos[0]; - aint[0][1] = j; - aint[0][2] = this.basePos[2]; - aint[0][3] = l; - --j; + int i = (int) (1.382D + Math.pow(this.leafDensity * (double) this.heightLimit / 13.0D, 2.0D)); - while (i1 >= 0) - { - int j1 = 0; - float f = this.layerSize(i1); + if (i < 1) { + i = 1; + } - if (f < 0.0F) - { - --j; - --i1; - } - else - { - for (double d0 = 0.5D; j1 < i; ++j1) - { - double d1 = this.scaleWidth * (double) f * ((double) this.rand.nextFloat() + 0.328D); - double d2 = (double) this.rand.nextFloat() * 2.0D * Math.PI; - int k1 = MathHelper.floor_double(d1 * Math.sin(d2) + (double) this.basePos[0] + d0); - int l1 = MathHelper.floor_double(d1 * Math.cos(d2) + (double) this.basePos[2] + d0); - int[] aint1 = new int[]{ - k1, - j, - l1 }; - int[] aint2 = new int[]{ - k1, - j + this.leafDistanceLimit, - l1 }; + int[][] aint = new int[i * this.heightLimit][4]; + int j = this.basePos[1] + this.heightLimit - this.leafDistanceLimit; + int k = 1; + int l = this.basePos[1] + this.height; + int i1 = j - this.basePos[1]; + aint[0][0] = this.basePos[0]; + aint[0][1] = j; + aint[0][2] = this.basePos[2]; + aint[0][3] = l; + --j; - if (this.checkBlockLine(aint1, aint2) == -1) - { - int[] aint3 = new int[]{ - this.basePos[0], - this.basePos[1], - this.basePos[2] }; - double d3 = Math.sqrt(Math.pow((double) Math.abs(this.basePos[0] - aint1[0]), 2.0D) + Math.pow((double) Math.abs(this.basePos[2] - aint1[2]), 2.0D)); - double d4 = d3 * this.branchSlope; + while (i1 >= 0) { + int j1 = 0; + float f = this.layerSize(i1); - if ((double) aint1[1] - d4 > (double) l) - { - aint3[1] = l; - } - else - { - aint3[1] = (int) ((double) aint1[1] - d4); - } + if (f < 0.0F) { + --j; + --i1; + } else { + for (double d0 = 0.5D; j1 < i; ++j1) { + double d1 = this.scaleWidth * (double) f * ((double) this.rand.nextFloat() + 0.328D); + double d2 = (double) this.rand.nextFloat() * 2.0D * Math.PI; + int k1 = MathHelper.floor_double(d1 * Math.sin(d2) + (double) this.basePos[0] + d0); + int l1 = MathHelper.floor_double(d1 * Math.cos(d2) + (double) this.basePos[2] + d0); + int[] aint1 = new int[] { k1, j, l1 }; + int[] aint2 = new int[] { k1, j + this.leafDistanceLimit, l1 }; - if (this.checkBlockLine(aint3, aint1) == -1) - { - aint[k][0] = k1; - aint[k][1] = j; - aint[k][2] = l1; - aint[k][3] = aint3[1]; - ++k; - } - } - } + if (this.checkBlockLine(aint1, aint2) == -1) { + int[] aint3 = new int[] { this.basePos[0], this.basePos[1], this.basePos[2] }; + double d3 = Math.sqrt( + Math.pow((double) Math.abs(this.basePos[0] - aint1[0]), 2.0D) + + Math.pow((double) Math.abs(this.basePos[2] - aint1[2]), 2.0D)); + double d4 = d3 * this.branchSlope; - --j; - --i1; - } - } + if ((double) aint1[1] - d4 > (double) l) { + aint3[1] = l; + } else { + aint3[1] = (int) ((double) aint1[1] - d4); + } - this.leafNodes = new int[k][4]; - System.arraycopy(aint, 0, this.leafNodes, 0, k); - } + if (this.checkBlockLine(aint3, aint1) == -1) { + aint[k][0] = k1; + aint[k][1] = j; + aint[k][2] = l1; + aint[k][3] = aint3[1]; + ++k; + } + } + } - void func_150529_a (int p_150529_1_, int p_150529_2_, int p_150529_3_, float p_150529_4_, byte p_150529_5_, Block p_150529_6_) - { - int l = (int) ((double) p_150529_4_ + 0.618D); - byte b1 = otherCoordPairs[p_150529_5_]; - byte b2 = otherCoordPairs[p_150529_5_ + 3]; - int[] aint = new int[]{ - p_150529_1_, - p_150529_2_, - p_150529_3_ }; - int[] aint1 = new int[]{ - 0, - 0, - 0 }; - int i1 = -l; - int j1 = -l; + --j; + --i1; + } + } - for (aint1[p_150529_5_] = aint[p_150529_5_]; i1 <= l; ++i1) - { - aint1[b1] = aint[b1] + i1; - j1 = -l; + this.leafNodes = new int[k][4]; + System.arraycopy(aint, 0, this.leafNodes, 0, k); + } - while (j1 <= l) - { - double d0 = Math.pow((double) Math.abs(i1) + 0.5D, 2.0D) + Math.pow((double) Math.abs(j1) + 0.5D, 2.0D); + void func_150529_a(int p_150529_1_, int p_150529_2_, int p_150529_3_, float p_150529_4_, byte p_150529_5_, + Block p_150529_6_) { + int l = (int) ((double) p_150529_4_ + 0.618D); + byte b1 = otherCoordPairs[p_150529_5_]; + byte b2 = otherCoordPairs[p_150529_5_ + 3]; + int[] aint = new int[] { p_150529_1_, p_150529_2_, p_150529_3_ }; + int[] aint1 = new int[] { 0, 0, 0 }; + int i1 = -l; + int j1 = -l; - if (d0 > (double) (p_150529_4_ * p_150529_4_)) - { - ++j1; - } - else - { - aint1[b2] = aint[b2] + j1; - Block block1 = this.worldObj.getBlock(aint1[0], aint1[1], aint1[2]); + for (aint1[p_150529_5_] = aint[p_150529_5_]; i1 <= l; ++i1) { + aint1[b1] = aint[b1] + i1; + j1 = -l; - if (!block1.isAir(worldObj, aint1[0], aint1[1], aint1[2]) && !block1.isLeaves(worldObj, aint1[0], aint1[1], aint1[2])) - { - ++j1; - } - else - { - this.setBlockAndNotifyAdequately(this.worldObj, aint1[0], aint1[1], aint1[2], p_150529_6_, 0); - ++j1; - } - } - } - } - } + while (j1 <= l) { + double d0 = Math.pow((double) Math.abs(i1) + 0.5D, 2.0D) + Math.pow((double) Math.abs(j1) + 0.5D, 2.0D); - /** - * Gets the rough size of a layer of the tree. - */ - float layerSize (int p_76490_1_) - { - if ((double) p_76490_1_ < (double) ((float) this.heightLimit) * 0.3D) - { - return -1.618F; - } - else - { - float f = (float) this.heightLimit / 2.0F; - float f1 = (float) this.heightLimit / 2.0F - (float) p_76490_1_; - float f2; + if (d0 > (double) (p_150529_4_ * p_150529_4_)) { + ++j1; + } else { + aint1[b2] = aint[b2] + j1; + Block block1 = this.worldObj.getBlock(aint1[0], aint1[1], aint1[2]); - if (f1 == 0.0F) - { - f2 = f; - } - else if (Math.abs(f1) >= f) - { - f2 = 0.0F; - } - else - { - f2 = (float) Math.sqrt(Math.pow((double) Math.abs(f), 2.0D) - Math.pow((double) Math.abs(f1), 2.0D)); - } + if (!block1.isAir(worldObj, aint1[0], aint1[1], aint1[2]) + && !block1.isLeaves(worldObj, aint1[0], aint1[1], aint1[2])) { + ++j1; + } else { + this.setBlockAndNotifyAdequately(this.worldObj, aint1[0], aint1[1], aint1[2], p_150529_6_, 0); + ++j1; + } + } + } + } + } - f2 *= 0.5F; - return f2; - } - } + /** + * Gets the rough size of a layer of the tree. + */ + float layerSize(int p_76490_1_) { + if ((double) p_76490_1_ < (double) ((float) this.heightLimit) * 0.3D) { + return -1.618F; + } else { + float f = (float) this.heightLimit / 2.0F; + float f1 = (float) this.heightLimit / 2.0F - (float) p_76490_1_; + float f2; - float leafSize (int p_76495_1_) - { - return p_76495_1_ >= 0 && p_76495_1_ < this.leafDistanceLimit ? (p_76495_1_ != 0 && p_76495_1_ != this.leafDistanceLimit - 1 ? 3.0F : 2.0F) : -1.0F; - } + if (f1 == 0.0F) { + f2 = f; + } else if (Math.abs(f1) >= f) { + f2 = 0.0F; + } else { + f2 = (float) Math.sqrt(Math.pow((double) Math.abs(f), 2.0D) - Math.pow((double) Math.abs(f1), 2.0D)); + } - /** - * Generates the leaves surrounding an individual entry in the leafNodes - * list. - */ - void generateLeafNode (int p_76491_1_, int p_76491_2_, int p_76491_3_) - { - int l = p_76491_2_; + f2 *= 0.5F; + return f2; + } + } - for (int i1 = p_76491_2_ + this.leafDistanceLimit; l < i1; ++l) - { - float f = this.leafSize(l - p_76491_2_); - this.func_150529_a(p_76491_1_, l, p_76491_3_, f, (byte) 1, leaves); - } - } + float leafSize(int p_76495_1_) { + return p_76495_1_ >= 0 && p_76495_1_ < this.leafDistanceLimit + ? (p_76495_1_ != 0 && p_76495_1_ != this.leafDistanceLimit - 1 ? 3.0F : 2.0F) + : -1.0F; + } - void func_150530_a (int[] p_150530_1_, int[] p_150530_2_, Block p_150530_3_) - { - int[] aint2 = new int[]{ - 0, - 0, - 0 }; - byte b0 = 0; - byte b1; + /** + * Generates the leaves surrounding an individual entry in the leafNodes list. + */ + void generateLeafNode(int p_76491_1_, int p_76491_2_, int p_76491_3_) { + int l = p_76491_2_; - for (b1 = 0; b0 < 3; ++b0) - { - aint2[b0] = p_150530_2_[b0] - p_150530_1_[b0]; + for (int i1 = p_76491_2_ + this.leafDistanceLimit; l < i1; ++l) { + float f = this.leafSize(l - p_76491_2_); + this.func_150529_a(p_76491_1_, l, p_76491_3_, f, (byte) 1, leaves); + } + } - if (Math.abs(aint2[b0]) > Math.abs(aint2[b1])) - { - b1 = b0; - } - } + void func_150530_a(int[] p_150530_1_, int[] p_150530_2_, Block p_150530_3_) { + int[] aint2 = new int[] { 0, 0, 0 }; + byte b0 = 0; + byte b1; - if (aint2[b1] != 0) - { - byte b2 = otherCoordPairs[b1]; - byte b3 = otherCoordPairs[b1 + 3]; - byte b4; + for (b1 = 0; b0 < 3; ++b0) { + aint2[b0] = p_150530_2_[b0] - p_150530_1_[b0]; - if (aint2[b1] > 0) - { - b4 = 1; - } - else - { - b4 = -1; - } + if (Math.abs(aint2[b0]) > Math.abs(aint2[b1])) { + b1 = b0; + } + } - double d0 = (double) aint2[b2] / (double) aint2[b1]; - double d1 = (double) aint2[b3] / (double) aint2[b1]; - int[] aint3 = new int[]{ - 0, - 0, - 0 }; - int i = 0; + if (aint2[b1] != 0) { + byte b2 = otherCoordPairs[b1]; + byte b3 = otherCoordPairs[b1 + 3]; + byte b4; - for (int j = aint2[b1] + b4; i != j; i += b4) - { - aint3[b1] = MathHelper.floor_double((double) (p_150530_1_[b1] + i) + 0.5D); - aint3[b2] = MathHelper.floor_double((double) p_150530_1_[b2] + (double) i * d0 + 0.5D); - aint3[b3] = MathHelper.floor_double((double) p_150530_1_[b3] + (double) i * d1 + 0.5D); - byte b5 = 0; - int k = Math.abs(aint3[0] - p_150530_1_[0]); - int l = Math.abs(aint3[2] - p_150530_1_[2]); - int i1 = Math.max(k, l); + if (aint2[b1] > 0) { + b4 = 1; + } else { + b4 = -1; + } - if (i1 > 0) - { - if (k == i1) - { - b5 = 4; - } - else if (l == i1) - { - b5 = 8; - } - } + double d0 = (double) aint2[b2] / (double) aint2[b1]; + double d1 = (double) aint2[b3] / (double) aint2[b1]; + int[] aint3 = new int[] { 0, 0, 0 }; + int i = 0; - this.setBlockAndNotifyAdequately(this.worldObj, aint3[0], aint3[1], aint3[2], p_150530_3_, b5); - } - } - } + for (int j = aint2[b1] + b4; i != j; i += b4) { + aint3[b1] = MathHelper.floor_double((double) (p_150530_1_[b1] + i) + 0.5D); + aint3[b2] = MathHelper.floor_double((double) p_150530_1_[b2] + (double) i * d0 + 0.5D); + aint3[b3] = MathHelper.floor_double((double) p_150530_1_[b3] + (double) i * d1 + 0.5D); + byte b5 = 0; + int k = Math.abs(aint3[0] - p_150530_1_[0]); + int l = Math.abs(aint3[2] - p_150530_1_[2]); + int i1 = Math.max(k, l); - /** - * Generates the leaf portion of the tree as specified by the leafNodes - * list. - */ - void generateLeaves () - { - int i = 0; + if (i1 > 0) { + if (k == i1) { + b5 = 4; + } else if (l == i1) { + b5 = 8; + } + } - for (int j = this.leafNodes.length; i < j; ++i) - { - int k = this.leafNodes[i][0]; - int l = this.leafNodes[i][1]; - int i1 = this.leafNodes[i][2]; - this.generateLeafNode(k, l, i1); - } - } + this.setBlockAndNotifyAdequately(this.worldObj, aint3[0], aint3[1], aint3[2], p_150530_3_, b5); + } + } + } - /** - * Indicates whether or not a leaf node requires additional wood to be added - * to preserve integrity. - */ - boolean leafNodeNeedsBase (int p_76493_1_) - { - return (double) p_76493_1_ >= (double) this.heightLimit * 0.2D; - } + /** + * Generates the leaf portion of the tree as specified by the leafNodes list. + */ + void generateLeaves() { + int i = 0; - /** - * Places the trunk for the big tree that is being generated. Able to - * generate double-sized trunks by changing a field that is always 1 to 2. - */ - void generateTrunk () - { - int i = this.basePos[0]; - int j = this.basePos[1]; - int k = this.basePos[1] + this.height; - int l = this.basePos[2]; - int[] aint = new int[]{ - i, - j, - l }; - int[] aint1 = new int[]{ - i, - k, - l }; - this.func_150530_a(aint, aint1, trunk); + for (int j = this.leafNodes.length; i < j; ++i) { + int k = this.leafNodes[i][0]; + int l = this.leafNodes[i][1]; + int i1 = this.leafNodes[i][2]; + this.generateLeafNode(k, l, i1); + } + } - if (this.trunkSize == 2) - { - ++aint[0]; - ++aint1[0]; - this.func_150530_a(aint, aint1, trunk); - ++aint[2]; - ++aint1[2]; - this.func_150530_a(aint, aint1, trunk); - aint[0] += -1; - aint1[0] += -1; - this.func_150530_a(aint, aint1, trunk); - } - } + /** + * Indicates whether or not a leaf node requires additional wood to be added to preserve integrity. + */ + boolean leafNodeNeedsBase(int p_76493_1_) { + return (double) p_76493_1_ >= (double) this.heightLimit * 0.2D; + } - /** - * Generates additional wood blocks to fill out the bases of different leaf - * nodes that would otherwise degrade. - */ - void generateLeafNodeBases () - { - int i = 0; - int j = this.leafNodes.length; + /** + * Places the trunk for the big tree that is being generated. Able to generate double-sized trunks by changing a + * field that is always 1 to 2. + */ + void generateTrunk() { + int i = this.basePos[0]; + int j = this.basePos[1]; + int k = this.basePos[1] + this.height; + int l = this.basePos[2]; + int[] aint = new int[] { i, j, l }; + int[] aint1 = new int[] { i, k, l }; + this.func_150530_a(aint, aint1, trunk); - for (int[] aint = new int[]{ - this.basePos[0], - this.basePos[1], - this.basePos[2] }; i < j; ++i) - { - int[] aint1 = this.leafNodes[i]; - int[] aint2 = new int[]{ - aint1[0], - aint1[1], - aint1[2] }; - aint[1] = aint1[3]; - int k = aint[1] - this.basePos[1]; + if (this.trunkSize == 2) { + ++aint[0]; + ++aint1[0]; + this.func_150530_a(aint, aint1, trunk); + ++aint[2]; + ++aint1[2]; + this.func_150530_a(aint, aint1, trunk); + aint[0] += -1; + aint1[0] += -1; + this.func_150530_a(aint, aint1, trunk); + } + } - if (this.leafNodeNeedsBase(k)) - { - this.func_150530_a(aint, aint2, trunk); - } - } - } + /** + * Generates additional wood blocks to fill out the bases of different leaf nodes that would otherwise degrade. + */ + void generateLeafNodeBases() { + int i = 0; + int j = this.leafNodes.length; - /** - * Checks a line of blocks in the world from the first coordinate to triplet - * to the second, returning the distance (in blocks) before a non-air, - * non-leaf block is encountered and/or the end is encountered. - */ - int checkBlockLine (int[] p_76496_1_, int[] p_76496_2_) - { - int[] aint2 = new int[]{ - 0, - 0, - 0 }; - byte b0 = 0; - byte b1; + for (int[] aint = new int[] { this.basePos[0], this.basePos[1], this.basePos[2] }; i < j; ++i) { + int[] aint1 = this.leafNodes[i]; + int[] aint2 = new int[] { aint1[0], aint1[1], aint1[2] }; + aint[1] = aint1[3]; + int k = aint[1] - this.basePos[1]; - for (b1 = 0; b0 < 3; ++b0) - { - aint2[b0] = p_76496_2_[b0] - p_76496_1_[b0]; + if (this.leafNodeNeedsBase(k)) { + this.func_150530_a(aint, aint2, trunk); + } + } + } - if (Math.abs(aint2[b0]) > Math.abs(aint2[b1])) - { - b1 = b0; - } - } + /** + * Checks a line of blocks in the world from the first coordinate to triplet to the second, returning the distance + * (in blocks) before a non-air, non-leaf block is encountered and/or the end is encountered. + */ + int checkBlockLine(int[] p_76496_1_, int[] p_76496_2_) { + int[] aint2 = new int[] { 0, 0, 0 }; + byte b0 = 0; + byte b1; - if (aint2[b1] == 0) - { - return -1; - } - else - { - byte b2 = otherCoordPairs[b1]; - byte b3 = otherCoordPairs[b1 + 3]; - byte b4; + for (b1 = 0; b0 < 3; ++b0) { + aint2[b0] = p_76496_2_[b0] - p_76496_1_[b0]; - if (aint2[b1] > 0) - { - b4 = 1; - } - else - { - b4 = -1; - } + if (Math.abs(aint2[b0]) > Math.abs(aint2[b1])) { + b1 = b0; + } + } - double d0 = (double) aint2[b2] / (double) aint2[b1]; - double d1 = (double) aint2[b3] / (double) aint2[b1]; - int[] aint3 = new int[]{ - 0, - 0, - 0 }; - int i = 0; - int j; + if (aint2[b1] == 0) { + return -1; + } else { + byte b2 = otherCoordPairs[b1]; + byte b3 = otherCoordPairs[b1 + 3]; + byte b4; - for (j = aint2[b1] + b4; i != j; i += b4) - { - aint3[b1] = p_76496_1_[b1] + i; - aint3[b2] = MathHelper.floor_double((double) p_76496_1_[b2] + (double) i * d0); - aint3[b3] = MathHelper.floor_double((double) p_76496_1_[b3] + (double) i * d1); - Block block = this.worldObj.getBlock(aint3[0], aint3[1], aint3[2]); + if (aint2[b1] > 0) { + b4 = 1; + } else { + b4 = -1; + } - if (!this.isReplaceable(worldObj, aint3[0], aint3[1], aint3[2])) - { - break; - } - } + double d0 = (double) aint2[b2] / (double) aint2[b1]; + double d1 = (double) aint2[b3] / (double) aint2[b1]; + int[] aint3 = new int[] { 0, 0, 0 }; + int i = 0; + int j; - return i == j ? -1 : Math.abs(i); - } - } + for (j = aint2[b1] + b4; i != j; i += b4) { + aint3[b1] = p_76496_1_[b1] + i; + aint3[b2] = MathHelper.floor_double((double) p_76496_1_[b2] + (double) i * d0); + aint3[b3] = MathHelper.floor_double((double) p_76496_1_[b3] + (double) i * d1); + Block block = this.worldObj.getBlock(aint3[0], aint3[1], aint3[2]); - /** - * Returns a boolean indicating whether or not the current location for the - * tree, spanning basePos to to the height limit, is valid. - */ - boolean validTreeLocation () - { - int[] aint = new int[]{ - this.basePos[0], - this.basePos[1], - this.basePos[2] }; - int[] aint1 = new int[]{ - this.basePos[0], - this.basePos[1] + this.heightLimit - 1, - this.basePos[2] }; - Block block = this.worldObj.getBlock(this.basePos[0], this.basePos[1] - 1, this.basePos[2]); + if (!this.isReplaceable(worldObj, aint3[0], aint3[1], aint3[2])) { + break; + } + } - boolean isSoil = block.canSustainPlant(worldObj, basePos[0], basePos[1] - 1, basePos[2], ForgeDirection.UP, (BlockSapling) BlockRegistry.BlockWarpwoodSapling); - if (!isSoil) - { - return false; - } - else - { - int i = this.checkBlockLine(aint, aint1); + return i == j ? -1 : Math.abs(i); + } + } - if (i == -1) - { - return true; - } - else if (i < 6) - { - return false; - } - else - { - this.heightLimit = i; - return true; - } - } - } + /** + * Returns a boolean indicating whether or not the current location for the tree, spanning basePos to to the height + * limit, is valid. + */ + boolean validTreeLocation() { + int[] aint = new int[] { this.basePos[0], this.basePos[1], this.basePos[2] }; + int[] aint1 = new int[] { this.basePos[0], this.basePos[1] + this.heightLimit - 1, this.basePos[2] }; + Block block = this.worldObj.getBlock(this.basePos[0], this.basePos[1] - 1, this.basePos[2]); - /** - * Rescales the generator settings, only used in WorldGenBigTree - */ - public void setScale (double p_76487_1_, double p_76487_3_, double p_76487_5_) - { - this.heightLimitLimit = (int) (p_76487_1_ * 12.0D); + boolean isSoil = block.canSustainPlant( + worldObj, + basePos[0], + basePos[1] - 1, + basePos[2], + ForgeDirection.UP, + (BlockSapling) BlockRegistry.BlockWarpwoodSapling); + if (!isSoil) { + return false; + } else { + int i = this.checkBlockLine(aint, aint1); - if (p_76487_1_ > 0.5D) - { - this.leafDistanceLimit = 5; - } + if (i == -1) { + return true; + } else if (i < 6) { + return false; + } else { + this.heightLimit = i; + return true; + } + } + } - this.scaleWidth = p_76487_3_; - this.leafDensity = p_76487_5_; - } + /** + * Rescales the generator settings, only used in WorldGenBigTree + */ + public void setScale(double p_76487_1_, double p_76487_3_, double p_76487_5_) { + this.heightLimitLimit = (int) (p_76487_1_ * 12.0D); - public boolean generate (World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) - { - this.worldObj = p_76484_1_; - long l = p_76484_2_.nextLong(); - this.rand.setSeed(l); - this.basePos[0] = p_76484_3_; - this.basePos[1] = p_76484_4_; - this.basePos[2] = p_76484_5_; + if (p_76487_1_ > 0.5D) { + this.leafDistanceLimit = 5; + } - if (this.heightLimit == 0) - { - this.heightLimit = 5 + this.rand.nextInt(this.heightLimitLimit); - } + this.scaleWidth = p_76487_3_; + this.leafDensity = p_76487_5_; + } - if (!this.validTreeLocation()) - { - this.worldObj = null; // Fix vanilla Mem leak, holds latest world - return false; - } - else - { - this.generateLeafNodeList(); - this.generateLeaves(); - this.generateTrunk(); - this.generateLeafNodeBases(); - this.worldObj = null; // Fix vanilla Mem leak, holds latest world - return true; - } - } -} \ No newline at end of file + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) { + this.worldObj = p_76484_1_; + long l = p_76484_2_.nextLong(); + this.rand.setSeed(l); + this.basePos[0] = p_76484_3_; + this.basePos[1] = p_76484_4_; + this.basePos[2] = p_76484_5_; + + if (this.heightLimit == 0) { + this.heightLimit = 5 + this.rand.nextInt(this.heightLimitLimit); + } + + if (!this.validTreeLocation()) { + this.worldObj = null; // Fix vanilla Mem leak, holds latest world + return false; + } else { + this.generateLeafNodeList(); + this.generateLeaves(); + this.generateTrunk(); + this.generateLeafNodeBases(); + this.worldObj = null; // Fix vanilla Mem leak, holds latest world + return true; + } + } +}