forked from Lanfix8/SimpleHealthBar-Forge
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The water display for thirst has been completed, and the linkage can now be normal. Thank you for the help provided by @mlus-asuka Fix the issue of error reporting in a dead state. It can now be launched in version 1.20. Co-Authored-By: mlus <[email protected]>
- Loading branch information
1 parent
6379253
commit 6506448
Showing
8 changed files
with
70 additions
and
36 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
16 changes: 16 additions & 0 deletions
16
src/main/java/cn/mcxkly/classicandsimplestatusbars/mixin/ThirstBarRendererMixin.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,16 @@ | ||
package cn.mcxkly.classicandsimplestatusbars.mixin; | ||
|
||
import dev.ghen.thirst.foundation.gui.ThirstBarRenderer; | ||
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(value = ThirstBarRenderer.class,remap = false) | ||
abstract class ThirstBarRendererMixin { | ||
@Inject(method = "registerThirstOverlay", at = @At("HEAD"), cancellable = true) | ||
private static void registerThirstOverlay(CallbackInfo ci) { | ||
ci.cancel(); | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/cn/mcxkly/classicandsimplestatusbars/mixin/ThirstHUDOverlayHandlerMixin.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,22 @@ | ||
package cn.mcxkly.classicandsimplestatusbars.mixin; | ||
|
||
import dev.ghen.thirst.foundation.gui.appleskin.HUDOverlayHandler; | ||
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(value = HUDOverlayHandler.class,remap = false) | ||
public class ThirstHUDOverlayHandlerMixin { | ||
|
||
|
||
@Inject(method = "onRenderGuiOverlayPre", at = @At("HEAD"), cancellable = true) | ||
private void onRenderExhaustion(CallbackInfo ci) { | ||
ci.cancel(); | ||
} | ||
@Inject(method = "renderThirstOverlay", at = @At("HEAD"), cancellable = true) | ||
private static void onRenderGuiOverlay(CallbackInfo ci) { | ||
ci.cancel(); | ||
} | ||
} | ||
|
27 changes: 0 additions & 27 deletions
27
src/main/java/cn/mcxkly/classicandsimplestatusbars/overlays/ThirstWasTaken.java
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"required": true, | ||
"package": "cn.mcxkly.classicandsimplestatusbars.mixin", | ||
"compatibilityLevel": "JAVA_17", | ||
"refmap": "classicandsimplestatusbars.refmap.json", | ||
"mixins": [ | ||
"ThirstHUDOverlayHandlerMixin", | ||
"ThirstBarRendererMixin" | ||
], | ||
"client": [ | ||
], | ||
"minVersion": "0.8" | ||
} |