/* * Decompiled with CFR 0.152. */ package net.minecraft.world.item.component; import java.util.List; import net.minecraft.sounds.SoundEvents; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.effect.MobEffects; import net.minecraft.world.item.ItemUseAnimation; import net.minecraft.world.item.component.Consumable; import net.minecraft.world.item.consume_effects.ApplyStatusEffectsConsumeEffect; import net.minecraft.world.item.consume_effects.ClearAllStatusEffectsConsumeEffect; import net.minecraft.world.item.consume_effects.RemoveStatusEffectsConsumeEffect; import net.minecraft.world.item.consume_effects.TeleportRandomlyConsumeEffect; public class Consumables { public static final Consumable DEFAULT_FOOD = Consumables.defaultFood().build(); public static final Consumable DEFAULT_DRINK = Consumables.defaultDrink().build(); public static final Consumable HONEY_BOTTLE = Consumables.defaultDrink().consumeSeconds(2.0f).sound(SoundEvents.HONEY_DRINK).onConsume(new RemoveStatusEffectsConsumeEffect(MobEffects.POISON)).build(); public static final Consumable OMINOUS_BOTTLE = Consumables.defaultDrink().soundAfterConsume(SoundEvents.OMINOUS_BOTTLE_DISPOSE).build(); public static final Consumable DRIED_KELP = Consumables.defaultFood().consumeSeconds(0.8f).build(); public static final Consumable CHICKEN = Consumables.defaultFood().onConsume(new ApplyStatusEffectsConsumeEffect(new MobEffectInstance(MobEffects.HUNGER, 600, 0), 0.3f)).build(); public static final Consumable ENCHANTED_GOLDEN_APPLE = Consumables.defaultFood().onConsume(new ApplyStatusEffectsConsumeEffect(List.of(new MobEffectInstance(MobEffects.REGENERATION, 400, 1), new MobEffectInstance(MobEffects.RESISTANCE, 6000, 0), new MobEffectInstance(MobEffects.FIRE_RESISTANCE, 6000, 0), new MobEffectInstance(MobEffects.ABSORPTION, 2400, 3)))).build(); public static final Consumable GOLDEN_APPLE = Consumables.defaultFood().onConsume(new ApplyStatusEffectsConsumeEffect(List.of(new MobEffectInstance(MobEffects.REGENERATION, 100, 1), new MobEffectInstance(MobEffects.ABSORPTION, 2400, 0)))).build(); public static final Consumable POISONOUS_POTATO = Consumables.defaultFood().onConsume(new ApplyStatusEffectsConsumeEffect(new MobEffectInstance(MobEffects.POISON, 100, 0), 0.6f)).build(); public static final Consumable PUFFERFISH = Consumables.defaultFood().onConsume(new ApplyStatusEffectsConsumeEffect(List.of(new MobEffectInstance(MobEffects.POISON, 1200, 1), new MobEffectInstance(MobEffects.HUNGER, 300, 2), new MobEffectInstance(MobEffects.NAUSEA, 300, 0)))).build(); public static final Consumable ROTTEN_FLESH = Consumables.defaultFood().onConsume(new ApplyStatusEffectsConsumeEffect(new MobEffectInstance(MobEffects.HUNGER, 600, 0), 0.8f)).build(); public static final Consumable SPIDER_EYE = Consumables.defaultFood().onConsume(new ApplyStatusEffectsConsumeEffect(new MobEffectInstance(MobEffects.POISON, 100, 0))).build(); public static final Consumable MILK_BUCKET = Consumables.defaultDrink().onConsume(ClearAllStatusEffectsConsumeEffect.INSTANCE).build(); public static final Consumable CHORUS_FRUIT = Consumables.defaultFood().onConsume(new TeleportRandomlyConsumeEffect()).build(); public static Consumable.Builder defaultFood() { return Consumable.builder().consumeSeconds(1.6f).animation(ItemUseAnimation.EAT).sound(SoundEvents.GENERIC_EAT).hasConsumeParticles(true); } public static Consumable.Builder defaultDrink() { return Consumable.builder().consumeSeconds(1.6f).animation(ItemUseAnimation.DRINK).sound(SoundEvents.GENERIC_DRINK).hasConsumeParticles(false); } }