Skip to content

Commit

Permalink
fix listOrder was omitted
Browse files Browse the repository at this point in the history
  • Loading branch information
mdxd44 committed Nov 27, 2024
1 parent 84e1626 commit 6fbb412
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
5 changes: 2 additions & 3 deletions plugin/mappings_generator.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,11 @@ File generateData(MinecraftVersion version) {
targetDir.deleteDir()

this.javaexec() {
classpath(jarFile)
if (version >= MinecraftVersion.MINECRAFT_1_18) {
jvmArgs("-DbundlerMainClass=net.minecraft.data.Main")
setMainClass("-jar")
args(jarFile.getAbsolutePath())
setMainClass("net.minecraft.bundler.Main")
} else {
classpath(jarFile.getAbsolutePath())
setMainClass("net.minecraft.data.Main")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ public boolean handle(MinecraftSessionHandler handler) {

private static Entry createFixedEntry(UUID initialId, Entry item, ConnectedPlayer player) {
Entry fixedEntry = new Entry(initialId);
fixedEntry.setDisplayName(item.getDisplayName());
fixedEntry.setGameMode(item.getGameMode());
fixedEntry.setLatency(item.getLatency());
fixedEntry.setDisplayName(item.getDisplayName());
GameProfile profile = item.getProfile();
fixedEntry.setProfile(profile == null || !profile.getId().equals(player.getUniqueId()) ? profile : new GameProfile(initialId, profile.getName(), profile.getProperties()));
fixedEntry.setListed(item.isListed());
fixedEntry.setLatency(item.getLatency());
fixedEntry.setGameMode(item.getGameMode());
fixedEntry.setDisplayName(item.getDisplayName());
fixedEntry.setListOrder(item.getListOrder());
fixedEntry.setChatSession(item.getChatSession());
return fixedEntry;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ default TabListEntry rewriteEntry(TabListEntry entry) {
return entry;
}

TabListEntry.Builder builder = TabListEntry.builder();
builder.tabList(entry.getTabList());
builder.profile(new GameProfile(this.rewriteUuid(profileId), profile.getName(), profile.getProperties()));
builder.listed(entry.isListed());
builder.latency(entry.getLatency());
builder.gameMode(entry.getGameMode());
entry.getDisplayNameComponent().ifPresent(builder::displayName);
builder.chatSession(entry.getChatSession());
return builder.build();
return TabListEntry.builder()
.tabList(entry.getTabList())
.profile(new GameProfile(this.rewriteUuid(profileId), profile.getName(), profile.getProperties()))
.chatSession(entry.getChatSession())
.latency(entry.getLatency())
.gameMode(entry.getGameMode())
.listed(entry.isListed())
.listOrder(entry.getListOrder())
.build();
}

default UUID rewriteUuid(UUID uuid) {
Expand Down

0 comments on commit 6fbb412

Please sign in to comment.