forked from BynBang/OpenPrestige
43 lines
1.5 KiB
Java
43 lines
1.5 KiB
Java
package dev.zprestige.prestige.mixin;
|
|
|
|
import dev.zprestige.prestige.event.ExplosionEvent;
|
|
import dev.zprestige.prestige.util.HookBridge;
|
|
import net.lenni0451.classtransform.InjectionCallback;
|
|
import net.lenni0451.classtransform.annotations.CTarget;
|
|
import net.lenni0451.classtransform.annotations.CTransformer;
|
|
import net.lenni0451.classtransform.annotations.injection.CInject;
|
|
import net.minecraft.entity.Entity;
|
|
import net.minecraft.entity.damage.DamageSource;
|
|
import net.minecraft.particle.ParticleEffect;
|
|
import net.minecraft.registry.entry.RegistryEntry;
|
|
import net.minecraft.server.world.ServerWorld;
|
|
import net.minecraft.sound.SoundEvent;
|
|
import net.minecraft.world.World.ExplosionSourceType;
|
|
import net.minecraft.world.explosion.ExplosionBehavior;
|
|
|
|
@CTransformer({ServerWorld.class})
|
|
public class ServerWorldMixin {
|
|
@CInject(
|
|
method = {"createExplosion"},
|
|
target = {@CTarget("HEAD")}
|
|
)
|
|
public void postExplosionEventAtCreateExplosionHead(
|
|
Entity entity,
|
|
DamageSource damageSource,
|
|
ExplosionBehavior behavior,
|
|
double x,
|
|
double y,
|
|
double z,
|
|
float power,
|
|
boolean createFire,
|
|
ExplosionSourceType explosionSourceType,
|
|
ParticleEffect smallParticle,
|
|
ParticleEffect largeParticle,
|
|
RegistryEntry<SoundEvent> soundEvent,
|
|
InjectionCallback ci
|
|
) {
|
|
ExplosionEvent event = HookBridge.createExplosionEvent(power, x, y, z);
|
|
HookBridge.postExplosionEvent(event);
|
|
}
|
|
}
|