|
10 | 10 | import net.minecraft.client.particle.Particle; |
11 | 11 | import net.minecraft.client.particle.ParticleEngine; |
12 | 12 | import net.minecraft.core.particles.ParticleOptions; |
13 | | -import net.minecraft.core.particles.ParticleTypes; |
14 | | -import org.jetbrains.annotations.Nullable; |
15 | 13 | import org.spongepowered.asm.mixin.Mixin; |
16 | | -import org.spongepowered.asm.mixin.Shadow; |
17 | 14 | import org.spongepowered.asm.mixin.injection.At; |
18 | 15 | import org.spongepowered.asm.mixin.injection.Inject; |
19 | 16 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; |
20 | 17 |
|
21 | 18 | @Mixin(ParticleEngine.class) |
22 | 19 | public abstract class ParticleEngineMixin { |
23 | | - @Shadow |
24 | | - @Nullable |
25 | | - protected abstract <T extends ParticleOptions> Particle makeParticle(T options, double x, double y, double z, double xa, double ya, double za); |
26 | | - |
27 | 20 | @Inject(method = "createParticle(Lnet/minecraft/core/particles/ParticleOptions;DDDDDD)Lnet/minecraft/client/particle/Particle;", at = @At("HEAD"), cancellable = true) |
28 | 21 | private void onCreateParticle(ParticleOptions options, double x, double y, double z, double xa, double ya, double za, CallbackInfoReturnable<Particle> cir) { |
29 | 22 | ParticleEvent event = MeteorClient.EVENT_BUS.post(ParticleEvent.get(options)); |
30 | 23 |
|
31 | | - if (event.isCancelled()) { |
32 | | - if (options.getType() == ParticleTypes.FLASH) |
33 | | - cir.setReturnValue(makeParticle(options, x, y, z, xa, ya, za)); |
34 | | - else cir.cancel(); |
35 | | - } |
| 24 | + if (event.isCancelled()) cir.cancel(); |
36 | 25 | } |
37 | 26 | } |
0 commit comments