|
|
|
@ -5,14 +5,17 @@ import lotr.common.LOTRLevelData;
|
|
|
|
import lotr.common.LOTRMod;
|
|
|
|
import lotr.common.LOTRMod;
|
|
|
|
import lotr.common.entity.animal.LOTREntityHorse;
|
|
|
|
import lotr.common.entity.animal.LOTREntityHorse;
|
|
|
|
import lotr.common.fac.LOTRFaction;
|
|
|
|
import lotr.common.fac.LOTRFaction;
|
|
|
|
|
|
|
|
import lotr.common.item.LOTRItemAxe;
|
|
|
|
import lotr.common.item.LOTRItemSword;
|
|
|
|
import lotr.common.item.LOTRItemSword;
|
|
|
|
import lotr.common.item.LOTRMaterial;
|
|
|
|
import lotr.common.item.LOTRMaterial;
|
|
|
|
|
|
|
|
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;
|
|
|
|
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.ItemStack;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.server.MinecraftServer;
|
|
|
|
import net.minecraft.server.MinecraftServer;
|
|
|
|
import net.minecraft.util.DamageSource;
|
|
|
|
import net.minecraft.util.DamageSource;
|
|
|
|
@ -21,12 +24,11 @@ import net.minecraft.world.World;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
public class MouthOfSauronWeapon extends LOTRItemSword {
|
|
|
|
public class MouthOfSauronWeapon extends LOTRItemSword implements LOTRStoryItem {
|
|
|
|
|
|
|
|
|
|
|
|
public MouthOfSauronWeapon() {
|
|
|
|
public MouthOfSauronWeapon() {
|
|
|
|
super(LOTRMaterial.MORDOR);
|
|
|
|
super(LOTRMaterial.MORDOR);
|
|
|
|
this.setMaxDamage(1500);
|
|
|
|
this.setMaxDamage(1500);
|
|
|
|
this.lotrWeaponDamage = 8.0f;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public ItemStack onEaten(ItemStack itemstack, World world, EntityPlayer entityplayer) {
|
|
|
|
public ItemStack onEaten(ItemStack itemstack, World world, EntityPlayer entityplayer) {
|
|
|
|
@ -38,7 +40,7 @@ public class MouthOfSauronWeapon extends LOTRItemSword {
|
|
|
|
user.swingItem();
|
|
|
|
user.swingItem();
|
|
|
|
world.playSoundAtEntity((Entity)user, "mob.wither.hurt", 2.0f, (itemRand.nextFloat() - itemRand.nextFloat()) * 0.2f + 1.0f);
|
|
|
|
world.playSoundAtEntity((Entity)user, "mob.wither.hurt", 2.0f, (itemRand.nextFloat() - itemRand.nextFloat()) * 0.2f + 1.0f);
|
|
|
|
if (!world.isRemote) {
|
|
|
|
if (!world.isRemote) {
|
|
|
|
List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, user.boundingBox.expand(12.0, 8.0, 12.0));
|
|
|
|
List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, user.boundingBox.expand(6.0, 6.0, 6.0));
|
|
|
|
if (!entities.isEmpty()) {
|
|
|
|
if (!entities.isEmpty()) {
|
|
|
|
for (int i = 0; i < entities.size(); ++i) {
|
|
|
|
for (int i = 0; i < entities.size(); ++i) {
|
|
|
|
EntityLiving entityliving;
|
|
|
|
EntityLiving entityliving;
|
|
|
|
@ -66,4 +68,18 @@ public class MouthOfSauronWeapon extends LOTRItemSword {
|
|
|
|
return itemstack;
|
|
|
|
return itemstack;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public int getMaxItemUseDuration(ItemStack itemstack) {
|
|
|
|
|
|
|
|
return 40;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public EnumAction getItemUseAction(ItemStack itemstack) {
|
|
|
|
|
|
|
|
return EnumAction.bow;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) {
|
|
|
|
|
|
|
|
entityplayer.setItemInUse(itemstack, this.getMaxItemUseDuration(itemstack));
|
|
|
|
|
|
|
|
return itemstack;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|