|
1 |
| -package com.ryorama.terrariamod.items.terraria.consumable.potions; |
| 1 | +package com.ryorama.terrariamod.items.terraria.consumable.food; |
2 | 2 |
|
3 | 3 | import com.ryorama.terrariamod.buffs.BuffsT;
|
4 | 4 | import com.ryorama.terrariamod.client.TAudio;
|
5 | 5 | import com.ryorama.terrariamod.items.impl.ItemT;
|
| 6 | +import com.ryorama.terrariamod.items.impl.interfaces.IFoodItem; |
6 | 7 | import net.minecraft.entity.player.PlayerEntity;
|
7 | 8 | import net.minecraft.item.ItemStack;
|
8 | 9 | import net.minecraft.util.Hand;
|
9 | 10 | import net.minecraft.util.TypedActionResult;
|
10 | 11 | import net.minecraft.world.World;
|
11 | 12 |
|
12 |
| -public class Mushroom extends ItemT { |
| 13 | +public class Mushroom extends ItemT implements IFoodItem { |
13 | 14 |
|
14 | 15 | public Mushroom(Settings settings) {
|
15 | 16 | super(settings.maxCount(64));
|
| 17 | + this.isConsumable(true); |
16 | 18 | }
|
17 | 19 |
|
18 | 20 | @Override
|
19 | 21 | public TypedActionResult<ItemStack> use(World world, PlayerEntity playerEntity, Hand hand) {
|
20 | 22 | if (!BuffsT.EntityHasBuff(playerEntity, BuffsT.POTION_SICKNESS)) {
|
21 |
| - playerEntity.playSound(TAudio.DRINK, 1, 1); |
| 23 | + playerEntity.playSound(TAudio.EAT, 1, 1); |
22 | 24 | playerEntity.heal(15);
|
23 |
| - BuffsT.AddBuffToEntity(playerEntity, 1000, BuffsT.POTION_SICKNESS); |
| 25 | + addBuffOnEaten(playerEntity, BuffsT.POTION_SICKNESS,1000); |
| 26 | + handlePlayerHunger(playerEntity, 4, 2); |
24 | 27 | return TypedActionResult.success(playerEntity.getStackInHand(hand));
|
25 | 28 | }
|
26 | 29 |
|
|
0 commit comments