-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
f3 text only shows when debug boxes are enabled and will show how many of the wakes are renderer
- Loading branch information
Showing
6 changed files
with
64 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.goby56.wakes.mixin; | ||
|
||
import com.goby56.wakes.WakesClient; | ||
import com.goby56.wakes.render.WakeTextureRenderer; | ||
import com.goby56.wakes.simulation.WakeHandler; | ||
import net.fabricmc.fabric.api.renderer.v1.RendererAccess; | ||
import net.minecraft.client.gui.hud.DebugHud; | ||
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; | ||
|
||
import java.util.List; | ||
|
||
@Mixin(DebugHud.class) | ||
public class DebugHudMixin { | ||
|
||
@Inject(at = @At("RETURN"), method = "getLeftText") | ||
protected void getLeftText(CallbackInfoReturnable<List<String>> info) { | ||
if (WakesClient.CONFIG_INSTANCE.drawDebugBoxes) { | ||
info.getReturnValue().add(String.format("[Wakes] Rendering %d/%d wake nodes", WakeTextureRenderer.nodesRendered, WakeHandler.getInstance().getTotal())); | ||
} | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
{ | ||
"required": true, | ||
"package": "com.goby56.wakes.mixin", | ||
"compatibilityLevel": "JAVA_17", | ||
"client": [ | ||
"WakeSpawnerMixin" | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
"required": true, | ||
"package": "com.goby56.wakes.mixin", | ||
"compatibilityLevel": "JAVA_17", | ||
"client": [ | ||
"DebugHudMixin", | ||
"WakeSpawnerMixin" | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
} | ||
} |