From b8a13a757f3b91b42b46ee86fd3f78d3d585772c Mon Sep 17 00:00:00 2001 From: Patbox <39821509+Patbox@users.noreply.github.com> Date: Thu, 30 Nov 2023 23:38:30 +0100 Subject: [PATCH] Update to 1.20.3-rc1 --- gradle.properties | 4 ++-- src/main/java/eu/pb4/sidebars/api/lines/SidebarLine.java | 4 ++++ src/testmod/java/eu/pb4/sidebarstest/TestMod.java | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index c42528c..53d840f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,8 +4,8 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use -minecraft_version=1.20.3-pre2 -yarn_mappings=1.20.3-pre2+build.1 +minecraft_version=1.20.3-rc1 +yarn_mappings=1.20.3-rc1+build.1 loader_version=0.14.24 #Fabric api diff --git a/src/main/java/eu/pb4/sidebars/api/lines/SidebarLine.java b/src/main/java/eu/pb4/sidebars/api/lines/SidebarLine.java index 79d8200..013f9f2 100644 --- a/src/main/java/eu/pb4/sidebars/api/lines/SidebarLine.java +++ b/src/main/java/eu/pb4/sidebars/api/lines/SidebarLine.java @@ -74,6 +74,10 @@ static SidebarLine create(int value, Text text) { return new SimpleSidebarLine(value, text); } + static SidebarLine create(int value, Text text, NumberFormat format) { + return new SimpleSidebarLine(value, text, format); + } + /** * Quick way to create SidebarLine instance with more advanced text building * diff --git a/src/testmod/java/eu/pb4/sidebarstest/TestMod.java b/src/testmod/java/eu/pb4/sidebarstest/TestMod.java index 004fea4..3542172 100644 --- a/src/testmod/java/eu/pb4/sidebarstest/TestMod.java +++ b/src/testmod/java/eu/pb4/sidebarstest/TestMod.java @@ -9,6 +9,7 @@ import net.fabricmc.api.ModInitializer; import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; import net.minecraft.scoreboard.number.BlankNumberFormat; +import net.minecraft.scoreboard.number.FixedNumberFormat; import net.minecraft.scoreboard.number.StyledNumberFormat; import net.minecraft.server.command.ServerCommandSource; import net.minecraft.server.network.ServerPlayerEntity; @@ -135,7 +136,7 @@ private static int test3(CommandContext objectCommandContex int speed = (int) (Math.random() * 20); sidebar.setUpdateRate(speed); - sidebar.addLines(SidebarLine.create(2, Text.literal("" + speed))); + sidebar.addLines(SidebarLine.create(2, Text.literal("" + speed), new FixedNumberFormat(Text.literal("<- Speed")))); sidebar.addLines(SidebarLine.create(2, (p) -> { System.out.println(p.age);