diff --git a/src/main/java/com/zivilon/cinder_loe/CinderLoE.java b/src/main/java/com/zivilon/cinder_loe/CinderLoE.java index 70bde55..756c587 100644 --- a/src/main/java/com/zivilon/cinder_loe/CinderLoE.java +++ b/src/main/java/com/zivilon/cinder_loe/CinderLoE.java @@ -121,6 +121,7 @@ public class CinderLoE { public static LOTRMaterial MATERIAL_USURPER; public static LOTRMaterial MATERIAL_WARLORD; public static LOTRMaterial MATERIAL_JADE; + public static LOTRMaterial MATERIAL_GILDEDGALVORN; // Blocks // public static Block barricade; @@ -235,6 +236,10 @@ public class CinderLoE { public static Item legsWarlord; public static Item bootsWarlord; public static Item maceWarlord; + public static Item helmetGildedGalvorn; + public static Item bodyGildedGalvorn; + public static Item legsGildedGalvorn; + public static Item bootsGildedGalvorn; // public static Item bowserpent; //public static Item swordUsurper; @@ -374,7 +379,7 @@ public class CinderLoE { // event.registerServerCommand(new CommandMobileSound()); } - public void registerEntities() { // Last ID added: 64 + public void registerEntities() { // Last ID added: 65 ///GameRegistry.registerTileEntity(TileEntityMistBlock.class, "TileEntityMistBlock"); ///.registerBlock(TileEntityRustedSword, "TileEntityRustedSword"); @@ -414,6 +419,7 @@ public class CinderLoE { EntityRegistry.registerModEntity(UtumnoSlaveTrader.class, "UtumnoSlaveTrader", (entityID + 30), this, 64, 1, true); EntityRegistry.registerModEntity(Monkey.class, "Monkey", (entityID + 62), this, 64, 1, true); EntityRegistry.registerModEntity(CryptBoss.class, "CryptBoss", (entityID + 63), this, 64, 1, true); + EntityRegistry.registerModEntity(EntityMorgulBlast.class, "EntityMorgulBlast", (entityID + 65), this, 64, 1, true); @@ -742,11 +748,13 @@ public class CinderLoE { warDartHeads = (new WarDartHeads()).setUnlocalizedName("war_dart_heads").setTextureName("lotr:war_dart_heads_0"); ItemRegistration.register(cleaver,"cleaver",6109); - linkLOTRWeapon(cleaver, "cleaver"); + ItemRegistration.register(warDart,"warDart",6111); ItemRegistration.register(warDartHeads,"warDartHeads",6500); + //Override Galvorn Helmet with new model texture + LOTRMod.helmetGalvorn = new LOTRItemArmor(LOTRMaterial.GALVORN, 0, "helmet").setUnlocalizedName("lotr:helmetGalvorn"); //ASH MATERIAL_ASH = getLOTRMaterialByName("ASH"); @@ -906,7 +914,7 @@ public class CinderLoE { linkLOTRWeapon(swordBree, "swordBree"); //Elite Armors - //Elite Armors + MATERIAL_SERPENT = getLOTRMaterialByName("SERPENT"); if (MATERIAL_SERPENT != null) { helmetserpent = (new LOTRItemArmor(MATERIAL_SERPENT, 0)).setUnlocalizedName("lotr:helmetserpent").setTextureName("lotr:helmetserpent").setCreativeTab(null); @@ -955,6 +963,22 @@ public class CinderLoE { } linkLOTRWeapon(maceWarlord, "maceWarlord"); + MATERIAL_GILDEDGALVORN = getLOTRMaterialByName("GILDEDGALVORN"); + if (MATERIAL_GILDEDGALVORN != null) { + helmetGildedGalvorn = (new LOTRItemArmor(MATERIAL_GILDEDGALVORN, 0, "helmet")).setUnlocalizedName("lotr:helmetGildedGalvorn").setTextureName("lotr:helmetGildedGalvorn").setCreativeTab(null); + bodyGildedGalvorn = (new LOTRItemArmor(MATERIAL_GILDEDGALVORN, 1)).setUnlocalizedName("lotr:bodyGildedGalvorn").setTextureName("lotr:bodyGildedGalvorn").setCreativeTab(null); + legsGildedGalvorn = (new LOTRItemArmor(MATERIAL_GILDEDGALVORN, 2)).setUnlocalizedName("lotr:legsGildedGalvorn").setTextureName("lotr:legsGildedGalvorn").setCreativeTab(null); + bootsGildedGalvorn = (new LOTRItemArmor(MATERIAL_GILDEDGALVORN, 3)).setUnlocalizedName("lotr:bootsGildedGalvorn").setTextureName("lotr:bootsGildedGalvorn").setCreativeTab(null); + + ItemRegistration.register(helmetGildedGalvorn, "helmetGildedGalvorn", 6813); + ItemRegistration.register(bodyGildedGalvorn, "bodyGildedGalvorn", 6814); + ItemRegistration.register(legsGildedGalvorn, "legsGildedGalvorn", 6815); + ItemRegistration.register(bootsGildedGalvorn, "bootsGildedGalvorn", 6816); + } else { + System.err.println("Failed to find WARLORD material for armor initialization."); + } + + //Rhudaur MATERIAL_RHUDAUR = getLOTRMaterialByName("RHUDAUR"); if (MATERIAL_RHUDAUR != null) { @@ -1016,6 +1040,7 @@ public class CinderLoE { // RenderingRegistry.registerEntityRenderingHandler(DwarfLevy.class, new LOTRRenderDwarf()); RenderingRegistry.registerEntityRenderingHandler(EntityWarDart.class, new RenderWarDart()); + RenderingRegistry.registerEntityRenderingHandler(EntityMorgulBlast.class, new RenderMorgulBlast()); RenderingRegistry.registerEntityRenderingHandler(BladorthinSmith.class, new LOTRRenderDorwinionElfVintner()); RenderingRegistry.registerEntityRenderingHandler(DarkSpider.class, new RenderDarkSpider()); RenderingRegistry.registerEntityRenderingHandler(CorruptDwarf.class, new RenderCorruptDwarf()); @@ -1033,6 +1058,7 @@ public class CinderLoE { RenderingRegistry.registerEntityRenderingHandler(RenegadeCaptain.class, new RenderRenegade()); RenderingRegistry.registerEntityRenderingHandler(Wraith.class, new RenderWraith()); RenderingRegistry.registerEntityRenderingHandler(Monkey.class, new RenderMonkey()); + RenderingRegistry.registerEntityRenderingHandler(CryptBoss.class, new RenderCryptBoss()); RenderingRegistry.registerEntityRenderingHandler(RedDwarfWarrior.class, new LOTRRenderDwarf()); RenderingRegistry.registerEntityRenderingHandler(RedDwarfArbalest.class, new LOTRRenderDwarf()); @@ -1336,6 +1362,7 @@ public class CinderLoE { CinderCore.registerEntityFallback(Renegade.class, LOTREntityBandit.class, "cinder_loe", "1.0"); CinderCore.registerEntityFallback(RenegadeCaptain.class, LOTREntityBandit.class, "cinder_loe", "1.1"); CinderCore.registerEntityFallback(Wraith.class, LOTREntityMarshWraith.class, "cinder_loe", "1.0"); + CinderCore.registerEntityFallback(CryptBoss.class, LOTREntityMarshWraith.class, "cinder_loe", "1.0"); CinderCore.registerEntityFallback(LOTREntitySauron.class, LOTREntityBarrowWight.class, "cinder_loe", "1.1"); CinderCore.registerEntityFallback(RedDwarfWarrior.class, LOTREntityDwarfWarrior.class, "cinder_loe", "1.0"); diff --git a/src/main/java/com/zivilon/cinder_loe/Materials.java b/src/main/java/com/zivilon/cinder_loe/Materials.java index da30bc0..829ba7f 100644 --- a/src/main/java/com/zivilon/cinder_loe/Materials.java +++ b/src/main/java/com/zivilon/cinder_loe/Materials.java @@ -25,6 +25,7 @@ public class Materials { modifyMaterial("USURPER",650, 2.0F, 0.6F, 2, 6.0F, 10, Items.iron_ingot); modifyMaterial("WARLORD", 650, 2.0F, 0.6F, 2, 6.0F, 10, LOTRMod.bronze); modifyMaterial("JADE",2400, 5.0F, 0.8F, 0, 9.0F, 10, LOTRMod.emerald); + modifyMaterial("GILDEDGALVORN",600, 3.0F, 0.6F, 2, 7.0F, 15, LOTRMod.galvorn); } public static void modifyMaterial(String fieldName, int uses, float weapon_damage, float protection, int harvest_level, float speed, int enchantability, Item crafting_item) { diff --git a/src/main/java/com/zivilon/cinder_loe/client/model/ModelGalvornHelmet.java b/src/main/java/com/zivilon/cinder_loe/client/model/ModelGalvornHelmet.java index 468f115..f5cc786 100644 --- a/src/main/java/com/zivilon/cinder_loe/client/model/ModelGalvornHelmet.java +++ b/src/main/java/com/zivilon/cinder_loe/client/model/ModelGalvornHelmet.java @@ -10,7 +10,6 @@ import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; public class ModelGalvornHelmet extends LOTRModelBiped { - private final ModelRenderer bipedHead; private final ModelRenderer crest; private final ModelRenderer shape12; private final ModelRenderer shape3; @@ -20,51 +19,68 @@ public class ModelGalvornHelmet extends LOTRModelBiped { public ModelGalvornHelmet(float f) { super(f); + this.textureWidth = 64; + this.textureHeight = 32; - textureWidth = 64; - textureHeight = 32; - bipedHead = new ModelRenderer(this); - bipedHead.setRotationPoint(0.0F, 0.0F, 0.0F); - bipedHead.cubeList.add(new ModelBox(bipedHead, 0, 0, -4.0F, -8.0F, -4.0F, 8, 8, 8, 1.0F)); crest = new ModelRenderer(this); crest.setRotationPoint(0.0F, -1.0F, 0.55F); - shape12 = new ModelRenderer(this); shape12.setRotationPoint(0.5F, -4.0F, -6.35F); - crest.addChild(shape12); setRotationAngle(shape12, 1.5708F, 0.0F, 0.0F); shape12.cubeList.add(new ModelBox(shape12, 43, 22, -1.0F, 0.0F, -1.5F, 1, 1, 9, 0.0F)); shape3 = new ModelRenderer(this); shape3.setRotationPoint(0.0F, 0.0F, 0.0F); - shape12.addChild(shape3); setRotationAngle(shape3, 0.0F, -0.2276F, 0.0F); shape3.cubeList.add(new ModelBox(shape3, 0, 25, -1.0F, 0.1F, 0.0F, 1, 0, 6, 0.0F)); shape4 = new ModelRenderer(this); shape4.setRotationPoint(0.0F, 0.0F, 0.0F); - shape3.addChild(shape4); setRotationAngle(shape4, 0.0F, -0.2731F, 0.0F); shape4.cubeList.add(new ModelBox(shape4, 16, 23, -1.0F, 0.2F, 0.0F, 1, 0, 5, 0.0F)); shape5 = new ModelRenderer(this); shape5.setRotationPoint(-1.0F, 0.0F, 0.0F); - shape12.addChild(shape5); setRotationAngle(shape5, 0.0F, 0.2276F, 0.0F); shape5.cubeList.add(new ModelBox(shape5, 50, 3, 0.0F, 0.1F, 0.0F, 1, 0, 6, 0.0F)); shape6 = new ModelRenderer(this); shape6.setRotationPoint(0.0F, 0.0F, 0.0F); - shape5.addChild(shape6); + setRotationAngle(shape6, 0.0F, 0.2731F, 0.0F); shape6.cubeList.add(new ModelBox(shape6, 49, 13, 0.0F, 0.2F, 0.0F, 1, 0, 5, 0.0F)); + + this.bipedHead.cubeList.clear(); + + bipedHead = new ModelRenderer(this); + bipedHead.setRotationPoint(0.0F, 0.0F, 0.0F); + bipedHead.cubeList.add(new ModelBox(bipedHead, 0, 0, -4.0F, -8.0F, -4.0F, 8, 8, 8, 1.0F)); + +// this.crest.addChild(this.shape12); +// this.crest.addChild(this.shape3); +// this.crest.addChild(this.shape4); +// this.crest.addChild(this.shape5); +// this.crest.addChild(this.shape6); + crest.addChild(shape12); + shape12.addChild(shape3); + shape3.addChild(shape4); + shape12.addChild(shape5); + shape5.addChild(shape6); + this.bipedHead.addChild(this.crest); + + this.bipedHeadwear.cubeList.clear(); + this.bipedBody.cubeList.clear(); + this.bipedRightArm.cubeList.clear(); + this.bipedLeftArm.cubeList.clear(); + this.bipedRightLeg.cubeList.clear(); + this.bipedLeftLeg.cubeList.clear(); + } @Override public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { bipedHead.render(f5); - crest.render(f5); } public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { diff --git a/src/main/java/com/zivilon/cinder_loe/client/model/ModelJadeHelmet.java b/src/main/java/com/zivilon/cinder_loe/client/model/ModelJadeHelmet.java index 2e0b612..f0fde8a 100644 --- a/src/main/java/com/zivilon/cinder_loe/client/model/ModelJadeHelmet.java +++ b/src/main/java/com/zivilon/cinder_loe/client/model/ModelJadeHelmet.java @@ -26,6 +26,7 @@ public class ModelJadeHelmet extends LOTRModelBiped { public ModelJadeHelmet(float f) { super (f); + this.textureWidth = 64; this.textureHeight = 32; this.bipedHead.cubeList.clear(); diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/RenderCryptBoss.java b/src/main/java/com/zivilon/cinder_loe/client/render/RenderCryptBoss.java new file mode 100644 index 0000000..ce3c1b0 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/client/render/RenderCryptBoss.java @@ -0,0 +1,43 @@ +package com.zivilon.cinder_loe.client.render; + +import com.zivilon.cinder_loe.entity.Wraith; +import com.zivilon.cinder_loe.entity.boss.CryptBoss; +import lotr.client.model.LOTRModelMarshWraith; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.RenderLiving; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class RenderCryptBoss extends RenderLiving { + private static ResourceLocation skin = new ResourceLocation("cinder_loe:mob/wraith/wraith.png"); + + public RenderCryptBoss() { + super((ModelBase)new LOTRModelMarshWraith(), 0.5F); + } + + protected ResourceLocation getEntityTexture(Entity entity) { + return skin; + } + + protected void preRenderCallback(EntityLivingBase entity, float f) { + super.preRenderCallback(entity, f); + float f1 = 0.9375F; + float hover = MathHelper.sin((((Entity)entity).ticksExisted + f) * 0.15F) * 0.2F - 0.5F; + GL11.glScalef(f1, f1, f1); + GL11.glTranslatef(0.0F, hover, 0.0F); + CryptBoss wraith = (CryptBoss)entity; + if (wraith.getDeathFadeTime() > 0) { + GL11.glEnable(3042); + GL11.glBlendFunc(770, 771); + GL11.glEnable(3008); + GL11.glColor4f(1.0F, 1.0F, 1.0F, wraith.getDeathFadeTime() / 30.0F); + } + } + + protected float getDeathMaxRotation(EntityLivingBase entity) { + return 0.0F; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/projectile/RenderMorgulBlast.java b/src/main/java/com/zivilon/cinder_loe/client/render/projectile/RenderMorgulBlast.java new file mode 100644 index 0000000..f062335 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/client/render/projectile/RenderMorgulBlast.java @@ -0,0 +1,15 @@ +package com.zivilon.cinder_loe.client.render.projectile; + +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; + +public class RenderMorgulBlast extends Render { + protected ResourceLocation getEntityTexture(Entity entity) { + return TextureMap.locationBlocksTexture; + } + + public void doRender(Entity entity, double d, double d1, double d2, float f, float f1) { + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/RenderSarumanFireball.java b/src/main/java/com/zivilon/cinder_loe/client/render/projectile/RenderSarumanFireball.java similarity index 96% rename from src/main/java/com/zivilon/cinder_loe/client/render/RenderSarumanFireball.java rename to src/main/java/com/zivilon/cinder_loe/client/render/projectile/RenderSarumanFireball.java index fad8631..f0f6fc4 100644 --- a/src/main/java/com/zivilon/cinder_loe/client/render/RenderSarumanFireball.java +++ b/src/main/java/com/zivilon/cinder_loe/client/render/projectile/RenderSarumanFireball.java @@ -1,6 +1,5 @@ -package com.zivilon.cinder_loe.client.render; +package com.zivilon.cinder_loe.client.render.projectile; -import lotr.client.LOTRClientProxy; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; import net.minecraft.entity.Entity; diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/RenderSarumanWhiteFireball.java b/src/main/java/com/zivilon/cinder_loe/client/render/projectile/RenderSarumanWhiteFireball.java similarity index 96% rename from src/main/java/com/zivilon/cinder_loe/client/render/RenderSarumanWhiteFireball.java rename to src/main/java/com/zivilon/cinder_loe/client/render/projectile/RenderSarumanWhiteFireball.java index ec581ab..6da4f50 100644 --- a/src/main/java/com/zivilon/cinder_loe/client/render/RenderSarumanWhiteFireball.java +++ b/src/main/java/com/zivilon/cinder_loe/client/render/projectile/RenderSarumanWhiteFireball.java @@ -1,6 +1,5 @@ -package com.zivilon.cinder_loe.client.render; +package com.zivilon.cinder_loe.client.render.projectile; -import lotr.client.LOTRClientProxy; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; import net.minecraft.entity.Entity; diff --git a/src/main/java/com/zivilon/cinder_loe/coremod/LOTRMaterialTransformer.java b/src/main/java/com/zivilon/cinder_loe/coremod/LOTRMaterialTransformer.java index 12f87c3..642a09b 100644 --- a/src/main/java/com/zivilon/cinder_loe/coremod/LOTRMaterialTransformer.java +++ b/src/main/java/com/zivilon/cinder_loe/coremod/LOTRMaterialTransformer.java @@ -67,6 +67,7 @@ public class LOTRMaterialTransformer implements IClassTransformer { addMaterial("USURPER", classNode); addMaterial("WARLORD",classNode); addMaterial("JADE",classNode); + addMaterial("GILDEDGALVORN",classNode); // Protection Conversion diff --git a/src/main/java/com/zivilon/cinder_loe/entity/boss/CryptBoss.java b/src/main/java/com/zivilon/cinder_loe/entity/boss/CryptBoss.java index 93c6fcd..02c397c 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/boss/CryptBoss.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/boss/CryptBoss.java @@ -1,10 +1,11 @@ package com.zivilon.cinder_loe.entity.boss; -import com.zivilon.cinder_loe.CinderLoE; -import com.zivilon.cinder_loe.projectiles.MorgulBlast; +import com.zivilon.cinder_loe.entity.projectile.EntityMorgulBlast; +import lotr.common.LOTRMod; import lotr.common.enchant.LOTREnchantment; import lotr.common.enchant.LOTREnchantmentHelper; import lotr.common.entity.ai.*; +import lotr.common.entity.npc.LOTREntityMarshWraith; import lotr.common.entity.npc.LOTREntityNPC; import lotr.common.fac.LOTRFaction; import lotr.common.quest.LOTRMiniQuest; @@ -21,10 +22,12 @@ import net.minecraft.util.DamageSource; import net.minecraft.util.MathHelper; import net.minecraft.world.World; +import java.util.Random; + public class CryptBoss extends LOTREntityNPC { private EntityAIBase meleeAttackAI = new LOTREntityAIAttackOnCollide(this, 2.0, false); - private EntityAIBase rangedAttackAI = new LOTREntityAIRangedAttack(this, 1.5, 30, 50, 24.0f); + private EntityAIBase rangedAttackAI = new LOTREntityAIRangedAttack(this, 1.5, 30, 50, 60.0f); //Copying Wraith temporarily public CryptBoss(World world) { @@ -32,7 +35,8 @@ public class CryptBoss extends LOTREntityNPC { setSize(0.8F, 2.5F); this.tasks.taskEntries.clear(); this.tasks.addTask(0, (EntityAIBase)new EntityAISwimming((EntityLiving)this)); - this.tasks.addTask(0, (EntityAIBase)new LOTREntityAIBossJumpAttack(this, 1.5, 0.02f)); + //Causes crash + //this.tasks.addTask(0, (EntityAIBase)new LOTREntityAIBossJumpAttack(this, 1.5, 0.02f)); this.tasks.addTask(2, (EntityAIBase)new EntityAIWander((EntityCreature)this, 1.0)); this.tasks.addTask(3, (EntityAIBase)new EntityAIWatchClosest2((EntityLiving)this, EntityPlayer.class, 12.0f, 0.02f)); this.tasks.addTask(3, (EntityAIBase)new EntityAIWatchClosest2((EntityLiving)this, LOTREntityNPC.class, 8.0f, 0.02f)); @@ -105,15 +109,23 @@ public class CryptBoss extends LOTREntityNPC { public void setInWeb() {} + @Override public void onLivingUpdate() { super.onLivingUpdate(); - if (rand.nextBoolean()) - ((Entity)this).worldObj.spawnParticle("morgulPortal", ((Entity)this).posX + (rand.nextDouble() - 0.5D) * ((Entity)this).width, ((Entity)this).posY + rand.nextDouble() * ((Entity)this).height, ((Entity)this).posZ + (rand.nextDouble() - 0.5D) * ((Entity)this).width, 0.0D, 0.0D, 0.0D); - if (!((Entity)this).worldObj.isRemote) { - if (getDeathFadeTime() > 0) - setDeathFadeTime(getDeathFadeTime() - 1); - if (getDeathFadeTime() == 1) - setDead(); + if (this.worldObj.isRemote) { + for (int l = 0; l < 1; ++l) { + double d = this.posX + (double)this.width * MathHelper.getRandomDoubleInRange((Random)this.rand, (double)-0.5, (double)0.5); + double d1 = this.posY + (double)this.height * MathHelper.getRandomDoubleInRange((Random)this.rand, (double)0.4, (double)0.8); + double d2 = this.posZ + (double)this.width * MathHelper.getRandomDoubleInRange((Random)this.rand, (double)-0.5, (double)0.5); + double d3 = MathHelper.getRandomDoubleInRange((Random)this.rand, (double)-0.1, (double)0.1); + double d4 = MathHelper.getRandomDoubleInRange((Random)this.rand, (double)-0.2, (double)-0.05); + double d5 = MathHelper.getRandomDoubleInRange((Random)this.rand, (double)-0.1, (double)0.1); + if (this.rand.nextBoolean()) { + LOTRMod.proxy.spawnParticle("morgulPortal", d, d1, d2, d3, d4, d5); + continue; + } + this.worldObj.spawnParticle("smoke", d, d1, d2, d3, d4, d5); + } } } @@ -138,10 +150,10 @@ public class CryptBoss extends LOTREntityNPC { @Override public void attackEntityWithRangedAttack(EntityLivingBase target, float f) { - MorgulBlast projectile = new MorgulBlast(this.worldObj, (EntityLivingBase)this, target); - projectile.leavesDamage = 6.0f; + EntityMorgulBlast projectile = new EntityMorgulBlast(this.worldObj, (EntityLivingBase)this, target); + projectile.leavesDamage = 16.0f; this.worldObj.spawnEntityInWorld((Entity)projectile); - this.playSound("lotr:wraith.marchWraith_shoot", this.getSoundVolume(), this.getSoundPitch()); + this.playSound("lotr:wraith.marshWraith_shoot", this.getSoundVolume(), this.getSoundPitch()); this.swingItem(); } @@ -150,7 +162,7 @@ public class CryptBoss extends LOTREntityNPC { Entity entity = damagesource.getEntity(); if (entity instanceof EntityLivingBase && entity == damagesource.getSourceOfDamage()) { ItemStack itemstack = ((EntityLivingBase)entity).getHeldItem(); - if (itemstack != null && LOTREnchantmentHelper.hasEnchant(itemstack, LOTREnchantment.baneWraith)) + if (itemstack != null && LOTREnchantmentHelper.hasEnchant(itemstack, LOTREnchantment.baneWight)) vulnerable = true; } if (vulnerable && getDeathFadeTime() == 0) { diff --git a/src/main/java/com/zivilon/cinder_loe/projectiles/MorgulBlast.java b/src/main/java/com/zivilon/cinder_loe/entity/projectile/EntityMorgulBlast.java similarity index 68% rename from src/main/java/com/zivilon/cinder_loe/projectiles/MorgulBlast.java rename to src/main/java/com/zivilon/cinder_loe/entity/projectile/EntityMorgulBlast.java index ea2b655..728e987 100644 --- a/src/main/java/com/zivilon/cinder_loe/projectiles/MorgulBlast.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/projectile/EntityMorgulBlast.java @@ -1,9 +1,7 @@ -package com.zivilon.cinder_loe.projectiles; +package com.zivilon.cinder_loe.entity.projectile; import lotr.common.LOTRMod; import lotr.common.entity.npc.LOTREntityNPC; -import lotr.common.entity.projectile.LOTREntityMallornLeafBomb; -import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.projectile.EntityThrowable; @@ -17,20 +15,20 @@ import net.minecraft.world.World; import java.util.List; import java.util.UUID; -public class MorgulBlast extends LOTREntityMallornLeafBomb { +public class EntityMorgulBlast extends EntityThrowable { private UUID throwerUUID; private int leavesAge; private static int MAX_LEAVES_AGE = 200; - public float leavesDamage = 10; + public float leavesDamage; - public MorgulBlast(World world) { + public EntityMorgulBlast(World world) { super(world); this.setSize(2.0f, 2.0f); this.setPosition(this.posX, this.posY, this.posZ); } - public MorgulBlast(World world, EntityLivingBase thrower, EntityLivingBase target) { + public EntityMorgulBlast(World world, EntityLivingBase thrower, EntityLivingBase target) { super(world, thrower); this.setSize(2.0f, 2.0f); this.setPosition(this.posX, this.posY, this.posZ); @@ -51,9 +49,44 @@ public class MorgulBlast extends LOTREntityMallornLeafBomb { } } + public EntityMorgulBlast(World world, double d, double d1, double d2) { + super(world, d, d1, d2); + this.setSize(2.0f, 2.0f); + this.setPosition(this.posX, this.posY, this.posZ); + } + + public void writeEntityToNBT(NBTTagCompound nbt) { + super.writeEntityToNBT(nbt); + nbt.setInteger("LeavesAge", this.leavesAge); + nbt.setFloat("LeavesDamage", this.leavesDamage); + if (this.throwerUUID != null) { + nbt.setString("ThrowerUUID", this.throwerUUID.toString()); + } + } + + public void readEntityFromNBT(NBTTagCompound nbt) { + super.readEntityFromNBT(nbt); + this.leavesAge = nbt.getInteger("LeavesAge"); + this.leavesDamage = nbt.getFloat("LeavesDamage"); + if (nbt.hasKey("ThrowerUUID")) { + this.throwerUUID = UUID.fromString(nbt.getString("ThrowerUUID")); + } + } + + protected void onImpact(MovingObjectPosition m) { + if (!this.worldObj.isRemote) { + Entity entity; + if (m.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + this.explode(null); + } else if (m.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && this.isEntityVulnerable(entity = m.entityHit)) { + this.explode(entity); + } + } + } + private void explode(Entity target) { if (!this.worldObj.isRemote) { - double range = 2.0; + double range = 3.0; List entities = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, this.boundingBox.expand(range, range, range)); if (!entities.isEmpty()) { for (int i = 0; i < entities.size(); ++i) { @@ -114,8 +147,28 @@ public class MorgulBlast extends LOTREntityMallornLeafBomb { double d4 = result.yCoord / 10.0; double d5 = result.zCoord / 10.0; LOTRMod.proxy.spawnParticle("morgulPortal", d, d1, d2, d3, d4, d5); - LOTRMod.proxy.spawnParticle("smoke", d, d1, d2, d3 * 0.5, d4 * 0.5, d5 * 0.5); + // LOTRMod.proxy.spawnParticle("smoke", d, d1, d2, d3 * 0.5, d4 * 0.5, d5 * 0.5); + worldObj.spawnParticle("smoke", d, d1, d2, d3 * 0.5, d4 * 0.5, d5 * 0.5); + + } + } + } + public EntityLivingBase getThrower() { + if (this.throwerUUID != null) { + for (Object obj : this.worldObj.loadedEntityList) { + Entity entity = (Entity)obj; + if (!(entity instanceof EntityLivingBase) || !entity.getUniqueID().equals(this.throwerUUID)) continue; + return (EntityLivingBase)entity; } } + return null; + } + + protected float func_70182_d() { + return 1.0f; + } + + protected float getGravityVelocity() { + return 0.0f; } } diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRArmorModels.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRArmorModels.java index f3ab789..0409601 100644 --- a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRArmorModels.java +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRArmorModels.java @@ -102,7 +102,7 @@ public class MixinLOTRArmorModels { map.put(CinderLoE.bodyJade, new ModelBodyJade(1.0f)); map.put(CinderLoE.legsJade, new ModelLegsJade(1.0f)); map.put(CinderLoE.helmetJade, new ModelJadeHelmet(1.0f)); - map.put(LOTRMod.helmetGalvorn, new ModelGalvornHelmet(1.0f)); + map.put(CinderLoE.helmetGildedGalvorn, new ModelGalvornHelmet(1.0f)); map.put(LOTRMod.plate, new LOTRModelHeadPlate()); map.put(LOTRMod.woodPlate, new LOTRModelHeadPlate()); map.put(LOTRMod.ceramicPlate, new LOTRModelHeadPlate()); diff --git a/src/main/java/com/zivilon/cinder_loe/recipes.java b/src/main/java/com/zivilon/cinder_loe/recipes.java index 1bf759b..44843e1 100644 --- a/src/main/java/com/zivilon/cinder_loe/recipes.java +++ b/src/main/java/com/zivilon/cinder_loe/recipes.java @@ -127,7 +127,7 @@ public class recipes { GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.fieldRepairKit), new ItemStack(CinderLoE.forgingKit, 1, 0), - new ItemStack(CinderLoE.spiceIngredient, 1, 1))); + new ItemStack(CinderLoE.forgingKit, 1, 1))); OreDictionary.registerOre("vegetable1", CinderLoE.onion); diff --git a/src/main/resources/assets/lotr/armor/gildedgalvorn_1.png b/src/main/resources/assets/lotr/armor/gildedgalvorn_1.png new file mode 100644 index 0000000..a3186dc Binary files /dev/null and b/src/main/resources/assets/lotr/armor/gildedgalvorn_1.png differ diff --git a/src/main/resources/assets/lotr/armor/gildedgalvorn_2.png b/src/main/resources/assets/lotr/armor/gildedgalvorn_2.png new file mode 100644 index 0000000..9ef090c Binary files /dev/null and b/src/main/resources/assets/lotr/armor/gildedgalvorn_2.png differ diff --git a/src/main/resources/assets/lotr/armor/galvorn_helmet.png b/src/main/resources/assets/lotr/armor/gildedgalvorn_helmet.png similarity index 100% rename from src/main/resources/assets/lotr/armor/galvorn_helmet.png rename to src/main/resources/assets/lotr/armor/gildedgalvorn_helmet.png diff --git a/src/main/resources/assets/lotr/textures/items/bodyGildedGalvorn.png b/src/main/resources/assets/lotr/textures/items/bodyGildedGalvorn.png new file mode 100644 index 0000000..8e5c836 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/bodyGildedGalvorn.png differ diff --git a/src/main/resources/assets/lotr/textures/items/bootsGildedGalvorn.png b/src/main/resources/assets/lotr/textures/items/bootsGildedGalvorn.png new file mode 100644 index 0000000..1daa131 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/bootsGildedGalvorn.png differ diff --git a/src/main/resources/assets/lotr/textures/items/flatbread.png b/src/main/resources/assets/lotr/textures/items/flatbread.png new file mode 100644 index 0000000..32847c6 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/flatbread.png differ diff --git a/src/main/resources/assets/lotr/textures/items/helmetGildedGalvorn.png b/src/main/resources/assets/lotr/textures/items/helmetGildedGalvorn.png new file mode 100644 index 0000000..1039aaa Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/helmetGildedGalvorn.png differ diff --git a/src/main/resources/assets/lotr/textures/items/legsGildedGalvorn.png b/src/main/resources/assets/lotr/textures/items/legsGildedGalvorn.png new file mode 100644 index 0000000..375f134 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/legsGildedGalvorn.png differ