Skip to content

Commit

Permalink
Update to 1.20.3-rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
Patbox committed Nov 30, 2023
1 parent fde966c commit b8a13a7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/eu/pb4/sidebars/api/lines/SidebarLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
3 changes: 2 additions & 1 deletion src/testmod/java/eu/pb4/sidebarstest/TestMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -135,7 +136,7 @@ private static int test3(CommandContext<ServerCommandSource> 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);
Expand Down

0 comments on commit b8a13a7

Please sign in to comment.