diff --git a/src/main/java/com/zivilon/cinder_loe/CinderEventHandler.java b/src/main/java/com/zivilon/cinder_loe/CinderEventHandler.java index 086b110..8574c00 100644 --- a/src/main/java/com/zivilon/cinder_loe/CinderEventHandler.java +++ b/src/main/java/com/zivilon/cinder_loe/CinderEventHandler.java @@ -299,7 +299,7 @@ public class CinderEventHandler implements IFuelHandler { } private void addNegativeModifier(ItemStack item, EntityPlayerMP player, String type) { //Sturdy Check - LOTREnchantment sturdy = type.equals("weapon") + LOTREnchantment sturdy = type.equals("weapon") || type.equals("bow") ? LOTREnchantment.getEnchantmentByName("meleeSturdy") : type.equals("armor") ? LOTREnchantment.getEnchantmentByName("armorSturdy") diff --git a/src/main/java/com/zivilon/cinder_loe/CinderLoE.java b/src/main/java/com/zivilon/cinder_loe/CinderLoE.java index efe189a..225a725 100644 --- a/src/main/java/com/zivilon/cinder_loe/CinderLoE.java +++ b/src/main/java/com/zivilon/cinder_loe/CinderLoE.java @@ -721,10 +721,10 @@ public class CinderLoE { spearUnnamed = (new UnnamedSpear(EVENT)).setUnlocalizedName("lotr:spearUnnamed").setTextureName("lotr:spearUnnamed").setCreativeTab(null); whip = (new Whip()).setUnlocalizedName("lotr:whip").setTextureName("lotr:whip"); helmetbrokenhalo = (new BrokenHalo(EVENT, 0, "helmet")).setUnlocalizedName("lotr:helmetbrokenhalo").setTextureName("lotr:helmetbrokenhalo").setCreativeTab(null); - helmetJade = (new LOTRItemArmor(MATERIAL_JADE, 0, "helmet")).setUnlocalizedName("lotr:helmetJade").setTextureName("lotr:helmetJade").setCreativeTab(null); - bodyJade = (new LOTRItemArmor(MATERIAL_JADE, 1, "chestplate")).setUnlocalizedName("lotr:bodyJade").setTextureName("lotr:bodyJade").setCreativeTab(null); - 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); + helmetJade = (new LoEArmor(MATERIAL_JADE, 0, "helmet")).setUnlocalizedName("lotr:helmetJade").setTextureName("lotr:helmetJade").setCreativeTab(null); + bodyJade = (new LoEArmor(MATERIAL_JADE, 1, "chestplate")).setUnlocalizedName("lotr:bodyJade").setTextureName("lotr:bodyJade").setCreativeTab(null); + legsJade = (new LoEArmor(MATERIAL_JADE, 2,"leggings")).setUnlocalizedName("lotr:legsJade").setTextureName("lotr:legsJade").setCreativeTab(null); + bootsJade = (new LoEArmor(MATERIAL_JADE, 3)).setUnlocalizedName("lotr:bootsJade").setTextureName("lotr:bootsJade").setCreativeTab(null); forgingKit = (new ForgingKit()); fieldRepairKit = new FieldRepairKit().setUnlocalizedName("lotr:field_repair_kit").setTextureName("lotr:field_repair_kit"); @@ -799,10 +799,10 @@ public class CinderLoE { MATERIAL_RED_DWARF = getLOTRMaterialByName("RED_DWARF"); if (MATERIAL_RED_DWARF != null) { - helmetRedDwarf = (new LOTRItemArmor(MATERIAL_RED_DWARF, 0, "helmet")).setUnlocalizedName("lotr:helmetRedDwarf").setTextureName("lotr:helmetRedDwarf"); - bodyRedDwarf = (new LOTRItemArmor(MATERIAL_RED_DWARF, 1)).setUnlocalizedName("lotr:bodyRedDwarf").setTextureName("lotr:bodyRedDwarf"); - legsRedDwarf = (new LOTRItemArmor(MATERIAL_RED_DWARF, 2)).setUnlocalizedName("lotr:legsRedDwarf").setTextureName("lotr:legsRedDwarf"); - bootsRedDwarf = (new LOTRItemArmor(MATERIAL_RED_DWARF, 3)).setUnlocalizedName("lotr:bootsRedDwarf").setTextureName("lotr:bootsRedDwarf"); + helmetRedDwarf = (new LoEArmor(MATERIAL_RED_DWARF, 0, "helmet")).setUnlocalizedName("lotr:helmetRedDwarf").setTextureName("lotr:helmetRedDwarf"); + bodyRedDwarf = (new LoEArmor(MATERIAL_RED_DWARF, 1)).setUnlocalizedName("lotr:bodyRedDwarf").setTextureName("lotr:bodyRedDwarf"); + legsRedDwarf = (new LoEArmor(MATERIAL_RED_DWARF, 2)).setUnlocalizedName("lotr:legsRedDwarf").setTextureName("lotr:legsRedDwarf"); + bootsRedDwarf = (new LoEArmor(MATERIAL_RED_DWARF, 3)).setUnlocalizedName("lotr:bootsRedDwarf").setTextureName("lotr:bootsRedDwarf"); spearRedDwarf = (new LOTRItemSpear(MATERIAL_RED_DWARF)).setUnlocalizedName("lotr:spearRedDwarf").setTextureName("lotr:spearRedDwarf"); swordRedDwarf = (new LOTRItemSword(MATERIAL_RED_DWARF)).setUnlocalizedName("lotr:swordRedDwarf").setTextureName("lotr:swordRedDwarf"); battleaxeRedDwarf = (new LOTRItemBattleaxe(MATERIAL_RED_DWARF)).setUnlocalizedName("lotr:battleaxeRedDwarf").setTextureName("lotr:battleaxeRedDwarf"); @@ -848,15 +848,15 @@ public class CinderLoE { MATERIAL_LIMWAITH_WOOD = getLOTRMaterialByName("LIMWAITH_WOOD"); MATERIAL_BONEMOLD = getLOTRMaterialByName("BONEMOLD"); if (MATERIAL_LIMWAITH_WOOD != null && MATERIAL_BONEMOLD != null) { - helmetLimwaith = (new LOTRItemArmor(MATERIAL_LIMWAITH_WOOD, 0)).setUnlocalizedName("lotr:helmetLimwaith").setTextureName("lotr:helmetLimwaith"); - bodyLimwaith = (new LOTRItemArmor(MATERIAL_LIMWAITH_WOOD, 1)).setUnlocalizedName("lotr:bodyLimwaith").setTextureName("lotr:bodyLimwaith"); - legsLimwaith = (new LOTRItemArmor(MATERIAL_LIMWAITH_WOOD, 2)).setUnlocalizedName("lotr:legsLimwaith").setTextureName("lotr:legsLimwaith"); - bootsLimwaith = (new LOTRItemArmor(MATERIAL_LIMWAITH_WOOD, 3)).setUnlocalizedName("lotr:bootsLimwaith").setTextureName("lotr:bootsLimwaith"); + helmetLimwaith = (new LoEArmor(MATERIAL_LIMWAITH_WOOD, 0)).setUnlocalizedName("lotr:helmetLimwaith").setTextureName("lotr:helmetLimwaith"); + bodyLimwaith = (new LoEArmor(MATERIAL_LIMWAITH_WOOD, 1)).setUnlocalizedName("lotr:bodyLimwaith").setTextureName("lotr:bodyLimwaith"); + legsLimwaith = (new LoEArmor(MATERIAL_LIMWAITH_WOOD, 2)).setUnlocalizedName("lotr:legsLimwaith").setTextureName("lotr:legsLimwaith"); + bootsLimwaith = (new LoEArmor(MATERIAL_LIMWAITH_WOOD, 3)).setUnlocalizedName("lotr:bootsLimwaith").setTextureName("lotr:bootsLimwaith"); - helmetboneLimwaith = (new LOTRItemArmor(MATERIAL_BONEMOLD, 0)).setUnlocalizedName("lotr:helmetboneLimwaith").setTextureName("lotr:helmetboneLimwaith"); - bodyboneLimwaith = (new LOTRItemArmor(MATERIAL_BONEMOLD, 1)).setUnlocalizedName("lotr:bodyboneLimwaith").setTextureName("lotr:bodyboneLimwaith"); - legsboneLimwaith = (new LOTRItemArmor(MATERIAL_BONEMOLD, 2)).setUnlocalizedName("lotr:legsboneLimwaith").setTextureName("lotr:legsboneLimwaith"); - bootsboneLimwaith = (new LOTRItemArmor(MATERIAL_BONEMOLD, 3)).setUnlocalizedName("lotr:bootsboneLimwaith").setTextureName("lotr:bootsboneLimwaith"); + helmetboneLimwaith = (new LoEArmor(MATERIAL_BONEMOLD, 0)).setUnlocalizedName("lotr:helmetboneLimwaith").setTextureName("lotr:helmetboneLimwaith"); + bodyboneLimwaith = (new LoEArmor(MATERIAL_BONEMOLD, 1)).setUnlocalizedName("lotr:bodyboneLimwaith").setTextureName("lotr:bodyboneLimwaith"); + legsboneLimwaith = (new LoEArmor(MATERIAL_BONEMOLD, 2)).setUnlocalizedName("lotr:legsboneLimwaith").setTextureName("lotr:legsboneLimwaith"); + bootsboneLimwaith = (new LoEArmor(MATERIAL_BONEMOLD, 3)).setUnlocalizedName("lotr:bootsboneLimwaith").setTextureName("lotr:bootsboneLimwaith"); spearLimwaith = (new LOTRItemSpear(MATERIAL_BONEMOLD)).setUnlocalizedName("lotr:spearLimwaith").setTextureName("lotr:spearLimwaith"); truncheonLimwaith = (new LOTRItemSword(MATERIAL_BONEMOLD)).setUnlocalizedName("lotr:truncheonLimwaith").setTextureName("lotr:truncheonLimwaith"); @@ -897,11 +897,11 @@ public class CinderLoE { //Bree MATERIAL_BREE = getLOTRMaterialByName("BREE"); if (MATERIAL_BREE != null) { - helmetBreeKettle = (new LOTRItemArmor(MATERIAL_BREE, 0, "helmet")).setUnlocalizedName("lotr:helmetBreeKettle").setTextureName("lotr:breekettlehelmet"); - helmetBree = (new LOTRItemArmor(MATERIAL_BREE, 0)).setUnlocalizedName("lotr:helmetBree").setTextureName("lotr:helmetBree"); - bodyBree = (new LOTRItemArmor(MATERIAL_BREE, 1)).setUnlocalizedName("lotr:bodyBree").setTextureName("lotr:bodyBree"); - legsBree = (new LOTRItemArmor(MATERIAL_BREE, 2)).setUnlocalizedName("lotr:legsBree").setTextureName("lotr:legsBree"); - bootsBree = (new LOTRItemArmor(MATERIAL_BREE, 3)).setUnlocalizedName("lotr:bootsBree").setTextureName("lotr:bootsBree"); + helmetBreeKettle = (new LoEArmor(MATERIAL_BREE, 0, "helmet")).setUnlocalizedName("lotr:helmetBreeKettle").setTextureName("lotr:breekettlehelmet"); + helmetBree = (new LoEArmor(MATERIAL_BREE, 0)).setUnlocalizedName("lotr:helmetBree").setTextureName("lotr:helmetBree"); + bodyBree = (new LoEArmor(MATERIAL_BREE, 1)).setUnlocalizedName("lotr:bodyBree").setTextureName("lotr:bodyBree"); + legsBree = (new LoEArmor(MATERIAL_BREE, 2)).setUnlocalizedName("lotr:legsBree").setTextureName("lotr:legsBree"); + bootsBree = (new LoEArmor(MATERIAL_BREE, 3)).setUnlocalizedName("lotr:bootsBree").setTextureName("lotr:bootsBree"); swordBree = (new LOTRItemSword(MATERIAL_BREE)).setUnlocalizedName("lotr:swordBree").setTextureName("lotr:swordBree"); ItemRegistration.register(helmetBreeKettle, "breekettle", 6440); @@ -919,10 +919,10 @@ public class CinderLoE { MATERIAL_SERPENT = getLOTRMaterialByName("SERPENT"); if (MATERIAL_SERPENT != null) { - helmetserpent = (new LOTRItemArmor(MATERIAL_SERPENT, 0)).setUnlocalizedName("lotr:helmetserpent").setTextureName("lotr:helmetserpent").setCreativeTab(null); - bodyserpent = (new LOTRItemArmor(MATERIAL_SERPENT, 1, "chestplate")).setUnlocalizedName("lotr:bodyserpent").setTextureName("lotr:bodyserpent").setCreativeTab(null); - 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); + helmetserpent = (new LoEArmor(MATERIAL_SERPENT, 0)).setUnlocalizedName("lotr:helmetserpent").setTextureName("lotr:helmetserpent").setCreativeTab(null); + bodyserpent = (new LoEArmor(MATERIAL_SERPENT, 1, "chestplate")).setUnlocalizedName("lotr:bodyserpent").setTextureName("lotr:bodyserpent").setCreativeTab(null); + legsserpent = (new LoEArmor(MATERIAL_SERPENT, 2)).setUnlocalizedName("lotr:legsserpent").setTextureName("lotr:legsserpent").setCreativeTab(null); + bootsserpent = (new LoEArmor(MATERIAL_SERPENT, 3)).setUnlocalizedName("lotr:bootsserpent").setTextureName("lotr:bootsserpent").setCreativeTab(null); ItemRegistration.register(helmetserpent, "helmetserpent", 6800); ItemRegistration.register(bodyserpent, "bodyserpent", 6801); @@ -933,10 +933,10 @@ public class CinderLoE { } MATERIAL_USURPER = getLOTRMaterialByName("USURPER"); if (MATERIAL_USURPER != null) { - helmetUsurper = (new LOTRItemArmor(MATERIAL_USURPER, 0, "helmet")).setUnlocalizedName("lotr:helmetUsurper").setTextureName("lotr:helmetUsurper").setCreativeTab(null); - bodyUsurper = (new LOTRItemArmor(MATERIAL_USURPER, 1)).setUnlocalizedName("lotr:bodyUsurper").setTextureName("lotr:bodyUsurper").setCreativeTab(null); - 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); + helmetUsurper = (new LoEArmor(MATERIAL_USURPER, 0, "helmet")).setUnlocalizedName("lotr:helmetUsurper").setTextureName("lotr:helmetUsurper").setCreativeTab(null); + bodyUsurper = (new LoEArmor(MATERIAL_USURPER, 1)).setUnlocalizedName("lotr:bodyUsurper").setTextureName("lotr:bodyUsurper").setCreativeTab(null); + legsUsurper = (new LoEArmor(MATERIAL_USURPER, 2)).setUnlocalizedName("lotr:legsUsurper").setTextureName("lotr:legsUsurper").setCreativeTab(null); + bootsUsurper = (new LoEArmor(MATERIAL_USURPER, 3)).setUnlocalizedName("lotr:bootsUsurper").setTextureName("lotr:bootsUsurper").setCreativeTab(null); ItemRegistration.register(helmetUsurper, "helmetUsurper", 6804); @@ -949,10 +949,10 @@ public class CinderLoE { } MATERIAL_WARLORD = getLOTRMaterialByName("WARLORD"); if (MATERIAL_WARLORD != null) { - helmetWarlord = (new LOTRItemArmor(MATERIAL_WARLORD, 0, "helmet")).setUnlocalizedName("lotr:helmetWarlord").setTextureName("lotr:helmetWarlord").setCreativeTab(null); - bodyWarlord = (new LOTRItemArmor(MATERIAL_WARLORD, 1)).setUnlocalizedName("lotr:bodyWarlord").setTextureName("lotr:bodyWarlord").setCreativeTab(null); - 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); + helmetWarlord = (new LoEArmor(MATERIAL_WARLORD, 0, "helmet")).setUnlocalizedName("lotr:helmetWarlord").setTextureName("lotr:helmetWarlord").setCreativeTab(null); + bodyWarlord = (new LoEArmor(MATERIAL_WARLORD, 1)).setUnlocalizedName("lotr:bodyWarlord").setTextureName("lotr:bodyWarlord").setCreativeTab(null); + legsWarlord = (new LoEArmor(MATERIAL_WARLORD, 2)).setUnlocalizedName("lotr:legsWarlord").setTextureName("lotr:legsWarlord").setCreativeTab(null); + bootsWarlord = (new LoEArmor(MATERIAL_WARLORD, 3)).setUnlocalizedName("lotr:bootsWarlord").setTextureName("lotr:bootsWarlord").setCreativeTab(null); maceWarlord = (new LOTRItemHammer(MATERIAL_WARLORD)).setUnlocalizedName("lotr:maceWarlord").setTextureName("lotr:maceWarlord"); ItemRegistration.register(helmetWarlord, "helmetWarlord", 6808); @@ -967,10 +967,10 @@ public class CinderLoE { MATERIAL_GILDEDGALVORN = getLOTRMaterialByName("GILDEDGALVORN"); if (MATERIAL_GILDEDGALVORN != null) { - helmetGildedGalvorn = (new LOTRItemArmor(MATERIAL_GILDEDGALVORN, 0, "helmet")).setUnlocalizedName("lotr:helmetGildedGalvorn").setTextureName("lotr:helmetGildedGalvorn").setCreativeTab(null); - bodyGildedGalvorn = (new LOTRItemArmor(MATERIAL_GILDEDGALVORN, 1)).setUnlocalizedName("lotr:bodyGildedGalvorn").setTextureName("lotr:bodyGildedGalvorn").setCreativeTab(null); - legsGildedGalvorn = (new LOTRItemArmor(MATERIAL_GILDEDGALVORN, 2)).setUnlocalizedName("lotr:legsGildedGalvorn").setTextureName("lotr:legsGildedGalvorn").setCreativeTab(null); - bootsGildedGalvorn = (new LOTRItemArmor(MATERIAL_GILDEDGALVORN, 3)).setUnlocalizedName("lotr:bootsGildedGalvorn").setTextureName("lotr:bootsGildedGalvorn").setCreativeTab(null); + helmetGildedGalvorn = (new LoEArmor(MATERIAL_GILDEDGALVORN, 0, "helmet")).setUnlocalizedName("lotr:helmetGildedGalvorn").setTextureName("lotr:helmetGildedGalvorn").setCreativeTab(null); + bodyGildedGalvorn = (new LoEArmor(MATERIAL_GILDEDGALVORN, 1)).setUnlocalizedName("lotr:bodyGildedGalvorn").setTextureName("lotr:bodyGildedGalvorn").setCreativeTab(null); + legsGildedGalvorn = (new LoEArmor(MATERIAL_GILDEDGALVORN, 2)).setUnlocalizedName("lotr:legsGildedGalvorn").setTextureName("lotr:legsGildedGalvorn").setCreativeTab(null); + bootsGildedGalvorn = (new LoEArmor(MATERIAL_GILDEDGALVORN, 3)).setUnlocalizedName("lotr:bootsGildedGalvorn").setTextureName("lotr:bootsGildedGalvorn").setCreativeTab(null); ItemRegistration.register(helmetGildedGalvorn, "helmetGildedGalvorn", 6813); ItemRegistration.register(bodyGildedGalvorn, "bodyGildedGalvorn", 6814); @@ -984,10 +984,10 @@ public class CinderLoE { //Rhudaur 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"); + helmetRhudaur = (new LoEArmor(MATERIAL_RHUDAUR, 0, "helmet")).setUnlocalizedName("lotr:helmetRhudaur").setTextureName("lotr:helmetRhudaur"); + bodyRhudaur = (new LoEArmor(MATERIAL_RHUDAUR, 1)).setUnlocalizedName("lotr:bodyRhudaur").setTextureName("lotr:bodyRhudaur"); + legsRhudaur = (new LoEArmor(MATERIAL_RHUDAUR, 2)).setUnlocalizedName("lotr:legsRhudaur").setTextureName("lotr:legsRhudaur"); + bootsRhudaur = (new LoEArmor(MATERIAL_RHUDAUR, 3)).setUnlocalizedName("lotr:bootsRhudaur").setTextureName("lotr:bootsRhudaur"); ItemRegistration.register(helmetRhudaur, "helmetRhudaur",6450); ItemRegistration.register(bodyRhudaur, "bodyRhudaur", 6451); @@ -999,10 +999,10 @@ public class CinderLoE { //Arnor MATERIAL_BATTLENUN = getLOTRMaterialByName("BATTLENUN"); if (MATERIAL_BATTLENUN != null) { - helmetArnorBanner = (new LOTRItemArmor(MATERIAL_BATTLENUN, 0)).setUnlocalizedName("lotr:helmetArnorBanner").setTextureName("lotr:helmetArnorBanner"); - bodyArnorBanner = (new LOTRItemArmor(MATERIAL_BATTLENUN, 1)).setUnlocalizedName("lotr:bodyArnorBanner").setTextureName("lotr:bodyArnorBanner"); - legsArnorBanner = (new LOTRItemArmor(MATERIAL_BATTLENUN, 2)).setUnlocalizedName("lotr:legsArnorBanner").setTextureName("lotr:legsArnorBanner"); - bootsArnorBanner = (new LOTRItemArmor(MATERIAL_BATTLENUN, 3)).setUnlocalizedName("lotr:bootsArnorBanner").setTextureName("lotr:bootsArnorBanner"); + helmetArnorBanner = (new LoEArmor(MATERIAL_BATTLENUN, 0)).setUnlocalizedName("lotr:helmetArnorBanner").setTextureName("lotr:helmetArnorBanner"); + bodyArnorBanner = (new LoEArmor(MATERIAL_BATTLENUN, 1)).setUnlocalizedName("lotr:bodyArnorBanner").setTextureName("lotr:bodyArnorBanner"); + legsArnorBanner = (new LoEArmor(MATERIAL_BATTLENUN, 2)).setUnlocalizedName("lotr:legsArnorBanner").setTextureName("lotr:legsArnorBanner"); + bootsArnorBanner = (new LoEArmor(MATERIAL_BATTLENUN, 3)).setUnlocalizedName("lotr:bootsArnorBanner").setTextureName("lotr:bootsArnorBanner"); maceArnor = (new LOTRItemHammer(LOTRMaterial.ARNOR)).setUnlocalizedName("lotr:maceArnor").setTextureName("lotr:maceArnor"); ItemRegistration.register(helmetArnorBanner, "helmetArnorBanner", 6460); diff --git a/src/main/java/com/zivilon/cinder_loe/items/CinderBow.java b/src/main/java/com/zivilon/cinder_loe/items/CinderBow.java index aab8116..b3cf127 100644 --- a/src/main/java/com/zivilon/cinder_loe/items/CinderBow.java +++ b/src/main/java/com/zivilon/cinder_loe/items/CinderBow.java @@ -1,6 +1,7 @@ package com.zivilon.cinder_loe.items; import com.zivilon.cinder_loe.CinderLoE; +import com.zivilon.cinder_loe.LoECreativeTabs; import cpw.mods.fml.common.network.simpleimpl.IMessage; import lotr.common.LOTRLevelData; import lotr.common.LOTRMod; @@ -28,12 +29,12 @@ public class CinderBow extends LOTRItemBow { public CinderBow(LOTRMaterial material, double d) { super(material, d); + setCreativeTab(LoECreativeTabs.tabCombatLoE); } @Override public boolean getIsRepairable(ItemStack itemstack, ItemStack repairItem) { - return repairItem.getItem() == CinderLoE.ingotAsh || super.getIsRepairable(itemstack, repairItem); + return repairItem.getItem() == CinderLoE.ingotAsh && super.getIsRepairable(itemstack, repairItem); } - } diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRContainerAnvil.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRContainerAnvil.java index fe07af1..e98b69e 100644 --- a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRContainerAnvil.java +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRContainerAnvil.java @@ -144,14 +144,7 @@ public abstract class MixinLOTRContainerAnvil { return (materialItem.getItem() == CinderLoE.bonemold); if (armorMaterial == CinderLoE.MATERIAL_RHUDAUR.toArmorMaterial()) return (materialItem.getItem() == Items.iron_ingot); - if (armorMaterial == CinderLoE.MATERIAL_JADE.toArmorMaterial()) - return (materialItem.getItem() == LOTRMod.emerald); - if (armorMaterial == CinderLoE.MATERIAL_SERPENT.toArmorMaterial()) - return (materialItem.getItem() == LOTRMod.bronze); - if (armorMaterial == CinderLoE.MATERIAL_WARLORD.toArmorMaterial()) - return (materialItem.getItem() == LOTRMod.bronze); - if (armorMaterial == CinderLoE.MATERIAL_USURPER.toArmorMaterial()) - return (materialItem.getItem() == Items.iron_ingot); + } return false; diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTREnchantment.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTREnchantment.java index 71a96d7..74fa14d 100644 --- a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTREnchantment.java +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTREnchantment.java @@ -36,8 +36,8 @@ public class MixinLOTREnchantment { LOTREnchantment fireRepair = new LOTREnchantmentArmorSpecial("fireRepair").setEnchantWeight(0).setSkilful(); LOTREnchantment mountArmor = new LOTREnchantmentArmorSpecial("mountArmor").setEnchantWeight(0).setSkilful(); LOTREnchantment stealth = new LOTREnchantmentArmorSpecial("stealth").setEnchantWeight(0).setSkilful(); - LOTREnchantment meleeSturdy = new LOTREnchantmentArmorSpecial("meleeSturdy").setEnchantWeight(1); - LOTREnchantment armorSturdy = new LOTREnchantmentArmorSpecial("armorSturdy").setEnchantWeight(1); + LOTREnchantment meleeSturdy = new LOTREnchantmentWeaponSpecial("meleeSturdy").setEnchantWeight(0); + LOTREnchantment armorSturdy = new LOTREnchantmentArmorSpecial("armorSturdy").setEnchantWeight(0); LOTREnchantment.allEnchantments.add(protectRangedWeak1); diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/overrides/MixinLOTRTradeEntriesOverrides.java b/src/main/java/com/zivilon/cinder_loe/mixins/overrides/MixinLOTRTradeEntriesOverrides.java index 637ae8c..384654d 100644 --- a/src/main/java/com/zivilon/cinder_loe/mixins/overrides/MixinLOTRTradeEntriesOverrides.java +++ b/src/main/java/com/zivilon/cinder_loe/mixins/overrides/MixinLOTRTradeEntriesOverrides.java @@ -1,30 +1,33 @@ package com.zivilon.cinder_loe.mixins.overrides; import com.zivilon.cinder_loe.CinderLoE; -import com.zivilon.cinder_loe.mixins.MixinLOTRTradeEntries; import lotr.common.LOTRFoods; import lotr.common.LOTRMod; +import lotr.common.enchant.LOTREnchantment; +import lotr.common.enchant.LOTREnchantmentHelper; import lotr.common.entity.npc.LOTRTradeEntries; import lotr.common.entity.npc.LOTRTradeEntry; import lotr.common.entity.npc.LOTRTradeEntryBarrel; import lotr.common.item.LOTRItemBanner; +import lotr.common.item.LOTRItemMug; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; +import net.minecraft.item.*; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Random; import static lotr.common.entity.npc.LOTRTradeEntries.*; -import static lotr.common.entity.npc.LOTRTradeEntries.MOREDAIN_HUNTSMAN_BUY; @Mixin(LOTRTradeEntries.class) public abstract class MixinLOTRTradeEntriesOverrides { @@ -124,14 +127,39 @@ public abstract class MixinLOTRTradeEntriesOverrides { @Shadow public static LOTRTradeEntries DALE_BLACKSMITH_BUY; @Shadow public static LOTRTradeEntries DALE_BLACKSMITH_SELL; - @Shadow public static LOTRTradeEntries WICKED_DWARF_BUY; @Shadow public static LOTRTradeEntries DALE_BAKER_BUY; + @Redirect( + method = "getRandomTrades", + at = @At( + value = "INVOKE", + target = "Llotr/common/enchant/LOTREnchantmentHelper;applyRandomEnchantments(Lnet/minecraft/item/ItemStack;Ljava/util/Random;ZZ)V" + ), + remap = false + ) + private void applyRandomEnchantsThenSturdy(ItemStack tradeItem, Random random, boolean skilful, boolean keepBanes) { + LOTREnchantmentHelper.applyRandomEnchantments(tradeItem, random, skilful, keepBanes); + Item item = tradeItem.getItem(); + String name; + if (item instanceof ItemArmor) { + name = "armorSturdy"; + } else if (item instanceof ItemSword) { + name = "meleeSturdy"; + } else if (item instanceof ItemBow) { + name = "meleeSturdy"; + } else { + return; + } + LOTREnchantment sturdy = LOTREnchantment.getEnchantmentByName(name); + if (sturdy != null && !LOTREnchantmentHelper.hasEnchant(tradeItem, sturdy)) { + LOTREnchantmentHelper.setHasEnchant(tradeItem, sturdy); + } + } /** - * @author - * @reason + * @author KeyLime + Mevans + * @reason Mixins is the very best!!!!!!!!!!!!!!! */ @Inject(method = "setupTrades1", at = @At("RETURN"), remap = false) private static void newTrades(CallbackInfo ci) { @@ -1876,5 +1904,6 @@ public abstract class MixinLOTRTradeEntriesOverrides { new LOTRTradeEntry(new ItemStack(CinderLoE.spiceIngredient, 1, 5), 6666)); ((MixinLOTRTradeEntriesOverrides)(Object)BREE_FLORIST_BUY).setVessels(LOTRFoods.BREE_DRINK); } + }