forked from MeteorDevelopment/meteor-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParticleEngineMixin.java
More file actions
26 lines (22 loc) · 1.21 KB
/
Copy pathParticleEngineMixin.java
File metadata and controls
26 lines (22 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
* This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client).
* Copyright (c) Meteor Development.
*/
package meteordevelopment.meteorclient.mixin;
import meteordevelopment.meteorclient.MeteorClient;
import meteordevelopment.meteorclient.events.world.ParticleEvent;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.particle.ParticleEngine;
import net.minecraft.core.particles.ParticleOptions;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(ParticleEngine.class)
public abstract class ParticleEngineMixin {
@Inject(method = "createParticle(Lnet/minecraft/core/particles/ParticleOptions;DDDDDD)Lnet/minecraft/client/particle/Particle;", at = @At("HEAD"), cancellable = true)
private void onCreateParticle(ParticleOptions options, double x, double y, double z, double xa, double ya, double za, CallbackInfoReturnable<Particle> cir) {
ParticleEvent event = MeteorClient.EVENT_BUS.post(ParticleEvent.get(options));
if (event.isCancelled()) cir.cancel();
}
}