This repository has been archived by the owner on Sep 15, 2024. It is now read-only.
generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a58d64
commit 2a11dee
Showing
5 changed files
with
67 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/main/java/dev/microcontrollers/overlaytweaks/mixin/TotemParticleMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package dev.microcontrollers.overlaytweaks.mixin; | ||
|
||
import dev.microcontrollers.overlaytweaks.config.OverlayTweaksConfig; | ||
import net.minecraft.client.particle.AnimatedParticle; | ||
import net.minecraft.client.particle.SpriteProvider; | ||
import net.minecraft.client.particle.TotemParticle; | ||
import net.minecraft.client.world.ClientWorld; | ||
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.CallbackInfo; | ||
|
||
@Mixin(TotemParticle.class) | ||
public class TotemParticleMixin extends AnimatedParticle { | ||
protected TotemParticleMixin(ClientWorld world, double x, double y, double z, SpriteProvider spriteProvider, float upwardsAcceleration) { | ||
super(world, x, y, z, spriteProvider, upwardsAcceleration); | ||
} | ||
|
||
@Inject(method = "<init>(Lnet/minecraft/client/world/ClientWorld;DDDDDDLnet/minecraft/client/particle/SpriteProvider;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/particle/TotemParticle;setSpriteForAge(Lnet/minecraft/client/particle/SpriteProvider;)V")) | ||
private void removeTotemParticleAge(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider, CallbackInfo ci) { | ||
if (OverlayTweaksConfig.CONFIG.instance().disableTotemParticles) this.scale = 0; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters