The Ulukai, also moved special item classes to a separate directory
parent
26dc5a3f90
commit
9ef8799c19
@ -1,29 +0,0 @@
|
|||||||
package com.zivilon.cinder_loe.items;
|
|
||||||
|
|
||||||
import com.zivilon.cinder_loe.CinderLoE;
|
|
||||||
import com.zivilon.cinder_loe.entity.corrupt.CorruptMan;
|
|
||||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
import lotr.common.item.LOTRItemArmor;
|
|
||||||
import lotr.common.item.LOTRMaterial;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
|
||||||
import net.minecraft.entity.IEntityLivingData;
|
|
||||||
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.potion.Potion;
|
|
||||||
import net.minecraft.potion.PotionEffect;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
|
||||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
public class BrokenHalo extends LOTRItemArmor {
|
|
||||||
|
|
||||||
public BrokenHalo(LOTRMaterial material, int slotType, String s) {
|
|
||||||
super(material, slotType, s);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
package com.zivilon.cinder_loe.items.specials;
|
||||||
|
|
||||||
|
import lotr.common.item.LOTRItemArmor;
|
||||||
|
import lotr.common.item.LOTRMaterial;
|
||||||
|
|
||||||
|
public class BrokenHalo extends LOTRItemArmor {
|
||||||
|
|
||||||
|
public BrokenHalo(LOTRMaterial material, int slotType, String s) {
|
||||||
|
super(material, slotType, s);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,27 +1,23 @@
|
|||||||
package com.zivilon.cinder_loe.items;
|
package com.zivilon.cinder_loe.items.specials;
|
||||||
|
|
||||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import lotr.common.LOTRCreativeTabs;
|
|
||||||
import lotr.common.LOTRLevelData;
|
import lotr.common.LOTRLevelData;
|
||||||
import lotr.common.LOTRMod;
|
import lotr.common.LOTRMod;
|
||||||
import lotr.common.fac.LOTRFaction;
|
import lotr.common.fac.LOTRFaction;
|
||||||
import lotr.common.network.LOTRPacketHandler;
|
import lotr.common.network.LOTRPacketHandler;
|
||||||
import lotr.common.network.LOTRPacketWeaponFX;
|
import lotr.common.network.LOTRPacketWeaponFX;
|
||||||
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLiving;
|
import net.minecraft.entity.EntityLiving;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.EnumAction;
|
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.potion.PotionEffect;
|
import net.minecraft.potion.PotionEffect;
|
||||||
import net.minecraft.potion.Potion;
|
import net.minecraft.potion.Potion;
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
import net.minecraft.util.DamageSource;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import com.zivilon.cinder_loe.items.WizardStaff;
|
import com.zivilon.cinder_loe.items.WizardStaff;
|
||||||
@ -1,6 +1,7 @@
|
|||||||
package com.zivilon.cinder_loe.items;
|
package com.zivilon.cinder_loe.items.specials;
|
||||||
|
|
||||||
|
|
||||||
|
import com.zivilon.cinder_loe.items.WizardStaff;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.passive.EntityAnimal;
|
import net.minecraft.entity.passive.EntityAnimal;
|
||||||
@ -1,27 +1,14 @@
|
|||||||
package com.zivilon.cinder_loe.items;
|
package com.zivilon.cinder_loe.items.specials;
|
||||||
|
|
||||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||||
import java.util.List;
|
|
||||||
import lotr.common.LOTRCreativeTabs;
|
|
||||||
import lotr.common.LOTRLevelData;
|
|
||||||
import lotr.common.LOTRMod;
|
|
||||||
import lotr.common.fac.LOTRFaction;
|
|
||||||
import lotr.common.network.LOTRPacketHandler;
|
import lotr.common.network.LOTRPacketHandler;
|
||||||
import lotr.common.network.LOTRPacketWeaponFX;
|
import lotr.common.network.LOTRPacketWeaponFX;
|
||||||
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLiving;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.EnumAction;
|
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.potion.PotionEffect;
|
|
||||||
import net.minecraft.potion.Potion;
|
|
||||||
import net.minecraft.server.MinecraftServer;
|
|
||||||
import net.minecraft.util.DamageSource;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import com.zivilon.cinder_loe.items.WizardStaff;
|
import com.zivilon.cinder_loe.items.WizardStaff;
|
||||||
@ -1,27 +1,13 @@
|
|||||||
package com.zivilon.cinder_loe.items;
|
package com.zivilon.cinder_loe.items.specials;
|
||||||
|
|
||||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||||
import java.util.List;
|
|
||||||
import lotr.common.LOTRCreativeTabs;
|
|
||||||
import lotr.common.LOTRLevelData;
|
|
||||||
import lotr.common.LOTRMod;
|
|
||||||
import lotr.common.fac.LOTRFaction;
|
|
||||||
import lotr.common.network.LOTRPacketHandler;
|
import lotr.common.network.LOTRPacketHandler;
|
||||||
import lotr.common.network.LOTRPacketWeaponFX;
|
import lotr.common.network.LOTRPacketWeaponFX;
|
||||||
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLiving;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.EnumAction;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.potion.PotionEffect;
|
|
||||||
import net.minecraft.potion.Potion;
|
|
||||||
import net.minecraft.server.MinecraftServer;
|
|
||||||
import net.minecraft.util.DamageSource;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import com.zivilon.cinder_loe.items.WizardStaff;
|
import com.zivilon.cinder_loe.items.WizardStaff;
|
||||||
@ -0,0 +1,272 @@
|
|||||||
|
package com.zivilon.cinder_loe.items.specials;
|
||||||
|
|
||||||
|
import com.zivilon.cinder_loe.CinderLoE_Config;
|
||||||
|
import com.zivilon.cinder_loe.LoECreativeTabs;
|
||||||
|
import com.zivilon.cinder_loe.entity.npc.orc.NorthernOrc;
|
||||||
|
import com.zivilon.cinder_loe.entity.npc.radagast.FangornAnimal;
|
||||||
|
import com.zivilon.cinder_loe.util.BlockPos;
|
||||||
|
import lotr.common.LOTRMod;
|
||||||
|
import lotr.common.entity.npc.*;
|
||||||
|
import lotr.common.fac.LOTRFaction;
|
||||||
|
import lotr.common.fac.LOTRFactionRelations;
|
||||||
|
import net.minecraft.entity.*;
|
||||||
|
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||||
|
import net.minecraft.entity.ai.attributes.IAttributeInstance;
|
||||||
|
import net.minecraft.entity.passive.EntityAnimal;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.EnumAction;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.nbt.NBTTagList;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
||||||
|
public class Ulukai extends Item {
|
||||||
|
private static final String ULUKAI_TAG = "UlukaiModifiers";
|
||||||
|
LOTRFaction gundabad = LOTRFaction.valueOf(CinderLoE_Config.ulukai_faction);
|
||||||
|
|
||||||
|
public Ulukai() {
|
||||||
|
super();
|
||||||
|
this.setCreativeTab(LoECreativeTabs.tabCharacterLoE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxItemUseDuration(ItemStack itemstack) {
|
||||||
|
return 400;
|
||||||
|
} //20 second usage before it spawns anything
|
||||||
|
|
||||||
|
public EnumAction getItemUseAction(ItemStack itemstack) {
|
||||||
|
return EnumAction.bow;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) {
|
||||||
|
entityplayer.setItemInUse(itemstack, getMaxItemUseDuration(itemstack));
|
||||||
|
return itemstack;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack onEaten(ItemStack stack, World world, EntityPlayer player) {
|
||||||
|
if (!world.isRemote) {
|
||||||
|
if (isAreaCrowded(world, player)) {
|
||||||
|
world.playSoundAtEntity(player, "lotr:item.puff", 1.0F, 2.0F);
|
||||||
|
} else {
|
||||||
|
for (int i = 0; i < 5; i++) {
|
||||||
|
BlockPos spawnPos = BlockPos.findSafeSpawnLocation(world, player);
|
||||||
|
if (spawnPos != null) {
|
||||||
|
spawnRandomGundabad(world, spawnPos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
world.playSoundAtEntity(player, "lotr:dwarf.kill", 2.0F,
|
||||||
|
(Item.itemRand.nextFloat() - Item.itemRand.nextFloat()) * 0.1F + 0.5F);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public boolean isAreaCrowded(World world, EntityPlayer player) {
|
||||||
|
int radius = 30; // Check within 30 blocks
|
||||||
|
int maxEntities = 50; // Maximum allowed nearby entities
|
||||||
|
|
||||||
|
AxisAlignedBB checkArea = AxisAlignedBB.getBoundingBox(
|
||||||
|
player.posX - radius, player.posY - radius, player.posZ - radius,
|
||||||
|
player.posX + radius, player.posY + radius, player.posZ + radius
|
||||||
|
);
|
||||||
|
|
||||||
|
List<LOTREntityNPC> nearbyNpcs = world.getEntitiesWithinAABB(LOTREntityNPC.class, checkArea);
|
||||||
|
int gundabadCount = 0;
|
||||||
|
for (LOTREntityNPC npc : nearbyNpcs) {
|
||||||
|
LOTRFaction faction = LOTRMod.getNPCFaction(npc);
|
||||||
|
if (faction == gundabad) {
|
||||||
|
gundabadCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return gundabadCount >= maxEntities;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUsingTick(ItemStack stack, EntityPlayer player, int count) {
|
||||||
|
if (player.worldObj.isRemote) return;
|
||||||
|
|
||||||
|
int ticksUsed = getMaxItemUseDuration(stack) - count;
|
||||||
|
|
||||||
|
// Avoid triggering at tick 0
|
||||||
|
if (ticksUsed > 0 && ticksUsed % 20 == 0) {
|
||||||
|
applyAllyHealing(player.worldObj, player);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ticksUsed > 0 && ticksUsed % 200 == 0) {
|
||||||
|
applyEnemyMaxHealthReduction(player.worldObj, player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void spawnRandomGundabad(World world, BlockPos location) {
|
||||||
|
Random rand = new Random();
|
||||||
|
int choice = rand.nextInt(7); // 0 to 6
|
||||||
|
|
||||||
|
EntityLiving entity;
|
||||||
|
|
||||||
|
switch (choice) {
|
||||||
|
case 0:
|
||||||
|
entity = new LOTREntityGundabadOrc(world);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
entity = new LOTREntityGundabadOrcArcher(world);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
entity = new LOTREntityGundabadWarg(world);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
entity = new LOTREntityGundabadUruk(world);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
entity = new LOTREntityGundabadUrukArcher(world);
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
entity = new LOTREntityGundabadBannerBearer(world);
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
entity = new NorthernOrc(world);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
entity = new LOTREntityGundabadOrc(world);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
entity.setPosition(location.x + 0.5, location.y, location.z + 0.5); // Center the entity on the block
|
||||||
|
entity.onSpawnWithEgg((IEntityLivingData) null);
|
||||||
|
world.spawnEntityInWorld(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void applyEnemyMaxHealthReduction(World world, EntityPlayer player) {
|
||||||
|
LOTRFaction gundabad = LOTRFaction.GUNDABAD;
|
||||||
|
|
||||||
|
List<EntityLivingBase> nearbyEntities = world.getEntitiesWithinAABB(
|
||||||
|
EntityLivingBase.class, player.boundingBox.expand(10.0D, 10.0D, 10.0D));
|
||||||
|
|
||||||
|
for (EntityLivingBase target : nearbyEntities) {
|
||||||
|
if (target == player || target instanceof EntityPlayer) continue;
|
||||||
|
|
||||||
|
if (target instanceof LOTREntityNPC) {
|
||||||
|
LOTRFaction targetFaction = LOTRMod.getNPCFaction((LOTREntityNPC) target);
|
||||||
|
if (targetFaction != null) {
|
||||||
|
LOTRFactionRelations.Relation relation = LOTRFactionRelations.getRelations(gundabad, targetFaction);
|
||||||
|
|
||||||
|
if (relation == LOTRFactionRelations.Relation.ENEMY || relation == LOTRFactionRelations.Relation.MORTAL_ENEMY) {
|
||||||
|
IAttributeInstance attribute = target.getEntityAttribute(SharedMonsterAttributes.maxHealth);
|
||||||
|
double currentMax = attribute.getAttributeValue();
|
||||||
|
double newMax = currentMax - 1.0D;
|
||||||
|
|
||||||
|
if (newMax >= 10.0D) {
|
||||||
|
AttributeModifier mod = new AttributeModifier(UUID.randomUUID(), "Ulukai Curse", -1.0D, 0);
|
||||||
|
attribute.applyModifier(mod);
|
||||||
|
|
||||||
|
// Save UUID + timestamp
|
||||||
|
NBTTagCompound data = target.getEntityData();
|
||||||
|
NBTTagList list = data.getTagList(ULUKAI_TAG, 10); // 10 = compound
|
||||||
|
|
||||||
|
NBTTagCompound entry = new NBTTagCompound();
|
||||||
|
entry.setString("UUID", mod.getID().toString());
|
||||||
|
entry.setLong("AppliedAt", player.ticksExisted); // or use world.getTotalWorldTime()
|
||||||
|
|
||||||
|
list.appendTag(entry);
|
||||||
|
data.setTag(ULUKAI_TAG, list);
|
||||||
|
System.out.println("Ulukai Curse applied to: " + target.getCommandSenderName() +
|
||||||
|
" UUID=" + mod.getID() + " Tick=" + player.ticksExisted);
|
||||||
|
|
||||||
|
world.playSoundAtEntity(player, "lotr:wraith.marshWraith_shoot", 1F,1F);
|
||||||
|
|
||||||
|
for(int l = 0; l < 16; ++l) {
|
||||||
|
LOTRMod.proxy.spawnParticle("morgulPortal",
|
||||||
|
target.posX, target.posY + 1.0D, target.posZ,
|
||||||
|
0.0D, 0.02D, 0.0D);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void applyAllyHealing(World world, EntityPlayer player) {
|
||||||
|
|
||||||
|
List<EntityLivingBase> nearbyEntities = world.getEntitiesWithinAABB(
|
||||||
|
EntityLivingBase.class, player.boundingBox.expand(10.0D, 10.0D, 10.0D));
|
||||||
|
|
||||||
|
List<EntityLivingBase> validTargets = new ArrayList<>();
|
||||||
|
|
||||||
|
for (EntityLivingBase target : nearbyEntities) {
|
||||||
|
if (target == player || target instanceof EntityPlayer) continue;
|
||||||
|
|
||||||
|
if (target instanceof LOTREntityNPC) {
|
||||||
|
LOTRFaction targetFaction = LOTRMod.getNPCFaction((LOTREntityNPC) target);
|
||||||
|
if (targetFaction == gundabad && target.getHealth() < target.getMaxHealth()) {
|
||||||
|
validTargets.add(target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Heal a random wounded ally, if any exist
|
||||||
|
if (!validTargets.isEmpty()) {
|
||||||
|
EntityLivingBase toHeal = validTargets.get(world.rand.nextInt(validTargets.size()));
|
||||||
|
toHeal.heal(1.0F); // 0.5 heart
|
||||||
|
world.playSoundAtEntity(toHeal, "mob.zombie.unfect", 0.25F,1F);
|
||||||
|
|
||||||
|
for(int l = 0; l < 8; ++l) {
|
||||||
|
LOTRMod.proxy.spawnParticle("heart",
|
||||||
|
toHeal.posX, toHeal.posY + 1.0D, toHeal.posZ,
|
||||||
|
0.0D, 0.02D, 0.0D);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// Fizzle
|
||||||
|
world.playSoundAtEntity(player, "lotr:swan.hiss", 0.1F, 0.1F + world.rand.nextFloat() * 0.5F);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void removeExpiredUlukaiModifiers(EntityLivingBase entity, long currentTick) {
|
||||||
|
IAttributeInstance attr = entity.getEntityAttribute(SharedMonsterAttributes.maxHealth);
|
||||||
|
NBTTagCompound data = entity.getEntityData();
|
||||||
|
NBTTagList oldList = data.getTagList(ULUKAI_TAG, 10); // 10 = compound tag
|
||||||
|
NBTTagList newList = new NBTTagList();
|
||||||
|
|
||||||
|
for (int i = 0; i < oldList.tagCount(); i++) {
|
||||||
|
NBTTagCompound entry = oldList.getCompoundTagAt(i);
|
||||||
|
long applied = entry.getLong("AppliedAt");
|
||||||
|
String uuidStr = entry.getString("UUID");
|
||||||
|
|
||||||
|
if (currentTick - applied >= 72000L) { // 1 hour in ticks
|
||||||
|
try {
|
||||||
|
UUID uuid = UUID.fromString(uuidStr);
|
||||||
|
AttributeModifier mod = attr.getModifier(uuid);
|
||||||
|
if (mod != null) {
|
||||||
|
attr.removeModifier(mod);
|
||||||
|
System.out.println("Ulukai Curse expired: " + entity.getCommandSenderName() +
|
||||||
|
" UUID=" + uuid + " Tick=" + currentTick);
|
||||||
|
}
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
// Invalid UUID format — skip
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
newList.appendTag(entry); // Keep active ones
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
data.setTag(ULUKAI_TAG, newList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,7 +1,6 @@
|
|||||||
package com.zivilon.cinder_loe.items;
|
package com.zivilon.cinder_loe.items.specials;
|
||||||
|
|
||||||
import lotr.common.item.LOTRItemSpear;
|
import lotr.common.item.LOTRItemSpear;
|
||||||
import lotr.common.item.LOTRItemSword;
|
|
||||||
import lotr.common.item.LOTRMaterial;
|
import lotr.common.item.LOTRMaterial;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
@ -1,27 +1,17 @@
|
|||||||
package com.zivilon.cinder_loe.items;
|
package com.zivilon.cinder_loe.items.specials;
|
||||||
|
|
||||||
import com.zivilon.cinder_loe.entity.corrupt.*;
|
import com.zivilon.cinder_loe.entity.corrupt.*;
|
||||||
import lotr.common.LOTRLevelData;
|
import lotr.common.LOTRLevelData;
|
||||||
import lotr.common.entity.npc.*;
|
import lotr.common.entity.npc.*;
|
||||||
import lotr.common.fac.LOTRFaction;
|
import lotr.common.fac.LOTRFaction;
|
||||||
import lotr.common.item.LOTRItemDagger;
|
import lotr.common.item.LOTRItemDagger;
|
||||||
import lotr.common.item.LOTRItemSword;
|
|
||||||
import lotr.common.item.LOTRMaterial;
|
import lotr.common.item.LOTRMaterial;
|
||||||
import lotr.common.item.LOTRWeaponStats;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.IEntityLivingData;
|
import net.minecraft.entity.IEntityLivingData;
|
||||||
import net.minecraft.entity.monster.EntityZombie;
|
|
||||||
import net.minecraft.entity.passive.EntityVillager;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.init.Items;
|
|
||||||
import net.minecraft.item.EnumAction;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.potion.Potion;
|
import net.minecraft.potion.Potion;
|
||||||
import net.minecraft.potion.PotionEffect;
|
import net.minecraft.potion.PotionEffect;
|
||||||
import net.minecraft.world.EnumDifficulty;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class VoidDagger extends LOTRItemDagger {
|
public class VoidDagger extends LOTRItemDagger {
|
||||||
public VoidDagger(LOTRMaterial material) {
|
public VoidDagger(LOTRMaterial material) {
|
||||||
@ -1,12 +1,10 @@
|
|||||||
package com.zivilon.cinder_loe.items;
|
package com.zivilon.cinder_loe.items.specials;
|
||||||
|
|
||||||
import com.zivilon.cinder_loe.CinderLoE;
|
import com.zivilon.cinder_loe.items.WizardStaff;
|
||||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||||
import lotr.common.LOTRLevelData;
|
import lotr.common.LOTRLevelData;
|
||||||
import lotr.common.LOTRMod;
|
import lotr.common.LOTRMod;
|
||||||
import lotr.common.fac.LOTRFaction;
|
import lotr.common.fac.LOTRFaction;
|
||||||
import lotr.common.item.LOTRItemSword;
|
|
||||||
import lotr.common.item.LOTRStoryItem;
|
|
||||||
import lotr.common.network.LOTRPacketHandler;
|
import lotr.common.network.LOTRPacketHandler;
|
||||||
import lotr.common.network.LOTRPacketWeaponFX;
|
import lotr.common.network.LOTRPacketWeaponFX;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
package com.zivilon.cinder_loe.world.event;
|
||||||
|
|
||||||
|
import com.zivilon.cinder_loe.items.specials.Ulukai;
|
||||||
|
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.DimensionManager;
|
||||||
|
|
||||||
|
public class UlukaiCurseHandler {
|
||||||
|
private int tickCounter = 0;
|
||||||
|
public static final int INTERVAL_TICKS = 72000; // 1 hour ~~10 minutes at 20 TPS~~
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onServerTick(TickEvent.ServerTickEvent event) {
|
||||||
|
if (event.phase == TickEvent.Phase.END) {
|
||||||
|
tickCounter++;
|
||||||
|
if (tickCounter >= INTERVAL_TICKS) {
|
||||||
|
tickCounter = 0;
|
||||||
|
runUlukaiCleanup();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void runUlukaiCleanup() {
|
||||||
|
for (World world : DimensionManager.getWorlds()) {
|
||||||
|
if (world == null || world.isRemote) continue;
|
||||||
|
|
||||||
|
for (Object obj : world.loadedEntityList) {
|
||||||
|
if (obj instanceof EntityLivingBase entity &&
|
||||||
|
entity.getEntityData().hasKey("UlukaiModifiers")) {
|
||||||
|
|
||||||
|
Ulukai.removeExpiredUlukaiModifiers(entity, world.getTotalWorldTime());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 858 B |
@ -0,0 +1,50 @@
|
|||||||
|
{
|
||||||
|
"animation": {
|
||||||
|
"frames": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
3,
|
||||||
|
3,
|
||||||
|
4,
|
||||||
|
4,
|
||||||
|
4,
|
||||||
|
3,
|
||||||
|
3,
|
||||||
|
3,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue