Skip to content

Commit

Permalink
fix readItemStack 1.13-1.13.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mdxd44 committed Nov 28, 2024
1 parent d123b13 commit 7203919
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ default TabListEntry rewriteEntry(TabListEntry entry) {
.tabList(entry.getTabList())
.profile(new GameProfile(this.rewriteUuid(profileId), profile.getName(), profile.getProperties()))
.chatSession(entry.getChatSession())
.displayName(entry.getDisplayNameComponent().orElse(null))
.latency(entry.getLatency())
.gameMode(entry.getGameMode())
.listed(entry.isListed())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ private static void write17(ByteBuf out, ByteBuf data) {
}
}

// In <=1.12.2 are still block entities, while on higher versions it's just blockstates
// In <=1.12.2 flower pots are still block entities, while on higher versions it's just blockstates
public static List<VirtualBlockEntity.Entry> getAdditionalFlowerPots(ChunkSnapshot chunk) {
List<VirtualBlockEntity.Entry> flowerPots = null;
VirtualBlockEntity flowerPot = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,11 @@ public static ItemStack readItemStack(ByteBuf buf, ProtocolVersion version, bool
return buf.readBoolean()
? new ItemStack(ProtocolUtils.readVarInt(buf), buf.readByte(), LimboProtocolUtils.readCompoundTagOrNull(buf, version))
: LimboProtocolUtils.emptyItemStack(allowEmpty);
} else if (version.noLessThan(ProtocolVersion.MINECRAFT_1_13)) {
short material = buf.readShort();
return material >= 0
? new ItemStack(material, buf.readByte(), LimboProtocolUtils.readCompoundTagOrNull(buf, version))
: LimboProtocolUtils.emptyItemStack(allowEmpty);
} else {
short material = buf.readShort();
return material >= 0
Expand Down

0 comments on commit 7203919

Please sign in to comment.