Skip to content

Commit

Permalink
Update to 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
Patbox committed Jun 5, 2024
1 parent b4a1473 commit 343bcc1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
13 changes: 6 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/use

minecraft_version=1.20.5-rc2
yarn_mappings=1.20.5-rc2+build.1
loader_version=0.15.10

#Fabric api
fabric_version=0.97.3+1.20.5
minecraft_version=1.21-pre2
yarn_mappings=1.21-pre2+build.2
loader_version=0.15.11

# Fabric API
fabric_version=0.99.4+1.21

# Mod Properties
mod_version = 0.4.0+1.20.5
mod_version = 0.5.0+1.21
maven_group = eu.pb4
archives_base_name = sidebar-api

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/eu/pb4/sidebars/impl/SidebarAPIMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class SidebarAPIMod implements ModInitializer {
@Override
public void onInitialize() {
for (int x = 0; x < 15; x++) {
String fakePlayerName = String.format("$pb§%s§r", Integer.toHexString(x));
String fakePlayerName = String.format("$.%s", Integer.toHexString(x));
FAKE_PLAYER_NAMES.add(fakePlayerName);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import eu.pb4.sidebars.api.lines.SidebarLine;
import eu.pb4.sidebars.impl.SidebarHolder;
import net.minecraft.network.ClientConnection;
import net.minecraft.network.DisconnectionInfo;
import net.minecraft.network.packet.s2c.play.*;
import net.minecraft.scoreboard.ScoreboardDisplaySlot;
import net.minecraft.scoreboard.ServerScoreboard;
Expand Down Expand Up @@ -48,7 +49,7 @@ public ServerPlayNetworkHandlerMixin(MinecraftServer server, ClientConnection co
}

@Inject(method = "onDisconnected", at = @At("TAIL"))
private void sidebarApi$removeFromSidebars(Text reason, CallbackInfo ci) {
private void sidebarApi$removeFromSidebars(DisconnectionInfo info, CallbackInfo ci) {
var handler = (ServerPlayNetworkHandler) (Object) this;
for (SidebarInterface sidebar : new HashSet<>(this.sidebarApi$sidebars)) {
sidebar.disconnected(handler);
Expand Down
8 changes: 4 additions & 4 deletions src/testmod/java/eu/pb4/sidebarstest/TestMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private static int test(CommandContext<ServerCommandSource> objectCommandContext
null,
null,
null,
Math.random() > 0.6 ? new Identifier("default") : Math.random() > 0.3 ? new Identifier("uniform") : new Identifier("alt")
Math.random() > 0.6 ? Identifier.of("default") : Math.random() > 0.3 ? Identifier.of("uniform") : Identifier.of("alt")
)
), new StyledNumberFormat( StyleAccessor.invokeInit(
TextColor.fromRgb((int) (Math.random() * 0xFFFFFF)),
Expand All @@ -57,7 +57,7 @@ private static int test(CommandContext<ServerCommandSource> objectCommandContext
null,
null,
null,
Math.random() > 0.6 ? new Identifier("default") : Math.random() > 0.3 ? new Identifier("uniform") : new Identifier("alt")
Math.random() > 0.6 ? Identifier.of("default") : Math.random() > 0.3 ? Identifier.of("uniform") : Identifier.of("alt")
)));
}

Expand Down Expand Up @@ -97,7 +97,7 @@ private static int test2(CommandContext<ServerCommandSource> objectCommandContex
null,
null,
null,
Math.random() > 0.6 ? new Identifier("default") : Math.random() > 0.3 ? new Identifier("uniform") : new Identifier("alt")
Math.random() > 0.6 ? Identifier.of("default") : Math.random() > 0.3 ? Identifier.of("uniform") : Identifier.of("alt")
)
));

Expand Down Expand Up @@ -130,7 +130,7 @@ private static int test3(CommandContext<ServerCommandSource> objectCommandContex
null,
null,
null,
Math.random() > 0.6 ? new Identifier("default") : Math.random() > 0.3 ? new Identifier("uniform") : new Identifier("alt")
Math.random() > 0.6 ? Identifier.of("default") : Math.random() > 0.3 ? Identifier.of("uniform") : Identifier.of("alt")
)
));
int speed = (int) (Math.random() * 20);
Expand Down

0 comments on commit 343bcc1

Please sign in to comment.