From 049fa7481a59f3ddd68180ec5ef1df50c320132f Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Sun, 4 Apr 2021 12:05:25 -0400 Subject: [PATCH] 1.16.220 support --- serverlist-server/pom.xml | 4 ++-- .../com/pyratron/pugmatt/bedrockconnect/BCPlayer.java | 5 ----- .../pugmatt/bedrockconnect/utils/BedrockProtocol.java | 2 ++ .../pugmatt/bedrockconnect/utils/PaletteManager.java | 11 +++++++++-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/serverlist-server/pom.xml b/serverlist-server/pom.xml index f210b690..429003f6 100644 --- a/serverlist-server/pom.xml +++ b/serverlist-server/pom.xml @@ -87,8 +87,8 @@ com.nukkitx.protocol - bedrock-v428 - 2.6.2-SNAPSHOT + bedrock-v431 + 2.7.0-SNAPSHOT compile diff --git a/serverlist-server/src/main/com/pyratron/pugmatt/bedrockconnect/BCPlayer.java b/serverlist-server/src/main/com/pyratron/pugmatt/bedrockconnect/BCPlayer.java index da6d47e6..f95182fb 100644 --- a/serverlist-server/src/main/com/pyratron/pugmatt/bedrockconnect/BCPlayer.java +++ b/serverlist-server/src/main/com/pyratron/pugmatt/bedrockconnect/BCPlayer.java @@ -263,11 +263,6 @@ public void spawn() { entityPacket.setIdentifiers(BedrockConnect.paletteManager.ENTITY_IDENTIFIERS); session.sendPacket(entityPacket); - InventoryContentPacket creativePacket = new InventoryContentPacket(); - creativePacket.setContainerId(ContainerId.CREATIVE); //TODO: Why is this deprecated? - creativePacket.setContents(BedrockConnect.paletteManager.CREATIVE_ITEMS); - session.sendPacket(creativePacket); - PlayStatusPacket playStatus = new PlayStatusPacket(); playStatus.setStatus(PlayStatusPacket.Status.PLAYER_SPAWN); session.sendPacket(playStatus); diff --git a/serverlist-server/src/main/com/pyratron/pugmatt/bedrockconnect/utils/BedrockProtocol.java b/serverlist-server/src/main/com/pyratron/pugmatt/bedrockconnect/utils/BedrockProtocol.java index f23fd9b7..e5a7b106 100644 --- a/serverlist-server/src/main/com/pyratron/pugmatt/bedrockconnect/utils/BedrockProtocol.java +++ b/serverlist-server/src/main/com/pyratron/pugmatt/bedrockconnect/utils/BedrockProtocol.java @@ -4,6 +4,7 @@ import com.nukkitx.protocol.bedrock.v419.Bedrock_v419; import com.nukkitx.protocol.bedrock.v422.Bedrock_v422; import com.nukkitx.protocol.bedrock.v428.Bedrock_v428; +import com.nukkitx.protocol.bedrock.v431.Bedrock_v431; import java.util.ArrayList; import java.util.List; @@ -29,6 +30,7 @@ public class BedrockProtocol { .minecraftVersion("1.16.200/1.16.201") .build()); SUPPORTED_BEDROCK_CODECS.add(DEFAULT_BEDROCK_CODEC); + SUPPORTED_BEDROCK_CODECS.add(Bedrock_v431.V431_CODEC); } /** diff --git a/serverlist-server/src/main/com/pyratron/pugmatt/bedrockconnect/utils/PaletteManager.java b/serverlist-server/src/main/com/pyratron/pugmatt/bedrockconnect/utils/PaletteManager.java index c7b4dfc9..1efc1fb8 100644 --- a/serverlist-server/src/main/com/pyratron/pugmatt/bedrockconnect/utils/PaletteManager.java +++ b/serverlist-server/src/main/com/pyratron/pugmatt/bedrockconnect/utils/PaletteManager.java @@ -84,12 +84,19 @@ public class PaletteManager { ByteArrayInputStream bais = new ByteArrayInputStream(bytes); try { NbtMap tag = (NbtMap) NbtUtils.createReaderLE(bais).readTag(); - creativeItems.add(ItemData.of(itemNode.get("id").asInt(), damage, 1, tag)); + creativeItems.add(ItemData.builder() + .id(itemNode.get("id").asInt()) + .damage(damage) + .count(1) + .tag(tag).build()); } catch (IOException e) { e.printStackTrace(); } } else { - creativeItems.add(ItemData.of(itemNode.get("id").asInt(), damage, 1)); + creativeItems.add(ItemData.builder() + .id(itemNode.get("id").asInt()) + .damage(damage) + .count(1).build()); } } CREATIVE_ITEMS = creativeItems;