2
0
Fork 0

Utilized new util to handle incoming damage increase,

added Bank banner
updated localization
fixed Ulukai and Warbands crashing eachother
main
KeyLime17 6 months ago
parent a0fe19d1e5
commit 6b6b474960

@ -10,15 +10,22 @@ import cpw.mods.fml.common.IFuelHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent; import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry;
import lotr.common.LOTRAchievement;
import lotr.common.LOTRLevelData;
import lotr.common.LOTRMod; import lotr.common.LOTRMod;
import lotr.common.LOTRDimension; import lotr.common.LOTRDimension;
import lotr.common.enchant.LOTREnchantment; import lotr.common.enchant.LOTREnchantment;
import lotr.common.enchant.LOTREnchantmentHelper; import lotr.common.enchant.LOTREnchantmentHelper;
import lotr.common.entity.npc.LOTREntityOrc; import lotr.common.entity.npc.LOTREntityOrc;
import lotr.common.entity.projectile.LOTREntityCrossbowBolt;
import lotr.common.entity.projectile.LOTREntityDart;
import lotr.common.entity.projectile.LOTREntitySpear;
import lotr.common.item.*; import lotr.common.item.*;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.*; import net.minecraft.item.*;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagList;
@ -27,6 +34,7 @@ import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect; import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatComponentText;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.EntityDamageSourceIndirect;
import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.DimensionManager;
@ -84,7 +92,41 @@ public class CinderEventHandler implements IFuelHandler {
} }
} }
} }
@SubscribeEvent
public void onLivingAttacked(LivingAttackEvent event) {
EntityLivingBase entity = event.entityLiving;
EntityLivingBase attacker = event.source.getEntity() instanceof EntityLivingBase ? (EntityLivingBase)event.source.getEntity() : null;
World world = entity.worldObj;
if (event.source instanceof EntityDamageSourceIndirect) {
ItemStack chestplate;
Entity projectile = event.source.getSourceOfDamage();
if (projectile instanceof EntityArrow || projectile instanceof LOTREntityCrossbowBolt || projectile instanceof LOTREntityDart) {
boolean wearingAllGalvorn = true;
for (int i = 0; i < 4; ++i) {
ItemStack armour = entity.getEquipmentInSlot(i + 1);
if (armour != null && armour.getItem() instanceof ItemArmor && ((ItemArmor)armour.getItem()).getArmorMaterial() == LOTRMaterial.GALVORN.toArmorMaterial()) continue;
wearingAllGalvorn = false;
break;
}
if (wearingAllGalvorn) {
if (!world.isRemote && entity instanceof EntityPlayer) {
((EntityPlayer)entity).inventory.damageArmor(event.ammount);
}
this.cancelAttackEvent(event);
}
}
if (!world.isRemote && entity instanceof EntityPlayer && attacker instanceof LOTREntityOrc && projectile instanceof LOTREntitySpear && (chestplate = entity.getEquipmentInSlot(3)) != null && chestplate.getItem() == LOTRMod.bodyMithril) {
LOTRLevelData.getData((EntityPlayer)entity).addAchievement(LOTRAchievement.hitByOrcSpear);
}
}
}
private void cancelAttackEvent(LivingAttackEvent event) {
event.setCanceled(true);
DamageSource source = event.source;
if (source instanceof EntityDamageSourceIndirect) {
Entity entity = source.getSourceOfDamage();
}
}
@SubscribeEvent @SubscribeEvent
public void onLivingAttack(LivingAttackEvent event) { public void onLivingAttack(LivingAttackEvent event) {
Entity attacker = event.source.getEntity(); Entity attacker = event.source.getEntity();

@ -30,6 +30,7 @@ public class LOTRBannerAdder implements IClassTransformer {
register("RED", "red", 44, "GONDOR"); register("RED", "red", 44, "GONDOR");
register("BLUE", "blue", 45, "GONDOR"); register("BLUE", "blue", 45, "GONDOR");
register("GREEN", "green", 46, "GONDOR"); register("GREEN", "green", 46, "GONDOR");
register("BANK", "bank", 47, "HOBBIT");
// register("TEST", "test", 43, "GONDOR"); // register("TEST", "test", 43, "GONDOR");
} }

@ -8,8 +8,8 @@ import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.DimensionManager;
public class UlukaiCurseHandler { public class UlukaiCurseHandler {
private int tickCounter = 0; private int tickCounter = 20000;
public static final int INTERVAL_TICKS = 72000; // 1 hour ~~10 minutes at 20 TPS~~ public static final int INTERVAL_TICKS = 92000; // 1 hour ~~10 minutes at 20 TPS~~ + 20000 Ticks, to offset warband running
@SubscribeEvent @SubscribeEvent
public void onServerTick(TickEvent.ServerTickEvent event) { public void onServerTick(TickEvent.ServerTickEvent event) {

@ -392,7 +392,7 @@ warband.fac.WOOD_ELF_SCOUT=Woodland Realm scouts
warband.fac.RED_MOUNTAINS=Red Mountains warband.fac.RED_MOUNTAINS=Red Mountains
warband.fac.RHUDEL_GOLDEN=Golden Easterlings warband.fac.RHUDEL_GOLDEN=Golden Easterlings
warband.fac.LIMWAITH=Limwaith warband.fac.LIMWAITH=Limwaith
warband.fac.RENEGADE=renegades warband.fac.RENEGADE=Renegades
pickpocket.cooldown=You need to wait before pickpocketing again. pickpocket.cooldown=You need to wait before pickpocketing again.
pickpocket.cooldown_alt=Maybe get your hands out of his pants first. pickpocket.cooldown_alt=Maybe get your hands out of his pants first.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Loading…
Cancel
Save