aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRonald Inglett <71849533+inglettronald@users.noreply.github.com>2023-11-14 15:19:00 -0600
committerRonald Inglett <71849533+inglettronald@users.noreply.github.com>2023-11-14 15:19:00 -0600
commit7f2ca7f9217df45172d454b7e18c1acc3211282c (patch)
tree119ba424bf0e2c0208a892f987a87c6b8d4b9eae /src
parent0516a4be0c93d6a82dc23ba074a5ee6c6b8c181f (diff)
downloadDulkirMod-Fabric-7f2ca7f9217df45172d454b7e18c1acc3211282c.tar.gz
DulkirMod-Fabric-7f2ca7f9217df45172d454b7e18c1acc3211282c.tar.bz2
DulkirMod-Fabric-7f2ca7f9217df45172d454b7e18c1acc3211282c.zip
fix: garden changes + bad injection
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/dulkirfabric/mixin/render/DrawContextMixin.java2
-rw-r--r--src/main/kotlin/com/dulkirfabric/util/TablistUtils.kt13
2 files changed, 8 insertions, 7 deletions
diff --git a/src/main/java/com/dulkirfabric/mixin/render/DrawContextMixin.java b/src/main/java/com/dulkirfabric/mixin/render/DrawContextMixin.java
index 958a1bf..57756fc 100644
--- a/src/main/java/com/dulkirfabric/mixin/render/DrawContextMixin.java
+++ b/src/main/java/com/dulkirfabric/mixin/render/DrawContextMixin.java
@@ -43,7 +43,7 @@ public class DrawContextMixin {
}
@Inject(method = "drawTooltip(Lnet/minecraft/client/font/TextRenderer;Ljava/util/List;IILnet/minecraft/client/gui/tooltip/TooltipPositioner;)V",
- at = @At(target = "Lnet/minecraft/client/util/math/MatrixStack;push()V", value = "INVOKE"))
+ at = @At(target = "Lnet/minecraft/client/util/math/MatrixStack;push()V", value = "INVOKE", shift = At.Shift.AFTER))
public void onPush(TextRenderer textRenderer, List<TooltipComponent> components, int x, int y, TooltipPositioner positioner, CallbackInfo ci) {
if (MinecraftClient.getInstance().currentScreen instanceof HandledScreen) {
TooltipImpl.INSTANCE.applyScale(matrices);
diff --git a/src/main/kotlin/com/dulkirfabric/util/TablistUtils.kt b/src/main/kotlin/com/dulkirfabric/util/TablistUtils.kt
index b69f0b4..38c62a7 100644
--- a/src/main/kotlin/com/dulkirfabric/util/TablistUtils.kt
+++ b/src/main/kotlin/com/dulkirfabric/util/TablistUtils.kt
@@ -11,7 +11,6 @@ object TablistUtils {
private val areaPattern = "Area: (.+)".toRegex()
private val speedPattern = "^Speed: (.+)".toRegex()
private val visitorPattern = "Visitors: \\((.+)\\)".toRegex()
- private val nextVisitorPattern = "Next Visitor: (.+)".toRegex()
private val compostTimePattern = "Time Left: (.+)".toRegex()
data class PersistentInfo(
@@ -49,12 +48,14 @@ object TablistUtils {
}
visitorPattern.matchEntire(str)?.let { result ->
- persistentInfo.numVisitors = result.groupValues[1].toInt()
- return@forEach
- }
-
- nextVisitorPattern.matchEntire(str)?.let { result ->
persistentInfo.nextVisitorTime = result.groupValues[1]
+ var index = tablist!!.indexOf(it) + 1
+ var visitors = 0
+ while (tablist!!.get(index).displayName?.string != "") {
+ index++
+ visitors++
+ }
+ persistentInfo.numVisitors = visitors
return@forEach
}