35 lines
1.4 KiB
Java
35 lines
1.4 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*/
|
|
package net.minecraft.world.effect;
|
|
|
|
import net.minecraft.core.particles.ParticleTypes;
|
|
import net.minecraft.server.level.ServerLevel;
|
|
import net.minecraft.sounds.SoundEvents;
|
|
import net.minecraft.util.random.WeightedList;
|
|
import net.minecraft.world.effect.MobEffect;
|
|
import net.minecraft.world.effect.MobEffectCategory;
|
|
import net.minecraft.world.entity.Entity;
|
|
import net.minecraft.world.entity.LivingEntity;
|
|
import net.minecraft.world.entity.projectile.windcharge.AbstractWindCharge;
|
|
import net.minecraft.world.level.Level;
|
|
|
|
class WindChargedMobEffect
|
|
extends MobEffect {
|
|
protected WindChargedMobEffect(MobEffectCategory category, int color) {
|
|
super(category, color, ParticleTypes.SMALL_GUST);
|
|
}
|
|
|
|
@Override
|
|
public void onMobRemoved(ServerLevel level, LivingEntity mob, int amplifier, Entity.RemovalReason reason) {
|
|
if (reason == Entity.RemovalReason.KILLED) {
|
|
double x = mob.getX();
|
|
double y = mob.getY() + (double)(mob.getBbHeight() / 2.0f);
|
|
double z = mob.getZ();
|
|
float gustStrength = 3.0f + mob.getRandom().nextFloat() * 2.0f;
|
|
level.explode(mob, null, AbstractWindCharge.EXPLOSION_DAMAGE_CALCULATOR, x, y, z, gustStrength, false, Level.ExplosionInteraction.TRIGGER, ParticleTypes.GUST_EMITTER_SMALL, ParticleTypes.GUST_EMITTER_LARGE, WeightedList.of(), SoundEvents.BREEZE_WIND_CHARGE_BURST);
|
|
}
|
|
}
|
|
}
|
|
|