diff --git a/dependencies.gradle b/dependencies.gradle index de4256b..5651b6f 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -37,4 +37,5 @@ dependencies { implementation files('libs/cindercore.jar') implementation files('libs/lotr.jar') implementation files('libs/optifine.jar') + implementation files('libs/variabletriggers.jar') } diff --git a/libs/variabletriggers.jar b/libs/variabletriggers.jar new file mode 100644 index 0000000..61c1644 Binary files /dev/null and b/libs/variabletriggers.jar differ diff --git a/src/main/java/com/zivilon/cinder_loe/CinderEventHandler.java b/src/main/java/com/zivilon/cinder_loe/CinderEventHandler.java index ef588f6..6831894 100644 --- a/src/main/java/com/zivilon/cinder_loe/CinderEventHandler.java +++ b/src/main/java/com/zivilon/cinder_loe/CinderEventHandler.java @@ -4,42 +4,209 @@ import com.zivilon.cinder_loe.entity.corrupt.CorruptMan; import com.zivilon.cinder_loe.items.BrokenHalo; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.IFuelHandler; +import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.registry.GameRegistry; import lotr.common.LOTRMod; +import lotr.common.enchant.LOTREnchantment; +import lotr.common.enchant.LOTREnchantmentHelper; +import lotr.common.item.*; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.DataWatcher; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; +import net.minecraft.item.*; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTTagString; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S04PacketEntityEquipment; +import net.minecraft.network.play.server.S09PacketHeldItemChange; +import net.minecraft.network.play.server.S1CPacketEntityMetadata; +import net.minecraft.network.play.server.S19PacketEntityStatus; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; +import net.minecraft.world.WorldServer; import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.living.LivingAttackEvent; import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.ArrowLooseEvent; import java.util.Random; public class CinderEventHandler implements IFuelHandler { private static final Random random = new Random(); public CinderEventHandler() { - FMLCommonHandler.instance().bus().register((Object)this); - MinecraftForge.EVENT_BUS.register((Object)this); - MinecraftForge.TERRAIN_GEN_BUS.register((Object)this); - GameRegistry.registerFuelHandler((IFuelHandler)this); + FMLCommonHandler.instance().bus().register(this); + MinecraftForge.EVENT_BUS.register(this); + MinecraftForge.TERRAIN_GEN_BUS.register(this); + GameRegistry.registerFuelHandler(this); + } + @SubscribeEvent + public void onArrowLoose(ArrowLooseEvent event) { + Entity attacker = event.entityLiving; + if (attacker instanceof EntityPlayerMP player) { + ItemStack bow = player.getHeldItem(); + if (bow != null && bow.isItemStackDamageable() && (bow.getItem() instanceof LOTRItemBow || bow.getItem() instanceof ItemBow)) { + float[] durabilityThresholds = {0.6f, 0.5f, 0.4f}; + double[] probabilities = {0.02, 0.05, 0.1}; // Corrected probabilities + + // Corrected durabilityPercent calculation + float durabilityPercent = (float) (bow.getMaxDamage() - bow.getItemDamage()) / bow.getMaxDamage(); + + for (int j = 0; j < durabilityThresholds.length; j++) { + if (durabilityPercent <= durabilityThresholds[j] && random.nextDouble() <= probabilities[j]) { + addNegativeModifier(bow, player, "bow"); + break; // Exit loop once a modifier is added + } + } + } + } + } + + @SubscribeEvent + public void onLivingAttack(LivingAttackEvent event) { + Entity attacker = event.source.getEntity(); + + if (attacker instanceof EntityPlayerMP player) { + ItemStack weapon = player.getHeldItem(); + // smithing rework for melee + if (weapon != null && (weapon.getItem() instanceof LOTRItemSpear || weapon.getItem() instanceof LOTRItemSword || weapon.getItem() instanceof LOTRItemDagger || weapon.getItem() instanceof LOTRItemBattleaxe || weapon.getItem() instanceof LOTRItemHammer || weapon.getItem() instanceof ItemSword)) { + float[] durabilityThresholds = {0.6f, 0.5f, 0.4f}; + double[] probabilities = {0.02, 0.05, 0.1}; // Corrected probabilities + if (weapon.isItemStackDamageable()) { + // Corrected durabilityPercent calculation + float durabilityPercent = (float) (weapon.getMaxDamage() - weapon.getItemDamage()) / weapon.getMaxDamage(); + + for (int j = 0; j < durabilityThresholds.length; j++) { + if (durabilityPercent <= durabilityThresholds[j] && random.nextDouble() <= probabilities[j]) { + addNegativeModifier(weapon, player, "weapon"); + break; // Exit loop once a modifier is added + } + } + } + } + } } @SubscribeEvent public void onLivingHurt(LivingHurtEvent event) { + + if (event.entityLiving == null || event.source.getEntity() == null) { + return; + } + EntityLivingBase entity = event.entityLiving; - EntityLivingBase attacker = event.source.getEntity() instanceof EntityLivingBase ? (EntityLivingBase)event.source.getEntity() : null; + EntityLivingBase attacker = event.source.getEntity() instanceof EntityLivingBase ? (EntityLivingBase) event.source.getEntity() : null; World world = entity.worldObj; + DamageSource source = event.source; + + if (event.entity instanceof EntityPlayer && !source.isUnblockable()) { + EntityPlayerMP player = (EntityPlayerMP) event.entity; + ItemStack sword = player.getHeldItem(); + + + float playerYaw = player.getRotationYawHead(); + float attackerYaw = attacker.getRotationYawHead(); + +// Normalize both angles to be within 0 - 360 + playerYaw = (playerYaw + 360) % 360; + attackerYaw = (attackerYaw + 360) % 360; +// Calculate the angle difference + float angleDifference = Math.abs(playerYaw - attackerYaw); + + if (angleDifference > 180) { + angleDifference = 360 - angleDifference; + } + ItemStack weapon = attacker.getHeldItem(); + if (weapon != null) { + if (player.isBlocking() && angleDifference >= 135 && angleDifference <=225) { + + float additionalDamage = 0.0f; + if (weapon.getItem() instanceof ItemAxe || weapon.getItem() instanceof LOTRItemAxe || weapon.getItem() instanceof LOTRItemBattleaxe) { + sword.damageItem((int) (event.ammount *1.5), player); // Axes deal 150% the Durability damage + player.clearItemInUse(); + world.playSoundAtEntity(player, "random.anvil_land", 1F, 2F); + additionalDamage = 0.75f; // Only 25% Passes through + } else if (weapon.getItem() instanceof LOTRItemHammer) { + sword.damageItem((int) event.ammount, player); // Hammers bypass the block better, but only deal 100% of the durability damage + player.clearItemInUse(); + world.playSoundAtEntity(player, "random.anvil_land", 1F, 2F); + additionalDamage = 0.5f; // Only 50% Passes through + } else { + additionalDamage = 0.0f; // 0% Damage Passes through + sword.damageItem((int) (event.ammount/2), player); //Swords only deal 50% of durability damage + player.clearItemInUse(); + world.playSoundAtEntity(player, "random.anvil_land", 1F, 2F); + } + + float newDamage = event.ammount * (additionalDamage); // Calculate new damage + float newHealth = player.getHealth() - (newDamage - event.ammount); // Calculate health after applying extra damage + + if (newHealth > 0) { + player.setHealth(newHealth); + event.setCanceled(true); + } else { + event.ammount = player.getHealth(); // Ensure player dies if health reaches 0 or below + } + + } + } + } + + + + + // Negative Arrow Protection Handler + if (!event.entityLiving.worldObj.isRemote && event.source.isProjectile() && event.entityLiving instanceof EntityPlayerMP player) { + // player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "DEBUG: Initial Damage: " + event.ammount)); + + float totalAdditionalDamage = 0.0f; // Initialize total additional damage + + for (int i = 0; i < 4; i++) { + ItemStack armor = player.getEquipmentInSlot(i + 1); + if (armor != null) { + LOTREnchantment protectRangedWeak1 = LOTREnchantment.getEnchantmentByName("protectRangedWeak1"); + LOTREnchantment protectRangedWeak2 = LOTREnchantment.getEnchantmentByName("protectRangedWeak2"); + + if (LOTREnchantmentHelper.hasEnchant(armor, protectRangedWeak1)) { + float additionalDamage = 0.2f; // 20% more damage per piece + totalAdditionalDamage += additionalDamage; // Accumulate damage increase + } + if (LOTREnchantmentHelper.hasEnchant(armor, protectRangedWeak2)) { + float additionalDamage = 0.4f; // 40% more damage per piece + totalAdditionalDamage += additionalDamage; // Accumulate damage increase + } + } + } + + // Apply total additional damage + if (totalAdditionalDamage > 0) { + float newDamage = event.ammount * (1 + totalAdditionalDamage); // Calculate new damage + float newHealth = player.getHealth() - (newDamage - event.ammount); // Calculate health after applying extra damage + + if (newHealth > 0) { + player.setHealth(newHealth); + event.setCanceled(true); + } else { + event.ammount = player.getHealth(); // Ensure player dies if health reaches 0 or below + } + + // player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "DEBUG: Total Additional Damage: " + newDamage)); + } + } + + // Broken Halo Event handler if (attacker != null && event.source.getSourceOfDamage() == attacker) { ItemStack helmet = entity.getEquipmentInSlot(4); if (helmet != null && helmet.getItem() instanceof BrokenHalo) { - if (random.nextDouble() <= 0.25 ) { + if (random.nextDouble() <= 0.25) { // Summon Corrupt Civilian NPC CorruptMan spawnedEntity = new CorruptMan(world); spawnedEntity.copyLocationAndAnglesFrom(attacker); @@ -51,7 +218,7 @@ public class CinderEventHandler implements IFuelHandler { spawnedEntity.setHealth(10); spawnedEntity.addPotionEffect(new PotionEffect(Potion.regeneration.id, 9999, 0)); - spawnedEntity.onSpawnWithEgg((IEntityLivingData) null); + spawnedEntity.onSpawnWithEgg(null); world.spawnEntityInWorld(spawnedEntity); world.playAuxSFXAtEntity(null, 1016, (int) spawnedEntity.posX, (int) spawnedEntity.posY, (int) spawnedEntity.posZ, 0); world.playSoundAtEntity(entity, "mob.zombie.unfect", 1F, 1F); @@ -59,8 +226,211 @@ public class CinderEventHandler implements IFuelHandler { } } } + + // Smithing Rework event handler + if (attacker instanceof EntityPlayerMP player) { + ItemStack weapon = player.getHeldItem(); + // smithing rework for melee + if (weapon !=null && (weapon.getItem() instanceof LOTRItemSpear || weapon.getItem() instanceof LOTRItemSword || weapon.getItem() instanceof LOTRItemDagger || weapon.getItem() instanceof LOTRItemBattleaxe || weapon.getItem() instanceof LOTRItemHammer || weapon.getItem() instanceof ItemSword)) { + float[] durabilityThresholds = {0.6f, 0.5f, 0.4f}; + double[] probabilities = {0.02, 0.05, 0.1}; + + if (weapon.isItemStackDamageable()) { + float durabilityPercent = (float) (weapon.getMaxDamage() - weapon.getItemDamage() / weapon.getMaxDamage()); + for (int j = 0; j < durabilityThresholds.length; j++) { + if (durabilityPercent <= durabilityThresholds[j] && random.nextDouble() <= probabilities[j]) { + addNegativeModifier(weapon, player, "weapon"); + break; // Exit loop once a modifier is added + } + } + } + } + } + if (entity instanceof EntityPlayerMP player) { + + // Durability thresholds and corresponding probabilities for adding a negative modifier + float[] durabilityThresholds = {0.6f, 0.5f, 0.4f}; + double[] probabilities = {0.02, 0.05, 0.1}; + + for (int i = 0; i < 4; ++i) { + ItemStack armor = player.getEquipmentInSlot(i + 1); + if (armor != null && armor.isItemStackDamageable()) { + float durabilityPercent = (float) (armor.getMaxDamage() - armor.getItemDamage()) / armor.getMaxDamage(); + // Check each threshold and apply negative modifier if conditions are met + for (int j = 0; j < durabilityThresholds.length; j++) { + if (durabilityPercent <= durabilityThresholds[j] && random.nextDouble() <= probabilities[j]) { + addNegativeModifier(armor, player, "armor"); + break; // Exit loop once a modifier is added + } + } + } + } + } + } + + private void sendNegativeModifierMessage(EntityPlayerMP player, String type) { + player.addChatMessage(new ChatComponentText( + EnumChatFormatting.RED + "Your " + + EnumChatFormatting.GOLD + type + + EnumChatFormatting.RED + " has received a negative modifier!" + )); + } + private void playNegativeModifierSound(World world, double x, double y, double z) { + world.playSoundEffect(x, y, z, "mob.irongolem.hit", 1.0F, 2.0F); + } + private void addNegativeModifier(ItemStack item, EntityPlayerMP player, String type) { + NBTTagCompound tag = item.getTagCompound(); + if (tag == null) { + tag = new NBTTagCompound(); + item.setTagCompound(tag); + } + + if (!tag.hasKey("LOTREnch")) { + tag.setTag("LOTREnch", new NBTTagList()); + } + + NBTTagList enchList = tag.getTagList("LOTREnch", 8); // 8 is the type for strings + boolean protectWeakUpgraded = false; + boolean protectRangedWeakUpgraded = false; + boolean upgraded = false; + + boolean meleeSwift = false; + boolean meleeReach = false; + + if (type.equals("armor")) { + // First, iterate and upgrade if necessary + for (int i = 0; i < enchList.tagCount(); i++) { + String ench = enchList.getStringTagAt(i); + switch (ench) { + case "protectWeak1" -> { + enchList.removeTag(i); + enchList.appendTag(new NBTTagString("protectWeak2")); + protectWeakUpgraded = true; + i--; // Adjust index after removal + playNegativeModifierSound(player.worldObj, player.posX, player.posY, player.posZ); + sendNegativeModifierMessage(player, "Armor"); + } + case "protectRangedWeak1" -> { + enchList.removeTag(i); + enchList.appendTag(new NBTTagString("protectRangedWeak2")); + protectRangedWeakUpgraded = true; + i--; // Adjust index after removal + playNegativeModifierSound(player.worldObj, player.posX, player.posY, player.posZ); + sendNegativeModifierMessage(player, "Armor"); + } + case "protectWeak2" -> protectWeakUpgraded = true; + case "protectRangedWeak2" -> protectRangedWeakUpgraded = true; + } + } + // After upgrading, check if we need to add a new modifier + if (!protectWeakUpgraded || !protectRangedWeakUpgraded) { + // Separate conditions for adding new modifiers + if (!protectWeakUpgraded && !protectRangedWeakUpgraded) { + // Randomly add either protectWeak1 or protectRangedWeak1 + String[] possibleModifiers = {"protectWeak1", "protectRangedWeak1"}; + String newModifier = possibleModifiers[random.nextInt(possibleModifiers.length)]; + enchList.appendTag(new NBTTagString(newModifier)); + } else if (!protectWeakUpgraded) { + // Only protectWeak1 is added + enchList.appendTag(new NBTTagString("protectWeak1")); + } else if (!protectRangedWeakUpgraded) { + // Only protectRangedWeak1 is added + enchList.appendTag(new NBTTagString("protectRangedWeak1")); + } + playNegativeModifierSound(player.worldObj, player.posX, player.posY, player.posZ); + sendNegativeModifierMessage(player, "Armor"); + } + + tag.setTag("LOTREnch", enchList); + } else if (type.equals("bow")) { + for (int i = 0; i < enchList.tagCount(); i++) { + String ench = enchList.getStringTagAt(i); + switch (ench) { + case "rangedWeak1" -> { + enchList.removeTag(i); + enchList.appendTag(new NBTTagString("rangedWeak2")); + upgraded = true; + i--; // Adjust index after removal + playNegativeModifierSound(player.worldObj, player.posX, player.posY, player.posZ); + sendNegativeModifierMessage(player, "Bow"); + } + case "rangedWeak2" -> { + enchList.removeTag(i); + enchList.appendTag(new NBTTagString("rangedWeak3")); + upgraded = true; + i--; // Adjust index after removal + playNegativeModifierSound(player.worldObj, player.posX, player.posY, player.posZ); + sendNegativeModifierMessage(player, "Bow"); + } + case "rangedWeak3" -> upgraded = true; + } + } + if (!upgraded) { + // Randomly add either rangedWeak1... etc + String[] possibleModifiers = {"rangedWeak1", "rangedWeak2", "rangedWeak3"}; + String newModifier = possibleModifiers[random.nextInt(possibleModifiers.length)]; + enchList.appendTag(new NBTTagString(newModifier)); + playNegativeModifierSound(player.worldObj, player.posX, player.posY, player.posZ); + sendNegativeModifierMessage(player, "Weapon"); + } + } else if (type.equals("weapon")) { + // First, iterate and upgrade if necessary + for (int i = 0; i < enchList.tagCount(); i++) { + String ench = enchList.getStringTagAt(i); + switch (ench) { + case "weak1" -> { + enchList.removeTag(i); + enchList.appendTag(new NBTTagString("weak2")); + upgraded = true; + i--; // Adjust index after removal + playNegativeModifierSound(player.worldObj, player.posX, player.posY, player.posZ); + sendNegativeModifierMessage(player, "Weapon"); + } + case "weak3" -> { + enchList.removeTag(i); + enchList.appendTag(new NBTTagString("weak4")); + upgraded = true; + i--; // Adjust index after removal + playNegativeModifierSound(player.worldObj, player.posX, player.posY, player.posZ); + sendNegativeModifierMessage(player, "Weapon"); + } + case "weak4" -> upgraded = true; + case "meleeSlow1" -> meleeSwift = true; + case "meleeUnreach1" -> meleeReach = true; + } + } + // After upgrading, check if we need to add a new modifier + if (!upgraded || !meleeSwift || !meleeReach) { + // Separate conditions for adding new modifiers + if (!upgraded && !meleeSwift && !meleeReach) { + // Randomly add one of the possible modifiers + String[] possibleModifiers = {"weak1", "weak2", "weak3", "weak4", "meleeSlow1", "meleeUnreach1"}; + String newModifier = possibleModifiers[random.nextInt(possibleModifiers.length)]; + enchList.appendTag(new NBTTagString(newModifier)); + } else if (!upgraded) { + // Only weak modifier is added + String[] weakModifiers = {"weak1", "weak2", "weak3", "weak4"}; + String newModifier = weakModifiers[random.nextInt(weakModifiers.length)]; + enchList.appendTag(new NBTTagString(newModifier)); + } else if (!meleeSwift) { + // Only meleeSlow1 is added + enchList.appendTag(new NBTTagString("meleeSlow1")); + } else if (!meleeReach) { + // Only meleeUnreach1 is added + enchList.appendTag(new NBTTagString("meleeUnreach1")); + } + + playNegativeModifierSound(player.worldObj, player.posX, player.posY, player.posZ); + sendNegativeModifierMessage(player, "Weapon"); + } + + + tag.setTag("LOTREnch", enchList); + } } + + private ItemStack getRandomWeapon() { Item[] weapons = new Item[]{LOTRMod.blacksmithHammer, LOTRMod.daggerIron, LOTRMod.dunlendingTrident, LOTRMod.battleaxeBronze, CinderLoE.cleaver}; return new ItemStack(weapons[random.nextInt(weapons.length)]); diff --git a/src/main/java/com/zivilon/cinder_loe/CinderLoE_Config.java b/src/main/java/com/zivilon/cinder_loe/CinderLoE_Config.java index 47694f0..dd81b1a 100644 --- a/src/main/java/com/zivilon/cinder_loe/CinderLoE_Config.java +++ b/src/main/java/com/zivilon/cinder_loe/CinderLoE_Config.java @@ -14,6 +14,17 @@ public class CinderLoE_Config { public static float enchantment_color_blue; public static String corrupt_faction; + public static boolean objective_lindon; + public static boolean objective_arnor; + public static boolean objective_angmar; + public static boolean objective_durin; + public static boolean objective_dolguldur; + public static boolean objective_woodelf; + public static boolean objective_lothlorien; + public static boolean objective_dale; + public static boolean objective_rhudaur; + + public static void init(FMLPreInitializationEvent event) { File configFile = new File(event.getModConfigurationDirectory(), "CinderLoE.cfg"); config = new Configuration(configFile); @@ -31,6 +42,17 @@ public class CinderLoE_Config { enchantment_color_blue = config.getFloat("EnchantmentColorBlue", Configuration.CATEGORY_GENERAL, 0.608f, 0.0f, 1.0f, "Configure blue color for enchantments"); corrupt_faction = config.getString("CorruptFaction", Configuration.CATEGORY_GENERAL, "MORDOR", "Configure the alignment the Corrupt npcs follow"); + + objective_lindon = config.getBoolean("Lindon", Configuration.CATEGORY_GENERAL, false, "set true if Lindon Objective Complete"); + objective_arnor = config.getBoolean("Arnor", Configuration.CATEGORY_GENERAL, false,"set true if Arnor Objective Complete"); + objective_angmar = config.getBoolean("Angmar", Configuration.CATEGORY_GENERAL, false, "set true if Angmar Objective Complete"); + objective_durin = config.getBoolean("Durin", Configuration.CATEGORY_GENERAL, false, "set true if Durin Objective Complete"); + objective_dolguldur = config.getBoolean("Dol_Guldur", Configuration.CATEGORY_GENERAL, false,"set true if Dol Guldur Objective Complete"); + objective_woodelf = config.getBoolean("Wood_Elf", Configuration.CATEGORY_GENERAL, false, "set true if Wood Elf Objective Complete"); + objective_lothlorien = config.getBoolean("Lothlorien", Configuration.CATEGORY_GENERAL, false, "set true if Lothlorien Objective Complete"); + objective_dale = config.getBoolean("Dale", Configuration.CATEGORY_GENERAL, false, "set true if Dalish Objective Complete"); + objective_rhudaur = config.getBoolean("Rhudaur", Configuration.CATEGORY_GENERAL, false, "set true if Rhudaur Objective Complete"); + // Save the configuration if it has changed if (config.hasChanged()) { config.save(); diff --git a/src/main/java/com/zivilon/cinder_loe/CinderUnitTradeEntry.java b/src/main/java/com/zivilon/cinder_loe/CinderUnitTradeEntry.java new file mode 100644 index 0000000..e442608 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/CinderUnitTradeEntry.java @@ -0,0 +1,93 @@ +package com.zivilon.cinder_loe; + +import lotr.common.LOTRLevelData; +import lotr.common.entity.LOTREntities; +import lotr.common.entity.npc.LOTRBannerBearer; +import lotr.common.entity.npc.LOTRHireableBase; +import lotr.common.entity.npc.LOTRUnitTradeEntry; +import lotr.common.fac.LOTRFaction; +import lotr.common.item.LOTRItemCoin; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.StatCollector; +import net.minecraftforge.common.config.Configuration; + +import java.io.File; + +public class CinderUnitTradeEntry extends LOTRUnitTradeEntry { + + public Class entityClass; + private String name; + private PledgeType pledgeType = PledgeType.NONE; + private String objectivename; + private static Configuration config; + private String extraInfo; + + static { + config = new Configuration(new File("CinderLoE.cfg")); + config.load(); + } + + public CinderUnitTradeEntry(Class c, int cost, float alignment) { + super(c, cost, alignment); + this.entityClass = c; // Set entityClass to the passed class + + if (LOTRBannerBearer.class.isAssignableFrom(this.entityClass)) { + this.setExtraInfo("Banner"); + } + } + + public CinderUnitTradeEntry(Class c, Class c1, String s, int cost, float alignment) { + super(c, cost, alignment); + this.entityClass = c; // Set entityClass to the passed class + this.mountClass = c1; + this.name = s; + } + + public boolean isObjectiveComplete(String objective) { + return config.getBoolean(objective, Configuration.CATEGORY_GENERAL, false, "Set true if " + objective + " is complete"); + } + + @Override + public boolean hasRequiredCostAndAlignment(EntityPlayer entityplayer, LOTRHireableBase trader) { + int coins = LOTRItemCoin.getInventoryValue(entityplayer, false); + if (coins < this.getCost(entityplayer, trader)) { + return false; + } + LOTRFaction fac = trader.getFaction(); + if (!this.pledgeType.canAcceptPlayer(entityplayer, fac)) { + return false; + } + if (objectivename != null && !isObjectiveComplete(objectivename)) { + return false; + } + float alignment = LOTRLevelData.getData(entityplayer).getAlignment(fac); + return alignment >= this.alignmentRequired; + } + + public CinderUnitTradeEntry setObjective(String objective) { + this.objectivename = objective; + return this; + } + + public String getFormattedExtraInfo() { + return StatCollector.translateToLocal((String) "lotr.unitinfo." + this.objectivename); + } + + public LOTRUnitTradeEntry setExtraInfo(String s) { + this.extraInfo = s; + return this; + } + + public boolean hasExtraInfo() { + return this.extraInfo != null; + } + + public String getUnitTradeName() { + if (this.mountClass == null) { + String entityName = LOTREntities.getStringFromClass(this.entityClass); + return StatCollector.translateToLocal((String)("entity." + entityName + ".name")); + } + return StatCollector.translateToLocal((String)("lotr.unit." + this.name)); + } + +} diff --git a/src/main/java/com/zivilon/cinder_loe/ItemRegistration.java b/src/main/java/com/zivilon/cinder_loe/ItemRegistration.java index aade39f..8d75f32 100644 --- a/src/main/java/com/zivilon/cinder_loe/ItemRegistration.java +++ b/src/main/java/com/zivilon/cinder_loe/ItemRegistration.java @@ -3,12 +3,24 @@ package com.zivilon.cinder_loe; import java.util.AbstractMap.SimpleEntry; import java.util.ArrayList; import java.util.List; +import net.minecraft.block.Block; import net.minecraft.item.Item; +import cpw.mods.fml.common.registry.GameData; import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry; public class ItemRegistration { + public static FMLControlledNamespacedRegistry block_registry; + public static FMLControlledNamespacedRegistry item_registry; + + static { + block_registry = GameData.getBlockRegistry(); + item_registry = GameData.getItemRegistry(); + } + public static List> list = new ArrayList<>(); + @Deprecated public static void registerItem(Item item, String item_name, int ordinal) { while (list.size() <= ordinal) { list.add(new SimpleEntry<>(null, null)); @@ -29,4 +41,11 @@ public class ItemRegistration { GameRegistry.registerItem(entry.getKey(), entry.getValue()); } } + + public static void register(Item item, String item_name, int id) { + item_registry.addObject(id, item_name, item); + } + public static void register(Block block, String item_name, int id) { + block_registry.addObject(id, item_name, block); + } } diff --git a/src/main/java/com/zivilon/cinder_loe/LoECreativeTabs.java b/src/main/java/com/zivilon/cinder_loe/LoECreativeTabs.java index 4738a99..472b4d4 100644 --- a/src/main/java/com/zivilon/cinder_loe/LoECreativeTabs.java +++ b/src/main/java/com/zivilon/cinder_loe/LoECreativeTabs.java @@ -28,7 +28,7 @@ public class LoECreativeTabs extends CreativeTabs { tabSpawnLoE.theIcon = new ItemStack(CinderLoE.spawnEgg); tabMiscLoE.theIcon = new ItemStack(CinderLoE.bonemold); tabFoodLoE.theIcon = new ItemStack(CinderLoE.onion); - tabDecoLoE.theIcon = new ItemStack(CinderLoE.silverChain); + tabDecoLoE.theIcon = new ItemStack(CinderLoE.goldChain); tabCharacterLoE.theIcon = new ItemStack(CinderLoE.sarumanStaff); } diff --git a/src/main/java/com/zivilon/cinder_loe/LoEDamage.java b/src/main/java/com/zivilon/cinder_loe/LoEDamage.java new file mode 100644 index 0000000..d148063 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/LoEDamage.java @@ -0,0 +1,7 @@ +package com.zivilon.cinder_loe; + +import net.minecraft.util.DamageSource; + +public class LoEDamage { + public static DamageSource shadow = (new DamageSource("cinder_loe.shadow")).setDamageBypassesArmor().setMagicDamage(); +} diff --git a/src/main/java/com/zivilon/cinder_loe/Materials.java b/src/main/java/com/zivilon/cinder_loe/Materials.java index 4990c3a..1c6d44f 100644 --- a/src/main/java/com/zivilon/cinder_loe/Materials.java +++ b/src/main/java/com/zivilon/cinder_loe/Materials.java @@ -21,14 +21,10 @@ public class Materials { modifyMaterial("RHUDAUR", 300, 2.5F, 0.6F, 2, 6.0F, 10, LOTRMod.fur); modifyMaterial("BATTLENUN", 300, 3F, 0.6F, 2, 6.0F, 10, Items.iron_ingot); modifyMaterial("ASH", 2000, 0.0F, 0.6F, 2, 7.0F, 10, CinderLoE.ingotAsh); - modifyMaterial("SERPENT", 650,2.0F, 0.6F, 2, 6.0F, 10, LOTRMod.bronze); - 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("SERPENT", 650, 2.0F, 0.6F, 2, 6.0F, 10, LOTRMod.bronze); + 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, null); - modifyMaterial("NEX_FIRE",1500, 0.0F, 0.8F, 0, 9.0F, 10, null); - modifyMaterial("NEX_TOXIN",1500, 0.0F, 0.8F, 0, 9.0F, 10, null); - modifyMaterial("NEX_SHADOW",1500, 0.0F, 0.8F, 0, 9.0F, 10, null); } 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/BarsBase.java b/src/main/java/com/zivilon/cinder_loe/blocks/BarsBase.java index 0dab051..c159a43 100644 --- a/src/main/java/com/zivilon/cinder_loe/blocks/BarsBase.java +++ b/src/main/java/com/zivilon/cinder_loe/blocks/BarsBase.java @@ -1,5 +1,6 @@ package com.zivilon.cinder_loe.blocks; +import com.zivilon.cinder_loe.LoECreativeTabs; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -26,7 +27,7 @@ public abstract class BarsBase extends BlockPane { super("", "", Material.iron, true); this.textureName = Utilities.toSnakeCase(blockName); this.setBlockName(blockName); - setCreativeTab((CreativeTabs)LOTRCreativeTabs.tabDeco); + this.setCreativeTab(LoECreativeTabs.tabBlockLoE); setHardness(5.0F); setResistance(10.0F); setStepSound(Block.soundTypeMetal); diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/BlockRedDwarfSteel.java b/src/main/java/com/zivilon/cinder_loe/blocks/BlockRedDwarfSteel.java index 3715765..df907fa 100644 --- a/src/main/java/com/zivilon/cinder_loe/blocks/BlockRedDwarfSteel.java +++ b/src/main/java/com/zivilon/cinder_loe/blocks/BlockRedDwarfSteel.java @@ -1,5 +1,6 @@ package com.zivilon.cinder_loe.blocks; +import com.zivilon.cinder_loe.LoECreativeTabs; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -16,13 +17,7 @@ public class BlockRedDwarfSteel extends Block { public BlockRedDwarfSteel() { super(Material.iron); // Choose the appropriate material - try { - Field tabField = LOTRCreativeTabs.class.getDeclaredField("tabBlock"); // Stupid workaround because ForgeGradle tries to obfuscate field LOTRCreativeTabs.tabBlock when it's not supposed to - LOTRCreativeTabs tab = (LOTRCreativeTabs)tabField.get(null); - setCreativeTab((CreativeTabs)tab); - } catch (NoSuchFieldException | IllegalAccessException e) { - e.printStackTrace(); - } + this.setCreativeTab(LoECreativeTabs.tabBlockLoE); setHardness(5.0F); setResistance(15.0F); setStepSound(Block.soundTypeMetal); diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/ChandelierBase.java b/src/main/java/com/zivilon/cinder_loe/blocks/ChandelierBase.java index 1f345e5..af002f2 100644 --- a/src/main/java/com/zivilon/cinder_loe/blocks/ChandelierBase.java +++ b/src/main/java/com/zivilon/cinder_loe/blocks/ChandelierBase.java @@ -1,5 +1,6 @@ package com.zivilon.cinder_loe.blocks; +import com.zivilon.cinder_loe.LoECreativeTabs; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -29,7 +30,7 @@ public abstract class ChandelierBase extends Block { super(Material.circuits); this.textureName = Utilities.toSnakeCase(blockName); this.setBlockName(blockName); - setCreativeTab((CreativeTabs)LOTRCreativeTabs.tabDeco); + this.setCreativeTab(LoECreativeTabs.tabBlockLoE); setHardness(0.0F); setResistance(2.0F); setStepSound(Block.soundTypeMetal); diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/CinderChain.java b/src/main/java/com/zivilon/cinder_loe/blocks/CinderChain.java new file mode 100644 index 0000000..2aa4fa2 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/blocks/CinderChain.java @@ -0,0 +1,149 @@ +package com.zivilon.cinder_loe.blocks; + +import com.zivilon.cinder_loe.LoECreativeTabs; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import lotr.common.block.LOTRBlockOrcChain; +import net.minecraft.block.*; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +import java.util.List; + +public class CinderChain extends LOTRBlockOrcChain { + + public static final String[] chainTypes = {"bronze", "gold", "silver", "iron"}; + @SideOnly(value= Side.CLIENT) + private IIcon[] iconMiddle; + @SideOnly(value=Side.CLIENT) + private IIcon[] iconTop; + @SideOnly(value=Side.CLIENT) + private IIcon[] iconBottom; + @SideOnly(value=Side.CLIENT) + private IIcon[] iconSingle; + @SideOnly(Side.CLIENT) + private IIcon[] iconItem; + + + public CinderChain() { + this.setCreativeTab(LoECreativeTabs.tabDecoLoE); + this.setHardness(1.0f); + this.setStepSound(Block.soundTypeMetal); + setBlockName("lotr:cinderchain"); + setBlockTextureName("lotr:cinderchain"); + float f = 0.2f; + this.setBlockBounds(0.5f - f, 0.0f, 0.5f - f, 0.5f + f, 1.0f, 0.5f + f); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerBlockIcons(IIconRegister iconRegister) { + + this.iconItem = new IIcon[chainTypes.length]; + + for (int i = 0; i < chainTypes.length; ++i) { + this.iconItem[i] = iconRegister.registerIcon(this.getTextureName() + "_" + chainTypes[i] + "_item"); + } + + this.iconMiddle = new IIcon[chainTypes.length]; + this.iconTop = new IIcon[chainTypes.length]; + this.iconBottom = new IIcon[chainTypes.length]; + this.iconSingle = new IIcon[chainTypes.length]; + + for (int i = 0; i < chainTypes.length; ++i) { + this.iconMiddle[i] = iconRegister.registerIcon(this.getTextureName() + "_" + chainTypes[i] + "_mid"); + this.iconTop[i] = iconRegister.registerIcon(this.getTextureName() + "_" + chainTypes[i] + "_top"); + this.iconBottom[i] = iconRegister.registerIcon(this.getTextureName() + "_" + chainTypes[i] + "_bottom"); + this.iconSingle[i] = iconRegister.registerIcon(this.getTextureName() + "_" + chainTypes[i] + "_single"); + } + } + @SideOnly(Side.CLIENT) + @Override + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { + Block above = world.getBlock(x, y + 1, z); + Block below = world.getBlock(x, y - 1, z); + boolean chainAbove = above instanceof CinderChain; + boolean chainBelow = below instanceof CinderChain; + + int meta = world.getBlockMetadata(x, y, z); + if (chainAbove && chainBelow) { + return this.iconMiddle[meta]; + } + if (chainAbove) { + return this.iconBottom[meta]; + } + if (chainBelow) { + return this.iconTop[meta]; + } + return this.iconSingle[meta]; + } + + @SideOnly(value=Side.CLIENT) + public IIcon getIcon(int i, int j) { + return i == 1 ? this.iconItem[0] : this.iconItem[1]; + } + + @SideOnly(value=Side.CLIENT) + public String getItemIconName() { + return this.getTextureName(); + } + + @Override + public int damageDropped(int meta) { + return meta; + } + + @SideOnly(Side.CLIENT) + @Override + public void getSubBlocks(Item item, CreativeTabs tab, List list) { + for (int i = 0; i < chainTypes.length; ++i) { + list.add(new ItemStack(item, 1, i)); + } + } + + @Override + public int onBlockPlaced(World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) { + // The metadata provided here is the metadata of the block being placed (from the item stack). + return metadata; // Return the metadata of the block that should be placed. + } + + + @Override + public boolean canPlaceBlockAt(World world, int x, int y, int z) { + Block blockAbove = world.getBlock(x, y + 1, z); + int metaAbove = world.getBlockMetadata(x, y + 1, z); + + // Get the metadata of the block to be placed (already handled by onBlockPlaced) + int currentMeta = world.getBlockMetadata(x, y, z); // Metadata of the block being placed + + // Check if the block above is a chain block and if the metadata matches + if (blockAbove instanceof CinderChain) { + if (metaAbove != currentMeta) { + return false; // Prevent placement of different types of chains + } + return true; // Same type, allow placement + } + + // Other checks for fences, walls, slabs, etc. + if (blockAbove instanceof BlockFence || blockAbove instanceof BlockWall) { + return true; + } + if (blockAbove instanceof BlockSlab && !blockAbove.isOpaqueCube() && (metaAbove & 8) == 0) { + return true; + } + if (blockAbove instanceof BlockStairs && (metaAbove & 4) == 0) { + return true; + } + + // Check if the block above is solid on the bottom + return blockAbove.isSideSolid(world, x, y + 1, z, ForgeDirection.DOWN); + } + + +} diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/CinderFurBlock.java b/src/main/java/com/zivilon/cinder_loe/blocks/CinderFurBlock.java new file mode 100644 index 0000000..af2ad42 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/blocks/CinderFurBlock.java @@ -0,0 +1,64 @@ +package com.zivilon.cinder_loe.blocks; + +import com.zivilon.cinder_loe.LoECreativeTabs; +import com.zivilon.cinder_loe.util.Utilities; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import lotr.common.LOTRCreativeTabs; +import lotr.common.block.LOTRBlockBrickBase; +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.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +import java.lang.reflect.Field; +import java.util.List; + +public class CinderFurBlock extends Block { + protected IIcon[] brickIcons; + protected String[] brickNames; + + + public CinderFurBlock() { + super(Material.cloth); + this.setCreativeTab(LoECreativeTabs.tabBlockLoE); + setBlockTextureName("lotr:cinderfur"); + setBlockName("lotr:cinderfur"); + setStepSound(Block.soundTypeCloth); + this.setBrickNames("brown", "gray", "black", "white", "obsidian", "bearblack", "bearbrown", "lion", "lioness"); + } + + protected void setBrickNames(String ... names) { + this.brickNames = names; + } + + @SideOnly(Side.CLIENT) + @Override + public void registerBlockIcons(IIconRegister iconregister) { + this.brickIcons = new IIcon[this.brickNames.length]; + for (int i = 0; i < this.brickNames.length; ++i) { + String texturePath = this.getTextureName() + "_" + this.brickNames[i]; + System.out.println("Registering texture: " + texturePath); // Debug log + this.brickIcons[i] = iconregister.registerIcon(texturePath); + } + } + @Override + public IIcon getIcon(int side, int meta) { + return this.brickIcons[meta]; + } + + @Override + public int damageDropped(int meta) { + return meta; + } + @SideOnly(Side.CLIENT) + @Override + public void getSubBlocks(Item item, CreativeTabs tab, List list) { + for (int i = 0; i < this.brickNames.length; ++i) { + list.add(new ItemStack(item, 1, i)); + } + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/CobbleBlock.java b/src/main/java/com/zivilon/cinder_loe/blocks/CobbleBlock.java index 550d7ca..9e8c110 100644 --- a/src/main/java/com/zivilon/cinder_loe/blocks/CobbleBlock.java +++ b/src/main/java/com/zivilon/cinder_loe/blocks/CobbleBlock.java @@ -1,5 +1,6 @@ package com.zivilon.cinder_loe.blocks; +import com.zivilon.cinder_loe.LoECreativeTabs; import com.zivilon.cinder_loe.util.Utilities; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -26,15 +27,7 @@ public class CobbleBlock extends Block { this.setHardness(1.5f); this.setResistance(10.0f); this.setStepSound(Block.soundTypeStone); - - try { - Field tabField = LOTRCreativeTabs.class.getDeclaredField("tabBlock"); // Stupid workaround because ForgeGradle tries to obfuscate field LOTRCreativeTabs.tabBlock when it's not supposed to - LOTRCreativeTabs tab = (LOTRCreativeTabs)tabField.get(null); - setCreativeTab((CreativeTabs)tab); - } catch (NoSuchFieldException | IllegalAccessException e) { - e.printStackTrace(); - } - + this.setCreativeTab(LoECreativeTabs.tabBlockLoE); setBlockTextureName("lotr:cindercobble"); setBlockName("lotr:cindercobble"); this.setBrickNames("drystone", "mordor"); 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/FishBarrel.java b/src/main/java/com/zivilon/cinder_loe/blocks/FishBarrel.java index 30b483a..d857567 100644 --- a/src/main/java/com/zivilon/cinder_loe/blocks/FishBarrel.java +++ b/src/main/java/com/zivilon/cinder_loe/blocks/FishBarrel.java @@ -1,5 +1,6 @@ package com.zivilon.cinder_loe.blocks; +import com.zivilon.cinder_loe.LoECreativeTabs; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import lotr.common.LOTRCreativeTabs; @@ -15,13 +16,7 @@ public class FishBarrel extends StaticBlockBase3 { public FishBarrel() { super(Material.wood, "lotr:fishbarrel"); - try { - Field tabField = LOTRCreativeTabs.class.getDeclaredField("tabDeco"); // Stupid workaround because ForgeGradle tries to obfuscate field LOTRCreativeTabs.tabBlock when it's not supposed to - LOTRCreativeTabs tab = (LOTRCreativeTabs)tabField.get(null); - setCreativeTab((CreativeTabs)tab); - } catch (NoSuchFieldException | IllegalAccessException e) { - e.printStackTrace(); - } + this.setCreativeTab(LoECreativeTabs.tabDecoLoE); setStepSound(Block.soundTypeWood); setBlockName("lotr:fishbarrel"); setHardness(1.0F); diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/FurBundle.java b/src/main/java/com/zivilon/cinder_loe/blocks/FurBundle.java index b05ebb7..398a03d 100644 --- a/src/main/java/com/zivilon/cinder_loe/blocks/FurBundle.java +++ b/src/main/java/com/zivilon/cinder_loe/blocks/FurBundle.java @@ -1,5 +1,6 @@ package com.zivilon.cinder_loe.blocks; +import com.zivilon.cinder_loe.LoECreativeTabs; import com.zivilon.cinder_loe.blocks.RotatableBlockBase3; import lotr.common.LOTRCreativeTabs; import net.minecraft.block.Block; @@ -12,13 +13,7 @@ import java.lang.reflect.Field; public class FurBundle extends RotatableBlockBase3 { public FurBundle() { super(Material.cloth, "lotr:furBundle"); - try { - Field tabField = LOTRCreativeTabs.class.getDeclaredField("tabDeco"); // Stupid workaround because ForgeGradle tries to obfuscate field LOTRCreativeTabs.tabBlock when it's not supposed to - LOTRCreativeTabs tab = (LOTRCreativeTabs)tabField.get(null); - setCreativeTab((CreativeTabs)tab); - } catch (NoSuchFieldException | IllegalAccessException e) { - e.printStackTrace(); - } + this.setCreativeTab(LoECreativeTabs.tabDecoLoE); setStepSound(Block.soundTypeCloth); setBlockName("lotr:furBundle"); setHardness(0.5F); diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/FurCarpet.java b/src/main/java/com/zivilon/cinder_loe/blocks/FurCarpet.java new file mode 100644 index 0000000..ad481af --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/blocks/FurCarpet.java @@ -0,0 +1,45 @@ +package com.zivilon.cinder_loe.blocks; + +import com.zivilon.cinder_loe.CinderLoE; +import com.zivilon.cinder_loe.LoECreativeTabs; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.BlockCarpet; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +import java.util.List; + +public class FurCarpet extends BlockCarpet { + public FurCarpet() + { + super(); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F); + this.setTickRandomly(true); + this.setCreativeTab(LoECreativeTabs.tabDecoLoE); + this.func_150089_b(0); + setBlockName("lotr:cinderfurcarpet"); + setStepSound(Block.soundTypeCloth); + } + + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return CinderLoE.cinderfur.getIcon(side, meta); + } + + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + for (int i = 0; i < 9; ++i) + { + list.add(new ItemStack(itemIn, 1, i)); + } + } + +} 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 a5cc3d5..0000000 --- a/src/main/java/com/zivilon/cinder_loe/blocks/IceCage.java +++ /dev/null @@ -1,200 +0,0 @@ -package com.zivilon.cinder_loe.blocks; - -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); - } - - @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.emptyIcon; - } - 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 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/LeatherBundle.java b/src/main/java/com/zivilon/cinder_loe/blocks/LeatherBundle.java index a841847..1ae87f7 100644 --- a/src/main/java/com/zivilon/cinder_loe/blocks/LeatherBundle.java +++ b/src/main/java/com/zivilon/cinder_loe/blocks/LeatherBundle.java @@ -1,5 +1,6 @@ package com.zivilon.cinder_loe.blocks; +import com.zivilon.cinder_loe.LoECreativeTabs; import com.zivilon.cinder_loe.blocks.RotatableBlockBase3; import lotr.common.LOTRCreativeTabs; import net.minecraft.block.Block; @@ -12,13 +13,7 @@ import java.lang.reflect.Field; public class LeatherBundle extends RotatableBlockBase3 { public LeatherBundle() { super(Material.cloth, "lotr:leatherBundle"); - try { - Field tabField = LOTRCreativeTabs.class.getDeclaredField("tabDeco"); // Stupid workaround because ForgeGradle tries to obfuscate field LOTRCreativeTabs.tabBlock when it's not supposed to - LOTRCreativeTabs tab = (LOTRCreativeTabs)tabField.get(null); - setCreativeTab((CreativeTabs)tab); - } catch (NoSuchFieldException | IllegalAccessException e) { - e.printStackTrace(); - } + this.setCreativeTab(LoECreativeTabs.tabDecoLoE); setStepSound(Block.soundTypeCloth); setBlockName("lotr:leatherBundle"); setHardness(0.5F); diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/ReedBale.java b/src/main/java/com/zivilon/cinder_loe/blocks/ReedBale.java index 467767b..3d173f5 100644 --- a/src/main/java/com/zivilon/cinder_loe/blocks/ReedBale.java +++ b/src/main/java/com/zivilon/cinder_loe/blocks/ReedBale.java @@ -1,5 +1,6 @@ package com.zivilon.cinder_loe.blocks; +import com.zivilon.cinder_loe.LoECreativeTabs; import com.zivilon.cinder_loe.blocks.RotatableBlockBase3; import lotr.common.LOTRCreativeTabs; import net.minecraft.block.Block; @@ -12,13 +13,7 @@ import java.lang.reflect.Field; public class ReedBale extends RotatableBlockBase3 { public ReedBale() { super(Material.grass, "lotr:reedBale"); - try { - Field tabField = LOTRCreativeTabs.class.getDeclaredField("tabDeco"); // Stupid workaround because ForgeGradle tries to obfuscate field LOTRCreativeTabs.tabBlock when it's not supposed to - LOTRCreativeTabs tab = (LOTRCreativeTabs)tabField.get(null); - setCreativeTab((CreativeTabs)tab); - } catch (NoSuchFieldException | IllegalAccessException e) { - e.printStackTrace(); - } + setCreativeTab(LoECreativeTabs.tabDecoLoE); setStepSound(Block.soundTypeGrass); setBlockName("lotr:reedBale"); setHardness(0.5F); diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/RunedDwarvenBrick.java b/src/main/java/com/zivilon/cinder_loe/blocks/RunedDwarvenBrick.java index 3b0541f..9afd624 100644 --- a/src/main/java/com/zivilon/cinder_loe/blocks/RunedDwarvenBrick.java +++ b/src/main/java/com/zivilon/cinder_loe/blocks/RunedDwarvenBrick.java @@ -1,5 +1,6 @@ package com.zivilon.cinder_loe.blocks; +import com.zivilon.cinder_loe.LoECreativeTabs; import lotr.common.LOTRCreativeTabs; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -19,13 +20,7 @@ public class RunedDwarvenBrick extends Block { public RunedDwarvenBrick() { super(Material.rock); // Choose the appropriate material - try { - Field tabField = LOTRCreativeTabs.class.getDeclaredField("tabDeco"); // Stupid workaround because ForgeGradle tries to obfuscate field LOTRCreativeTabs.tabBlock when it's not supposed to - LOTRCreativeTabs tab = (LOTRCreativeTabs)tabField.get(null); - setCreativeTab((CreativeTabs)tab); - } catch (NoSuchFieldException | IllegalAccessException e) { - e.printStackTrace(); - } + setCreativeTab(LoECreativeTabs.tabDecoLoE); // Set other properties like hardness, resistance, name, etc. setHardness(2.0F); setResistance(5.0F); 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 7ad60e4..0000000 --- a/src/main/java/com/zivilon/cinder_loe/blocks/ShadowTile.java +++ /dev/null @@ -1,44 +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 cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -import java.lang.reflect.Field; - -public class ShadowTile extends BlockPressurePlate { - - public ShadowTile() { - super("lotr:shadow_tile", Material.rock, BlockPressurePlate.Sensitivity.players); - try { - Field tabField = LOTRCreativeTabs.class.getDeclaredField("tabMisc"); // Stupid workaround because ForgeGradle tries to obfuscate field LOTRCreativeTabs.tabBlock when it's not supposed to - LOTRCreativeTabs tab = (LOTRCreativeTabs)tabField.get(null); - setCreativeTab((CreativeTabs)tab); - } catch (NoSuchFieldException | IllegalAccessException e) { - e.printStackTrace(); - } - setBlockTextureName("lotr:shadow_tile"); - setBlockName("lotr:shadowTile"); - } - - @Override - public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) { - if (entity instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer)entity; - player.attackEntityFrom(new DamageSource("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/blocks/cutDrystone.java b/src/main/java/com/zivilon/cinder_loe/blocks/cutDrystone.java index 7697104..74beb96 100644 --- a/src/main/java/com/zivilon/cinder_loe/blocks/cutDrystone.java +++ b/src/main/java/com/zivilon/cinder_loe/blocks/cutDrystone.java @@ -1,5 +1,6 @@ package com.zivilon.cinder_loe.blocks; +import com.zivilon.cinder_loe.LoECreativeTabs; import com.zivilon.cinder_loe.util.Utilities; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -16,13 +17,7 @@ public class cutDrystone extends Block { public cutDrystone() { super(Material.rock); // Choose the appropriate material // Set other properties like hardness, resistance, name, etc. - try { - Field tabField = LOTRCreativeTabs.class.getDeclaredField("tabBlock"); // Stupid workaround because ForgeGradle tries to obfuscate field LOTRCreativeTabs.tabBlock when it's not supposed to - LOTRCreativeTabs tab = (LOTRCreativeTabs)tabField.get(null); - setCreativeTab((CreativeTabs)tab); - } catch (NoSuchFieldException | IllegalAccessException e) { - e.printStackTrace(); - } + this.setCreativeTab(LoECreativeTabs.tabBlockLoE); setHardness(2.0F); setResistance(5.0F); setBlockTextureName(Utilities.toSnakeCase("lotr:cut_drystone")); diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/reeflessCoral.java b/src/main/java/com/zivilon/cinder_loe/blocks/reeflessCoral.java index 3ad20a2..67294ee 100644 --- a/src/main/java/com/zivilon/cinder_loe/blocks/reeflessCoral.java +++ b/src/main/java/com/zivilon/cinder_loe/blocks/reeflessCoral.java @@ -1,5 +1,6 @@ package com.zivilon.cinder_loe.blocks; +import com.zivilon.cinder_loe.LoECreativeTabs; import com.zivilon.cinder_loe.util.Utilities; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -15,13 +16,7 @@ public class reeflessCoral extends Block { public reeflessCoral() { super(Material.rock); // Choose the appropriate material - try { - Field tabField = LOTRCreativeTabs.class.getDeclaredField("tabDeco"); // Stupid workaround because ForgeGradle tries to obfuscate field LOTRCreativeTabs.tabBlock when it's not supposed to - LOTRCreativeTabs tab = (LOTRCreativeTabs)tabField.get(null); - setCreativeTab((CreativeTabs)tab); - } catch (NoSuchFieldException | IllegalAccessException e) { - e.printStackTrace(); - } + setCreativeTab(LoECreativeTabs.tabBlockLoE); // Set other properties like hardness, resistance, name, etc. setHardness(2.0F); setResistance(5.0F); diff --git a/src/main/java/com/zivilon/cinder_loe/character/CharacterEventListener.java b/src/main/java/com/zivilon/cinder_loe/character/CharacterEventListener.java index b7c00d0..e76917f 100644 --- a/src/main/java/com/zivilon/cinder_loe/character/CharacterEventListener.java +++ b/src/main/java/com/zivilon/cinder_loe/character/CharacterEventListener.java @@ -16,7 +16,7 @@ import java.util.ArrayList; import java.util.List; import java.util.UUID; -import com.zivilon.cinder_loe.entity.npc.FangornAnimal; +import com.zivilon.cinder_loe.entity.npc.radagast.FangornAnimal; public class CharacterEventListener { diff --git a/src/main/java/com/zivilon/cinder_loe/client/model/ModelFangornElk.java b/src/main/java/com/zivilon/cinder_loe/client/model/ModelFangornElk.java index 80829f9..62d5b9a 100644 --- a/src/main/java/com/zivilon/cinder_loe/client/model/ModelFangornElk.java +++ b/src/main/java/com/zivilon/cinder_loe/client/model/ModelFangornElk.java @@ -7,7 +7,7 @@ import net.minecraft.entity.Entity; import net.minecraft.util.MathHelper; import org.lwjgl.opengl.GL11; -import com.zivilon.cinder_loe.entity.npc.FangornElk; +import com.zivilon.cinder_loe.entity.npc.radagast.FangornElk; public class ModelFangornElk extends ModelBase { private ModelRenderer body; diff --git a/src/main/java/com/zivilon/cinder_loe/client/model/ModelFangornWolf.java b/src/main/java/com/zivilon/cinder_loe/client/model/ModelFangornWolf.java index 6560992..d7db6fe 100644 --- a/src/main/java/com/zivilon/cinder_loe/client/model/ModelFangornWolf.java +++ b/src/main/java/com/zivilon/cinder_loe/client/model/ModelFangornWolf.java @@ -7,7 +7,7 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.MathHelper; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; -import com.zivilon.cinder_loe.entity.npc.FangornWolf; +import com.zivilon.cinder_loe.entity.npc.radagast.FangornWolf; @SideOnly(Side.CLIENT) public class ModelFangornWolf extends ModelBase { 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/render/RenderBattleNun.java b/src/main/java/com/zivilon/cinder_loe/client/render/RenderBattleNun.java index 2be6d72..bb0cfae 100644 --- a/src/main/java/com/zivilon/cinder_loe/client/render/RenderBattleNun.java +++ b/src/main/java/com/zivilon/cinder_loe/client/render/RenderBattleNun.java @@ -1,6 +1,6 @@ package com.zivilon.cinder_loe.client.render; -import com.zivilon.cinder_loe.entity.npc.BattleNun; +import com.zivilon.cinder_loe.entity.npc.good_human.BattleNun; import lotr.client.model.LOTRModelHuman; import lotr.client.render.entity.LOTRRenderBiped; import lotr.client.render.entity.LOTRRandomSkins; diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/RenderFangornAuroch.java b/src/main/java/com/zivilon/cinder_loe/client/render/RenderFangornAuroch.java index dc0b76b..8378879 100644 --- a/src/main/java/com/zivilon/cinder_loe/client/render/RenderFangornAuroch.java +++ b/src/main/java/com/zivilon/cinder_loe/client/render/RenderFangornAuroch.java @@ -8,7 +8,7 @@ import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; import com.zivilon.cinder_loe.client.model.ModelFangornAuroch; -import com.zivilon.cinder_loe.entity.npc.FangornAuroch; +import com.zivilon.cinder_loe.entity.npc.radagast.FangornAuroch; public class RenderFangornAuroch extends RenderLiving { public static LOTRRandomSkins aurochsSkins; diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/RenderFangornBear.java b/src/main/java/com/zivilon/cinder_loe/client/render/RenderFangornBear.java index 12d0daa..332c86f 100644 --- a/src/main/java/com/zivilon/cinder_loe/client/render/RenderFangornBear.java +++ b/src/main/java/com/zivilon/cinder_loe/client/render/RenderFangornBear.java @@ -1,6 +1,6 @@ package com.zivilon.cinder_loe.client.render; -import com.zivilon.cinder_loe.entity.npc.FangornBear; +import com.zivilon.cinder_loe.entity.npc.radagast.FangornBear; import java.util.HashMap; import java.util.Map; diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/RenderFangornElk.java b/src/main/java/com/zivilon/cinder_loe/client/render/RenderFangornElk.java index f7d3824..a34b632 100644 --- a/src/main/java/com/zivilon/cinder_loe/client/render/RenderFangornElk.java +++ b/src/main/java/com/zivilon/cinder_loe/client/render/RenderFangornElk.java @@ -8,7 +8,7 @@ import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; import com.zivilon.cinder_loe.client.model.ModelFangornElk; -import com.zivilon.cinder_loe.entity.npc.FangornElk; +import com.zivilon.cinder_loe.entity.npc.radagast.FangornElk; public class RenderFangornElk extends RenderLiving { private static LOTRRandomSkins elkSkins; diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/RenderLimwaith.java b/src/main/java/com/zivilon/cinder_loe/client/render/RenderLimwaith.java index 75d923b..df82b8e 100644 --- a/src/main/java/com/zivilon/cinder_loe/client/render/RenderLimwaith.java +++ b/src/main/java/com/zivilon/cinder_loe/client/render/RenderLimwaith.java @@ -11,7 +11,7 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.util.ResourceLocation; -import com.zivilon.cinder_loe.entity.npc.Limwaith; +import com.zivilon.cinder_loe.entity.npc.evil_human.Limwaith; public class RenderLimwaith extends LOTRRenderBiped { public static LOTRRandomSkins skinsMale; diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/RenderLimwaithShaman.java b/src/main/java/com/zivilon/cinder_loe/client/render/RenderLimwaithShaman.java index 6efa0d2..7b92011 100644 --- a/src/main/java/com/zivilon/cinder_loe/client/render/RenderLimwaithShaman.java +++ b/src/main/java/com/zivilon/cinder_loe/client/render/RenderLimwaithShaman.java @@ -1,6 +1,6 @@ package com.zivilon.cinder_loe.client.render; -import com.zivilon.cinder_loe.entity.npc.Limwaith; +import com.zivilon.cinder_loe.entity.npc.evil_human.Limwaith; import lotr.client.render.entity.LOTRRandomSkins; import net.minecraft.client.model.ModelBase; import net.minecraft.entity.EntityLiving; 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 286829b..0000000 --- a/src/main/java/com/zivilon/cinder_loe/client/render/RenderNex.java +++ /dev/null @@ -1,134 +0,0 @@ -package lotr.client.render.entity; - -import com.zivilon.cinder_loe.client.model.ModelNex; -import com.zivilon.cinder_loe.entity.Nex; -import lotr.common.entity.LOTRRandomSkinEntity; -import lotr.common.entity.npc.LOTREntityBalrog; -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/block/RenderIceCage.java b/src/main/java/com/zivilon/cinder_loe/client/render/block/RenderIceCage.java deleted file mode 100644 index a52b040..0000000 --- a/src/main/java/com/zivilon/cinder_loe/client/render/block/RenderIceCage.java +++ /dev/null @@ -1,76 +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 - - GL11.glPushMatrix(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - - // 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); - } - - GL11.glDisable(GL11.GL_BLEND); - GL11.glPopMatrix(); - - 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/coremod/LOTRMaterialTransformer.java b/src/main/java/com/zivilon/cinder_loe/coremod/LOTRMaterialTransformer.java index abd5c93..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,10 +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); // 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 8a31da6..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"); + "daggerAsh","bowAsh","hammerAsh","pikeAsh","battleaxeAsh","swordAsh","spearAsh", "staffAsh"); } return basicClass; } diff --git a/src/main/java/com/zivilon/cinder_loe/enchants/LOTREnchantmentWeakProtectionRanged.java b/src/main/java/com/zivilon/cinder_loe/enchants/LOTREnchantmentWeakProtectionRanged.java new file mode 100644 index 0000000..d4fac14 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/enchants/LOTREnchantmentWeakProtectionRanged.java @@ -0,0 +1,50 @@ +package com.zivilon.cinder_loe.enchants; + +import lotr.common.enchant.LOTREnchantmentProtectionRanged; +import lotr.common.enchant.LOTREnchantmentProtectionSpecial; +import lotr.common.item.LOTRMaterial; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.util.DamageSource; +import net.minecraft.util.StatCollector; + +public class LOTREnchantmentWeakProtectionRanged extends LOTREnchantmentProtectionSpecial { + + public LOTREnchantmentWeakProtectionRanged(String s, int level) { + super(s, level); + } + + @Override + public String getDescription(ItemStack itemstack) { + return StatCollector.translateToLocalFormatted((String)"lotr.enchant.protectRanged.desc", (Object[])new Object[]{this.formatAdditiveInt(this.calcIntProtection())}); + } + + @Override + public boolean canApply(ItemStack itemstack, boolean considering) { + if (super.canApply(itemstack, considering)) { + Item item = itemstack.getItem(); + return !(item instanceof ItemArmor) || ((ItemArmor)item).getArmorMaterial() != LOTRMaterial.GALVORN.toArmorMaterial(); + } + return false; + } + + + @Override + public boolean isBeneficial() { + // This enchantment is detrimental, so return false + return false; + } + + @Override + protected boolean protectsAgainst(DamageSource damageSource) { + return false; + } + + @Override + protected int calcIntProtection() { + return this.protectLevel; + } +} + + 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 431f2db..0000000 --- a/src/main/java/com/zivilon/cinder_loe/entity/Nex.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.zivilon.cinder_loe.entity; - -import java.util.UUID; - -import lotr.common.entity.ai.LOTREntityAIAttackOnCollide; -import lotr.common.entity.npc.LOTREntityNPC; -import lotr.common.fac.LOTRFaction; - -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.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.util.DamageSource; -import net.minecraft.world.World; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; - -import com.zivilon.cinder_loe.CinderLoE; - -public class Nex extends LOTREntityNPC { - public AxisAlignedBB collisionBox; - public AxisAlignedBB hitbox; - public int phase = 1; - public ChunkCoordinates currentFlightTarget; - public EntityPlayer playerTarget; - - public Nex(World world) { - super(world); - setSize(1.5F, 3.0F); - ((EntityLiving) this).tasks.addTask(2, (EntityAIBase) new LOTREntityAIAttackOnCollide(this, 1.3D, false)); - ((EntityLiving) this).tasks.addTask(5, (EntityAIBase) new EntityAIWander(this, 1.0D)); - ((EntityLiving) this).tasks.addTask(9, (EntityAIBase) new EntityAILookIdle((EntityLiving) this)); - addTargetTasks(true); - } - - protected void entityInit() { - super.entityInit(); - this.dataWatcher.addObject(31, Integer.valueOf(0)); - } - - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(1000.0D); - getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.2D); - } - - public int getPhase() { - return this.dataWatcher.getWatchableObjectInt(31); - } - public void setPhase(int i) { - this.dataWatcher.updateObject(31, Integer.valueOf(i)); - } - - 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; - } - - public void onLivingUpdate() { - super.onLivingUpdate(); - if (rand.nextBoolean()) - ((Entity)this).worldObj.spawnParticle("chill", ((Entity)this).posX + (rand.nextDouble() - 0.5D) * ((Entity)this).width, ((Entity)this).posY + rand.nextDouble() * ((Entity)this).height, ((Entity)this).posZ + (rand.nextDouble() - 0.5D) * ((Entity)this).width, 0.0D, 0.0D, 0.0D); - } - - protected void dropFewItems(boolean flag, int i) { - return; - } - - protected String getHurtSound() { - return "lotr:wight.hurt"; - } - - protected String getDeathSound() { - return "lotr:wight.death"; - } - - public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor) { - // Do nothing - } - - @Override - public ItemStack getPickedResult(MovingObjectPosition target) { - return null; - } -} 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 30a0615..0000000 --- a/src/main/java/com/zivilon/cinder_loe/entity/NexShadow.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.zivilon.cinder_loe.entity; - -import com.zivilon.cinder_loe.CinderLoE; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.IRangedAttackMob; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAIOpenDoor; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWander; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.ai.EntityAIWatchClosest2; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; - -import lotr.common.LOTRFoods; -import lotr.common.LOTRMod; -import lotr.common.entity.ai.LOTREntityAIAttackOnCollide; -import lotr.common.entity.ai.LOTREntityAIDrink; -import lotr.common.entity.ai.LOTREntityAIEat; -import lotr.common.entity.ai.LOTREntityAIFollowHiringPlayer; -import lotr.common.entity.ai.LOTREntityAIHiredRemainStill; -import lotr.common.entity.animal.LOTREntityHorse; -import lotr.common.entity.npc.LOTREntityMan; -import lotr.common.entity.npc.LOTREntityNPC; -import lotr.common.entity.npc.LOTRNPCMount; -import lotr.common.entity.npc.LOTRNames; -import lotr.common.fac.LOTRFaction; - -import java.lang.reflect.Field; -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -public class NexShadow extends LOTREntityMan { - String entity_name = "§7Fuinë"; - - public NexShadow(World world) { - super(world); - setSize(0.6F, 1.8F); - ((EntityLiving) this).tasks.addTask(2, (EntityAIBase) new LOTREntityAIAttackOnCollide(this, 1.3D, false)); - ((EntityLiving) this).tasks.addTask(7, (EntityAIBase) new EntityAIWatchClosest2((EntityLiving) this, EntityPlayer.class, 8.0F, 0.02F)); - ((EntityLiving) this).tasks.addTask(7, (EntityAIBase) new EntityAIWatchClosest2((EntityLiving) this, LOTREntityNPC.class, 5.0F, 0.02F)); - ((EntityLiving) this).tasks.addTask(8, (EntityAIBase) new EntityAIWatchClosest((EntityLiving) this, EntityLiving.class, 8.0F, 0.02F)); - ((EntityLiving) this).tasks.addTask(9, (EntityAIBase) new EntityAILookIdle((EntityLiving) this)); - addTargetTasks(true); - } - - public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor) { - } - - public void setupNPCGender() { - this.familyInfo.setMale(true); - } - - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(200.0D); - getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.2D); - } - - public LOTRFaction getFaction() { - return LOTRFaction.UTUMNO; - } - - public String getNPCName() { - return entity_name; - } - - public String getNPCFormattedName(String npcName, String entityName) { - return entity_name; - } - - protected void onAttackModeChange(LOTREntityNPC.AttackMode mode, boolean mounted) { - } - - protected void dropFewItems(boolean flag, int i) { - } - - public boolean getCanSpawnHere() { - return false; - } - - public String getSpeechBank(EntityPlayer entityplayer) { - return "nex/shadow"; - } - - public void setupNPCName() { - } - - @Override - public ItemStack getPickedResult(MovingObjectPosition target) { - return null; - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/ai/LoEPreciseAttackOnCollide.java b/src/main/java/com/zivilon/cinder_loe/entity/ai/LoEPreciseAttackOnCollide.java new file mode 100644 index 0000000..693fc7a --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/ai/LoEPreciseAttackOnCollide.java @@ -0,0 +1,97 @@ +package com.zivilon.cinder_loe.entity.ai; + +import lotr.common.entity.ai.LOTREntityAIAttackOnCollide; +import lotr.common.entity.npc.LOTREntityNPC; +import lotr.common.entity.projectile.LOTREntitySpear; +import lotr.common.item.LOTRItemSpear; +import lotr.common.item.LOTRWeaponStats; +import net.minecraft.item.ItemStack; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EntityLiving; +import net.minecraft.pathfinding.PathEntity; + +import java.util.List; + +public class LoEPreciseAttackOnCollide extends LOTREntityAIAttackOnCollide { + public double attack_range; + public int attack_cooldown; + + public LoEPreciseAttackOnCollide(EntityCreature entity, double speed, double reach, int delay, boolean flag) { + super(entity, speed, flag); + attack_range = reach; + attack_cooldown = delay; + } + + @Override + public void updateTask() { + updateLookAndPathing(); + if (this.attackTick > 0) + this.attackTick--; + ItemStack weapon = this.theOwner.getHeldItem(); + + // Throw a throwing spear if available + if (weapon != null && weapon.getItem() instanceof LOTRItemSpear && this.attackTick <= 0 && this.theOwner instanceof LOTREntityNPC) { + LOTREntityNPC theNPC = (LOTREntityNPC)this.theOwner; + ItemStack spearBackup = theNPC.npcItemsInv.getSpearBackup(); + + if (spearBackup != null) { + LOTRItemSpear spearItem = (LOTRItemSpear)weapon.getItem(); + double d = this.theOwner.getDistanceToEntity((Entity)this.attackTarget); + double range = this.theOwner.getNavigator().getPathSearchRange(); + if (d > 5.0D && d < range * 0.75D) { + LOTREntitySpear spear = new LOTREntitySpear(this.worldObj, (EntityLivingBase)this.theOwner, this.attackTarget, weapon.copy(), 0.75F + (float)d * 0.025F, 0.5F); + this.worldObj.playSoundAtEntity((Entity)this.theOwner, "random.bow", 1.0F, 1.0F / (this.worldObj.rand.nextFloat() * 0.4F + 1.2F) + 0.25F); + this.worldObj.spawnEntityInWorld((Entity)spear); + this.attackTick = 30 + this.theOwner.getRNG().nextInt(20); + if (ItemStack.areItemStacksEqual(theNPC.npcItemsInv.getIdleItem(), theNPC.npcItemsInv.getMeleeWeapon())) + theNPC.npcItemsInv.setIdleItem(spearBackup); + theNPC.npcItemsInv.setMeleeWeapon(spearBackup); + theNPC.npcItemsInv.setSpearBackup(null); + return; + } + } + } + float weaponReach = 1.0F; + if (this.theOwner.ridingEntity != null) + weaponReach = LOTREntityNPC.MOUNT_RANGE_BONUS; + if (weapon == null) { + weaponReach = (float)attack_range; + } else { + weaponReach *= LOTRWeaponStats.getMeleeReachFactor(weapon); + } + + float meleeRange = (float)this.theOwner.boundingBox.getAverageEdgeLength() + weaponReach; + double distanceSq = this.theOwner.getDistanceSqToEntity((Entity)this.attackTarget); + + if (distanceSq <= (meleeRange * meleeRange) || this.theOwner.boundingBox.intersectsWith(this.attackTarget.boundingBox)) { + if (this.attackTick <= 0) { + this.attackTick = (weapon == null) ? attack_cooldown : LOTRWeaponStats.getAttackTimeMob(weapon); // Apply cooldown here + this.theOwner.attackEntityAsMob((Entity)this.attackTarget); + this.theOwner.swingItem(); + } + } + } + + @Override + protected void updateLookAndPathing() { + this.theOwner.getLookHelper().setLookPositionWithEntity((Entity)this.attackTarget, 30.0F, 30.0F); + if (this.theOwner.riddenByEntity != null && this.theOwner.riddenByEntity instanceof EntityLiving) { + ((EntityLiving)this.theOwner.riddenByEntity).rotationYaw = this.theOwner.rotationYaw; + ((EntityLiving)this.theOwner.riddenByEntity).rotationYawHead = this.theOwner.rotationYawHead; + } + if ((this.sightNotRequired || this.theOwner.getEntitySenses().canSee((Entity)this.attackTarget)) && --this.pathCheckTimer <= 0) { + this.pathCheckTimer = 2; + PathEntity path = getPathEntity(); + if (path != null) + this.theOwner.getNavigator().setPath(path, this.moveSpeed); + } + } + + public PathEntity getPathEntity() { + if (this.theOwner.ridingEntity != null) + return this.worldObj.getPathEntityToEntity((Entity)this.theOwner, (Entity)this.attackTarget, this.theOwner.getNavigator().getPathSearchRange(), true, this.theOwner.getNavigator().getCanBreakDoors(), this.theOwner.getNavigator().getAvoidsWater(), false); + return this.theOwner.getNavigator().getPathToEntityLiving((Entity)this.attackTarget); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/DwarfLevy.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/DwarfLevy.java deleted file mode 100644 index c213bf4..0000000 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/DwarfLevy.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.zivilon.cinder_loe.entity.npc; - -import com.zivilon.cinder_loe.CinderLoE; - -import lotr.common.LOTRMod; -import lotr.common.LOTRShields; -import lotr.common.entity.npc.LOTREntityDwarfWarrior; -import net.minecraft.entity.IEntityLivingData; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; - -public class DwarfLevy extends LOTREntityDwarfWarrior { - - private static ItemStack[] levyWeapons = new ItemStack[]{new ItemStack(LOTRMod.daggerDwarven), new ItemStack(LOTRMod.daggerDwarvenPoisoned), new ItemStack(LOTRMod.swordDwarven), new ItemStack(LOTRMod.axeDwarven), new ItemStack(LOTRMod.battleaxeDwarven), new ItemStack(LOTRMod.hammerDwarven), new ItemStack(Items.iron_axe), new ItemStack(LOTRMod.battleaxeIron), new ItemStack(LOTRMod.spearDwarven), new ItemStack(LOTRMod.spearIron)}; - private static ItemStack[] levySpears = new ItemStack[]{new ItemStack(LOTRMod.spearDwarven), new ItemStack(LOTRMod.spearIron)}; - private static ItemStack[] levyBodies = new ItemStack[]{new ItemStack(Items.leather_chestplate), new ItemStack(LOTRMod.bodyDaleGambeson)}; - private static ItemStack[] levyLegs = new ItemStack[]{new ItemStack(Items.leather_leggings), new ItemStack(Items.iron_leggings)}; - private static ItemStack[] levyBoots = new ItemStack[]{new ItemStack(Items.leather_boots), new ItemStack(LOTRMod.bootsBronze), null}; - private static final int[] colors = new int[]{14823729, 5512477, 14196753, 11374145, 7366222}; - - public DwarfLevy(World world) { - super(world); - this.npcShield = null; - } - - public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) { - data = super.onSpawnWithEgg(data); - int i = (this).rand.nextInt(levyWeapons.length); - this.npcItemsInv.setMeleeWeapon(levyWeapons[i].copy()); - this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon()); - if ((this).rand.nextInt(5) == 0) { - this.npcItemsInv.setSpearBackup(this.npcItemsInv.getMeleeWeapon()); - i = (this).rand.nextInt(levySpears.length); - this.npcItemsInv.setMeleeWeapon(levySpears[i].copy()); - } - i = (this).rand.nextInt(levyBoots.length); - this.setCurrentItemOrArmor(1, levyBoots[i].copy()); - i = (this).rand.nextInt(levyLegs.length); - this.setCurrentItemOrArmor(2, levyLegs[i].copy()); - i = (this).rand.nextInt(levyBodies.length); - this.setCurrentItemOrArmor(3, levyBodies[i].copy()); - this.setCurrentItemOrArmor(4, null); - return data; - } - @Override - public ItemStack getPickedResult(MovingObjectPosition target) { - return new ItemStack(CinderLoE.spawnEgg, 1, 24); - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/HaradLevy.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/HaradLevy.java deleted file mode 100644 index e76bcc5..0000000 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/HaradLevy.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.zivilon.cinder_loe.entity.npc; - -import com.zivilon.cinder_loe.CinderLoE; - -import lotr.common.LOTRMod; -import lotr.common.LOTRShields; -import lotr.common.entity.npc.LOTREntityBreeGuard; -import lotr.common.entity.npc.LOTREntityNearHaradrim; -import lotr.common.item.LOTRItemHaradRobes; -import net.minecraft.entity.IEntityLivingData; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraft.util.MovingObjectPosition; - -public class HaradLevy extends LOTREntityNearHaradrim { - private static ItemStack[] levyWeapons = new ItemStack[]{new ItemStack(LOTRMod.daggerHarad), new ItemStack(LOTRMod.daggerHaradPoisoned), new ItemStack(LOTRMod.swordHarad), new ItemStack(LOTRMod.swordMoredain), new ItemStack(LOTRMod.battleaxeBronze), new ItemStack(LOTRMod.maceNearHarad), new ItemStack(Items.iron_sword), new ItemStack(LOTRMod.swordBronze), new ItemStack(LOTRMod.battleaxeIron), new ItemStack(LOTRMod.poleaxeNearHarad), new ItemStack(LOTRMod.spearHarad), new ItemStack(LOTRMod.spearIron), new ItemStack(LOTRMod.spearBronze)}; - private static ItemStack[] levySpears = new ItemStack[]{new ItemStack(LOTRMod.spearHarad), new ItemStack(LOTRMod.spearIron), new ItemStack(LOTRMod.spearBronze)}; - private static ItemStack[] levyBodies = new ItemStack[]{new ItemStack(Items.leather_chestplate), new ItemStack(LOTRMod.bodyBronze), new ItemStack(LOTRMod.bodyHaradRobes)}; - private static ItemStack[] levyLegs = new ItemStack[]{new ItemStack(Items.leather_leggings), new ItemStack(LOTRMod.legsBronze)}; - private static ItemStack[] levyBoots = new ItemStack[]{new ItemStack(Items.leather_boots), new ItemStack(LOTRMod.bootsBronze), null}; - private static final int[] colors = new int[]{14823729, 5512477, 14196753, 11374145, 7366222}; - - public HaradLevy(World world) { - super(world); - this.spawnRidingHorse = false; - this.addTargetTasks(true); - this.npcShield = null; - } - - @Override - public void setupNPCGender() { - this.familyInfo.setMale(true); - } - - @Override - public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) { - data = super.onSpawnWithEgg(data); - int i = (this).rand.nextInt(levyWeapons.length); - this.npcItemsInv.setMeleeWeapon(levyWeapons[i].copy()); - this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon()); - if ((this).rand.nextInt(5) == 0) { - this.npcItemsInv.setSpearBackup(this.npcItemsInv.getMeleeWeapon()); - i = (this).rand.nextInt(levySpears.length); - this.npcItemsInv.setMeleeWeapon(levySpears[i].copy()); - } - i = (this).rand.nextInt(levyBoots.length); - this.setCurrentItemOrArmor(1, levyBoots[i].copy()); - i = (this).rand.nextInt(levyLegs.length); - this.setCurrentItemOrArmor(2, levyLegs[i].copy()); - i = (this).rand.nextInt(levyBodies.length); - this.setCurrentItemOrArmor(3, levyBodies[i].copy()); - this.setCurrentItemOrArmor(4, null); - return data; - } - @Override - public ItemStack getPickedResult(MovingObjectPosition target) { - return new ItemStack(CinderLoE.spawnEgg, 1, 25); - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/HobbitBannerBearer.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/HobbitBannerBearer.java new file mode 100644 index 0000000..bfcdd91 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/HobbitBannerBearer.java @@ -0,0 +1,29 @@ +package com.zivilon.cinder_loe.entity.npc; + +import com.zivilon.cinder_loe.CinderLoE; +import lotr.common.entity.npc.LOTRBannerBearer; +import lotr.common.entity.npc.LOTREntityHobbitBounder; +import lotr.common.item.LOTRItemBanner; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class HobbitBannerBearer extends LOTREntityHobbitBounder implements LOTRBannerBearer { + public HobbitBannerBearer(World world) { + super(world); + } + @Override + public LOTRItemBanner.BannerType getBannerType() { + return LOTRItemBanner.BannerType.HOBBIT; + } + @Override + public ItemStack getPickedResult(MovingObjectPosition target) { + return new ItemStack(CinderLoE.spawnEgg, 1, 16); + } + + @Override + public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) { + + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/RedDwarfArbalest.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/dwarf/RedDwarfArbalest.java similarity index 97% rename from src/main/java/com/zivilon/cinder_loe/entity/npc/RedDwarfArbalest.java rename to src/main/java/com/zivilon/cinder_loe/entity/npc/dwarf/RedDwarfArbalest.java index bdf4407..055b0ea 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/RedDwarfArbalest.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/dwarf/RedDwarfArbalest.java @@ -1,4 +1,4 @@ -package com.zivilon.cinder_loe.entity.npc; +package com.zivilon.cinder_loe.entity.npc.dwarf; import com.zivilon.cinder_loe.CinderLoE; diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/RedDwarfBannerBearer.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/dwarf/RedDwarfBannerBearer.java similarity index 94% rename from src/main/java/com/zivilon/cinder_loe/entity/npc/RedDwarfBannerBearer.java rename to src/main/java/com/zivilon/cinder_loe/entity/npc/dwarf/RedDwarfBannerBearer.java index 3a4f0d2..b04e6d1 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/RedDwarfBannerBearer.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/dwarf/RedDwarfBannerBearer.java @@ -1,4 +1,4 @@ -package com.zivilon.cinder_loe.entity.npc; +package com.zivilon.cinder_loe.entity.npc.dwarf; import com.zivilon.cinder_loe.CinderLoE; diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/RedDwarfCommander.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/dwarf/RedDwarfCommander.java similarity index 97% rename from src/main/java/com/zivilon/cinder_loe/entity/npc/RedDwarfCommander.java rename to src/main/java/com/zivilon/cinder_loe/entity/npc/dwarf/RedDwarfCommander.java index 5560d29..2c7fdb9 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/RedDwarfCommander.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/dwarf/RedDwarfCommander.java @@ -1,4 +1,4 @@ -package com.zivilon.cinder_loe.entity.npc; +package com.zivilon.cinder_loe.entity.npc.dwarf; import com.zivilon.cinder_loe.CinderLoE; diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/RedDwarfWarrior.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/dwarf/RedDwarfWarrior.java similarity index 97% rename from src/main/java/com/zivilon/cinder_loe/entity/npc/RedDwarfWarrior.java rename to src/main/java/com/zivilon/cinder_loe/entity/npc/dwarf/RedDwarfWarrior.java index 841728f..93adfa8 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/RedDwarfWarrior.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/dwarf/RedDwarfWarrior.java @@ -1,4 +1,4 @@ -package com.zivilon.cinder_loe.entity.npc; +package com.zivilon.cinder_loe.entity.npc.dwarf; import com.zivilon.cinder_loe.CinderLoE; diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/elf/Sirrandrai.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/elf/Sirrandrai.java new file mode 100644 index 0000000..467a10f --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/elf/Sirrandrai.java @@ -0,0 +1,82 @@ +package com.zivilon.cinder_loe.entity.npc.elf; + +import com.zivilon.cinder_loe.CinderLoE; +import lotr.common.LOTRAchievement; +import lotr.common.LOTRMod; +import lotr.common.LOTRShields; +import lotr.common.entity.ai.LOTREntityAIAttackOnCollide; +import lotr.common.entity.npc.LOTREntityHighElf; +import lotr.common.entity.npc.LOTREntityHighElfWarrior; +import lotr.common.entity.npc.LOTREntityMoredain; +import lotr.common.entity.npc.LOTRNPCMount; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + + +public class Sirrandrai extends LOTREntityHighElfWarrior { + public Sirrandrai(World world) { + super(world); + this.tasks.addTask(2, this.meleeAttackAI); + this.spawnRidingHorse = this.rand.nextInt(4) == 0; + this.npcShield = LOTRShields.ALIGNMENT_HIGH_ELF; + } + @Override + protected EntityAIBase createElfMeleeAttackAI() { + return new LOTREntityAIAttackOnCollide(this, 1.5, false); + } + + @Override + protected EntityAIBase createElfRangedAttackAI() { + return this.createElfMeleeAttackAI(); + } + @Override + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(24.0); + } + + @Override + public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) { + data = super.onSpawnWithEgg(data); + int i = this.rand.nextInt(2); + if (i == 0) { + this.npcItemsInv.setMeleeWeapon(new ItemStack(LOTRMod.polearmHighElven)); + if (this.rand.nextInt(5) == 0) { + this.npcItemsInv.setSpearBackup(this.npcItemsInv.getMeleeWeapon()); + this.npcItemsInv.setMeleeWeapon(new ItemStack(LOTRMod.spearHighElven)); + } + } else if (i == 1) { + this.npcItemsInv.setMeleeWeapon(new ItemStack(LOTRMod.spearHighElven)); + this.npcItemsInv.setSpearBackup(null); + } + this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon()); + this.npcItemsInv.setRangedWeapon(this.npcItemsInv.getMeleeWeapon()); + this.setCurrentItemOrArmor(1, new ItemStack(LOTRMod.bootsHighElven)); + this.setCurrentItemOrArmor(2, new ItemStack(LOTRMod.legsHighElven)); + this.setCurrentItemOrArmor(3, new ItemStack(LOTRMod.bodyHighElven)); + this.setCurrentItemOrArmor(4, new ItemStack(LOTRMod.helmetHighElven)); + return data; + } + + @Override + public float getAlignmentBonus() { + return 3.0f; + } + + @Override + public String getSpeechBank(EntityPlayer entityplayer) { + if (this.isFriendlyAndAligned(entityplayer)) { + if (this.hiredNPCInfo.getHiringPlayer() == entityplayer) { + return "highElf/elf/hired"; + } + return "highElf/warrior/friendly"; + } + return "highElf/warrior/hostile"; + } + +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/Limwaith.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/evil_human/Limwaith.java similarity index 98% rename from src/main/java/com/zivilon/cinder_loe/entity/npc/Limwaith.java rename to src/main/java/com/zivilon/cinder_loe/entity/npc/evil_human/Limwaith.java index 33b3e4e..f9a0e1f 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/Limwaith.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/evil_human/Limwaith.java @@ -1,4 +1,4 @@ -package com.zivilon.cinder_loe.entity.npc; +package com.zivilon.cinder_loe.entity.npc.evil_human; import com.zivilon.cinder_loe.CinderLoE; diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/LimwaithBannerBearer.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/evil_human/LimwaithBannerBearer.java similarity index 93% rename from src/main/java/com/zivilon/cinder_loe/entity/npc/LimwaithBannerBearer.java rename to src/main/java/com/zivilon/cinder_loe/entity/npc/evil_human/LimwaithBannerBearer.java index 3379d48..6b3a364 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/LimwaithBannerBearer.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/evil_human/LimwaithBannerBearer.java @@ -1,4 +1,4 @@ -package com.zivilon.cinder_loe.entity.npc; +package com.zivilon.cinder_loe.entity.npc.evil_human; import com.zivilon.cinder_loe.CinderLoE; diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/LimwaithBlowgunner.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/evil_human/LimwaithBlowgunner.java similarity index 98% rename from src/main/java/com/zivilon/cinder_loe/entity/npc/LimwaithBlowgunner.java rename to src/main/java/com/zivilon/cinder_loe/entity/npc/evil_human/LimwaithBlowgunner.java index 88e9b2a..aa3f99e 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/LimwaithBlowgunner.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/evil_human/LimwaithBlowgunner.java @@ -1,4 +1,4 @@ -package com.zivilon.cinder_loe.entity.npc; +package com.zivilon.cinder_loe.entity.npc.evil_human; import com.zivilon.cinder_loe.CinderLoE; diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/LimwaithBoneWarrior.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/evil_human/LimwaithBoneWarrior.java similarity index 97% rename from src/main/java/com/zivilon/cinder_loe/entity/npc/LimwaithBoneWarrior.java rename to src/main/java/com/zivilon/cinder_loe/entity/npc/evil_human/LimwaithBoneWarrior.java index 1c9d1bf..4b83e65 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/LimwaithBoneWarrior.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/evil_human/LimwaithBoneWarrior.java @@ -1,4 +1,4 @@ -package com.zivilon.cinder_loe.entity.npc; +package com.zivilon.cinder_loe.entity.npc.evil_human; import com.zivilon.cinder_loe.CinderLoE; diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/LimwaithChieftain.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/evil_human/LimwaithChieftain.java similarity index 97% rename from src/main/java/com/zivilon/cinder_loe/entity/npc/LimwaithChieftain.java rename to src/main/java/com/zivilon/cinder_loe/entity/npc/evil_human/LimwaithChieftain.java index 7ab32ee..a09775d 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/LimwaithChieftain.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/evil_human/LimwaithChieftain.java @@ -1,4 +1,4 @@ -package com.zivilon.cinder_loe.entity.npc; +package com.zivilon.cinder_loe.entity.npc.evil_human; import com.zivilon.cinder_loe.CinderLoE; diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/LimwaithWarrior.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/evil_human/LimwaithWarrior.java similarity index 97% rename from src/main/java/com/zivilon/cinder_loe/entity/npc/LimwaithWarrior.java rename to src/main/java/com/zivilon/cinder_loe/entity/npc/evil_human/LimwaithWarrior.java index c168393..9399238 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/LimwaithWarrior.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/evil_human/LimwaithWarrior.java @@ -1,4 +1,4 @@ -package com.zivilon.cinder_loe.entity.npc; +package com.zivilon.cinder_loe.entity.npc.evil_human; import com.zivilon.cinder_loe.CinderLoE; diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/evil_human/RhudaurSoldier.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/evil_human/RhudaurSoldier.java new file mode 100644 index 0000000..0231a7b --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/evil_human/RhudaurSoldier.java @@ -0,0 +1,44 @@ +package com.zivilon.cinder_loe.entity.npc.evil_human; + +import com.zivilon.cinder_loe.CinderLoE; +import lotr.common.LOTRMod; +import lotr.common.LOTRShields; +import lotr.common.entity.npc.LOTREntityAngmarHillmanWarrior; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + + +public class RhudaurSoldier extends LOTREntityAngmarHillmanWarrior { + + private static ItemStack[] weapons = new ItemStack[]{new ItemStack(LOTRMod.swordAngmar), new ItemStack(LOTRMod.battleaxeAngmar), new ItemStack(LOTRMod.hammerAngmar), new ItemStack(LOTRMod.polearmAngmar), new ItemStack(LOTRMod.spearAngmar)}; + private static ItemStack[] helmets = new ItemStack[]{new ItemStack(CinderLoE.helmetRhudaur)}; + private static ItemStack[] bodies = new ItemStack[]{new ItemStack(CinderLoE.bodyRhudaur)}; + private static ItemStack[] legs = new ItemStack[]{new ItemStack(CinderLoE.legsRhudaur)}; + private static ItemStack[] boots = new ItemStack[]{new ItemStack(CinderLoE.bootsRhudaur)}; + + public RhudaurSoldier(World world) { + super(world); + this.npcShield = LOTRShields.ALIGNMENT_MORDOR; + } + + @Override + public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) { + data = super.onSpawnWithEgg(data); + int i = this.rand.nextInt(weapons.length); + this.npcItemsInv.setMeleeWeapon(weapons[i].copy()); + this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon()); + i = this.rand.nextInt(boots.length); + this.setCurrentItemOrArmor(1, boots[i].copy()); + i = this.rand.nextInt(legs.length); + this.setCurrentItemOrArmor(2, legs[i].copy()); + i = this.rand.nextInt(bodies.length); + this.setCurrentItemOrArmor(3, bodies[i].copy()); + if (this.rand.nextInt(5) != 0) { + i = this.rand.nextInt(helmets.length); + this.setCurrentItemOrArmor(4, helmets[i].copy()); + } + return data; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/ArnorBannerBearer.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/ArnorBannerBearer.java similarity index 92% rename from src/main/java/com/zivilon/cinder_loe/entity/npc/ArnorBannerBearer.java rename to src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/ArnorBannerBearer.java index b940719..d61a3b0 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/ArnorBannerBearer.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/ArnorBannerBearer.java @@ -1,4 +1,4 @@ -package com.zivilon.cinder_loe.entity.npc; +package com.zivilon.cinder_loe.entity.npc.good_human; import com.zivilon.cinder_loe.CinderLoE; import lotr.common.entity.npc.LOTRBannerBearer; diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/ArnorCaptain.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/ArnorCaptain.java similarity index 98% rename from src/main/java/com/zivilon/cinder_loe/entity/npc/ArnorCaptain.java rename to src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/ArnorCaptain.java index 93be88e..9900921 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/ArnorCaptain.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/ArnorCaptain.java @@ -1,4 +1,4 @@ -package com.zivilon.cinder_loe.entity.npc; +package com.zivilon.cinder_loe.entity.npc.good_human; import com.zivilon.cinder_loe.CinderLoE; import lotr.common.LOTRCapes; diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/ArnorSoldier.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/ArnorSoldier.java similarity index 98% rename from src/main/java/com/zivilon/cinder_loe/entity/npc/ArnorSoldier.java rename to src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/ArnorSoldier.java index 92e45fa..c2a6459 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/ArnorSoldier.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/ArnorSoldier.java @@ -1,4 +1,4 @@ -package com.zivilon.cinder_loe.entity.npc; +package com.zivilon.cinder_loe.entity.npc.good_human; import lotr.common.entity.ai.LOTREntityAIAttackOnCollide; import lotr.common.entity.npc.LOTREntityDunedain; diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/ArnorSoldierArcher.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/ArnorSoldierArcher.java similarity index 97% rename from src/main/java/com/zivilon/cinder_loe/entity/npc/ArnorSoldierArcher.java rename to src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/ArnorSoldierArcher.java index 00f7776..41d712e 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/ArnorSoldierArcher.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/ArnorSoldierArcher.java @@ -1,4 +1,4 @@ -package com.zivilon.cinder_loe.entity.npc; +package com.zivilon.cinder_loe.entity.npc.good_human; import com.zivilon.cinder_loe.CinderLoE; diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/BattleNun.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/BattleNun.java similarity index 96% rename from src/main/java/com/zivilon/cinder_loe/entity/npc/BattleNun.java rename to src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/BattleNun.java index 8ad518a..129ed38 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/BattleNun.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/BattleNun.java @@ -1,4 +1,4 @@ -package com.zivilon.cinder_loe.entity.npc; +package com.zivilon.cinder_loe.entity.npc.good_human; import com.zivilon.cinder_loe.CinderLoE; diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/BreeCaptain.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/BreeCaptain.java similarity index 97% rename from src/main/java/com/zivilon/cinder_loe/entity/npc/BreeCaptain.java rename to src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/BreeCaptain.java index 61281ce..db118f9 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/BreeCaptain.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/BreeCaptain.java @@ -1,4 +1,4 @@ -package com.zivilon.cinder_loe.entity.npc; +package com.zivilon.cinder_loe.entity.npc.good_human; import com.zivilon.cinder_loe.CinderLoE; diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/BreeCrossbowman.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/BreeCrossbowman.java similarity index 97% rename from src/main/java/com/zivilon/cinder_loe/entity/npc/BreeCrossbowman.java rename to src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/BreeCrossbowman.java index aed0e4f..3db873b 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/BreeCrossbowman.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/BreeCrossbowman.java @@ -1,4 +1,4 @@ -package com.zivilon.cinder_loe.entity.npc; +package com.zivilon.cinder_loe.entity.npc.good_human; import com.zivilon.cinder_loe.CinderLoE; diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/BreeOutrider.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/BreeOutrider.java similarity index 99% rename from src/main/java/com/zivilon/cinder_loe/entity/npc/BreeOutrider.java rename to src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/BreeOutrider.java index 07ea063..d9a6922 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/BreeOutrider.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/BreeOutrider.java @@ -1,4 +1,4 @@ -package com.zivilon.cinder_loe.entity.npc; +package com.zivilon.cinder_loe.entity.npc.good_human; import com.zivilon.cinder_loe.CinderLoE; diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/BreeSoldier.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/BreeSoldier.java similarity index 96% rename from src/main/java/com/zivilon/cinder_loe/entity/npc/BreeSoldier.java rename to src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/BreeSoldier.java index 3863cc3..8fb5ab3 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/BreeSoldier.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/BreeSoldier.java @@ -1,4 +1,4 @@ -package com.zivilon.cinder_loe.entity.npc; +package com.zivilon.cinder_loe.entity.npc.good_human; import com.zivilon.cinder_loe.CinderLoE; diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/BreeSoldierBannerBearer.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/BreeSoldierBannerBearer.java similarity index 94% rename from src/main/java/com/zivilon/cinder_loe/entity/npc/BreeSoldierBannerBearer.java rename to src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/BreeSoldierBannerBearer.java index 86a6991..3ec0345 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/BreeSoldierBannerBearer.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/BreeSoldierBannerBearer.java @@ -1,4 +1,4 @@ -package com.zivilon.cinder_loe.entity.npc; +package com.zivilon.cinder_loe.entity.npc.good_human; import com.zivilon.cinder_loe.CinderLoE; diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/EsgarothSoldier.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/EsgarothSoldier.java new file mode 100644 index 0000000..7604a04 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/EsgarothSoldier.java @@ -0,0 +1,23 @@ +package com.zivilon.cinder_loe.entity.npc.good_human; + +import com.zivilon.cinder_loe.CinderLoE; +import lotr.common.LOTRMod; +import lotr.common.LOTRShields; +import lotr.common.entity.npc.LOTREntityDaleSoldier; +import lotr.common.entity.npc.LOTREntityDunedain; +import lotr.common.fac.LOTRFaction; +import lotr.common.quest.LOTRMiniQuest; +import lotr.common.quest.LOTRMiniQuestFactory; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class EsgarothSoldier extends LOTREntityDaleSoldier { + public EsgarothSoldier(World world) { + super(world); + this.npcShield = LOTRShields.ALIGNMENT_ESGAROTH; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/TauredainTrueBlood.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/TauredainTrueBlood.java new file mode 100644 index 0000000..eacff72 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/good_human/TauredainTrueBlood.java @@ -0,0 +1,54 @@ +package com.zivilon.cinder_loe.entity.npc.good_human; + +import lotr.common.LOTRMod; +import lotr.common.LOTRShields; +import lotr.common.entity.ai.LOTREntityAIAttackOnCollide; +import lotr.common.entity.npc.LOTREntityDaleSoldier; +import lotr.common.entity.npc.LOTREntityTauredain; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class TauredainTrueBlood extends LOTREntityTauredain { + public TauredainTrueBlood(World world) { + super(world); + this.npcShield = LOTRShields.ALIGNMENT_TAUREDAIN; + } + @Override + public EntityAIBase createHaradrimAttackAI() { + return new LOTREntityAIAttackOnCollide(this, 1.7, false); + } + @Override + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(26.0); + this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(24.0); + this.getEntityAttribute(npcAttackDamageExtra).setBaseValue(2.0); + } + + private static ItemStack[] weapons = new ItemStack[]{new ItemStack(LOTRMod.swordTauredain), new ItemStack(LOTRMod.battleaxeTauredain), new ItemStack(LOTRMod.hammerTauredain), new ItemStack(LOTRMod.spearTauredain), new ItemStack(LOTRMod.pikeTauredain)}; + private static ItemStack[] helmets = new ItemStack[]{new ItemStack(LOTRMod.helmetTauredainChieftain), new ItemStack(LOTRMod.helmetTauredainChieftain), new ItemStack(LOTRMod.helmetTauredainGold, 0)}; + private static ItemStack[] bodies = new ItemStack[]{new ItemStack(LOTRMod.bodyTauredain), new ItemStack(LOTRMod.bodyTauredain), new ItemStack(LOTRMod.bodyTauredainGold, 0)}; + private static ItemStack[] legs = new ItemStack[]{new ItemStack(LOTRMod.legsTauredain), new ItemStack(LOTRMod.legsTauredain), new ItemStack(LOTRMod.legsTauredainGold, 0)}; + private static ItemStack[] boots = new ItemStack[]{new ItemStack(LOTRMod.bootsTauredain), new ItemStack(LOTRMod.bootsTauredain), new ItemStack(LOTRMod.bootsTauredainGold, 0)}; + @Override + public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) { + data = super.onSpawnWithEgg(data); + int i = this.rand.nextInt(weapons.length); + this.npcItemsInv.setMeleeWeapon(weapons[i].copy()); + this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon()); + i = this.rand.nextInt(boots.length); + this.setCurrentItemOrArmor(1, boots[i].copy()); + i = this.rand.nextInt(legs.length); + this.setCurrentItemOrArmor(2, legs[i].copy()); + i = this.rand.nextInt(bodies.length); + this.setCurrentItemOrArmor(3, bodies[i].copy()); + if (this.rand.nextInt(5) != 0) { + i = this.rand.nextInt(helmets.length); + this.setCurrentItemOrArmor(4, helmets[i].copy()); + } + return data; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/orc/MorgulOrc.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/orc/MorgulOrc.java new file mode 100644 index 0000000..f054cdd --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/orc/MorgulOrc.java @@ -0,0 +1,13 @@ +package com.zivilon.cinder_loe.entity.npc.orc; + +import lotr.common.LOTRShields; +import lotr.common.entity.npc.LOTREntityMordorOrc; +import net.minecraft.world.World; + + +public class MorgulOrc extends LOTREntityMordorOrc { + public MorgulOrc(World world) { + super(world); + this.npcShield = LOTRShields.ALIGNMENT_MINAS_MORGUL; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/orc/NorthernOrc.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/orc/NorthernOrc.java new file mode 100644 index 0000000..04f7608 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/orc/NorthernOrc.java @@ -0,0 +1,74 @@ +package com.zivilon.cinder_loe.entity.npc.orc; + +import com.zivilon.cinder_loe.CinderLoE; +import lotr.common.LOTRLevelData; +import lotr.common.LOTRMod; +import lotr.common.LOTRShields; +import lotr.common.entity.npc.LOTREntityAngmarHillmanWarrior; +import lotr.common.entity.npc.LOTREntityGundabadUruk; +import lotr.common.fac.LOTRFaction; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + + +public class NorthernOrc extends LOTREntityGundabadUruk { + + private static ItemStack[] weapons = new ItemStack[]{new ItemStack(LOTRMod.swordAngmar), new ItemStack(LOTRMod.battleaxeAngmar), new ItemStack(LOTRMod.hammerGundabadUruk), new ItemStack(LOTRMod.polearmAngmar), new ItemStack(LOTRMod.spearAngmar), new ItemStack(LOTRMod.swordGundabadUruk)}; + private static ItemStack[] helmets = new ItemStack[]{new ItemStack(LOTRMod.helmetAngmar), new ItemStack(LOTRMod.helmetGundabadUruk), new ItemStack(LOTRMod.helmetBone)}; + private static ItemStack[] bodies = new ItemStack[]{new ItemStack(LOTRMod.bodyAngmar), new ItemStack(LOTRMod.bodyGundabadUruk), new ItemStack(LOTRMod.bodyUruk)}; + private static ItemStack[] legs = new ItemStack[]{new ItemStack(LOTRMod.legsAngmar), new ItemStack(LOTRMod.legsGundabadUruk), new ItemStack(LOTRMod.legsUruk)}; + private static ItemStack[] boots = new ItemStack[]{new ItemStack(LOTRMod.bootsAngmar), new ItemStack(LOTRMod.bootsGundabadUruk), new ItemStack(LOTRMod.bootsUruk)}; + + public NorthernOrc(World world) { + super(world); + this.setSize(0.6f, 1.8f); + this.isWeakOrc = false; + this.npcShield = LOTRShields.ALIGNMENT_ANGMAR; + } + + @Override + public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) { + data = super.onSpawnWithEgg(data); + int i = this.rand.nextInt(weapons.length); + this.npcItemsInv.setMeleeWeapon(weapons[i].copy()); + this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon()); + i = this.rand.nextInt(boots.length); + this.setCurrentItemOrArmor(1, boots[i].copy()); + i = this.rand.nextInt(legs.length); + this.setCurrentItemOrArmor(2, legs[i].copy()); + i = this.rand.nextInt(bodies.length); + this.setCurrentItemOrArmor(3, bodies[i].copy()); + if (this.rand.nextInt(5) != 0) { + i = this.rand.nextInt(helmets.length); + this.setCurrentItemOrArmor(4, helmets[i].copy()); + } + return data; + } + + @Override + public LOTRFaction getFaction() { + return LOTRFaction.ANGMAR; + } + + @Override + public String getSpeechBank(EntityPlayer entityplayer) { + if (this.isFriendlyAndAligned(entityplayer)) { + if (this.hiredNPCInfo.getHiringPlayer() == entityplayer) { + return "angmar/orc/hired"; + } + if (LOTRLevelData.getData(entityplayer).getAlignment(this.getFaction()) >= 100.0f) { + return "angmar/orc/friendly"; + } + return "angmar/orc/neutral"; + } + return "angmar/orc/hostile"; + } + + @Override + public boolean canOrcSkirmish() { + return false; + } + +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/FangornAnimal.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/radagast/FangornAnimal.java similarity index 98% rename from src/main/java/com/zivilon/cinder_loe/entity/npc/FangornAnimal.java rename to src/main/java/com/zivilon/cinder_loe/entity/npc/radagast/FangornAnimal.java index a6ad952..cf67672 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/FangornAnimal.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/radagast/FangornAnimal.java @@ -1,4 +1,4 @@ -package com.zivilon.cinder_loe.entity.npc; +package com.zivilon.cinder_loe.entity.npc.radagast; import com.zivilon.cinder_loe.CinderLoE; diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/FangornAuroch.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/radagast/FangornAuroch.java similarity index 97% rename from src/main/java/com/zivilon/cinder_loe/entity/npc/FangornAuroch.java rename to src/main/java/com/zivilon/cinder_loe/entity/npc/radagast/FangornAuroch.java index 24e2691..b177518 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/FangornAuroch.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/radagast/FangornAuroch.java @@ -1,4 +1,4 @@ -package com.zivilon.cinder_loe.entity.npc; +package com.zivilon.cinder_loe.entity.npc.radagast; import com.zivilon.cinder_loe.CinderLoE; diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/FangornBear.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/radagast/FangornBear.java similarity index 99% rename from src/main/java/com/zivilon/cinder_loe/entity/npc/FangornBear.java rename to src/main/java/com/zivilon/cinder_loe/entity/npc/radagast/FangornBear.java index 0fb6aa3..d4c06c9 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/FangornBear.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/radagast/FangornBear.java @@ -1,4 +1,4 @@ -package com.zivilon.cinder_loe.entity.npc; +package com.zivilon.cinder_loe.entity.npc.radagast; import com.zivilon.cinder_loe.CinderLoE; diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/FangornElk.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/radagast/FangornElk.java similarity index 97% rename from src/main/java/com/zivilon/cinder_loe/entity/npc/FangornElk.java rename to src/main/java/com/zivilon/cinder_loe/entity/npc/radagast/FangornElk.java index 46e6be6..cb0a08f 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/FangornElk.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/radagast/FangornElk.java @@ -1,4 +1,4 @@ -package com.zivilon.cinder_loe.entity.npc; +package com.zivilon.cinder_loe.entity.npc.radagast; import com.zivilon.cinder_loe.CinderLoE; diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/FangornWildBoar.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/radagast/FangornWildBoar.java similarity index 97% rename from src/main/java/com/zivilon/cinder_loe/entity/npc/FangornWildBoar.java rename to src/main/java/com/zivilon/cinder_loe/entity/npc/radagast/FangornWildBoar.java index 595ae9b..2605334 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/FangornWildBoar.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/radagast/FangornWildBoar.java @@ -1,4 +1,4 @@ -package com.zivilon.cinder_loe.entity.npc; +package com.zivilon.cinder_loe.entity.npc.radagast; import com.zivilon.cinder_loe.CinderLoE; diff --git a/src/main/java/com/zivilon/cinder_loe/entity/npc/FangornWolf.java b/src/main/java/com/zivilon/cinder_loe/entity/npc/radagast/FangornWolf.java similarity index 97% rename from src/main/java/com/zivilon/cinder_loe/entity/npc/FangornWolf.java rename to src/main/java/com/zivilon/cinder_loe/entity/npc/radagast/FangornWolf.java index 69d4801..d7fde98 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/npc/FangornWolf.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/npc/radagast/FangornWolf.java @@ -1,4 +1,4 @@ -package com.zivilon.cinder_loe.entity.npc; +package com.zivilon.cinder_loe.entity.npc.radagast; import com.zivilon.cinder_loe.CinderLoE; diff --git a/src/main/java/com/zivilon/cinder_loe/entity/projectile/EntityWarDart.java b/src/main/java/com/zivilon/cinder_loe/entity/projectile/EntityWarDart.java index adcbc38..e736e01 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/projectile/EntityWarDart.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/projectile/EntityWarDart.java @@ -13,6 +13,8 @@ import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; public class EntityWarDart extends LOTREntityProjectileBase { @@ -33,7 +35,8 @@ public class EntityWarDart extends LOTREntityProjectileBase { public int knockbackStrength = 0; public ItemStack item; - public int damage; + public double damage; + public int dart_type; public EntityWarDart(World world) { super(world); @@ -44,6 +47,7 @@ public class EntityWarDart extends LOTREntityProjectileBase { this.item = item.copy(); // Store a copy of the item stack this.item.stackSize = 1; this.damage = WarDart.getDamageFromMeta(item.getItemDamage()); + this.dart_type = item.getItemDamage(); } @Override @@ -104,9 +108,18 @@ public class EntityWarDart extends LOTREntityProjectileBase { } } + @Override + protected void onCollideWithTarget(Entity entity) { + super.onCollideWithTarget(entity); + if (entity instanceof EntityLivingBase) + if (this.dart_type == 14) { + ((EntityLivingBase)entity).addPotionEffect(new PotionEffect(Potion.wither.id, 160)); + } + } + @Override public float getBaseImpactDamage(Entity entity, ItemStack itemStack) { - return this.damage; + return (float)this.damage; } @Override @@ -144,6 +157,7 @@ public class EntityWarDart extends LOTREntityProjectileBase { this.item = ItemStack.loadItemStackFromNBT(tagCompound.getCompoundTag("Item")); if (this.item != null) { this.damage = WarDart.getDamageFromMeta(this.item.getItemDamage()); + this.dart_type = this.item.getItemDamage(); this.dataWatcher.updateObject(ITEMSTACK_WATCHER_ID, this.item); // Ensure DataWatcher is updated with the deserialized ItemStack } } diff --git a/src/main/java/com/zivilon/cinder_loe/entity/trader/LimwaithFishmonger.java b/src/main/java/com/zivilon/cinder_loe/entity/trader/LimwaithFishmonger.java index b82cf31..889b98a 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/trader/LimwaithFishmonger.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/trader/LimwaithFishmonger.java @@ -2,7 +2,7 @@ package com.zivilon.cinder_loe.entity.trader; import com.zivilon.cinder_loe.CinderLoE; -import com.zivilon.cinder_loe.entity.npc.Limwaith; +import com.zivilon.cinder_loe.entity.npc.evil_human.Limwaith; import lotr.common.LOTRLevelData; import lotr.common.LOTRMod; import lotr.common.entity.npc.LOTRTradeEntries; diff --git a/src/main/java/com/zivilon/cinder_loe/entity/trader/LimwaithShaman.java b/src/main/java/com/zivilon/cinder_loe/entity/trader/LimwaithShaman.java index a8109b8..8d6c002 100644 --- a/src/main/java/com/zivilon/cinder_loe/entity/trader/LimwaithShaman.java +++ b/src/main/java/com/zivilon/cinder_loe/entity/trader/LimwaithShaman.java @@ -2,7 +2,7 @@ package com.zivilon.cinder_loe.entity.trader; import com.zivilon.cinder_loe.CinderLoE; -import com.zivilon.cinder_loe.entity.npc.Limwaith; +import com.zivilon.cinder_loe.entity.npc.evil_human.Limwaith; import lotr.common.LOTRLevelData; import lotr.common.LOTRMod; import lotr.common.entity.npc.LOTRTradeEntries; diff --git a/src/main/java/com/zivilon/cinder_loe/items/CinderFurItem.java b/src/main/java/com/zivilon/cinder_loe/items/CinderFurItem.java new file mode 100644 index 0000000..fd7f897 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/items/CinderFurItem.java @@ -0,0 +1,56 @@ +package com.zivilon.cinder_loe.items; + +import com.zivilon.cinder_loe.LoECreativeTabs; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +import java.util.List; + +public class CinderFurItem extends Item { + public IIcon[] icons; + + public CinderFurItem() { + super(); + this.setCreativeTab(LoECreativeTabs.tabMiscLoE); + setHasSubtypes(true); + } + + @Override + public void registerIcons(IIconRegister iconRegister) { + icons = new IIcon[7]; + for (int i = 0; i < 7; i++) { + icons[i] = iconRegister.registerIcon("lotr:cinder_fur_item_" + i); + } + } + + @Override + public String getUnlocalizedName(ItemStack item) { + return "item.cinder_fur_item_" + item.getItemDamage(); + } + + @Override + public IIcon getIconIndex(ItemStack item) { + return getIcon(item, 0); + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass) { + int dmg = stack.getItemDamage(); + + // Ensure dmg is within the expected range of subtypes + if (dmg < 7) { + return icons[dmg]; + } + return icons[0]; // Default to 0 if out of bounds + } + + @Override + public void getSubItems(Item item, CreativeTabs tab, List list) { + for (int i = 0; i < 7; i++) { + list.add(new ItemStack(item, 1, i)); + } + } +} 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 6022ae8..9a63149 100644 --- a/src/main/java/com/zivilon/cinder_loe/items/CinderLoESpawnEgg.java +++ b/src/main/java/com/zivilon/cinder_loe/items/CinderLoESpawnEgg.java @@ -1,11 +1,16 @@ package com.zivilon.cinder_loe.items; -import com.zivilon.cinder_loe.CinderLoE; - import com.zivilon.cinder_loe.LoECreativeTabs; import com.zivilon.cinder_loe.entity.*; import com.zivilon.cinder_loe.entity.corrupt.*; 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; +import com.zivilon.cinder_loe.entity.npc.dwarf.RedDwarfCommander; +import com.zivilon.cinder_loe.entity.npc.dwarf.RedDwarfWarrior; +import com.zivilon.cinder_loe.entity.npc.evil_human.*; +import com.zivilon.cinder_loe.entity.npc.good_human.*; +import com.zivilon.cinder_loe.entity.npc.radagast.*; import com.zivilon.cinder_loe.entity.trader.*; import net.minecraft.creativetab.CreativeTabs; @@ -75,8 +80,6 @@ public class CinderLoESpawnEgg extends Item { ENTITY_CLASSES.add(BreeOutrider.class); ENTITY_CLASSES.add(BreeSoldierBannerBearer.class); ENTITY_CLASSES.add(BreeCaptain.class); - ENTITY_CLASSES.add(DwarfLevy.class); // unregistered - ENTITY_CLASSES.add(HaradLevy.class); // unregistered ENTITY_CLASSES.add(FangornElk.class); ENTITY_CLASSES.add(FangornBear.class); ENTITY_CLASSES.add(FangornWildBoar.class); @@ -92,6 +95,7 @@ public class CinderLoESpawnEgg extends Item { ENTITY_CLASSES.add(CorruptHobbit.class); ENTITY_CLASSES.add(CorruptMan.class); ENTITY_CLASSES.add(CorruptOrc.class); + ENTITY_CLASSES.add(HobbitBannerBearer.class); } @Override @@ -115,7 +119,6 @@ public class CinderLoESpawnEgg extends Item { @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { if (!world.isRemote) { - // Perform a ray trace to find the block the player is looking at MovingObjectPosition target = getMovingObjectPositionFromPlayer(world, player, true); if (target != null && target.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { @@ -123,7 +126,6 @@ public class CinderLoESpawnEgg extends Item { int y = target.blockY; int z = target.blockZ; - // Adjust the y coordinate to spawn the entity on top of the block clicked y += 1; try { diff --git a/src/main/java/com/zivilon/cinder_loe/items/FirstAgeGlaive.java b/src/main/java/com/zivilon/cinder_loe/items/FirstAgeGlaive.java deleted file mode 100644 index 7d36235..0000000 --- a/src/main/java/com/zivilon/cinder_loe/items/FirstAgeGlaive.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.zivilon.cinder_loe.items; - -import com.zivilon.cinder_loe.CinderLoE; -import com.zivilon.cinder_loe.LoECreativeTabs; - -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - -import lotr.common.LOTRBannerProtection; -import lotr.common.LOTRMod; -import lotr.common.enchant.LOTREnchantment; -import lotr.common.enchant.LOTREnchantmentHelper; -import lotr.common.item.LOTRItemSword; -import lotr.common.item.LOTRItemPolearm; -import lotr.common.item.LOTRMaterial; -import lotr.common.item.LOTRWeaponStats; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.EnumAction; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -public class FirstAgeGlaive extends LOTRItemPolearm { - public FirstAgeGlaive() { - super(CinderLoE.MATERIAL_NEX_ICE); - this.lotrWeaponDamage = 11.5F; - this.setUnlocalizedName("lotr:firstAgeGlaive"); - this.setTextureName("lotr:firstAgeGlaive"); - this.setCreativeTab(LoECreativeTabs.tabCombatLoE); - LOTRWeaponStats.registerMeleeReach(FirstAgeGlaive.class, 1.8F); - LOTRWeaponStats.registerMeleeSpeed(FirstAgeGlaive.class, 1.0F); - } - - public boolean getIsRepairable(ItemStack itemstack, ItemStack repairItem) { - return (repairItem.getItem() == Item.getItemFromBlock(CinderLoE.enchantedIce)); - } - -// private void checkIncompatibleModifiers(ItemStack itemstack) {} - - public static UUID accessWeaponDamageModifier() { - return null; - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/items/ForgingKit.java b/src/main/java/com/zivilon/cinder_loe/items/ForgingKit.java new file mode 100644 index 0000000..29c4b06 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/items/ForgingKit.java @@ -0,0 +1,58 @@ +package com.zivilon.cinder_loe.items; + +import lotr.common.item.LOTRMaterial; +import lotr.common.item.LOTRItemSword; +import com.zivilon.cinder_loe.LoECreativeTabs; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +import java.util.List; + +public class ForgingKit extends Item { + public IIcon[] icons; + + public ForgingKit() { + this.setHasSubtypes(true); + setMaxStackSize(64); + this.setMaxDamage(0); + 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[2]; + this.icons[0] = iconRegister.registerIcon("lotr:repair_kit"); + this.icons[1] = iconRegister.registerIcon("lotr:upgrade_kit"); + } + + @Override + public String getUnlocalizedName(ItemStack item) { + switch(item.getItemDamage()) { + case 0: + return "item.repair_kit"; + case 1: + return "item.upgrade_kit"; + default: + return "item.repair_kit"; + } + } + + @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/LoEArmor.java b/src/main/java/com/zivilon/cinder_loe/items/LoEArmor.java new file mode 100644 index 0000000..087e536 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/items/LoEArmor.java @@ -0,0 +1,40 @@ +package com.zivilon.cinder_loe.items; + +import lotr.common.item.LOTRMaterial; +import lotr.common.item.LOTRItemArmor; +import com.zivilon.cinder_loe.LoECreativeTabs; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class LoEArmor extends LOTRItemArmor { + public Item repair_item; + + public LoEArmor(LOTRMaterial material, int slotType) { + this(material, slotType, ""); + } + public LoEArmor(LOTRMaterial material, int slotType, String s) { + this(material, slotType, s, (Item) null); + } + public LoEArmor(LOTRMaterial material, int slotType, Item item) { + this(material, slotType, "", item); + } + public LoEArmor(LOTRMaterial material, int slotType, Block block) { + this(material, slotType, "", block); + } + public LoEArmor(LOTRMaterial material, int slotType, String s, Block block) { + this(material, slotType, s, Item.getItemFromBlock(block)); + } + public LoEArmor(LOTRMaterial material, int slotType, String s, Item item) { + super(material, slotType, s); + repair_item = item; + setCreativeTab(LoECreativeTabs.tabCombatLoE); + } + + @Override + public boolean getIsRepairable(ItemStack item, ItemStack repair_material) { + if (repair_material.getItem() == repair_item) + return true; + return false; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/items/LoEBow.java b/src/main/java/com/zivilon/cinder_loe/items/LoEBow.java new file mode 100644 index 0000000..c412569 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/items/LoEBow.java @@ -0,0 +1,43 @@ +package com.zivilon.cinder_loe.items; + +import lotr.common.item.LOTRMaterial; +import lotr.common.item.LOTRItemBow; +import com.zivilon.cinder_loe.LoECreativeTabs; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class LoEBow extends LOTRItemBow { + public Item repair_item; + + public LoEBow(LOTRMaterial material) { + this(material, (Item) null, 1.0D); + } + public LoEBow(LOTRMaterial material, Block repair_block) { + this(material, Item.getItemFromBlock(repair_block), 1.0D); + } + public LoEBow(LOTRMaterial material, Block repair_block, double damage) { + this(material, Item.getItemFromBlock(repair_block), damage); + } + public LoEBow(LOTRMaterial material, double damage, Block repair_block) { + this(material, Item.getItemFromBlock(repair_block), damage); + } + public LoEBow(LOTRMaterial material, double damage) { + this(material, (Item) null, damage); + } + public LoEBow(LOTRMaterial material, double damage, Item item) { + this(material, item, damage); + } + public LoEBow(LOTRMaterial material, Item item, double damage) { + super(material, damage); + repair_item = item; + setCreativeTab(LoECreativeTabs.tabCombatLoE); + } + + @Override + public boolean getIsRepairable(ItemStack item, ItemStack repair_material) { + if (repair_material.getItem() == repair_item) + return true; + return false; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/items/LoEHammer.java b/src/main/java/com/zivilon/cinder_loe/items/LoEHammer.java new file mode 100644 index 0000000..a035da6 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/items/LoEHammer.java @@ -0,0 +1,31 @@ +package com.zivilon.cinder_loe.items; + +import lotr.common.item.LOTRMaterial; +import lotr.common.item.LOTRItemHammer; +import com.zivilon.cinder_loe.LoECreativeTabs; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class LoEHammer extends LOTRItemHammer { + public Item repair_item; + + public LoEHammer(LOTRMaterial material) { + this(material, (Item) null); + } + public LoEHammer(LOTRMaterial material, Block repair_block) { + this(material, Item.getItemFromBlock(repair_block)); + } + public LoEHammer(LOTRMaterial material, Item item) { + super(material); + repair_item = item; + setCreativeTab(LoECreativeTabs.tabCombatLoE); + } + + @Override + public boolean getIsRepairable(ItemStack item, ItemStack repair_material) { + if (repair_material.getItem() == repair_item) + return true; + return false; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/items/LoEItemMug.java b/src/main/java/com/zivilon/cinder_loe/items/LoEItemMug.java new file mode 100644 index 0000000..26fc1bc --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/items/LoEItemMug.java @@ -0,0 +1,69 @@ +package com.zivilon.cinder_loe.items; + +import com.zivilon.cinder_loe.LoECreativeTabs; + +import lotr.common.item.LOTRItemMug; +import lotr.common.item.LOTRItemMug.Vessel; +import lotr.client.render.LOTRDrinkIcons; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class LoEItemMug extends LOTRItemMug { + @SideOnly(Side.CLIENT) + public IIcon[] drinkIcons; + + @SideOnly(Side.CLIENT) + public IIcon liquidIcon; + + public LoEItemMug(boolean full, boolean food) { + super(full, food, false, 0.0F); + } + + public LoEItemMug(float alc) { + this(true, false, true, alc); + } + + public LoEItemMug(boolean full, boolean food, boolean brew, float alc) { + super(full, food, brew, alc); + setCreativeTab(LoECreativeTabs.tabFoodLoE); + } + + public void setTextureNameFromUnlocalizedName() { + String textureName = getUnlocalizedName().substring("item.".length()); // Strip the "item." prefix + this.setTextureName(textureName); + } + + + public void registerIcons(IIconRegister iconregister) { + if (this.isFullMug) { + this.drinkIcons = new IIcon[(Vessel.values()).length]; + for (int i = 0; i < (Vessel.values()).length; i++) { + this.drinkIcons[i] = LOTRDrinkIcons.registerDrinkIcon(iconregister, this, getIconString(), (Vessel.values()[i]).name); + } + this.liquidIcon = LOTRDrinkIcons.registerLiquidIcon(iconregister, this, getIconString()); + barrelGui_emptyBucketSlotIcon = iconregister.registerIcon("lotr:barrel_emptyBucketSlot"); + barrelGui_emptyMugSlotIcon = iconregister.registerIcon("lotr:barrel_emptyMugSlot"); + } else { + super.registerIcons(iconregister); + } + } + + public IIcon getIconFromDamage(int i) { + if (this.isFullMug) { + if (i == -1) + return this.liquidIcon; + int vessel = (getVessel(i)).id; + return this.drinkIcons[vessel]; + } + return super.getIconFromDamage(i); + } + + public static Vessel getVessel(int damage) { + int i = damage / vesselMeta; + return Vessel.forMeta(i); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/items/LoESpear.java b/src/main/java/com/zivilon/cinder_loe/items/LoESpear.java new file mode 100644 index 0000000..e875371 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/items/LoESpear.java @@ -0,0 +1,31 @@ +package com.zivilon.cinder_loe.items; + +import lotr.common.item.LOTRMaterial; +import lotr.common.item.LOTRItemSpear; +import com.zivilon.cinder_loe.LoECreativeTabs; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class LoESpear extends LOTRItemSpear { + public Item repair_item; + + public LoESpear(LOTRMaterial material) { + this(material, (Item) null); + } + public LoESpear(LOTRMaterial material, Block repair_block) { + this(material, Item.getItemFromBlock(repair_block)); + } + public LoESpear(LOTRMaterial material, Item item) { + super(material); + repair_item = item; + setCreativeTab(LoECreativeTabs.tabCombatLoE); + } + + @Override + public boolean getIsRepairable(ItemStack item, ItemStack repair_material) { + if (repair_material.getItem() == repair_item) + return true; + return false; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/items/LoESword.java b/src/main/java/com/zivilon/cinder_loe/items/LoESword.java new file mode 100644 index 0000000..395f37a --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/items/LoESword.java @@ -0,0 +1,36 @@ +package com.zivilon.cinder_loe.items; + +import lotr.common.item.LOTRMaterial; +import lotr.common.item.LOTRItemSword; +import com.zivilon.cinder_loe.LoECreativeTabs; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class LoESword extends LOTRItemSword { + public Item repair_item; + + public LoESword(LOTRMaterial material) { + this(material, (Item) null); + } + public LoESword(LOTRMaterial material, Block repair_block) { + this(material, Item.getItemFromBlock(repair_block)); + } + public LoESword(LOTRMaterial material, Item item) { + super(material); + repair_item = item; + setCreativeTab(LoECreativeTabs.tabCombatLoE); + } + + public LoESword setWeaponDamage(float damage) { + this.lotrWeaponDamage = damage; + return this; + } + + @Override + public boolean getIsRepairable(ItemStack item, ItemStack repair_material) { + if (repair_material.getItem() == repair_item) + return true; + return false; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/items/RadagastStaff.java b/src/main/java/com/zivilon/cinder_loe/items/RadagastStaff.java index d01d670..8a469e9 100644 --- a/src/main/java/com/zivilon/cinder_loe/items/RadagastStaff.java +++ b/src/main/java/com/zivilon/cinder_loe/items/RadagastStaff.java @@ -11,11 +11,11 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; import com.zivilon.cinder_loe.util.BlockPos; -import com.zivilon.cinder_loe.entity.npc.FangornBear; -import com.zivilon.cinder_loe.entity.npc.FangornWildBoar; -import com.zivilon.cinder_loe.entity.npc.FangornAuroch; -import com.zivilon.cinder_loe.entity.npc.FangornElk; -import com.zivilon.cinder_loe.entity.npc.FangornAnimal; +import com.zivilon.cinder_loe.entity.npc.radagast.FangornBear; +import com.zivilon.cinder_loe.entity.npc.radagast.FangornWildBoar; +import com.zivilon.cinder_loe.entity.npc.radagast.FangornAuroch; +import com.zivilon.cinder_loe.entity.npc.radagast.FangornElk; +import com.zivilon.cinder_loe.entity.npc.radagast.FangornAnimal; import java.util.Random; 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 74bdebf..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(100); - this.setNoRepair(); - this.setMaxStackSize(1); - } -} diff --git a/src/main/java/com/zivilon/cinder_loe/items/WarDart.java b/src/main/java/com/zivilon/cinder_loe/items/WarDart.java index 16a9421..02e0e13 100644 --- a/src/main/java/com/zivilon/cinder_loe/items/WarDart.java +++ b/src/main/java/com/zivilon/cinder_loe/items/WarDart.java @@ -1,8 +1,8 @@ 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; @@ -62,7 +62,7 @@ public class WarDart extends Item { @Override public void registerIcons(IIconRegister iconRegister) { - this.icons = new IIcon[14]; + this.icons = new IIcon[15]; this.icons[0] = iconRegister.registerIcon("lotr:war_dart_headless"); this.icons[1] = iconRegister.registerIcon("lotr:war_dart_copper"); this.icons[2] = iconRegister.registerIcon("lotr:war_dart_bronze"); @@ -77,6 +77,7 @@ public class WarDart extends Item { this.icons[11] = iconRegister.registerIcon("lotr:war_dart_red_dwarven"); this.icons[12] = iconRegister.registerIcon("lotr:war_dart_mithril"); this.icons[13] = iconRegister.registerIcon("lotr:war_dart_ancient"); + this.icons[14] = iconRegister.registerIcon("lotr:war_dart_morgul"); } public static String getDartMaterial(ItemStack item) { @@ -107,6 +108,8 @@ public class WarDart extends Item { return "mithril"; case 13: return "ancient"; + case 14: + return "morgul"; default: return "headless"; } @@ -122,22 +125,23 @@ public class WarDart extends Item { return damage; } - public static int getDamageFromMeta(int meta) { + public static double getDamageFromMeta(int meta) { switch(meta) { - case 1: return 3; // Copper - case 2: return 3; // Bronze - case 3: return 4; // Iron - case 4: return 5; // Orc - case 5: return 6; // Dwarven - case 6: return 6; // Uruk - case 7: return 6; // Blue Dwarven - case 8: return 6; // Black Uruk - case 9: return 6; // Elven - case 10: return 5; // Gilded Iron - case 11: return 6; // Red Dwarven - case 12: return 10; // Mithril - case 13: return 12; // Ancient - default: return 0; + case 1: return 5.5D; // Copper + case 2: return 5.5D; // Bronze + case 3: return 6.0D; // Iron + case 4: return 6.5D; // Orc + case 5: return 7.0D; // Dwarven + case 6: return 7.0D; // Uruk + case 7: return 7.0D; // Blue Dwarven + case 8: return 7.0D; // Black Uruk + case 9: return 7.0D; // Elven + case 10: return 6.5D; // Gilded Iron + case 11: return 7.0D; // Red Dwarven + case 12: return 9.0D; // Mithril + case 13: return 12.0D; // Ancient + case 14: return 6.5D; // Morgul + default: return 0.0D; } } diff --git a/src/main/java/com/zivilon/cinder_loe/items/WarDartHeads.java b/src/main/java/com/zivilon/cinder_loe/items/WarDartHeads.java index b08ba43..e5f5abd 100644 --- a/src/main/java/com/zivilon/cinder_loe/items/WarDartHeads.java +++ b/src/main/java/com/zivilon/cinder_loe/items/WarDartHeads.java @@ -12,7 +12,7 @@ import net.minecraft.util.IIcon; import java.util.List; public class WarDartHeads extends Item { - private IIcon[] icons; + public IIcon[] icons; public WarDartHeads() { super(); @@ -22,10 +22,13 @@ public class WarDartHeads extends Item { @Override public void registerIcons(IIconRegister iconRegister) { - icons = new IIcon[6]; - for (int i = 0; i < icons.length; i++) { + icons = new IIcon[12]; + for (int i = 0; i < 6; i++) { icons[i] = iconRegister.registerIcon("lotr:war_dart_heads_" + i); } + for (int i = 0; i < 6; i++) { + icons[i + 6] = iconRegister.registerIcon("lotr:war_dart_heads_" + i + "_morgul"); + } } @Override @@ -50,7 +53,8 @@ public class WarDartHeads extends Item { case 10: return 0xFFFFB0; // Gilded Iron case 11: return 0xFFC48B; // Red dwarven case 12: return 0xAFB3D3; // Mithril - case 13: return 0x033346; // Ancient + case 13: return 0x335753; // Ancient + case 14: return 16777215; // Morgul default: return 0xFFFFFF; // Blank } } @@ -63,16 +67,22 @@ public class WarDartHeads extends Item { @Override public IIcon getIcon(ItemStack stack, int renderPass) { int count = stack.stackSize; + int dmg = stack.getItemDamage(); + if (count > 5 || count < 1) { + if (dmg == 14) + return icons[6]; return icons[0]; } else { + if (dmg == 14) + return icons[count + 6]; return icons[count]; } } @Override public void getSubItems(Item item, CreativeTabs tab, List list) { - for (int i = 1; i < 14; i++) { + for (int i = 1; i < 15; i++) { list.add(new ItemStack(item, 1, i)); } } diff --git a/src/main/java/com/zivilon/cinder_loe/items/unitLevelTool.java b/src/main/java/com/zivilon/cinder_loe/items/unitLevelTool.java new file mode 100644 index 0000000..cadb92f --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/items/unitLevelTool.java @@ -0,0 +1,82 @@ +package com.zivilon.cinder_loe.items; + +import com.zivilon.cinder_loe.CinderLoE; +import com.zivilon.cinder_loe.LoECreativeTabs; +import lotr.common.entity.npc.LOTREntityNPC; +import lotr.common.entity.npc.LOTRHiredNPCInfo; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumAction; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; + +public class unitLevelTool extends Item { + + public unitLevelTool() { + setCreativeTab(LoECreativeTabs.tabMiscLoE); + } + + public EnumAction getItemUseAction(ItemStack itemstack) { + return EnumAction.bow; + } + + @Override + public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { + List hiredNPCs = this.findHiredNPCsNearPlayer(player); + + if (!hiredNPCs.isEmpty()) { + for (LOTREntityNPC hiredNPC : hiredNPCs) { + if (hiredNPC != null && hiredNPC.hiredNPCInfo != null) { + try { + LOTRHiredNPCInfo npcInfo = hiredNPC.hiredNPCInfo; + + Method addExperienceMethod = LOTRHiredNPCInfo.class.getDeclaredMethod("addExperience", int.class); + addExperienceMethod.setAccessible(true); + + int xpToAdd = 1; + + try { + xpToAdd = Integer.parseInt(itemStack.getDisplayName()); + } catch (NumberFormatException e) { + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Tool name wasnt a number, applying 1 Xp instead")); + continue; + } + + addExperienceMethod.invoke(npcInfo, xpToAdd); + + + } catch (Exception e) { + throw new RuntimeException(e); + } + } + } + } + return itemStack; + } + + private List findHiredNPCsNearPlayer(EntityPlayer player) { + // Logic to find all nearby hired NPCs within a certain range + double range = 20.0D; // Set the range within which the NPCs should be found + List nearbyHiredNPCs = new ArrayList<>(); + + for (Object entity : player.worldObj.getEntitiesWithinAABB(LOTREntityNPC.class, player.boundingBox.expand(range, range, range))) { + LOTREntityNPC npc = (LOTREntityNPC) entity; + + // Check if the player has sufficient permission level (admin tool usage) + if (npc.hiredNPCInfo.getHiringPlayerUUID() != null && player.canCommandSenderUseCommand(2, "")) { + nearbyHiredNPCs.add(npc); + } + } + + return nearbyHiredNPCs; + } + + +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinEnchantmentHelper.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinEnchantmentHelper.java new file mode 100644 index 0000000..230f580 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinEnchantmentHelper.java @@ -0,0 +1,27 @@ +package com.zivilon.cinder_loe.mixins; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import lotr.common.item.LOTRWeaponStats; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.enchantment.Enchantment; +import lotr.common.enchant.LOTREnchantmentHelper; + +@Mixin(EnchantmentHelper.class) +public class MixinEnchantmentHelper { + + /** + * @author Shinare + * @reason Having full knockbackResistance attribute now negates bonus knockback as well + */ + @Overwrite + public static int getKnockbackModifier(EntityLivingBase attacker, EntityLivingBase target) { + int vanilla_ench_level = EnchantmentHelper.getEnchantmentLevel(Enchantment.knockback.effectId, attacker.getHeldItem()); + int base_extra_knockback = LOTRWeaponStats.getBaseExtraKnockback(attacker.getHeldItem()); + int modifier_extra_knockback = LOTREnchantmentHelper.calcExtraKnockback(attacker.getHeldItem()); + if (target.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue() == 1.0D) return 0; + return vanilla_ench_level + base_extra_knockback + modifier_extra_knockback; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinEntity.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinEntity.java new file mode 100644 index 0000000..a1e4e4c --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinEntity.java @@ -0,0 +1,12 @@ +package com.zivilon.cinder_loe.mixins; + +import net.minecraft.entity.Entity; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +@Mixin(Entity.class) +public interface MixinEntity { + + @Accessor("invulnerable") + void setInvulnerable(boolean invulnerable); +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinEntityArrow.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinEntityArrow.java new file mode 100644 index 0000000..bda8bc1 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinEntityArrow.java @@ -0,0 +1,305 @@ +package com.zivilon.cinder_loe.mixins; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Overwrite; +import lotr.common.item.LOTRWeaponStats; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.enchantment.Enchantment; +import lotr.common.enchant.LOTREnchantmentHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import java.util.List; +import net.minecraft.entity.monster.EntityEnderman; + +@Mixin(EntityArrow.class) +public abstract class MixinEntityArrow extends Entity { + + public MixinEntityArrow(World world) { + super(world); + } + + @Shadow + public abstract void setIsCritical(boolean p_70243_1_); + @Shadow + public abstract boolean getIsCritical(); + + @Shadow + private Block field_145790_g; + @Shadow + private int field_145791_d; + @Shadow + private int field_145792_e; + @Shadow + private int field_145789_f; + @Shadow + private boolean inGround; + @Shadow + public int arrowShake; + @Shadow + private int inData; + @Shadow + private int ticksInGround; + @Shadow + private int ticksInAir; + @Shadow + public Entity shootingEntity; + @Shadow + private int knockbackStrength; + @Shadow + private double damage; + + /** + * @author Shinare + * @reason Having full knockbackResistance attribute now negates bonus knockback as well + */ + @Overwrite + public void onUpdate() { + super.onUpdate(); + + EntityArrow arrow = (EntityArrow)(Object)this; + + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { + float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f) * 180.0D / Math.PI); + } + + Block block = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f); + + if (block.getMaterial() != Material.air) { + block.setBlockBoundsBasedOnState(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f); + AxisAlignedBB axisalignedbb = block.getCollisionBoundingBoxFromPool(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f); + + if (axisalignedbb != null && axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ))) { + this.inGround = true; + } + } + + if (this.arrowShake > 0) { + --this.arrowShake; + } + + if (this.inGround) { + int j = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f); + + if (block == this.field_145790_g && j == this.inData) { + ++this.ticksInGround; + + if (this.ticksInGround == 1200) { + this.setDead(); + } + } else { + this.inGround = false; + this.motionX *= (double)(this.rand.nextFloat() * 0.2F); + this.motionY *= (double)(this.rand.nextFloat() * 0.2F); + this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); + this.ticksInGround = 0; + this.ticksInAir = 0; + } + } else { + ++this.ticksInAir; + Vec3 vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + Vec3 vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec31, vec3, false, true, false); + vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + + if (movingobjectposition != null) { + vec3 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); + } + + Entity entity = null; + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double d0 = 0.0D; + int i; + float f1; + + for (i = 0; i < list.size(); ++i) { + Entity entity1 = (Entity)list.get(i); + + if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) { + f1 = 0.3F; + AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand((double)f1, (double)f1, (double)f1); + MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec31, vec3); + + if (movingobjectposition1 != null) { + double d1 = vec31.distanceTo(movingobjectposition1.hitVec); + + if (d1 < d0 || d0 == 0.0D) { + entity = entity1; + d0 = d1; + } + } + } + } + + if (entity != null) { + movingobjectposition = new MovingObjectPosition(entity); + } + + if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer) { + EntityPlayer entityplayer = (EntityPlayer)movingobjectposition.entityHit; + + if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).canAttackPlayer(entityplayer)) { + movingobjectposition = null; + } + } + + float f2; + float f4; + + if (movingobjectposition != null) { + if (movingobjectposition.entityHit != null) { + f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + int k = MathHelper.ceiling_double_int((double)f2 * this.damage); + + if (this.getIsCritical()) { + k += this.rand.nextInt(k / 2 + 2); + } + + DamageSource damagesource = null; + + if (this.shootingEntity == null) { + damagesource = DamageSource.causeArrowDamage(arrow, this); + } else { + damagesource = DamageSource.causeArrowDamage(arrow, this.shootingEntity); + } + + if (arrow.isBurning() && !(movingobjectposition.entityHit instanceof EntityEnderman)) { + movingobjectposition.entityHit.setFire(5); + } + + if (movingobjectposition.entityHit.attackEntityFrom(damagesource, (float)k)) { + if (movingobjectposition.entityHit instanceof EntityLivingBase) { + EntityLivingBase entitylivingbase = (EntityLivingBase)movingobjectposition.entityHit; + + if (!this.worldObj.isRemote) { + entitylivingbase.setArrowCountInEntity(entitylivingbase.getArrowCountInEntity() + 1); + } + + + double knockback_resistance = entitylivingbase.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue(); + if (this.knockbackStrength > 0 && knockback_resistance < 1.0D) { + f4 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + + if (f4 > 0.0F) { + entitylivingbase.addVelocity(this.motionX * (double)this.knockbackStrength * 0.6000000238418579D / (double)f4, 0.1D, this.motionZ * (double)this.knockbackStrength * 0.6000000238418579D / (double)f4); + } + } + + if (this.shootingEntity != null && this.shootingEntity instanceof EntityLivingBase) { + EnchantmentHelper.func_151384_a(entitylivingbase, this.shootingEntity); + EnchantmentHelper.func_151385_b((EntityLivingBase)this.shootingEntity, entitylivingbase); + } + + if (this.shootingEntity != null && entitylivingbase != this.shootingEntity && entitylivingbase instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP) { + ((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(6, 0.0F)); + } + } + + arrow.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); + + if (!(movingobjectposition.entityHit instanceof EntityEnderman)) { + arrow.setDead(); + } + } else { + this.motionX *= -0.10000000149011612D; + this.motionY *= -0.10000000149011612D; + this.motionZ *= -0.10000000149011612D; + this.rotationYaw += 180.0F; + this.prevRotationYaw += 180.0F; + this.ticksInAir = 0; + } + } else { + this.field_145791_d = movingobjectposition.blockX; + this.field_145792_e = movingobjectposition.blockY; + this.field_145789_f = movingobjectposition.blockZ; + this.field_145790_g = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f); + this.inData = arrow.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f); + this.motionX = (double)((float)(movingobjectposition.hitVec.xCoord - this.posX)); + this.motionY = (double)((float)(movingobjectposition.hitVec.yCoord - this.posY)); + this.motionZ = (double)((float)(movingobjectposition.hitVec.zCoord - this.posZ)); + f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + this.posX -= this.motionX / (double)f2 * 0.05000000074505806D; + this.posY -= this.motionY / (double)f2 * 0.05000000074505806D; + this.posZ -= this.motionZ / (double)f2 * 0.05000000074505806D; + this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); + this.inGround = true; + this.arrowShake = 7; + this.setIsCritical(false); + + if (this.field_145790_g.getMaterial() != Material.air) { + this.field_145790_g.onEntityCollidedWithBlock(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f, this); + } + } + } + + if (arrow.getIsCritical()) { + for (i = 0; i < 4; ++i) { + arrow.worldObj.spawnParticle("crit", arrow.posX + arrow.motionX * (double)i / 4.0D, arrow.posY + arrow.motionY * (double)i / 4.0D, arrow.posZ + arrow.motionZ * (double)i / 4.0D, -arrow.motionX, -arrow.motionY + 0.2D, -arrow.motionZ); + } + } + + arrow.posX += arrow.motionX; + arrow.posY += arrow.motionY; + arrow.posZ += arrow.motionZ; + f2 = MathHelper.sqrt_double(arrow.motionX * arrow.motionX + arrow.motionZ * arrow.motionZ); + arrow.rotationYaw = (float)(Math.atan2(arrow.motionX, arrow.motionZ) * 180.0D / Math.PI); + + for (arrow.rotationPitch = (float)(Math.atan2(arrow.motionY, (double)f2) * 180.0D / Math.PI); arrow.rotationPitch - arrow.prevRotationPitch < -180.0F; arrow.prevRotationPitch -= 360.0F) { + ; + } + + while (arrow.rotationPitch - arrow.prevRotationPitch >= 180.0F) { + arrow.prevRotationPitch += 360.0F; + } + + while (arrow.rotationYaw - arrow.prevRotationYaw < -180.0F) { + arrow.prevRotationYaw -= 360.0F; + } + + while (arrow.rotationYaw - arrow.prevRotationYaw >= 180.0F) { + arrow.prevRotationYaw += 360.0F; + } + + arrow.rotationPitch = arrow.prevRotationPitch + (arrow.rotationPitch - arrow.prevRotationPitch) * 0.2F; + arrow.rotationYaw = arrow.prevRotationYaw + (arrow.rotationYaw - arrow.prevRotationYaw) * 0.2F; + float f3 = 0.99F; + f1 = 0.05F; + + if (arrow.isInWater()) { + for (int l = 0; l < 4; ++l) { + f4 = 0.25F; + arrow.worldObj.spawnParticle("bubble", arrow.posX - arrow.motionX * (double)f4, arrow.posY - arrow.motionY * (double)f4, arrow.posZ - arrow.motionZ * (double)f4, arrow.motionX, arrow.motionY, arrow.motionZ); + } + + f3 = 0.8F; + } + + if (arrow.isWet()) { + arrow.extinguish(); + } + + arrow.motionX *= (double)f3; + arrow.motionY *= (double)f3; + arrow.motionZ *= (double)f3; + arrow.motionY -= (double)f1; + arrow.setPosition(arrow.posX, arrow.posY, arrow.posZ); + this.func_145775_I(); + } + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinItemBlock.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinItemBlock.java deleted file mode 100644 index ef530a7..0000000 --- a/src/main/java/com/zivilon/cinder_loe/mixins/MixinItemBlock.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.zivilon.cinder_loe.mixins; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; -import org.spongepowered.asm.mixin.Shadow; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -@Mixin(ItemBlock.class) -public abstract class MixinItemBlock { - - @Shadow - public final Block field_150939_a; - - public MixinItemBlock(Block block) { - this.field_150939_a = block; - } - - @Overwrite(remap = false) - public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) { - - System.out.println("Placing block with metadata " + metadata); - if (!world.setBlock(x, y, z, field_150939_a, metadata, 3)) { - return false; - } - - if (world.getBlock(x, y, z) == field_150939_a) { - field_150939_a.onBlockPlacedBy(world, x, y, z, player, stack); - field_150939_a.onPostBlockPlaced(world, x, y, z, metadata); - } - - return true; - } -} 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 70fdd28..b44dd96 100644 --- a/src/main/java/com/zivilon/cinder_loe/mixins/MixinItemRenderer.java +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinItemRenderer.java @@ -1,11 +1,14 @@ package com.zivilon.cinder_loe.mixins; +import com.zivilon.cinder_loe.CinderLoE; +import com.zivilon.cinder_loe.CinderLoE_Config; import com.zivilon.cinder_loe.client.render.item.RenderHelper; import com.zivilon.cinder_loe.util.Utilities; -import com.zivilon.cinder_loe.CinderLoE_Config; + import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; + import org.spongepowered.asm.mixin.Dynamic; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; @@ -62,13 +65,26 @@ public abstract class MixinItemRenderer { @Shadow private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); - + @Shadow + private ItemStack itemToRender; + @Shadow + private float equippedProgress; + @Shadow + private float prevEquippedProgress; @Shadow private RenderBlocks renderBlocksIr; - @Shadow private Minecraft mc; + /** + * Reimplements the default behavior of the renderItem method. + * + * @author Shinare + * @reason Added support for semi-transparent item textures + * @param p_78443_1_ Don't ask me it's default parameter + * @param p_78443_2_ Don't ask me it's default parameter + * @param type Don't ask me it's default parameter + */ @Overwrite(remap = false) public void renderItem(EntityLivingBase p_78443_1_, ItemStack p_78443_2_, int p_78443_3_, ItemRenderType type) { GL11.glPushMatrix(); @@ -256,20 +272,13 @@ public abstract class MixinItemRenderer { if (!enchant) GL11.glPopMatrix(); // Restore the saved OpenGL state } + /** + * @author Shinare + * @reason Failsafe in case some @Redirect fails + */ @Overwrite public static void renderItemIn2D(Tessellator p_78439_0_, float p_78439_1_, float p_78439_2_, float p_78439_3_, float p_78439_4_, int p_78439_5_, int p_78439_6_, float p_78439_7_) { // 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); - -/* DEBUG - System.out.println("Printing stacktrace from original render method"); - Utilities.writeLog("Printing stacktrace from original render method"); - StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace(); - for (StackTraceElement element : stackTraceElements) { - Utilities.writeLog(element.toString()); - } - Utilities.writeLog(""); -*/ } - } diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRArmorModels.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRArmorModels.java index 568065e..faf1a3b 100644 --- a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRArmorModels.java +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRArmorModels.java @@ -47,10 +47,10 @@ import net.minecraft.item.Item; @Mixin(LOTRArmorModels.class) public class MixinLOTRArmorModels { - @Shadow + @Shadow(remap = false) private Map> specialArmorModels; - @Shadow + @Shadow(remap = false) public void copyModelRotations(ModelBiped target, ModelBiped src) { } diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRBrewingRecipes.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRBrewingRecipes.java new file mode 100644 index 0000000..d82b743 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRBrewingRecipes.java @@ -0,0 +1,15 @@ +package com.zivilon.cinder_loe.mixins; + +import lotr.common.recipe.LOTRBrewingRecipes; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Invoker; +import net.minecraft.item.ItemStack; + +@Mixin(LOTRBrewingRecipes.class) +public interface MixinLOTRBrewingRecipes { + + @Invoker(value = "addBrewingRecipe", remap = false) + static void addRecipe(ItemStack result, Object... ingredients) { + throw new UnsupportedOperationException(); // This is just to satisfy the compiler; it won't be used. + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRClientProxy.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRClientProxy.java index a81f479..15bf487 100644 --- a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRClientProxy.java +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRClientProxy.java @@ -18,9 +18,13 @@ import net.minecraft.util.ResourceLocation; @Mixin(LOTRClientProxy.class) public abstract class MixinLOTRClientProxy { - @Shadow + @Shadow(remap = false) public static final ResourceLocation enchantmentTexture = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + /** + * @author Shinare + * @reason Added support for semi-transparent item textures + */ @Overwrite(remap = false) public static void renderEnchantmentEffect() { Tessellator tessellator = Tessellator.instance; 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 a4e5884..1f4bd54 100644 --- a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRContainerAnvil.java +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRContainerAnvil.java @@ -2,23 +2,88 @@ package com.zivilon.cinder_loe.mixins; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; -import lotr.common.inventory.LOTRContainerAnvil; +import lotr.common.LOTRConfig; import lotr.common.LOTRMod; +import lotr.common.enchant.LOTREnchantment; +import lotr.common.enchant.LOTREnchantmentCombining; +import lotr.common.enchant.LOTREnchantmentHelper; +import lotr.common.entity.npc.LOTREntityScrapTrader; +import lotr.common.entity.npc.LOTRTradeable; +import lotr.common.inventory.LOTRContainerAnvil; +import lotr.common.item.AnvilNameColorProvider; +import lotr.common.item.LOTRItemEnchantment; +import lotr.common.item.LOTRItemModifierTemplate; import lotr.common.item.LOTRMaterial; +import lotr.common.recipe.LOTRRecipePoisonWeapon; import net.minecraft.init.Items; +import net.minecraft.inventory.IInventory; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemSword; import net.minecraft.item.ItemTool; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; import com.zivilon.cinder_loe.CinderLoE; +import com.zivilon.cinder_loe.util.Utilities; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.Objects; +import org.apache.commons.lang3.StringUtils; + @Mixin(LOTRContainerAnvil.class) -public class MixinLOTRContainerAnvil { +public abstract class MixinLOTRContainerAnvil { + @Shadow + public IInventory invInput; + @Shadow + public IInventory invOutput; + @Shadow + public LOTRTradeable theTrader; + @Shadow + public EntityPlayer thePlayer; + @Shadow + public int materialCost; + @Shadow + public int reforgeCost; + @Shadow + public int engraveOwnerCost; + @Shadow + public boolean isSmithScrollCombine; + @Shadow + public boolean isTrader; + @Shadow + private String repairedItemName; + @Shadow + abstract void detectAndSendChanges(); + @Shadow + abstract float getTraderMaterialPrice(ItemStack inputItem); + @Shadow + static boolean costsToRename(ItemStack itemstack) { + return false; + } + @Shadow + static String stripFormattingCodes(String name) { + return null; + } + @Shadow + static String applyFormattingCodes(String name, List colors) { + return null; + } + @Shadow + static List getAppliedFormattingCodes(String name) { + return null; + } + /** * @author Shinare @@ -75,7 +140,7 @@ public class MixinLOTRContainerAnvil { return (materialItem.getItem() == Items.iron_ingot); if (armorMaterial == CinderLoE.MATERIAL_BONEMOLD.toArmorMaterial()) return (materialItem.getItem() == CinderLoE.bonemold); - if (armorMaterial == CinderLoE.MATERIAL_RHUDUAR.toArmorMaterial()) + if (armorMaterial == CinderLoE.MATERIAL_RHUDAUR.toArmorMaterial()) return (materialItem.getItem() == Items.iron_ingot); if (armorMaterial == CinderLoE.MATERIAL_JADE.toArmorMaterial()) return (materialItem.getItem() == LOTRMod.emerald); @@ -83,4 +148,382 @@ public class MixinLOTRContainerAnvil { return false; } + + /** + * @author Shinare + * @reason Adding repair kits and removing bad modifiers from 3 modifier limit + **/ + @Overwrite(remap = false) + private void updateRepairOutput() { + ItemStack inputItem = this.invInput.getStackInSlot(0); + this.materialCost = 0; + this.reforgeCost = 0; + this.engraveOwnerCost = 0; + this.isSmithScrollCombine = false; + int baseAnvilCost = 0; + int repairCost = 0; + int combineCost = 0; + int renameCost = 0; + if (inputItem == null) { + this.invOutput.setInventorySlotContents(0, null); + this.materialCost = 0; + } else { + ItemStack inputCopy = inputItem.copy(); + ItemStack combinerItem = this.invInput.getStackInSlot(1); + ItemStack materialItem = this.isTrader ? null : this.invInput.getStackInSlot(2); + Map inputEnchants = EnchantmentHelper.getEnchantments(inputCopy); + boolean enchantingWithBook = false; + List inputModifiers = LOTREnchantmentHelper.getEnchantList(inputCopy); + baseAnvilCost = LOTREnchantmentHelper.getAnvilCost(inputItem) + ((combinerItem == null) ? 0 : LOTREnchantmentHelper.getAnvilCost(combinerItem)); + this.materialCost = 0; + String previousDisplayName = inputCopy.getDisplayName(); + String defaultItemName = inputCopy.getItem().getItemStackDisplayName(inputCopy); + String nameToApply = this.repairedItemName; + String formattedNameToApply = nameToApply; + List colorsToApply = new ArrayList(); + colorsToApply.addAll(getAppliedFormattingCodes(inputCopy.getDisplayName())); + boolean alteringNameColor = false; + if (costsToRename(inputItem) && combinerItem != null) { + if (combinerItem.getItem() instanceof AnvilNameColorProvider) { + AnvilNameColorProvider nameColorProvider = (AnvilNameColorProvider)combinerItem.getItem(); + EnumChatFormatting newColor = nameColorProvider.getAnvilNameColor(); + boolean isDifferentColor = !colorsToApply.contains(newColor); + if (isDifferentColor) { + for (EnumChatFormatting ecf : EnumChatFormatting.values()) { + if (ecf.isColor()) + while (colorsToApply.contains(ecf)) + colorsToApply.remove(ecf); + } + colorsToApply.add(newColor); + alteringNameColor = true; + } + } else if (combinerItem.getItem() == Items.flint) { + if (!colorsToApply.isEmpty()) { + colorsToApply.clear(); + alteringNameColor = true; + } + } + if (alteringNameColor) + renameCost++; + } + if (!colorsToApply.isEmpty()) { + if (StringUtils.isBlank(formattedNameToApply)) + formattedNameToApply = defaultItemName; + formattedNameToApply = applyFormattingCodes(formattedNameToApply, colorsToApply); + } + boolean nameChange = false; + if (formattedNameToApply != null && !formattedNameToApply.equals(previousDisplayName)) + if (StringUtils.isBlank(formattedNameToApply) || formattedNameToApply.equals(defaultItemName)) { + if (inputCopy.hasDisplayName()) { + inputCopy.func_135074_t(); + if (!stripFormattingCodes(previousDisplayName).equals(stripFormattingCodes(formattedNameToApply))) + nameChange = true; + } + } else { + inputCopy.setStackDisplayName(formattedNameToApply); + if (!stripFormattingCodes(previousDisplayName).equals(stripFormattingCodes(formattedNameToApply))) + nameChange = true; + } + if (nameChange) { + boolean costRename = costsToRename(inputItem); + if (costRename) + renameCost++; + } + if (this.isTrader) { + LOTREnchantmentCombining.CombineRecipe scrollCombine = LOTREnchantmentCombining.getCombinationResult(inputItem, combinerItem); + if (scrollCombine != null) { + this.invOutput.setInventorySlotContents(0, scrollCombine.createOutputItem()); + this.materialCost = scrollCombine.cost; + this.reforgeCost = 0; + this.engraveOwnerCost = 0; + this.isSmithScrollCombine = true; + return; + } + } + boolean combining = false; + if (combinerItem != null) { + enchantingWithBook = (combinerItem.getItem() == Items.enchanted_book && Items.enchanted_book.func_92110_g(combinerItem).tagCount() > 0); + if (enchantingWithBook && !LOTRConfig.enchantingVanilla) { + this.invOutput.setInventorySlotContents(0, null); + this.materialCost = 0; + return; + } + LOTREnchantment combinerItemEnchant = null; + if (combinerItem.getItem() instanceof LOTRItemEnchantment) { + combinerItemEnchant = ((LOTRItemEnchantment)combinerItem.getItem()).theEnchant; + } else if (combinerItem.getItem() instanceof LOTRItemModifierTemplate) { + combinerItemEnchant = LOTRItemModifierTemplate.getModifier(combinerItem); + } + if (!enchantingWithBook && combinerItemEnchant == null) + if (inputCopy.isItemStackDamageable() && inputCopy.getItem() == combinerItem.getItem()) { + int inputUseLeft = inputItem.getMaxDamage() - inputItem.getItemDamageForDisplay(); + int combinerUseLeft = combinerItem.getMaxDamage() - combinerItem.getItemDamageForDisplay(); + int restoredUses = combinerUseLeft + inputCopy.getMaxDamage() * 12 / 100; + int newUsesLeft = inputUseLeft + restoredUses; + int newDamage = inputCopy.getMaxDamage() - newUsesLeft; + newDamage = Math.max(newDamage, 0); + if (newDamage < inputCopy.getItemDamage()) { + inputCopy.setItemDamage(newDamage); + int restoredUses1 = inputCopy.getMaxDamage() - inputUseLeft; + int restoredUses2 = inputCopy.getMaxDamage() - combinerUseLeft; + combineCost += Math.max(0, Math.min(restoredUses1, restoredUses2) / 100); + } + combining = true; + } else if (!alteringNameColor && combinerItem.getItem() != CinderLoE.forgingKit) { + this.invOutput.setInventorySlotContents(0, null); + this.materialCost = 0; + return; + } + Map outputEnchants = new HashMap(inputEnchants); + if (LOTRConfig.enchantingVanilla) { + Map combinerEnchants = EnchantmentHelper.getEnchantments(combinerItem); + for (Object obj : combinerEnchants.keySet()) { + int combinedEnchLevel, combinerEnchID = ((Integer)obj).intValue(); + Enchantment combinerEnch = Enchantment.enchantmentsList[combinerEnchID]; + int inputEnchLevel = 0; + if (outputEnchants.containsKey(Integer.valueOf(combinerEnchID))) + inputEnchLevel = ((Integer)outputEnchants.get(Integer.valueOf(combinerEnchID))).intValue(); + int combinerEnchLevel = ((Integer)combinerEnchants.get(Integer.valueOf(combinerEnchID))).intValue(); + if (inputEnchLevel == combinerEnchLevel) { + combinedEnchLevel = ++combinerEnchLevel; + } else { + combinedEnchLevel = Math.max(combinerEnchLevel, inputEnchLevel); + } + combinerEnchLevel = combinedEnchLevel; + int levelsAdded = combinerEnchLevel - inputEnchLevel; + boolean canApply = combinerEnch.canApply(inputItem); + if (this.thePlayer.capabilities.isCreativeMode || inputItem.getItem() == Items.enchanted_book) + canApply = true; + for (Object objIn : outputEnchants.keySet()) { + int inputEnchID = ((Integer)objIn).intValue(); + Enchantment inputEnch = Enchantment.enchantmentsList[inputEnchID]; + if (inputEnchID != combinerEnchID) + if (!combinerEnch.canApplyTogether(inputEnch) || !inputEnch.canApplyTogether(combinerEnch)) { + canApply = false; + combineCost += levelsAdded; + } + } + if (canApply) { + combinerEnchLevel = Math.min(combinerEnchLevel, combinerEnch.getMaxLevel()); + outputEnchants.put(Integer.valueOf(combinerEnchID), Integer.valueOf(combinerEnchLevel)); + int costPerLevel = 0; + int enchWeight = combinerEnch.getWeight(); + if (enchWeight == 1) { + costPerLevel = 8; + } else if (enchWeight == 2) { + costPerLevel = 4; + } else if (enchWeight == 5) { + costPerLevel = 2; + } else if (enchWeight == 10) { + costPerLevel = 1; + } + combineCost += costPerLevel * levelsAdded; + } + } + } else { + outputEnchants.clear(); + } + EnchantmentHelper.setEnchantments(outputEnchants, inputCopy); + int maxMods = 3; + List outputMods = new ArrayList(); + outputMods.addAll(inputModifiers); + List combinerMods = LOTREnchantmentHelper.getEnchantList(combinerItem); + if (combinerItemEnchant != null) { + combinerMods.add(combinerItemEnchant); + if (combinerItemEnchant == LOTREnchantment.fire) { + Item item = inputCopy.getItem(); + if (LOTRRecipePoisonWeapon.poisonedToInput.containsKey(item)) { + Item unpoisoned = (Item)LOTRRecipePoisonWeapon.poisonedToInput.get(item); + inputCopy.func_150996_a(unpoisoned); + } + } + } + for (LOTREnchantment combinerMod : combinerMods) { + boolean canApply = combinerMod.canApply(inputItem, false); + if (canApply) + for (LOTREnchantment mod : outputMods) { + if (!mod.isCompatibleWith(combinerMod) || !combinerMod.isCompatibleWith(mod)) + canApply = false; + } + int numOutputMods = 0; + for (LOTREnchantment mod : outputMods) { + if (!mod.bypassAnvilLimit()) + numOutputMods++; + } + if (!combinerMod.bypassAnvilLimit() && numOutputMods >= maxMods) + canApply = false; + if (canApply) { + outputMods.add(combinerMod); + if (combinerMod.isBeneficial()) + combineCost += Math.max(1, (int)combinerMod.getValueModifier()); + } + } + if (combinerItem.getItem() == CinderLoE.forgingKit) { + List newMods = new ArrayList(); + if (combinerItem.getItemDamage() == 0) { + for (LOTREnchantment mod : outputMods) { + if (Utilities.isBadEnch(mod)) { + combineCost += 2; + } else { + newMods.add(mod); + } + } + } else { + for (LOTREnchantment mod : outputMods) { + if (Utilities.upgradedEnchants.containsKey(mod.enchantName)) { + combineCost += 2; + newMods.add(Utilities.upgradeEnch(inputCopy, mod)); + } else { + newMods.add(mod); + } + } + } + outputMods = newMods; + } + LOTREnchantmentHelper.setEnchantList(inputCopy, outputMods); + } + if (combineCost > 0) + combining = true; + int numEnchants = 0; + for (Object obj : inputEnchants.keySet()) { + int enchID = ((Integer)obj).intValue(); + Enchantment ench = Enchantment.enchantmentsList[enchID]; + int enchLevel = ((Integer)inputEnchants.get(Integer.valueOf(enchID))).intValue(); + numEnchants++; + int costPerLevel = 0; + int enchWeight = ench.getWeight(); + if (enchWeight == 1) { + costPerLevel = 8; + } else if (enchWeight == 2) { + costPerLevel = 4; + } else if (enchWeight == 5) { + costPerLevel = 2; + } else if (enchWeight == 10) { + costPerLevel = 1; + } + baseAnvilCost += numEnchants + enchLevel * costPerLevel; + } + if (enchantingWithBook && !inputCopy.getItem().isBookEnchantable(inputCopy, combinerItem)) + inputCopy = null; + for (LOTREnchantment mod : inputModifiers) { + if (mod.isBeneficial()) + baseAnvilCost += Math.max(1, (int)mod.getValueModifier()); + } + if (inputCopy.isItemStackDamageable()) { + boolean canRepair = false; + int availableMaterials = 0; + if (this.isTrader) { + canRepair = (getTraderMaterialPrice(inputItem) > 0.0F); + availableMaterials = Integer.MAX_VALUE; + } else { + canRepair = (materialItem != null && isRepairMaterial(inputItem, materialItem)); + if (materialItem != null) + availableMaterials = materialItem.stackSize - combineCost - renameCost; + } + int oneItemRepair = Math.min(inputCopy.getItemDamageForDisplay(), inputCopy.getMaxDamage() / 4); + if (canRepair && availableMaterials > 0 && oneItemRepair > 0) { + availableMaterials -= baseAnvilCost; + if (availableMaterials > 0) { + int usedMaterials = 0; + while (oneItemRepair > 0 && usedMaterials < availableMaterials) { + int newDamage = inputCopy.getItemDamageForDisplay() - oneItemRepair; + inputCopy.setItemDamage(newDamage); + oneItemRepair = Math.min(inputCopy.getItemDamageForDisplay(), inputCopy.getMaxDamage() / 4); + usedMaterials++; + } + repairCost += usedMaterials; + } else if (!nameChange && !combining) { + repairCost = 1; + int newDamage = inputCopy.getItemDamageForDisplay() - oneItemRepair; + inputCopy.setItemDamage(newDamage); + } + } + } + boolean repairing = (repairCost > 0); + if (combining || repairing) { + this.materialCost = baseAnvilCost; + this.materialCost += combineCost + repairCost; + } else { + this.materialCost = 0; + } + this.materialCost += renameCost; + if (inputCopy != null) { + int nextAnvilCost = LOTREnchantmentHelper.getAnvilCost(inputItem); + if (combinerItem != null) { + int combinerAnvilCost = LOTREnchantmentHelper.getAnvilCost(combinerItem); + nextAnvilCost = Math.max(nextAnvilCost, combinerAnvilCost); + } + if (combining) { + nextAnvilCost += 2; + } else if (repairing) { + nextAnvilCost++; + } + nextAnvilCost = Math.max(nextAnvilCost, 0); + if (nextAnvilCost > 0) + LOTREnchantmentHelper.setAnvilCost(inputCopy, nextAnvilCost); + } + if (LOTREnchantmentHelper.isReforgeable(inputItem)) { + this.reforgeCost = 2; + if (inputItem.getItem() instanceof ItemArmor) + this.reforgeCost = 3; + if (inputItem.isItemStackDamageable()) { + ItemStack reforgeCopy = inputItem.copy(); + int oneItemRepair = Math.min(reforgeCopy.getItemDamageForDisplay(), reforgeCopy.getMaxDamage() / 4); + if (oneItemRepair > 0) { + int usedMaterials = 0; + while (oneItemRepair > 0) { + int newDamage = reforgeCopy.getItemDamageForDisplay() - oneItemRepair; + reforgeCopy.setItemDamage(newDamage); + oneItemRepair = Math.min(reforgeCopy.getItemDamageForDisplay(), reforgeCopy.getMaxDamage() / 4); + usedMaterials++; + } + this.reforgeCost += usedMaterials; + } + } + this.engraveOwnerCost = 2; + } else { + this.reforgeCost = 0; + this.engraveOwnerCost = 0; + } + if (isRepairMaterial(inputItem, new ItemStack(Items.string))) { + int stringFactor = 3; + this.materialCost *= stringFactor; + this.reforgeCost *= stringFactor; + this.engraveOwnerCost *= stringFactor; + } + if (this.isTrader) { + boolean isCommonRenameOnly = (nameChange && this.materialCost == 0); + float materialPrice = getTraderMaterialPrice(inputItem); + if (materialPrice > 0.0F) { + this.materialCost = Math.round(this.materialCost * materialPrice); + this.materialCost = Math.max(this.materialCost, 1); + this.reforgeCost = Math.round(this.reforgeCost * materialPrice); + this.reforgeCost = Math.max(this.reforgeCost, 1); + this.engraveOwnerCost = Math.round(this.engraveOwnerCost * materialPrice); + this.engraveOwnerCost = Math.max(this.engraveOwnerCost, 1); + if (this.theTrader instanceof LOTREntityScrapTrader) { + this.materialCost = MathHelper.ceiling_float_int(this.materialCost * 0.5F); + this.materialCost = Math.max(this.materialCost, 1); + this.reforgeCost = MathHelper.ceiling_float_int(this.reforgeCost * 0.5F); + this.reforgeCost = Math.max(this.reforgeCost, 1); + this.engraveOwnerCost = MathHelper.ceiling_float_int(this.engraveOwnerCost * 0.5F); + this.engraveOwnerCost = Math.max(this.engraveOwnerCost, 1); + } + } else if (!isCommonRenameOnly) { + this.invOutput.setInventorySlotContents(0, null); + this.materialCost = 0; + this.reforgeCost = 0; + this.engraveOwnerCost = 0; + return; + } + } + if (combining || repairing || nameChange || alteringNameColor) { + this.invOutput.setInventorySlotContents(0, inputCopy); + } else { + this.invOutput.setInventorySlotContents(0, null); + this.materialCost = 0; + } + detectAndSendChanges(); + } + } } diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTREnchantment.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTREnchantment.java new file mode 100644 index 0000000..aa9678f --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTREnchantment.java @@ -0,0 +1,65 @@ +package com.zivilon.cinder_loe.mixins; + +import com.zivilon.cinder_loe.enchants.LOTREnchantmentWeakProtectionRanged; +import com.zivilon.cinder_loe.util.Utilities; +import lotr.common.enchant.LOTREnchantment; +import lotr.common.enchant.LOTREnchantmentDamage; +import lotr.common.enchant.LOTREnchantmentProtectionRanged; +import lotr.common.enchant.LOTREnchantmentRangedDamage; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import java.lang.reflect.Field; +import java.util.Map; + +@Mixin(LOTREnchantment.class) +public class MixinLOTREnchantment { + @Shadow + private boolean bypassAnvilLimit; + + @Inject(method = "", at = @At("TAIL")) + private static void onStaticInit(CallbackInfo ci) { + // Add your new enchantments here + try { + LOTREnchantment protectRangedWeak1 = new LOTREnchantmentWeakProtectionRanged("protectRangedWeak1", -1).setEnchantWeight(0); + LOTREnchantment protectRangedWeak2 = new LOTREnchantmentWeakProtectionRanged("protectRangedWeak2", -2).setEnchantWeight(0); + LOTREnchantment rangedWeak3 = new LOTREnchantmentRangedDamage("rangedWeak3", 0.25f); + LOTREnchantment weak4 = new LOTREnchantmentDamage("weak4", -3.0f).setEnchantWeight(0); + + LOTREnchantment.allEnchantments.add(protectRangedWeak1); + LOTREnchantment.allEnchantments.add(protectRangedWeak2); + rangedWeak3.allEnchantments.add(rangedWeak3); + LOTREnchantment.allEnchantments.add(weak4); + + Field enchantsByNameField = LOTREnchantment.class.getDeclaredField("enchantsByName"); + enchantsByNameField.setAccessible(true); + @SuppressWarnings("unchecked") + Map enchantsByName = (Map) enchantsByNameField.get(null); + + enchantsByName.put(protectRangedWeak1.enchantName, protectRangedWeak1); + enchantsByName.put(protectRangedWeak2.enchantName, protectRangedWeak2); + enchantsByName.put(rangedWeak3.enchantName, rangedWeak3); + enchantsByName.put(weak4.enchantName, weak4); + + } catch (NoSuchFieldException | IllegalAccessException e) { + e.printStackTrace(); + } + } + + /** + * @author Shinare + * @reason Bad enchantments will not count towards 3 modifier limit now + **/ + @Overwrite(remap = false) + public boolean bypassAnvilLimit() { + if (Utilities.isBadEnch((LOTREnchantment)(Object)this)) + return true; + return this.bypassAnvilLimit; + } + +} + diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTREntityAINearestAttackableTargetBasic.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTREntityAINearestAttackableTargetBasic.java new file mode 100644 index 0000000..c351181 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTREntityAINearestAttackableTargetBasic.java @@ -0,0 +1,35 @@ +package com.zivilon.cinder_loe.mixins; + +import com.zivilon.cinder_loe.potion.LoEPotions; // Needs to be implemented + +import lotr.common.LOTRLevelData; +import lotr.common.LOTRMod; +import lotr.common.entity.ai.LOTREntityAINearestAttackableTargetBasic; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.ai.EntityAITarget; +import net.minecraft.entity.player.EntityPlayer; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; + +@Mixin(LOTREntityAINearestAttackableTargetBasic.class) +public abstract class MixinLOTREntityAINearestAttackableTargetBasic extends EntityAITarget { + + public MixinLOTREntityAINearestAttackableTargetBasic(EntityCreature p_i1669_1_, boolean p_i1669_2_) { + super(p_i1669_1_, p_i1669_2_); + } + + /** + * @author Shinare + * @reason Added corrupting potion effect that makes all NPCs hostile + */ + @Overwrite(remap = false) + protected boolean isPlayerSuitableAlignmentTarget(EntityPlayer entityplayer) { + float alignment = LOTRLevelData.getData(entityplayer).getAlignment(LOTRMod.getNPCFaction((Entity)this.taskOwner)); + if (entityplayer == null || LoEPotions.corrupting == null) return alignment < 0.0F; + boolean corrupting = entityplayer.isPotionActive(LoEPotions.corrupting); // Needs to be implemented + return (alignment < 0.0F || corrupting); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTREntityProjectileBase.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTREntityProjectileBase.java new file mode 100644 index 0000000..329c8f4 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTREntityProjectileBase.java @@ -0,0 +1,259 @@ +package com.zivilon.cinder_loe.mixins; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Overwrite; +import lotr.common.item.LOTRWeaponStats; +import lotr.common.enchant.LOTREnchantmentHelper; +import lotr.common.entity.projectile.LOTREntityProjectileBase; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IProjectile; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +import java.util.List; + +@Mixin(LOTREntityProjectileBase.class) +public abstract class MixinLOTREntityProjectileBase extends Entity { + + public MixinLOTREntityProjectileBase(World world) { + super(world); + } + + @Shadow(remap = false) + public abstract void setIsCritical(boolean p_70243_1_); + @Shadow(remap = false) + public abstract boolean getIsCritical(); + @Shadow(remap = false) + public abstract float getSpeedReduction(); + @Shadow(remap = false) + public abstract String getImpactSound(); + @Shadow(remap = false) + protected abstract void onCollideWithTarget(Entity entity); + @Shadow(remap = false) + protected abstract float getKnockbackFactor(); + @Shadow(remap = false) + public abstract ItemStack getProjectileItem(); + @Shadow(remap = false) + public abstract DamageSource getDamageSource(); + @Shadow(remap = false) + public abstract int maxTicksInGround(); + @Shadow(remap = false) + public abstract float getBaseImpactDamage(Entity paramEntity, ItemStack paramItemStack); + + @Shadow(remap = false) + private int xTile = -1; + @Shadow(remap = false) + private int yTile = -1; + @Shadow(remap = false) + private int zTile = -1; + @Shadow(remap = false) + private Block inTile; + @Shadow(remap = false) + private int inData; + @Shadow(remap = false) + private boolean inGround; + @Shadow(remap = false) + public int shake; + @Shadow(remap = false) + public Entity shootingEntity; + @Shadow(remap = false) + private int ticksInGround; + @Shadow(remap = false) + private int ticksInAir; + @Shadow(remap = false) + private int knockbackStrength; + + + /** + * @author Shinare + * @reason Having full knockbackResistance attribute now negates bonus knockback as well + */ + @Overwrite(remap = false) + public void func_70071_h_() { + super.onUpdate(); + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { + float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(this.motionY, f) * 180.0D / Math.PI); + } + Block block = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile); + if (block != Blocks.air) { + block.setBlockBoundsBasedOnState((IBlockAccess)this.worldObj, this.xTile, this.yTile, this.zTile); + AxisAlignedBB axisalignedbb = block.getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile); + if (axisalignedbb != null && axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ))) + this.inGround = true; + } + if (this.shake > 0) + this.shake--; + if (this.inGround) { + Block j = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile); + int k = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile); + if (j == this.inTile && k == this.inData) { + this.ticksInGround++; + if (this.ticksInGround >= maxTicksInGround()) + setDead(); + } else { + this.inGround = false; + this.motionX *= (this.rand.nextFloat() * 0.2F); + this.motionY *= (this.rand.nextFloat() * 0.2F); + this.motionZ *= (this.rand.nextFloat() * 0.2F); + this.ticksInGround = 0; + this.ticksInAir = 0; + } + } else { + this.ticksInAir++; + Vec3 vec3d = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + Vec3 vec3d1 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec3d, vec3d1, false, true, false); + vec3d = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + vec3d1 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + if (movingobjectposition != null) + vec3d1 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); + Entity entity = null; + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double d = 0.0D; + int l; + for (l = 0; l < list.size(); l++) { + Entity entity1 = list.get(l); + if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) { + float f5 = 0.3F; + AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand(f5, f5, f5); + MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec3d, vec3d1); + if (movingobjectposition1 != null) { + double d1 = vec3d.distanceTo(movingobjectposition1.hitVec); + if (d1 < d || d == 0.0D) { + entity = entity1; + d = d1; + } + } + } + } + if (entity != null) + movingobjectposition = new MovingObjectPosition(entity); + if (movingobjectposition != null && movingobjectposition.entityHit instanceof EntityPlayer) { + EntityPlayer entityplayer = (EntityPlayer)movingobjectposition.entityHit; + if (entityplayer.capabilities.disableDamage || (this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).canAttackPlayer(entityplayer))) + movingobjectposition = null; + } + if (movingobjectposition != null) { + Entity hitEntity = movingobjectposition.entityHit; + if (hitEntity != null) { + ItemStack itemstack = getProjectileItem(); + int damageInt = MathHelper.ceiling_double_int(getBaseImpactDamage(hitEntity, itemstack)); + int fireAspect = 0; + if (itemstack != null) + if (this.shootingEntity instanceof EntityLivingBase && hitEntity instanceof EntityLivingBase) { + this.knockbackStrength += EnchantmentHelper.getKnockbackModifier((EntityLivingBase)this.shootingEntity, (EntityLivingBase)hitEntity); + } else { + this.knockbackStrength += LOTRWeaponStats.getTotalKnockback(itemstack); + } + if (getIsCritical()) + damageInt += this.rand.nextInt(damageInt / 2 + 2); + double[] prevMotion = { hitEntity.motionX, hitEntity.motionY, hitEntity.motionZ }; + DamageSource damagesource = getDamageSource(); + if (hitEntity.attackEntityFrom(damagesource, damageInt)) { + double[] newMotion = { hitEntity.motionX, hitEntity.motionY, hitEntity.motionZ }; + float kbf = getKnockbackFactor(); + hitEntity.motionX = prevMotion[0] + (newMotion[0] - prevMotion[0]) * kbf; + hitEntity.motionY = prevMotion[1] + (newMotion[1] - prevMotion[1]) * kbf; + hitEntity.motionZ = prevMotion[2] + (newMotion[2] - prevMotion[2]) * kbf; + if (isBurning()) + hitEntity.setFire(5); + if (hitEntity instanceof EntityLivingBase) { + EntityLivingBase hitEntityLiving = (EntityLivingBase)hitEntity; + double knockback_resistance = hitEntityLiving.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue(); + if (this.knockbackStrength > 0 && knockback_resistance < 1.0D) { + float knockback = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + if (knockback > 0.0F) + hitEntityLiving.addVelocity(this.motionX * this.knockbackStrength * 0.6D / knockback, 0.1D, this.motionZ * this.knockbackStrength * 0.6D / knockback); + } + if (fireAspect > 0) + hitEntityLiving.setFire(fireAspect * 4); + if (this.shootingEntity instanceof EntityLivingBase) { + EnchantmentHelper.func_151384_a(hitEntityLiving, this.shootingEntity); + EnchantmentHelper.func_151385_b((EntityLivingBase)this.shootingEntity, (Entity)hitEntityLiving); + } + if (this.shootingEntity instanceof EntityPlayerMP && hitEntityLiving instanceof EntityPlayer) + ((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacket((Packet)new S2BPacketChangeGameState(6, 0.0F)); + } + this.worldObj.playSoundAtEntity(this, getImpactSound(), 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); + onCollideWithTarget(hitEntity); + } else { + this.motionX *= -0.1D; + this.motionY *= -0.1D; + this.motionZ *= -0.1D; + this.rotationYaw += 180.0F; + this.prevRotationYaw += 180.0F; + this.ticksInAir = 0; + } + } else { + this.xTile = movingobjectposition.blockX; + this.yTile = movingobjectposition.blockY; + this.zTile = movingobjectposition.blockZ; + this.inTile = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile); + this.inData = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile); + this.motionX = (float)(movingobjectposition.hitVec.xCoord - this.posX); + this.motionY = (float)(movingobjectposition.hitVec.yCoord - this.posY); + this.motionZ = (float)(movingobjectposition.hitVec.zCoord - this.posZ); + float f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + this.posX -= this.motionX / f2 * 0.05D; + this.posY -= this.motionY / f2 * 0.05D; + this.posZ -= this.motionZ / f2 * 0.05D; + this.worldObj.playSoundAtEntity(this, getImpactSound(), 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); + this.inGround = true; + this.shake = 7; + setIsCritical(false); + if (this.inTile.getMaterial() != Material.air) + this.inTile.onEntityCollidedWithBlock(this.worldObj, this.xTile, this.yTile, this.zTile, this); + } + } + if (getIsCritical()) + for (l = 0; l < 4; l++) + this.worldObj.spawnParticle("crit", this.posX + this.motionX * l / 4.0D, this.posY + this.motionY * l / 4.0D, this.posZ + this.motionZ * l / 4.0D, -this.motionX, -this.motionY + 0.2D, -this.motionZ); + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + float f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + for (this.rotationPitch = (float)(Math.atan2(this.motionY, f3) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F); + for (; this.rotationPitch - this.prevRotationPitch >= 180.0F; this.prevRotationPitch += 360.0F); + for (; this.rotationYaw - this.prevRotationYaw < -180.0F; this.prevRotationYaw -= 360.0F); + for (; this.rotationYaw - this.prevRotationYaw >= 180.0F; this.prevRotationYaw += 360.0F); + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float f4 = getSpeedReduction(); + if (isInWater()) { + for (int k1 = 0; k1 < 4; k1++) { + float f7 = 0.25F; + this.worldObj.spawnParticle("bubble", this.posX - this.motionX * f7, this.posY - this.motionY * f7, this.posZ - this.motionZ * f7, this.motionX, this.motionY, this.motionZ); + } + f4 = 0.8F; + } + this.motionX *= f4; + this.motionY *= f4; + this.motionZ *= f4; + this.motionY -= 0.05000000074505806D; + setPosition(this.posX, this.posY, this.posZ); + func_145775_I(); + } + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRIntCache.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRIntCache.java index bcb9aef..eca9684 100644 --- a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRIntCache.java +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRIntCache.java @@ -11,21 +11,25 @@ import java.util.List; @Mixin(LOTRIntCache.class) public abstract class MixinLOTRIntCache { - @Shadow + @Shadow(remap = false) private static LOTRIntCache SERVER; - @Shadow + @Shadow(remap = false) private static LOTRIntCache CLIENT; - @Shadow + @Shadow(remap = false) private int intCacheSize = 256; - @Shadow + @Shadow(remap = false) private List freeSmallArrays; - @Shadow + @Shadow(remap = false) private List inUseSmallArrays; - @Shadow + @Shadow(remap = false) private List freeLargeArrays; - @Shadow + @Shadow(remap = false) private List inUseLargeArrays; + /** + * @author Shinare + * @reason Unsuccessfully trying to patch a crash bug + */ @Overwrite(remap = false) public int[] getIntArray(int size) { try { 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 4e1403b..0000000 --- a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRItemRendererManager.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.zivilon.cinder_loe.mixins; - -import lotr.client.LOTRItemRendererManager; -import lotr.client.render.item.LOTRRenderLargeItem; - -import net.minecraft.client.resources.IResourceManager; -import net.minecraft.item.Item; - -import java.lang.reflect.Field; - -import org.objectweb.asm.Opcodes; - -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import org.spongepowered.asm.mixin.injection.callback.LocalCapture; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; - -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 { - -/* @Inject(method = "func_110549_a(Lnet/minecraft/client/resources/IResourceManager;)V", - at = @At(value = "JUMP", opcode = Opcodes.IFEQ, ordinal = 0, shift = At.Shift.BEFORE), - locals = LocalCapture.CAPTURE_FAILSOFT, - remap = false) - private void afterIsLargeSet(IResourceManager resourceManager, CallbackInfo ci, int i, Field[] fields, Field field, Item item, LOTRRenderLargeItem largeItemRenderer, boolean isLarge) { - System.out.println("\u001B[35mVerifying item in renderer manager..."); - System.out.println("Name of item is " + item.getUnlocalizedName()); - System.out.println("Is crossbow: " + (item instanceof lotr.common.item.LOTRItemCrossbow)); - System.out.println("Is bow: " + (item instanceof lotr.common.item.LOTRItemBow)); - System.out.println("Is sword: " + (item instanceof lotr.common.item.LOTRItemSword)); - System.out.println("Is large: " + isLarge); - }*/ - @Shadow - private static List largeItemRenderers; - - @Overwrite - public void onResourceManagerReload(IResourceManager resourceManager) { - largeItemRenderers.clear(); - try { - for (Field field : LOTRMod.class.getFields()) { - System.out.println("Found field " + field.getName() + " of type " + field.getType().getName()); - if (field.getName().equals("spearRedDwarf")) { - System.out.println("Found spearRedDwarf"); - System.out.println("Is type Item: " + (field.get(null) instanceof Item)); - } - if (field.get(null) instanceof Item) { - Item item = (Item)field.get(null); - MinecraftForgeClient.registerItemRenderer(item, null); - LOTRRenderLargeItem largeItemRenderer = LOTRRenderLargeItem.getRendererIfLarge(item); - boolean isLarge = (largeItemRenderer != null); - System.out.println("\u001B[35mVerifying item in renderer manager..."); - System.out.println("Name of item is " + item.getUnlocalizedName()); - System.out.println("Is crossbow: " + (item instanceof lotr.common.item.LOTRItemCrossbow)); - System.out.println("Is bow: " + (item instanceof lotr.common.item.LOTRItemBow)); - System.out.println("Is sword: " + (item instanceof lotr.common.item.LOTRItemSword)); - System.out.println("Is large: " + isLarge); - 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) { - MinecraftForgeClient.registerItemRenderer(item, (IItemRenderer)largeItemRenderer); - } - if (largeItemRenderer != null) - largeItemRenderers.add(largeItemRenderer); - } - } - } 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/MixinLOTRRenderArmorStand.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderArmorStand.java index 0d3960f..aab91db 100644 --- a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderArmorStand.java +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderArmorStand.java @@ -29,24 +29,28 @@ import net.minecraftforge.client.ForgeHooksClient; @Mixin(LOTRRenderArmorStand.class) public abstract class MixinLOTRRenderArmorStand extends TileEntitySpecialRenderer { - @Shadow + @Shadow(remap = false) private static ModelBase standModel; - @Shadow + @Shadow(remap = false) private static ResourceLocation standTexture; - - @Shadow + @Shadow(remap = false) private static ModelBiped modelBipedMain; - @Shadow + @Shadow(remap = false) private static ModelBiped modelBiped1; - @Shadow + @Shadow(remap = false) private static ModelBiped modelBiped2; - @Shadow + @Shadow(remap = false) private static float BIPED_ARM_ROTATION; - @Shadow + @Shadow(remap = false) private static float BIPED_TICKS_EXISTED; + + /** + * @author Shinare + * @reason Added support configurable enchantment colour + */ @Overwrite(remap = false) - public void renderTileEntityAt(TileEntity tileentity, double d, double d1, double d2, float f) { + public void func_147500_a(TileEntity tileentity, double d, double d1, double d2, float f) { LOTRTileEntityArmorStand armorStand = (LOTRTileEntityArmorStand)tileentity; FakeArmorStandEntity fakeArmorStandEntity = FakeArmorStandEntity.INSTANCE; GL11.glPushMatrix(); 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 f19a2dc..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,17 +1,40 @@ package com.zivilon.cinder_loe.mixins; import com.zivilon.cinder_loe.client.render.item.RenderHelper; + 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 net.minecraft.client.Minecraft; import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.resources.IResource; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StringUtils; + +import net.minecraftforge.client.IItemRenderer; + +import java.io.IOException; +import java.util.Map; @Mixin(LOTRRenderLargeItem.class) public abstract class MixinLOTRRenderLargeItem { + + /** + * @author Shinare + * @reason Added support for transparent textures + */ @Redirect(method = "renderLargeItem(Lnet/minecraft/util/IIcon;)V", remap = false, at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/ItemRenderer;func_78439_a(Lnet/minecraft/client/renderer/Tessellator;FFFFIIF)V")) diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRTileEntityDwarvenForge.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRTileEntityDwarvenForge.java index 1b86f7f..280162a 100644 --- a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRTileEntityDwarvenForge.java +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRTileEntityDwarvenForge.java @@ -38,13 +38,12 @@ public abstract class MixinLOTRTileEntityDwarvenForge { protected boolean isCoal(ItemStack itemstack) { return (itemstack.getItem() == Items.coal); } - @Unique - protected boolean cinderLoE_Git$isMithril(ItemStack itemstack) { + + protected boolean isMithril(ItemStack itemstack) { return itemstack.getItem() == Item.getItemFromBlock(LOTRMod.oreMithril) || itemstack.getItem() == LOTRMod.mithril; } - @Unique - protected boolean cinderLoE_Git$isCoalBlock(ItemStack itemstack) { + protected boolean isCoalBlock(ItemStack itemstack) { return itemstack.getItem() == Item.getItemFromBlock(Blocks.coal_block); } @@ -52,6 +51,10 @@ public abstract class MixinLOTRTileEntityDwarvenForge { return (itemstack.getItem() == Items.gold_nugget); } + /** + * @author Shinare + * @reason Added recipe for CinderLoE.ingotAsh and CinderLoE.redDwarfSteel + */ @Overwrite(remap = false) protected ItemStack getAlloySmeltingResult(ItemStack itemstack, ItemStack alloyItem) { if (isIron(itemstack) && isCoal(alloyItem)) @@ -64,7 +67,7 @@ public abstract class MixinLOTRTileEntityDwarvenForge { return new ItemStack(CinderLoE.redDwarfSteel); if ((isCopper(itemstack) && isTin(alloyItem)) || (isTin(itemstack) && isCopper(alloyItem))) return new ItemStack(LOTRMod.bronze, 2); - if (this.cinderLoE_Git$isMithril(itemstack) && this.cinderLoE_Git$isCoalBlock(alloyItem)) + if (this.isMithril(itemstack) && this.isCoalBlock(alloyItem)) return new ItemStack(CinderLoE.ingotAsh, 1); return null; } diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRTradeEntries.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRTradeEntries.java index a056974..580d433 100644 --- a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRTradeEntries.java +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRTradeEntries.java @@ -9,6 +9,6 @@ import lotr.common.LOTRFoods; @Mixin(LOTRTradeEntries.class) public interface MixinLOTRTradeEntries { - @Invoker("setVessels") + @Invoker(value = "setVessels", remap = false) public abstract LOTRTradeEntries vessels(LOTRFoods foods); } diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRWorldGenMumakSkeleton.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRWorldGenMumakSkeleton.java index 76786c0..89e5633 100644 --- a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRWorldGenMumakSkeleton.java +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRWorldGenMumakSkeleton.java @@ -15,12 +15,16 @@ import com.zivilon.cinder_loe.CinderLoE; @Mixin(LOTRWorldGenMumakSkeleton.class) public class MixinLOTRWorldGenMumakSkeleton { - @Shadow + @Shadow(remap = false) protected Block boneBlock; - @Shadow + @Shadow(remap = false) protected int boneMeta; + /** + * @author Shinare + * @reason Replaces bone blocks with ivory blocks to make these structures unique + */ @Overwrite(remap = false) protected void setupRandomBlocks(Random random) { this.boneBlock = CinderLoE.ivoryBlock; diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinRenderItem.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinRenderItem.java index 396b349..2abbc2e 100644 --- a/src/main/java/com/zivilon/cinder_loe/mixins/MixinRenderItem.java +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinRenderItem.java @@ -57,17 +57,17 @@ public abstract class MixinRenderItem extends Render { @Shadow public static boolean renderInFrame; - @Shadow + @Shadow(remap = false) public byte getMiniBlockCount(ItemStack stack, byte original) { return 0; } - @Shadow + @Shadow(remap = false) public byte getMiniItemCount(ItemStack stack, byte original) { return 0; } - @Shadow + @Shadow(remap = false) public boolean shouldSpreadItems() { return false; } @@ -75,6 +75,20 @@ public abstract class MixinRenderItem extends Render { @Shadow private void renderGlint(int p_77018_1_, int p_77018_2_, int p_77018_3_, int p_77018_4_, int p_77018_5_) {} + /** + * Reimplements the default behavior of the renderDroppedItem method. + * + * @author Shinare + * @reason Added support for semi-transparent item textures + * @param p_77020_1_ Don't ask me it's default parameter + * @param p_77020_2_ Don't ask me it's default parameter + * @param p_77020_3_ Don't ask me it's default parameter + * @param p_77020_4_ Don't ask me it's default parameter + * @param p_77020_5_ Don't ask me it's default parameter + * @param p_77020_6_ Don't ask me it's default parameter + * @param p_77020_7_ Don't ask me it's default parameter + * @param pass Don't ask me it's default parameter + */ @Overwrite(remap = false) private void renderDroppedItem(EntityItem p_77020_1_, IIcon p_77020_2_, int p_77020_3_, float p_77020_4_, float p_77020_5_, float p_77020_6_, float p_77020_7_, int pass) { Tessellator tessellator = Tessellator.instance; @@ -209,6 +223,10 @@ public abstract class MixinRenderItem extends Render { } } + /** + * @author Shinare + * @reason Added support for semi-transparent item textures + */ @Overwrite(remap = false) public void renderEffect(TextureManager manager, int x, int y) { GL11.glDepthFunc(GL11.GL_EQUAL); diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity.java index 9c31081..03b56fc 100644 --- a/src/main/java/com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity.java +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity.java @@ -85,6 +85,10 @@ public abstract class MixinRendererLivingEntity extends Render { return 0.0F; } + /** + * @author Shinare + * @reason Added support for configurable enchantment colour + */ @Overwrite public void doRender(EntityLivingBase p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) { 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 891d0e6..2a8148c 100644 --- a/src/main/java/com/zivilon/cinder_loe/mixins/MixinSlotCrafting.java +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinSlotCrafting.java @@ -30,6 +30,11 @@ public abstract class MixinSlotCrafting { craftMatrix = null; } + /** + * @author Shinare + * @reason Added support for crafting with item durability. To register items for durability crafting, refer to com.zivilon.cinder_loe.util.DurableItemCrafter + */ + @Overwrite public void onPickupFromSlot(EntityPlayer p_82870_1_, ItemStack p_82870_2_) { FMLCommonHandler.instance().firePlayerCraftingEvent(p_82870_1_, p_82870_2_, craftMatrix); @@ -53,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/mixins/overrides/MixinLOTREntityWarg.java b/src/main/java/com/zivilon/cinder_loe/mixins/overrides/MixinLOTREntityWarg.java new file mode 100644 index 0000000..ea7db5a --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/overrides/MixinLOTREntityWarg.java @@ -0,0 +1,77 @@ +package com.zivilon.cinder_loe.mixins.overrides; + +import com.zivilon.cinder_loe.CinderLoE; +import lotr.common.LOTRMod; +import lotr.common.entity.npc.LOTREntityWarg; +import net.minecraft.entity.Entity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; + + +@Mixin(LOTREntityWarg.class) +public abstract class MixinLOTREntityWarg extends Entity { + + public MixinLOTREntityWarg(World worldIn) { + super(worldIn); + } + + /** + * @author KeyLime17 + * @reason Mevans + */ + + @Shadow + public abstract LOTREntityWarg.WargType getWargType(); + + @Overwrite(remap = false) + protected void func_70628_a(boolean flag, int i) { + Item furItem = null; + int furMeta = 0; + switch(getWargType().wargID) { + case 0: + furItem = LOTRMod.fur; + break; + case 1: + furItem = CinderLoE.cinderFurItem; + break; + case 2: + furItem = CinderLoE.cinderFurItem; + furMeta = 1; + break; + case 3: + furItem = CinderLoE.cinderFurItem; + furMeta = 2; + break; + case 4: + furItem = CinderLoE.cinderFurItem; + furMeta = 0; // Needs ice fur to be added + break; + case 5: + furItem = CinderLoE.cinderFurItem; + furMeta = 3; + break; + case 6: + furItem = CinderLoE.cinderFurItem; + furMeta = 0; // Needs fire fur to be added + break; + } + + int furs = 1 + this.rand.nextInt(3) + this.rand.nextInt(i + 1); + for (int l = 0; l < furs; l++) + entityDropItem(new ItemStack(furItem, 1, furMeta), 0.0F); + int bones = 2 + this.rand.nextInt(2) + this.rand.nextInt(i + 1); + for (int j = 0; j < bones; j++) + dropItem(LOTRMod.wargBone, 1); + if (flag) { + int rugChance = 50 - i * 8; + rugChance = Math.max(rugChance, 1); + if (this.rand.nextInt(rugChance) == 0) + entityDropItem(new ItemStack(LOTRMod.wargskinRug, 1, (getWargType()).wargID), 0.0F); + } + } + +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/overrides/MixinLOTRHiredNPCInfo.java b/src/main/java/com/zivilon/cinder_loe/mixins/overrides/MixinLOTRHiredNPCInfo.java new file mode 100644 index 0000000..cf9c4db --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/overrides/MixinLOTRHiredNPCInfo.java @@ -0,0 +1,154 @@ +package com.zivilon.cinder_loe.mixins.overrides; + +import lotr.common.entity.npc.LOTREntityNPC; +import lotr.common.entity.npc.LOTRHiredNPCInfo; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.IAttribute; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.ai.attributes.RangedAttribute; +import net.minecraft.entity.item.EntityFireworkRocket; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; +import net.minecraft.world.World; +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 java.util.UUID; + +@Mixin(LOTRHiredNPCInfo.class) +public class MixinLOTRHiredNPCInfo { + @Shadow + private LOTREntityNPC theEntity; + @Shadow + private UUID hiringPlayerUUID; + @Shadow + public int xpLevel = 1; + @Unique + public int levelUpCounter = 0; + + /** + * @author + * @reason + */ + @Overwrite(remap = false) + public void onLevelUp() { + EntityPlayer hirer; + rotateLevelUpStat(); + + Entity mount = this.theEntity.ridingEntity; + if (mount instanceof EntityLivingBase && !(mount instanceof LOTREntityNPC)) { + this.addLevelUpHealthGain((EntityLivingBase)mount); + } + if ((hirer = this.getHiringPlayer()) != null) { + hirer.addChatMessage((IChatComponent)new ChatComponentTranslation("lotr.hiredNPC.levelUp", new Object[]{this.theEntity.getCommandSenderName(), this.xpLevel})); + } + this.spawnLevelUpFireworks(); + } + + + public void rotateLevelUpStat() { + EntityLivingBase entity = (EntityLivingBase) this.theEntity; + + switch (levelUpCounter) { + case 0: + // +1 HP + this.addLevelUpHealthGain(entity); + break; + case 1: + // +0.25 Damage + this.increaseDamageGain(entity); + break; + case 2: + // +0.005 movement Speed + this.increaseMovementGain(entity); + break; + case 3: + // +0.1 knockback resistance + this.increaseKnockbackGain(entity); + break; + } + levelUpCounter = (levelUpCounter +1) % 4; + } + + /** + * @author + * @reason + */ + @Overwrite(remap = false) + public void addLevelUpHealthGain(EntityLivingBase gainingEntity) { + float healthBoost = 1.0f; + IAttributeInstance attrHealth = gainingEntity.getEntityAttribute(SharedMonsterAttributes.maxHealth); + attrHealth.setBaseValue(attrHealth.getBaseValue() + (double)healthBoost); + gainingEntity.heal(healthBoost); + } + + public void increaseDamageGain(EntityLivingBase gainingEntity) { + float damageBoost = 0.25f; + IAttributeInstance attribute = gainingEntity.getEntityAttribute(LOTREntityNPC.npcAttackDamage); + attribute.setBaseValue(attribute.getBaseValue() + (double)damageBoost); + } + + public void increaseMovementGain(EntityLivingBase gainingEntity) { + float movementBoost = 0.005f; + IAttributeInstance attribute = gainingEntity.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + attribute.setBaseValue(attribute.getBaseValue() + (double)movementBoost); + } + + public void increaseKnockbackGain(EntityLivingBase gainingEntity) { + float kbResBoost = 0.1f; + IAttributeInstance attribute = gainingEntity.getEntityAttribute(SharedMonsterAttributes.knockbackResistance); + attribute.setBaseValue(attribute.getBaseValue() + (double)kbResBoost); + } + + /** + * @author + * @reason + */ + @Overwrite(remap = false) + public EntityPlayer getHiringPlayer() { + if (this.hiringPlayerUUID == null) { + return null; + } + return this.theEntity.worldObj.func_152378_a(this.hiringPlayerUUID); + } + + public void spawnLevelUpFireworks() { + boolean bigLvlUp = this.xpLevel % 5 == 0; + World world = this.theEntity.worldObj; + ItemStack itemstack = new ItemStack(Items.fireworks); + NBTTagCompound itemData = new NBTTagCompound(); + NBTTagCompound fireworkData = new NBTTagCompound(); + NBTTagList explosionsList = new NBTTagList(); + int explosions = 1; + for (int l = 0; l < explosions; ++l) { + NBTTagCompound explosionData = new NBTTagCompound(); + explosionData.setBoolean("Flicker", true); + explosionData.setBoolean("Trail", bigLvlUp); + int[] colors = new int[]{0xFF5500, this.theEntity.getFaction().getFactionColor()}; + explosionData.setIntArray("Colors", colors); + boolean effectType = bigLvlUp; + explosionData.setByte("Type", (byte)(effectType ? 1 : 0)); + explosionsList.appendTag((NBTBase)explosionData); + } + fireworkData.setTag("Explosions", (NBTBase)explosionsList); + itemData.setTag("Fireworks", (NBTBase)fireworkData); + itemstack.setTagCompound(itemData); + EntityFireworkRocket firework = new EntityFireworkRocket(world, this.theEntity.posX, this.theEntity.boundingBox.minY + (double)this.theEntity.height, this.theEntity.posZ, itemstack); + NBTTagCompound fireworkNBT = new NBTTagCompound(); + firework.writeEntityToNBT(fireworkNBT); + fireworkNBT.setInteger("LifeTime", bigLvlUp ? 20 : 15); + firework.readEntityFromNBT(fireworkNBT); + world.spawnEntityInWorld((Entity)firework); + } + +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/overrides/MixinLOTRItemEntDraught.java b/src/main/java/com/zivilon/cinder_loe/mixins/overrides/MixinLOTRItemEntDraught.java index 7eac88c..d361b78 100644 --- a/src/main/java/com/zivilon/cinder_loe/mixins/overrides/MixinLOTRItemEntDraught.java +++ b/src/main/java/com/zivilon/cinder_loe/mixins/overrides/MixinLOTRItemEntDraught.java @@ -46,11 +46,11 @@ public abstract class MixinLOTRItemEntDraught { /** - * @author - * @reason - */ - @Overwrite - public ItemStack onEaten(ItemStack itemstack, World world, EntityPlayer entityplayer) { + * @author KeyLime17 + * @reason ??? + */ + @Overwrite(remap = false) + public ItemStack func_77654_b(ItemStack itemstack, World world, EntityPlayer entityplayer) { final Random rand = new Random(); int chance = rand.nextInt(100); @@ -83,11 +83,11 @@ public abstract class MixinLOTRItemEntDraught { } /** - * @author - * @reason - */ - @Overwrite - public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k, int side, float f, float f1, float f2) { + * @author KeyLime17 + * @reason ??? + */ + @Overwrite(remap = false) + public boolean func_77648_a(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k, int side, float f, float f1, float f2) { if (this.getDraughtInfo((ItemStack)itemstack).name.equals("gold")) { if (LOTRLevelData.getData(entityplayer).getAlignment(LOTRFaction.FANGORN) < 500.0f) { if (!world.isRemote) { diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/overrides/MixinLOTRReplacedMethods.java b/src/main/java/com/zivilon/cinder_loe/mixins/overrides/MixinLOTRReplacedMethods.java new file mode 100644 index 0000000..772d827 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/overrides/MixinLOTRReplacedMethods.java @@ -0,0 +1,25 @@ +package com.zivilon.cinder_loe.mixins.overrides; + +import lotr.common.coremod.LOTRReplacedMethods; +import lotr.common.enchant.LOTREnchantmentHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; + +@Mixin(LOTRReplacedMethods.Enchants.class) +public class MixinLOTRReplacedMethods { + + /** + * @author Keylime + * @reason because Mixins complains + */ + @Overwrite(remap = false) + public static int getSpecialArmorProtection(int base, ItemStack[] armor, DamageSource source) { + int i = base; + i += LOTREnchantmentHelper.calcSpecialArmorSetProtection(armor, source); + //i = MathHelper.clamp_int(i, -25, 25); + return i; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/overrides/MixinLOTRUnitTradeEntries.java b/src/main/java/com/zivilon/cinder_loe/mixins/overrides/MixinLOTRUnitTradeEntries.java new file mode 100644 index 0000000..5070c85 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/overrides/MixinLOTRUnitTradeEntries.java @@ -0,0 +1,376 @@ +package com.zivilon.cinder_loe.mixins.overrides; + +import com.zivilon.cinder_loe.CinderUnitTradeEntry; +import com.zivilon.cinder_loe.entity.npc.HobbitBannerBearer; +import com.zivilon.cinder_loe.entity.npc.elf.Sirrandrai; +import com.zivilon.cinder_loe.entity.npc.evil_human.RhudaurSoldier; +import com.zivilon.cinder_loe.entity.npc.good_human.BattleNun; +import com.zivilon.cinder_loe.entity.npc.good_human.EsgarothSoldier; +import com.zivilon.cinder_loe.entity.npc.good_human.TauredainTrueBlood; +import com.zivilon.cinder_loe.entity.npc.orc.MorgulOrc; +import com.zivilon.cinder_loe.entity.npc.orc.NorthernOrc; +import lotr.common.LOTRMod; +import lotr.common.entity.animal.*; +import lotr.common.entity.npc.*; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; + +@Mixin(LOTRUnitTradeEntries.class) +public class MixinLOTRUnitTradeEntries { + + @Shadow + public static LOTRUnitTradeEntries MORDOR_ORC_MERCENARY_CAPTAIN = new LOTRUnitTradeEntries(150.0f, + new LOTRUnitTradeEntry(LOTREntityMordorOrc.class, 150, 0.0f), + new LOTRUnitTradeEntry(LOTREntityMordorOrcArcher.class, 150, 50.0f), + new LOTRUnitTradeEntry(LOTREntityMordorOrcBombardier.class, 250, 400.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityMordorWarg.class, 100, 0.0f), + new LOTRUnitTradeEntry(LOTREntityMordorOrc.class, LOTREntityMordorWarg.class, "MordorOrc_Warg", 250, 100.0f).setMountArmor(LOTRMod.wargArmorMordor, 0.5f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityMordorOrcArcher.class, LOTREntityMordorWarg.class, "MordorOrcArcher_Warg", 250, 150.0f).setMountArmor(LOTRMod.wargArmorMordor, 0.5f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityMordorWargBombardier.class, 400, 250.0f), + new LOTRUnitTradeEntry(LOTREntityOlogHai.class, 800, 350.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityMordorBannerBearer.class, 150, 150.0f), + new LOTRUnitTradeEntry(LOTREntityMordorBannerBearer.class, LOTREntityMordorWarg.class, "Banner_Warg", 150, 250.0f).setMountArmor(LOTRMod.wargArmorMordor, 0.5f).setPledgeExclusive(), + new LOTRUnitTradeEntry(MorgulOrc.class, 130, 750.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(MorgulOrc.class, LOTREntityMordorWarg.class, "MordorOrc_Warg", 230, 750.0f).setPledgeExclusive().setMountArmor(LOTRMod.wargArmorMordor, 1.0f), + new LOTRUnitTradeEntry(LOTREntityMinasMorgulBannerBearer.class, 130, 150.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityMinasMorgulBannerBearer.class, LOTREntityMordorWarg.class, "Banner_Warg", 230, 750.0f).setPledgeExclusive().setMountArmor(LOTRMod.wargArmorMordor, 1.0f)); + @Shadow + public static LOTRUnitTradeEntries GONDORIAN_CAPTAIN = new LOTRUnitTradeEntries(200.0f, + new LOTRUnitTradeEntry(LOTREntityGondorLevyman.class, 150, 0.0f), + new LOTRUnitTradeEntry(LOTREntityGondorSoldier.class, 250, 50.0f), + new LOTRUnitTradeEntry(LOTREntityGondorArcher.class, 250, 100.0f), + new LOTRUnitTradeEntry(LOTREntityGondorSoldier.class, LOTREntityHorse.class, "GondorSoldier_Horse", 350, 150.0f).setMountArmor(LOTRMod.horseArmorGondor).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityGondorTowerGuard.class, 500, 250.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityGondorBannerBearer.class, 250, 200.0f), + new LOTRUnitTradeEntry(LOTREntityGondorBannerBearer.class, LOTREntityHorse.class, "Banner_Horse", 350, 300.0f).setMountArmor(LOTRMod.horseArmorGondor).setPledgeExclusive()); + @Shadow + public static LOTRUnitTradeEntries DWARF_COMMANDER = new LOTRUnitTradeEntries(200.0f, + new LOTRUnitTradeEntry(LOTREntityDwarf.class, 60, 0.0f), + new LOTRUnitTradeEntry(LOTREntityDwarfWarrior.class, 400, 50.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityDwarfAxeThrower.class, 400, 100.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityDwarfWarrior.class, LOTREntityWildBoar.class, "DwarfWarrior_Boar", 500, 150.0f).setMountArmor(LOTRMod.boarArmorDwarven).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityDwarfAxeThrower.class, LOTREntityWildBoar.class, "DwarfAxeThrower_Boar", 500, 200.0f).setMountArmor(LOTRMod.boarArmorDwarven).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityDwarfBannerBearer.class, 400, 200.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityDwarfBannerBearer.class, LOTREntityWildBoar.class, "Banner_Horse", 500, 300.0f).setMountArmor(LOTRMod.boarArmorDwarven).setPledgeExclusive()); + @Shadow + public static LOTRUnitTradeEntries URUK_HAI_MERCENARY_CAPTAIN = new LOTRUnitTradeEntries(150.0f, + new LOTRUnitTradeEntry(LOTREntityIsengardSnaga.class, 100, 0.0f), + new LOTRUnitTradeEntry(LOTREntityIsengardSnagaArcher.class, 100, 50.0f), + new LOTRUnitTradeEntry(LOTREntityUrukHai.class, 500, 0.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityUrukHaiCrossbower.class, 500, 50.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityUrukHaiSapper.class, 600, 100.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityUrukHaiBerserker.class, 600, 150.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityUrukWarg.class, 100, 0.0f), + new LOTRUnitTradeEntry(LOTREntityIsengardSnaga.class, LOTREntityUrukWarg.class, "IsengardSnaga_Warg", 200, 100.0f).setMountArmor(LOTRMod.wargArmorUruk, 0.5f), + new LOTRUnitTradeEntry(LOTREntityIsengardSnagaArcher.class, LOTREntityUrukWarg.class, "IsengardSnagaArcher_Warg", 200, 150.0f).setMountArmor(LOTRMod.wargArmorUruk, 0.5f), + new LOTRUnitTradeEntry(LOTREntityUrukWargBombardier.class, 400, 250.0f), + new LOTRUnitTradeEntry(LOTREntityUrukHaiBannerBearer.class, 500, 150.0f).setPledgeExclusive()); + @Shadow + public static LOTRUnitTradeEntries ELF_LORD = new LOTRUnitTradeEntries(300.0f, + new LOTRUnitTradeEntry(LOTREntityGaladhrimElf.class, 60, 0.0f), + new LOTRUnitTradeEntry(LOTREntityGaladhrimWarden.class, 250, 50.0f), + new LOTRUnitTradeEntry(LOTREntityGaladhrimWarrior.class, 500, 100.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityGaladhrimWarrior.class, LOTREntityHorse.class, "GaladhrimWarrior_Horse", 600, 200.0f).setMountArmor(LOTRMod.horseArmorGaladhrim).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityGaladhrimBannerBearer.class, 500, 250.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityGaladhrimBannerBearer.class, LOTREntityHorse.class, "Banner_Horse", 600, 350.0f).setMountArmor(LOTRMod.horseArmorGaladhrim).setPledgeExclusive()); + @Shadow + public static LOTRUnitTradeEntries ROHIRRIM_MARSHAL = new LOTRUnitTradeEntries(150.0f, + new LOTRUnitTradeEntry(LOTREntityRohirrimWarrior.class, 250, 0.0f), + new LOTRUnitTradeEntry(LOTREntityRohirrimArcher.class, 250, 50.0f), + new LOTRUnitTradeEntry(LOTREntityRohirrimWarrior.class, LOTREntityHorse.class, "Rohirrim_Horse", 350, 100.0f).setMountArmor(LOTRMod.horseArmorRohan).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityRohirrimArcher.class, LOTREntityHorse.class, "RohirrimArcher_Horse", 350, 150.0f).setMountArmor(LOTRMod.horseArmorRohan).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityRohanBannerBearer.class, 250, 150.0f), + new LOTRUnitTradeEntry(LOTREntityRohanBannerBearer.class, LOTREntityHorse.class, "Banner_Horse", 350, 250.0f).setMountArmor(LOTRMod.horseArmorRohan).setPledgeExclusive()); + @Shadow + public static LOTRUnitTradeEntries HOBBIT_SHIRRIFF = new LOTRUnitTradeEntries(50.0f, + new LOTRUnitTradeEntry(LOTREntityHobbitBounder.class, 60, 0.0f), + new LOTRUnitTradeEntry(LOTREntityHobbitBounder.class, LOTREntityShirePony.class, "HobbitBounder_Pony", 160, 50.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(HobbitBannerBearer.class, 60, 100.0f), + new LOTRUnitTradeEntry(HobbitBannerBearer.class, LOTREntityShirePony.class, "Banner_Horse", 160, 200.0f).setPledgeExclusive() + ); + @Shadow + public static LOTRUnitTradeEntries DUNLENDING_WARLORD = new LOTRUnitTradeEntries(100.0f, + new LOTRUnitTradeEntry(LOTREntityDunlending.class, 60, 0.0f), + new LOTRUnitTradeEntry(LOTREntityDunlendingWarrior.class, 250, 50.0f), + new LOTRUnitTradeEntry(LOTREntityDunlendingArcher.class, 250, 100.0f), + new LOTRUnitTradeEntry(LOTREntityDunlendingAxeThrower.class, 250, 100.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityDunlendingBerserker.class, 400, 200.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityDunlendingBannerBearer.class, 250, 200.0f)); + @Shadow + public static LOTRUnitTradeEntries WOOD_ELF_CAPTAIN = new LOTRUnitTradeEntries(250.0f, + new LOTRUnitTradeEntry(LOTREntityWoodElf.class, 60, 0.0f), + new LOTRUnitTradeEntry(LOTREntityWoodElfScout.class, 250, 50.0f), + new LOTRUnitTradeEntry(LOTREntityWoodElfWarrior.class, 500, 100.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityWoodElfWarrior.class, LOTREntityElk.class, "WoodElfWarrior_Elk", 600, 200.0f).setMountArmor(LOTRMod.elkArmorWoodElven).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityWoodElfBannerBearer.class, 500, 250.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityWoodElfBannerBearer.class, LOTREntityElk.class, "Banner_Horse", 600, 350.0f).setMountArmor(LOTRMod.elkArmorWoodElven).setPledgeExclusive()); + @Shadow + public static LOTRUnitTradeEntries ANGMAR_ORC_MERCENARY_CAPTAIN = new LOTRUnitTradeEntries(150.0f, + new LOTRUnitTradeEntry(LOTREntityAngmarOrc.class, 150, 0.0f), + new LOTRUnitTradeEntry(LOTREntityAngmarOrcArcher.class, 150, 50.0f), + new LOTRUnitTradeEntry(LOTREntityAngmarOrcBombardier.class, 250, 100.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityAngmarWarg.class, 100, 0.0f), + new LOTRUnitTradeEntry(LOTREntityAngmarOrc.class, LOTREntityAngmarWarg.class, "AngmarOrc_Warg", 250, 100.0f).setMountArmor(LOTRMod.wargArmorAngmar, 0.5f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityAngmarOrcArcher.class, LOTREntityAngmarWarg.class, "AngmarOrcArcher_Warg", 250, 150.0f).setMountArmor(LOTRMod.wargArmorAngmar, 0.5f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityAngmarWargBombardier.class, 400, 250.0f), + new LOTRUnitTradeEntry(LOTREntityTroll.class, 500, 250.0f), + new LOTRUnitTradeEntry(LOTREntityMountainTroll.class, 600, 350.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityAngmarBannerBearer.class, 150, 150.0f), + new LOTRUnitTradeEntry(LOTREntityAngmarBannerBearer.class, LOTREntityAngmarWarg.class, "Banner_Warg", 250, 250.0f).setMountArmor(LOTRMod.wargArmorAngmar, 0.5f).setPledgeExclusive(), + (new CinderUnitTradeEntry(NorthernOrc.class, 500, 400.0F).setObjective("Angmar").setExtraInfo("Angmar")).setPledgeExclusive()); + @Shadow + public static LOTRUnitTradeEntries MORDOR_ORC_SLAVER = new LOTRUnitTradeEntries(200.0f, + new LOTRUnitTradeEntry(LOTREntityNurnSlave.class, 100, 0.0f).setTask(LOTRHiredNPCInfo.Task.FARMER)); + @Shadow + public static LOTRUnitTradeEntries MORDOR_ORC_SPIDER_KEEPER = new LOTRUnitTradeEntries(250.0f, + new LOTRUnitTradeEntry(LOTREntityMordorSpider.class, 100, 0.0f), + new LOTRUnitTradeEntry(LOTREntityMordorOrc.class, 150, 0.0f), + new LOTRUnitTradeEntry(LOTREntityMordorOrcArcher.class, 150, 0.0f), + new LOTRUnitTradeEntry(LOTREntityMordorOrc.class, LOTREntityMordorSpider.class, "MordorOrc_Spider", 250, 50.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityMordorOrcArcher.class, LOTREntityMordorSpider.class, "MordorOrcArcher_Spider", 250, 100.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityNanUngolBannerBearer.class, 150, 150.0f), + new LOTRUnitTradeEntry(LOTREntityNanUngolBannerBearer.class, LOTREntityMordorSpider.class, "MordorOrcArcher_Spider", 250, 250.0f).setPledgeExclusive()); + @Shadow + public static LOTRUnitTradeEntries GUNDABAD_ORC_MERCENARY_CAPTAIN = new LOTRUnitTradeEntries(100.0f, + new LOTRUnitTradeEntry(LOTREntityGundabadOrc.class, 100, 0.0f), + new LOTRUnitTradeEntry(LOTREntityGundabadOrcArcher.class, 100, 50.0f), + new LOTRUnitTradeEntry(LOTREntityGundabadWarg.class, 100, 50.0f), + new LOTRUnitTradeEntry(LOTREntityGundabadOrc.class, LOTREntityGundabadWarg.class, "GundabadOrc_Warg", 200, 100.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityGundabadOrcArcher.class, LOTREntityGundabadWarg.class, "GundabadOrcArcher_Warg", 200, 150.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityGundabadUruk.class, 500, 250.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityGundabadUrukArcher.class, 500, 300.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityGundabadBannerBearer.class, 100, 150.0f), + new LOTRUnitTradeEntry(LOTREntityGundabadBannerBearer.class, LOTREntityGundabadWarg.class, "Banner_Warg", 200, 250.0f).setPledgeExclusive()); + @Shadow + public static LOTRUnitTradeEntries RANGER_NORTH_CAPTAIN = new LOTRUnitTradeEntries(300.0f, + new LOTRUnitTradeEntry(LOTREntityRangerNorth.class, 250, 0.0f), + new LOTRUnitTradeEntry(LOTREntityRangerNorth.class, LOTREntityHorse.class, "RangerNorth_Horse", 350, 100.0f), + new LOTRUnitTradeEntry(LOTREntityRangerNorthBannerBearer.class, 250, 150.0f)); + @Shadow + public static LOTRUnitTradeEntries HOBBIT_FARMER = new LOTRUnitTradeEntries(0.0f, + new LOTRUnitTradeEntry(LOTREntityHobbitFarmhand.class, 100, 50.0f).setTask(LOTRHiredNPCInfo.Task.FARMER)); + @Shadow + public static LOTRUnitTradeEntries HIGH_ELF_LORD = new LOTRUnitTradeEntries(300.0f, + new LOTRUnitTradeEntry(LOTREntityHighElf.class, 60, 0.0f), + new LOTRUnitTradeEntry(LOTREntityHighElfWarrior.class, 500, 100.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityHighElfWarrior.class, LOTREntityHorse.class, "HighElfWarrior_Horse", 600, 200.0f).setMountArmor(LOTRMod.horseArmorHighElven).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityHighElfBannerBearer.class, 500, 250.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityHighElfBannerBearer.class, LOTREntityHorse.class, "Banner_Horse", 600, 350.0f).setMountArmor(LOTRMod.horseArmorHighElven).setPledgeExclusive(), + (new CinderUnitTradeEntry(Sirrandrai.class, LOTREntityHorse.class, "Sirrandrai", 600, 400.0F).setObjective("Lindon").setExtraInfo("Lindon")).setPledgeExclusive().setMountArmor(LOTRMod.horseArmorHighElven)); + @Shadow + public static LOTRUnitTradeEntries NEAR_HARADRIM_WARLORD = new LOTRUnitTradeEntries(150.0f, + new LOTRUnitTradeEntry(LOTREntityNearHaradrimWarrior.class, 250, 0.0f), + new LOTRUnitTradeEntry(LOTREntityNearHaradrimArcher.class, 250, 50.0f), + new LOTRUnitTradeEntry(LOTREntitySouthronChampion.class, LOTREntityHorse.class, "SouthronChampion_Horse", 350, 100.0f).setMountArmor(LOTRMod.horseArmorNearHarad).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityNearHaradBannerBearer.class, 250, 150.0f), + new LOTRUnitTradeEntry(LOTREntityNearHaradBannerBearer.class, LOTREntityHorse.class, "Banner_Horse", 350, 250.0f).setMountArmor(LOTRMod.horseArmorNearHarad).setPledgeExclusive()); + @Shadow + public static LOTRUnitTradeEntries BLUE_DWARF_COMMANDER = new LOTRUnitTradeEntries(200.0f, + new LOTRUnitTradeEntry(LOTREntityBlueDwarf.class, 60, 0.0f), + new LOTRUnitTradeEntry(LOTREntityBlueDwarfWarrior.class, 400, 50.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityBlueDwarfAxeThrower.class, 400, 100.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityBlueDwarfWarrior.class, LOTREntityWildBoar.class, "BlueDwarfWarrior_Boar", 500, 150.0f).setMountArmor(LOTRMod.boarArmorBlueDwarven).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityBlueDwarfAxeThrower.class, LOTREntityWildBoar.class, "BlueDwarfAxeThrower_Boar", 500, 200.0f).setMountArmor(LOTRMod.boarArmorBlueDwarven).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityBlueDwarfBannerBearer.class, 400, 200.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityBlueDwarfBannerBearer.class, LOTREntityWildBoar.class, "Banner_Horse", 500, 300.0f).setMountArmor(LOTRMod.boarArmorBlueDwarven).setPledgeExclusive()); + @Shadow + public static LOTRUnitTradeEntries DOL_GULDUR_CAPTAIN = new LOTRUnitTradeEntries(150.0f, + new LOTRUnitTradeEntry(LOTREntityDolGuldurOrc.class, 150, 0.0f), + new LOTRUnitTradeEntry(LOTREntityDolGuldurOrcArcher.class, 150, 50.0f), + new LOTRUnitTradeEntry(LOTREntityMirkwoodSpider.class, 100, 0.0f), + new LOTRUnitTradeEntry(LOTREntityDolGuldurOrc.class, LOTREntityMirkwoodSpider.class, "DolGuldurOrc_Spider", 250, 100.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityDolGuldurOrcArcher.class, LOTREntityMirkwoodSpider.class, "DolGuldurOrcArcher_Spider", 250, 150.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityMirkTroll.class, 750, 350.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityDolGuldurBannerBearer.class, 150, 0.0f), + new LOTRUnitTradeEntry(LOTREntityDolGuldurBannerBearer.class, LOTREntityMirkwoodSpider.class, "DolGuldurOrc_Spider", 250, 100.0f).setPledgeExclusive()); + @Shadow + public static LOTRUnitTradeEntries RANGER_ITHILIEN_CAPTAIN = new LOTRUnitTradeEntries(300.0f, + new LOTRUnitTradeEntry(LOTREntityRangerIthilien.class, 50, 0.0f), + new LOTRUnitTradeEntry(LOTREntityRangerIthilienBannerBearer.class, 70, 150.0f)); + @Shadow + public static LOTRUnitTradeEntries HALF_TROLL_WARLORD = new LOTRUnitTradeEntries(200.0f, + new LOTRUnitTradeEntry(LOTREntityHalfTroll.class, 100, 0.0f), + new LOTRUnitTradeEntry(LOTREntityHalfTrollWarrior.class, 400, 100.0f), + new LOTRUnitTradeEntry(LOTREntityHalfTrollWarrior.class, LOTREntityRhino.class, "HalfTrollWarrior_Rhino", 500, 200.0f).setMountArmor(LOTRMod.rhinoArmorHalfTroll, 0.5f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityHalfTrollBannerBearer.class, 400, 150.0f), + new LOTRUnitTradeEntry(LOTREntityHalfTrollBannerBearer.class, LOTREntityRhino.class, "Banner_Horse", 500, 250.0f).setMountArmor(LOTRMod.rhinoArmorHalfTroll, 0.5f).setPledgeExclusive()); + @Shadow + public static LOTRUnitTradeEntries DOL_AMROTH_CAPTAIN = new LOTRUnitTradeEntries(200.0f, + new LOTRUnitTradeEntry(LOTREntityDolAmrothSoldier.class, 150, 0.0f), + new LOTRUnitTradeEntry(LOTREntityDolAmrothArcher.class, 150, 50.0f), + new LOTRUnitTradeEntry(LOTREntitySwanKnight.class, 500, 100.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityDolAmrothSoldier.class, LOTREntityHorse.class, "DolAmrothSoldier_Horse", 250, 100.0f).setMountArmor(LOTRMod.horseArmorDolAmroth, 0.5f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntitySwanKnight.class, LOTREntityHorse.class, "SwanKnight_Horse", 600, 200.0f).setMountArmor(LOTRMod.horseArmorDolAmroth).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityDolAmrothBannerBearer.class, 150, 150.0f), + new LOTRUnitTradeEntry(LOTREntityDolAmrothBannerBearer.class, LOTREntityHorse.class, "Banner_Horse", 250, 250.0f).setMountArmor(LOTRMod.horseArmorDolAmroth, 0.5f).setPledgeExclusive()); + @Shadow + public static LOTRUnitTradeEntries MOREDAIN_CHIEFTAIN = new LOTRUnitTradeEntries(150.0f, + new LOTRUnitTradeEntry(LOTREntityMoredainWarrior.class, 250, 0.0f), + new LOTRUnitTradeEntry(LOTREntityMoredainWarrior.class, LOTREntityZebra.class, "MoredainWarrior_Zebra", 350, 100.0f), + new LOTRUnitTradeEntry(LOTREntityMoredainBannerBearer.class, 250, 150.0f), + new LOTRUnitTradeEntry(LOTREntityMoredainBannerBearer.class, LOTREntityZebra.class, "Banner_Horse", 350, 250.0f)); + @Shadow + public static LOTRUnitTradeEntries ANGMAR_HILLMAN_CHIEFTAIN = new LOTRUnitTradeEntries(100.0f, + new LOTRUnitTradeEntry(LOTREntityAngmarHillman.class, 60, 0.0f), + new LOTRUnitTradeEntry(LOTREntityAngmarHillmanWarrior.class, 150, 50.0f), + new LOTRUnitTradeEntry(LOTREntityAngmarHillmanAxeThrower.class, 150, 100.0f), + new LOTRUnitTradeEntry(LOTREntityAngmarHillman.class, LOTREntityAngmarWarg.class, "AngmarHillman_Warg", 250, 100.0f), + new LOTRUnitTradeEntry(LOTREntityAngmarHillmanWarrior.class, LOTREntityAngmarWarg.class, "AngmarHillmanWarrior_Warg", 250, 150.0f).setMountArmor(LOTRMod.wargArmorAngmar, 0.3f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityAngmarHillmanAxeThrower.class, LOTREntityAngmarWarg.class, "AngmarHillmanAxeThrower_Warg", 250, 200.0f).setMountArmor(LOTRMod.wargArmorAngmar, 0.3f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityAngmarHillmanBannerBearer.class, 150, 200.0f), + new LOTRUnitTradeEntry(LOTREntityAngmarHillmanBannerBearer.class, LOTREntityAngmarWarg.class, "Banner_Warg", 250, 300.0f).setMountArmor(LOTRMod.wargArmorAngmar, 0.5f).setPledgeExclusive(), + (new CinderUnitTradeEntry(RhudaurSoldier.class, 500, 400.0F).setObjective("Rhudaur").setExtraInfo("Rhudaur"))); + @Shadow + public static LOTRUnitTradeEntries TAUREDAIN_CHIEFTAIN = new LOTRUnitTradeEntries(200.0f, + new LOTRUnitTradeEntry(LOTREntityTauredainWarrior.class, 250, 0.0f), + new LOTRUnitTradeEntry(LOTREntityTauredainBlowgunner.class, 250, 50.0f), + new LOTRUnitTradeEntry(LOTREntityTauredainBannerBearer.class, 250, 150.0f), + new LOTRUnitTradeEntry(TauredainTrueBlood.class, 500, 800.0f).setPledgeExclusive()); + @Shadow + public static LOTRUnitTradeEntries TAUREDAIN_FARMER = new LOTRUnitTradeEntries(0.0f, + new LOTRUnitTradeEntry(LOTREntityTauredainFarmhand.class, 100, 50.0f).setTask(LOTRHiredNPCInfo.Task.FARMER)); + @Shadow + public static LOTRUnitTradeEntries DALE_CAPTAIN = new LOTRUnitTradeEntries(100.0f, + new LOTRUnitTradeEntry(LOTREntityDaleLevyman.class, 150, 0.0f), + new LOTRUnitTradeEntry(LOTREntityDaleSoldier.class, 250, 50.0f), + new LOTRUnitTradeEntry(LOTREntityDaleArcher.class, 250, 100.0f), + new LOTRUnitTradeEntry(LOTREntityDaleSoldier.class, LOTREntityHorse.class, "DaleSoldier_Horse", 350, 150.0f).setMountArmor(LOTRMod.horseArmorDale).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityDaleBannerBearer.class, 250, 200.0f), + new LOTRUnitTradeEntry(LOTREntityDaleBannerBearer.class, LOTREntityHorse.class, "Banner_Horse", 350, 300.0f).setMountArmor(LOTRMod.horseArmorDale).setPledgeExclusive(), + (new CinderUnitTradeEntry(EsgarothSoldier.class, 500, 400.0F).setObjective("Dale").setExtraInfo("Dale")), + (new CinderUnitTradeEntry(LOTREntityEsgarothBannerBearer.class, 500, 400.0F).setObjective("Dale").setExtraInfo("Dale"))); + @Shadow + public static LOTRUnitTradeEntries DORWINION_CAPTAIN = new LOTRUnitTradeEntries(150.0f, + new LOTRUnitTradeEntry(LOTREntityDorwinionGuard.class, 250, 0.0f), + new LOTRUnitTradeEntry(LOTREntityDorwinionCrossbower.class, 250, 50.0f), + new LOTRUnitTradeEntry(LOTREntityDorwinionBannerBearer.class, 250, 150.0f)); + @Shadow + public static LOTRUnitTradeEntries DORWINION_ELF_CAPTAIN = new LOTRUnitTradeEntries(250.0f, + new LOTRUnitTradeEntry(LOTREntityDorwinionElfWarrior.class, 500, 0.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityDorwinionElfArcher.class, 500, 50.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityDorwinionElfBannerBearer.class, 500, 150.0f).setPledgeExclusive()); + @Shadow + public static LOTRUnitTradeEntries DORWINION_VINEKEEPER = new LOTRUnitTradeEntries(0.0f, + new LOTRUnitTradeEntry(LOTREntityDorwinionVinehand.class, 100, 50.0f).setTask(LOTRHiredNPCInfo.Task.FARMER)); + @Shadow + public static LOTRUnitTradeEntries LOSSARNACH_CAPTAIN = new LOTRUnitTradeEntries(150.0f, + new LOTRUnitTradeEntry(LOTREntityGondorLevyman.class, 150, 0.0f), + new LOTRUnitTradeEntry(LOTREntityLossarnachAxeman.class, 250, 50.0f), + new LOTRUnitTradeEntry(LOTREntityLossarnachBannerBearer.class, 250, 200.0f)); + @Shadow + public static LOTRUnitTradeEntries PELARGIR_CAPTAIN = new LOTRUnitTradeEntries(200.0f, + new LOTRUnitTradeEntry(LOTREntityLebenninLevyman.class, 150, 0.0f), + new LOTRUnitTradeEntry(LOTREntityPelargirMarine.class, 200, 50.0f), + new LOTRUnitTradeEntry(LOTREntityPelargirBannerBearer.class, 250, 200.0f)); + @Shadow + public static LOTRUnitTradeEntries PINNATH_GELIN_CAPTAIN = new LOTRUnitTradeEntries(200.0f, + new LOTRUnitTradeEntry(LOTREntityGondorLevyman.class, 150, 0.0f), + new LOTRUnitTradeEntry(LOTREntityPinnathGelinSoldier.class, 200, 50.0f), + new LOTRUnitTradeEntry(LOTREntityPinnathGelinSoldier.class, LOTREntityHorse.class, "PinnathGelinSoldier_Horse", 350, 150.0f).setMountArmor(LOTRMod.horseArmorGondor).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityPinnathGelinBannerBearer.class, 250, 200.0f), + new LOTRUnitTradeEntry(LOTREntityPinnathGelinBannerBearer.class, LOTREntityHorse.class, "Banner_Horse", 350, 300.0f).setMountArmor(LOTRMod.horseArmorGondor).setPledgeExclusive()); + @Shadow + public static LOTRUnitTradeEntries BLACKROOT_CAPTAIN = new LOTRUnitTradeEntries(150.0f, + new LOTRUnitTradeEntry(LOTREntityGondorLevyman.class, 150, 0.0f), + new LOTRUnitTradeEntry(LOTREntityBlackrootSoldier.class, 250, 50.0f), + new LOTRUnitTradeEntry(LOTREntityBlackrootArcher.class, 200, 100.0f), + new LOTRUnitTradeEntry(LOTREntityBlackrootSoldier.class, LOTREntityHorse.class, "BlackrootSoldier_Horse", 350, 150.0f).setMountArmor(LOTRMod.horseArmorGondor).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityBlackrootBannerBearer.class, 250, 200.0f), + new LOTRUnitTradeEntry(LOTREntityBlackrootBannerBearer.class, LOTREntityHorse.class, "Banner_Horse", 350, 300.0f).setMountArmor(LOTRMod.horseArmorGondor).setPledgeExclusive()); + @Shadow + public static LOTRUnitTradeEntries GONDOR_FARMER = new LOTRUnitTradeEntries(0.0f, + new LOTRUnitTradeEntry(LOTREntityGondorFarmhand.class, 100, 50.0f).setTask(LOTRHiredNPCInfo.Task.FARMER)); + @Shadow + public static LOTRUnitTradeEntries LEBENNIN_CAPTAIN = new LOTRUnitTradeEntries(150.0f, + new LOTRUnitTradeEntry(LOTREntityLebenninLevyman.class, 100, 0.0f), + new LOTRUnitTradeEntry(LOTREntityGondorSoldier.class, 250, 50.0f), + new LOTRUnitTradeEntry(LOTREntityGondorArcher.class, 250, 100.0f), + new LOTRUnitTradeEntry(LOTREntityLebenninBannerBearer.class, 150, 150.0f)); + @Shadow + public static LOTRUnitTradeEntries LAMEDON_CAPTAIN = new LOTRUnitTradeEntries(200.0f, + new LOTRUnitTradeEntry(LOTREntityLamedonHillman.class, 150, 0.0f), + new LOTRUnitTradeEntry(LOTREntityLamedonSoldier.class, 200, 50.0f), + new LOTRUnitTradeEntry(LOTREntityLamedonArcher.class, 250, 100.0f), + new LOTRUnitTradeEntry(LOTREntityLamedonSoldier.class, LOTREntityHorse.class, "LamedonSoldier_Horse", 300, 150.0f).setMountArmor(LOTRMod.horseArmorLamedon).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityLamedonBannerBearer.class, 250, 200.0f), + new LOTRUnitTradeEntry(LOTREntityLamedonBannerBearer.class, LOTREntityHorse.class, "Banner_Horse", 300, 300.0f).setMountArmor(LOTRMod.horseArmorLamedon).setPledgeExclusive()); + @Shadow + public static LOTRUnitTradeEntries ROHAN_FARMER = new LOTRUnitTradeEntries(0.0f, + new LOTRUnitTradeEntry(LOTREntityRohanFarmhand.class, 100, 50.0f).setTask(LOTRHiredNPCInfo.Task.FARMER)); + @Shadow + public static LOTRUnitTradeEntries EASTERLING_WARLORD = new LOTRUnitTradeEntries(150.0f, + new LOTRUnitTradeEntry(LOTREntityEasterlingLevyman.class, 150, 0.0f), + new LOTRUnitTradeEntry(LOTREntityEasterlingWarrior.class, 250, 50.0f), + new LOTRUnitTradeEntry(LOTREntityEasterlingArcher.class, 250, 100.0f), + new LOTRUnitTradeEntry(LOTREntityEasterlingGoldWarrior.class, 500, 200.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityEasterlingWarrior.class, LOTREntityHorse.class, "EasterlingWarrior_Horse", 350, 150.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityEasterlingArcher.class, LOTREntityHorse.class, "EasterlingArcher_Horse", 350, 200.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityEasterlingGoldWarrior.class, LOTREntityHorse.class, "EasterlingGoldWarrior_Horse", 600, 300.0f).setMountArmor(LOTRMod.horseArmorRhunGold).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityEasterlingFireThrower.class, 260, 150.0f), + new LOTRUnitTradeEntry(LOTREntityEasterlingBannerBearer.class, 250, 200.0f), + new LOTRUnitTradeEntry(LOTREntityEasterlingBannerBearer.class, LOTREntityHorse.class, "Banner_Horse", 350, 150.0f).setPledgeExclusive()); + @Shadow + public static LOTRUnitTradeEntries EASTERLING_FARMER = new LOTRUnitTradeEntries(0.0f, + new LOTRUnitTradeEntry(LOTREntityEasterlingFarmhand.class, 100, 50.0f).setTask(LOTRHiredNPCInfo.Task.FARMER)); + @Shadow + public static LOTRUnitTradeEntries RIVENDELL_LORD = new LOTRUnitTradeEntries(300.0f, + new LOTRUnitTradeEntry(LOTREntityRivendellElf.class, 60, 0.0f), + new LOTRUnitTradeEntry(LOTREntityRivendellWarrior.class, 500, 100.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityRivendellWarrior.class, LOTREntityHorse.class, "RivendellWarrior_Horse", 600, 200.0f).setMountArmor(LOTRMod.horseArmorRivendell).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityRivendellBannerBearer.class, 500, 250.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityRivendellBannerBearer.class, LOTREntityHorse.class, "Banner_Horse", 600, 350.0f).setMountArmor(LOTRMod.horseArmorRivendell).setPledgeExclusive()); + @Shadow + public static LOTRUnitTradeEntries HARNEDOR_WARLORD = new LOTRUnitTradeEntries(150.0f, + new LOTRUnitTradeEntry(LOTREntityHarnedorWarrior.class, 250, 0.0f), + new LOTRUnitTradeEntry(LOTREntityHarnedorArcher.class, 200, 50.0f), + new LOTRUnitTradeEntry(LOTREntityHarnedorWarrior.class, LOTREntityHorse.class, "HarnedorWarrior_Horse", 350, 100.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityHarnedorArcher.class, LOTREntityHorse.class, "HarnedorArcher_Horse", 300, 150.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityHarnedorBannerBearer.class, 250, 150.0f), + new LOTRUnitTradeEntry(LOTREntityHarnedorBannerBearer.class, LOTREntityHorse.class, "Banner_Horse", 350, 250.0f).setPledgeExclusive()); + @Shadow + public static LOTRUnitTradeEntries UMBAR_CAPTAIN = new LOTRUnitTradeEntries(150.0f, + new LOTRUnitTradeEntry(LOTREntityUmbarWarrior.class, 250, 0.0f), + new LOTRUnitTradeEntry(LOTREntityUmbarArcher.class, 250, 50.0f), + new LOTRUnitTradeEntry(LOTREntityUmbarWarrior.class, LOTREntityHorse.class, "UmbarWarrior_Horse", 350, 100.0f).setMountArmor(LOTRMod.horseArmorUmbar).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityUmbarBannerBearer.class, 250, 150.0f), + new LOTRUnitTradeEntry(LOTREntityUmbarBannerBearer.class, LOTREntityHorse.class, "Banner_Horse", 350, 250.0f).setMountArmor(LOTRMod.horseArmorUmbar).setPledgeExclusive()); + @Shadow + public static LOTRUnitTradeEntries CORSAIR_CAPTAIN = new LOTRUnitTradeEntries(150.0f, + new LOTRUnitTradeEntry(LOTREntityCorsair.class, 200, 0.0f).setExtraInfo("Corsair")); + @Shadow + public static LOTRUnitTradeEntries NOMAD_WARLORD = new LOTRUnitTradeEntries(150.0f, + new LOTRUnitTradeEntry(LOTREntityNomadWarrior.class, 150, 0.0f), + new LOTRUnitTradeEntry(LOTREntityNomadArcher.class, 150, 50.0f), + new LOTRUnitTradeEntry(LOTREntityNomadWarrior.class, LOTREntityCamel.class, "NomadWarrior_Camel", 250, 100.0f), + new LOTRUnitTradeEntry(LOTREntityNomadArcher.class, LOTREntityCamel.class, "NomadArcher_Camel", 250, 150.0f), + new LOTRUnitTradeEntry(LOTREntityNomadBannerBearer.class, 150, 150.0f), + new LOTRUnitTradeEntry(LOTREntityNomadBannerBearer.class, LOTREntityCamel.class, "Banner_Horse", 250, 250.0f)); + @Shadow + public static LOTRUnitTradeEntries GULF_WARLORD = new LOTRUnitTradeEntries(150.0f, + new LOTRUnitTradeEntry(LOTREntityGulfHaradWarrior.class, 200, 0.0f), + new LOTRUnitTradeEntry(LOTREntityGulfHaradArcher.class, 250, 50.0f), + new LOTRUnitTradeEntry(LOTREntityGulfHaradWarrior.class, LOTREntityHorse.class, "GulfWarrior_Horse", 300, 100.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityGulfHaradArcher.class, LOTREntityHorse.class, "GulfArcher_Horse", 350, 150.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityGulfHaradBannerBearer.class, 250, 150.0f), + new LOTRUnitTradeEntry(LOTREntityGulfHaradBannerBearer.class, LOTREntityHorse.class, "GulfWarrior_Horse", 350, 250.0f).setPledgeExclusive()); + @Shadow + public static LOTRUnitTradeEntries CORSAIR_SLAVER = new LOTRUnitTradeEntries(0.0f, + new LOTRUnitTradeEntry(LOTREntityHaradSlave.class, 100, 0.0f).setTask(LOTRHiredNPCInfo.Task.FARMER)); + @Shadow + public static LOTRUnitTradeEntries HARNEDOR_FARMER = new LOTRUnitTradeEntries(0.0f, + new LOTRUnitTradeEntry(LOTREntityHarnedorFarmhand.class, 100, 50.0f).setTask(LOTRHiredNPCInfo.Task.FARMER)); + @Shadow + public static LOTRUnitTradeEntries BLACK_URUK_CAPTAIN = new LOTRUnitTradeEntries(400.0f, + new LOTRUnitTradeEntry(LOTREntityBlackUruk.class, 500, 250.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityBlackUrukArcher.class, 500, 300.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityOlogHai.class, 800, 350.0f).setPledgeExclusive(), + new LOTRUnitTradeEntry(LOTREntityBlackUrukBannerBearer.class, 500, 400.0f).setPledgeExclusive()); + @Shadow + public static LOTRUnitTradeEntries BREE_FARMER = new LOTRUnitTradeEntries(0.0f, + new LOTRUnitTradeEntry(LOTREntityBreeFarmhand.class, 40, 50.0f).setTask(LOTRHiredNPCInfo.Task.FARMER)); + @Final + @Shadow + public static final int MOREDAIN_MERCENARY_COST = 200; + +} diff --git a/src/main/java/com/zivilon/cinder_loe/potion/LoEPotions.java b/src/main/java/com/zivilon/cinder_loe/potion/LoEPotions.java new file mode 100644 index 0000000..34339c3 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/potion/LoEPotions.java @@ -0,0 +1,28 @@ +package com.zivilon.cinder_loe.potion; + +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.entity.EntityLivingBase; + +public class LoEPotions { + public static Potion corrupting; + + public static void registerPotions() { + corrupting = new PotionCorrupting(31, false, 0x7F0000).setPotionName("potion.corrupting"); + } +} + +class PotionCorrupting extends Potion { + public PotionCorrupting(int id, boolean isBadEffect, int liquidColor) { + super(id, isBadEffect, liquidColor); + } + + @Override + public void performEffect(EntityLivingBase entity, int amplifier) { + } + + @Override + public boolean isReady(int duration, int amplifier) { + return false; + } +} 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 12c51ae..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 3dc590c..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,7 @@ 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; import net.minecraft.init.Blocks; @@ -30,6 +30,7 @@ public class recipes { registerBreeRecipes(); registerArnorRecipes(); registerAngmarRecipes(); + registerBrewingRecipes(); } public static void registerGeneralRecipes() { @@ -70,26 +71,23 @@ 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))); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.warDartHeads, 2, 3), Items.iron_ingot, new ItemStack(LOTRMod.chisel, 1, OreDictionary.WILDCARD_VALUE))); - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.warDartHeads, 2, 4), LOTRMod.orcSteel, new ItemStack(LOTRMod.chisel, 1, OreDictionary.WILDCARD_VALUE))); - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.warDartHeads, 2, 5), LOTRMod.dwarfSteel, new ItemStack(LOTRMod.chisel, 1, OreDictionary.WILDCARD_VALUE))); - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.warDartHeads, 2, 6), LOTRMod.urukSteel, new ItemStack(LOTRMod.chisel, 1, OreDictionary.WILDCARD_VALUE))); - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.warDartHeads, 2, 7), LOTRMod.blueDwarfSteel, new ItemStack(LOTRMod.chisel, 1, OreDictionary.WILDCARD_VALUE))); - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.warDartHeads, 2, 8), LOTRMod.blackUrukSteel, new ItemStack(LOTRMod.chisel, 1, OreDictionary.WILDCARD_VALUE))); - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.warDartHeads, 2, 9), LOTRMod.elfSteel, new ItemStack(LOTRMod.chisel, 1, OreDictionary.WILDCARD_VALUE))); - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.warDartHeads, 2, 10), LOTRMod.gildedIron, new ItemStack(LOTRMod.chisel, 1, OreDictionary.WILDCARD_VALUE))); - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.warDartHeads, 2, 11), CinderLoE.redDwarfSteel, new ItemStack(LOTRMod.chisel, 1, OreDictionary.WILDCARD_VALUE))); +// GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.warDartHeads, 2, 4), LOTRMod.orcSteel, new ItemStack(LOTRMod.chisel, 1, OreDictionary.WILDCARD_VALUE))); +// GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.warDartHeads, 2, 5), LOTRMod.dwarfSteel, new ItemStack(LOTRMod.chisel, 1, OreDictionary.WILDCARD_VALUE))); +// GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.warDartHeads, 2, 6), LOTRMod.urukSteel, new ItemStack(LOTRMod.chisel, 1, OreDictionary.WILDCARD_VALUE))); +// GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.warDartHeads, 2, 7), LOTRMod.blueDwarfSteel, new ItemStack(LOTRMod.chisel, 1, OreDictionary.WILDCARD_VALUE))); +// GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.warDartHeads, 2, 8), LOTRMod.blackUrukSteel, new ItemStack(LOTRMod.chisel, 1, OreDictionary.WILDCARD_VALUE))); +// GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.warDartHeads, 2, 9), LOTRMod.elfSteel, new ItemStack(LOTRMod.chisel, 1, OreDictionary.WILDCARD_VALUE))); +// GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.warDartHeads, 2, 10), LOTRMod.gildedIron, new ItemStack(LOTRMod.chisel, 1, OreDictionary.WILDCARD_VALUE))); +// GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.warDartHeads, 2, 11), CinderLoE.redDwarfSteel, new ItemStack(LOTRMod.chisel, 1, OreDictionary.WILDCARD_VALUE))); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.warDartHeads, 2, 12), LOTRMod.mithril, new ItemStack(LOTRMod.chisel, 1, OreDictionary.WILDCARD_VALUE))); +// GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.warDartHeads, 2, 14), LOTRMod.morgulSteel, new ItemStack(LOTRMod.chisel, 1, OreDictionary.WILDCARD_VALUE))); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.warDart, 1, 1), new ItemStack(CinderLoE.warDart, 1, 0), new ItemStack(CinderLoE.warDartHeads, 1, 1))); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.warDart, 1, 2), new ItemStack(CinderLoE.warDart, 1, 0), new ItemStack(CinderLoE.warDartHeads, 1, 2))); @@ -104,6 +102,7 @@ public class recipes { GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.warDart, 1, 11), new ItemStack(CinderLoE.warDart, 1, 0), new ItemStack(CinderLoE.warDartHeads, 1, 11))); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.warDart, 1, 12), new ItemStack(CinderLoE.warDart, 1, 0), new ItemStack(CinderLoE.warDartHeads, 1, 12))); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.warDart, 1, 13), new ItemStack(CinderLoE.warDart, 1, 0), new ItemStack(CinderLoE.warDartHeads, 1, 13))); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.warDart, 1, 14), new ItemStack(CinderLoE.warDart, 1, 0), new ItemStack(CinderLoE.warDartHeads, 1, 14))); OreDictionary.registerOre("vegetable1", CinderLoE.onion); OreDictionary.registerOre("vegetable1", LOTRMod.leek); @@ -143,9 +142,9 @@ public class recipes { OreDictionary.registerOre("meat", LOTRMod.zebraCooked); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.fruitsalad), Items.bowl, "fruit1", "fruit2", "fruit3")); - GameRegistry.addRecipe(new CinderShapelessOreRecipe(new ItemStack(CinderLoE.pasta, 4), LOTRMod.rollingPin, CinderLoE.dough, CinderLoE.dough)); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.pasta, 4), LOTRMod.rollingPin, CinderLoE.dough, CinderLoE.dough)); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.halva), Items.sugar, CinderLoE.dough, CinderLoE.spice, LOTRMod.almond)); - //takes durability from rolling pin + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.chocolatebar, 2), LOTRMod.mugChocolate)); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(CinderLoE.pelmen), Items.wheat, "meat", LOTRMod.salt)); @@ -319,4 +318,6 @@ public class recipes { LOTRRecipes.rangerRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.maceArnor), " XX", " XX", "Y ", Character.valueOf('X'), Items.iron_ingot, Character.valueOf('Y'), "stickWood")); } + public static void registerBrewingRecipes() { + } } diff --git a/src/main/java/com/zivilon/cinder_loe/util/BlockPos.java b/src/main/java/com/zivilon/cinder_loe/util/BlockPos.java index 61c6ac9..e6558a9 100644 --- a/src/main/java/com/zivilon/cinder_loe/util/BlockPos.java +++ b/src/main/java/com/zivilon/cinder_loe/util/BlockPos.java @@ -17,6 +17,10 @@ public class BlockPos { this.z = z; } + public BlockPos down() { + return new BlockPos(x, y - 1, z); + } + public static BlockPos findSafeSpawnLocation(World world, EntityPlayer entityPlayer) { Random rand = new Random(); ArrayList validPositions = new ArrayList(); 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 242a81a..6e950f8 100644 --- a/src/main/java/com/zivilon/cinder_loe/util/DurableItemCrafter.java +++ b/src/main/java/com/zivilon/cinder_loe/util/DurableItemCrafter.java @@ -10,10 +10,8 @@ import com.zivilon.cinder_loe.CinderLoE; public class DurableItemCrafter { public static List customItems = new ArrayList<>(); public static List exceptionItems = new ArrayList<>(); - static { - customItems.add(LOTRMod.chisel); - customItems.add(CinderLoE.toxicCore); - exceptionItems.add(LOTRMod.ithildin); + static { + customItems.add(LOTRMod.rollingPin); } } 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 8327caf..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.firstAgeGlaive); } } 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 613f923..832c5f4 100644 --- a/src/main/java/com/zivilon/cinder_loe/util/Utilities.java +++ b/src/main/java/com/zivilon/cinder_loe/util/Utilities.java @@ -1,7 +1,8 @@ package com.zivilon.cinder_loe.util; -import com.zivilon.cinder_loe.client.render.item.RenderHelper; import com.zivilon.cinder_loe.CinderLoE; +import com.zivilon.cinder_loe.client.render.item.RenderHelper; +import com.zivilon.cinder_loe.mixins.MixinEntity; import java.io.BufferedWriter; import java.io.FileOutputStream; @@ -14,6 +15,10 @@ import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.UUID; import java.util.Vector; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import lotr.common.LOTRCreativeTabs; import lotr.common.world.biome.LOTRBiome; @@ -21,18 +26,72 @@ import lotr.common.item.LOTRItemArmor; import lotr.common.item.LOTRMaterial; import lotr.common.enchant.LOTREnchantment; import lotr.common.enchant.LOTREnchantmentHelper; -import net.minecraft.item.ItemStack; import net.minecraft.client.renderer.Tessellator; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTTagString; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; import net.minecraft.server.MinecraftServer; + public class Utilities { public static int[] LOTRIntCache = null; public static LOTRBiome reflected_river; public static LOTRCreativeTabs reflected_tab_block; + public static List badEnchants = new ArrayList<>(); + public static Map upgradedEnchants = new HashMap<>(); + + static { + badEnchants.add("weak1"); + badEnchants.add("weak2"); + badEnchants.add("weak3"); + badEnchants.add("weak4"); + badEnchants.add("meleeSlow1"); + badEnchants.add("meleeUnreach1"); + badEnchants.add("toolSlow1"); + badEnchants.add("protectWeak1"); + badEnchants.add("protectWeak2"); + badEnchants.add("rangedWeak1"); + badEnchants.add("rangedWeak2"); + badEnchants.add("rangedWeak3"); + badEnchants.add("protectRangedWeak1"); + badEnchants.add("protectRangedWeak2"); + upgradedEnchants.put("strong1", LOTREnchantment.strong1); + upgradedEnchants.put("strong2", LOTREnchantment.strong3); + upgradedEnchants.put("strong3", LOTREnchantment.strong4); + upgradedEnchants.put("durable1", LOTREnchantment.durable2); + upgradedEnchants.put("durable2", LOTREnchantment.durable3); + upgradedEnchants.put("knockback1", LOTREnchantment.knockback2); + upgradedEnchants.put("toolSpeed1", LOTREnchantment.toolSpeed2); + upgradedEnchants.put("toolSpeed2", LOTREnchantment.toolSpeed3); + upgradedEnchants.put("toolSpeed3", LOTREnchantment.toolSpeed4); + upgradedEnchants.put("looting1", LOTREnchantment.looting2); + upgradedEnchants.put("looting2", LOTREnchantment.looting3); + upgradedEnchants.put("protect1", LOTREnchantment.protect2); + upgradedEnchants.put("protectFire1", LOTREnchantment.protectFire2); + upgradedEnchants.put("protectFire2", LOTREnchantment.protectFire3); + upgradedEnchants.put("protectFall1", LOTREnchantment.protectFall2); + upgradedEnchants.put("protectFall2", LOTREnchantment.protectFall3); + upgradedEnchants.put("protectRanged1", LOTREnchantment.protectRanged2); + upgradedEnchants.put("protectRanged2", LOTREnchantment.protectRanged3); + upgradedEnchants.put("rangedStrong1", LOTREnchantment.rangedStrong2); + upgradedEnchants.put("rangedStrong2", LOTREnchantment.rangedStrong3); + upgradedEnchants.put("rangedKnockback1", LOTREnchantment.rangedKnockback2); + } public static void initialize_reflects() { try { @@ -160,36 +219,30 @@ public class Utilities { return has_fire; } - public static int[] countNexArmour(String player_name) { - EntityPlayer player = getPlayerByName(player_name); - int[] nexPieces = new int[4]; + public static boolean has_fire_weapon(Entity entity) { + if (!(entity instanceof EntityLivingBase)) return false; + ItemStack held_item = ((EntityLivingBase)entity).getHeldItem(); + return LOTREnchantmentHelper.hasEnchant(held_item, LOTREnchantment.fire); + } - 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]++; - } + 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; + + double attribute = attacker.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); + double enchantments = EnchantmentHelper.getEnchantmentModifierLiving(attacker, target); + boolean is_critical = !attacker.onGround && attacker.motionY < 0.0D && !attacker.isInWater() && !attacker.isRiding(); + double critical = 0.0D; + if (is_critical) { + PotionEffect strength_effect = attacker.getActivePotionEffect(Potion.damageBoost); + if (strength_effect == null) { + critical = Math.min((attribute + enchantments) * 1.5D, 7.0D); + } else { + int level = strength_effect.getAmplifier() + 1; + critical = Math.min((attribute + enchantments) * 1.5D, 7.0D * (1.0D + 0.5D * level)); } } - - 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; + return attribute + enchantments + critical; } public static boolean isArrayEmpty(int[] array) { @@ -199,4 +252,94 @@ public class Utilities { return true; } + public static void setInvulnerable(Entity entity, boolean invulnerable) { + ((MixinEntity)entity).setInvulnerable(invulnerable); + } + + public static void setLOTREnchant(ItemStack itemstack, LOTREnchantment ench) { + NBTTagList tags = getItemEnchantTags(itemstack, true); + if (tags != null) { + String enchName = ench.enchantName; + tags.appendTag((NBTBase)new NBTTagString(enchName)); + } + } + + public static NBTTagList getItemEnchantTags(ItemStack itemstack, boolean create) { + NBTTagCompound itemData = itemstack.getTagCompound(); + NBTTagList tags = null; + if (itemData != null && itemData.hasKey("LOTREnch")) { + tags = itemData.getTagList("LOTREnch", 8); + } else if (create) { + if (itemData == null) { + itemData = new NBTTagCompound(); + itemstack.setTagCompound(itemData); + } + tags = new NBTTagList(); + itemData.setTag("LOTREnch", (NBTBase)tags); + } + return tags; + } + + public static void setAppliedRandomEnchants(ItemStack itemstack) { + if (!itemstack.hasTagCompound()) + itemstack.setTagCompound(new NBTTagCompound()); + itemstack.getTagCompound().setBoolean("LOTRRandomEnch", true); + } + + public static void knockback(EntityLivingBase target, EntityLivingBase attacker, double knockback_strength) { + // Calculate direction of knockback + double dx = attacker.posX - target.posX; + double dz = attacker.posZ - target.posZ; + + // Normalize the direction vector + double distance = Math.sqrt(dx * dx + dz * dz); + if (distance != 0) { + dx /= distance; + dz /= distance; + } + + // Apply knockback manually + target.motionX -= dx * knockback_strength; + target.motionZ -= dz * knockback_strength; + + // Ensure the motion is applied + target.velocityChanged = true; + } + + public static boolean isBadEnch(LOTREnchantment ench) { + if (ench == null) return false; + String ench_name = ench.enchantName; + if (badEnchants.contains(ench_name)) { + return true; + } + return false; + } + public static LOTREnchantment upgradeEnch(ItemStack item, LOTREnchantment ench) { + if (ench == null) return ench; + if (ench != LOTREnchantment.protect1) { + LOTREnchantment return_ench = upgradedEnchants.get(ench.enchantName); + if (return_ench == null) return_ench = ench; + return return_ench; + } + int armor_piece = ((ItemArmor)item.getItem()).armorType; + int prot = ((ItemArmor)item.getItem()).damageReduceAmount; + LOTREnchantment return_value = ench; + switch(armor_piece) { + case 0: + if (prot < 2) return_value = upgradedEnchants.get(ench.enchantName); + break; + case 1: + if (prot < 7) return_value = upgradedEnchants.get(ench.enchantName); + break; + case 2: + if (prot < 5) return_value = upgradedEnchants.get(ench.enchantName); + break; + case 3: + if (prot < 2) return_value = upgradedEnchants.get(ench.enchantName); + break; + default: + break; + } + return return_value; + } } 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 new file mode 100644 index 0000000..cc34e81 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/util/VT_additions.java @@ -0,0 +1,9 @@ +package com.zivilon.cinder_loe.util; + +public class VT_additions { + public static String applyCustomPlaceholders(String scriptLine) { +/* scriptLine = scriptLine.replace("", String.valueOf(Nex.get_nex_phase())); + scriptLine = scriptLine.replace("", String.valueOf(Nex.get_nex_health()));*/ + return scriptLine; + } +} diff --git a/src/main/resources/assets/cinder_loe/lang/en_US.lang b/src/main/resources/assets/cinder_loe/lang/en_US.lang index 2f8da6d..debbe50 100644 --- a/src/main/resources/assets/cinder_loe/lang/en_US.lang +++ b/src/main/resources/assets/cinder_loe/lang/en_US.lang @@ -19,7 +19,62 @@ tile.lotr:plaster.name=Plaster tile.lotr:voidblock.name=Void tile.lotr:cindercobble.0.name=Cobbled Drystone tile.lotr:cindercobble.1.name=Cobbled Mordor Rock +tile.lotr:enchantedIce.name=Enchanted Ice +tile.lotr:iceCage.name=Ice Cage +tile.forging_station.name=Forging Station +tile.lotr:cinderfur.0.name=Brown Warg Fur Block +tile.lotr:cinderfur.1.name=Gray Warg Fur Block +tile.lotr:cinderfur.2.name=Black Warg Fur Block +tile.lotr:cinderfur.3.name=White Warg Fur Block +tile.lotr:cinderfur.4.name=Obsidian Warg Fur Block +tile.lotr:cinderfur.5.name=Black Bear Fur Block +tile.lotr:cinderfur.6.name=Brown Bear Fur Block +tile.lotr:cinderfur.7.name=Lion Fur Block +tile.lotr:cinderfur.8.name=Lioness Fur Block + +tile.lotr:cinderfurcarpet.0.name=Brown Warg Fur Carpet +tile.lotr:cinderfurcarpet.1.name=Gray Warg Fur Carpet +tile.lotr:cinderfurcarpet.2.name=Black Warg Fur Carpet +tile.lotr:cinderfurcarpet.3.name=White Warg Carpet +tile.lotr:cinderfurcarpet.4.name=Obsidian Warg Fur Carpet +tile.lotr:cinderfurcarpet.5.name=Black Bear Fur Carpet +tile.lotr:cinderfurcarpet.6.name=Brown Bear Fur Carpet +tile.lotr:cinderfurcarpet.7.name=Lion Fur Carpet +tile.lotr:cinderfurcarpet.8.name=Lioness Fur Carpet + +item.repair_kit.name=Repair Kit +item.upgrade_kit.name=Upgrade Kit +item.cinder_fur_item_0.name=Gray Warg Fur +item.cinder_fur_item_1.name=Black Warg Fur +item.cinder_fur_item_2.name=White Warg Fur +item.cinder_fur_item_3.name=Obsidian Warg Fur +item.cinder_fur_item_4.name=Black Bear Fur +item.cinder_fur_item_5.name=Brown Bear Fur +item.cinder_fur_item_6.name=Lioness Fur + +item.lotr:helmetJade.name=Jade Helmet +item.lotr:bodyJade.name=Jade Chestplate +item.lotr:legsJade.name=Jade Leggings +item.lotr:bootsJade.name=Jade Boots +item.lotr:helmetRhudaur.name=Rhudaur Helmet +item.lotr:bodyRhudaur.name=Rhudaur Chestplate +item.lotr:legsRhudaur.name=Rhudaur Leggings +item.lotr:bootsRhudaur.name=Rhudaur Boots + +item.lotr:helmetserpent.name=Serpent Hood +item.lotr:bodyserpent.name=Serpent Cloak +item.lotr:legsserpent.name=Serpent Leggings +item.lotr:bootsserpent.name=Serpent Boots +item.lotr:helmetUsurper.name=Usurper Helmet +item.lotr:bodyUsurper.name=Usurper Chestplate +item.lotr:legsUsurper.name=Usurper Leggings +item.lotr:bootsUsurper.name=Usurper Boots +item.lotr:helmetWarlord.name=Warlord Headdress +item.lotr:bodyWarlord.name=Warlord Chestplate +item.lotr:legsWarlord.name=Warlord Leggings +item.lotr:bootsWarlord.name=Warlord Boots +item.lotr:cleaver=Cleaver item.lotr:spearUnnamed.name=Drannach Oriour item.lotr:frostblade.name=Frostblade item.lotr:whip.name=Whip @@ -53,6 +108,14 @@ item.lotr:pelmen.name=Pelmeni item.lotr:lightStew.name=Light Stew item.lotr:spice.name=Spices item.lotr:spicedHam.name=Spiced Ham +item.lotr:chocolatebar.name=Chocolate Bar +item.lotr:fruitsalad.name=Fruid Salad +item.lotr:flour.name=Flour +item.lotr:dough.name=Dough +item.lotr:pasta.name=Pasta +item.lotr:pretzel.name=Pretzel +item.lotr:halva.name=Halva +item.lotr:doner_kebab.name=Döner Kebab item.lotr:bonemold.name=Bonemold item.lotr:helmetLimwaith.name=Limwaith Helmet @@ -114,6 +177,7 @@ item.war_dart_gilded_iron.name=Gilded Iron Dart item.war_dart_red_dwarven.name=Red Dwarven Dart item.war_dart_mithril.name=Mithril Dart item.war_dart_ancient.name=Ancient Dart +item.war_dart_morgul.name=Morgul Dart item.war_dart_heads_headless.name=??? Dart Heads item.war_dart_heads_copper.name=Copper Dart Heads @@ -129,6 +193,49 @@ item.war_dart_heads_gilded_iron.name=Gilded Iron Dart Heads item.war_dart_heads_red_dwarven.name=Red Dwarven Dart Heads item.war_dart_heads_mithril.name=Mithril Dart Heads item.war_dart_heads_ancient.name=Ancient Dart Heads +item.war_dart_heads_morgul.name=Morgul Dart Heads + +item.lotr.toxicCore.name=Toxic Core +item.lotr:celeiniss.name=Celeiniss +lotr:nimveil.name=Nimveil +item.nimveil_gem.name=Nimveil Gem +item.nimveil_blade.name=Nimveil Blade +item.nimveil_hilt.name=Nimveil Hilt +item.blessed_hammer.name=Hammer of Aulendur +item.ice_thawer.name=Ice Thawer +item.deceiver_blade.name=Deceiver's Blade +item.anarore_bow.name=Anarórë's Bow +item.troll_chieftain_club.name=Troll Chieftain Club +item.glaechir_spear.name=Glaechír's Spear +item.deceiver_blade_blade.name=Cursed Blade +item.deceiver_blade_guard.name=Deceiver's Guard +item.deceiver_blade_hilt.name=Dark Hilt +item.anarore_bow_top.name=Anarórë's Bow Top +item.anarore_bow_bottom.name=Anarórë's Bow Bottom +item.anarore_bow_bowstring.name=Blessed Bowstring +item.troll_chieftain_club_club.name=Troll Club +item.troll_chieftain_club_spikes.name=Serrated Spikes +item.troll_chieftain_club_???.name=??? +item.glaechir_spear_tip.name=Fine Bronze Spear Tip +item.glaechir_spear_shaft.name=Heraldic Spear Shaft +item.glaechir_spear_???.name=??? + +item.lotr:helmetNexShadow=Ancient Shadow Hood +item.lotr:bodyNexShadow=Ancient Shadow Robe Top +item.lotr:legsNexShadow=Ancient Shadow Robe Bottom +item.lotr:bootsNexShadow=Ancient Shadow Boots +item.lotr:helmetNexToxic=Ancient Toxic Hood +item.lotr:bodyNexToxic=Ancient Toxic Robe Top +item.lotr:legsNexToxic=Ancient Toxic Robe Bottom +item.lotr:bootsNexToxic=Ancient Toxic Boots +item.lotr:helmetNexFire=Ancient Fire Hood +item.lotr:bodyNexFire=Ancient Fire Robe Top +item.lotr:legsNexFire=Ancient Fire Robe Bottom +item.lotr:bootsNexFire=Ancient Fire Boots +item.lotr:helmetNexIce=Ancient Ice Hood +item.lotr:bodyNexIce=Ancient Ice Robe Top +item.lotr:legsNexIce=Ancient Ice Robe Bottom +item.lotr:bootsNexIce=Ancient Ice Boots item.spawn_egg_FangornAuroch.name=Spawn Fangorn Auroch item.spawn_egg_FangornBear.name=Spawn Fangorn Bear @@ -213,3 +320,28 @@ lotr.unit.Bree_Horse=Bree-land Outrider entity.cinder_loe.LOTREntitySauron.name=Sauron entity.cinder_loe.UtumnoSlaveTrader.bound.name=Slave Mule entity.cinder_loe.UtumnoSlaveTrader.name=Freed Utumno Trader +entity.cinder_loe.HobbitBannerBearer.name=Hobbit Banner Bearer +entity.cinder_loe.MorgulOrc.name=Minas Morgul Orc +entity.cinder_loe.EsgarothSoldier.name=Esgarothi Soldier +entity.cinder_loe.RhudaurSoldier.name=Rhudaur Soldier +entity.cinder_loe.TauredainTrueBlood.name=Taurethrim True-Blood +entity.cinder_loe.Sirrandrai.name=Rider of Sirrandrai + +lotr.enchant.protectWeak1=Dented +lotr.enchant.protectWeak2=Defective +lotr.enchant.protectRangedWeak1=Punctured +lotr.enchant.protectRangedWeak2=Pierced +lotr.enchant.weak4=Bent +lotr.enchant.rangedWeak3=Cracked + +lotr.unit.Banner_Warg=Warg Rider Banner +lotr.unit.Banner_Horse=Mounted Banner Bearer +lotr.unit.TestMob=Test Mob +lotr.unit.Sirrandrai=Rider of Sirrandrai + + +lotr.unitinfo.Angmar=To Hire this unit you must have the Angmar Objective complete. +lotr.unitinfo.Arnor=To Hire this unit you must have the Arnor Objective complete. +lotr.unitinfo.Rhudaur=To Hire this unit you must have the Rhudaur Objective complete. +lotr.unitinfo.Dale=To Hire this unit you must have the Dalish Objective complete. +lotr.unitinfo.Lindon=To Hire this unit you must have the Lindon Objective complete. \ No newline at end of file diff --git a/src/main/resources/assets/cinder_loe/mob/green.png b/src/main/resources/assets/cinder_loe/mob/green.png new file mode 100644 index 0000000..afd0c26 Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/green.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/nex/fire.png b/src/main/resources/assets/cinder_loe/mob/nex/fire.png new file mode 100644 index 0000000..f3837fc Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/nex/fire.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/nex/ice.png b/src/main/resources/assets/cinder_loe/mob/nex/ice.png new file mode 100644 index 0000000..aa7762c Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/nex/ice.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/nex/shadow.png b/src/main/resources/assets/cinder_loe/mob/nex/shadow.png new file mode 100644 index 0000000..7c7f175 Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/nex/shadow.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/nex/toxin.png b/src/main/resources/assets/cinder_loe/mob/nex/toxin.png new file mode 100644 index 0000000..8bf70d8 Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/nex/toxin.png differ diff --git a/src/main/resources/assets/cinder_loe/sounds.json b/src/main/resources/assets/cinder_loe/sounds.json new file mode 100644 index 0000000..e54451a --- /dev/null +++ b/src/main/resources/assets/cinder_loe/sounds.json @@ -0,0 +1,34 @@ +{ + "boss.Battle": + { + "category": "neutral", + "sounds": + [ + "boss/Battle" + ] + }, + "boss.Battle2": + { + "category": "neutral", + "sounds": + [ + "boss/Battle2" + ] + }, + "boss.Victory": + { + "category": "neutral", + "sounds": + [ + "boss/Victory" + ] + }, + "boss.Spiders": + { + "category": "neutral", + "sounds": + [ + "boss/Spiders" + ] + } +} diff --git a/src/main/resources/assets/cinder_loe/sounds/boss/battle.ogg b/src/main/resources/assets/cinder_loe/sounds/boss/battle.ogg new file mode 100644 index 0000000..da8aeb5 Binary files /dev/null and b/src/main/resources/assets/cinder_loe/sounds/boss/battle.ogg differ diff --git a/src/main/resources/assets/cinder_loe/sounds/boss/combat.ogg b/src/main/resources/assets/cinder_loe/sounds/boss/combat.ogg new file mode 100644 index 0000000..0a78d53 Binary files /dev/null and b/src/main/resources/assets/cinder_loe/sounds/boss/combat.ogg differ diff --git a/src/main/resources/assets/cinder_loe/sounds/boss/spiders.ogg b/src/main/resources/assets/cinder_loe/sounds/boss/spiders.ogg new file mode 100644 index 0000000..803ceb9 Binary files /dev/null and b/src/main/resources/assets/cinder_loe/sounds/boss/spiders.ogg differ diff --git a/src/main/resources/assets/cinder_loe/sounds/boss/victory.ogg b/src/main/resources/assets/cinder_loe/sounds/boss/victory.ogg new file mode 100644 index 0000000..6abc3f2 Binary files /dev/null and b/src/main/resources/assets/cinder_loe/sounds/boss/victory.ogg differ diff --git a/src/main/resources/assets/cinder_loe/sounds2.json b/src/main/resources/assets/cinder_loe/sounds2.json new file mode 100644 index 0000000..5418e14 --- /dev/null +++ b/src/main/resources/assets/cinder_loe/sounds2.json @@ -0,0 +1,4 @@ + boss.Battle + boss.Battle2 + boss.Spiders + boss.Victory diff --git a/src/main/resources/assets/lotr/textures/blocks/cinderfur_bearblack.png b/src/main/resources/assets/lotr/textures/blocks/cinderfur_bearblack.png new file mode 100644 index 0000000..a56ff66 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/cinderfur_bearblack.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/cinderfur_bearbrown.png b/src/main/resources/assets/lotr/textures/blocks/cinderfur_bearbrown.png new file mode 100644 index 0000000..cc6107c Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/cinderfur_bearbrown.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/cinderfur_black.png b/src/main/resources/assets/lotr/textures/blocks/cinderfur_black.png new file mode 100644 index 0000000..6a0ec9c Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/cinderfur_black.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/cinderfur_brown.png b/src/main/resources/assets/lotr/textures/blocks/cinderfur_brown.png new file mode 100644 index 0000000..0ad91ed Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/cinderfur_brown.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/cinderfur_gray.png b/src/main/resources/assets/lotr/textures/blocks/cinderfur_gray.png new file mode 100644 index 0000000..ac386b9 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/cinderfur_gray.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/cinderfur_lion.png b/src/main/resources/assets/lotr/textures/blocks/cinderfur_lion.png new file mode 100644 index 0000000..04e9f16 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/cinderfur_lion.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/cinderfur_lioness.png b/src/main/resources/assets/lotr/textures/blocks/cinderfur_lioness.png new file mode 100644 index 0000000..450aa46 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/cinderfur_lioness.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/cinderfur_obsidian.png b/src/main/resources/assets/lotr/textures/blocks/cinderfur_obsidian.png new file mode 100644 index 0000000..28eb3eb Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/cinderfur_obsidian.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/cinderfur_white.png b/src/main/resources/assets/lotr/textures/blocks/cinderfur_white.png new file mode 100644 index 0000000..4d0492f Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/cinderfur_white.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/nex_ice_crystal.png b/src/main/resources/assets/lotr/textures/blocks/nex_ice_crystal.png new file mode 100644 index 0000000..571d58d Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/nex_ice_crystal.png differ diff --git a/src/main/resources/assets/lotr/textures/items/blessed_hammer.png b/src/main/resources/assets/lotr/textures/items/blessed_hammer.png new file mode 100644 index 0000000..96f7114 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/blessed_hammer.png differ diff --git a/src/main/resources/assets/lotr/textures/items/firstAgeGlaive.png b/src/main/resources/assets/lotr/textures/items/celeiniss.png similarity index 100% rename from src/main/resources/assets/lotr/textures/items/firstAgeGlaive.png rename to src/main/resources/assets/lotr/textures/items/celeiniss.png diff --git a/src/main/resources/assets/lotr/textures/items/cinder_fur_item_0.png b/src/main/resources/assets/lotr/textures/items/cinder_fur_item_0.png new file mode 100644 index 0000000..029301d Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/cinder_fur_item_0.png differ diff --git a/src/main/resources/assets/lotr/textures/items/cinder_fur_item_1.png b/src/main/resources/assets/lotr/textures/items/cinder_fur_item_1.png new file mode 100644 index 0000000..50c925f Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/cinder_fur_item_1.png differ diff --git a/src/main/resources/assets/lotr/textures/items/cinder_fur_item_2.png b/src/main/resources/assets/lotr/textures/items/cinder_fur_item_2.png new file mode 100644 index 0000000..9dbc84f Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/cinder_fur_item_2.png differ diff --git a/src/main/resources/assets/lotr/textures/items/cinder_fur_item_3.png b/src/main/resources/assets/lotr/textures/items/cinder_fur_item_3.png new file mode 100644 index 0000000..6753689 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/cinder_fur_item_3.png differ diff --git a/src/main/resources/assets/lotr/textures/items/cinder_fur_item_4.png b/src/main/resources/assets/lotr/textures/items/cinder_fur_item_4.png new file mode 100644 index 0000000..f3d8335 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/cinder_fur_item_4.png differ diff --git a/src/main/resources/assets/lotr/textures/items/cinder_fur_item_5.png b/src/main/resources/assets/lotr/textures/items/cinder_fur_item_5.png new file mode 100644 index 0000000..b2000cd Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/cinder_fur_item_5.png differ diff --git a/src/main/resources/assets/lotr/textures/items/cinder_fur_item_6.png b/src/main/resources/assets/lotr/textures/items/cinder_fur_item_6.png new file mode 100644 index 0000000..cf9a1c8 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/cinder_fur_item_6.png differ diff --git a/src/main/resources/assets/lotr/textures/items/cleaver.png b/src/main/resources/assets/lotr/textures/items/cleaver.png new file mode 100644 index 0000000..1b63d74 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/cleaver.png differ diff --git a/src/main/resources/assets/lotr/textures/items/deceiver_blade.png b/src/main/resources/assets/lotr/textures/items/deceiver_blade.png new file mode 100644 index 0000000..e11f7f5 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/deceiver_blade.png differ diff --git a/src/main/resources/assets/lotr/textures/items/deceiver_blade.png.mcmeta b/src/main/resources/assets/lotr/textures/items/deceiver_blade.png.mcmeta new file mode 100644 index 0000000..55aeb43 --- /dev/null +++ b/src/main/resources/assets/lotr/textures/items/deceiver_blade.png.mcmeta @@ -0,0 +1,30 @@ +{ + "animation": { + "frames": [ + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 2, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 4, + 4, + 4, + 4, + 5, + 5, + 5, + 5 + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/lotr/textures/items/deceiver_blade_blade.png b/src/main/resources/assets/lotr/textures/items/deceiver_blade_blade.png new file mode 100644 index 0000000..037df3a Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/deceiver_blade_blade.png differ diff --git a/src/main/resources/assets/lotr/textures/items/deceiver_blade_guard.png b/src/main/resources/assets/lotr/textures/items/deceiver_blade_guard.png new file mode 100644 index 0000000..1d40b0f Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/deceiver_blade_guard.png differ diff --git a/src/main/resources/assets/lotr/textures/items/deceiver_blade_hilt.png b/src/main/resources/assets/lotr/textures/items/deceiver_blade_hilt.png new file mode 100644 index 0000000..e3c8ce9 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/deceiver_blade_hilt.png differ diff --git a/src/main/resources/assets/lotr/textures/items/demonblood_vial.png b/src/main/resources/assets/lotr/textures/items/demonblood_vial.png new file mode 100644 index 0000000..78a0625 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/demonblood_vial.png differ diff --git a/src/main/resources/assets/lotr/textures/items/doner_kebab.png b/src/main/resources/assets/lotr/textures/items/doner_kebab.png new file mode 100644 index 0000000..e16f1b2 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/doner_kebab.png differ diff --git a/src/main/resources/assets/lotr/textures/items/ice_thawer.png b/src/main/resources/assets/lotr/textures/items/ice_thawer.png new file mode 100644 index 0000000..7bdf430 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/ice_thawer.png differ diff --git a/src/main/resources/assets/lotr/textures/items/ice_thawer.png.mcmeta b/src/main/resources/assets/lotr/textures/items/ice_thawer.png.mcmeta new file mode 100644 index 0000000..30601d0 --- /dev/null +++ b/src/main/resources/assets/lotr/textures/items/ice_thawer.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation":{"frametime":3} +} diff --git a/src/main/resources/assets/lotr/textures/items/large/firstAgeGlaive.png b/src/main/resources/assets/lotr/textures/items/large/celeiniss.png similarity index 100% rename from src/main/resources/assets/lotr/textures/items/large/firstAgeGlaive.png rename to src/main/resources/assets/lotr/textures/items/large/celeiniss.png diff --git a/src/main/resources/assets/lotr/textures/items/mugDemonicHealthPotion_liquid.png b/src/main/resources/assets/lotr/textures/items/mugDemonicHealthPotion_liquid.png new file mode 100644 index 0000000..ee1f593 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/mugDemonicHealthPotion_liquid.png differ diff --git a/src/main/resources/assets/lotr/textures/items/war_dart_heads_1_alt.png b/src/main/resources/assets/lotr/textures/items/nimveil_blade.png similarity index 100% rename from src/main/resources/assets/lotr/textures/items/war_dart_heads_1_alt.png rename to src/main/resources/assets/lotr/textures/items/nimveil_blade.png diff --git a/src/main/resources/assets/lotr/textures/items/nimveil_gem_ancient.png b/src/main/resources/assets/lotr/textures/items/nimveil_gem_ancient.png new file mode 100644 index 0000000..cc30a0b Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/nimveil_gem_ancient.png differ diff --git a/src/main/resources/assets/lotr/textures/items/nimveil_gem_ancient.png.mcmeta b/src/main/resources/assets/lotr/textures/items/nimveil_gem_ancient.png.mcmeta new file mode 100644 index 0000000..7533019 --- /dev/null +++ b/src/main/resources/assets/lotr/textures/items/nimveil_gem_ancient.png.mcmeta @@ -0,0 +1,76 @@ +{ + "animation": { + "frames": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 12, + 12, + 13, + 13, + 13, + 14, + 14, + 14, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15 + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/lotr/textures/items/nimveil_gem_mortals.png b/src/main/resources/assets/lotr/textures/items/nimveil_gem_mortals.png new file mode 100644 index 0000000..f52aeef Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/nimveil_gem_mortals.png differ diff --git a/src/main/resources/assets/lotr/textures/items/nimveil_gem_mortals.png.mcmeta b/src/main/resources/assets/lotr/textures/items/nimveil_gem_mortals.png.mcmeta new file mode 100644 index 0000000..7533019 --- /dev/null +++ b/src/main/resources/assets/lotr/textures/items/nimveil_gem_mortals.png.mcmeta @@ -0,0 +1,76 @@ +{ + "animation": { + "frames": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 12, + 12, + 13, + 13, + 13, + 14, + 14, + 14, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15 + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/lotr/textures/items/nimveil_gem_sauron.png b/src/main/resources/assets/lotr/textures/items/nimveil_gem_sauron.png new file mode 100644 index 0000000..053a811 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/nimveil_gem_sauron.png differ diff --git a/src/main/resources/assets/lotr/textures/items/nimveil_gem_sauron.png.mcmeta b/src/main/resources/assets/lotr/textures/items/nimveil_gem_sauron.png.mcmeta new file mode 100644 index 0000000..7533019 --- /dev/null +++ b/src/main/resources/assets/lotr/textures/items/nimveil_gem_sauron.png.mcmeta @@ -0,0 +1,76 @@ +{ + "animation": { + "frames": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 12, + 12, + 13, + 13, + 13, + 14, + 14, + 14, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15 + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/lotr/textures/items/nimveil_gem_udun.png b/src/main/resources/assets/lotr/textures/items/nimveil_gem_udun.png new file mode 100644 index 0000000..3b278cd Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/nimveil_gem_udun.png differ diff --git a/src/main/resources/assets/lotr/textures/items/nimveil_gem_udun.png.mcmeta b/src/main/resources/assets/lotr/textures/items/nimveil_gem_udun.png.mcmeta new file mode 100644 index 0000000..7533019 --- /dev/null +++ b/src/main/resources/assets/lotr/textures/items/nimveil_gem_udun.png.mcmeta @@ -0,0 +1,76 @@ +{ + "animation": { + "frames": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 12, + 12, + 13, + 13, + 13, + 14, + 14, + 14, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15 + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/lotr/textures/items/nimveil_gem_valar.png b/src/main/resources/assets/lotr/textures/items/nimveil_gem_valar.png new file mode 100644 index 0000000..25a3d13 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/nimveil_gem_valar.png differ diff --git a/src/main/resources/assets/lotr/textures/items/nimveil_gem_valar.png.mcmeta b/src/main/resources/assets/lotr/textures/items/nimveil_gem_valar.png.mcmeta new file mode 100644 index 0000000..7533019 --- /dev/null +++ b/src/main/resources/assets/lotr/textures/items/nimveil_gem_valar.png.mcmeta @@ -0,0 +1,76 @@ +{ + "animation": { + "frames": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 12, + 12, + 13, + 13, + 13, + 14, + 14, + 14, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15 + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/lotr/textures/items/repair_kit.png b/src/main/resources/assets/lotr/textures/items/repair_kit.png new file mode 100644 index 0000000..1ee5390 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/repair_kit.png differ diff --git a/src/main/resources/assets/lotr/textures/items/upgrade_kit.png b/src/main/resources/assets/lotr/textures/items/upgrade_kit.png new file mode 100644 index 0000000..5f7d429 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/upgrade_kit.png differ diff --git a/src/main/resources/assets/lotr/textures/items/war_dart_dwarven.png b/src/main/resources/assets/lotr/textures/items/war_dart_dwarven.png index 42ce651..12f2319 100644 Binary files a/src/main/resources/assets/lotr/textures/items/war_dart_dwarven.png and b/src/main/resources/assets/lotr/textures/items/war_dart_dwarven.png differ diff --git a/src/main/resources/assets/lotr/textures/items/war_dart_heads_0_morgul.png b/src/main/resources/assets/lotr/textures/items/war_dart_heads_0_morgul.png new file mode 100644 index 0000000..b0a3e0e Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/war_dart_heads_0_morgul.png differ diff --git a/src/main/resources/assets/lotr/textures/items/war_dart_heads_1_morgul.png b/src/main/resources/assets/lotr/textures/items/war_dart_heads_1_morgul.png new file mode 100644 index 0000000..9da8ab5 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/war_dart_heads_1_morgul.png differ diff --git a/src/main/resources/assets/lotr/textures/items/war_dart_heads_2_morgul.png b/src/main/resources/assets/lotr/textures/items/war_dart_heads_2_morgul.png new file mode 100644 index 0000000..5c3c5c2 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/war_dart_heads_2_morgul.png differ diff --git a/src/main/resources/assets/lotr/textures/items/war_dart_heads_3_morgul.png b/src/main/resources/assets/lotr/textures/items/war_dart_heads_3_morgul.png new file mode 100644 index 0000000..7bc828a Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/war_dart_heads_3_morgul.png differ diff --git a/src/main/resources/assets/lotr/textures/items/war_dart_heads_4_morgul.png b/src/main/resources/assets/lotr/textures/items/war_dart_heads_4_morgul.png new file mode 100644 index 0000000..92d10ce Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/war_dart_heads_4_morgul.png differ diff --git a/src/main/resources/assets/lotr/textures/items/war_dart_heads_5_morgul.png b/src/main/resources/assets/lotr/textures/items/war_dart_heads_5_morgul.png new file mode 100644 index 0000000..3904239 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/war_dart_heads_5_morgul.png differ diff --git a/src/main/resources/assets/lotr/textures/items/war_dart_mithril.png.mcmeta b/src/main/resources/assets/lotr/textures/items/war_dart_mithril.png.mcmeta new file mode 100644 index 0000000..7b67f48 --- /dev/null +++ b/src/main/resources/assets/lotr/textures/items/war_dart_mithril.png.mcmeta @@ -0,0 +1,51 @@ +{ + "animation": { + "frames": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6 + ] + } +} diff --git a/src/main/resources/assets/lotr/textures/items/war_dart_red_dwarven.png b/src/main/resources/assets/lotr/textures/items/war_dart_red_dwarven.png index ccdb1be..7ee04b7 100644 Binary files a/src/main/resources/assets/lotr/textures/items/war_dart_red_dwarven.png and b/src/main/resources/assets/lotr/textures/items/war_dart_red_dwarven.png differ diff --git a/src/main/resources/credits.txt b/src/main/resources/credits.txt new file mode 100644 index 0000000..4ebbf3c --- /dev/null +++ b/src/main/resources/credits.txt @@ -0,0 +1,81 @@ +Cinder LoE: An exciting expansion to Lord of Embers + +==Credits== + +• Mevans - Creation of the LOTRMod +• Shinare - Primary Creator of Cinder and all that it is capable of bringing to the world +• KeyLime17 - Secondary Developer, Texturer, and general assistant to whatever is being worked on +• cleric_red - primary developer of Textures and Models +• Deanburrito - Developer of textures and models +• Jacubie - Developer of some textures. + +==Textures: (Please do not reuse without the creators permission!)== +KeyLime17 +• Red Dwarven Alignment Shield +• Wood Elven Relic +• Upgrade Kit +• Limwaith Weapons +• Limwaith Armor sets +• Bree Sword +• Ash Weaponry +• Spiced Ham, Spice, Doner Kebab, Bacon, Beef Stew, Light Stew, Pelmen, Onion, Cabbage, Halva +• Wizard Staves +• Chains +• Frostblade +• Voidal Dagger +• Red Dwarf Crossbow +• Bonemold, Ashen Ingot +• Fish barrel +• Cut and Cobbled Drystone + +Cleric_red +• War darts +• Toxic Core +• Red Dwarven Weapons +• Red Dwarven Armor sets +• Bree Armor sets +• Ash Weaponry +• Pretzel, Pasta, Dough, Flour, Chocolate +• Arnor Mace +• Arnor Light armor set +• Haradric Elite Armor sets +• Rhudaur Armor set +• Jade Armor set +• Red Dwarven Ingot and Block +• Cinder block +• Red Dwarven Chandelier +• Ice cage +• Plaster +• Red Dwarven Banner +• Mordor Cobblebrick + +Deanburrito +• Repair Kit +• All the extra Fur Blocks +• And the Fur items + +Jacubie +• Whip + +Geralt (Or other usernames such as DefenderOfChina) +• Drannach Iaur (spearUnnamed.png) + +==Models: (All models below belong to their corresponding individual, a lot of work was put into them, so if you wish to redistribute, please ask!)== + +Cleric_red +• Jade Armor Model +• Serpent Armor Model +• Bree Kettle Helmet Model +• Broken Halo Model +• Red Dwarven Helmet Model +• Usurper Helmet Model +• Rhudaur Helmet Armor Model +• Warlord Helmet Model + +==Sounds:== + +KeyLime (Although Most of these are or will be taken from existing video games and sources, which will be attached to the name) +• boss/Battle - Baldurs Gate 3 - Ketheric Thorm Battle Theme - Borislav Slavov +• boss/Spiders - Baldurs Gate 3 - Thorms Battle OST - Borislav Slavov +• boss/Battle2 - Baldurs Gate 3 OST - Fight Theme 916 - Ally Down - Borislav Slavov +• boss/Victory - Borislav Slavov - Baldurs Gate 3 OST - Battle - Enemy Down - Borislav Slavov diff --git a/src/main/resources/mixins.cinder_loe.json b/src/main/resources/mixins.cinder_loe.json index c33d57e..9dec57c 100644 --- a/src/main/resources/mixins.cinder_loe.json +++ b/src/main/resources/mixins.cinder_loe.json @@ -6,10 +6,18 @@ "target": "@env(DEFAULT)", "compatibilityLevel": "JAVA_8", "mixins": [ + "MixinEnchantmentHelper", + "MixinEntity", + "MixinEntityArrow", "MixinItemRenderer", "MixinLOTRArmorModels", + "MixinLOTRBrewingRecipes", "MixinLOTRClientProxy", "MixinLOTRContainerAnvil", + "MixinLOTREnchantment", + "MixinLOTREnchantmentType", + "MixinLOTREntityAINearestAttackableTargetBasic", + "MixinLOTREntityProjectileBase", "MixinLOTREntitySauron", "MixinLOTRIntCache", "MixinLOTRNPCRendering", @@ -32,7 +40,11 @@ "MixinRendererLivingEntity", "MixinRenderItem", "MixinSlotCrafting", - "MixinLOTREnchantmentType" - ], + "overrides.MixinLOTREntityWarg", + "overrides.MixinLOTRHiredNPCInfo", + "overrides.MixinLOTRReplacedMethods", + "overrides.MixinLOTRItemEntDraught", + "overrides.MixinLOTRUnitTradeEntries" + ], "client": [] }