mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-28 23:48:00 +01:00
30 lines
922 B
Java
30 lines
922 B
Java
package com.minelittlepony.unicopia.item;
|
|
|
|
import net.minecraft.entity.LivingEntity;
|
|
import net.minecraft.entity.effect.StatusEffects;
|
|
import net.minecraft.item.FoodComponent;
|
|
import net.minecraft.item.Item;
|
|
import net.minecraft.item.ItemGroup;
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraft.world.World;
|
|
|
|
public class TomatoItem extends Item {
|
|
|
|
public TomatoItem(int hunger, float saturation) {
|
|
super(new Settings()
|
|
.group(ItemGroup.FOOD)
|
|
.food(new FoodComponent.Builder()
|
|
.hunger(hunger)
|
|
.saturationModifier(saturation)
|
|
.build())
|
|
);
|
|
}
|
|
|
|
@Override
|
|
public ItemStack finishUsing(ItemStack stack, World world, LivingEntity entity) {
|
|
stack = super.finishUsing(stack, world, entity);
|
|
entity.removePotionEffect(StatusEffects.NAUSEA);
|
|
return stack;
|
|
}
|
|
|
|
}
|