33 lines
904 B
Java
33 lines
904 B
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*/
|
|
package net.minecraft.world.effect;
|
|
|
|
import net.minecraft.server.level.ServerLevel;
|
|
import net.minecraft.world.effect.MobEffect;
|
|
import net.minecraft.world.effect.MobEffectCategory;
|
|
import net.minecraft.world.entity.LivingEntity;
|
|
import net.minecraft.world.entity.player.Player;
|
|
|
|
class HungerMobEffect
|
|
extends MobEffect {
|
|
protected HungerMobEffect(MobEffectCategory category, int color) {
|
|
super(category, color);
|
|
}
|
|
|
|
@Override
|
|
public boolean applyEffectTick(ServerLevel serverLevel, LivingEntity mob, int amplification) {
|
|
if (mob instanceof Player) {
|
|
Player player = (Player)mob;
|
|
player.causeFoodExhaustion(0.005f * (float)(amplification + 1));
|
|
}
|
|
return true;
|
|
}
|
|
|
|
@Override
|
|
public boolean shouldApplyEffectTickThisTick(int tickCount, int amplification) {
|
|
return true;
|
|
}
|
|
}
|
|
|