MinecraftMixin.java (829B)
1 package ambos.vanillafixes.mixin; 2 3 import net.minecraft.client.Minecraft; 4 import net.minecraft.client.render.EffectRenderer; 5 import org.spongepowered.asm.mixin.Mixin; 6 import org.spongepowered.asm.mixin.Shadow; 7 import org.spongepowered.asm.mixin.injection.*; 8 import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 9 10 import ambos.vanillafixes.VanillaFixes; 11 12 @Mixin(value = Minecraft.class, remap = false) 13 final class MinecraftMixin { 14 @Shadow 15 public EffectRenderer effectRenderer; 16 17 @Inject(method = "getEntityCountsInfoString", at = @At("HEAD"), require = 0, cancellable = true) 18 private void changeFormatting(CallbackInfoReturnable<String> cir) { 19 if (VanillaFixes.F3_MENU) { 20 cir.setReturnValue("Particles: " + this.effectRenderer.getNumParticlesString()); 21 } 22 } 23 }