Skip to content

Commit

Permalink
Merge pull request #179 from Camotoy/feature/1.16.220
Browse files Browse the repository at this point in the history
1.16.220 support
  • Loading branch information
Pugmatt authored Apr 6, 2021
2 parents 57474e2 + 049fa74 commit 8e0d78e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions serverlist-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@
</dependency>
<dependency>
<groupId>com.nukkitx.protocol</groupId>
<artifactId>bedrock-v428</artifactId>
<version>2.6.2-SNAPSHOT</version>
<artifactId>bedrock-v431</artifactId>
<version>2.7.0-SNAPSHOT</version>
<scope>compile</scope>
<exclusions>
<exclusion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8e0d78e

Please sign in to comment.