You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.5 KiB
Java
44 lines
1.5 KiB
Java
package com.zivilon.cinder_loe.items;
|
|
|
|
import com.zivilon.cinder_loe.CinderLoE;
|
|
import lotr.common.LOTRAchievement;
|
|
import lotr.common.LOTRCreativeTabs;
|
|
import lotr.common.LOTRLevelData;
|
|
import lotr.common.LOTRMod;
|
|
import lotr.common.item.LOTRItemFood;
|
|
import lotr.common.item.LOTRItemSword;
|
|
import lotr.common.item.LOTRMaterial;
|
|
import lotr.common.item.LOTRWeaponStats;
|
|
import net.minecraft.entity.Entity;
|
|
import net.minecraft.entity.EntityLivingBase;
|
|
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.ItemFood;
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraft.util.DamageSource;
|
|
import net.minecraft.world.World;
|
|
|
|
public class CinderItemFood extends LOTRItemFood {
|
|
|
|
private int damageAmount;
|
|
public CinderItemFood(int healAmount, float saturation, boolean canWolfEat) {
|
|
super(healAmount, saturation, canWolfEat);
|
|
}
|
|
|
|
public CinderItemFood setdamageAmount(int i) {
|
|
this.damageAmount = i;
|
|
return this;
|
|
}
|
|
@Override
|
|
public ItemStack onEaten(ItemStack itemstack, World world, EntityPlayer entityplayer) {
|
|
if (!world.isRemote && this == LOTRMod.maggotyBread) {
|
|
LOTRLevelData.getData(entityplayer).addAchievement(LOTRAchievement.eatMaggotyBread);
|
|
}
|
|
if (this.damageAmount > 0) {
|
|
entityplayer.attackEntityFrom(DamageSource.onFire, (float)this.damageAmount);
|
|
}
|
|
return super.onEaten(itemstack, world, entityplayer);
|
|
}
|
|
} |