From 339781e2e00bb8e9360a53ea49c611845499f61c Mon Sep 17 00:00:00 2001 From: Shinare Date: Tue, 10 Sep 2024 22:56:38 +0300 Subject: [PATCH] Added repair kits --- .../com/zivilon/cinder_loe/CinderLoE.java | 490 ++++++------------ .../com/zivilon/cinder_loe/Materials.java | 6 - .../cinder_loe/blocks/EnchantedIce.java | 47 -- .../cinder_loe/blocks/ForgingStation.java | 279 ---------- .../zivilon/cinder_loe/blocks/IceCage.java | 221 -------- .../zivilon/cinder_loe/blocks/ShadowTile.java | 71 --- .../cinder_loe/client/model/ModelNex.java | 200 ------- .../client/model/ModelNexIceCrystal.java | 71 --- .../model/blocks/ModelForgingStation.java | 72 --- .../cinder_loe/client/render/RenderNex.java | 136 ----- .../client/render/RenderNexCloud.java | 50 -- .../client/render/RenderNexMiniboss.java | 52 -- .../client/render/RenderNimveilBolt.java | 136 ----- .../client/render/block/RenderIceCage.java | 69 --- .../client/render/item/TrollClubRenderer.java | 59 --- .../TileEntityForgingStationRenderer.java | 113 ---- .../coremod/LOTRMaterialTransformer.java | 6 - .../cinder_loe/coremod/LOTRWeaponLinker.java | 3 +- .../com/zivilon/cinder_loe/entity/Nex.java | 417 --------------- .../zivilon/cinder_loe/entity/NexCloud.java | 180 ------- .../zivilon/cinder_loe/entity/NexFire.java | 67 --- .../com/zivilon/cinder_loe/entity/NexIce.java | 68 --- .../cinder_loe/entity/NexMiniboss.java | 152 ------ .../zivilon/cinder_loe/entity/NexShadow.java | 85 --- .../zivilon/cinder_loe/entity/NexToxin.java | 73 --- .../entity/effect/NimveilLightningBolt.java | 84 --- .../cinder_loe/items/BlessedHammer.java | 26 - .../zivilon/cinder_loe/items/Celeiniss.java | 26 - .../cinder_loe/items/CinderLoESpawnEgg.java | 5 - .../zivilon/cinder_loe/items/IceThawer.java | 27 - .../com/zivilon/cinder_loe/items/Nimveil.java | 458 ---------------- .../zivilon/cinder_loe/items/NimveilPart.java | 128 ----- .../zivilon/cinder_loe/items/ToxicCore.java | 17 - .../zivilon/cinder_loe/items/WeaponPart.java | 127 ----- .../mixins/MixinEntityLivingBase.java | 204 -------- .../cinder_loe/mixins/MixinItemRenderer.java | 16 - .../mixins/MixinLOTRItemRendererManager.java | 111 ---- .../mixins/MixinLOTRRenderLargeItem.java | 156 ------ .../cinder_loe/mixins/MixinSlotCrafting.java | 6 +- .../cinder_loe/recipe/ForgingRecipe.java | 57 -- .../cinder_loe/recipe/ForgingRecipes.java | 86 --- .../recipe/ToxicCoreArrowsRecipe.java | 81 --- .../java/com/zivilon/cinder_loe/recipes.java | 7 - .../tileentity/TileEntityForgingStation.java | 127 ----- .../tileentity/TileEntityShadowTile.java | 37 -- .../cinder_loe/util/DurableItemCrafter.java | 4 - .../util/LOTREnchantmentExclusions.java | 1 - .../zivilon/cinder_loe/util/Utilities.java | 32 -- .../zivilon/cinder_loe/util/VT_additions.java | 2 - src/main/resources/mixins.cinder_loe.json | 2 - 50 files changed, 147 insertions(+), 4803 deletions(-) delete mode 100644 src/main/java/com/zivilon/cinder_loe/blocks/EnchantedIce.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/blocks/ForgingStation.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/blocks/IceCage.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/blocks/ShadowTile.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/client/model/ModelNex.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/client/model/ModelNexIceCrystal.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/client/model/blocks/ModelForgingStation.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/client/render/RenderNex.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/client/render/RenderNexCloud.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/client/render/RenderNexMiniboss.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/client/render/RenderNimveilBolt.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/client/render/block/RenderIceCage.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/client/render/item/TrollClubRenderer.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/client/render/tileentity/TileEntityForgingStationRenderer.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/entity/Nex.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/entity/NexCloud.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/entity/NexFire.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/entity/NexIce.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/entity/NexMiniboss.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/entity/NexShadow.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/entity/NexToxin.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/entity/effect/NimveilLightningBolt.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/items/BlessedHammer.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/items/Celeiniss.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/items/IceThawer.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/items/Nimveil.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/items/NimveilPart.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/items/ToxicCore.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/items/WeaponPart.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/mixins/MixinEntityLivingBase.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRItemRendererManager.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/recipe/ForgingRecipe.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/recipe/ForgingRecipes.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/recipe/ToxicCoreArrowsRecipe.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/tileentity/TileEntityForgingStation.java delete mode 100644 src/main/java/com/zivilon/cinder_loe/tileentity/TileEntityShadowTile.java diff --git a/src/main/java/com/zivilon/cinder_loe/CinderLoE.java b/src/main/java/com/zivilon/cinder_loe/CinderLoE.java index 8030cc6..f8f9e47 100644 --- a/src/main/java/com/zivilon/cinder_loe/CinderLoE.java +++ b/src/main/java/com/zivilon/cinder_loe/CinderLoE.java @@ -9,7 +9,6 @@ import com.zivilon.cinder_loe.client.render.projectile.*; import com.zivilon.cinder_loe.command.CommandCinderCharacter; import com.zivilon.cinder_loe.entity.*; import com.zivilon.cinder_loe.entity.corrupt.*; -import com.zivilon.cinder_loe.entity.effect.*; import com.zivilon.cinder_loe.entity.npc.*; import com.zivilon.cinder_loe.entity.npc.dwarf.RedDwarfArbalest; import com.zivilon.cinder_loe.entity.npc.dwarf.RedDwarfBannerBearer; @@ -108,20 +107,13 @@ public class CinderLoE { public static LOTRMaterial MATERIAL_LIMWAITH_WOOD; public static LOTRMaterial EVENT; public static LOTRMaterial MATERIAL_BREE; - public static LOTRMaterial MATERIAL_RHUDUAR; + public static LOTRMaterial MATERIAL_RHUDAUR; public static LOTRMaterial MATERIAL_BATTLENUN; public static LOTRMaterial MATERIAL_ASH; public static LOTRMaterial MATERIAL_SERPENT; public static LOTRMaterial MATERIAL_USURPER; public static LOTRMaterial MATERIAL_WARLORD; public static LOTRMaterial MATERIAL_JADE; - public static LOTRMaterial MATERIAL_NEX_ICE; - public static LOTRMaterial MATERIAL_NEX_FIRE; - public static LOTRMaterial MATERIAL_NEX_TOXIN; - public static LOTRMaterial MATERIAL_NEX_SHADOW; - public static LOTRMaterial MATERIAL_NIMVEIL; - public static LOTRMaterial MATERIAL_FROZEN; - // Blocks // public static Block barricade; @@ -148,12 +140,6 @@ public class CinderLoE { public static Block voidblock; public static Block entityBarrier; - // Frozen Dungeon Blocks - public static Block shadowTile; - public static Block iceCage; - public static Block enchantedIce; - public static Block forgingStation; - //public static Block verticalWeaponRack; //Gates @@ -201,38 +187,8 @@ public class CinderLoE { public static Item legsJade; public static Item bootsJade; - // Frozen Dungeon - public static Item helmetNexIce; - public static Item bodyNexIce; - public static Item legsNexIce; - public static Item bootsNexIce; - public static Item helmetNexFire; - public static Item bodyNexFire; - public static Item legsNexFire; - public static Item bootsNexFire; - public static Item helmetNexToxin; - public static Item bodyNexToxin; - public static Item legsNexToxin; - public static Item bootsNexToxin; - public static Item helmetNexShadow; - public static Item bodyNexShadow; - public static Item legsNexShadow; - public static Item bootsNexShadow; - public static Item celeiniss; - public static Item nimveil; - public static Item nimveilPart; - public static Item blessedHammer; - public static Item toxicCore; - public static Item iceThawer; - public static Item demonbloodVial; - public static Item mugDemonicHealthPotion; - public static Item deceiverBlade; - public static Item anaroreBow; - public static Item trollChieftainClub; - public static Item glaechirSpear; - public static Item weaponPart; - // Misc + public static Item repairKit; // Common tools/weapons public static Item whip; @@ -352,10 +308,6 @@ public class CinderLoE { } MinecraftForge.EVENT_BUS.register(this); new CharacterEventListener(); - - if (event.getSide().isClient()) { - ClientCommandHandler.instance.registerCommand(new DevCommand()); - } } @@ -367,11 +319,9 @@ public class CinderLoE { modifySpawnLists(); } Utilities.initialize_reflects(); - recipes.registerRecipes(); // Register recipes at com.zivilon.cinder_loe.recipes.java + recipes.registerRecipes(); setupTradeEntries(); LOTRWeaponStats.registerMeleeReach(Whip.class, 1.5F); -/* LOTRWeaponStats.registerMeleeReach(Celeiniss.class, 1.8F); - LOTRWeaponStats.registerMeleeSpeed(Celeiniss.class, 1.0F);*/ LoECreativeTabs.setupIcons(); } @@ -384,8 +334,6 @@ public class CinderLoE { public void registerEntities() { // Last ID added: 54 ///GameRegistry.registerTileEntity(TileEntityMistBlock.class, "TileEntityMistBlock"); -/* GameRegistry.registerTileEntity(TileEntityShadowTile.class, "TileEntityShadowTile"); - GameRegistry.registerTileEntity(TileEntityForgingStation.class, "TileEntityForgingStation");*/ ///.registerBlock(TileEntityRustedSword, "TileEntityRustedSword"); int entityID = 7320; // Always increment entityID by 1 over the last entity to ensure unique IDs @@ -451,14 +399,6 @@ public class CinderLoE { EntityRegistry.registerModEntity(MorgulOrc.class, "MorgulOrc", (entityID + 53), this, 64, 1, true); // EntityRegistry.registerModEntity(MorgulOrc.class, "MorgulOrc", (entityID + 54), this, 64, 1, true); - // Frozen Dungeon -/* EntityRegistry.registerModEntity(Nex.class, "Nex", (entityID + 45), this, 64, 1, true); - EntityRegistry.registerModEntity(NexShadow.class, "NexShadow", (entityID + 46), this, 64, 1, true); - EntityRegistry.registerModEntity(NexIce.class, "NexIce", (entityID + 47), this, 64, 1, true); - EntityRegistry.registerModEntity(NexFire.class, "NexFire", (entityID + 48), this, 64, 1, true); - EntityRegistry.registerModEntity(NexToxin.class, "NexToxin", (entityID + 49), this, 64, 1, true); - EntityRegistry.registerModEntity(NexCloud.class, "NexCloud", (entityID + 50), this, 64, 1, true); - EntityRegistry.registerModEntity(NimveilLightningBolt.class, "NimveilLightningBolt", (entityID + 51), this, 64, 1, true);*/ } public void registerBlocks() { @@ -529,16 +469,6 @@ public class CinderLoE { entityBarrier = (new EntityBarrier()); GameRegistry.registerBlock(entityBarrier, "entity_barrier"); - // Frozen Dungeon -/* shadowTile = (new ShadowTile()); - GameRegistry.registerBlock(shadowTile, "shadow_tile"); - iceCage = (new IceCage()); - GameRegistry.registerBlock(iceCage, "ice_cage"); - enchantedIce = (new EnchantedIce()); - GameRegistry.registerBlock(enchantedIce, "enchanted_ice"); - forgingStation = (new ForgingStation()); - GameRegistry.registerBlock(forgingStation, "forging_station");*/ - // Building Blocks cutDrystone = (new cutDrystone()); GameRegistry.registerBlock(cutDrystone, "cutDrystone"); @@ -601,35 +531,64 @@ public class CinderLoE { // Relics welfRelic = (new WoodElfRelic()).setUnlocalizedName("lotr:welfRelic").setTextureName("lotr:welfRelic"); - /* - * Item Registation, add up the "last ID added" upon adding a new item + /** + * Item Registation * Weapons will need to be linked - */ - // Last ID added: 127 + * + * ID 6000-6099 + * Misc / Materials + * + * ID 6100-6199 + * Misc equipment + * + * ID 6200-6399 + * Event + * + * ID 6400-6499 + * Faction equipment + * + * ID 6500-6699 + * Unassigned + * + * ID 6700-6799 + * Character or Objective + * + * ID 6800-6899 + * Elite armor + * + * ID 6900-6999 + * Food and crops + * + * ID 7000-7199 + * Unassigned + * + * ID 7200-7299 + * Frozen Dungeon + **/ // ==Food Items== - ItemRegistration.registerItem(onion, "onion", 58); - ItemRegistration.registerItem(cabbage, "cabbage", 59); - ItemRegistration.registerItem(pelmen, "pelmen", 60); - ItemRegistration.registerItem(lightStew, "lightStew", 61); - ItemRegistration.registerItem(spice, "spice", 62); - ItemRegistration.registerItem(spicedHam, "spicedHam", 63); - ItemRegistration.registerItem(chocolatebar, "chocolatebar", 84); - ItemRegistration.registerItem(fruitsalad, "fruitsalad", 85); - ItemRegistration.registerItem(flour, "flour", 86); - ItemRegistration.registerItem(dough, "dough", 87); - ItemRegistration.registerItem(pasta, "pasta", 88); - ItemRegistration.registerItem(pretzel, "pretzel", 89); - ItemRegistration.registerItem(halva, "halva", 94); - ItemRegistration.registerItem(doner_kebab, "doner_kebab", 95); - - ItemRegistration.registerItem(spawnEgg, "spawnEgg", 42); + ItemRegistration.register(onion, "onion", 6900); + ItemRegistration.register(cabbage, "cabbage", 6901); + ItemRegistration.register(pelmen, "pelmen", 6902); + ItemRegistration.register(lightStew, "lightStew", 6902); + ItemRegistration.register(spice, "spice", 6903); + ItemRegistration.register(spicedHam, "spicedHam", 6904); + ItemRegistration.register(chocolatebar, "chocolatebar", 6905); + ItemRegistration.register(fruitsalad, "fruitsalad", 6906); + ItemRegistration.register(flour, "flour", 6907); + ItemRegistration.register(dough, "dough", 6908); + ItemRegistration.register(pasta, "pasta", 6909); + ItemRegistration.register(pretzel, "pretzel", 6910); + ItemRegistration.register(halva, "halva", 6911); + ItemRegistration.register(doner_kebab, "doner_kebab", 6912); + + ItemRegistration.register(spawnEgg, "spawnEgg", 6003); // Wizard Staves - ItemRegistration.registerItem(radagastStaff, "radagastStaff", 0); - ItemRegistration.registerItem(pallandoStaff, "pallandoStaff", 1); - ItemRegistration.registerItem(alatarStaff, "alatarStaff", 2); - ItemRegistration.registerItem(sarumanStaff, "sarumanStaff", 3); + ItemRegistration.register(radagastStaff, "radagastStaff", 6700); + ItemRegistration.register(pallandoStaff, "pallandoStaff", 6701); + ItemRegistration.register(alatarStaff, "alatarStaff", 6702); + ItemRegistration.register(sarumanStaff, "sarumanStaff", 6703); linkLOTRWeapon(radagastStaff, "radagastStaff"); linkLOTRWeapon(pallandoStaff, "pallandoStaff"); @@ -637,19 +596,13 @@ public class CinderLoE { linkLOTRWeapon(sarumanStaff, "sarumanStaff"); //Relics - ItemRegistration.registerItem(welfRelic, "welfRelic", 56); + ItemRegistration.register(welfRelic, "welfRelic", 6704); linkLOTRWeapon(welfRelic, "welfRelic"); // Misc EVENT = getLOTRMaterialByName("EVENT"); MATERIAL_JADE = getLOTRMaterialByName("JADE"); - MATERIAL_NEX_ICE = getLOTRMaterialByName("NEX_ICE"); - MATERIAL_NEX_FIRE = getLOTRMaterialByName("NEX_FIRE"); - MATERIAL_NEX_TOXIN = getLOTRMaterialByName("NEX_TOXIN"); - MATERIAL_NEX_SHADOW = getLOTRMaterialByName("NEX_SHADOW"); - MATERIAL_NIMVEIL = getLOTRMaterialByName("NIMVEIL"); - MATERIAL_FROZEN = getLOTRMaterialByName("FROZEN"); frostblade = (new LOTRItemSword(EVENT)).setUnlocalizedName("lotr:frostblade").setTextureName("lotr:frostblade"); daggervoid = (new VoidDagger(EVENT)).addWeaponDamage(5.0F).setUnlocalizedName("lotr:daggerVoid").setTextureName("lotr:daggerVoid").setCreativeTab(null); @@ -662,80 +615,17 @@ public class CinderLoE { legsJade = (new LOTRItemArmor(MATERIAL_JADE, 2,"leggings")).setUnlocalizedName("lotr:legsJade").setTextureName("lotr:legsJade").setCreativeTab(null); bootsJade = (new LOTRItemArmor(MATERIAL_JADE, 3)).setUnlocalizedName("lotr:bootsJade").setTextureName("lotr:bootsJade").setCreativeTab(null); -/* helmetNexIce = (new LoEArmor(MATERIAL_NEX_ICE, 0, enchantedIce)).setUnlocalizedName("lotr:helmetNexIce").setTextureName("lotr:helmetNexIce"); - bodyNexIce = (new LoEArmor(MATERIAL_NEX_ICE, 1, enchantedIce)).setUnlocalizedName("lotr:bodyNexIce").setTextureName("lotr:bodyNexIce"); - legsNexIce = (new LoEArmor(MATERIAL_NEX_ICE, 2, enchantedIce)).setUnlocalizedName("lotr:legsNexIce").setTextureName("lotr:legsNexIce"); - bootsNexIce = (new LoEArmor(MATERIAL_NEX_ICE, 3, enchantedIce)).setUnlocalizedName("lotr:bootsNexIce").setTextureName("lotr:bootsNexIce"); - helmetNexFire = (new LoEArmor(MATERIAL_NEX_FIRE, 0, enchantedIce)).setUnlocalizedName("lotr:helmetNexFire").setTextureName("lotr:helmetNexFire"); - bodyNexFire = (new LoEArmor(MATERIAL_NEX_FIRE, 1, enchantedIce)).setUnlocalizedName("lotr:bodyNexFire").setTextureName("lotr:bodyNexFire"); - legsNexFire = (new LoEArmor(MATERIAL_NEX_FIRE, 2, enchantedIce)).setUnlocalizedName("lotr:legsNexFire").setTextureName("lotr:legsNexFire"); - bootsNexFire = (new LoEArmor(MATERIAL_NEX_FIRE, 3, enchantedIce)).setUnlocalizedName("lotr:bootsNexFire").setTextureName("lotr:bootsNexFire"); - helmetNexToxin = (new LoEArmor(MATERIAL_NEX_TOXIN, 0, enchantedIce)).setUnlocalizedName("lotr:helmetNexToxin").setTextureName("lotr:helmetNexToxin"); - bodyNexToxin = (new LoEArmor(MATERIAL_NEX_TOXIN, 1, enchantedIce)).setUnlocalizedName("lotr:bodyNexToxin").setTextureName("lotr:bodyNexToxin"); - legsNexToxin = (new LoEArmor(MATERIAL_NEX_TOXIN, 2, enchantedIce)).setUnlocalizedName("lotr:legsNexToxin").setTextureName("lotr:legsNexToxin"); - bootsNexToxin = (new LoEArmor(MATERIAL_NEX_TOXIN, 3, enchantedIce)).setUnlocalizedName("lotr:bootsNexToxin").setTextureName("lotr:bootsNexToxin"); - helmetNexShadow = (new LoEArmor(MATERIAL_NEX_SHADOW, 0, enchantedIce)).setUnlocalizedName("lotr:helmetNexShadow").setTextureName("lotr:helmetNexShadow"); - bodyNexShadow = (new LoEArmor(MATERIAL_NEX_SHADOW, 1, enchantedIce)).setUnlocalizedName("lotr:bodyNexShadow").setTextureName("lotr:bodyNexShadow"); - legsNexShadow = (new LoEArmor(MATERIAL_NEX_SHADOW, 2, enchantedIce)).setUnlocalizedName("lotr:legsNexShadow").setTextureName("lotr:legsNexShadow"); - bootsNexShadow = (new LoEArmor(MATERIAL_NEX_SHADOW, 3, enchantedIce)).setUnlocalizedName("lotr:bootsNexShadow").setTextureName("lotr:bootsNexShadow"); - celeiniss = (new Celeiniss()); - blessedHammer = (new BlessedHammer()); - nimveil = (new Nimveil()); - nimveilPart = (new NimveilPart()); - toxicCore = (new ToxicCore()); - iceThawer = (new IceThawer()); - demonbloodVial = (new Item()).setUnlocalizedName("lotr:demonbloodVial").setCreativeTab(LoECreativeTabs.tabMiscLoE).setTextureName("lotr:demonbloodVial"); - mugDemonicHealthPotion = (new LoEItemMug(0.0F)).setDrinkStats(20, 1.0F).addPotionEffect(Potion.field_76434_w.id, 28800).setUnlocalizedName("lotr:mugDemonicHealthPotion"); - ((LoEItemMug)mugDemonicHealthPotion).setTextureNameFromUnlocalizedName(); - deceiverBlade = (new LoESword(LOTRMaterial.MORGUL, enchantedIce).setWeaponDamage(8.0F)).setUnlocalizedName("deceiver_blade").setTextureName("lotr:deceiver_blade").setMaxDamage(1000); - anaroreBow = (new LoEBow(MATERIAL_FROZEN, enchantedIce, 2.0D).setDrawTime(16)).setUnlocalizedName("anarore_bow").setTextureName("lotr:anarore_bow").setMaxDamage(1000); - trollChieftainClub = (new LoEHammer(MATERIAL_FROZEN, enchantedIce)).setUnlocalizedName("troll_chieftain_club").setTextureName("lotr:troll_chieftain_club").setMaxDamage(1000); - glaechirSpear = (new LoESpear(MATERIAL_FROZEN, enchantedIce)).setUnlocalizedName("glaechir_spear").setTextureName("lotr:glaechir_spear").setMaxDamage(1000); - weaponPart = (new WeaponPart()); - - linkLOTRWeapon(celeiniss, "celeiniss"); - linkLOTRWeapon(nimveil, "nimveil"); - - ItemRegistration.register(helmetNexIce,"helmetNexIce",7200); - ItemRegistration.register(bodyNexIce,"bodyNexIce",7201); - ItemRegistration.register(legsNexIce,"legsNexIce",7202); - ItemRegistration.register(bootsNexIce,"bootsNexIce",7203); - ItemRegistration.register(helmetNexFire,"helmetNexFire",7204); - ItemRegistration.register(bodyNexFire,"bodyNexFire",7205); - ItemRegistration.register(legsNexFire,"legsNexFire",7206); - ItemRegistration.register(bootsNexFire,"bootsNexFire",7207); - ItemRegistration.register(helmetNexToxin,"helmetNexToxin",7208); - ItemRegistration.register(bodyNexToxin,"bodyNexToxin",7209); - ItemRegistration.register(legsNexToxin,"legsNexToxin",7210); - ItemRegistration.register(bootsNexToxin,"bootsNexToxin",7211); - ItemRegistration.register(helmetNexShadow,"helmetNexShadow",7212); - ItemRegistration.register(bodyNexShadow,"bodyNexShadow",7213); - ItemRegistration.register(legsNexShadow,"legsNexShadow",7214); - ItemRegistration.register(bootsNexShadow,"bootsNexShadow",7215); - ItemRegistration.register(celeiniss, "celeiniss",7220); - ItemRegistration.register(nimveil, "nimveil",7221); - ItemRegistration.register(nimveilPart, "nimveilPart",7222); - ItemRegistration.register(blessedHammer, "blessedHammer",7223); - ItemRegistration.register(deceiverBlade, "deceiverBlade",7224); - ItemRegistration.register(anaroreBow, "anaroreBow",7225); - ItemRegistration.register(trollChieftainClub, "trollChieftainClub",7226); - ItemRegistration.register(glaechirSpear, "glaechirSpear",7227); - ItemRegistration.register(weaponPart, "weaponPart", 7228); - ItemRegistration.register(toxicCore,"toxicCore",7229); - ItemRegistration.register(iceThawer, "iceThawer",7230); - ItemRegistration.register(demonbloodVial, "demonbloodVial",7231); - ItemRegistration.register(mugDemonicHealthPotion, "mugDemonicHealthPotion",7232);*/ - - ItemRegistration.registerItem(frostblade, "frostblade", 4); - ItemRegistration.registerItem(daggervoid, "daggerVoid", 65); - ItemRegistration.registerItem(spearsolidgold, "spearsolidgold", 5); - ItemRegistration.registerItem(spearUnnamed, "spearUnnamed", 66); - ItemRegistration.registerItem(whip, "whip", 6); - ItemRegistration.registerItem(helmetbrokenhalo, "brokenhalo", 67); - ItemRegistration.registerItem(helmetJade, "helmetJade", 90); - ItemRegistration.registerItem(bodyJade, "chestplateJade", 91); - ItemRegistration.registerItem(legsJade, "legsJade", 92); - ItemRegistration.registerItem(bootsJade, "bootsJade", 93); + ItemRegistration.register(frostblade, "frostblade", 6200); + ItemRegistration.register(repairKit,"repairKit",6001); + ItemRegistration.register(whip, "whip", 6110); + ItemRegistration.register(daggervoid, "daggerVoid", 6201); + ItemRegistration.register(spearsolidgold, "spearsolidgold", 6202); + ItemRegistration.register(spearUnnamed, "spearUnnamed", 6203); + ItemRegistration.register(helmetbrokenhalo, "brokenhalo", 6204); + ItemRegistration.register(helmetJade, "helmetJade", 6205); + ItemRegistration.register(bodyJade, "chestplateJade", 6206); + ItemRegistration.register(legsJade, "legsJade", 6207); + ItemRegistration.register(bootsJade, "bootsJade", 6208); linkLOTRWeapon(frostblade, "frostblade"); linkLOTRWeapon(daggervoid, "daggerVoid"); linkLOTRWeapon(spearsolidgold, "spearsolidgold"); @@ -747,11 +637,11 @@ public class CinderLoE { warDart = (new WarDart()).setUnlocalizedName("war_dart").setTextureName("lotr:war_dart"); warDartHeads = (new WarDartHeads()).setUnlocalizedName("war_dart_heads").setTextureName("lotr:war_dart_heads_0"); - ItemRegistration.registerItem(cleaver,"cleaver",96); + ItemRegistration.register(cleaver,"cleaver",6109); linkLOTRWeapon(cleaver, "cleaver"); - ItemRegistration.registerItem(warDart,"warDart",97); - ItemRegistration.registerItem(warDartHeads,"warDartHeads",98); + ItemRegistration.register(warDart,"warDart",6111); + ItemRegistration.register(warDartHeads,"warDartHeads",6500); //ASH @@ -767,15 +657,15 @@ public class CinderLoE { pikeAsh = (new LOTRItemPike(MATERIAL_ASH)).addWeaponDamage(5.0F).setUnlocalizedName("lotr:pikeAsh").setTextureName("lotr:pikeAsh"); spearAsh = (new LOTRItemSpear(MATERIAL_ASH)).addWeaponDamage(5.0F).setUnlocalizedName("lotr:spearAsh").setTextureName("lotr:spearAsh"); - ItemRegistration.registerItem(ingotAsh, "ingotAsh", 47); - ItemRegistration.registerItem(swordAsh, "swordAsh", 48); - ItemRegistration.registerItem(daggerAsh, "daggerAsh", 49); - ItemRegistration.registerItem(hammerAsh, "hammerAsh", 50); - ItemRegistration.registerItem(battleaxeAsh, "battleaxeAsh", 51); - ItemRegistration.registerItem(bowAsh, "bowAsh", 52); - ItemRegistration.registerItem(pikeAsh, "pikeAsh", 53); - ItemRegistration.registerItem(spearAsh, "spearAsh", 54); - ItemRegistration.registerItem(staffAsh, "staffAsh", 64); + ItemRegistration.register(ingotAsh, "ingotAsh", 6100); + ItemRegistration.register(swordAsh, "swordAsh", 6101); + ItemRegistration.register(daggerAsh, "daggerAsh", 6102); + ItemRegistration.register(hammerAsh, "hammerAsh", 6103); + ItemRegistration.register(battleaxeAsh, "battleaxeAsh", 6104); + ItemRegistration.register(bowAsh, "bowAsh", 6105); + ItemRegistration.register(pikeAsh, "pikeAsh", 6106); + ItemRegistration.register(spearAsh, "spearAsh", 6107); + ItemRegistration.register(staffAsh, "staffAsh", 6108); } else { // Log an error or handle the case where the material could not be found System.err.println("Failed to find MATERIAL_ASH material for armor initialization."); @@ -791,7 +681,7 @@ public class CinderLoE { // Red Dwarves redDwarfSteel = new Item().setUnlocalizedName("lotr:redDwarfSteel").setTextureName("lotr:redDwarfSteel").setCreativeTab((CreativeTabs) materials); - ItemRegistration.registerItem(redDwarfSteel, "redDwarfSteel", 7); + ItemRegistration.register(redDwarfSteel, "redDwarfSteel", 6002); MATERIAL_RED_DWARF = getLOTRMaterialByName("RED_DWARF"); if (MATERIAL_RED_DWARF != null) { @@ -809,19 +699,19 @@ public class CinderLoE { crossbowRedDwarf = (new LOTRItemCrossbow(MATERIAL_RED_DWARF)).setUnlocalizedName("lotr:crossbowRedDwarf").setTextureName("lotr:crossbowRedDwarf"); boarArmorRedDwarf = (new LOTRItemMountArmor(MATERIAL_RED_DWARF, LOTRItemMountArmor.Mount.BOAR)).setUnlocalizedName("lotr:boarArmorRedDwarf").setTextureName("lotr:boarArmorRedDwarf"); - ItemRegistration.registerItem(helmetRedDwarf, "helmetRedDwarf", 8); - ItemRegistration.registerItem(bodyRedDwarf, "bodyRedDwarf", 9); - ItemRegistration.registerItem(legsRedDwarf, "legsRedDwarf", 10); - ItemRegistration.registerItem(bootsRedDwarf, "bootsRedDwarf", 11); - ItemRegistration.registerItem(spearRedDwarf, "spearRedDwarf", 12); - ItemRegistration.registerItem(swordRedDwarf, "swordRedDwarf", 13); - ItemRegistration.registerItem(battleaxeRedDwarf, "battleaxeRedDwarf", 14); - ItemRegistration.registerItem(pikeRedDwarf, "pikeRedDwarf", 15); - ItemRegistration.registerItem(hammerRedDwarf, "hammerRedDwarf", 16); - ItemRegistration.registerItem(daggerRedDwarf, "daggerRedDwarf", 17); - ItemRegistration.registerItem(daggerRedDwarfPoisoned, "daggerRedDwarfPoisoned", 18); - ItemRegistration.registerItem(crossbowRedDwarf, "crossbowRedDwarf", 19); - ItemRegistration.registerItem(boarArmorRedDwarf, "boarArmorRedDwarf", 20); + ItemRegistration.register(helmetRedDwarf, "helmetRedDwarf", 6400); + ItemRegistration.register(bodyRedDwarf, "bodyRedDwarf", 6401); + ItemRegistration.register(legsRedDwarf, "legsRedDwarf", 6402); + ItemRegistration.register(bootsRedDwarf, "bootsRedDwarf", 6403); + ItemRegistration.register(spearRedDwarf, "spearRedDwarf", 6404); + ItemRegistration.register(swordRedDwarf, "swordRedDwarf", 6405); + ItemRegistration.register(battleaxeRedDwarf, "battleaxeRedDwarf", 6406); + ItemRegistration.register(pikeRedDwarf, "pikeRedDwarf", 6407); + ItemRegistration.register(hammerRedDwarf, "hammerRedDwarf", 6408); + ItemRegistration.register(daggerRedDwarf, "daggerRedDwarf", 6409); + ItemRegistration.register(daggerRedDwarfPoisoned, "daggerRedDwarfPoisoned", 6410); + ItemRegistration.register(crossbowRedDwarf, "crossbowRedDwarf", 6411); + ItemRegistration.register(boarArmorRedDwarf, "boarArmorRedDwarf", 6412); // System.out.println("Registered red dwarf equipment"); } else { // Log an error or handle the case where the material could not be found @@ -862,23 +752,23 @@ public class CinderLoE { daggerLimwaithPoisoned = (new LOTRItemDagger(MATERIAL_BONEMOLD, LOTRItemDagger.DaggerEffect.POISON)).setUnlocalizedName("lotr:daggerLimwaithPoisoned").setTextureName("lotr:daggerLimwaithPoisoned"); blowgunLimwaith = (new LOTRItemBlowgun(LOTRMaterial.TAUREDAIN)).setUnlocalizedName("lotr:blowgunLimwaith").setTextureName("lotr:blowgunLimwaith"); - ItemRegistration.registerItem(helmetLimwaith, "helmetLimwaith", 21); - ItemRegistration.registerItem(bodyLimwaith, "bodyLimwaith", 22); - ItemRegistration.registerItem(legsLimwaith, "legsLimwaith", 23); - ItemRegistration.registerItem(bootsLimwaith, "bootsLimwaith", 24); - - ItemRegistration.registerItem(helmetboneLimwaith, "helmetboneLimwaith", 43); - ItemRegistration.registerItem(bodyboneLimwaith, "bodyboneLimwaith", 44); - ItemRegistration.registerItem(legsboneLimwaith, "legsboneLimwaith", 45); - ItemRegistration.registerItem(bootsboneLimwaith, "bootsboneLimwaith", 46); - - ItemRegistration.registerItem(spearLimwaith, "spearLimwaith", 25); - ItemRegistration.registerItem(tridentLimwaith, "tridentLimwaith", 26); - ItemRegistration.registerItem(truncheonLimwaith, "truncheonLimwaith", 27); - ItemRegistration.registerItem(battleaxeLimwaith, "battleaxeLimwaith", 28); - ItemRegistration.registerItem(daggerLimwaith, "daggerLimwaith", 29); - ItemRegistration.registerItem(daggerLimwaithPoisoned, "daggerLimwaithPoisoned", 30); - ItemRegistration.registerItem(blowgunLimwaith, "blowgunLimwaith", 31); + ItemRegistration.register(helmetLimwaith, "helmetLimwaith", 6420); + ItemRegistration.register(bodyLimwaith, "bodyLimwaith", 6421); + ItemRegistration.register(legsLimwaith, "legsLimwaith", 6422); + ItemRegistration.register(bootsLimwaith, "bootsLimwaith", 6423); + + ItemRegistration.register(helmetboneLimwaith, "helmetboneLimwaith", 6424); + ItemRegistration.register(bodyboneLimwaith, "bodyboneLimwaith", 6425); + ItemRegistration.register(legsboneLimwaith, "legsboneLimwaith", 6426); + ItemRegistration.register(bootsboneLimwaith, "bootsboneLimwaith", 6427); + + ItemRegistration.register(spearLimwaith, "spearLimwaith", 6428); + ItemRegistration.register(tridentLimwaith, "tridentLimwaith", 6429); + ItemRegistration.register(truncheonLimwaith, "truncheonLimwaith", 6430); + ItemRegistration.register(battleaxeLimwaith, "battleaxeLimwaith", 6431); + ItemRegistration.register(daggerLimwaith, "daggerLimwaith", 6432); + ItemRegistration.register(daggerLimwaithPoisoned, "daggerLimwaithPoisoned", 6433); + ItemRegistration.register(blowgunLimwaith, "blowgunLimwaith", 6434); } else { System.err.println("Failed to find LIMWAITH material for armor initialization."); } @@ -900,12 +790,12 @@ public class CinderLoE { bootsBree = (new LOTRItemArmor(MATERIAL_BREE, 3)).setUnlocalizedName("lotr:bootsBree").setTextureName("lotr:bootsBree"); swordBree = (new LOTRItemSword(MATERIAL_BREE)).setUnlocalizedName("lotr:swordBree").setTextureName("lotr:swordBree"); - ItemRegistration.registerItem(helmetBree, "helmetBree", 32); - ItemRegistration.registerItem(helmetBreeKettle, "breekettle", 57); - ItemRegistration.registerItem(bodyBree, "bodyBree", 33); - ItemRegistration.registerItem(legsBree, "legsBree", 34); - ItemRegistration.registerItem(bootsBree, "bootsBree", 35); - ItemRegistration.registerItem(swordBree, "swordBree", 36); + ItemRegistration.register(helmetBree, "helmetBree", 6440); + ItemRegistration.register(helmetBreeKettle, "breekettle", 6441); + ItemRegistration.register(bodyBree, "bodyBree", 6442); + ItemRegistration.register(legsBree, "legsBree", 6443); + ItemRegistration.register(bootsBree, "bootsBree", 6444); + ItemRegistration.register(swordBree, "swordBree", 6445); } else { System.err.println("Failed to find BREE material for armor initialization."); } @@ -919,10 +809,10 @@ public class CinderLoE { legsserpent = (new LOTRItemArmor(MATERIAL_SERPENT, 2)).setUnlocalizedName("lotr:legsserpent").setTextureName("lotr:legsserpent").setCreativeTab(null); bootsserpent = (new LOTRItemArmor(MATERIAL_SERPENT, 3)).setUnlocalizedName("lotr:bootsserpent").setTextureName("lotr:bootsserpent").setCreativeTab(null); - ItemRegistration.registerItem(helmetserpent, "helmetserpent", 72); - ItemRegistration.registerItem(bodyserpent, "bodyserpent", 73); - ItemRegistration.registerItem(legsserpent, "legsserpent", 74); - ItemRegistration.registerItem(bootsserpent, "bootsserpent", 75); + ItemRegistration.register(helmetserpent, "helmetserpent", 6800); + ItemRegistration.register(bodyserpent, "bodyserpent", 6801); + ItemRegistration.register(legsserpent, "legsserpent", 6802); + ItemRegistration.register(bootsserpent, "bootsserpent", 6803); } else { System.err.println("Failed to find SERPENT material for armor initialization."); } @@ -933,10 +823,10 @@ public class CinderLoE { legsUsurper = (new LOTRItemArmor(MATERIAL_USURPER, 2)).setUnlocalizedName("lotr:legsUsurper").setTextureName("lotr:legsUsurper").setCreativeTab(null); bootsUsurper = (new LOTRItemArmor(MATERIAL_USURPER, 3)).setUnlocalizedName("lotr:bootsUsurper").setTextureName("lotr:bootsUsurper").setCreativeTab(null); - ItemRegistration.registerItem(helmetUsurper, "helmetUsurper", 76); - ItemRegistration.registerItem(bodyUsurper, "bodyUsurper", 77); - ItemRegistration.registerItem(legsUsurper, "legsUsurper", 78); - ItemRegistration.registerItem(bootsUsurper, "bootsUsurper", 79); + ItemRegistration.register(helmetUsurper, "helmetUsurper", 6804); + ItemRegistration.register(bodyUsurper, "bodyUsurper", 6805); + ItemRegistration.register(legsUsurper, "legsUsurper", 6806); + ItemRegistration.register(bootsUsurper, "bootsUsurper", 6807); } else { System.err.println("Failed to find USURPER material for armor initialization."); } @@ -947,26 +837,26 @@ public class CinderLoE { legsWarlord = (new LOTRItemArmor(MATERIAL_WARLORD, 2)).setUnlocalizedName("lotr:legsWarlord").setTextureName("lotr:legsWarlord").setCreativeTab(null); bootsWarlord = (new LOTRItemArmor(MATERIAL_WARLORD, 3)).setUnlocalizedName("lotr:bootsWarlord").setTextureName("lotr:bootsWarlord").setCreativeTab(null); - ItemRegistration.registerItem(helmetWarlord, "helmetWarlord", 80); - ItemRegistration.registerItem(bodyWarlord, "bodyWarlord", 81); - ItemRegistration.registerItem(legsWarlord, "legsWarlord", 82); - ItemRegistration.registerItem(bootsWarlord, "bootsWarlord", 83); + ItemRegistration.register(helmetWarlord, "helmetWarlord", 6808); + ItemRegistration.register(bodyWarlord, "bodyWarlord", 6809); + ItemRegistration.register(legsWarlord, "legsWarlord", 6810); + ItemRegistration.register(bootsWarlord, "bootsWarlord", 6811); } else { System.err.println("Failed to find WARLORD material for armor initialization."); } //Rhudaur - MATERIAL_RHUDUAR = getLOTRMaterialByName("RHUDAUR"); - if (MATERIAL_RHUDUAR != null) { - helmetRhudaur = (new LOTRItemArmor(MATERIAL_RHUDUAR, 0, "helmet")).setUnlocalizedName("lotr:helmetRhudaur").setTextureName("lotr:helmetRhudaur"); - bodyRhudaur = (new LOTRItemArmor(MATERIAL_RHUDUAR, 1)).setUnlocalizedName("lotr:bodyRhudaur").setTextureName("lotr:bodyRhudaur"); - legsRhudaur = (new LOTRItemArmor(MATERIAL_RHUDUAR, 2)).setUnlocalizedName("lotr:legsRhudaur").setTextureName("lotr:legsRhudaur"); - bootsRhudaur = (new LOTRItemArmor(MATERIAL_RHUDUAR, 3)).setUnlocalizedName("lotr:bootsRhudaur").setTextureName("lotr:bootsRhudaur"); - - ItemRegistration.registerItem(helmetRhudaur, "helmetRhudaur",68); - ItemRegistration.registerItem(bodyRhudaur, "bodyRhudaur", 69); - ItemRegistration.registerItem(legsRhudaur, "legsRhudaur", 70); - ItemRegistration.registerItem(bootsRhudaur, "bootsRhudaur", 71); + MATERIAL_RHUDAUR = getLOTRMaterialByName("RHUDAUR"); + if (MATERIAL_RHUDAUR != null) { + helmetRhudaur = (new LOTRItemArmor(MATERIAL_RHUDAUR, 0, "helmet")).setUnlocalizedName("lotr:helmetRhudaur").setTextureName("lotr:helmetRhudaur"); + bodyRhudaur = (new LOTRItemArmor(MATERIAL_RHUDAUR, 1)).setUnlocalizedName("lotr:bodyRhudaur").setTextureName("lotr:bodyRhudaur"); + legsRhudaur = (new LOTRItemArmor(MATERIAL_RHUDAUR, 2)).setUnlocalizedName("lotr:legsRhudaur").setTextureName("lotr:legsRhudaur"); + bootsRhudaur = (new LOTRItemArmor(MATERIAL_RHUDAUR, 3)).setUnlocalizedName("lotr:bootsRhudaur").setTextureName("lotr:bootsRhudaur"); + + ItemRegistration.register(helmetRhudaur, "helmetRhudaur",6450); + ItemRegistration.register(bodyRhudaur, "bodyRhudaur", 6451); + ItemRegistration.register(legsRhudaur, "legsRhudaur", 6452); + ItemRegistration.register(bootsRhudaur, "bootsRhudaur", 6453); } else { System.err.println("Failed to find RHUDAUR material for armor initialization."); } @@ -979,11 +869,11 @@ public class CinderLoE { bootsArnorBanner = (new LOTRItemArmor(MATERIAL_BATTLENUN, 3)).setUnlocalizedName("lotr:bootsArnorBanner").setTextureName("lotr:bootsArnorBanner"); maceArnor = (new LOTRItemHammer(LOTRMaterial.ARNOR)).setUnlocalizedName("lotr:maceArnor").setTextureName("lotr:maceArnor"); - ItemRegistration.registerItem(helmetArnorBanner, "helmetArnorBanner", 37); - ItemRegistration.registerItem(bodyArnorBanner, "bodyArnorBanner", 38); - ItemRegistration.registerItem(legsArnorBanner, "legsArnorBanner", 39); - ItemRegistration.registerItem(bootsArnorBanner, "bootsArnorBanner", 40); - ItemRegistration.registerItem(maceArnor, "maceArnor", 41); + ItemRegistration.register(helmetArnorBanner, "helmetArnorBanner", 6460); + ItemRegistration.register(bodyArnorBanner, "bodyArnorBanner", 6461); + ItemRegistration.register(legsArnorBanner, "legsArnorBanner", 6462); + ItemRegistration.register(bootsArnorBanner, "bootsArnorBanner", 6463); + ItemRegistration.register(maceArnor, "maceArnor", 6464); } else { System.err.println("Failed to find ARNOR material for armor initialization."); } @@ -1014,10 +904,8 @@ public class CinderLoE { public void setup() { // RenderingRegistry.registerEntityRenderingHandler(HaradLevy.class, new LOTRRenderNearHaradrim()); // RenderingRegistry.registerEntityRenderingHandler(DwarfLevy.class, new LOTRRenderDwarf()); -// RenderingRegistry.registerBlockHandler(new RenderIceCage()); RenderingRegistry.registerEntityRenderingHandler(EntityWarDart.class, new RenderWarDart()); - RenderingRegistry.registerEntityRenderingHandler(NimveilLightningBolt.class, new RenderNimveilBolt()); RenderingRegistry.registerEntityRenderingHandler(BladorthinSmith.class, new LOTRRenderDorwinionElfVintner()); RenderingRegistry.registerEntityRenderingHandler(DarkSpider.class, new RenderDarkSpider()); RenderingRegistry.registerEntityRenderingHandler(CorruptDwarf.class, new RenderCorruptDwarf()); @@ -1070,13 +958,6 @@ public class CinderLoE { RenderingRegistry.registerEntityRenderingHandler(LOTREntitySauron.class, new LOTRRenderSauron()); RenderingRegistry.registerEntityRenderingHandler(UtumnoSlaveTrader.class, new RenderUtumnoSlave()); -/* RenderingRegistry.registerEntityRenderingHandler(NexShadow.class, new RenderNexMiniboss()); - RenderingRegistry.registerEntityRenderingHandler(NexIce.class, new RenderNexMiniboss()); - RenderingRegistry.registerEntityRenderingHandler(NexFire.class, new RenderNexMiniboss()); - RenderingRegistry.registerEntityRenderingHandler(NexToxin.class, new RenderNexMiniboss()); - RenderingRegistry.registerEntityRenderingHandler(NexCloud.class, new RenderNexCloud()); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityForgingStation.class, (TileEntitySpecialRenderer)new TileEntityForgingStationRenderer()); - RenderingRegistry.registerEntityRenderingHandler(Nex.class, new RenderNex());*/ ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMistBlock.class, (TileEntitySpecialRenderer)new LOTRRenderUtumnoPortal()); } } @@ -1406,86 +1287,5 @@ public class CinderLoE { (new LOTRUnitTradeEntry(BreeSoldierBannerBearer.class, 250, 400.0F)).setPledgeType(LOTRUnitTradeEntry.PledgeType.FACTION)); } - - public class DevCommand extends CommandBase { -/* - public static float box1 = -7F; - public static float box2 = -6F; - public static float box3 = -7F; - public static int box4 = 14; - public static int box5 = 0; - public static int box6 = 14; -*/ - public static float box1 = -7F; // X position - public static float box2 = -6.5F; // Y position - public static float box3 = -7F; // Z position - public static int box4 = 14; // X Texture map size - public static int box5 = 0; // Y Texture map size - public static int box6 = 14; // Z Texture map size - - @Override - public String getCommandName() { - return "dev"; // Command name - } - - @Override - public String getCommandUsage(ICommandSender sender) { - return "/dev"; // Usage - } - - @Override - public void processCommand(ICommandSender sender, String[] args) { - if (args.length < 1) { - sender.addChatMessage(new ChatComponentText("Usage: /dev ")); - return; - } else if (args.length < 2 && args[0].equals("print")) { - sender.addChatMessage(new ChatComponentText("Variable box1: " + box1)); - sender.addChatMessage(new ChatComponentText("Variable box2: " + box2)); - sender.addChatMessage(new ChatComponentText("Variable box3: " + box3)); - sender.addChatMessage(new ChatComponentText("Variable box4: " + box4)); - sender.addChatMessage(new ChatComponentText("Variable box5: " + box5)); - sender.addChatMessage(new ChatComponentText("Variable box6: " + box6)); - return; - } - - - String variableName = args[0]; - String value = args[1]; - - try { - switch (variableName) { - case "box1": - box1 = Float.parseFloat(value); - break; - case "box2": - box2 = Float.parseFloat(value); - break; - case "box3": - box3 = Float.parseFloat(value); - break; - case "box4": - box4 = Integer.parseInt(value); - break; - case "box5": - box5 = Integer.parseInt(value); - break; - case "box6": - box6 = Integer.parseInt(value); - break; - default: - sender.addChatMessage(new ChatComponentText("Unknown variable.")); - return; - } - sender.addChatMessage(new ChatComponentText(variableName + " set to " + value)); - } catch (NumberFormatException e) { - sender.addChatMessage(new ChatComponentText("Invalid value format for " + variableName)); - } - } - - @Override - public boolean canCommandSenderUseCommand(ICommandSender sender) { - return true; // Here you can add permission checks if necessary - } - } public int getRustedSwordID() {return 0;} } diff --git a/src/main/java/com/zivilon/cinder_loe/Materials.java b/src/main/java/com/zivilon/cinder_loe/Materials.java index 8cc5e7a..1c6d44f 100644 --- a/src/main/java/com/zivilon/cinder_loe/Materials.java +++ b/src/main/java/com/zivilon/cinder_loe/Materials.java @@ -25,12 +25,6 @@ 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("NEX_ICE",1500, 0.0F, 0.8F, 0, 9.0F, 10, Item.getItemFromBlock(CinderLoE.enchantedIce)); - modifyMaterial("NEX_FIRE",1500, 0.0F, 0.8F, 0, 9.0F, 10, Item.getItemFromBlock(CinderLoE.enchantedIce)); - modifyMaterial("NEX_TOXIN",1500, 0.0F, 0.8F, 0, 9.0F, 10, Item.getItemFromBlock(CinderLoE.enchantedIce)); - modifyMaterial("NEX_SHADOW",1500, 0.0F, 0.8F, 0, 9.0F, 10, Item.getItemFromBlock(CinderLoE.enchantedIce)); - modifyMaterial("NIMVEIL",300, 6.0F, 0.0F, 0, 0.0F, 10, Item.getItemFromBlock(CinderLoE.enchantedIce)); - modifyMaterial("FROZEN",1000, 5.0F, 0.0F, 0, 0.0F, 10, Item.getItemFromBlock(CinderLoE.enchantedIce)); } 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/blocks/EnchantedIce.java b/src/main/java/com/zivilon/cinder_loe/blocks/EnchantedIce.java deleted file mode 100644 index 4ee562f..0000000 --- a/src/main/java/com/zivilon/cinder_loe/blocks/EnchantedIce.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.zivilon.cinder_loe.blocks; - -import com.zivilon.cinder_loe.LoECreativeTabs; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockIce; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -import java.lang.reflect.Field; -import java.util.Random; - -public class EnchantedIce extends BlockIce { - public IIcon baseIcon; - - public EnchantedIce() { - super(); - this.setTickRandomly(false); - this.setCreativeTab(LoECreativeTabs.tabBlockLoE); - setBlockTextureName("minecraft:ice"); - setBlockName("lotr:enchantedIce"); - setLightLevel(0.25F); - } - - @Override - public void registerBlockIcons(IIconRegister iconRegister) { - this.baseIcon = iconRegister.registerIcon(this.getTextureName()); - } - - @Override - public IIcon getIcon(int side, int meta) { - return this.baseIcon; - } - - public IIcon getBaseIcon() { - return this.baseIcon; - } - - @Override - public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) {} -} diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/ForgingStation.java b/src/main/java/com/zivilon/cinder_loe/blocks/ForgingStation.java deleted file mode 100644 index 4fc74d6..0000000 --- a/src/main/java/com/zivilon/cinder_loe/blocks/ForgingStation.java +++ /dev/null @@ -1,279 +0,0 @@ -package com.zivilon.cinder_loe.blocks; - -import com.zivilon.cinder_loe.CinderLoE; -import com.zivilon.cinder_loe.LoECreativeTabs; -import com.zivilon.cinder_loe.items.NimveilPart; -import com.zivilon.cinder_loe.items.Nimveil; -import com.zivilon.cinder_loe.recipe.ForgingRecipe; -import com.zivilon.cinder_loe.recipe.ForgingRecipes; -import com.zivilon.cinder_loe.tileentity.TileEntityForgingStation; - -import lotr.common.item.LOTRItemHammer; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; - -public class ForgingStation extends BlockContainer { - - public ForgingStation() { - super(Material.anvil); - setHardness(10.0F); - setResistance(10.0F); - setBlockName("forging_station"); - setCreativeTab(LoECreativeTabs.tabDecoLoE); - setBlockBounds(0, 0, 0, 1, 1, 1); // Set the block bounds to cover 1x1x1 for each individual part - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public int getRenderType() { - return -1; // Use custom renderer - } - - @Override - public TileEntity createNewTileEntity(World world, int meta) { - return new TileEntityForgingStation(); - } - - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase placer, ItemStack itemStack) { - int direction = MathHelper.floor_double((double)(placer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; - - // Middle part (placed block) - world.setBlockMetadataWithNotify(x, y, z, (direction << 2) | 1, 2); - - // Right and right parts based on orientation - if (direction == 0) { // South - world.setBlock(x - 1, y, z, this, (direction << 2) | 0, 2); // Right part - world.setBlock(x + 1, y, z, this, (direction << 2) | 2, 2); // Left part - } else if (direction == 1) { // West - world.setBlock(x, y, z - 1, this, (direction << 2) | 0, 2); // Right part - world.setBlock(x, y, z + 1, this, (direction << 2) | 2, 2); // Left part - } else if (direction == 2) { // North - world.setBlock(x + 1, y, z, this, (direction << 2) | 0, 2); // Right part - world.setBlock(x - 1, y, z, this, (direction << 2) | 2, 2); // Left part - } else if (direction == 3) { // East - world.setBlock(x, y, z + 1, this, (direction << 2) | 0, 2); // Right part - world.setBlock(x, y, z - 1, this, (direction << 2) | 2, 2); // Left part - } - } - - @Override - public void breakBlock(World world, int x, int y, int z, Block block, int meta) { - int direction = meta >> 2; - int part = meta & 3; - - if (direction == 0) { // South - if (part == 1) { // Middle - world.setBlockToAir(x - 1, y, z); // Right part - world.setBlockToAir(x + 1, y, z); // Left part - } else if (part == 0) { // Right - world.setBlockToAir(x + 1, y, z); // Middle part - world.setBlockToAir(x + 2, y, z); // Left part - } else if (part == 2) { // Left - world.setBlockToAir(x - 1, y, z); // Middle part - world.setBlockToAir(x - 2, y, z); // Right part - } - } else if (direction == 1) { // West - if (part == 1) { // Middle - world.setBlockToAir(x, y, z - 1); // Right part - world.setBlockToAir(x, y, z + 1); // Left part - } else if (part == 0) { // Right - world.setBlockToAir(x, y, z + 1); // Middle part - world.setBlockToAir(x, y, z + 2); // Left part - } else if (part == 2) { // Left - world.setBlockToAir(x, y, z - 1); // Middle part - world.setBlockToAir(x, y, z - 2); // Right part - } - } else if (direction == 2) { // North - if (part == 1) { // Middle - world.setBlockToAir(x + 1, y, z); // Right part - world.setBlockToAir(x - 1, y, z); // Left part - } else if (part == 0) { // Right - world.setBlockToAir(x - 1, y, z); // Middle part - world.setBlockToAir(x - 2, y, z); // Left part - } else if (part == 2) { // Left - world.setBlockToAir(x + 1, y, z); // Middle part - world.setBlockToAir(x + 2, y, z); // Right part - } - } else if (direction == 3) { // East - if (part == 1) { // Middle - world.setBlockToAir(x, y, z + 1); // Right part - world.setBlockToAir(x, y, z - 1); // Left part - } else if (part == 0) { // Right - world.setBlockToAir(x, y, z - 1); // Middle part - world.setBlockToAir(x, y, z - 2); // Left part - } else if (part == 2) { // Left - world.setBlockToAir(x, y, z + 1); // Middle part - world.setBlockToAir(x, y, z + 2); // Right part - } - } - - super.breakBlock(world, x, y, z, block, meta); - } - - public TileEntityForgingStation getCentralTileEntity(World world, int x, int y, int z) { - int meta = world.getBlockMetadata(x, y, z); - int direction = meta >> 2; // Extract the direction - int part = meta & 3; // Extract the part (0, 1, 2) - - int centralX = x, centralZ = z; - - switch (direction) { - case 0: // South - if (part == 0) { - centralX = x + 1; // Right part, middle is to the left - } else if (part == 2) { - centralX = x - 1; // Left part, middle is to the right - } - break; - case 1: // West - if (part == 0) { - centralZ = z + 1; // Right part, middle is to the front - } else if (part == 2) { - centralZ = z - 1; // Left part, middle is to the back - } - break; - case 2: // North - if (part == 0) { - centralX = x - 1; // Right part, middle is to the right - } else if (part == 2) { - centralX = x + 1; // Left part, middle is to the left - } - break; - case 3: // East - if (part == 0) { - centralZ = z - 1; // Right part, middle is to the back - } else if (part == 2) { - centralZ = z + 1; // Left part, middle is to the front - } - break; - } - - TileEntity tileEntity = world.getTileEntity(centralX, y, centralZ); - return (tileEntity instanceof TileEntityForgingStation) ? (TileEntityForgingStation) tileEntity : null; - } - - @Override - public void onBlockClicked(World world, int x, int y, int z, EntityPlayer player) { - ItemStack heldStack = player.getHeldItem(); - if (heldStack == null) return; - - boolean isBlessedHammer = heldStack.getItem() == CinderLoE.blessedHammer; - boolean isRegularHammer = heldStack.getItem() instanceof LOTRItemHammer; - - if (!isBlessedHammer && !isRegularHammer) return; - - TileEntityForgingStation tileentity = getCentralTileEntity(world, x, y, z); - if (tileentity == null) return; - - ItemStack left = tileentity.getLeftItem(); - ItemStack middle = tileentity.getMiddleItem(); - ItemStack right = tileentity.getRightItem(); - - // Iterate through available recipes and find a match - for (ForgingRecipe recipe : ForgingRecipes.getAllRecipes()) { - - if (recipe.matches(left, middle, right, isBlessedHammer)) { - // Clear the inputs if the recipe matches - tileentity.setLeftItem(null); - tileentity.setRightItem(null); - tileentity.setMiddleItem(recipe.getOutput()); - - // Damage the hammer by 1 - if (heldStack.attemptDamageItem(1, player.getRNG())) { - player.inventory.setInventorySlotContents(player.inventory.currentItem, null); - } else { - player.inventory.markDirty(); - } - return; - } - } - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if (!world.isRemote) { - TileEntityForgingStation tileentity = getCentralTileEntity(world, x, y, z); - if (tileentity == null) return true; - - int meta = world.getBlockMetadata(x, y, z); - int part = meta & 3; - - ItemStack stack = null; - if (part == 0) stack = tileentity.getRightItem(); - else if (part == 1) stack = tileentity.getMiddleItem(); - else if (part == 2) stack = tileentity.getLeftItem(); - - if (stack != null) { - // Try to pick up the item - boolean hasSpace = player.inventory.addItemStackToInventory(stack); - if (hasSpace) { - if (part == 0) tileentity.setRightItem(null); - else if (part == 1) tileentity.setMiddleItem(null); - else if (part == 2) tileentity.setLeftItem(null); - - if (player instanceof EntityPlayerMP) { - ((EntityPlayerMP) player).sendContainerToPlayer(player.inventoryContainer); - } - } else { - player.addChatMessage(new ChatComponentText("You need more inventory space")); - } - } else { - // Try to place an item - ItemStack heldStack = player.getHeldItem(); - if (heldStack == null) return true; - - boolean itemPlaced = false; - - // Check all recipes to see if the held item matches any input slot - for (ForgingRecipe recipe : ForgingRecipes.getAllRecipes()) { - if (part == 0 && recipe.matchesItem(recipe.rightInput, heldStack)) { - tileentity.setRightItem(heldStack.splitStack(1)); - itemPlaced = true; - } else if (part == 1 && recipe.matchesItem(recipe.middleInput, heldStack)) { - tileentity.setMiddleItem(heldStack.splitStack(1)); - itemPlaced = true; - } else if (part == 2 && recipe.matchesItem(recipe.leftInput, heldStack)) { - tileentity.setLeftItem(heldStack.splitStack(1)); - itemPlaced = true; - } - - if (itemPlaced) { - tileentity.markDirty(); - if (heldStack.stackSize <= 0) { - player.inventory.setInventorySlotContents(player.inventory.currentItem, null); - } - player.inventory.markDirty(); - break; - } - } - - if (!itemPlaced) { - player.addChatMessage(new ChatComponentText("This item does not fit here.")); - } - } - } - return true; - } - -} diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/IceCage.java b/src/main/java/com/zivilon/cinder_loe/blocks/IceCage.java deleted file mode 100644 index 75a2bf5..0000000 --- a/src/main/java/com/zivilon/cinder_loe/blocks/IceCage.java +++ /dev/null @@ -1,221 +0,0 @@ -package com.zivilon.cinder_loe.blocks; - -import com.zivilon.cinder_loe.CinderLoE; -import com.zivilon.cinder_loe.LoECreativeTabs; -import com.zivilon.cinder_loe.util.Utilities; -import com.zivilon.cinder_loe.client.render.block.RenderIceCage; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; - -import java.util.List; -import java.util.Random; - -public class IceCage extends Block { - @SideOnly(Side.CLIENT) - private IIcon blockIcon; - @SideOnly(Side.CLIENT) - private IIcon emptyIcon; - - public IceCage() { - super(Material.ice); - setHardness(2.0F); - setResistance(1.0F); - setStepSound(soundTypeGlass); - setBlockTextureName(Utilities.toSnakeCase("lotr:iceCage")); - setBlockName(Utilities.toSnakeCase("lotr:iceCage")); - setLightOpacity(5); // Semi-transparent - setCreativeTab(CreativeTabs.tabBlock); - setCreativeTab(LoECreativeTabs.tabDecoLoE); - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public int getRenderType() { - return RenderIceCage.RENDER_ID; // Use the custom render type - } - - @Override - @SideOnly(Side.CLIENT) - public int getRenderBlockPass() { - return 1; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister iconRegister) { - this.blockIcon = iconRegister.registerIcon("lotr:ice_cage"); - this.emptyIcon = iconRegister.registerIcon("lotr:invisible"); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int side, int meta) { -/* if ((meta == 0 && side == 1) || (meta == 1 && side == 0)) { - return this.blockIcon; - }*/ - return this.blockIcon; - } - - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { - return AxisAlignedBB.getBoundingBox(x, y, z, x + 1.0F, y + 1.0F, z + 1.0F); - } - - @Override - public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB aabb, List list, Entity entity) { - int meta = world.getBlockMetadata(x, y, z); - if (meta == 0) { // Lower part - float thickness = 0.0625F; // 1/16th of a block thickness - - AxisAlignedBB[] boundingBoxes = new AxisAlignedBB[]{ - AxisAlignedBB.getBoundingBox(x, y, z, x + thickness, y + 1.0F, z + 1.0F), // Left wall - AxisAlignedBB.getBoundingBox(x + 1.0F - thickness, y, z, x + 1.0F, y + 1.0F, z + 1.0F), // Right wall - AxisAlignedBB.getBoundingBox(x, y, z, x + 1.0F, y + 1.0F, z + thickness), // Front wall - AxisAlignedBB.getBoundingBox(x, y, z + 1.0F - thickness, x + 1.0F, y + 1.0F, z + 1.0F) // Back wall - }; - - for (AxisAlignedBB boundingBox : boundingBoxes) { - if (boundingBox != null && aabb.intersectsWith(boundingBox)) { - list.add(boundingBox); - } - } - } else if (meta == 1) { // Upper partplayer.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 20, 2, true)); // Mining Fatigue III - float thickness = 0.0625F; // 1/16th of a block thickness - - AxisAlignedBB[] boundingBoxes = new AxisAlignedBB[]{ - AxisAlignedBB.getBoundingBox(x, y, z, x + thickness, y + 1.0F, z + 1.0F), // Left wall - AxisAlignedBB.getBoundingBox(x + 1.0F - thickness, y, z, x + 1.0F, y + 1.0F, z + 1.0F), // Right wall - AxisAlignedBB.getBoundingBox(x, y, z, x + 1.0F, y + 1.0F, z + thickness), // Front wall - AxisAlignedBB.getBoundingBox(x, y, z + 1.0F - thickness, x + 1.0F, y + 1.0F, z + 1.0F), // Back wall - AxisAlignedBB.getBoundingBox(x, y + 1.0F - thickness, z, x + 1.0F, y + 1.0F, z + 1.0F) // Ceiling - }; - - for (AxisAlignedBB boundingBox : boundingBoxes) { - if (boundingBox != null && aabb.intersectsWith(boundingBox)) { - list.add(boundingBox); - } - } - } - } - - @Override - public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) { - if (entity instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer) entity; - AxisAlignedBB blockBounds = AxisAlignedBB.getBoundingBox(x, y, z, x + 1.0F, y + 1.0F, z + 1.0F); - if (blockBounds != null && blockBounds.intersectsWith(player.boundingBox)) { - player.motionX = 0; - player.motionY = 0; - player.motionZ = 0; - player.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 20, 2, true)); // Mining Fatigue III - } - } - } - - @Override - public void updateTick(World world, int x, int y, int z, Random random) { - int meta = world.getBlockMetadata(x, y, z); - if (meta == 0) { // Lower part - List players = world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1.0F, y + 2.0F, z + 1.0F)); - for (EntityPlayer player : players) { - player.motionX = 0; - player.motionY = 0; - player.motionZ = 0; - player.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 20, 2, true)); // Mining Fatigue III - } - } - world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world)); - } - - @Override - public int tickRate(World world) { - return 1; // Adjust the tick rate as needed - } - - @Override - @SideOnly(Side.CLIENT) - public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) { - return true; - } - - @Override - public boolean canPlaceBlockAt(World world, int x, int y, int z) { - return world.isAirBlock(x, y, z) && world.isAirBlock(x, y + 1, z); - } - - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase placer, ItemStack itemStack) { - world.setBlockMetadataWithNotify(x, y, z, 0, 2); // Lower part - world.setBlock(x, y + 1, z, this, 1, 2); // Upper part - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { - if (player.getHeldItem() != null && player.getHeldItem().getItem() == CinderLoE.iceThawer) { - if (!player.capabilities.isCreativeMode) { - player.getHeldItem().stackSize--; - if (player.getHeldItem().stackSize <= 0) { - player.inventory.setInventorySlotContents(player.inventory.currentItem, null); - } - } - - world.func_147480_a(x, y, z, false); - - return true; - } - return false; - } - - - @Override - public void onNeighborBlockChange(World world, int x, int y, int z, Block neighbor) { - int meta = world.getBlockMetadata(x, y, z); - if (meta == 0) { // Lower part - if (world.getBlock(x, y + 1, z) != this) { - world.setBlockToAir(x, y, z); - } - } else if (meta == 1) { // Upper part - if (world.getBlock(x, y - 1, z) != this) { - world.setBlockToAir(x, y, z); - } - } - } - - @Override - public void breakBlock(World world, int x, int y, int z, Block block, int meta) { - if (meta == 0) { // Lower part - if (world.getBlock(x, y + 1, z) == this) { - world.setBlockToAir(x, y + 1, z); - } - } else if (meta == 1) { // Upper part - if (world.getBlock(x, y - 1, z) == this) { - world.setBlockToAir(x, y - 1, z); - } - } - super.breakBlock(world, x, y, z, block, meta); - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/ShadowTile.java b/src/main/java/com/zivilon/cinder_loe/blocks/ShadowTile.java deleted file mode 100644 index 9ada9e9..0000000 --- a/src/main/java/com/zivilon/cinder_loe/blocks/ShadowTile.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.zivilon.cinder_loe.blocks; - -import lotr.common.LOTRCreativeTabs; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.world.World; -import net.minecraft.block.BlockPressurePlate; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.DamageSource; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import com.zivilon.cinder_loe.LoECreativeTabs; -import com.zivilon.cinder_loe.LoEDamage; -import com.zivilon.cinder_loe.tileentity.TileEntityShadowTile; - -import java.lang.reflect.Field; -import java.util.Random; - -public class ShadowTile extends BlockPressurePlate { - public int ticksLived = 0; - - public ShadowTile() { - super("lotr:shadow_tile", Material.rock, BlockPressurePlate.Sensitivity.players); - this.setCreativeTab(LoECreativeTabs.tabMiscLoE); - setBlockTextureName("lotr:shadow_tile"); - setBlockName("lotr:shadowTile"); - this.isBlockContainer = true; - } - - @Override - public boolean hasTileEntity(int metadata) { - return true; - } - - @Override - public TileEntity createTileEntity(World world, int metadata) { - return new TileEntityShadowTile(); - } - - @Override - public void onBlockAdded(World world, int x, int y, int z) { - super.onBlockAdded(world, x, y, z); - - // Manually create and initialize the tile entity - if (!world.isRemote) { - world.setTileEntity(x, y, z, createTileEntity(world, world.getBlockMetadata(x, y, z))); - } - } - - @Override - public void breakBlock(World world, int x, int y, int z, Block block, int meta) { - super.breakBlock(world, x, y, z, block, meta); - world.removeTileEntity(x, y, z); // Clean up the tile entity - } - - @Override - public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) { - if (entity instanceof EntityPlayer && !world.isRemote) { - EntityPlayer player = (EntityPlayer)entity; - player.attackEntityFrom(LoEDamage.shadow, 10.0F); - player.addPotionEffect(new PotionEffect(15, 6*20, 0, false)); - world.setBlockToAir(x, y, z); - } - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/client/model/ModelNex.java b/src/main/java/com/zivilon/cinder_loe/client/model/ModelNex.java deleted file mode 100644 index 2c5d794..0000000 --- a/src/main/java/com/zivilon/cinder_loe/client/model/ModelNex.java +++ /dev/null @@ -1,200 +0,0 @@ -package com.zivilon.cinder_loe.client.model; - -import lotr.common.LOTRConfig; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.util.MathHelper; - -public class ModelNex extends ModelBase { - public ModelRenderer body; - - public ModelRenderer neck; - - public ModelRenderer head; - - public ModelRenderer rightArm; - - public ModelRenderer leftArm; - - public ModelRenderer rightLeg; - - public ModelRenderer leftLeg; - - public ModelRenderer tail; - - public ModelRenderer rightWing; - - public ModelRenderer leftWing; - - private boolean isFireModel; - - public int heldItemRight; - - public ModelNex() { - this(0.0F); - } - - public ModelNex(float f) { - this.textureWidth = 128; - this.textureHeight = 256; - this.body = new ModelRenderer(this, 0, 38); - this.body.setRotationPoint(0.0F, 7.0F, 3.0F); - this.body.addBox(-8.0F, -15.0F, -6.0F, 16, 18, 12, f); - this.body.setTextureOffset(0, 207); - this.body.addBox(-9.0F, -6.5F, -7.0F, 7, 1, 14, f); - this.body.addBox(-9.0F, -9.5F, -7.0F, 7, 1, 14, f); - this.body.addBox(-9.0F, -12.5F, -7.0F, 7, 1, 14, f); - this.body.mirror = true; - this.body.addBox(2.0F, -6.5F, -7.0F, 7, 1, 14, f); - this.body.addBox(2.0F, -9.5F, -7.0F, 7, 1, 14, f); - this.body.addBox(2.0F, -12.5F, -7.0F, 7, 1, 14, f); - this.body.mirror = false; - this.body.setTextureOffset(0, 0).addBox(-9.0F, -29.0F, -7.0F, 18, 14, 15, f); - this.body.setTextureOffset(81, 163).addBox(-2.0F, -21.0F, 5.5F, 4, 25, 2, f); - this.neck = new ModelRenderer(this, 76, 0); - this.neck.setRotationPoint(0.0F, -25.0F, -3.0F); - this.neck.addBox(-6.0F, -5.0F, -10.0F, 12, 12, 14, f); - this.body.addChild(this.neck); - this.head = new ModelRenderer(this, 92, 48); - this.head.setRotationPoint(0.0F, 0.0F, -10.0F); - this.head.addBox(-4.0F, -6.0F, -6.0F, 8, 10, 7, f); - this.head.setTextureOffset(57, 58).addBox(-6.0F, -7.0F, -4.0F, 12, 4, 4, f); - this.head.rotateAngleX = (float)Math.toRadians(10.0D); - this.neck.addChild(this.head); - ModelRenderer rightHorn1 = new ModelRenderer(this, 57, 47); - rightHorn1.setRotationPoint(-6.0F, -5.0F, -2.0F); - rightHorn1.addBox(-7.0F, -1.5F, -1.5F, 8, 3, 3, f); - rightHorn1.rotateAngleY = (float)Math.toRadians(-35.0D); - this.head.addChild(rightHorn1); - ModelRenderer rightHorn2 = new ModelRenderer(this, 57, 35); - rightHorn2.setRotationPoint(-7.0F, 0.0F, 0.0F); - rightHorn2.addBox(-1.0F, -1.0F, -6.0F, 2, 2, 6, f); - rightHorn2.rotateAngleY = (float)Math.toRadians(45.0D); - rightHorn1.addChild(rightHorn2); - ModelRenderer leftHorn1 = new ModelRenderer(this, 57, 47); - leftHorn1.setRotationPoint(6.0F, -5.0F, -2.0F); - leftHorn1.mirror = true; - leftHorn1.addBox(-1.0F, -1.5F, -1.5F, 8, 3, 3, f); - leftHorn1.rotateAngleY = (float)Math.toRadians(35.0D); - this.head.addChild(leftHorn1); - ModelRenderer leftHorn2 = new ModelRenderer(this, 57, 35); - leftHorn2.setRotationPoint(7.0F, 0.0F, 0.0F); - leftHorn2.mirror = true; - leftHorn2.addBox(-1.0F, -1.0F, -6.0F, 2, 2, 6, f); - leftHorn2.rotateAngleY = (float)Math.toRadians(-45.0D); - leftHorn1.addChild(leftHorn2); - this.rightArm = new ModelRenderer(this, 59, 136); - this.rightArm.setRotationPoint(-9.0F, -25.0F, 0.0F); - this.rightArm.addBox(-7.0F, -2.0F, -4.0F, 7, 10, 8, f); - this.rightArm.setTextureOffset(93, 136).addBox(-6.5F, 8.0F, -3.0F, 6, 16, 6, f); - this.body.addChild(this.rightArm); - this.leftArm = new ModelRenderer(this, 59, 136); - this.leftArm.setRotationPoint(9.0F, -25.0F, 0.0F); - this.leftArm.mirror = true; - this.leftArm.addBox(0.0F, -2.0F, -4.0F, 7, 10, 8, f); - this.leftArm.setTextureOffset(93, 136).addBox(0.5F, 8.0F, -3.0F, 6, 16, 6, f); - this.body.addChild(this.leftArm); - this.rightLeg = new ModelRenderer(this, 46, 230); - this.rightLeg.setRotationPoint(-6.0F, 6.0F, 3.0F); - this.rightLeg.addBox(-7.0F, -2.0F, -4.0F, 7, 9, 8, f); - this.rightLeg.setTextureOffset(46, 208).addBox(-6.5F, 2.0F, 4.0F, 6, 13, 5, f); - ModelRenderer rightFoot = new ModelRenderer(this, 0, 243); - rightFoot.setRotationPoint(0.0F, 0.0F, 0.0F); - rightFoot.addBox(-7.0F, 15.0F, -6.0F, 7, 3, 9, f); - rightFoot.rotateAngleX = (float)Math.toRadians(25.0D); - this.rightLeg.addChild(rightFoot); - this.leftLeg = new ModelRenderer(this, 46, 230); - this.leftLeg.setRotationPoint(6.0F, 6.0F, 3.0F); - this.leftLeg.mirror = true; - this.leftLeg.addBox(0.0F, -2.0F, -4.0F, 7, 9, 8, f); - this.leftLeg.setTextureOffset(46, 208).addBox(0.5F, 2.0F, 4.0F, 6, 13, 5, f); - ModelRenderer leftFoot = new ModelRenderer(this, 0, 243); - leftFoot.setRotationPoint(0.0F, 0.0F, 0.0F); - leftFoot.mirror = true; - leftFoot.addBox(0.0F, 15.0F, -6.0F, 7, 3, 9, f); - leftFoot.rotateAngleX = (float)Math.toRadians(25.0D); - this.leftLeg.addChild(leftFoot); - this.tail = new ModelRenderer(this, 79, 200); - this.tail.setRotationPoint(0.0F, -3.0F, 3.0F); - this.tail.addBox(-3.5F, -3.0F, 2.0F, 7, 7, 10, f); - this.tail.setTextureOffset(80, 225).addBox(-2.5F, -2.5F, 11.0F, 5, 5, 14, f); - this.tail.setTextureOffset(96, 175).addBox(-1.5F, -2.0F, 24.0F, 3, 3, 12, f); - this.body.addChild(this.tail); - this.rightWing = new ModelRenderer(this, 0, 137); - this.rightWing.setRotationPoint(-6.0F, -27.0F, 4.0F); - this.rightWing.addBox(-1.5F, -1.5F, 0.0F, 3, 3, 25, f); - this.rightWing.setTextureOffset(0, 167).addBox(-1.0F, -2.0F, 25.0F, 2, 24, 2, f); - this.rightWing.setTextureOffset(0, 30).addBox(-0.5F, -7.0F, 25.5F, 1, 5, 1, f); - this.rightWing.setTextureOffset(0, 69).addBox(0.0F, 0.0F, 0.0F, 0, 35, 25, f); - this.body.addChild(this.rightWing); - this.leftWing = new ModelRenderer(this, 0, 137); - this.leftWing.setRotationPoint(6.0F, -27.0F, 4.0F); - this.leftWing.mirror = true; - this.leftWing.addBox(-1.5F, -1.5F, 0.0F, 3, 3, 25, f); - this.leftWing.setTextureOffset(0, 167).addBox(-1.0F, -2.0F, 25.0F, 2, 24, 2, f); - this.leftWing.setTextureOffset(0, 30).addBox(-0.5F, -7.0F, 25.5F, 1, 5, 1, f); - this.leftWing.setTextureOffset(0, 69).addBox(0.0F, 0.0F, 0.0F, 0, 35, 25, f); - this.body.addChild(this.leftWing); - } - - public void setFireModel() { - this.isFireModel = true; - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - this.rightWing.showModel = true; - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - this.body.render(f5); - this.rightLeg.render(f5); - this.leftLeg.render(f5); - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { - this.neck.rotateAngleX = (float)Math.toRadians(-10.0D); - this.neck.rotateAngleY = 0.0F; - this.neck.rotateAngleX += f4 / (float)Math.toDegrees(1.0D); - this.neck.rotateAngleY += f3 / (float)Math.toDegrees(1.0D); - this.body.rotateAngleX = (float)Math.toRadians(10.0D); - this.body.rotateAngleX += MathHelper.cos(f2 * 0.03F) * 0.15F; - this.rightArm.rotateAngleX = 0.0F; - this.leftArm.rotateAngleX = 0.0F; - this.rightArm.rotateAngleZ = 0.0F; - this.leftArm.rotateAngleZ = 0.0F; - this.rightArm.rotateAngleX += MathHelper.cos(f * 0.4F + 3.1415927F) * 0.8F * f1; - this.leftArm.rotateAngleX += MathHelper.cos(f * 0.4F) * 0.8F * f1; - this.rightArm.rotateAngleZ += MathHelper.cos(f2 * 0.09F) * 0.05F + 0.05F; - this.leftArm.rotateAngleZ -= MathHelper.cos(f2 * 0.09F) * 0.05F + 0.05F; - if (this.onGround > -9990.0F) { - float f6 = this.onGround; - this.rightArm.rotateAngleY += this.body.rotateAngleY; - this.leftArm.rotateAngleY += this.body.rotateAngleY; - this.leftArm.rotateAngleX += this.body.rotateAngleY; - f6 = 1.0F - this.onGround; - f6 *= f6; - f6 *= f6; - f6 = 1.0F - f6; - float f7 = MathHelper.sin(f6 * 3.1415927F); - float f8 = MathHelper.sin(this.onGround * 3.1415927F) * -(this.head.rotateAngleX - 0.7F) * 0.75F; - this.rightArm.rotateAngleX = (float)(this.rightArm.rotateAngleX - f7 * 1.2D + f8); - this.rightArm.rotateAngleY += this.body.rotateAngleY * 2.0F; - this.rightArm.rotateAngleZ = MathHelper.sin(this.onGround * 3.1415927F) * -0.4F; - } - if (this.heldItemRight != 0) - this.rightArm.rotateAngleX = this.rightArm.rotateAngleX * 0.5F - 0.31415927F * this.heldItemRight; - this.rightLeg.rotateAngleX = (float)Math.toRadians(-25.0D); - this.leftLeg.rotateAngleX = (float)Math.toRadians(-25.0D); - this.rightLeg.rotateAngleX += MathHelper.sin(f * 0.4F) * 1.2F * f1; - this.leftLeg.rotateAngleX += MathHelper.sin(f * 0.4F + 3.1415927F) * 1.2F * f1; - this.rightWing.rotateAngleX = (float)Math.toRadians(40.0D); - this.leftWing.rotateAngleX = (float)Math.toRadians(40.0D); - this.rightWing.rotateAngleY = (float)Math.toRadians(-40.0D); - this.leftWing.rotateAngleY = (float)Math.toRadians(40.0D); - this.rightWing.rotateAngleY += MathHelper.cos(f2 * 0.04F) * 0.5F; - this.leftWing.rotateAngleY -= MathHelper.cos(f2 * 0.04F) * 0.5F; - this.tail.rotateAngleX = (float)Math.toRadians(-40.0D); - this.tail.rotateAngleY = 0.0F; - this.tail.rotateAngleY += MathHelper.cos(f2 * 0.05F) * 0.15F; - this.tail.rotateAngleY += MathHelper.sin(f * 0.1F) * 0.6F * f1; - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/client/model/ModelNexIceCrystal.java b/src/main/java/com/zivilon/cinder_loe/client/model/ModelNexIceCrystal.java deleted file mode 100644 index 87a2445..0000000 --- a/src/main/java/com/zivilon/cinder_loe/client/model/ModelNexIceCrystal.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.zivilon.cinder_loe.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -/** - * IceCrystal - cleric_red - * Created using Tabula 4.1.1 - */ -public class ModelNexIceCrystal extends ModelBase { - public ModelRenderer shape16; - public ModelRenderer back; - public ModelRenderer front; - public ModelRenderer left; - public ModelRenderer right; - public ModelRenderer bottomfront; - public ModelRenderer bottomback; - - public ModelNexIceCrystal() { - this.textureWidth = 64; - this.textureHeight = 32; - this.right = new ModelRenderer(this, 0, 2); - this.right.setRotationPoint(2.9F, 12.6F, 3.2F); - this.right.addBox(0.0F, 0.0F, 0.0F, 0, 9, 5, 0.0F); - this.setRotateAngle(right, 0.0F, 3.141592653589793F, 0.0F); - this.bottomfront = new ModelRenderer(this, 14, 0); - this.bottomfront.setRotationPoint(-3.0F, 17.3F, -2.66F); - this.bottomfront.addBox(0.0F, 0.0F, 0.0F, 6, 6, 1, 0.0F); - this.setRotateAngle(bottomfront, 0.5009094953223726F, 0.0F, 0.0F); - this.bottomback = new ModelRenderer(this, 14, 0); - this.bottomback.setRotationPoint(-3.0F, 16.3F, 3.1F); - this.bottomback.addBox(0.0F, 0.0F, 0.0F, 6, 6, 1, 0.0F); - this.setRotateAngle(bottomback, -0.5009094953223726F, 0.0F, 0.0F); - this.back = new ModelRenderer(this, 0, 0); - this.back.setRotationPoint(-3.0F, 12.0F, 0.2F); - this.back.addBox(0.0F, 0.0F, 0.0F, 6, 6, 1, 0.0F); - this.setRotateAngle(back, 0.5009094953223726F, 0.0F, 0.0F); - this.front = new ModelRenderer(this, 0, 0); - this.front.setRotationPoint(-3.0F, 12.0F, 0.2F); - this.front.addBox(0.0F, 0.0F, 0.0F, 6, 6, 1, 0.0F); - this.setRotateAngle(front, -0.5009094953223726F, 0.0F, 0.0F); - this.shape16 = new ModelRenderer(this, 31, 0); - this.shape16.setRotationPoint(0.0F, 7.0F, -8.0F); - this.shape16.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(shape16, 0.4553564018453205F, 0.0F, 0.0F); - this.left = new ModelRenderer(this, 0, 2); - this.left.setRotationPoint(-2.9F, 12.6F, -1.9F); - this.left.addBox(0.0F, 0.0F, 0.0F, 0, 9, 5, 0.0F); - this.shape16.addChild(this.right); - this.shape16.addChild(this.bottomfront); - this.shape16.addChild(this.bottomback); - this.shape16.addChild(this.back); - this.shape16.addChild(this.front); - this.shape16.addChild(this.left); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - this.shape16.render(f5); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/client/model/blocks/ModelForgingStation.java b/src/main/java/com/zivilon/cinder_loe/client/model/blocks/ModelForgingStation.java deleted file mode 100644 index 98afa2d..0000000 --- a/src/main/java/com/zivilon/cinder_loe/client/model/blocks/ModelForgingStation.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.zivilon.cinder_loe.client.model.blocks; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -/** - * forging_station - Shinare - * Created using Tabula 4.1.1 - */ -public class ModelForgingStation extends ModelBase { - public ModelRenderer middle_block; - public ModelRenderer left_block; - public ModelRenderer right_block; - public ModelRenderer left_leg; - public ModelRenderer left_leg_top; - public ModelRenderer left_leg_base; - public ModelRenderer right_leg_front; - public ModelRenderer right_leg_back; - - public ModelForgingStation() { - this.textureWidth = 128; - this.textureHeight = 64; - this.right_leg_back = new ModelRenderer(this, 0, 0); - this.right_leg_back.setRotationPoint(4.0F, 10.0F, 0.0F); - this.right_leg_back.addBox(0.0F, 0.0F, -2.0F, 2, 2, 16, 0.0F); - this.setRotateAngle(right_leg_back, 0.7853981633974483F, 0.0F, 0.0F); - this.left_leg = new ModelRenderer(this, 0, 32); - this.left_leg.setRotationPoint(6.0F, 2.0F, 6.0F); - this.left_leg.addBox(0.0F, 0.0F, 0.0F, 4, 14, 4, 0.0F); - this.left_leg_top = new ModelRenderer(this, 0, 32); - this.left_leg_top.setRotationPoint(-1.0F, 0.0F, -1.0F); - this.left_leg_top.addBox(0.0F, 0.0F, 0.0F, 6, 2, 6, 0.0F); - this.left_block = new ModelRenderer(this, 64, 32); - this.left_block.setRotationPoint(16.0F, 0.0F, 0.0F); - this.left_block.addBox(0.0F, 0.0F, 0.0F, 16, 2, 16, 0.0F); - this.setRotateAngle(left_block, 0.0F, 3.141592653589793F, 0.0F); - this.right_leg_front = new ModelRenderer(this, 0, 0); - this.right_leg_front.setRotationPoint(11.0F, 10.0F, 0.0F); - this.right_leg_front.addBox(0.0F, 0.0F, -2.0F, 2, 2, 16, 0.0F); - this.setRotateAngle(right_leg_front, 0.7853981633974483F, 0.0F, 0.0F); - this.left_leg_base = new ModelRenderer(this, 0, 32); - this.left_leg_base.setRotationPoint(-1.0F, 12.0F, -1.0F); - this.left_leg_base.addBox(0.0F, 0.0F, 0.0F, 6, 2, 6, 0.0F); - this.right_block = new ModelRenderer(this, 64, 0); - this.right_block.setRotationPoint(0.0F, 0.0F, 16.0F); - this.right_block.addBox(0.0F, 0.0F, 0.0F, 16, 2, 16, 0.0F); - this.middle_block = new ModelRenderer(this, 0, 0); - this.middle_block.setRotationPoint(-8.0F, 8.0F, -8.0F); - this.middle_block.addBox(0.0F, 0.0F, 0.0F, 16, 16, 16, 0.0F); - this.right_block.addChild(this.right_leg_back); - this.left_block.addChild(this.left_leg); - this.left_leg.addChild(this.left_leg_top); - this.middle_block.addChild(this.left_block); - this.right_block.addChild(this.right_leg_front); - this.left_leg.addChild(this.left_leg_base); - this.middle_block.addChild(this.right_block); - } - - public void render(float f5) { - this.middle_block.render(f5); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/RenderNex.java b/src/main/java/com/zivilon/cinder_loe/client/render/RenderNex.java deleted file mode 100644 index 99c4950..0000000 --- a/src/main/java/com/zivilon/cinder_loe/client/render/RenderNex.java +++ /dev/null @@ -1,136 +0,0 @@ -package com.zivilon.cinder_loe.client.render; - -import com.zivilon.cinder_loe.client.model.ModelNex; -import com.zivilon.cinder_loe.entity.Nex; -import lotr.client.render.entity.LOTRRandomSkins; -import lotr.common.entity.LOTRRandomSkinEntity; -import lotr.common.entity.npc.LOTREntityBalrog; -import lotr.client.render.entity.LOTRRandomSkins; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.OpenGlHelper; -import net.minecraft.client.renderer.entity.RenderLiving; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; - -public class RenderNex extends RenderLiving { - private static LOTRRandomSkins balrogSkins; - - private static LOTRRandomSkins balrogSkinsBright; - - private static final ResourceLocation fireTexture = new ResourceLocation("lotr:mob/balrog/fire.png"); - - private ModelNex balrogModel; - - private ModelNex balrogModelBright; - - private ModelNex fireModel; - - public RenderNex() { - super((ModelBase)new ModelNex(), 0.5F); - this.balrogModel = (ModelNex)this.mainModel; - this.balrogModelBright = new ModelNex(0.05F); - this.fireModel = new ModelNex(0.0F); - this.fireModel.setFireModel(); - balrogSkins = LOTRRandomSkins.loadSkinsList("lotr:mob/balrog/balrog"); - balrogSkinsBright = LOTRRandomSkins.loadSkinsList("lotr:mob/balrog/balrog_bright"); - } - - protected ResourceLocation getEntityTexture(Entity entity) { - return balrogSkins.getRandomSkin((LOTRRandomSkinEntity)entity); - } - - public void doRender(Entity entity, double d, double d1, double d2, float f, float f1) { - Nex balrog = (Nex)entity; - ItemStack heldItem = balrog.getHeldItem(); - this.fireModel.heldItemRight = (heldItem == null) ? 0 : 2; - doRender((EntityLiving)balrog, d, d1, d2, f, f1); - } - - protected void preRenderCallback(EntityLivingBase entity, float f) { - Nex balrog = (Nex)entity; - float scale = 2.0F; - GL11.glScalef(scale, scale, scale); - } - - private void setupFullBright() { - int light = 15728880; - int lx = light % 65536; - int ly = light / 65536; - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lx / 1.0F, ly / 1.0F); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - - protected int shouldRenderPass(EntityLivingBase entity, int pass, float f) { - Nex balrog = (Nex)entity; - if (pass == 1) { - float alpha; - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0F, 240.0F); - GL11.glMatrixMode(5890); - GL11.glLoadIdentity(); - float f1 = balrog.ticksExisted + f; - float f2 = f1 * 0.01F; - float f3 = f1 * 0.01F; - GL11.glTranslatef(f2, f3, 0.0F); - GL11.glMatrixMode(5888); - GL11.glAlphaFunc(516, 0.01F); - GL11.glEnable(3042); - GL11.glBlendFunc(1, 1); - alpha = 0.3F + MathHelper.sin(f1 * 0.05F) * 0.15F; - GL11.glColor4f(alpha, alpha, alpha, 1.0F); - GL11.glDisable(2896); - GL11.glDepthMask(false); - setRenderPassModel((ModelBase)this.fireModel); - bindTexture(fireTexture); - return 1; - } - if (pass == 2) { - GL11.glMatrixMode(5890); - GL11.glLoadIdentity(); - GL11.glMatrixMode(5888); - GL11.glAlphaFunc(516, 0.1F); - GL11.glDisable(3042); - GL11.glEnable(2896); - GL11.glDepthMask(true); - GL11.glDisable(2896); - setupFullBright(); - setRenderPassModel((ModelBase)this.balrogModelBright); - bindTexture(balrogSkinsBright.getRandomSkin((LOTRRandomSkinEntity)balrog)); - GL11.glEnable(3042); - GL11.glBlendFunc(770, 771); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - return 1; - } - if (pass == 3) { - GL11.glEnable(2896); - GL11.glDisable(3042); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - return -1; - } - - protected void renderEquippedItems(EntityLivingBase entity, float f) { - GL11.glColor3f(1.0F, 1.0F, 1.0F); - ItemStack heldItem = entity.getHeldItem(); - if (heldItem != null) { - GL11.glPushMatrix(); - this.balrogModel.body.postRender(0.0625F); - this.balrogModel.rightArm.postRender(0.0625F); - GL11.glTranslatef(-0.25F, 1.5F, -0.125F); - float scale = 1.25F; - GL11.glScalef(scale, -scale, scale); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - this.renderManager.itemRenderer.renderItem(entity, heldItem, 0); - if (heldItem.getItem().requiresMultipleRenderPasses()) - for (int x = 1; x < heldItem.getItem().getRenderPasses(heldItem.getItemDamage()); x++) - this.renderManager.itemRenderer.renderItem(entity, heldItem, x); - GL11.glPopMatrix(); - } - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/RenderNexCloud.java b/src/main/java/com/zivilon/cinder_loe/client/render/RenderNexCloud.java deleted file mode 100644 index e6644ae..0000000 --- a/src/main/java/com/zivilon/cinder_loe/client/render/RenderNexCloud.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.zivilon.cinder_loe.client.render; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; - -import com.zivilon.cinder_loe.entity.NexCloud; - -public class RenderNexCloud extends Render { - - public static ResourceLocation GREEN_PIXEL_TEXTURE = new ResourceLocation("cinder_loe:mob/green.png"); - public ModelBase model = new ModelBase() {}; // Create an empty ModelBase instance - public ModelRenderer cube; - - public RenderNexCloud() { - this.cube = new ModelRenderer(this.model, 0, 0); - this.cube.addBox(-8F, -8F, -8F, 16, 16, 16); // Define a cube of 16x16x16 pixels - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - return GREEN_PIXEL_TEXTURE; - } - - @Override - public void doRender(Entity entity, double x, double y, double z, float entityYaw, float partialTicks) { - GL11.glPushMatrix(); - GL11.glTranslatef((float) x, (float) y + entity.height / 2, (float) z); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDisable(GL11.GL_CULL_FACE); // Disable face culling - - this.bindEntityTexture(entity); // Bind the single-pixel texture - - NexCloud nexCloud = (NexCloud) entity; - GL11.glColor4f(1.0F, 1.0F, 1.0F, nexCloud.opacity); // Use the opacity from the entity - - // Render the cube model - GL11.glScalef(entity.width, entity.height, entity.width); - this.cube.render(0.0625F); // Render the cube with a scaling factor - - GL11.glEnable(GL11.GL_CULL_FACE); // Re-enable face culling - GL11.glDisable(GL11.GL_BLEND); - GL11.glPopMatrix(); - } - -} diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/RenderNexMiniboss.java b/src/main/java/com/zivilon/cinder_loe/client/render/RenderNexMiniboss.java deleted file mode 100644 index 3fb5b41..0000000 --- a/src/main/java/com/zivilon/cinder_loe/client/render/RenderNexMiniboss.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.zivilon.cinder_loe.client.render; - -import com.zivilon.cinder_loe.entity.NexShadow; -import com.zivilon.cinder_loe.entity.NexIce; -import com.zivilon.cinder_loe.entity.NexFire; -import com.zivilon.cinder_loe.entity.NexToxin; - -import lotr.client.model.LOTRModelHuman; -import lotr.client.render.entity.LOTRRenderBiped; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; - -public class RenderNexMiniboss extends LOTRRenderBiped { - public static ResourceLocation SHADOW_TEXTURE = new ResourceLocation("cinder_loe:mob/nex/shadow.png"); - public static ResourceLocation FIRE_TEXTURE = new ResourceLocation("cinder_loe:mob/nex/fire.png"); - public static ResourceLocation ICE_TEXTURE = new ResourceLocation("cinder_loe:mob/nex/ice.png"); - public static ResourceLocation TOXIN_TEXTURE = new ResourceLocation("cinder_loe:mob/nex/toxin.png"); - - public RenderNexMiniboss() { - super(new LOTRModelHuman(), 0.0F); - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - if (entity instanceof NexToxin) { - return TOXIN_TEXTURE; - } else if (entity instanceof NexFire) { - return FIRE_TEXTURE; - } else if (entity instanceof NexIce) { - return ICE_TEXTURE; - } else { - return SHADOW_TEXTURE; - } - } - - @Override - protected void preRenderCallback(EntityLivingBase entity, float partialTickTime) { - super.preRenderCallback(entity, partialTickTime); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.5F); // Apply 50% transparency - } - - @Override - protected void renderModel(EntityLivingBase entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor) { - super.renderModel(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor); - GL11.glDisable(GL11.GL_BLEND); - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/RenderNimveilBolt.java b/src/main/java/com/zivilon/cinder_loe/client/render/RenderNimveilBolt.java deleted file mode 100644 index 5ab2cec..0000000 --- a/src/main/java/com/zivilon/cinder_loe/client/render/RenderNimveilBolt.java +++ /dev/null @@ -1,136 +0,0 @@ -package com.zivilon.cinder_loe.client.render; - -import com.zivilon.cinder_loe.entity.effect.NimveilLightningBolt; - -import net.minecraft.client.renderer.entity.RenderLightningBolt; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import java.util.Random; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; - -@SideOnly(Side.CLIENT) -public class RenderNimveilBolt extends RenderLightningBolt { - - public void doRender(NimveilLightningBolt p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) { - Tessellator tessellator = Tessellator.instance; - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); - double[] adouble = new double[8]; - double[] adouble1 = new double[8]; - double d3 = 0.0D; - double d4 = 0.0D; - Random random = new Random(p_76986_1_.boltVertex); - - for (int i = 7; i >= 0; --i) { - adouble[i] = d3; - adouble1[i] = d4; - d3 += (double)(random.nextInt(11) - 5); - d4 += (double)(random.nextInt(11) - 5); - } - - for (int k1 = 0; k1 < 4; ++k1) { - Random random1 = new Random(p_76986_1_.boltVertex); - - for (int j = 0; j < 3; ++j) { - int k = 7; - int l = 0; - - if (j > 0) { - k = 7 - j; - } - - if (j > 0) { - l = k - 2; - } - - double d5 = adouble[k] - d3; - double d6 = adouble1[k] - d4; - - for (int i1 = k; i1 >= l; --i1) { - double d7 = d5; - double d8 = d6; - - if (j == 0) { - d5 += (double)(random1.nextInt(11) - 5); - d6 += (double)(random1.nextInt(11) - 5); - } else { - d5 += (double)(random1.nextInt(31) - 15); - d6 += (double)(random1.nextInt(31) - 15); - } - - tessellator.startDrawing(5); - float f2 = 0.5F; - tessellator.setColorRGBA_F(0.9F * f2, 0.9F * f2, 1.0F * f2, 0.3F); - double d9 = 0.1D + (double)k1 * 0.2D; - - if (j == 0) { - d9 *= (double)i1 * 0.1D + 1.0D; - } - - double d10 = 0.1D + (double)k1 * 0.2D; - - if (j == 0) { - d10 *= (double)(i1 - 1) * 0.1D + 1.0D; - } - - for (int j1 = 0; j1 < 5; ++j1) { - double d11 = p_76986_2_ + 0.5D - d9; - double d12 = p_76986_6_ + 0.5D - d9; - - if (j1 == 1 || j1 == 2) { - d11 += d9 * 2.0D; - } - - if (j1 == 2 || j1 == 3) { - d12 += d9 * 2.0D; - } - - double d13 = p_76986_2_ + 0.5D - d10; - double d14 = p_76986_6_ + 0.5D - d10; - - if (j1 == 1 || j1 == 2) { - d13 += d10 * 2.0D; - } - - if (j1 == 2 || j1 == 3) { - d14 += d10 * 2.0D; - } - - tessellator.addVertex(d13 + d5, p_76986_4_ + (double)(i1 * 16), d14 + d6); - tessellator.addVertex(d11 + d7, p_76986_4_ + (double)((i1 + 1) * 16), d12 + d8); - } - - tessellator.draw(); - } - } - } - - GL11.glDisable(GL11.GL_BLEND); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_TEXTURE_2D); - } - - /** - * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. - */ - public ResourceLocation getEntityTexture(NimveilLightningBolt p_110775_1_) { - return null; - } - - /** - * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. - */ - public ResourceLocation getEntityTexture(Entity p_110775_1_) { - return this.getEntityTexture((NimveilLightningBolt)p_110775_1_); - } - - public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) - { - this.doRender((NimveilLightningBolt)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/block/RenderIceCage.java b/src/main/java/com/zivilon/cinder_loe/client/render/block/RenderIceCage.java deleted file mode 100644 index bfb8b72..0000000 --- a/src/main/java/com/zivilon/cinder_loe/client/render/block/RenderIceCage.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.zivilon.cinder_loe.client.render.block; - -import com.zivilon.cinder_loe.blocks.IceCage; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; -import cpw.mods.fml.client.registry.RenderingRegistry; -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.world.IBlockAccess; -import org.lwjgl.opengl.GL11; - -public class RenderIceCage implements ISimpleBlockRenderingHandler { - - public static final int RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - if (modelID != RENDER_ID) return; - - // Render inventory block as flat texture icon - renderer.renderBlockAsItem(block, metadata, 1.0F); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - if (!(block instanceof IceCage) || modelId != RENDER_ID) { - return false; - } - - int meta = world.getBlockMetadata(x, y, z); - float thickness = 0.0625F; // 1/16th of a block thickness - - // Render the bounding boxes as defined in the block class - if (meta == 0) { // Lower part - renderer.setRenderBounds(0, 0, 0, thickness, 1, 1); // Left wall - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(1 - thickness, 0, 0, 1, 1, 1); // Right wall - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0, 0, 0, 1, 1, thickness); // Front wall - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0, 0, 1 - thickness, 1, 1, 1); // Back wall - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0, 0, 0, 1, thickness, 1); // Floor - renderer.renderStandardBlock(block, x, y, z); - } else if (meta == 1) { // Upper part - renderer.setRenderBounds(0, 0, 0, thickness, 1, 1); // Left wall - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(1 - thickness, 0, 0, 1, 1, 1); // Right wall - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0, 0, 0, 1, 1, thickness); // Front wall - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0, 0, 1 - thickness, 1, 1, 1); // Back wall - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0, 1, 0, 1, 1 + thickness, 1); // Ceiling - renderer.renderStandardBlock(block, x, y, z); - } - - return true; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return false; // Do not render as 3D in inventory - } - - @Override - public int getRenderId() { - return RENDER_ID; - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/item/TrollClubRenderer.java b/src/main/java/com/zivilon/cinder_loe/client/render/item/TrollClubRenderer.java deleted file mode 100644 index 6067895..0000000 --- a/src/main/java/com/zivilon/cinder_loe/client/render/item/TrollClubRenderer.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.zivilon.cinder_loe.client.render.item; - -import net.minecraft.util.ResourceLocation; -import net.minecraft.client.renderer.OpenGlHelper; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.item.ItemStack; -import net.minecraftforge.client.IItemRenderer; -import org.lwjgl.opengl.GL11; -import net.minecraft.client.model.ModelBase; - -public class TrollClubRenderer implements IItemRenderer { - - public static ResourceLocation texture = new ResourceLocation("lotr", "textures/items/troll_chieftain_club.png"); - - public ModelBase model; -/* public ModelTrollChieftainClub model; - - public TrollClubRenderer(ModelTrollChieftainClub model) { - this.model = model; - }*/ - public TrollClubRenderer() { - this.model = null; - } - - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - return type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON; - } - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - return false; - } - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - GL11.glPushMatrix(); - - // Position the model correctly - if (type == ItemRenderType.EQUIPPED_FIRST_PERSON) { - GL11.glTranslatef(0.5F, 0.5F, 0.5F); - } else { - GL11.glTranslatef(0.7F, 0.4F, 0.5F); - } - - // Rotate and scale the model as needed - GL11.glScalef(1.0F, 1.0F, 1.0F); - - // Bind the texture - RenderManager.instance.renderEngine.bindTexture(texture); - - // Render the model - model.render(null, 0, 0, 0, 0, 0, 0.0625F); - - GL11.glPopMatrix(); - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/tileentity/TileEntityForgingStationRenderer.java b/src/main/java/com/zivilon/cinder_loe/client/render/tileentity/TileEntityForgingStationRenderer.java deleted file mode 100644 index 38d2291..0000000 --- a/src/main/java/com/zivilon/cinder_loe/client/render/tileentity/TileEntityForgingStationRenderer.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.zivilon.cinder_loe.client.render.tileentity; - -import com.zivilon.cinder_loe.client.model.blocks.ModelForgingStation; -import com.zivilon.cinder_loe.tileentity.TileEntityForgingStation; -import com.zivilon.cinder_loe.client.render.item.RenderHelper; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.ItemRenderer; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; -import net.minecraft.util.ChatComponentText; - -public class TileEntityForgingStationRenderer extends TileEntitySpecialRenderer { - public ModelForgingStation model = new ModelForgingStation(); - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTick) { - - if (tileEntity instanceof TileEntityForgingStation) { - TileEntityForgingStation tile = (TileEntityForgingStation) tileEntity; - - // Get the metadata to determine if this is the middle part - int meta = tile.getBlockMetadata(); - int direction = meta >> 2; - int part = meta & 3; - float rotation = 270F; - if (part != 1) return; - - rotation = direction * 90F - 90F; - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F); - GL11.glScalef(-1.0F, -1.0F, 1.0F); - GL11.glRotatef(rotation, 0F, 1F, 0F); // Adjust rotation as needed - bindTexture(new ResourceLocation("lotr:textures/blocks/forging_station.png")); - this.model.render(0.0625F); // Render the model - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glPopMatrix(); - - - // Render the items above each part of the Forging Station - float offset = 0F; - switch (direction) { - case 1: - case 3: - offset -= 180F; - break; - } - renderStoredItems(tile, x, y, z, direction * 90F + offset); - } - } - - public void renderStoredItems(TileEntityForgingStation tile, double x, double y, double z, float rotation) { - GL11.glPushMatrix(); - GL11.glTranslatef((float) x + 0.5F, (float) y + 1.0F, (float) z + 0.5F); // Adjust the position - GL11.glRotatef(rotation, 0F, 1F, 0F); // Rotate to match the block's orientation - - ItemStack left = tile.getLeftItem(); - ItemStack middle = tile.getMiddleItem(); - ItemStack right = tile.getRightItem(); - - // Render left item - if (left != null) { - renderItemInWorld(left, 1.0, 0.0, 0.0); - } - - // Render middle item - if (middle != null) { - renderItemInWorld(middle, 0.0, 0.0, 0.0); - } - - // Render right item - if (right != null) { - renderItemInWorld(right, -1.0, 0.0, 0.0); - } - - GL11.glPopMatrix(); - } - - public void renderItemInWorld(ItemStack stack, double x, double y, double z) { - if (stack != null) { - GL11.glPushMatrix(); - GL11.glTranslated(x, y, z); - GL11.glScalef(1.0F, 1.0F, 1.0F); // Adjust the item size - - // Bind the item texture - Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.locationItemsTexture); - IIcon icon = stack.getIconIndex(); - Tessellator tessellator = Tessellator.instance; - - // Set up the item rendering parameters - float minU = icon.getMinU(); - float maxU = icon.getMaxU(); - float minV = icon.getMinV(); - float maxV = icon.getMaxV(); - - // Render the item in 2D - GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); - GL11.glTranslatef(-0.25F, -0.25F, 0.0F); - GL11.glScalef(0.5F, 0.5F, 0.5F); - - RenderHelper.customRenderItemIn2D(tessellator, maxU, minV, minU, maxV, icon.getIconWidth(), icon.getIconHeight(), 0.0625F, false); - - GL11.glPopMatrix(); - } - } -} 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 63aa60c..95f4a23 100644 --- a/src/main/java/com/zivilon/cinder_loe/coremod/LOTRMaterialTransformer.java +++ b/src/main/java/com/zivilon/cinder_loe/coremod/LOTRMaterialTransformer.java @@ -67,12 +67,6 @@ public class LOTRMaterialTransformer implements IClassTransformer { addMaterial("USURPER", classNode); addMaterial("WARLORD",classNode); addMaterial("JADE",classNode); - addMaterial("NEX_ICE",classNode); - addMaterial("NEX_FIRE",classNode); - addMaterial("NEX_TOXIN",classNode); - addMaterial("NEX_SHADOW",classNode); - addMaterial("NIMVEIL",classNode); - addMaterial("FROZEN",classNode); // Protection Conversion diff --git a/src/main/java/com/zivilon/cinder_loe/coremod/LOTRWeaponLinker.java b/src/main/java/com/zivilon/cinder_loe/coremod/LOTRWeaponLinker.java index 5c9d186..7df320c 100644 --- a/src/main/java/com/zivilon/cinder_loe/coremod/LOTRWeaponLinker.java +++ b/src/main/java/com/zivilon/cinder_loe/coremod/LOTRWeaponLinker.java @@ -25,8 +25,7 @@ public class LOTRWeaponLinker implements IClassTransformer { "frostblade", "spearsolidgold", "whip", "spearUnnamed", "swordBree", "maceArnor", - "daggerAsh","bowAsh","hammerAsh","pikeAsh","battleaxeAsh","swordAsh","spearAsh", "staffAsh", - "firstAgeGlaive", "nimveil"); + "daggerAsh","bowAsh","hammerAsh","pikeAsh","battleaxeAsh","swordAsh","spearAsh", "staffAsh"); } return basicClass; } diff --git a/src/main/java/com/zivilon/cinder_loe/entity/Nex.java b/src/main/java/com/zivilon/cinder_loe/entity/Nex.java deleted file mode 100644 index f8464cb..0000000 --- a/src/main/java/com/zivilon/cinder_loe/entity/Nex.java +++ /dev/null @@ -1,417 +0,0 @@ -package com.zivilon.cinder_loe.entity; - - -import lotr.common.LOTRDamage; -import lotr.common.entity.ai.LOTREntityAIAttackOnCollide; -import lotr.common.entity.npc.LOTREntityNPC; -import lotr.common.fac.LOTRFaction; - -import net.minecraft.block.Block; -import net.minecraft.entity.EnumCreatureAttribute; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAIWander; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EntityDamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; - -import com.zivilon.cinder_loe.CinderLoE; -import com.zivilon.cinder_loe.entity.ai.LoEPreciseAttackOnCollide; -import com.zivilon.cinder_loe.util.BlockPos; -import com.zivilon.cinder_loe.util.Utilities; - -import java.lang.ref.WeakReference; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - -public class Nex extends LOTREntityNPC { - public EntityAIBase normal_attack_ai; - public EntityAIBase desperate_attack_ai; - public static double normal_attack_damage = 30.0D; - public static double desperate_attack_damage = 50.0D; - public static int normal_attack_speed = 20; - public static int desperate_attack_speed = 10; - - public static List> nex_instances = new ArrayList<>(); - - public AxisAlignedBB collisionBox; - public AxisAlignedBB hitbox; - public int phase = 0; - public ChunkCoordinates currentFlightTarget; - public EntityPlayer playerTarget; - public int tickCounter = 0; - - public Nex(World world) { - super(world); - setSize(1.5F, 3.0F); - normal_attack_ai = (EntityAIBase) new LoEPreciseAttackOnCollide(this, 1.3D, 3.0D, normal_attack_speed, false); - desperate_attack_ai = (EntityAIBase) new LoEPreciseAttackOnCollide(this, 1.3D, 3.0D, desperate_attack_speed, false); - ((EntityLiving) this).tasks.addTask(2, normal_attack_ai); - ((EntityLiving) this).tasks.addTask(2, (EntityAIBase) new EntityAIWander(this, 1.0D)); - ((EntityLiving) this).tasks.addTask(3, (EntityAIBase) new EntityAILookIdle((EntityLiving) this)); - addTargetTasks(true); -/* store_nex_instance(); - clear_shadow_tiles();*/ - } - protected void entityInit() { - super.entityInit(); - this.dataWatcher.addObject(31, Integer.valueOf(0)); - } -/* - public void clear_shadow_tiles() { - if (!this.worldObj.isRemote) { - int xz_range = 100; - int y_range = 10; - int i = MathHelper.floor_double(this.posX); - int j = MathHelper.floor_double(this.posY); - int k = MathHelper.floor_double(this.posZ); - for (int i1 = i - xz_range; i1 <= i + xz_range; i1++) { - for (int j1 = j - y_range; j1 <= j + y_range; j1++) { - for (int k1 = k - xz_range; k1 <= k + xz_range; k1++) { - Block block = this.worldObj.getBlock(i1, j1, k1); - if (block == CinderLoE.shadowTile) - this.worldObj.setBlockToAir(i1, j1, k1); - } - } - } - } - } - - - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(5000.0D); - getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.2D); - getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(1.0D); - getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(100.0D); - getEntityAttribute(npcAttackDamage).setBaseValue(normal_attack_damage); - } - - public int getPhase() { - phase = this.dataWatcher.getWatchableObjectInt(31); - return phase; - } - public void setPhase(int i) { - phase = i; - this.dataWatcher.updateObject(31, Integer.valueOf(phase)); - } - - public void next_phase() { - Utilities.setInvulnerable((Entity)this, false); - phase = getPhase(); - switch(phase) { - case 0: // Move to Toxic phase - clear_shadow_tiles(); - setPhase(phase + 1); - return; - case 1: // Move to Ice phase - setPhase(phase + 1); - return; - case 2: // Move to Fire phase - setPhase(phase + 1); - return; - case 3: // Move to Desperation phase - setPhase(phase + 1); - this.tasks.removeTask(normal_attack_ai); - this.tasks.addTask(2, desperate_attack_ai); - getEntityAttribute(npcAttackDamage).setBaseValue(desperate_attack_damage); - return; - default: - System.out.println("[CinderLoE] Nex phase shift past phase 4???"); - } - } - - public LOTRFaction getFaction() { - return LOTRFaction.UTUMNO; - } - - public void writeEntityToNBT(NBTTagCompound nbt) { - super.writeEntityToNBT(nbt); - nbt.setInteger("NexPhase", getPhase()); - } - - public void readEntityFromNBT(NBTTagCompound nbt) { - super.readEntityFromNBT(nbt); - setPhase(nbt.getInteger("NexPhase")); - } - - public boolean canBePushed() { - return false; - } - - protected void fall(float f) {} - - protected void updateFallState(double d, boolean flag) {} - - protected boolean canDespawn() { - return false; - } - - // Phase 0 - Shadow - // Phase 1 - Toxin - // Phase 2 - Ice - // Phase 3 - Fire - // Phase 4 - Desperation - - public void release_miniboss() { - Utilities.setInvulnerable((Entity)this, true); - System.out.println("Set Nex invulnerable: " + this.isEntityInvulnerable()); - Class phaseClass = null; - switch (phase) { - case 0: - phaseClass = NexShadow.class; - break; - case 1: - phaseClass = NexToxin.class; - break; - case 2: - phaseClass = NexIce.class; - break; - case 3: - phaseClass = NexFire.class; - break; - default: - this.setDead(); - System.out.println("ERROR! Invalid Nex phase change: " + phase); - return; - } - - System.out.println("Miniboss class: " + phaseClass.getSimpleName()); - List entityList = this.worldObj.getEntitiesWithinAABB(NexMiniboss.class, this.boundingBox.expand(100, 10, 100)); - for (Entity entity : entityList) { - if (phaseClass.isInstance(entity)) { - System.out.println("Found correct miniboss class"); - NexMiniboss miniboss = (NexMiniboss) entity; - miniboss.unbind(); - return; - } - } - System.out.println("ERROR! Nex is missing miniboss of type " + phaseClass.getSimpleName()); - } - - @Override - public void onUpdate() { - super.onUpdate(); - tickCounter++; - - switch (phase) { - case 0: - runShadowTasks(); - break; - case 1: - runToxinTasks(); - break; - case 2: - runIceTasks(); - break; - case 3: - runFireTasks(); - break; - default: - break; - } - } - - public void runShadowTasks() { - if (tickCounter >= 100) { // 5 seconds (100 ticks) - tickCounter = 0; - - // Find air blocks with solid blocks underneath and place ShadowTile - placeShadowTiles(); - } - } - public void runToxinTasks() { - if (tickCounter >= 200) { - tickCounter = 0; - spawnToxicCloud(); - } - } - public void runIceTasks() {} - public void runFireTasks() {} - - public List getValidPositions() { - int radius = 64; // Radius to search for valid blocks - - List validPositions = new ArrayList<>(); - - // Iterate over blocks in a specific area - for (int x = -radius; x <= radius; x++) { - for (int y = -4; y <= 4; y++) { - for (int z = -radius; z <= radius; z++) { - BlockPos pos = new BlockPos(MathHelper.floor_double(this.posX) + x, MathHelper.floor_double(this.posY) + y, MathHelper.floor_double(this.posZ) + z); - BlockPos below = pos.down(); - - if (worldObj.isAirBlock(pos.x, pos.y, pos.z) && worldObj.getBlock(below.x, below.y, below.z).isOpaqueCube()) { - validPositions.add(pos); - } - } - } - } - return validPositions; - } - - public void spawnToxicCloud() { - if (this.worldObj.isRemote) return; - int toxicCloudsToPlace = 4; - if (countToxicClouds() >= toxicCloudsToPlace) return; - - List validPositions = getValidPositions(); - - // Place NexCloud in 2 random valid positions - for (int i = 0; i < toxicCloudsToPlace && !validPositions.isEmpty(); i++) { - int randomIndex = worldObj.rand.nextInt(validPositions.size()); - BlockPos pos = validPositions.remove(randomIndex); - - NexCloud cloud = new NexCloud(this.worldObj); - cloud.setPosition(pos.x + 0.5, pos.y + 1.5, pos.z + 0.5); - this.worldObj.spawnEntityInWorld(cloud); - } - } - - public boolean attackEntityAsMob(Entity entity) { - if (super.attackEntityAsMob(entity)) { - if (entity instanceof EntityPlayerMP) - LOTRDamage.doFrostDamage((EntityPlayerMP)entity); - if (entity instanceof EntityLivingBase) { - int difficulty = this.worldObj.difficultySetting.getDifficultyId(); - int duration = difficulty * (difficulty + 5) / 2; - if (duration > 0) - ((EntityLivingBase)entity).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, duration * 20, 0)); - } - return true; - } - return false; - } - - public int countToxicClouds() { - List clouds = worldObj.getEntitiesWithinAABB(NexCloud.class, this.boundingBox.expand(100.0, 10.0, 100.0)); - return clouds.size(); - } - - public void placeShadowTiles() { - if (this.worldObj.isRemote) return; - int shadowTilesToPlace = 8; // Number of shadow tiles to place - - List validPositions = getValidPositions(); - - // Place ShadowTile in 4 random valid positions - for (int i = 0; i < shadowTilesToPlace && !validPositions.isEmpty(); i++) { - int randomIndex = worldObj.rand.nextInt(validPositions.size()); - BlockPos pos = validPositions.remove(randomIndex); - worldObj.setBlock(pos.x, pos.y, pos.z, CinderLoE.shadowTile); - } - } - - @Override - public boolean attackEntityFrom(DamageSource source, float dmg) { - super.attackEntityFrom(source, dmg); - int current_phase = (int) (this.getHealth() + dmg) / 1000; - int new_phase = (int) this.getHealth() / 1000; - System.out.println("Damage received: " + dmg + "while at health " + this.getHealth()); - if (phase == 3) { - if (source instanceof EntityDamageSource) { - Entity attacker = ((EntityDamageSource)source).getEntity(); - if (Utilities.has_fire_weapon(attacker)) { - attacker.attackEntityFrom(DamageSource.causeMobDamage(this), dmg); - attacker.setFire(10); - return false; - } - } - } - if (current_phase != new_phase && current_phase != 5) { - System.out.println("New phase should occur. Current phase health: " + current_phase + " and new phase health: " + new_phase); - if (phase != 4) - release_miniboss(); - } - return true; - } - - protected void dropFewItems(boolean flag, int i) { - return; - } - - protected String getHurtSound() { - return "lotr:wight.hurt"; - } - - protected String getDeathSound() { - return "lotr:wight.death"; - } - - @Override - public void heal(float amount) {} -*/ - @Override - public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor) {} -/* - @Override - public ItemStack getPickedResult(MovingObjectPosition target) { - return null; - } - - // Scripting data methods, VT hooks into these. See util.VT_additions - public void store_nex_instance() { - cleanup_instances(); - nex_instances.add(new WeakReference<>(this)); - } - public static Nex get_nex_instance() { - cleanup_instances(); - if (!nex_instances.isEmpty()) { - return nex_instances.get(0).get(); - } - return null; // or handle this scenario accordingly - } - public static int get_nex_phase() { - Nex nex = get_nex_instance(); - if (nex == null) { - return -404; - } - return nex.phase; protected void entityInit() { - super.entityInit(); - this.dataWatcher.addObject(31, Integer.valueOf(0)); - } - - } - public static int get_nex_health() { - Nex nex = get_nex_instance(); - if (nex == null) { - return -404; - } - return (int)nex.getHealth(); - } - public static void cleanup_instances() { - for (int i = nex_instances.size() - 1; i >= 0; i--) { - WeakReference weakRef = nex_instances.get(i); - Nex listed_instance = weakRef.get(); - if (listed_instance == null || !listed_instance.isEntityAlive()) { - nex_instances.remove(i); - } - } - } - - public static boolean is_nex_fire_phase_nearby(EntityLivingBase entity) { - List entityList = entity.worldObj.getEntitiesWithinAABB(Nex.class, entity.boundingBox.expand(100, 10, 100)); - for (Nex nex : entityList) { // We don't actually need to iterate, checking the first object is enough - if (nex.phase == 3) return true; - return false; - } - return false; - }*/ -} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/NexCloud.java b/src/main/java/com/zivilon/cinder_loe/entity/NexCloud.java deleted file mode 100644 index 209574e..0000000 --- a/src/main/java/com/zivilon/cinder_loe/entity/NexCloud.java +++ /dev/null @@ -1,180 +0,0 @@ -package com.zivilon.cinder_loe.entity; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; -import lotr.common.entity.npc.LOTREntityNPC; -import lotr.common.fac.LOTRFaction; -import net.minecraft.util.AxisAlignedBB; - -import java.util.List; - -public class NexCloud extends Entity { - public int tickCounter = 0; - public float opacity = 0.0F; - public boolean unbound = false; - - public NexCloud(World world) { - super(world); - this.setSize(5.0F, 3.0F); // Set the size of the cloud - this.noClip = true; // Disable hitbox - } - - @Override - protected void entityInit() { - this.dataWatcher.addObject(20, 0.0F); // Index 20, initial opacity - } - - @Override - protected void readEntityFromNBT(NBTTagCompound nbt) { - // Load entity data from NBT - } - - @Override - protected void writeEntityToNBT(NBTTagCompound nbt) { - // Save entity data to NBT - } - - public void syncOpacityToClient() { - this.dataWatcher.updateObject(20, this.opacity); - } - - @Override - public void onUpdate() { - super.onUpdate(); - this.noClip = true; - if (worldObj.isRemote) { - this.opacity = this.dataWatcher.getWatchableObjectFloat(20); - // Update the client's position to match the server's position - this.setPosition(this.posX, this.posY, this.posZ); - return; - } - syncOpacityToClient(); - tickCounter++; - - if (tickCounter <= 100) { - // Increase opacity from 0.0F to 0.5F over the first 100 ticks - opacity = 0.5F * (tickCounter / 100.0F); - } else if (tickCounter <= 200) { - // Maintain opacity at 0.5F for the next 100 ticks - opacity = 0.5F; - } - - if (unbound) { - followNearestPlayer(); - // Apply the motion to the entity's position - this.posX += this.motionX; - this.posY += this.motionY; - this.posZ += this.motionZ; - - this.setPosition(this.posX, this.posY, this.posZ); // Update the entity's position - } - - if (tickCounter % 10 == 0) { - if (tickCounter > 60 && tickCounter < 240) - applyPoisonEffect(); - unbound = isMinibossUnbound(); -/* if (unbound && tickCounter > 100) { - tickCounter = 100; - return; - }*/ - } - -/* if (unbound) { - return; - }*/ - - if (tickCounter <= 300 && tickCounter > 200) { - // Decrease opacity from 0.5F to 0.0F over the next 100 ticks - opacity = 0.5F * ((300 - tickCounter) / 100.0F); - return; - } - if (tickCounter > 300) { - // Set the entity as dead after 300 ticks - System.out.println("Setting cloud dead. Ticks: " + tickCounter + " and unbound state: " + unbound); - this.setDead(); - return; - } - - } - - @Override - public void moveEntity(double x, double y, double z) { - if (this.noClip) { - this.setPosition(this.posX + x, this.posY + y, this.posZ + z); - } else { - super.moveEntity(x, y, z); - } - } - - - public boolean isMinibossUnbound() { - List entities = worldObj.getEntitiesWithinAABB(Entity.class, this.boundingBox.expand(100.0, 10.0, 100.0)); - for (Entity entity : entities) { - if (entity instanceof NexToxin) { - NexToxin miniboss = (NexToxin) entity; -// System.out.println("Found miniboss. Is unbound: " + !miniboss.bound); - return !miniboss.bound; - } - } -// System.out.println("Miniboss not found"); - return false; - } - - public void applyPoisonEffect() { - List entities = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, this.boundingBox); - for (Entity entity : entities) { - if (entity != this && !(entity instanceof LOTREntityNPC && ((LOTREntityNPC) entity).getFaction() == LOTRFaction.UTUMNO)) { - if (entity instanceof EntityLivingBase) { - EntityLivingBase livingEntity = (EntityLivingBase) entity; - livingEntity.attackEntityFrom(DamageSource.magic, 2.0F); - livingEntity.addPotionEffect(new PotionEffect(Potion.poison.id, 200, 1)); // 10 seconds of poison (200 ticks) - } - } - } - } - - @Override - public AxisAlignedBB getBoundingBox() { - return null; - } - - - public void followNearestPlayer() { - List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, this.boundingBox.expand(100.0, 4.0, 100.0)); - if (!players.isEmpty()) { - EntityPlayer nearestPlayer = players.get(0); - double minDistance = this.getDistanceToEntity(nearestPlayer); - for (EntityPlayer player : players) { - double distance = this.getDistanceToEntity(player); - if (distance < minDistance) { - nearestPlayer = player; - minDistance = distance; - } - } - double speed = 0.01; - this.motionX = (nearestPlayer.posX - this.posX) * speed; - this.motionY = (nearestPlayer.posY - this.posY) * speed; - this.motionZ = (nearestPlayer.posZ - this.posZ) * speed; - } else { - this.motionX = 0; - this.motionY = 0; - this.motionZ = 0; - } - } - - @Override - public boolean canBeCollidedWith() { - return false; - } - - @Override - public boolean canBePushed() { - return false; - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/NexFire.java b/src/main/java/com/zivilon/cinder_loe/entity/NexFire.java deleted file mode 100644 index cbcab09..0000000 --- a/src/main/java/com/zivilon/cinder_loe/entity/NexFire.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.zivilon.cinder_loe.entity; - -import com.zivilon.cinder_loe.CinderLoE; -import com.zivilon.cinder_loe.util.Utilities; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import lotr.common.LOTRMod; -import lotr.common.enchant.LOTREnchantmentHelper; -import lotr.common.enchant.LOTREnchantment; -import net.minecraft.item.ItemStack; - -public class NexFire extends NexMiniboss { - public String entity_name = "§4Naira"; - - public NexFire(World world) { - super(world); - } - - @Override - public void setupEquipment() {/* - ItemStack weapon = new ItemStack(LOTRMod.hammerUtumno, 0); - ItemStack boots = new ItemStack(CinderLoE.bootsNexFire, 0); - ItemStack legs = new ItemStack(CinderLoE.legsNexFire, 0); - ItemStack body = new ItemStack(CinderLoE.bodyNexFire, 0); - ItemStack helmet = new ItemStack(CinderLoE.helmetNexFire, 0); - Utilities.setAppliedRandomEnchants(weapon); - Utilities.setLOTREnchant(weapon, LOTREnchantment.strong4); - Utilities.setLOTREnchant(weapon, LOTREnchantment.strong4); - Utilities.setLOTREnchant(weapon, LOTREnchantment.strong4); - Utilities.setLOTREnchant(weapon, LOTREnchantment.strong2); - Utilities.setLOTREnchant(weapon, LOTREnchantment.strong1); - Utilities.setLOTREnchant(weapon, LOTREnchantment.meleeReach1); - Utilities.setLOTREnchant(weapon, LOTREnchantment.meleeSpeed1); - Utilities.setLOTREnchant(weapon, LOTREnchantment.fire); - - this.npcItemsInv.setIdleItem(weapon); - this.npcItemsInv.setMeleeWeapon(weapon); - setCurrentItemOrArmor(0, weapon); - setCurrentItemOrArmor(1, boots); - setCurrentItemOrArmor(2, legs); - setCurrentItemOrArmor(3, body); - setCurrentItemOrArmor(4, helmet);*/ - } - - @Override - public String getNPCName() { - return entity_name; - } - @Override - public String getNPCFormattedName(String npcName, String entityName) { - return entity_name; - } - - @Override - public String getSpeechBank(EntityPlayer entityplayer) { - return "nex/fire"; - } - - @Override - public void onBoundUpdate(int x, int y, int z) { - } - - @Override - public void onUnboundUpdate() { - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/NexIce.java b/src/main/java/com/zivilon/cinder_loe/entity/NexIce.java deleted file mode 100644 index c723dfd..0000000 --- a/src/main/java/com/zivilon/cinder_loe/entity/NexIce.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.zivilon.cinder_loe.entity; - -import com.zivilon.cinder_loe.CinderLoE; -import com.zivilon.cinder_loe.util.Utilities; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import lotr.common.LOTRMod; -import lotr.common.enchant.LOTREnchantmentHelper; -import lotr.common.enchant.LOTREnchantment; -import net.minecraft.item.ItemStack; - - -public class NexIce extends NexMiniboss { - public String entity_name = "§bNinquë"; - - public NexIce(World world) { - super(world); - } - - @Override - public void setupEquipment() {/* - ItemStack weapon = new ItemStack(LOTRMod.spearUtumno, 0); - ItemStack boots = new ItemStack(CinderLoE.bootsNexIce, 0); - ItemStack legs = new ItemStack(CinderLoE.legsNexIce, 0); - ItemStack body = new ItemStack(CinderLoE.bodyNexIce, 0); - ItemStack helmet = new ItemStack(CinderLoE.helmetNexIce, 0); - Utilities.setAppliedRandomEnchants(weapon); - Utilities.setLOTREnchant(weapon, LOTREnchantment.strong4); - Utilities.setLOTREnchant(weapon, LOTREnchantment.strong4); - Utilities.setLOTREnchant(weapon, LOTREnchantment.strong4); - Utilities.setLOTREnchant(weapon, LOTREnchantment.strong3); - Utilities.setLOTREnchant(weapon, LOTREnchantment.strong1); - Utilities.setLOTREnchant(weapon, LOTREnchantment.meleeReach1); - Utilities.setLOTREnchant(weapon, LOTREnchantment.meleeSpeed1); - Utilities.setLOTREnchant(weapon, LOTREnchantment.chill); - - this.npcItemsInv.setIdleItem(weapon); - this.npcItemsInv.setMeleeWeapon(weapon); - setCurrentItemOrArmor(0, weapon); - setCurrentItemOrArmor(1, boots); - setCurrentItemOrArmor(2, legs); - setCurrentItemOrArmor(3, body); - setCurrentItemOrArmor(4, helmet);*/ - } - - @Override - public String getNPCName() { - return entity_name; - } - @Override - public String getNPCFormattedName(String npcName, String entityName) { - return entity_name; - } - - @Override - public String getSpeechBank(EntityPlayer entityplayer) { - return "nex/ice"; - } - - @Override - public void onBoundUpdate(int x, int y, int z) { - } - - @Override - public void onUnboundUpdate() { - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/NexMiniboss.java b/src/main/java/com/zivilon/cinder_loe/entity/NexMiniboss.java deleted file mode 100644 index f130c4e..0000000 --- a/src/main/java/com/zivilon/cinder_loe/entity/NexMiniboss.java +++ /dev/null @@ -1,152 +0,0 @@ -package com.zivilon.cinder_loe.entity; - -import com.zivilon.cinder_loe.CinderLoE; -import com.zivilon.cinder_loe.util.Utilities; -import com.zivilon.cinder_loe.entity.Nex; -import com.zivilon.cinder_loe.entity.ai.LoEPreciseAttackOnCollide; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; - -import lotr.common.entity.npc.LOTREntityMan; -import lotr.common.fac.LOTRFaction; - -import java.util.List; - -public abstract class NexMiniboss extends LOTREntityMan { - public String entity_name = "UNDEFINED"; - public boolean bound = true; - - public NexMiniboss(World world) { - super(world); - setSize(0.6F, 1.8F); - ((EntityLiving) this).tasks.addTask(2, (EntityAIBase) new LoEPreciseAttackOnCollide(this, 1.3D, 1.0D, 40, false)); - ((EntityLiving) this).tasks.addTask(8, (EntityAIBase) new EntityAIWatchClosest((EntityLiving) this, Nex.class, 8.0F, 0.02F)); - addTargetTasks(true); -// setupEquipment(); - } - - @Override - public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor) { - } - - @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(200.0D); - getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.225D); - getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(1.0D); - getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(100.0D); - } - - @Override - public LOTRFaction getFaction() { - return LOTRFaction.UTUMNO; - } - - @Override - protected boolean canDespawn() { - return false; - } - - @Override - public String getNPCName() { - return entity_name; - } - @Override - public String getNPCFormattedName(String npcName, String entityName) { - return entity_name; - } - - @Override - protected void dropFewItems(boolean flag, int i) { - } - - @Override - public boolean getCanSpawnHere() { - return false; - } - - @Override - public String getSpeechBank(EntityPlayer entityplayer) { - return "nex/undefined"; - } - - @Override - public void setupNPCName() { - } - - @Override - public ItemStack getPickedResult(MovingObjectPosition target) { - return null; - } - - @Override - public void onDeath(DamageSource source) { -/* List entityList = this.worldObj.getEntitiesWithinAABB(Nex.class, this.boundingBox.expand(100, 10, 100)); - for (Nex nex : entityList) { - nex.next_phase(); - return; - }*/ - } - - public void unbind() { -/* System.out.println("Unbinding " + this.getClass().getSimpleName()); - - int x = MathHelper.floor_double(this.posX); - int y = MathHelper.floor_double(this.posY); - int z = MathHelper.floor_double(this.posZ); - - Block blockAtFeet = this.worldObj.getBlock(x, y, z); - Block blockAtHead = this.worldObj.getBlock(x, y + 1, z); - if (blockAtFeet == CinderLoE.iceCage) { - this.worldObj.setBlock(x, y, z, Blocks.air); - } - if (blockAtHead == CinderLoE.iceCage) { - this.worldObj.setBlock(x, y, z, Blocks.air); - } - bound = false;*/ - } - - @Override - public void onUpdate() { - super.onUpdate(); - checkInsideIceCage(); - } - - public void checkInsideIceCage() { -/* int x = MathHelper.floor_double(this.posX); - int y = MathHelper.floor_double(this.posY); - int z = MathHelper.floor_double(this.posZ); - - - Block blockAtFeet = this.worldObj.getBlock(x, y, z); - Block blockAtHead = this.worldObj.getBlock(x, y + 1, z); - - if (blockAtFeet == CinderLoE.iceCage || blockAtHead == CinderLoE.iceCage) { - onBoundUpdate(x, y, z); - Utilities.setInvulnerable((Entity)this, true); -// System.out.println("Nex Miniboss vulnerable: " + this.isEntityInvulnerable()); - } else { - onUnboundUpdate(); - Utilities.setInvulnerable((Entity)this, false); -// System.out.println("Nex Miniboss vulnerable: " + this.isEntityInvulnerable()); - }*/ - } - - public abstract void onBoundUpdate(int x, int y, int z); - public abstract void onUnboundUpdate(); - public abstract void setupEquipment(); -} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/NexShadow.java b/src/main/java/com/zivilon/cinder_loe/entity/NexShadow.java deleted file mode 100644 index ae4f7fe..0000000 --- a/src/main/java/com/zivilon/cinder_loe/entity/NexShadow.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.zivilon.cinder_loe.entity; - -import com.zivilon.cinder_loe.CinderLoE; -import com.zivilon.cinder_loe.util.Utilities; - -import lotr.common.LOTRMod; -import lotr.common.enchant.LOTREnchantmentHelper; -import lotr.common.enchant.LOTREnchantment; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; - -import java.util.List; - -public class NexShadow extends NexMiniboss { - public String entity_name = "§7Fuinë"; - - public NexShadow(World world) { - super(world); - } - - @Override - public void setupEquipment() {/* - ItemStack weapon = new ItemStack(LOTRMod.swordUtumno, 0); - ItemStack boots = new ItemStack(CinderLoE.bootsNexShadow, 0); - ItemStack legs = new ItemStack(CinderLoE.legsNexShadow, 0); - ItemStack body = new ItemStack(CinderLoE.bodyNexShadow, 0); - ItemStack helmet = new ItemStack(CinderLoE.helmetNexShadow, 0); - Utilities.setAppliedRandomEnchants(weapon); - Utilities.setLOTREnchant(weapon, LOTREnchantment.strong4); - Utilities.setLOTREnchant(weapon, LOTREnchantment.strong4); - Utilities.setLOTREnchant(weapon, LOTREnchantment.strong4); - Utilities.setLOTREnchant(weapon, LOTREnchantment.strong1); - Utilities.setLOTREnchant(weapon, LOTREnchantment.meleeReach1); - Utilities.setLOTREnchant(weapon, LOTREnchantment.meleeSpeed1); - - this.npcItemsInv.setIdleItem(weapon); - this.npcItemsInv.setMeleeWeapon(weapon); - setCurrentItemOrArmor(0, weapon); - setCurrentItemOrArmor(1, boots); - setCurrentItemOrArmor(2, legs); - setCurrentItemOrArmor(3, body); - setCurrentItemOrArmor(4, helmet);*/ - } - - @Override - public String getNPCName() { - return entity_name; - } - @Override - public String getNPCFormattedName(String npcName, String entityName) { - return entity_name; - } - - @Override - public String getSpeechBank(EntityPlayer entityplayer) { - return "nex/shadow"; - } - - @Override - public void onBoundUpdate(int x, int y, int z) { - this.motionX = 0; - this.motionY = 0; - this.motionZ = 0; - this.setPosition(x + 0.5, y, z + 0.5); - } - - @Override - public void onUnboundUpdate() { - List players = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, this.boundingBox.expand(100.0D, 100.0D, 100.0D)); - - for (EntityPlayer player : players) { - int playerLightLevel = this.worldObj.getBlockLightValue(MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ)); - double playerDistanceY = player.posY - this.posY; - - if (playerLightLevel < 4 && Math.abs(playerDistanceY) <= 4.0D) { - player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100)); // 5 seconds of blindness - } - } - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/NexToxin.java b/src/main/java/com/zivilon/cinder_loe/entity/NexToxin.java deleted file mode 100644 index acc66cf..0000000 --- a/src/main/java/com/zivilon/cinder_loe/entity/NexToxin.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.zivilon.cinder_loe.entity; - -import com.zivilon.cinder_loe.CinderLoE; -import com.zivilon.cinder_loe.util.Utilities; - -import lotr.common.LOTRMod; -import lotr.common.enchant.LOTREnchantmentHelper; -import lotr.common.enchant.LOTREnchantment; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -public class NexToxin extends NexMiniboss { - public String entity_name = "§2Hloirë"; - - public NexToxin(World world) { - super(world); - } - - @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(200.0D); - getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); - } - - @Override - public void setupEquipment() { -/* ItemStack weapon = new ItemStack(LOTRMod.daggerUtumnoPoisoned, 0); - ItemStack boots = new ItemStack(CinderLoE.bootsNexToxin, 0); - ItemStack legs = new ItemStack(CinderLoE.legsNexToxin, 0); - ItemStack body = new ItemStack(CinderLoE.bodyNexToxin, 0); - ItemStack helmet = new ItemStack(CinderLoE.helmetNexToxin, 0); - Utilities.setAppliedRandomEnchants(weapon); - Utilities.setLOTREnchant(weapon, LOTREnchantment.strong4); - Utilities.setLOTREnchant(weapon, LOTREnchantment.strong4); - Utilities.setLOTREnchant(weapon, LOTREnchantment.strong4); - Utilities.setLOTREnchant(weapon, LOTREnchantment.strong1); - Utilities.setLOTREnchant(weapon, LOTREnchantment.meleeReach1); - Utilities.setLOTREnchant(weapon, LOTREnchantment.meleeSpeed1); - - this.npcItemsInv.setIdleItem(weapon); - this.npcItemsInv.setMeleeWeapon(weapon); - setCurrentItemOrArmor(0, weapon); - setCurrentItemOrArmor(1, boots); - setCurrentItemOrArmor(2, legs); - setCurrentItemOrArmor(3, body); - setCurrentItemOrArmor(4, helmet);*/ - } - - @Override - public String getNPCName() { - return entity_name; - } - @Override - public String getNPCFormattedName(String npcName, String entityName) { - return entity_name; - } - - @Override - public String getSpeechBank(EntityPlayer entityplayer) { - return "nex/toxin"; - } - - @Override - public void onBoundUpdate(int x, int y, int z) { - } - - @Override - public void onUnboundUpdate() { - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/effect/NimveilLightningBolt.java b/src/main/java/com/zivilon/cinder_loe/entity/effect/NimveilLightningBolt.java deleted file mode 100644 index a716f48..0000000 --- a/src/main/java/com/zivilon/cinder_loe/entity/effect/NimveilLightningBolt.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.zivilon.cinder_loe.entity.effect; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.effect.EntityWeatherEffect; -import net.minecraft.entity.passive.EntityPig; -import net.minecraft.entity.monster.EntityCreeper; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; - -import java.util.List; - -public class NimveilLightningBolt extends EntityWeatherEffect { - /** Declares which state the lightning bolt is in. Whether it's in the air, hit the ground, etc. */ - public int lightningState; - /** A random long that is used to change the vertex of the lightning rendered in RenderLightningBolt */ - public long boltVertex; - /** Determines the time before the NimveilLightningBolt is destroyed. It is a random integer decremented over time. */ - public int boltLivingTime; - - public NimveilLightningBolt(World world, double x, double y, double z) { - super(world); - this.setLocationAndAngles(x, y, z, 0.0F, 0.0F); - this.lightningState = 2; - this.boltVertex = this.rand.nextLong(); - this.boltLivingTime = this.rand.nextInt(3) + 1; - } - public NimveilLightningBolt(World world) { - this(world, 0, 0, 0);// Summon line of custom lightning bolts - // Must not place fire or affect any non-EntityLivingBase targets - // Probably the most work of all of these - } - - /** - * Called to update the entity's position/logic. - */ - public void onUpdate() { - super.onUpdate(); - - if (this.lightningState == 2) { - this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "ambient.weather.thunder", 10000.0F, 0.8F + this.rand.nextFloat() * 0.2F); - this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 2.0F, 0.5F + this.rand.nextFloat() * 0.2F); - } - - --this.lightningState; - - if (this.lightningState < 0) { - if (this.boltLivingTime == 0) { - this.setDead(); - } else if (this.lightningState < -this.rand.nextInt(10)) { - --this.boltLivingTime; - this.lightningState = 1; - this.boltVertex = this.rand.nextLong(); - } - } - - if (this.lightningState >= 0) { - if (this.worldObj.isRemote) { - this.worldObj.lastLightningBolt = 2; - } else { - double d0 = 3.0D; - List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, AxisAlignedBB.getBoundingBox(this.posX - d0, this.posY - d0, this.posZ - d0, this.posX + d0, this.posY + 6.0D + d0, this.posZ + d0)); - list.removeIf(entity -> !(entity instanceof EntityLivingBase)); - list.removeIf(entity -> (entity instanceof EntityPig)); - list.removeIf(entity -> (entity instanceof EntityCreeper)); - - for (int l = 0; l < list.size(); ++l) { - Entity entity = (Entity)list.get(l); - if (entity.isImmuneToFire() == false) { - entity.attackEntityFrom(DamageSource.inFire, 20.0F); - entity.setFire(8); - } - System.out.println("Striking " + entity.getCommandSenderName()); - } - } - } - } - - public void entityInit() {} - public void readEntityFromNBT(NBTTagCompound p_70037_1_) {} - public void writeEntityToNBT(NBTTagCompound p_70014_1_) {} -} diff --git a/src/main/java/com/zivilon/cinder_loe/items/BlessedHammer.java b/src/main/java/com/zivilon/cinder_loe/items/BlessedHammer.java deleted file mode 100644 index a8e0ad1..0000000 --- a/src/main/java/com/zivilon/cinder_loe/items/BlessedHammer.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.zivilon.cinder_loe.items; - -import com.zivilon.cinder_loe.CinderLoE; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; - -import java.util.List; - -public class BlessedHammer extends LoEHammer { - public BlessedHammer() { - super(CinderLoE.MATERIAL_NIMVEIL, CinderLoE.enchantedIce); - this.setTextureName("lotr:blessed_hammer"); - } - - @Override - public String getUnlocalizedName(ItemStack item) { - return "item.blessed_hammer"; - } - - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean advanced) { - list.add(EnumChatFormatting.GRAY + "This blacksmith hammer is brimming with power"); - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/items/Celeiniss.java b/src/main/java/com/zivilon/cinder_loe/items/Celeiniss.java deleted file mode 100644 index 4205d76..0000000 --- a/src/main/java/com/zivilon/cinder_loe/items/Celeiniss.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.zivilon.cinder_loe.items; - -import com.zivilon.cinder_loe.CinderLoE; -import com.zivilon.cinder_loe.LoECreativeTabs; - -import lotr.common.item.LOTRItemPolearm; -import lotr.common.item.LOTRWeaponStats; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -public class Celeiniss extends LOTRItemPolearm { - public Celeiniss() { - super(CinderLoE.MATERIAL_NEX_ICE); - this.lotrWeaponDamage = 11.5F; - this.setUnlocalizedName("lotr:firstAgeGlaive"); - this.setTextureName("lotr:firstAgeGlaive"); - this.setCreativeTab(LoECreativeTabs.tabCombatLoE); - LOTRWeaponStats.registerMeleeReach(Celeiniss.class, 1.8F); - LOTRWeaponStats.registerMeleeSpeed(Celeiniss.class, 1.0F); - } - - public boolean getIsRepairable(ItemStack itemstack, ItemStack repairItem) { - return (repairItem.getItem() == Item.getItemFromBlock(CinderLoE.enchantedIce)); - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/items/CinderLoESpawnEgg.java b/src/main/java/com/zivilon/cinder_loe/items/CinderLoESpawnEgg.java index 8e031d4..9a63149 100644 --- a/src/main/java/com/zivilon/cinder_loe/items/CinderLoESpawnEgg.java +++ b/src/main/java/com/zivilon/cinder_loe/items/CinderLoESpawnEgg.java @@ -95,11 +95,6 @@ public class CinderLoESpawnEgg extends Item { ENTITY_CLASSES.add(CorruptHobbit.class); ENTITY_CLASSES.add(CorruptMan.class); ENTITY_CLASSES.add(CorruptOrc.class); - ENTITY_CLASSES.add(NexShadow.class); - ENTITY_CLASSES.add(NexIce.class); - ENTITY_CLASSES.add(NexFire.class); - ENTITY_CLASSES.add(NexToxin.class); - ENTITY_CLASSES.add(Nex.class); ENTITY_CLASSES.add(HobbitBannerBearer.class); } diff --git a/src/main/java/com/zivilon/cinder_loe/items/IceThawer.java b/src/main/java/com/zivilon/cinder_loe/items/IceThawer.java deleted file mode 100644 index 0cf0b9a..0000000 --- a/src/main/java/com/zivilon/cinder_loe/items/IceThawer.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.zivilon.cinder_loe.items; - -import com.zivilon.cinder_loe.LoECreativeTabs; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.entity.player.EntityPlayer; - -import java.util.List; - -public class IceThawer extends Item { - - public IceThawer() { - this.setUnlocalizedName("ice_thawer"); - this.setTextureName("lotr:ice_thawer"); - setCreativeTab(LoECreativeTabs.tabMiscLoE); - } - - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean advanced) { - list.add(EnumChatFormatting.DARK_PURPLE + "You feel like if you held this"); - list.add(EnumChatFormatting.DARK_PURPLE + "against a frozen body, it might melt."); - list.add(EnumChatFormatting.DARK_PURPLE + "But why would you need such thing?"); - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/items/Nimveil.java b/src/main/java/com/zivilon/cinder_loe/items/Nimveil.java deleted file mode 100644 index 654f408..0000000 --- a/src/main/java/com/zivilon/cinder_loe/items/Nimveil.java +++ /dev/null @@ -1,458 +0,0 @@ -package com.zivilon.cinder_loe.items; - -import com.zivilon.cinder_loe.CinderLoE; -import com.zivilon.cinder_loe.LoECreativeTabs; -import com.zivilon.cinder_loe.entity.effect.NimveilLightningBolt; -import com.zivilon.cinder_loe.potion.LoEPotions; -import com.zivilon.cinder_loe.util.Utilities; - -import lotr.common.LOTRLevelData; -import lotr.common.entity.npc.LOTREntityNPC; -import lotr.common.fac.LOTRFaction; -import lotr.common.item.LOTRItemSword; -import lotr.common.item.LOTRMaterial; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumAction; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; - -import java.util.List; - -public class Nimveil extends LOTRItemSword { - public static String NBT_STATE = "NimveilState"; - public static String NBT_VARIANT = "NimveilVariant"; - public static String NBT_TICK = "Tick"; - public IIcon[] icons; - - public Nimveil() { - super(CinderLoE.MATERIAL_NIMVEIL); - this.setHasSubtypes(true); - this.canRepair = false; - this.setMaxDamage(300); - setCreativeTab(LoECreativeTabs.tabCombatLoE); - } - - public boolean getIsRepairable(ItemStack nimveil, ItemStack repair_material) { - if (repair_material.getItem() == Item.getItemFromBlock(CinderLoE.enchantedIce)) - return true; - return false; - } - - @Override - public boolean showDurabilityBar(ItemStack stack) { - return true; // Always show the durability bar - } - - @Override - public double getDurabilityForDisplay(ItemStack stack) { - int state = get_state(stack); - - // No charges found, show recharge meter - if (state == 0) { - double damage = ((double) stack.getItemDamage() / (double) stack.getMaxDamage()); - return damage; - } - - // The only variant where state is > 1 is "ancient". So we skip an NBT read here. - if (state > 1) { - double ancient_charges = 1.0D - (10.0D - (double)state) / 10.0D; - return 1.0D - ancient_charges; - } - - // If variant is not "ancient", then it can't have more than 1 charge. We already checked that there is charge, so it's at max - String variant = get_variant(stack); - if (!variant.equals("ancient")) - return 0.0D; - - // If variant is "ancient" and state is 1, we know the bar is at 0.9. - return 0.9D; - } - - /** - * Nimveil state handling - */ - public static byte get_state(ItemStack stack) { - if (stack.hasTagCompound()) { - NBTTagCompound tag = stack.getTagCompound(); - return tag.getByte(NBT_STATE); - } - return 0; - } - public static void set_state(ItemStack stack, byte state) { - NBTTagCompound tag = stack.getTagCompound(); - if (tag == null) { - tag = new NBTTagCompound(); - stack.setTagCompound(tag); - } - tag.setByte(NBT_STATE, state); - } - public static boolean decrement_state(ItemStack stack) { - NBTTagCompound tag = stack.getTagCompound(); - if (tag == null) { - return false; - } - byte state = tag.getByte(NBT_STATE); - if (state > 0) { - if (state == 1) - stack.setItemDamage(300); - tag.setByte(NBT_STATE, --state); - return true; - } - return false; - } - public static int tick(ItemStack stack) { - NBTTagCompound tag = stack.getTagCompound(); - if (tag == null) { - tag = new NBTTagCompound(); - stack.setTagCompound(tag); - } - int tick = tag.getInteger(NBT_TICK); - if (tick >= 20) { - tick = 0; - } else { - tick++; - } - tag.setInteger(NBT_TICK, tick); - return tick; - } - - /** - * Methods to put all variants under one item type - */ - public IIcon getIconIndex(ItemStack stack) - { - int icon_index = 0; - if (get_state(stack) != 0) - icon_index += 5; - switch(get_variant(stack)) { - case "valar": - break; - case "mortals": - icon_index += 1; - break; - case "udun": - icon_index += 2; - break; - case "sauron": - icon_index += 3; - break; - case "ancient": - icon_index += 4; - break; - default: - break; - } - return icons[icon_index]; - } - @Override - public void registerIcons(IIconRegister iconRegister) { - this.icons = new IIcon[10]; - this.icons[0] = iconRegister.registerIcon("lotr:nimveil_valar"); - this.icons[1] = iconRegister.registerIcon("lotr:nimveil_mortals"); - this.icons[2] = iconRegister.registerIcon("lotr:nimveil_udun"); - this.icons[3] = iconRegister.registerIcon("lotr:nimveil_sauron"); - this.icons[4] = iconRegister.registerIcon("lotr:nimveil_ancient"); - this.icons[5] = iconRegister.registerIcon("lotr:nimveil_valar_glow"); - this.icons[6] = iconRegister.registerIcon("lotr:nimveil_mortals_glow"); - this.icons[7] = iconRegister.registerIcon("lotr:nimveil_udun_glow"); - this.icons[8] = iconRegister.registerIcon("lotr:nimveil_sauron_glow"); - this.icons[9] = iconRegister.registerIcon("lotr:nimveil_ancient_glow"); - } - - - - @Override - public String getUnlocalizedName(ItemStack item) { -// return "item.nimveil_" + get_variant(item); - return "lotr:nimveil"; - } - public static String get_variant(ItemStack stack) { - if (stack.hasTagCompound()) { - NBTTagCompound tag = stack.getTagCompound(); - return tag.getString(NBT_VARIANT); - } - return "invalid"; - } - public static ItemStack init_variant(ItemStack stack, String variant) { - NBTTagCompound tag = stack.getTagCompound(); - if (tag == null) { - tag = new NBTTagCompound(); - stack.setTagCompound(tag); - } - tag.setString(NBT_VARIANT, variant); - tag.setByte(NBT_STATE, (byte)0); - return stack; - } - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean advanced) { - switch(get_variant(stack)) { - case "valar": - list.add(EnumChatFormatting.AQUA + "Valar"); - list.add(""); - list.add(EnumChatFormatting.GOLD + "Special Attack:"); - list.add(EnumChatFormatting.YELLOW + " Cast a line of lightning strikes"); - return; - case "mortals": - list.add(EnumChatFormatting.DARK_GREEN + "Mortals"); - list.add(""); - list.add(EnumChatFormatting.GOLD + "Special Attack:"); - list.add(EnumChatFormatting.YELLOW + " Deal 25% of your missing health as damage"); - return; - case "udun": - list.add(EnumChatFormatting.DARK_RED + "Udûn"); - list.add(""); - list.add(EnumChatFormatting.GOLD + "Special Attack:"); - list.add(EnumChatFormatting.YELLOW + " +20% Attack Damage"); - list.add(EnumChatFormatting.YELLOW + " Reverse Knockback"); - return; - case "sauron": - list.add(EnumChatFormatting.DARK_PURPLE + "Sauron"); - list.add(EnumChatFormatting.GOLD + "Special Attack:"); - list.add(EnumChatFormatting.YELLOW + " Apply Corrupting effect for 60 seconds"); - list.add(EnumChatFormatting.YELLOW + " Causes all NPCs to be hostile"); - return; - case "ancient": - list.add(EnumChatFormatting.DARK_AQUA + "Ancient"); - list.add(EnumChatFormatting.GOLD + "Special Attack:"); - list.add(EnumChatFormatting.YELLOW + " For each outnumbering non-allied NPC nearby"); - list.add(EnumChatFormatting.YELLOW + " +5% damage vs NPCs"); - list.add(EnumChatFormatting.YELLOW + " +1.25% damage vs players"); - return; - default: - list.add(EnumChatFormatting.GRAY + "Invalid"); - return; - } - } - @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { - list.add(init_variant(new ItemStack(item, 1), "ancient")); - list.add(init_variant(new ItemStack(item, 1), "valar")); - list.add(init_variant(new ItemStack(item, 1), "mortals")); - list.add(init_variant(new ItemStack(item, 1), "udun")); - list.add(init_variant(new ItemStack(item, 1), "sauron")); - } - - /** - * Modify sword mechanics to those unique to Nimveil - */ - @Override - public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker) { - if (attacker.worldObj.isRemote) return false; - if (stack.getItemDamage() != 0) return false; - - if (decrement_state(stack)) { - special_damage(stack, target, attacker); - } - return false; - } - - @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { - if (world.isRemote) return stack; - if (stack.getItemDamage() != 0) return stack; - - byte state = get_state(stack); - if (state == 0) { - special_action(stack, world, player); - } - return stack; - } - - - /** - * Unused but here to remind they exist for later - */ - @Override - public EnumAction getItemUseAction(ItemStack p_77661_1_) { - return EnumAction.none; // might be modified later, it's here so I remember it exists, - } - - /** - * Recharging durability (special attack) bar - */ - @Override - public void onUpdate(ItemStack stack, World world, Entity entity, int itemSlot, boolean isSelected) { - super.onUpdate(stack, world, entity, itemSlot, isSelected); - - // Only run on the server-side to prevent conflicts with client-side rendering - if (!world.isRemote && get_state(stack) == 0) { - int tick = tick(stack); - if (tick == 20 && stack.getItemDamage() > 0) { - stack.setItemDamage(stack.getItemDamage() - 1); - } - } - } - - /** - * Generic redirects for Nimveil special actions - */ - public void special_action(ItemStack stack, World world, EntityPlayer player) { - String variant = get_variant(stack); - switch(variant) { - case "valar": - special_action_valar(stack, world, player); - return; - case "mortals": - special_action_mortals(stack, world, player); - return; - case "udun": - special_action_udun(stack, world, player); - return; - case "sauron": - special_action_sauron(stack, world, player); - return; - case "ancient": - special_action_ancient(stack, world, player); - return; - default: - return; - } - } - public void special_damage(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker) { - String variant = get_variant(stack); - switch(variant) { - case "mortals": - special_damage_mortals(stack, target, attacker); - return; - case "udun": - special_damage_udun(stack, target, attacker); - return; - case "sauron": - special_damage_sauron(stack, target, attacker); - return; - case "ancient": - special_damage_ancient(stack, target, attacker); - return; - case "valar": - special_damage_valar(stack, target, attacker); - return; - default: - return; - } - } - - /** - * Valar Nimveil special actions - */ - public void special_action_valar(ItemStack stack, World world, EntityPlayer player) { - // No charges because this triggers immediately. Set damage to max - stack.setItemDamage(stack.getMaxDamage()); - System.out.println("Triggering Valar action. Also max damage is " + stack.getMaxDamage()); - summon_lightning_line(world, player); - } - public void special_damage_valar(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker) { - // Do nothing, this method should never run but exists for consistency and extensibility - } - public void summon_lightning_line(World world, EntityPlayer player) { - // Get the player's facing direction - float yaw = player.rotationYaw; - - // Calculate the initial position, 4 blocks in front - double x = player.posX - Math.sin(Math.toRadians(yaw)) * 7; - double z = player.posZ + Math.cos(Math.toRadians(yaw)) * 7; - double y = player.posY; - - // Summon the first lightning bolt - world.spawnEntityInWorld(new NimveilLightningBolt(world, x, y, z)); - - // Summon 6 more lightning bolts, each 3 blocks apart - for (int i = 1; i < 7; i++) { - x -= Math.sin(Math.toRadians(yaw)) * 5; - z += Math.cos(Math.toRadians(yaw)) * 5; - world.spawnEntityInWorld(new NimveilLightningBolt(world, x, y, z)); - } - } - - /** - * Udûn Nimveil special actions - */ - public void special_action_udun(ItemStack stack, World world, EntityPlayer player) { - // Set 1 charge - set_state(stack, (byte)1); - } - public void special_damage_udun(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker) { - double damage = Utilities.calculate_melee_damage_on_entity(target, attacker); - target.attackEntityFrom(DamageSource.causeMobDamage(attacker), 0.2F * (float)damage); - Utilities.knockback(target, attacker, -3.0D); - target.worldObj.playSoundAtEntity(target, "lotr:item.maceSauron", 1.0F, 1.3F); - } - - /** - * Mortals Nimveil special actions - */ - public void special_action_mortals(ItemStack stack, World world, EntityPlayer player) { - // Set 1 charge - set_state(stack, (byte)1); - } - public void special_damage_mortals(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker) { - // Set 1 charge - float max_health = attacker.getMaxHealth(); - float current_health = attacker.getHealth(); - target.attackEntityFrom(DamageSource.causeMobDamage(attacker).setDamageBypassesArmor(), 0.25F * (max_health - current_health)); - } - - /** - * Sauron Nimveil special actions - */ - public void special_action_sauron(ItemStack stack, World world, EntityPlayer player) { - // Set 1 charge - set_state(stack, (byte)1); - } - public void special_damage_sauron(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker) { - // Check if the target is an instance of EntityPlayer - if (target instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer) target; - - // Apply the Corrupting potion effect - player.addPotionEffect(new PotionEffect(LoEPotions.corrupting.id, 1200, 0)); // 60 seconds duration (20 ticks per second) - } - } - - /** - * Ancient Nimveil special actions - */ - public void special_action_ancient(ItemStack stack, World world, EntityPlayer player) { - // Set 10 charges - this.set_state(stack, ((byte)10)); - } - public void special_damage_ancient(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker) { - if (!(attacker instanceof EntityPlayer)) return; - LOTRFaction pledged_faction = LOTRLevelData.getData(((EntityPlayer)attacker)).getPledgeFaction(); - if (pledged_faction == null) { - ((EntityPlayer)attacker).addChatMessage(new ChatComponentText("You need to be pledged to a faction to use this")); - return; - } - List entity_list = attacker.worldObj.getEntitiesWithinAABB(LOTREntityNPC.class, attacker.boundingBox.expand(100, 10, 100)); - int friendly_count = 0; - int total_count = entity_list.size(); - double damage = 0.0D; - for (LOTREntityNPC npc : entity_list) { - if (npc.getFaction().isGoodRelation(pledged_faction)) - friendly_count++; - } - int outnumber_count = Math.min(total_count - friendly_count * 2, 20); - if (outnumber_count > 0) - damage = Utilities.calculate_melee_damage_on_entity(target, attacker); - float final_damage = 0.0F; - if (!(target instanceof EntityPlayer)) { - final_damage = 0.05F * (float)outnumber_count * (float)damage; - target.attackEntityFrom(DamageSource.causeMobDamage(attacker), final_damage); - return; - } - final_damage = 0.0125F * ((float)outnumber_count) * ((float)damage); - target.attackEntityFrom(DamageSource.causeMobDamage(attacker), final_damage); - return; - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/items/NimveilPart.java b/src/main/java/com/zivilon/cinder_loe/items/NimveilPart.java deleted file mode 100644 index c902139..0000000 --- a/src/main/java/com/zivilon/cinder_loe/items/NimveilPart.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.zivilon.cinder_loe.items; - -import com.zivilon.cinder_loe.entity.projectile.EntityWarDart; -import com.zivilon.cinder_loe.LoECreativeTabs; - -import lotr.common.dispenser.LOTRDispenseThrowingAxe; -import lotr.common.enchant.LOTREnchantment; -import lotr.common.enchant.LOTREnchantmentHelper; -import lotr.common.entity.projectile.LOTREntityThrowingAxe; -import lotr.common.item.LOTRMaterial; -import lotr.common.recipe.LOTRRecipes; -import net.minecraft.block.BlockDispenser; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.enchantment.Enchantment; -import net.minecraft.enchantment.EnchantmentHelper; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureAttribute; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.util.IIcon; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.creativetab.CreativeTabs; -import java.util.List; - -public class NimveilPart extends Item { - public IIcon[] icons; - - public NimveilPart() { - this.setHasSubtypes(true); - setCreativeTab(LoECreativeTabs.tabMiscLoE); - } - - @Override - public IIcon getIconFromDamage(int damage) { - if (damage < 0 || damage >= icons.length) { - damage = 0; - } - return this.icons[damage]; - } - - @Override - public void registerIcons(IIconRegister iconRegister) { - this.icons = new IIcon[7]; - this.icons[0] = iconRegister.registerIcon("lotr:nimveil_hilt"); - this.icons[1] = iconRegister.registerIcon("lotr:nimveil_blade"); - this.icons[2] = iconRegister.registerIcon("lotr:nimveil_gem_valar"); - this.icons[3] = iconRegister.registerIcon("lotr:nimveil_gem_mortals"); - this.icons[4] = iconRegister.registerIcon("lotr:nimveil_gem_udun"); - this.icons[5] = iconRegister.registerIcon("lotr:nimveil_gem_sauron"); - this.icons[6] = iconRegister.registerIcon("lotr:nimveil_gem_ancient"); - } - - public static String get_part_type(ItemStack item) { - switch(item.getItemDamage()) { - case 0: - return "hilt"; - case 1: - return "blade"; - case 2: - case 3: - case 4: - case 5: - case 6: - return "gem"; - default: - return "hilt"; - } - } - - public static String get_gem_type(ItemStack item) { - switch(item.getItemDamage()) { - case 0: - case 1: - return "invalid"; - case 2: - return "valar"; - case 3: - return "mortals"; - case 4: - return "udun"; - case 5: - return "sauron"; - case 6: - return "ancient"; - default: - return "invalid"; - } - } - - @Override - public String getUnlocalizedName(ItemStack item) { - return "item.nimveil_" + get_part_type(item); - } - - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean advanced) { - switch(get_gem_type(stack)) { - case "valar": - list.add(EnumChatFormatting.AQUA + "Valar"); - return; - case "mortals": - list.add(EnumChatFormatting.DARK_GREEN + "Mortals"); - return; - case "udun": - list.add(EnumChatFormatting.DARK_RED + "Udûn"); - return; - case "sauron": - list.add(EnumChatFormatting.DARK_PURPLE + "Sauron"); - return; - case "ancient": - list.add(EnumChatFormatting.DARK_AQUA + "Ancient"); - return; - default: - return; - } - } - - @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { - for (int i = 0; i < icons.length; i++) { - list.add(new ItemStack(item, 1, i)); - } - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/items/ToxicCore.java b/src/main/java/com/zivilon/cinder_loe/items/ToxicCore.java deleted file mode 100644 index 8c5df91..0000000 --- a/src/main/java/com/zivilon/cinder_loe/items/ToxicCore.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.zivilon.cinder_loe.items; - -import com.zivilon.cinder_loe.LoECreativeTabs; - -import net.minecraft.item.Item; - -public class ToxicCore extends Item { - - public ToxicCore() { - this.setUnlocalizedName("lotr:toxicCore"); - this.setTextureName("lotr:toxic_core"); - setCreativeTab(LoECreativeTabs.tabMiscLoE); - this.setMaxDamage(10000); - this.setNoRepair(); - this.setMaxStackSize(1); - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/items/WeaponPart.java b/src/main/java/com/zivilon/cinder_loe/items/WeaponPart.java deleted file mode 100644 index d047f44..0000000 --- a/src/main/java/com/zivilon/cinder_loe/items/WeaponPart.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.zivilon.cinder_loe.items; - -import com.zivilon.cinder_loe.entity.projectile.EntityWarDart; -import com.zivilon.cinder_loe.LoECreativeTabs; - -import lotr.common.dispenser.LOTRDispenseThrowingAxe; -import lotr.common.enchant.LOTREnchantment; -import lotr.common.enchant.LOTREnchantmentHelper; -import lotr.common.entity.projectile.LOTREntityThrowingAxe; -import lotr.common.item.LOTRMaterial; -import lotr.common.recipe.LOTRRecipes; -import net.minecraft.block.BlockDispenser; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.enchantment.Enchantment; -import net.minecraft.enchantment.EnchantmentHelper; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureAttribute; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.util.IIcon; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.creativetab.CreativeTabs; -import java.util.List; - -public class WeaponPart extends Item { - public IIcon[] icons; - - public WeaponPart() { - this.setHasSubtypes(true); - setCreativeTab(LoECreativeTabs.tabMiscLoE); - } - - @Override - public IIcon getIconFromDamage(int damage) { - if (damage < 0 || damage >= icons.length) { - damage = 0; - } - return this.icons[damage]; - } - - @Override - public void registerIcons(IIconRegister iconRegister) { - this.icons = new IIcon[12]; - this.icons[0] = iconRegister.registerIcon("lotr:deceiver_blade_blade"); - this.icons[1] = iconRegister.registerIcon("lotr:deceiver_blade_guard"); - this.icons[2] = iconRegister.registerIcon("lotr:deceiver_blade_hilt"); - this.icons[3] = iconRegister.registerIcon("lotr:anarore_bow_top"); - this.icons[4] = iconRegister.registerIcon("lotr:anarore_bow_bottom"); - this.icons[5] = iconRegister.registerIcon("lotr:anarore_bow_bowstring"); - this.icons[6] = iconRegister.registerIcon("lotr:chieftain_club_???"); - this.icons[7] = iconRegister.registerIcon("lotr:chieftain_club_???"); - this.icons[8] = iconRegister.registerIcon("lotr:chieftain_club_???"); - this.icons[9] = iconRegister.registerIcon("lotr:glaechir_spear_tip"); - this.icons[10] = iconRegister.registerIcon("lotr:glaechir_spear_shaft"); - this.icons[11] = iconRegister.registerIcon("lotr:glaechir_spear_???"); - } - - public static String get_part(ItemStack item) { - switch(item.getItemDamage()) { - case 0: - return "blade"; - case 1: - return "guard"; - case 2: - return "hilt"; - case 3: - return "top"; - case 4: - return "bottom"; - case 5: - return "bowstring"; - case 6: - return "club"; - case 7: - return "spikes"; - case 8: - return "???"; - case 9: - return "tip"; - case 10: - return "shaft"; - case 11: - return "???"; - default: - return "invalid"; - } - } - - public static String get_weapon(ItemStack item) { - switch(item.getItemDamage()) { - case 0: - case 1: - case 2: - return "deceiver_blade"; - case 3: - case 4: - case 5: - return "anarore_bow"; - case 6: - case 7: - case 8: - return "troll_chieftain_club"; - case 9: - case 10: - case 11: - return "glaechir_spear"; - default: - return "invalid"; - } - } - - @Override - public String getUnlocalizedName(ItemStack item) { - return "item." + get_weapon(item) + "_" + get_part(item); - } - - @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { - for (int i = 0; i < icons.length; i++) { - list.add(new ItemStack(item, 1, i)); - } - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinEntityLivingBase.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinEntityLivingBase.java deleted file mode 100644 index e42071a..0000000 --- a/src/main/java/com/zivilon/cinder_loe/mixins/MixinEntityLivingBase.java +++ /dev/null @@ -1,204 +0,0 @@ -package com.zivilon.cinder_loe.mixins; - -import com.zivilon.cinder_loe.entity.Nex; -import com.zivilon.cinder_loe.entity.NexMiniboss; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.Overwrite; - -import net.minecraft.potion.Potion; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; -import net.minecraft.entity.effect.EntityLightningBolt; - -import net.minecraftforge.common.ForgeHooks; - -import java.util.List; - -@Mixin(EntityLivingBase.class) -public abstract class MixinEntityLivingBase extends Entity { - @Shadow - protected int entityAge; - @Shadow - public int maxHurtTime; - @Shadow - public float attackedAtYaw; - @Shadow - protected EntityPlayer attackingPlayer; - @Shadow - protected int recentlyHit; - @Shadow - public int hurtTime; - @Shadow - public float prevHealth; - @Shadow - protected float lastDamage; - @Shadow - public int maxHurtResistantTime; - @Shadow - public float limbSwingAmount; - - @Shadow - protected abstract float getSoundPitch(); - @Shadow - protected abstract float getSoundVolume(); - @Shadow - protected abstract String getHurtSound(); - @Shadow - public abstract void onDeath(DamageSource p_70645_1_); - @Shadow - protected abstract String getDeathSound(); - @Shadow - public abstract float getHealth(); - @Shadow - public abstract void knockBack(Entity p_70653_1_, float p_70653_2_, double p_70653_3_, double p_70653_5_); - @Shadow - public abstract void setRevengeTarget(EntityLivingBase p_70604_1_); - @Shadow - protected abstract void damageEntity(DamageSource p_70665_1_, float p_70665_2_); - @Shadow - public abstract ItemStack getEquipmentInSlot(int p_71124_1_); - @Shadow - public abstract boolean isPotionActive(int p_82165_1_); - @Shadow - public abstract boolean isPotionActive(Potion p_70644_1_); - - public MixinEntityLivingBase(World world) { - super(world); - } - - /** - * @author Shinare - * @reason Adding Nex fire damage modifiers - */ - @Overwrite - public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { - if (ForgeHooks.onLivingAttack((EntityLivingBase)(Object)this, p_70097_1_, p_70097_2_)) return false; - if (this.isEntityInvulnerable()) { - return false; - } else if (this.worldObj.isRemote) { - return false; - } else { - this.entityAge = 0; - - if (this.getHealth() <= 0.0F) { - return false; - } else if (p_70097_1_.isFireDamage() && this.isPotionActive(Potion.fireResistance)) { - return false; - } -/* } else if (p_70097_1_.isFireDamage()) { - if ((EntityLivingBase)(Object)this instanceof Nex || (EntityLivingBase)(Object)this instanceof NexMiniboss) return false; - boolean fire_phase = Nex.is_nex_fire_phase_nearby((EntityLivingBase)(Object)this); - if (this.isPotionActive(Potion.fireResistance)) { - if (!fire_phase) return false; - p_70097_2_ *= 0.5F; - } - if (fire_phase) { - p_70097_2_ *= 3.0F; - List list = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, this.boundingBox.expand(5, 5, 5)); - for (EntityLivingBase entity : list) { - if (!(entity instanceof Nex || entity instanceof NexMiniboss)) { - entity.setFire(10); - } - } - } - }*/ - if ((p_70097_1_ == DamageSource.anvil || p_70097_1_ == DamageSource.fallingBlock) && this.getEquipmentInSlot(4) != null) { - this.getEquipmentInSlot(4).damageItem((int)(p_70097_2_ * 4.0F + this.rand.nextFloat() * p_70097_2_ * 2.0F), (EntityLivingBase)(Object)this); - p_70097_2_ *= 0.75F; - } - - this.limbSwingAmount = 1.5F; - boolean flag = true; - - if ((float)this.hurtResistantTime > (float)this.maxHurtResistantTime / 2.0F) { - if (p_70097_2_ <= this.lastDamage) { - return false; - } - - this.damageEntity(p_70097_1_, p_70097_2_ - this.lastDamage); - this.lastDamage = p_70097_2_; - flag = false; - } else { - this.lastDamage = p_70097_2_; - this.prevHealth = this.getHealth(); - this.hurtResistantTime = this.maxHurtResistantTime; - this.damageEntity(p_70097_1_, p_70097_2_); - this.hurtTime = this.maxHurtTime = 10; - } - - this.attackedAtYaw = 0.0F; - Entity entity = p_70097_1_.getEntity(); - - if (entity != null) { - if (entity instanceof EntityLivingBase) { - this.setRevengeTarget((EntityLivingBase)entity); - } - - if (entity instanceof EntityPlayer) { - this.recentlyHit = 100; - this.attackingPlayer = (EntityPlayer)entity; - } else if (entity instanceof net.minecraft.entity.passive.EntityTameable) { - net.minecraft.entity.passive.EntityTameable entitywolf = (net.minecraft.entity.passive.EntityTameable)entity; - - if (entitywolf.isTamed()) { - this.recentlyHit = 100; - this.attackingPlayer = null; - } - } - } - - if (flag) { - this.worldObj.setEntityState(this, (byte)2); - - if (p_70097_1_ != DamageSource.drown) { - this.setBeenAttacked(); - } - - if (entity != null) { - double d1 = entity.posX - this.posX; - double d0; - - for (d0 = entity.posZ - this.posZ; d1 * d1 + d0 * d0 < 1.0E-4D; d0 = (Math.random() - Math.random()) * 0.01D) { - d1 = (Math.random() - Math.random()) * 0.01D; - } - - this.attackedAtYaw = (float)(Math.atan2(d0, d1) * 180.0D / Math.PI) - this.rotationYaw; - this.knockBack(entity, p_70097_2_, d1, d0); - } else { - this.attackedAtYaw = (float)((int)(Math.random() * 2.0D) * 180); - } - } - - String s; - - if (this.getHealth() <= 0.0F) { - s = this.getDeathSound(); - - if (flag && s != null) { - this.playSound(s, this.getSoundVolume(), this.getSoundPitch()); - } - - this.onDeath(p_70097_1_); - } else { - s = this.getHurtSound(); - - if (flag && s != null) { - this.playSound(s, this.getSoundVolume(), this.getSoundPitch()); - } - } - - return true; - } - } - - public void onStruckByLightning(EntityLightningBolt lightning) { - super.onStruckByLightning(lightning); - System.out.println(this.getCommandSenderName() + " was struck by lightning!"); - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinItemRenderer.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinItemRenderer.java index 741a262..b44dd96 100644 --- a/src/main/java/com/zivilon/cinder_loe/mixins/MixinItemRenderer.java +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinItemRenderer.java @@ -281,20 +281,4 @@ public abstract class MixinItemRenderer { // Redirect to new custom renderer. This should not be necessary but works as failsafe RenderHelper.customRenderItemIn2D(p_78439_0_, p_78439_1_, p_78439_2_, p_78439_3_, p_78439_4_, p_78439_5_, p_78439_6_, p_78439_7_, false); } - - /** - * Making recharging Nimveil not be constantly in the item change animation - */ - @Inject(method = "renderItemInFirstPerson", at = @At("HEAD"), cancellable = true) - public void inject(float f, CallbackInfo ci) { - if (itemToRender != null && itemToRender.getItem() == CinderLoE.nimveil) { - EntityClientPlayerMP entityclientplayermp = this.mc.thePlayer; - ItemStack itemstack = entityclientplayermp.inventory.getCurrentItem(); - equippedProgress = 1.0F; - prevEquippedProgress = 1.0F; - itemToRender = itemstack; - } - } - - } diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRItemRendererManager.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRItemRendererManager.java deleted file mode 100644 index c9d1d5f..0000000 --- a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRItemRendererManager.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.zivilon.cinder_loe.mixins; - -import com.zivilon.cinder_loe.client.render.item.RenderHelper; -import com.zivilon.cinder_loe.items.Nimveil; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.Overwrite; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Redirect; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import lotr.client.render.item.LOTRRenderLargeItem; -import lotr.client.LOTRItemRendererManager; - -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.StringUtils; - -import net.minecraftforge.client.IItemRenderer; - -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import lotr.client.render.item.LOTRRenderBannerItem; -import lotr.client.render.item.LOTRRenderBlownItem; -import lotr.client.render.item.LOTRRenderBow; -import lotr.client.render.item.LOTRRenderCrossbow; -import lotr.client.render.item.LOTRRenderElvenBlade; -import lotr.client.render.item.LOTRRenderInvTableCommand; -import lotr.client.render.item.LOTRRenderLargeItem; -import lotr.client.render.item.LOTRRenderSkullStaff; -import lotr.client.render.tileentity.LOTRRenderAnimalJar; -import lotr.common.LOTRMod; -import lotr.common.item.LOTRItemSword; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.client.resources.IReloadableResourceManager; -import net.minecraft.client.resources.IResourceManager; -import net.minecraft.client.resources.IResourceManagerReloadListener; -import net.minecraft.item.Item; -import net.minecraftforge.client.IItemRenderer; -import net.minecraftforge.client.MinecraftForgeClient; -import net.minecraftforge.client.event.TextureStitchEvent; -import net.minecraftforge.common.MinecraftForge; - -@Mixin(LOTRItemRendererManager.class) -public abstract class MixinLOTRItemRendererManager { - @Shadow(remap = false) - private static List largeItemRenderers; - - /** - * @author Shinare - * @reason testing - */ - @Overwrite(remap = false) - public void func_110549_a(IResourceManager resourceManager) { - largeItemRenderers.clear(); - try { - for (Field field : LOTRMod.class.getFields()) { - if (field.get(null) instanceof Item) { - Item item = (Item)field.get(null); - if (item instanceof Nimveil) System.out.println("Processing Nimveil!"); - MinecraftForgeClient.registerItemRenderer(item, null); - LOTRRenderLargeItem largeItemRenderer = LOTRRenderLargeItem.getRendererIfLarge(item); - boolean isLarge = (largeItemRenderer != null); - if (item instanceof lotr.common.item.LOTRItemCrossbow) { - MinecraftForgeClient.registerItemRenderer(item, (IItemRenderer)new LOTRRenderCrossbow()); - } else if (item instanceof lotr.common.item.LOTRItemBow) { - MinecraftForgeClient.registerItemRenderer(item, (IItemRenderer)new LOTRRenderBow(largeItemRenderer)); - } else if (item instanceof LOTRItemSword && ((LOTRItemSword)item).isElvenBlade()) { - double d = 24.0D; - if (item == LOTRMod.sting) - d = 40.0D; - MinecraftForgeClient.registerItemRenderer(item, (IItemRenderer)new LOTRRenderElvenBlade(d, largeItemRenderer)); - } else if (isLarge) { - if (item instanceof Nimveil) System.out.println("Nimveil is large!"); - MinecraftForgeClient.registerItemRenderer(item, (IItemRenderer)largeItemRenderer); - } - if (largeItemRenderer != null) { - if (item instanceof Nimveil) System.out.println("Adding Nimveil large renderer!"); - largeItemRenderers.add(largeItemRenderer); - } - if (item instanceof Nimveil) System.out.println("Nimveil processing ending!"); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(LOTRMod.commandTable), (IItemRenderer)new LOTRRenderInvTableCommand()); - MinecraftForgeClient.registerItemRenderer(LOTRMod.hobbitPipe, (IItemRenderer)new LOTRRenderBlownItem()); - MinecraftForgeClient.registerItemRenderer(LOTRMod.commandHorn, (IItemRenderer)new LOTRRenderBlownItem()); - MinecraftForgeClient.registerItemRenderer(LOTRMod.conquestHorn, (IItemRenderer)new LOTRRenderBlownItem()); - MinecraftForgeClient.registerItemRenderer(LOTRMod.banner, (IItemRenderer)new LOTRRenderBannerItem()); - MinecraftForgeClient.registerItemRenderer(LOTRMod.orcSkullStaff, (IItemRenderer)new LOTRRenderSkullStaff()); - Iterator itItems = Item.itemRegistry.iterator(); - while (itItems.hasNext()) { - Item item = itItems.next(); - if (item instanceof lotr.common.item.LOTRItemAnimalJar) - MinecraftForgeClient.registerItemRenderer(item, (IItemRenderer)new LOTRRenderAnimalJar()); - } - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderLargeItem.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderLargeItem.java index 8c3a220..e7d994e 100644 --- a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderLargeItem.java +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderLargeItem.java @@ -1,7 +1,6 @@ package com.zivilon.cinder_loe.mixins; import com.zivilon.cinder_loe.client.render.item.RenderHelper; -import com.zivilon.cinder_loe.items.Nimveil; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -31,21 +30,6 @@ import java.util.Map; @Mixin(LOTRRenderLargeItem.class) public abstract class MixinLOTRRenderLargeItem { - private static IIcon[] nimveil_icons; - - @Shadow(remap = false) - private Item theItem; - @Shadow(remap = false) - private IIcon largeIcon; - @Shadow(remap = false) - private String folderName; - @Shadow(remap = false) - private static Map sizeFolders; - - @Shadow(remap = false) - private static ResourceLocation getLargeTexturePath(Item item, String folder) { - return null; - }; /** * @author Shinare @@ -57,144 +41,4 @@ public abstract class MixinLOTRRenderLargeItem { private void onRenderItemIn2D(Tessellator tessellator, float f1, float f2, float f, float f3, int width, int height, float thickness) { RenderHelper.customRenderItemIn2D(tessellator, f1, f2, f, f3, width, height, thickness, false); } -/* - @Inject(method = "registerLargeIcon", at = @At("HEAD"), cancellable = true, remap = false) - public void temp(IIconRegister register, String extra, CallbackInfoReturnable ci) { - System.out.println("Registering icon with folder " + this.folderName); - }*/ - - /** - * @author Shinare - * @reason Added support for NBT based subtyping for Nimveil - */ - @Overwrite(remap = false) - private IIcon registerLargeIcon(IIconRegister register, String extra) { - String prefix = "lotr:"; - if (this.theItem instanceof Nimveil) { - String itemName = "lotr:nimveil"; - itemName = itemName.substring(itemName.indexOf(prefix) + prefix.length()); - String path = prefix + this.folderName + "/" + itemName; - nimveil_icons = new IIcon[10]; - nimveil_icons[0] = register.registerIcon(path + "_valar"); - nimveil_icons[1] = register.registerIcon(path + "_mortals"); - nimveil_icons[2] = register.registerIcon(path + "_udun"); - nimveil_icons[3] = register.registerIcon(path + "_sauron"); - nimveil_icons[4] = register.registerIcon(path + "_ancient"); - nimveil_icons[5] = register.registerIcon(path + "_valar_glow"); - nimveil_icons[6] = register.registerIcon(path + "_mortals_glow"); - nimveil_icons[7] = register.registerIcon(path + "_udun_glow"); - nimveil_icons[8] = register.registerIcon(path + "_sauron_glow"); - nimveil_icons[9] = register.registerIcon(path + "_ancient_glow"); - System.out.println("Registering large icon for " + this.theItem.getClass().getSimpleName() + " at " + path); - return nimveil_icons[0]; - } else { - String itemName = this.theItem.getUnlocalizedName(); - itemName = itemName.substring(itemName.indexOf(prefix) + prefix.length()); - String path = prefix + this.folderName + "/" + itemName; - if (!StringUtils.isNullOrEmpty(extra)) - path = path + "_" + extra; - System.out.println("Registering large icon for " + this.theItem.getClass().getSimpleName() + " at " + path); - return register.registerIcon(path); - } - } - - /** - * @author Shinare - * @reason Added support for NBT based subtyping for Nimveil - */ - @Overwrite(remap = false) - public static LOTRRenderLargeItem getRendererIfLarge(Item item) { - if (item instanceof Nimveil) - return new LOTRRenderLargeItem(item, "large", 2.0F); - for (String folder : sizeFolders.keySet()) { - float iconScale = ((Float)sizeFolders.get(folder)).floatValue(); - try { - ResourceLocation resLoc = getLargeTexturePath(item, folder); - IResource res = Minecraft.getMinecraft().getResourceManager().getResource(resLoc); - if (res != null) - return new LOTRRenderLargeItem(item, folder, iconScale); - } catch (IOException iOException) {} - } - return null; - } - - - /** - * @author Shinare - * @reason Added support for NBT based subtyping for Nimveil - */ - @Inject(method = "renderItem", - at = @At(value = "HEAD"), - cancellable = true, remap = false) - public void getNimveilIcon(IItemRenderer.ItemRenderType type, ItemStack itemstack, Object[] data, CallbackInfo ci) { - if (itemstack.getItem() instanceof Nimveil) { - int icon_index = 0; - if (Nimveil.get_state(itemstack) != 0) - icon_index += 5; - switch(Nimveil.get_variant(itemstack)) { - case "valar": - break; - case "mortals": - icon_index += 1; - break; - case "udun": - icon_index += 2; - break; - case "sauron": - icon_index += 3; - break; - case "ancient": - icon_index += 4; - break; - default: - this.largeIcon = nimveil_icons[0]; - break; - } - this.largeIcon = nimveil_icons[icon_index]; - } - } } -/* - - public void renderItem(IItemRenderer.ItemRenderType type, ItemStack itemstack, Object... data) { - GL11.glPushMatrix(); - Entity holder = (Entity)data[1]; - boolean isFirstPerson = (holder == (Minecraft.getMinecraft()).thePlayer && (Minecraft.getMinecraft()).gameSettings.thirdPersonView == 0); - Item item = itemstack.getItem(); - if (item instanceof lotr.common.item.LOTRItemSpear && holder instanceof EntityPlayer && ((EntityPlayer)holder).getItemInUse() == itemstack) { - GL11.glRotatef(260.0F, 0.0F, 0.0F, 1.0F); - GL11.glTranslatef(-1.0F, 0.0F, 0.0F); - } - if (item instanceof lotr.common.item.LOTRItemPike && holder instanceof EntityLivingBase) { - EntityLivingBase entityliving = (EntityLivingBase)holder; - if (entityliving.getHeldItem() == itemstack && entityliving.swingProgress <= 0.0F) - if (entityliving.isSneaking()) { - if (isFirstPerson) { - GL11.glRotatef(270.0F, 0.0F, 0.0F, 1.0F); - GL11.glTranslatef(-1.0F, 0.0F, 0.0F); - } else { - GL11.glTranslatef(0.0F, -0.1F, 0.0F); - GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F); - } - } else if (!isFirstPerson) { - GL11.glTranslatef(0.0F, -0.3F, 0.0F); - GL11.glRotatef(40.0F, 0.0F, 0.0F, 1.0F); - } - } - if (item instanceof lotr.common.item.LOTRItemLance && holder instanceof EntityLivingBase) { - EntityLivingBase entityliving = (EntityLivingBase)holder; - if (entityliving.getHeldItem() == itemstack) - if (isFirstPerson) { - GL11.glRotatef(260.0F, 0.0F, 0.0F, 1.0F); - GL11.glTranslatef(-1.0F, 0.0F, 0.0F); - } else { - GL11.glTranslatef(0.7F, 0.0F, 0.0F); - GL11.glRotatef(-30.0F, 0.0F, 0.0F, 1.0F); - GL11.glTranslatef(-1.0F, 0.0F, 0.0F); - } - } - renderLargeItem(); - if (itemstack != null && itemstack.hasEffect(0)) - LOTRClientProxy.renderEnchantmentEffect(); - GL11.glPopMatrix(); - }*/ diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinSlotCrafting.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinSlotCrafting.java index 2ebd594..2a8148c 100644 --- a/src/main/java/com/zivilon/cinder_loe/mixins/MixinSlotCrafting.java +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinSlotCrafting.java @@ -58,11 +58,7 @@ public abstract class MixinSlotCrafting { if (itemstack1 != null) { if (!hasExceptionItem && DurableItemCrafter.customItems.contains(itemstack1.getItem())) { - if (itemstack1.getItem() == CinderLoE.toxicCore && arrow_count > 0) { - damage_item(itemstack1, i, arrow_count, craftMatrix); - } else { - damage_item(itemstack1, i, 1, craftMatrix); - } + damage_item(itemstack1, i, 1, craftMatrix); } else { craftMatrix.decrStackSize(i, 1); } diff --git a/src/main/java/com/zivilon/cinder_loe/recipe/ForgingRecipe.java b/src/main/java/com/zivilon/cinder_loe/recipe/ForgingRecipe.java deleted file mode 100644 index 3680377..0000000 --- a/src/main/java/com/zivilon/cinder_loe/recipe/ForgingRecipe.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.zivilon.cinder_loe.recipe; - -import net.minecraft.item.ItemStack; - -public class ForgingRecipe { - - public boolean isBlessed; - public ItemStack leftInput; - public ItemStack middleInput; - public ItemStack rightInput; - public ItemStack output; - - public ForgingRecipe(ItemStack leftInput, ItemStack middleInput, ItemStack rightInput, ItemStack output, boolean isBlessed) { - this.leftInput = leftInput; - this.middleInput = middleInput; - this.rightInput = rightInput; - this.output = output; - this.isBlessed = isBlessed; - } - - public boolean matches(ItemStack left, ItemStack middle, ItemStack right, boolean isBlessedHammer) { - if (this.isBlessed && !isBlessedHammer) { - return false; - } - - return matchesItem(leftInput, left) && - matchesItem(middleInput, middle) && - matchesItem(rightInput, right); - } - - public boolean matchesItem(ItemStack recipeInput, ItemStack stationInput) { - if (recipeInput == null && stationInput == null) { - return true; - } - if (recipeInput == null || stationInput == null) { - return false; - } - return recipeInput.getItem() == stationInput.getItem() && - recipeInput.getItemDamage() == stationInput.getItemDamage(); - } - - public ItemStack getOutput() { - return output.copy(); - } - - public static String getSafeName(ItemStack stack) { - if (stack == null) return "null"; - return stack.getUnlocalizedName(); - } - - public static void printRecipeDetails(ForgingRecipe recipe) { - System.out.println("Left: " + getSafeName(recipe.leftInput)); - System.out.println("Middle: " + getSafeName(recipe.middleInput)); - System.out.println("Right: " + getSafeName(recipe.rightInput)); - } - -} diff --git a/src/main/java/com/zivilon/cinder_loe/recipe/ForgingRecipes.java b/src/main/java/com/zivilon/cinder_loe/recipe/ForgingRecipes.java deleted file mode 100644 index eff099a..0000000 --- a/src/main/java/com/zivilon/cinder_loe/recipe/ForgingRecipes.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.zivilon.cinder_loe.recipe; - -import com.zivilon.cinder_loe.CinderLoE; -import com.zivilon.cinder_loe.items.Nimveil; -import com.zivilon.cinder_loe.util.Utilities; - -import lotr.common.enchant.LOTREnchantment; - -import net.minecraft.item.ItemStack; - -import java.util.ArrayList; -import java.util.List; - -public class ForgingRecipes { - public static List recipes = new ArrayList(); - - public static void register_recipe(ForgingRecipe recipe) { - recipes.add(recipe); - } - - public static void register_recipes() { -/* register_recipe(new ForgingRecipe( - new ItemStack(CinderLoE.nimveilPart, 1, 2), - new ItemStack(CinderLoE.nimveilPart, 1, 1), - new ItemStack(CinderLoE.nimveilPart, 1, 0), - Nimveil.init_variant(new ItemStack(CinderLoE.nimveil, 1), "valar"), - true - )); - register_recipe(new ForgingRecipe( - new ItemStack(CinderLoE.nimveilPart, 1, 3), - new ItemStack(CinderLoE.nimveilPart, 1, 1), - new ItemStack(CinderLoE.nimveilPart, 1, 0), - Nimveil.init_variant(new ItemStack(CinderLoE.nimveil, 1), "mortals"), - true - )); - register_recipe(new ForgingRecipe( - new ItemStack(CinderLoE.nimveilPart, 1, 4), - new ItemStack(CinderLoE.nimveilPart, 1, 1), - new ItemStack(CinderLoE.nimveilPart, 1, 0), - Nimveil.init_variant(new ItemStack(CinderLoE.nimveil, 1), "udun"), - true - )); - register_recipe(new ForgingRecipe( - new ItemStack(CinderLoE.nimveilPart, 1, 5), - new ItemStack(CinderLoE.nimveilPart, 1, 1), - new ItemStack(CinderLoE.nimveilPart, 1, 0), - Nimveil.init_variant(new ItemStack(CinderLoE.nimveil, 1), "sauron"), - true - )); - register_recipe(new ForgingRecipe( - new ItemStack(CinderLoE.nimveilPart, 1, 6), - new ItemStack(CinderLoE.nimveilPart, 1, 1), - new ItemStack(CinderLoE.nimveilPart, 1, 0), - Nimveil.init_variant(new ItemStack(CinderLoE.nimveil, 1), "ancient"), - true - )); - register_recipe(new ForgingRecipe( - null, - new ItemStack(CinderLoE.nimveil, 1), - null, - new ItemStack(CinderLoE.nimveilPart, 1, 1), - true - )); - register_recipe(new ForgingRecipe( - new ItemStack(CinderLoE.weaponPart, 1, 0), - new ItemStack(CinderLoE.weaponPart, 1, 1), - new ItemStack(CinderLoE.weaponPart, 1, 2), - deceiver_blade(), - false - ));*/ - } - - public static ItemStack deceiver_blade() { -/* ItemStack blade = new ItemStack(CinderLoE.deceiverBlade, 1); - Utilities.setAppliedRandomEnchants(blade); - Utilities.setLOTREnchant(blade, LOTREnchantment.strong4); - Utilities.setLOTREnchant(blade, LOTREnchantment.meleeSpeed1); - Utilities.setLOTREnchant(blade, LOTREnchantment.meleeReach1); - return blade;*/ - return null; - } - - public static List getAllRecipes() { - return recipes; - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/recipe/ToxicCoreArrowsRecipe.java b/src/main/java/com/zivilon/cinder_loe/recipe/ToxicCoreArrowsRecipe.java deleted file mode 100644 index 5791a1f..0000000 --- a/src/main/java/com/zivilon/cinder_loe/recipe/ToxicCoreArrowsRecipe.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.zivilon.cinder_loe.recipe; - -import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.world.World; -import com.zivilon.cinder_loe.CinderLoE; - -public class ToxicCoreArrowsRecipe implements IRecipe { - - private final ItemStack result; - - public ToxicCoreArrowsRecipe(ItemStack result) { - this.result = result; - } - - @Override - public boolean matches(InventoryCrafting inv, World worldIn) { -/* ItemStack toxicCore = null; - int arrowCount = 0; - - for (int i = 0; i < inv.getSizeInventory(); i++) { - ItemStack itemstack = inv.getStackInSlot(i); - - if (itemstack != null) { - if (itemstack.getItem() == CinderLoE.toxicCore) { - if (toxicCore != null) { - return false; // Only one toxic core allowed - } - toxicCore = itemstack; - } else if (itemstack.getItem() == Items.arrow) { - arrowCount++; - } else { - return false; // Invalid item in grid - } - } - } - - if (toxicCore != null && arrowCount > 0) { - return toxicCore.getItemDamage() + arrowCount <= toxicCore.getMaxDamage(); - } -*/ - return false; - } - - @Override - public ItemStack getCraftingResult(InventoryCrafting inv) { -/* ItemStack toxicCore = null; - int arrowCount = 0; - - for (int i = 0; i < inv.getSizeInventory(); i++) { - ItemStack itemstack = inv.getStackInSlot(i); - - if (itemstack != null) { - if (itemstack.getItem() == CinderLoE.toxicCore) { - toxicCore = itemstack; - } else if (itemstack.getItem() == Items.arrow) { - arrowCount++; - } - } - } - - if (toxicCore != null && arrowCount > 0) { - ItemStack resultStack = new ItemStack(result.getItem(), arrowCount); - return resultStack; - } -*/ - return null; - } - - @Override - public int getRecipeSize() { - return 9; - } - - @Override - public ItemStack getRecipeOutput() { - return result; - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/recipes.java b/src/main/java/com/zivilon/cinder_loe/recipes.java index 5ed33ef..fa5d3c8 100644 --- a/src/main/java/com/zivilon/cinder_loe/recipes.java +++ b/src/main/java/com/zivilon/cinder_loe/recipes.java @@ -5,7 +5,6 @@ import lotr.common.LOTRMod; import lotr.common.recipe.LOTRRecipePoisonWeapon; import lotr.common.recipe.LOTRRecipes; import com.zivilon.cinder_loe.CinderLoE; -import com.zivilon.cinder_loe.recipe.*; import com.zivilon.cinder_loe.mixins.MixinLOTRBrewingRecipes; import lotr.common.item.LOTRItemFood; @@ -31,7 +30,6 @@ public class recipes { registerBreeRecipes(); registerArnorRecipes(); registerAngmarRecipes(); - ForgingRecipes.register_recipes(); registerBrewingRecipes(); } @@ -73,13 +71,9 @@ public class recipes { GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(CinderLoE.warDart, 1, 0), new Object[] { " Y", "X ", Character.valueOf('X'), "feather", Character.valueOf('Y'), "stickWood" })); - GameRegistry.addRecipe(new ToxicCoreArrowsRecipe(new ItemStack(LOTRMod.arrowPoisoned))); - GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(CinderLoE.warDart, 1, 0), new Object[] { " Y", "X ", Character.valueOf('X'), "feather", Character.valueOf('Y'), "stickWood" })); - GameRegistry.addRecipe(new ToxicCoreArrowsRecipe(new ItemStack(LOTRMod.arrowPoisoned))); - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.spicedHam), CinderLoE.spice, Items.cooked_porkchop)); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.warDartHeads, 2, 1), LOTRMod.copper, new ItemStack(LOTRMod.chisel, 1, OreDictionary.WILDCARD_VALUE))); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.warDartHeads, 2, 2), LOTRMod.bronze, new ItemStack(LOTRMod.chisel, 1, OreDictionary.WILDCARD_VALUE))); @@ -325,6 +319,5 @@ public class recipes { Character.valueOf('X'), Items.iron_ingot, Character.valueOf('Y'), "stickWood")); } public static void registerBrewingRecipes() { -// MixinLOTRBrewingRecipes.addRecipe(new ItemStack(CinderLoE.mugDemonicHealthPotion, 2), new Object[] { CinderLoE.demonbloodVial, new ItemStack(LOTRMod.tallGrass, 1, 4), new ItemStack(LOTRMod.tallGrass, 1, 4), new ItemStack(LOTRMod.tallGrass, 1, 4), CinderLoE.chocolatebar, CinderLoE.chocolatebar }); } } diff --git a/src/main/java/com/zivilon/cinder_loe/tileentity/TileEntityForgingStation.java b/src/main/java/com/zivilon/cinder_loe/tileentity/TileEntityForgingStation.java deleted file mode 100644 index c7313c5..0000000 --- a/src/main/java/com/zivilon/cinder_loe/tileentity/TileEntityForgingStation.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.zivilon.cinder_loe.tileentity; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.util.AxisAlignedBB; - -public class TileEntityForgingStation extends TileEntity { - - public ItemStack leftItem; - public ItemStack middleItem; - public ItemStack rightItem; - - @Override - public AxisAlignedBB getRenderBoundingBox() { - return AxisAlignedBB.getBoundingBox( - xCoord - 1, yCoord, zCoord - 1, - xCoord + 2, yCoord + 1, zCoord + 2 - ); - } - - - @Override - public Packet getDescriptionPacket() { - NBTTagCompound tag = new NBTTagCompound(); - writeToNBT(tag); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, tag); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - readFromNBT(pkt.func_148857_g()); - } - - - // Getters and Setters for the items - public ItemStack getLeftItem() { - return leftItem; - } - - public void setLeftItem(ItemStack leftItem) { - this.leftItem = leftItem; - markDirty(); // Mark the tile entity as dirty to ensure the world saves the changes - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } - - public ItemStack getMiddleItem() { - return middleItem; - } - - public void setMiddleItem(ItemStack middleItem) { - this.middleItem = middleItem; - markDirty(); // Mark the tile entity as dirty to ensure the world saves the changes - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } - - public ItemStack getRightItem() { - return rightItem; - } - - public void setRightItem(ItemStack rightItem) { - this.rightItem = rightItem; - markDirty(); // Mark the tile entity as dirty to ensure the world saves the changes - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } - - // Method to write data to NBT - @Override - public void writeToNBT(NBTTagCompound compound) { - super.writeToNBT(compound); - - if (leftItem != null) { - NBTTagCompound leftTag = new NBTTagCompound(); - leftItem.writeToNBT(leftTag); - compound.setTag("LeftItem", leftTag); - } else { - compound.removeTag("LeftItem"); - } - - if (middleItem != null) { - NBTTagCompound middleTag = new NBTTagCompound(); - middleItem.writeToNBT(middleTag); - compound.setTag("MiddleItem", middleTag); - } else { - compound.removeTag("MiddleItem"); - } - - if (rightItem != null) { - NBTTagCompound rightTag = new NBTTagCompound(); - rightItem.writeToNBT(rightTag); - compound.setTag("RightItem", rightTag); - } else { - compound.removeTag("RightItem"); - } - } - - - // Method to read data from NBT - @Override - public void readFromNBT(NBTTagCompound compound) { - super.readFromNBT(compound); - - if (compound.hasKey("LeftItem")) { - NBTTagCompound leftTag = compound.getCompoundTag("LeftItem"); - leftItem = ItemStack.loadItemStackFromNBT(leftTag); - } else { - leftItem = null; - } - - if (compound.hasKey("MiddleItem")) { - NBTTagCompound middleTag = compound.getCompoundTag("MiddleItem"); - middleItem = ItemStack.loadItemStackFromNBT(middleTag); - } else { - middleItem = null; - } - - if (compound.hasKey("RightItem")) { - NBTTagCompound rightTag = compound.getCompoundTag("RightItem"); - rightItem = ItemStack.loadItemStackFromNBT(rightTag); - } else { - rightItem = null; - } - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/tileentity/TileEntityShadowTile.java b/src/main/java/com/zivilon/cinder_loe/tileentity/TileEntityShadowTile.java deleted file mode 100644 index c66a0b2..0000000 --- a/src/main/java/com/zivilon/cinder_loe/tileentity/TileEntityShadowTile.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.zivilon.cinder_loe.tileentity; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; - -public class TileEntityShadowTile extends TileEntity { - public long spawnTime; - public static long REMOVAL_DELAY_MS = 15000; - - @Override - public void updateEntity() { - if (!worldObj.isRemote) { - if (spawnTime == 0) { - spawnTime = System.currentTimeMillis(); - } - - long currentTime = System.currentTimeMillis(); - if (currentTime >= spawnTime + REMOVAL_DELAY_MS) { - worldObj.setBlockToAir(xCoord, yCoord, zCoord); - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); // Force the client to update - worldObj.removeTileEntity(xCoord, yCoord, zCoord); // Clean up the tile entity - } - } - } - - @Override - public void writeToNBT(NBTTagCompound nbt) { - super.writeToNBT(nbt); - nbt.setLong("spawnTime", spawnTime); - } - - @Override - public void readFromNBT(NBTTagCompound nbt) { - super.readFromNBT(nbt); - spawnTime = nbt.getLong("spawnTime"); - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/util/DurableItemCrafter.java b/src/main/java/com/zivilon/cinder_loe/util/DurableItemCrafter.java index 013b213..6e950f8 100644 --- a/src/main/java/com/zivilon/cinder_loe/util/DurableItemCrafter.java +++ b/src/main/java/com/zivilon/cinder_loe/util/DurableItemCrafter.java @@ -13,9 +13,5 @@ public class DurableItemCrafter { static { customItems.add(LOTRMod.rollingPin); - customItems.add(LOTRMod.chisel); -// customItems.add(CinderLoE.toxicCore); - - exceptionItems.add(LOTRMod.ithildin); } } diff --git a/src/main/java/com/zivilon/cinder_loe/util/LOTREnchantmentExclusions.java b/src/main/java/com/zivilon/cinder_loe/util/LOTREnchantmentExclusions.java index 3f4d119..7c811cf 100644 --- a/src/main/java/com/zivilon/cinder_loe/util/LOTREnchantmentExclusions.java +++ b/src/main/java/com/zivilon/cinder_loe/util/LOTREnchantmentExclusions.java @@ -10,6 +10,5 @@ import com.zivilon.cinder_loe.CinderLoE; public class LOTREnchantmentExclusions { public static List exclusions = new ArrayList<>(); static { -// exclusions.add(CinderLoE.celeiniss); } } diff --git a/src/main/java/com/zivilon/cinder_loe/util/Utilities.java b/src/main/java/com/zivilon/cinder_loe/util/Utilities.java index 9e20475..f0c15d8 100644 --- a/src/main/java/com/zivilon/cinder_loe/util/Utilities.java +++ b/src/main/java/com/zivilon/cinder_loe/util/Utilities.java @@ -200,38 +200,6 @@ public class Utilities { return LOTREnchantmentHelper.hasEnchant(held_item, LOTREnchantment.fire); } - public static int[] countNexArmour(String player_name) { - EntityPlayer player = getPlayerByName(player_name); - int[] nexPieces = new int[4]; - - if (player == null) { - System.out.println("[CinderLoE] Warning! Player not found: " + player_name); - return nexPieces; - } - - for (ItemStack armor : player.inventory.armorInventory) { - if (armor != null && armor.getItem() instanceof LOTRItemArmor) { - LOTRItemArmor itemArmor = (LOTRItemArmor) armor.getItem(); - if (itemArmor.getLOTRArmorMaterial() == CinderLoE.MATERIAL_NEX_ICE) { - nexPieces[0]++; - } else if (itemArmor.getLOTRArmorMaterial() == CinderLoE.MATERIAL_NEX_FIRE) { - nexPieces[1]++; - } else if (itemArmor.getLOTRArmorMaterial() == CinderLoE.MATERIAL_NEX_SHADOW) { - nexPieces[2]++; - } else if (itemArmor.getLOTRArmorMaterial() == CinderLoE.MATERIAL_NEX_TOXIN) { - nexPieces[3]++; - } - } - } - - if (nexPieces[0] == 4) nexPieces[0] = 5; - if (nexPieces[1] == 4) nexPieces[1] = 5; - if (nexPieces[2] == 4) nexPieces[2] = 5; - if (nexPieces[3] == 4) nexPieces[3] = 5; - - return nexPieces; - } - public static double calculate_melee_damage_on_entity(EntityLivingBase target, EntityLivingBase attacker) { if (attacker == null) return 0.0D; if (attacker.getEntityAttribute(SharedMonsterAttributes.attackDamage) == null) return 0.0D; diff --git a/src/main/java/com/zivilon/cinder_loe/util/VT_additions.java b/src/main/java/com/zivilon/cinder_loe/util/VT_additions.java index 9988877..cc34e81 100644 --- a/src/main/java/com/zivilon/cinder_loe/util/VT_additions.java +++ b/src/main/java/com/zivilon/cinder_loe/util/VT_additions.java @@ -1,7 +1,5 @@ package com.zivilon.cinder_loe.util; -import com.zivilon.cinder_loe.entity.Nex; - public class VT_additions { public static String applyCustomPlaceholders(String scriptLine) { /* scriptLine = scriptLine.replace("", String.valueOf(Nex.get_nex_phase())); diff --git a/src/main/resources/mixins.cinder_loe.json b/src/main/resources/mixins.cinder_loe.json index f8a3df1..0757ee5 100644 --- a/src/main/resources/mixins.cinder_loe.json +++ b/src/main/resources/mixins.cinder_loe.json @@ -9,7 +9,6 @@ "MixinEnchantmentHelper", "MixinEntity", "MixinEntityArrow", - "MixinEntityLivingBase", "MixinItemRenderer", "MixinLOTRArmorModels", "MixinLOTRBrewingRecipes", @@ -21,7 +20,6 @@ "MixinLOTREntityProjectileBase", "MixinLOTREntitySauron", "MixinLOTRIntCache", - "MixinLOTRItemRendererManager", "MixinLOTRNPCRendering", "MixinLOTRRenderArmorStand", "MixinLOTRRenderBlownItem",