Update to Bedrock 1.16.100 (#1552)

* Initial work on 1.16.100 - currently crashes the client

* Update runtime item states

* Use new Bedrock runtime IDs

Bedrock now hardcodes block runtime IDs in alphabetical order of the identifiers. This commit updates Geyser to accomodate.

- Remove runtime_block_states.dat and replace it with blockpalette.nbt
- Calculate the block runtime ID based on the order of the block palette
- Separate BlockTranslator.AIR into Bedrock and Java values
- Update the second layer of chunks to use air when not waterlogged
- Don't send item palette for now, as that's what crashes the game (will look into for v415)
- Other misc. changes

* Improve second layer chunk translation

* v415 support

- Add a message warning people they are on a beta version of Geyser

* Update to protocol v417

There are still some mappings changes that need to be gone through.

* Update runtime item states and clean up item frames

* Future-proof enchanment table

* Update for v418

* Update to v419

* Apply proper air ID to waterlogged chunk layer

* Fix missing import

* Remove beta warning

* Update mappings

* Manually patch runtime_item_states and send the ITEMS registry

* Update README

* Disable grindstone and smithing inventories (since they're broken)

* Use artifactory jenkins plugin (#1548)

* Use artifactory jenkins plugin

* Bump version to 1.2.0-SNAPSHOT

Co-authored-by: SupremeMortal <6178101+SupremeMortal@users.noreply.github.com>
This commit is contained in:
Camotoy 2020-11-17 12:03:12 -05:00 committed by GitHub
parent 512f8cd6c2
commit 123b074cc7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 5019 additions and 5466 deletions

23
Jenkinsfile vendored
View file

@ -24,8 +24,29 @@ pipeline {
when { when {
branch "master" branch "master"
} }
steps { steps {
sh 'mvn javadoc:jar source:jar deploy -DskipTests' rtMavenDeployer(
id: "maven-deployer",
serverId: "opencollab-artifactory",
releaseRepo: "maven-releases",
snapshotRepo: "maven-snapshots"
)
rtMavenResolver(
id: "maven-resolver",
serverId: "opencollab-artifactory",
releaseRepo: "release",
snapshotRepo: "snapshot"
)
rtMavenRun(
pom: 'pom.xml',
goals: 'javadoc:jar source:jar install -DskipTests',
deployerId: "maven-deployer",
resolverId: "maven-resolver"
)
rtPublishBuildInfo(
serverId: "opencollab-artifactory"
)
} }
} }
} }

View file

@ -18,7 +18,7 @@ The ultimate goal of this project is to allow Minecraft: Bedrock Edition users t
Special thanks to the DragonProxy project for being a trailblazer in protocol translation and for all the team members who have now joined us here! Special thanks to the DragonProxy project for being a trailblazer in protocol translation and for all the team members who have now joined us here!
### Currently supporting Minecraft Bedrock v1.16.x and Minecraft Java v1.16.4. ### Currently supporting Minecraft Bedrock v1.16.100 and Minecraft Java v1.16.4.
## Setting Up ## Setting Up
Take a look [here](https://github.com/GeyserMC/Geyser/wiki#Setup) for how to set up Geyser. Take a look [here](https://github.com/GeyserMC/Geyser/wiki#Setup) for how to set up Geyser.

View file

@ -6,15 +6,15 @@
<parent> <parent>
<groupId>org.geysermc</groupId> <groupId>org.geysermc</groupId>
<artifactId>bootstrap-parent</artifactId> <artifactId>bootstrap-parent</artifactId>
<version>1.1.0</version> <version>1.2.0-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent> </parent>
<artifactId>bootstrap-bungeecord</artifactId> <artifactId>bootstrap-bungeecord</artifactId>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.geysermc</groupId> <groupId>org.geysermc</groupId>
<artifactId>connector</artifactId> <artifactId>connector</artifactId>
<version>1.1.0</version> <version>1.2.0-SNAPSHOT</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>

View file

@ -6,12 +6,11 @@
<parent> <parent>
<groupId>org.geysermc</groupId> <groupId>org.geysermc</groupId>
<artifactId>geyser-parent</artifactId> <artifactId>geyser-parent</artifactId>
<version>parent</version> <version>1.2.0-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent> </parent>
<artifactId>bootstrap-parent</artifactId> <artifactId>bootstrap-parent</artifactId>
<version>1.1.0</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<repositories> <repositories>
<repository> <repository>
<id>spigot-public</id> <id>spigot-public</id>

View file

@ -6,15 +6,15 @@
<parent> <parent>
<groupId>org.geysermc</groupId> <groupId>org.geysermc</groupId>
<artifactId>bootstrap-parent</artifactId> <artifactId>bootstrap-parent</artifactId>
<version>1.1.0</version> <version>1.2.0-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent> </parent>
<artifactId>bootstrap-spigot</artifactId> <artifactId>bootstrap-spigot</artifactId>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.geysermc</groupId> <groupId>org.geysermc</groupId>
<artifactId>connector</artifactId> <artifactId>connector</artifactId>
<version>1.1.0</version> <version>1.2.0-SNAPSHOT</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>

View file

@ -119,7 +119,7 @@ public class GeyserSpigotWorldManager extends GeyserWorldManager {
if ((this.isLegacy && !this.isViaVersion) if ((this.isLegacy && !this.isViaVersion)
|| session.getPlayerEntity() == null || session.getPlayerEntity() == null
|| (bukkitPlayer = Bukkit.getPlayer(session.getPlayerEntity().getUsername())) == null) { || (bukkitPlayer = Bukkit.getPlayer(session.getPlayerEntity().getUsername())) == null) {
return BlockTranslator.AIR; return BlockTranslator.JAVA_AIR_ID;
} }
World world = bukkitPlayer.getWorld(); World world = bukkitPlayer.getWorld();
if (isLegacy) { if (isLegacy) {
@ -136,7 +136,7 @@ public class GeyserSpigotWorldManager extends GeyserWorldManager {
BlockStorage storage = Via.getManager().getConnection(bukkitPlayer.getUniqueId()).get(BlockStorage.class); BlockStorage storage = Via.getManager().getConnection(bukkitPlayer.getUniqueId()).get(BlockStorage.class);
return getLegacyBlock(storage, bukkitPlayer.getWorld(), x, y, z); return getLegacyBlock(storage, bukkitPlayer.getWorld(), x, y, z);
} else { } else {
return BlockTranslator.AIR; return BlockTranslator.JAVA_AIR_ID;
} }
} }
@ -190,7 +190,7 @@ public class GeyserSpigotWorldManager extends GeyserWorldManager {
for (int blockZ = 0; blockZ < 16; blockZ++) { for (int blockZ = 0; blockZ < 16; blockZ++) {
for (int blockX = 0; blockX < 16; blockX++) { for (int blockX = 0; blockX < 16; blockX++) {
Block block = world.getBlockAt((x << 4) + blockX, (y << 4) + blockY, (z << 4) + blockZ); Block block = world.getBlockAt((x << 4) + blockX, (y << 4) + blockY, (z << 4) + blockZ);
int id = BlockTranslator.getJavaIdBlockMap().getOrDefault(block.getBlockData().getAsString(), BlockTranslator.AIR); int id = BlockTranslator.getJavaIdBlockMap().getOrDefault(block.getBlockData().getAsString(), BlockTranslator.JAVA_AIR_ID);
chunk.set(blockX, blockY, blockZ, id); chunk.set(blockX, blockY, blockZ, id);
} }
} }

View file

@ -6,15 +6,15 @@
<parent> <parent>
<groupId>org.geysermc</groupId> <groupId>org.geysermc</groupId>
<artifactId>bootstrap-parent</artifactId> <artifactId>bootstrap-parent</artifactId>
<version>1.1.0</version> <version>1.2.0-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent> </parent>
<artifactId>bootstrap-sponge</artifactId> <artifactId>bootstrap-sponge</artifactId>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.geysermc</groupId> <groupId>org.geysermc</groupId>
<artifactId>connector</artifactId> <artifactId>connector</artifactId>
<version>1.1.0</version> <version>1.2.0-SNAPSHOT</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>

View file

@ -6,15 +6,15 @@
<parent> <parent>
<groupId>org.geysermc</groupId> <groupId>org.geysermc</groupId>
<artifactId>bootstrap-parent</artifactId> <artifactId>bootstrap-parent</artifactId>
<version>1.1.0</version> <version>1.2.0-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent> </parent>
<artifactId>bootstrap-standalone</artifactId> <artifactId>bootstrap-standalone</artifactId>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.geysermc</groupId> <groupId>org.geysermc</groupId>
<artifactId>connector</artifactId> <artifactId>connector</artifactId>
<version>1.1.0</version> <version>1.2.0-SNAPSHOT</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>

View file

@ -6,15 +6,15 @@
<parent> <parent>
<groupId>org.geysermc</groupId> <groupId>org.geysermc</groupId>
<artifactId>bootstrap-parent</artifactId> <artifactId>bootstrap-parent</artifactId>
<version>1.1.0</version> <version>1.2.0-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent> </parent>
<artifactId>bootstrap-velocity</artifactId> <artifactId>bootstrap-velocity</artifactId>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.geysermc</groupId> <groupId>org.geysermc</groupId>
<artifactId>connector</artifactId> <artifactId>connector</artifactId>
<version>1.1.0</version> <version>1.2.0-SNAPSHOT</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>

View file

@ -6,11 +6,10 @@
<parent> <parent>
<groupId>org.geysermc</groupId> <groupId>org.geysermc</groupId>
<artifactId>geyser-parent</artifactId> <artifactId>geyser-parent</artifactId>
<version>parent</version> <version>1.2.0-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent> </parent>
<artifactId>common</artifactId> <artifactId>common</artifactId>
<version>1.1.0</version>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.google.code.gson</groupId> <groupId>com.google.code.gson</groupId>

View file

@ -6,16 +6,15 @@
<parent> <parent>
<groupId>org.geysermc</groupId> <groupId>org.geysermc</groupId>
<artifactId>geyser-parent</artifactId> <artifactId>geyser-parent</artifactId>
<version>parent</version> <version>1.2.0-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent> </parent>
<artifactId>connector</artifactId> <artifactId>connector</artifactId>
<version>1.1.0</version>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.geysermc</groupId> <groupId>org.geysermc</groupId>
<artifactId>common</artifactId> <artifactId>common</artifactId>
<version>1.1.0</version> <version>1.2.0-SNAPSHOT</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -32,8 +31,8 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.github.CloudburstMC.Protocol</groupId> <groupId>com.github.CloudburstMC.Protocol</groupId>
<artifactId>bedrock-v408</artifactId> <artifactId>bedrock-v419</artifactId>
<version>02f46a8700</version> <version>ce59d39118</version>
<scope>compile</scope> <scope>compile</scope>
<exclusions> <exclusions>
<exclusion> <exclusion>

View file

@ -69,7 +69,6 @@ public class ItemFrameEntity extends Entity {
public ItemFrameEntity(long entityId, long geyserId, EntityType entityType, Vector3f position, Vector3f motion, Vector3f rotation, HangingDirection direction) { public ItemFrameEntity(long entityId, long geyserId, EntityType entityType, Vector3f position, Vector3f motion, Vector3f rotation, HangingDirection direction) {
super(entityId, geyserId, entityType, position, motion, rotation); super(entityId, geyserId, entityType, position, motion, rotation);
NbtMapBuilder builder = NbtMap.builder();
NbtMapBuilder blockBuilder = NbtMap.builder() NbtMapBuilder blockBuilder = NbtMap.builder()
.putString("name", "minecraft:frame") .putString("name", "minecraft:frame")
.putInt("version", BlockTranslator.getBlockStateVersion()); .putInt("version", BlockTranslator.getBlockStateVersion());
@ -77,9 +76,7 @@ public class ItemFrameEntity extends Entity {
.putInt("facing_direction", direction.ordinal()) .putInt("facing_direction", direction.ordinal())
.putByte("item_frame_map_bit", (byte) 0) .putByte("item_frame_map_bit", (byte) 0)
.build()); .build());
builder.put("block", blockBuilder.build()); bedrockRuntimeId = BlockTranslator.getItemFrame(blockBuilder.build());
builder.putShort("id", (short) 199);
bedrockRuntimeId = BlockTranslator.getItemFrame(builder.build());
bedrockPosition = Vector3i.from(position.getFloorX(), position.getFloorY(), position.getFloorZ()); bedrockPosition = Vector3i.from(position.getFloorX(), position.getFloorY(), position.getFloorZ());
} }
@ -101,7 +98,7 @@ public class ItemFrameEntity extends Entity {
ItemEntry itemEntry = ItemRegistry.getItem((ItemStack) entityMetadata.getValue()); ItemEntry itemEntry = ItemRegistry.getItem((ItemStack) entityMetadata.getValue());
NbtMapBuilder builder = NbtMap.builder(); NbtMapBuilder builder = NbtMap.builder();
String blockName = ItemRegistry.getBedrockIdentifer(itemEntry); String blockName = ItemRegistry.getBedrockIdentifier(itemEntry);
builder.putByte("Count", (byte) itemData.getCount()); builder.putByte("Count", (byte) itemData.getCount());
if (itemData.getTag() != null) { if (itemData.getTag() != null) {
@ -141,8 +138,7 @@ public class ItemFrameEntity extends Entity {
UpdateBlockPacket updateBlockPacket = new UpdateBlockPacket(); UpdateBlockPacket updateBlockPacket = new UpdateBlockPacket();
updateBlockPacket.setDataLayer(0); updateBlockPacket.setDataLayer(0);
updateBlockPacket.setBlockPosition(bedrockPosition); updateBlockPacket.setBlockPosition(bedrockPosition);
// TODO 1.16.100 set to BEDROCK_AIR updateBlockPacket.setRuntimeId(BlockTranslator.BEDROCK_AIR_ID);
updateBlockPacket.setRuntimeId(0);
updateBlockPacket.getFlags().add(UpdateBlockPacket.Flag.PRIORITY); updateBlockPacket.getFlags().add(UpdateBlockPacket.Flag.PRIORITY);
updateBlockPacket.getFlags().add(UpdateBlockPacket.Flag.NETWORK); updateBlockPacket.getFlags().add(UpdateBlockPacket.Flag.NETWORK);
updateBlockPacket.getFlags().add(UpdateBlockPacket.Flag.NEIGHBORS); updateBlockPacket.getFlags().add(UpdateBlockPacket.Flag.NEIGHBORS);

View file

@ -26,8 +26,7 @@
package org.geysermc.connector.network; package org.geysermc.connector.network;
import com.nukkitx.protocol.bedrock.BedrockPacketCodec; import com.nukkitx.protocol.bedrock.BedrockPacketCodec;
import com.nukkitx.protocol.bedrock.v407.Bedrock_v407; import com.nukkitx.protocol.bedrock.v419.Bedrock_v419;
import com.nukkitx.protocol.bedrock.v408.Bedrock_v408;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -40,14 +39,13 @@ public class BedrockProtocol {
* Default Bedrock codec that should act as a fallback. Should represent the latest available * Default Bedrock codec that should act as a fallback. Should represent the latest available
* release of the game that Geyser supports. * release of the game that Geyser supports.
*/ */
public static final BedrockPacketCodec DEFAULT_BEDROCK_CODEC = Bedrock_v408.V408_CODEC; public static final BedrockPacketCodec DEFAULT_BEDROCK_CODEC = Bedrock_v419.V419_CODEC;
/** /**
* A list of all supported Bedrock versions that can join Geyser * A list of all supported Bedrock versions that can join Geyser
*/ */
public static final List<BedrockPacketCodec> SUPPORTED_BEDROCK_CODECS = new ArrayList<>(); public static final List<BedrockPacketCodec> SUPPORTED_BEDROCK_CODECS = new ArrayList<>();
static { static {
SUPPORTED_BEDROCK_CODECS.add(Bedrock_v407.V407_CODEC);
SUPPORTED_BEDROCK_CODECS.add(DEFAULT_BEDROCK_CODEC); SUPPORTED_BEDROCK_CODECS.add(DEFAULT_BEDROCK_CODEC);
} }

View file

@ -75,7 +75,6 @@ import org.geysermc.connector.network.translators.EntityIdentifierRegistry;
import org.geysermc.connector.network.translators.PacketTranslatorRegistry; import org.geysermc.connector.network.translators.PacketTranslatorRegistry;
import org.geysermc.connector.network.translators.inventory.EnchantmentInventoryTranslator; import org.geysermc.connector.network.translators.inventory.EnchantmentInventoryTranslator;
import org.geysermc.connector.network.translators.item.ItemRegistry; import org.geysermc.connector.network.translators.item.ItemRegistry;
import org.geysermc.connector.network.translators.world.block.BlockTranslator;
import org.geysermc.connector.utils.*; import org.geysermc.connector.utils.*;
import org.geysermc.floodgate.util.BedrockData; import org.geysermc.floodgate.util.BedrockData;
import org.geysermc.floodgate.util.EncryptionUtil; import org.geysermc.floodgate.util.EncryptionUtil;
@ -674,7 +673,6 @@ public class GeyserSession implements CommandSender {
// startGamePacket.setCurrentTick(0); // startGamePacket.setCurrentTick(0);
startGamePacket.setEnchantmentSeed(0); startGamePacket.setEnchantmentSeed(0);
startGamePacket.setMultiplayerCorrelationId(""); startGamePacket.setMultiplayerCorrelationId("");
startGamePacket.setBlockPalette(BlockTranslator.BLOCKS);
startGamePacket.setItemEntries(ItemRegistry.ITEMS); startGamePacket.setItemEntries(ItemRegistry.ITEMS);
startGamePacket.setVanillaVersion("*"); startGamePacket.setVanillaVersion("*");
startGamePacket.setAuthoritativeMovementMode(AuthoritativeMovementMode.CLIENT); startGamePacket.setAuthoritativeMovementMode(AuthoritativeMovementMode.CLIENT);

View file

@ -94,12 +94,12 @@ public class ChunkCache {
public int getBlockAt(int x, int y, int z) { public int getBlockAt(int x, int y, int z) {
if (!cache) { if (!cache) {
return BlockTranslator.AIR; return BlockTranslator.JAVA_AIR_ID;
} }
Column column = this.getChunk(x >> 4, z >> 4); Column column = this.getChunk(x >> 4, z >> 4);
if (column == null) { if (column == null) {
return BlockTranslator.AIR; return BlockTranslator.JAVA_AIR_ID;
} }
Chunk chunk = column.getChunks()[y >> 4]; Chunk chunk = column.getChunks()[y >> 4];
@ -107,7 +107,7 @@ public class ChunkCache {
return chunk.get(x & 0xF, y & 0xF, z & 0xF); return chunk.get(x & 0xF, y & 0xF, z & 0xF);
} }
return BlockTranslator.AIR; return BlockTranslator.JAVA_AIR_ID;
} }
public void removeChunk(int chunkX, int chunkZ) { public void removeChunk(int chunkX, int chunkZ) {

View file

@ -42,7 +42,7 @@ public class BedrockBlockPickRequestTranslator extends PacketTranslator<BlockPic
int blockToPick = session.getConnector().getWorldManager().getBlockAt(session, vector.getX(), vector.getY(), vector.getZ()); int blockToPick = session.getConnector().getWorldManager().getBlockAt(session, vector.getX(), vector.getY(), vector.getZ());
// Block is air - chunk caching is probably off // Block is air - chunk caching is probably off
if (blockToPick == 0) { if (blockToPick == BlockTranslator.JAVA_AIR_ID) {
return; return;
} }

View file

@ -117,13 +117,13 @@ public class BedrockInventoryTransactionTranslator extends PacketTranslator<Inve
false); false);
session.sendDownstreamPacket(blockPacket); session.sendDownstreamPacket(blockPacket);
// Otherwise boats will not be able to be placed in survival and buckets wont work on mobile // Otherwise boats will not be able to be placed in survival and buckets won't work on mobile
if (packet.getItemInHand() != null && packet.getItemInHand().getId() == ItemRegistry.BOAT.getBedrockId()) { if (packet.getItemInHand() != null && ItemRegistry.BOATS.contains(packet.getItemInHand().getId())) {
ClientPlayerUseItemPacket itemPacket = new ClientPlayerUseItemPacket(Hand.MAIN_HAND); ClientPlayerUseItemPacket itemPacket = new ClientPlayerUseItemPacket(Hand.MAIN_HAND);
session.sendDownstreamPacket(itemPacket); session.sendDownstreamPacket(itemPacket);
} }
// Check actions, otherwise buckets may be activated when block inventories are accessed // Check actions, otherwise buckets may be activated when block inventories are accessed
else if (packet.getItemInHand() != null && packet.getItemInHand().getId() == ItemRegistry.BUCKET.getBedrockId()) { else if (packet.getItemInHand() != null && ItemRegistry.BUCKETS.contains(packet.getItemInHand().getId())) {
// Let the server decide if the bucket item should change, not the client, and revert the changes the client made // Let the server decide if the bucket item should change, not the client, and revert the changes the client made
InventorySlotPacket slotPacket = new InventorySlotPacket(); InventorySlotPacket slotPacket = new InventorySlotPacket();
slotPacket.setContainerId(ContainerId.INVENTORY); slotPacket.setContainerId(ContainerId.INVENTORY);
@ -172,8 +172,8 @@ public class BedrockInventoryTransactionTranslator extends PacketTranslator<Inve
} }
// Handled in ITEM_USE if the item is not milk // Handled in ITEM_USE if the item is not milk
if (packet.getItemInHand() != null && packet.getItemInHand().getId() == ItemRegistry.BUCKET.getBedrockId() && if (packet.getItemInHand() != null && ItemRegistry.BUCKETS.contains(packet.getItemInHand().getId()) &&
packet.getItemInHand().getDamage() != 1) { packet.getItemInHand().getId() != ItemRegistry.MILK_BUCKET.getBedrockId()) {
break; break;
} }

View file

@ -42,6 +42,7 @@ import org.geysermc.connector.common.ChatColor;
import org.geysermc.connector.inventory.Inventory; import org.geysermc.connector.inventory.Inventory;
import org.geysermc.connector.network.session.GeyserSession; import org.geysermc.connector.network.session.GeyserSession;
import org.geysermc.connector.network.translators.inventory.updater.InventoryUpdater; import org.geysermc.connector.network.translators.inventory.updater.InventoryUpdater;
import org.geysermc.connector.network.translators.item.ItemRegistry;
import org.geysermc.connector.network.translators.item.ItemTranslator; import org.geysermc.connector.network.translators.item.ItemTranslator;
import org.geysermc.connector.utils.InventoryUtils; import org.geysermc.connector.utils.InventoryUtils;
import org.geysermc.connector.utils.LocaleUtils; import org.geysermc.connector.utils.LocaleUtils;
@ -57,9 +58,8 @@ import java.util.List;
*/ */
public class EnchantmentInventoryTranslator extends BlockInventoryTranslator { public class EnchantmentInventoryTranslator extends BlockInventoryTranslator {
private static final int DYE_ID = 351; private static final int DYE_ID = ItemRegistry.getItemEntry("minecraft:lapis_lazuli").getBedrockId();
private static final short LAPIS_DAMAGE = 4; private static final int ENCHANTED_BOOK_ID = ItemRegistry.getItemEntry("minecraft:enchanted_book").getBedrockId();
private static final int ENCHANTED_BOOK_ID = 403;
public EnchantmentInventoryTranslator(InventoryUpdater updater) { public EnchantmentInventoryTranslator(InventoryUpdater updater) {
super(2, "minecraft:hopper[enabled=false,facing=down]", ContainerType.HOPPER, updater); super(2, "minecraft:hopper[enabled=false,facing=down]", ContainerType.HOPPER, updater);
@ -73,8 +73,7 @@ public class EnchantmentInventoryTranslator extends BlockInventoryTranslator {
switch (action.getSlot()) { switch (action.getSlot()) {
case 1: case 1:
// Don't allow the slot to be put through if the item isn't lapis // Don't allow the slot to be put through if the item isn't lapis
if ((action.getToItem().getId() != DYE_ID if ((action.getToItem().getId() != DYE_ID) && action.getToItem() != ItemData.AIR) {
&& action.getToItem().getDamage() != LAPIS_DAMAGE) && action.getToItem() != ItemData.AIR) {
updateInventory(session, inventory); updateInventory(session, inventory);
InventoryUtils.updateCursor(session); InventoryUtils.updateCursor(session);
return; return;

View file

@ -53,9 +53,9 @@ public abstract class InventoryTranslator {
put(WindowType.BREWING_STAND, new BrewingInventoryTranslator()); put(WindowType.BREWING_STAND, new BrewingInventoryTranslator());
put(WindowType.ANVIL, new AnvilInventoryTranslator()); put(WindowType.ANVIL, new AnvilInventoryTranslator());
put(WindowType.CRAFTING, new CraftingInventoryTranslator()); put(WindowType.CRAFTING, new CraftingInventoryTranslator());
put(WindowType.GRINDSTONE, new GrindstoneInventoryTranslator()); //put(WindowType.GRINDSTONE, new GrindstoneInventoryTranslator()); //FIXME
put(WindowType.MERCHANT, new MerchantInventoryTranslator()); put(WindowType.MERCHANT, new MerchantInventoryTranslator());
put(WindowType.SMITHING, new SmithingInventoryTranslator()); //put(WindowType.SMITHING, new SmithingInventoryTranslator()); //TODO for server authoritative inventories
InventoryTranslator furnace = new FurnaceInventoryTranslator(); InventoryTranslator furnace = new FurnaceInventoryTranslator();
put(WindowType.FURNACE, furnace); put(WindowType.FURNACE, furnace);

View file

@ -34,6 +34,8 @@ import com.nukkitx.protocol.bedrock.data.inventory.ItemData;
import com.nukkitx.protocol.bedrock.packet.StartGamePacket; import com.nukkitx.protocol.bedrock.packet.StartGamePacket;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.ints.IntArrayList;
import it.unimi.dsi.fastutil.ints.IntList;
import org.geysermc.connector.GeyserConnector; import org.geysermc.connector.GeyserConnector;
import org.geysermc.connector.utils.FileUtils; import org.geysermc.connector.utils.FileUtils;
import org.geysermc.connector.utils.LanguageUtils; import org.geysermc.connector.utils.LanguageUtils;
@ -60,13 +62,17 @@ public class ItemRegistry {
*/ */
public static ItemEntry BAMBOO; public static ItemEntry BAMBOO;
/** /**
* Boat item entry, used in BedrockInventoryTransactionTranslator.java * Boat item entries, used in BedrockInventoryTransactionTranslator.java
*/ */
public static ItemEntry BOAT; public static IntList BOATS = new IntArrayList();
/** /**
* Bucket item entry, used in BedrockInventoryTransactionTranslator.java * Bucket item entries (excluding the milk bucket), used in BedrockInventoryTransactionTranslator.java
*/ */
public static ItemEntry BUCKET; public static IntList BUCKETS = new IntArrayList();
/**
* Empty item bucket, used in BedrockInventoryTransactionTranslator.java
*/
public static ItemEntry MILK_BUCKET;
/** /**
* Egg item entry, used in JavaEntityStatusTranslator.java * Egg item entry, used in JavaEntityStatusTranslator.java
*/ */
@ -92,7 +98,7 @@ public class ItemRegistry {
static { static {
/* Load item palette */ /* Load item palette */
InputStream stream = FileUtils.getResource("bedrock/items.json"); InputStream stream = FileUtils.getResource("bedrock/runtime_item_states.json");
TypeReference<List<JsonNode>> itemEntriesType = new TypeReference<List<JsonNode>>() { TypeReference<List<JsonNode>> itemEntriesType = new TypeReference<List<JsonNode>>() {
}; };
@ -104,8 +110,13 @@ public class ItemRegistry {
throw new AssertionError(LanguageUtils.getLocaleStringLog("geyser.toolbox.fail.runtime_bedrock"), e); throw new AssertionError(LanguageUtils.getLocaleStringLog("geyser.toolbox.fail.runtime_bedrock"), e);
} }
int lodestoneCompassId = 0;
for (JsonNode entry : itemEntries) { for (JsonNode entry : itemEntries) {
ITEMS.add(new StartGamePacket.ItemEntry(entry.get("name").textValue(), (short) entry.get("id").intValue())); ITEMS.add(new StartGamePacket.ItemEntry(entry.get("name").textValue(), (short) entry.get("id").intValue()));
if (entry.get("name").textValue().equals("minecraft:lodestone_compass")) {
lodestoneCompassId = entry.get("id").intValue();
}
} }
stream = FileUtils.getResource("mappings/items.json"); stream = FileUtils.getResource("mappings/items.json");
@ -153,9 +164,6 @@ public class ItemRegistry {
case "minecraft:bamboo": case "minecraft:bamboo":
BAMBOO = ITEM_ENTRIES.get(itemIndex); BAMBOO = ITEM_ENTRIES.get(itemIndex);
break; break;
case "minecraft:oak_boat":
BOAT = ITEM_ENTRIES.get(itemIndex);
break;
case "minecraft:egg": case "minecraft:egg":
EGG = ITEM_ENTRIES.get(itemIndex); EGG = ITEM_ENTRIES.get(itemIndex);
break; break;
@ -165,8 +173,8 @@ public class ItemRegistry {
case "minecraft:shield": case "minecraft:shield":
SHIELD = ITEM_ENTRIES.get(itemIndex); SHIELD = ITEM_ENTRIES.get(itemIndex);
break; break;
case "minecraft:bucket": case "minecraft:milk_bucket":
BUCKET = ITEM_ENTRIES.get(itemIndex); MILK_BUCKET = ITEM_ENTRIES.get(itemIndex);
break; break;
case "minecraft:wheat": case "minecraft:wheat":
WHEAT = ITEM_ENTRIES.get(itemIndex); WHEAT = ITEM_ENTRIES.get(itemIndex);
@ -175,11 +183,22 @@ public class ItemRegistry {
break; break;
} }
if (entry.getKey().contains("boat")) {
BOATS.add(entry.getValue().get("bedrock_id").intValue());
} else if (entry.getKey().contains("bucket") && !entry.getKey().contains("milk")) {
BUCKETS.add(entry.getValue().get("bedrock_id").intValue());
}
itemIndex++; itemIndex++;
} }
if (lodestoneCompassId == 0) {
throw new RuntimeException("Lodestone compass not found in item palette!");
}
// Add the loadstone compass since it doesn't exist on java but we need it for item conversion // Add the loadstone compass since it doesn't exist on java but we need it for item conversion
ITEM_ENTRIES.put(itemIndex, new ItemEntry("minecraft:lodestonecompass", itemIndex, 741, 0, false)); ITEM_ENTRIES.put(itemIndex, new ItemEntry("minecraft:lodestone_compass", itemIndex,
lodestoneCompassId, 0, false));
/* Load creative items */ /* Load creative items */
stream = FileUtils.getResource("bedrock/creative_items.json"); stream = FileUtils.getResource("bedrock/creative_items.json");
@ -256,7 +275,7 @@ public class ItemRegistry {
* @param entry the ItemEntry to search for * @param entry the ItemEntry to search for
* @return the Bedrock identifier * @return the Bedrock identifier
*/ */
public static String getBedrockIdentifer(ItemEntry entry) { public static String getBedrockIdentifier(ItemEntry entry) {
String blockName = ""; String blockName = "";
for (StartGamePacket.ItemEntry startGamePacketItemEntry : ItemRegistry.ITEMS) { for (StartGamePacket.ItemEntry startGamePacketItemEntry : ItemRegistry.ITEMS) {
if (startGamePacketItemEntry.getId() == (short) entry.getBedrockId()) { if (startGamePacketItemEntry.getId() == (short) entry.getBedrockId()) {

View file

@ -53,7 +53,7 @@ public class CrossbowTranslator extends NbtItemStackTranslator {
CompoundTag newProjectile = new CompoundTag("chargedItem"); CompoundTag newProjectile = new CompoundTag("chargedItem");
newProjectile.put(new ByteTag("Count", (byte) itemData.getCount())); newProjectile.put(new ByteTag("Count", (byte) itemData.getCount()));
newProjectile.put(new StringTag("Name", ItemRegistry.getBedrockIdentifer(entry))); newProjectile.put(new StringTag("Name", ItemRegistry.getBedrockIdentifier(entry)));
newProjectile.put(new ShortTag("Damage", itemData.getDamage())); newProjectile.put(new ShortTag("Damage", itemData.getDamage()));

View file

@ -50,7 +50,7 @@ public class ShulkerBoxItemTranslator extends NbtItemStackTranslator {
boxItemTag.put(new ByteTag("WasPickedUp", (byte) 0)); // ??? boxItemTag.put(new ByteTag("WasPickedUp", (byte) 0)); // ???
ItemEntry boxItemEntry = ItemRegistry.getItemEntry(((StringTag) itemData.get("id")).getValue()); ItemEntry boxItemEntry = ItemRegistry.getItemEntry(((StringTag) itemData.get("id")).getValue());
String blockName = ItemRegistry.getBedrockIdentifer(boxItemEntry); String blockName = ItemRegistry.getBedrockIdentifier(boxItemEntry);
boxItemTag.put(new StringTag("Name", blockName)); boxItemTag.put(new StringTag("Name", blockName));
boxItemTag.put(new ShortTag("Damage", (short) boxItemEntry.getBedrockData())); boxItemTag.put(new ShortTag("Damage", (short) boxItemEntry.getBedrockData()));

View file

@ -46,7 +46,7 @@ public class JavaExplosionTranslator extends PacketTranslator<ServerExplosionPac
public void translate(ServerExplosionPacket packet, GeyserSession session) { public void translate(ServerExplosionPacket packet, GeyserSession session) {
for (ExplodedBlockRecord record : packet.getExploded()) { for (ExplodedBlockRecord record : packet.getExploded()) {
Vector3f pos = Vector3f.from(packet.getX() + record.getX(), packet.getY() + record.getY(), packet.getZ() + record.getZ()); Vector3f pos = Vector3f.from(packet.getX() + record.getX(), packet.getY() + record.getY(), packet.getZ() + record.getZ());
ChunkUtils.updateBlock(session, BlockTranslator.AIR, pos.toInt()); ChunkUtils.updateBlock(session, BlockTranslator.JAVA_AIR_ID, pos.toInt());
} }
Vector3f pos = Vector3f.from(packet.getX(), packet.getY(), packet.getZ()); Vector3f pos = Vector3f.from(packet.getX(), packet.getY(), packet.getZ());

View file

@ -43,7 +43,7 @@ import org.geysermc.connector.utils.GameRule;
public abstract class WorldManager { public abstract class WorldManager {
/** /**
* Gets the block state at the specified location * Gets the Java block state at the specified location
* *
* @param session the session * @param session the session
* @param position the position * @param position the position
@ -54,7 +54,7 @@ public abstract class WorldManager {
} }
/** /**
* Gets the block state at the specified location * Gets the Java block state at the specified location
* *
* @param session the session * @param session the session
* @param vector the position * @param vector the position
@ -65,7 +65,7 @@ public abstract class WorldManager {
} }
/** /**
* Gets the block state at the specified location * Gets the Java block state at the specified location
* *
* @param session the session * @param session the session
* @param x the x coordinate to get the block at * @param x the x coordinate to get the block at
@ -97,7 +97,7 @@ public abstract class WorldManager {
public abstract boolean hasMoreBlockDataThanChunkCache(); public abstract boolean hasMoreBlockDataThanChunkCache();
/** /**
* Gets the biome data for the specified chunk. * Gets the Java biome data for the specified chunk.
* *
* @param session the session of the player * @param session the session of the player
* @param x the chunk's X coordinate * @param x the chunk's X coordinate
@ -116,7 +116,7 @@ public abstract class WorldManager {
public abstract void setGameRule(GeyserSession session, String name, Object value); public abstract void setGameRule(GeyserSession session, String name, Object value);
/** /**
* Get a gamerule value as a boolean * Gets a gamerule value as a boolean
* *
* @param session The session of the user that requested the value * @param session The session of the user that requested the value
* @param gameRule The gamerule to fetch the value of * @param gameRule The gamerule to fetch the value of

View file

@ -30,21 +30,25 @@ import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap; import com.google.common.collect.HashBiMap;
import com.nukkitx.nbt.*; import com.nukkitx.nbt.*;
import it.unimi.dsi.fastutil.ints.*; import it.unimi.dsi.fastutil.ints.*;
import it.unimi.dsi.fastutil.objects.Object2IntMap; import it.unimi.dsi.fastutil.objects.*;
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
import it.unimi.dsi.fastutil.objects.Object2ObjectMap;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
import org.geysermc.connector.GeyserConnector; import org.geysermc.connector.GeyserConnector;
import org.geysermc.connector.network.translators.world.block.entity.BlockEntity; import org.geysermc.connector.network.translators.world.block.entity.BlockEntity;
import org.geysermc.connector.utils.FileUtils; import org.geysermc.connector.utils.FileUtils;
import org.reflections.Reflections; import org.reflections.Reflections;
import java.io.DataInputStream;
import java.io.InputStream; import java.io.InputStream;
import java.util.*; import java.util.*;
public class BlockTranslator { public class BlockTranslator {
public static final NbtList<NbtMap> BLOCKS; /**
public static final int AIR = 0; * The Java block runtime ID of air
*/
public static final int JAVA_AIR_ID = 0;
/**
* The Bedrock block runtime ID of air
*/
public static final int BEDROCK_AIR_ID;
public static final int BEDROCK_WATER_ID; public static final int BEDROCK_WATER_ID;
private static final Int2IntMap JAVA_TO_BEDROCK_BLOCK_MAP = new Int2IntOpenHashMap(); private static final Int2IntMap JAVA_TO_BEDROCK_BLOCK_MAP = new Int2IntOpenHashMap();
@ -86,25 +90,31 @@ public class BlockTranslator {
public static final int JAVA_RUNTIME_SPAWNER_ID; public static final int JAVA_RUNTIME_SPAWNER_ID;
private static final int BLOCK_STATE_VERSION = 17825806; private static final int BLOCK_STATE_VERSION = 17825808;
static { static {
/* Load block palette */ /* Load block palette */
InputStream stream = FileUtils.getResource("bedrock/runtime_block_states.dat"); InputStream stream = FileUtils.getResource("bedrock/blockpalette.nbt");
NbtList<NbtMap> blocksTag; NbtList<NbtMap> blocksTag;
try (NBTInputStream nbtInputStream = NbtUtils.createNetworkReader(stream)) { try (NBTInputStream nbtInputStream = new NBTInputStream(new DataInputStream(stream))) {
blocksTag = (NbtList<NbtMap>) nbtInputStream.readTag(); NbtMap blockPalette = (NbtMap) nbtInputStream.readTag();
blocksTag = (NbtList<NbtMap>) blockPalette.getList("blocks", NbtType.COMPOUND);
} catch (Exception e) { } catch (Exception e) {
throw new AssertionError("Unable to get blocks from runtime block states", e); throw new AssertionError("Unable to get blocks from runtime block states", e);
} }
Map<NbtMap, NbtMap> blockStateMap = new HashMap<>(); // New since 1.16.100 - find the block runtime ID by the order given to us in the block palette,
// as we no longer send a block palette
Object2IntMap<NbtMap> blockStateOrderedMap = new Object2IntOpenHashMap<>(blocksTag.size());
for (NbtMap tag : blocksTag) { for (int i = 0; i < blocksTag.size(); i++) {
if (blockStateMap.putIfAbsent(tag.getCompound("block"), tag) != null) { NbtMap tag = blocksTag.get(i);
NbtMap blockTag = tag.getCompound("block");
if (blockStateOrderedMap.containsKey(blockTag)) {
throw new AssertionError("Duplicate block states in Bedrock palette"); throw new AssertionError("Duplicate block states in Bedrock palette");
} }
blockStateOrderedMap.put(blockTag, i);
} }
stream = FileUtils.getResource("mappings/blocks.json"); stream = FileUtils.getResource("mappings/blocks.json");
@ -114,16 +124,13 @@ public class BlockTranslator {
} catch (Exception e) { } catch (Exception e) {
throw new AssertionError("Unable to load Java block mappings", e); throw new AssertionError("Unable to load Java block mappings", e);
} }
Object2IntMap<NbtMap> addedStatesMap = new Object2IntOpenHashMap<>();
addedStatesMap.defaultReturnValue(-1);
List<NbtMap> paletteList = new ArrayList<>();
Reflections ref = GeyserConnector.getInstance().useXmlReflections() ? FileUtils.getReflections("org.geysermc.connector.network.translators.world.block.entity") : new Reflections("org.geysermc.connector.network.translators.world.block.entity"); Reflections ref = GeyserConnector.getInstance().useXmlReflections() ? FileUtils.getReflections("org.geysermc.connector.network.translators.world.block.entity")
ref.getTypesAnnotatedWith(BlockEntity.class); : new Reflections("org.geysermc.connector.network.translators.world.block.entity");
int waterRuntimeId = -1; int waterRuntimeId = -1;
int javaRuntimeId = -1; int javaRuntimeId = -1;
int bedrockRuntimeId = 0; int airRuntimeId = -1;
int cobwebRuntimeId = -1; int cobwebRuntimeId = -1;
int commandBlockRuntimeId = -1; int commandBlockRuntimeId = -1;
int furnaceRuntimeId = -1; int furnaceRuntimeId = -1;
@ -136,6 +143,10 @@ public class BlockTranslator {
Map.Entry<String, JsonNode> entry = blocksIterator.next(); Map.Entry<String, JsonNode> entry = blocksIterator.next();
String javaId = entry.getKey(); String javaId = entry.getKey();
NbtMap blockTag = buildBedrockState(entry.getValue()); NbtMap blockTag = buildBedrockState(entry.getValue());
int bedrockRuntimeId = blockStateOrderedMap.getOrDefault(blockTag, -1);
if (bedrockRuntimeId == -1) {
throw new RuntimeException("Unable to find " + javaId + " Bedrock runtime ID!");
}
// TODO fix this, (no block should have a null hardness) // TODO fix this, (no block should have a null hardness)
JsonNode hardnessNode = entry.getValue().get("block_hardness"); JsonNode hardnessNode = entry.getValue().get("block_hardness");
@ -199,22 +210,12 @@ public class BlockTranslator {
BEDROCK_TO_JAVA_BLOCK_MAP.putIfAbsent(bedrockRuntimeId, javaRuntimeId); BEDROCK_TO_JAVA_BLOCK_MAP.putIfAbsent(bedrockRuntimeId, javaRuntimeId);
} }
NbtMap runtimeTag = blockStateMap.remove(blockTag);
if (runtimeTag != null) {
addedStatesMap.put(blockTag, bedrockRuntimeId);
paletteList.add(runtimeTag);
} else {
int duplicateRuntimeId = addedStatesMap.getOrDefault(blockTag, -1);
if (duplicateRuntimeId == -1) {
GeyserConnector.getInstance().getLogger().debug("Mapping " + javaId + " was not found for bedrock edition!");
} else {
JAVA_TO_BEDROCK_BLOCK_MAP.put(javaRuntimeId, duplicateRuntimeId);
}
continue;
}
JAVA_TO_BEDROCK_BLOCK_MAP.put(javaRuntimeId, bedrockRuntimeId); JAVA_TO_BEDROCK_BLOCK_MAP.put(javaRuntimeId, bedrockRuntimeId);
if (javaId.contains("wool")) { if (bedrockIdentifier.equals("minecraft:air")) {
airRuntimeId = bedrockRuntimeId;
} else if (javaId.contains("wool")) {
JAVA_RUNTIME_WOOL_IDS.add(javaRuntimeId); JAVA_RUNTIME_WOOL_IDS.add(javaRuntimeId);
} else if (javaId.contains("cobweb")) { } else if (javaId.contains("cobweb")) {
@ -233,8 +234,6 @@ public class BlockTranslator {
} else if (javaId.startsWith("minecraft:spawner")) { } else if (javaId.startsWith("minecraft:spawner")) {
spawnerRuntimeId = javaRuntimeId; spawnerRuntimeId = javaRuntimeId;
} }
bedrockRuntimeId++;
} }
if (cobwebRuntimeId == -1) { if (cobwebRuntimeId == -1) {
@ -267,19 +266,17 @@ public class BlockTranslator {
} }
BEDROCK_WATER_ID = waterRuntimeId; BEDROCK_WATER_ID = waterRuntimeId;
paletteList.addAll(blockStateMap.values()); // Add any missing mappings that could crash the client if (airRuntimeId == -1) {
throw new AssertionError("Unable to find air in palette");
}
BEDROCK_AIR_ID = airRuntimeId;
// Loop around again to find all item frame runtime IDs // Loop around again to find all item frame runtime IDs
int frameRuntimeId = 0; for (Object2IntMap.Entry<NbtMap> entry : blockStateOrderedMap.object2IntEntrySet()) {
for (NbtMap tag : paletteList) { if (entry.getKey().getString("name").equals("minecraft:frame")) {
NbtMap blockTag = tag.getCompound("block"); ITEM_FRAMES.put(entry.getKey(), entry.getIntValue());
if (blockTag.getString("name").equals("minecraft:frame")) {
ITEM_FRAMES.put(tag, frameRuntimeId);
} }
frameRuntimeId++;
} }
BLOCKS = new NbtList<>(NbtType.COMPOUND, paletteList);
} }
private BlockTranslator() { private BlockTranslator() {

View file

@ -30,6 +30,7 @@ import io.netty.buffer.ByteBuf;
import it.unimi.dsi.fastutil.ints.IntArrayList; import it.unimi.dsi.fastutil.ints.IntArrayList;
import it.unimi.dsi.fastutil.ints.IntList; import it.unimi.dsi.fastutil.ints.IntList;
import lombok.Getter; import lombok.Getter;
import org.geysermc.connector.network.translators.world.block.BlockTranslator;
import org.geysermc.connector.network.translators.world.chunk.bitarray.BitArray; import org.geysermc.connector.network.translators.world.chunk.bitarray.BitArray;
import org.geysermc.connector.network.translators.world.chunk.bitarray.BitArrayVersion; import org.geysermc.connector.network.translators.world.chunk.bitarray.BitArrayVersion;
@ -50,7 +51,7 @@ public class BlockStorage {
public BlockStorage(BitArrayVersion version) { public BlockStorage(BitArrayVersion version) {
this.bitArray = version.createArray(SIZE); this.bitArray = version.createArray(SIZE);
this.palette = new IntArrayList(16); this.palette = new IntArrayList(16);
this.palette.add(0); // Air is at the start of every palette. this.palette.add(BlockTranslator.BEDROCK_AIR_ID); // Air is at the start of every palette and controls what the default block is in second-layer non-air block spaces.
} }
public BlockStorage(BitArray bitArray, IntList palette) { public BlockStorage(BitArray bitArray, IntList palette) {

View file

@ -68,7 +68,8 @@ import java.util.ArrayList;
import java.util.BitSet; import java.util.BitSet;
import java.util.List; import java.util.List;
import static org.geysermc.connector.network.translators.world.block.BlockTranslator.AIR; import static org.geysermc.connector.network.translators.world.block.BlockTranslator.JAVA_AIR_ID;
import static org.geysermc.connector.network.translators.world.block.BlockTranslator.BEDROCK_AIR_ID;
import static org.geysermc.connector.network.translators.world.block.BlockTranslator.BEDROCK_WATER_ID; import static org.geysermc.connector.network.translators.world.block.BlockTranslator.BEDROCK_WATER_ID;
@UtilityClass @UtilityClass
@ -246,7 +247,7 @@ public class ChunkUtils {
// V1 palette // V1 palette
IntList layer1Palette = new IntArrayList(2); IntList layer1Palette = new IntArrayList(2);
layer1Palette.add(0); // Air layer1Palette.add(BEDROCK_AIR_ID); // Air - see BlockStorage's constructor for more information
layer1Palette.add(BEDROCK_WATER_ID); layer1Palette.add(BEDROCK_WATER_ID);
layers = new BlockStorage[]{ layer0, new BlockStorage(BitArrayVersion.V1.createArray(BlockStorage.SIZE, layer1Data), layer1Palette) }; layers = new BlockStorage[]{ layer0, new BlockStorage(BitArrayVersion.V1.createArray(BlockStorage.SIZE, layer1Data), layer1Palette) };
@ -318,18 +319,32 @@ public class ChunkUtils {
} }
} }
/**
* Sends a block update to the Bedrock client. If chunk caching is enabled and the platform is not Spigot, this also
* adds that block to the cache.
* @param session the Bedrock session to send/register the block to
* @param blockState the Java block state of the block
* @param position the position of the block
*/
public static void updateBlock(GeyserSession session, int blockState, Position position) { public static void updateBlock(GeyserSession session, int blockState, Position position) {
Vector3i pos = Vector3i.from(position.getX(), position.getY(), position.getZ()); Vector3i pos = Vector3i.from(position.getX(), position.getY(), position.getZ());
updateBlock(session, blockState, pos); updateBlock(session, blockState, pos);
} }
/**
* Sends a block update to the Bedrock client. If chunk caching is enabled and the platform is not Spigot, this also
* adds that block to the cache.
* @param session the Bedrock session to send/register the block to
* @param blockState the Java block state of the block
* @param position the position of the block
*/
public static void updateBlock(GeyserSession session, int blockState, Vector3i position) { public static void updateBlock(GeyserSession session, int blockState, Vector3i position) {
// Checks for item frames so they aren't tripped up and removed // Checks for item frames so they aren't tripped up and removed
long frameEntityId = ItemFrameEntity.getItemFrameEntityId(session, position); long frameEntityId = ItemFrameEntity.getItemFrameEntityId(session, position);
if (frameEntityId != -1) { if (frameEntityId != -1) {
// TODO: Very occasionally the item frame doesn't sync up when destroyed // TODO: Very occasionally the item frame doesn't sync up when destroyed
Entity entity = session.getEntityCache().getEntityByJavaId(frameEntityId); Entity entity = session.getEntityCache().getEntityByJavaId(frameEntityId);
if (blockState == AIR && entity != null) { // Item frame is still present and no block overrides that; refresh it if (blockState == JAVA_AIR_ID && entity != null) { // Item frame is still present and no block overrides that; refresh it
((ItemFrameEntity) entity).updateBlock(session); ((ItemFrameEntity) entity).updateBlock(session);
return; return;
} }
@ -358,7 +373,7 @@ public class ChunkUtils {
if (BlockTranslator.isWaterlogged(blockState)) { if (BlockTranslator.isWaterlogged(blockState)) {
waterPacket.setRuntimeId(BEDROCK_WATER_ID); waterPacket.setRuntimeId(BEDROCK_WATER_ID);
} else { } else {
waterPacket.setRuntimeId(0); waterPacket.setRuntimeId(BEDROCK_AIR_ID);
} }
session.sendUpstreamPacket(waterPacket); session.sendUpstreamPacket(waterPacket);

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -1,555 +0,0 @@
{
"minecraft:air" : 0,
"minecraft:stone" : 1,
"minecraft:grass" : 2,
"minecraft:dirt" : 3,
"minecraft:cobblestone" : 4,
"minecraft:planks" : 5,
"minecraft:sapling" : 6,
"minecraft:bedrock" : 7,
"minecraft:flowing_water" : 8,
"minecraft:water" : 9,
"minecraft:flowing_lava" : 10,
"minecraft:lava" : 11,
"minecraft:sand" : 12,
"minecraft:gravel" : 13,
"minecraft:gold_ore" : 14,
"minecraft:iron_ore" : 15,
"minecraft:coal_ore" : 16,
"minecraft:log" : 17,
"minecraft:leaves" : 18,
"minecraft:sponge" : 19,
"minecraft:glass" : 20,
"minecraft:lapis_ore" : 21,
"minecraft:lapis_block" : 22,
"minecraft:dispenser" : 23,
"minecraft:sandstone" : 24,
"minecraft:noteblock" : 25,
"minecraft:bed" : 26,
"minecraft:golden_rail" : 27,
"minecraft:detector_rail" : 28,
"minecraft:sticky_piston" : 29,
"minecraft:web" : 30,
"minecraft:tallgrass" : 31,
"minecraft:deadbush" : 32,
"minecraft:piston" : 33,
"minecraft:pistonArmCollision" : 34,
"minecraft:wool" : 35,
"minecraft:element_0" : 36,
"minecraft:yellow_flower" : 37,
"minecraft:red_flower" : 38,
"minecraft:brown_mushroom" : 39,
"minecraft:red_mushroom" : 40,
"minecraft:gold_block" : 41,
"minecraft:iron_block" : 42,
"minecraft:double_stone_slab" : 43,
"minecraft:stone_slab" : 44,
"minecraft:brick_block" : 45,
"minecraft:tnt" : 46,
"minecraft:bookshelf" : 47,
"minecraft:mossy_cobblestone" : 48,
"minecraft:obsidian" : 49,
"minecraft:torch" : 50,
"minecraft:fire" : 51,
"minecraft:mob_spawner" : 52,
"minecraft:oak_stairs" : 53,
"minecraft:chest" : 54,
"minecraft:redstone_wire" : 55,
"minecraft:diamond_ore" : 56,
"minecraft:diamond_block" : 57,
"minecraft:crafting_table" : 58,
"minecraft:wheat" : 59,
"minecraft:farmland" : 60,
"minecraft:furnace" : 61,
"minecraft:lit_furnace" : 62,
"minecraft:standing_sign" : 63,
"minecraft:wooden_door" : 64,
"minecraft:ladder" : 65,
"minecraft:rail" : 66,
"minecraft:stone_stairs" : 67,
"minecraft:wall_sign" : 68,
"minecraft:lever" : 69,
"minecraft:stone_pressure_plate" : 70,
"minecraft:iron_door" : 71,
"minecraft:wooden_pressure_plate" : 72,
"minecraft:redstone_ore" : 73,
"minecraft:lit_redstone_ore" : 74,
"minecraft:unlit_redstone_torch" : 75,
"minecraft:redstone_torch" : 76,
"minecraft:stone_button" : 77,
"minecraft:snow_layer" : 78,
"minecraft:ice" : 79,
"minecraft:snow" : 80,
"minecraft:cactus" : 81,
"minecraft:clay" : 82,
"minecraft:reeds" : 83,
"minecraft:jukebox" : 84,
"minecraft:fence" : 85,
"minecraft:pumpkin" : 86,
"minecraft:netherrack" : 87,
"minecraft:soul_sand" : 88,
"minecraft:glowstone" : 89,
"minecraft:portal" : 90,
"minecraft:lit_pumpkin" : 91,
"minecraft:cake" : 92,
"minecraft:unpowered_repeater" : 93,
"minecraft:powered_repeater" : 94,
"minecraft:invisibleBedrock" : 95,
"minecraft:trapdoor" : 96,
"minecraft:monster_egg" : 97,
"minecraft:stonebrick" : 98,
"minecraft:brown_mushroom_block" : 99,
"minecraft:red_mushroom_block" : 100,
"minecraft:iron_bars" : 101,
"minecraft:glass_pane" : 102,
"minecraft:melon_block" : 103,
"minecraft:pumpkin_stem" : 104,
"minecraft:melon_stem" : 105,
"minecraft:vine" : 106,
"minecraft:fence_gate" : 107,
"minecraft:brick_stairs" : 108,
"minecraft:stone_brick_stairs" : 109,
"minecraft:mycelium" : 110,
"minecraft:waterlily" : 111,
"minecraft:nether_brick" : 112,
"minecraft:nether_brick_fence" : 113,
"minecraft:nether_brick_stairs" : 114,
"minecraft:nether_wart" : 115,
"minecraft:enchanting_table" : 116,
"minecraft:brewing_stand" : 117,
"minecraft:cauldron" : 118,
"minecraft:end_portal" : 119,
"minecraft:end_portal_frame" : 120,
"minecraft:end_stone" : 121,
"minecraft:dragon_egg" : 122,
"minecraft:redstone_lamp" : 123,
"minecraft:lit_redstone_lamp" : 124,
"minecraft:dropper" : 125,
"minecraft:activator_rail" : 126,
"minecraft:cocoa" : 127,
"minecraft:sandstone_stairs" : 128,
"minecraft:emerald_ore" : 129,
"minecraft:ender_chest" : 130,
"minecraft:tripwire_hook" : 131,
"minecraft:tripWire" : 132,
"minecraft:emerald_block" : 133,
"minecraft:spruce_stairs" : 134,
"minecraft:birch_stairs" : 135,
"minecraft:jungle_stairs" : 136,
"minecraft:command_block" : 137,
"minecraft:beacon" : 138,
"minecraft:cobblestone_wall" : 139,
"minecraft:flower_pot" : 140,
"minecraft:carrots" : 141,
"minecraft:potatoes" : 142,
"minecraft:wooden_button" : 143,
"minecraft:skull" : 144,
"minecraft:anvil" : 145,
"minecraft:trapped_chest" : 146,
"minecraft:light_weighted_pressure_plate" : 147,
"minecraft:heavy_weighted_pressure_plate" : 148,
"minecraft:unpowered_comparator" : 149,
"minecraft:powered_comparator" : 150,
"minecraft:daylight_detector" : 151,
"minecraft:redstone_block" : 152,
"minecraft:quartz_ore" : 153,
"minecraft:hopper" : 154,
"minecraft:quartz_block" : 155,
"minecraft:quartz_stairs" : 156,
"minecraft:double_wooden_slab" : 157,
"minecraft:wooden_slab" : 158,
"minecraft:stained_hardened_clay" : 159,
"minecraft:stained_glass_pane" : 160,
"minecraft:leaves2" : 161,
"minecraft:log2" : 162,
"minecraft:acacia_stairs" : 163,
"minecraft:dark_oak_stairs" : 164,
"minecraft:slime" : 165,
"minecraft:iron_trapdoor" : 167,
"minecraft:prismarine" : 168,
"minecraft:seaLantern" : 169,
"minecraft:hay_block" : 170,
"minecraft:carpet" : 171,
"minecraft:hardened_clay" : 172,
"minecraft:coal_block" : 173,
"minecraft:packed_ice" : 174,
"minecraft:double_plant" : 175,
"minecraft:standing_banner" : 176,
"minecraft:wall_banner" : 177,
"minecraft:daylight_detector_inverted" : 178,
"minecraft:red_sandstone" : 179,
"minecraft:red_sandstone_stairs" : 180,
"minecraft:double_stone_slab2" : 181,
"minecraft:stone_slab2" : 182,
"minecraft:spruce_fence_gate" : 183,
"minecraft:birch_fence_gate" : 184,
"minecraft:jungle_fence_gate" : 185,
"minecraft:dark_oak_fence_gate" : 186,
"minecraft:acacia_fence_gate" : 187,
"minecraft:repeating_command_block" : 188,
"minecraft:chain_command_block" : 189,
"minecraft:hard_glass_pane" : 190,
"minecraft:hard_stained_glass_pane" : 191,
"minecraft:chemical_heat" : 192,
"minecraft:spruce_door" : 193,
"minecraft:birch_door" : 194,
"minecraft:jungle_door" : 195,
"minecraft:acacia_door" : 196,
"minecraft:dark_oak_door" : 197,
"minecraft:grass_path" : 198,
"minecraft:frame" : 199,
"minecraft:chorus_flower" : 200,
"minecraft:purpur_block" : 201,
"minecraft:colored_torch_rg" : 202,
"minecraft:purpur_stairs" : 203,
"minecraft:colored_torch_bp" : 204,
"minecraft:undyed_shulker_box" : 205,
"minecraft:end_bricks" : 206,
"minecraft:frosted_ice" : 207,
"minecraft:end_rod" : 208,
"minecraft:end_gateway" : 209,
"minecraft:allow" : 210,
"minecraft:deny" : 211,
"minecraft:border_block" : 212,
"minecraft:magma" : 213,
"minecraft:nether_wart_block" : 214,
"minecraft:red_nether_brick" : 215,
"minecraft:bone_block" : 216,
"minecraft:structure_void" : 217,
"minecraft:shulker_box" : 218,
"minecraft:purple_glazed_terracotta" : 219,
"minecraft:white_glazed_terracotta" : 220,
"minecraft:orange_glazed_terracotta" : 221,
"minecraft:magenta_glazed_terracotta" : 222,
"minecraft:light_blue_glazed_terracotta" : 223,
"minecraft:yellow_glazed_terracotta" : 224,
"minecraft:lime_glazed_terracotta" : 225,
"minecraft:pink_glazed_terracotta" : 226,
"minecraft:gray_glazed_terracotta" : 227,
"minecraft:silver_glazed_terracotta" : 228,
"minecraft:cyan_glazed_terracotta" : 229,
"minecraft:blue_glazed_terracotta" : 231,
"minecraft:brown_glazed_terracotta" : 232,
"minecraft:green_glazed_terracotta" : 233,
"minecraft:red_glazed_terracotta" : 234,
"minecraft:black_glazed_terracotta" : 235,
"minecraft:concrete" : 236,
"minecraft:concretePowder" : 237,
"minecraft:chemistry_table" : 238,
"minecraft:underwater_torch" : 239,
"minecraft:chorus_plant" : 240,
"minecraft:stained_glass" : 241,
"minecraft:camera" : 242,
"minecraft:podzol" : 243,
"minecraft:beetroot" : 244,
"minecraft:stonecutter" : 245,
"minecraft:glowingobsidian" : 246,
"minecraft:netherreactor" : 247,
"minecraft:info_update" : 248,
"minecraft:info_update2" : 249,
"minecraft:movingBlock" : 250,
"minecraft:observer" : 251,
"minecraft:structure_block" : 252,
"minecraft:hard_glass" : 253,
"minecraft:hard_stained_glass" : 254,
"minecraft:reserved6" : 255,
"minecraft:prismarine_stairs" : 257,
"minecraft:dark_prismarine_stairs" : 258,
"minecraft:prismarine_bricks_stairs" : 259,
"minecraft:stripped_spruce_log" : 260,
"minecraft:stripped_birch_log" : 261,
"minecraft:stripped_jungle_log" : 262,
"minecraft:stripped_acacia_log" : 263,
"minecraft:stripped_dark_oak_log" : 264,
"minecraft:stripped_oak_log" : 265,
"minecraft:blue_ice" : 266,
"minecraft:element_1" : 267,
"minecraft:element_2" : 268,
"minecraft:element_3" : 269,
"minecraft:element_4" : 270,
"minecraft:element_5" : 271,
"minecraft:element_6" : 272,
"minecraft:element_7" : 273,
"minecraft:element_8" : 274,
"minecraft:element_9" : 275,
"minecraft:element_10" : 276,
"minecraft:element_11" : 277,
"minecraft:element_12" : 278,
"minecraft:element_13" : 279,
"minecraft:element_14" : 280,
"minecraft:element_15" : 281,
"minecraft:element_16" : 282,
"minecraft:element_17" : 283,
"minecraft:element_18" : 284,
"minecraft:element_19" : 285,
"minecraft:element_20" : 286,
"minecraft:element_21" : 287,
"minecraft:element_22" : 288,
"minecraft:element_23" : 289,
"minecraft:element_24" : 290,
"minecraft:element_25" : 291,
"minecraft:element_26" : 292,
"minecraft:element_27" : 293,
"minecraft:element_28" : 294,
"minecraft:element_29" : 295,
"minecraft:element_30" : 296,
"minecraft:element_31" : 297,
"minecraft:element_32" : 298,
"minecraft:element_33" : 299,
"minecraft:element_34" : 300,
"minecraft:element_35" : 301,
"minecraft:element_36" : 302,
"minecraft:element_37" : 303,
"minecraft:element_38" : 304,
"minecraft:element_39" : 305,
"minecraft:element_40" : 306,
"minecraft:element_41" : 307,
"minecraft:element_42" : 308,
"minecraft:element_43" : 309,
"minecraft:element_44" : 310,
"minecraft:element_45" : 311,
"minecraft:element_46" : 312,
"minecraft:element_47" : 313,
"minecraft:element_48" : 314,
"minecraft:element_49" : 315,
"minecraft:element_50" : 316,
"minecraft:element_51" : 317,
"minecraft:element_52" : 318,
"minecraft:element_53" : 319,
"minecraft:element_54" : 320,
"minecraft:element_55" : 321,
"minecraft:element_56" : 322,
"minecraft:element_57" : 323,
"minecraft:element_58" : 324,
"minecraft:element_59" : 325,
"minecraft:element_60" : 326,
"minecraft:element_61" : 327,
"minecraft:element_62" : 328,
"minecraft:element_63" : 329,
"minecraft:element_64" : 330,
"minecraft:element_65" : 331,
"minecraft:element_66" : 332,
"minecraft:element_67" : 333,
"minecraft:element_68" : 334,
"minecraft:element_69" : 335,
"minecraft:element_70" : 336,
"minecraft:element_71" : 337,
"minecraft:element_72" : 338,
"minecraft:element_73" : 339,
"minecraft:element_74" : 340,
"minecraft:element_75" : 341,
"minecraft:element_76" : 342,
"minecraft:element_77" : 343,
"minecraft:element_78" : 344,
"minecraft:element_79" : 345,
"minecraft:element_80" : 346,
"minecraft:element_81" : 347,
"minecraft:element_82" : 348,
"minecraft:element_83" : 349,
"minecraft:element_84" : 350,
"minecraft:element_85" : 351,
"minecraft:element_86" : 352,
"minecraft:element_87" : 353,
"minecraft:element_88" : 354,
"minecraft:element_89" : 355,
"minecraft:element_90" : 356,
"minecraft:element_91" : 357,
"minecraft:element_92" : 358,
"minecraft:element_93" : 359,
"minecraft:element_94" : 360,
"minecraft:element_95" : 361,
"minecraft:element_96" : 362,
"minecraft:element_97" : 363,
"minecraft:element_98" : 364,
"minecraft:element_99" : 365,
"minecraft:element_100" : 366,
"minecraft:element_101" : 367,
"minecraft:element_102" : 368,
"minecraft:element_103" : 369,
"minecraft:element_104" : 370,
"minecraft:element_105" : 371,
"minecraft:element_106" : 372,
"minecraft:element_107" : 373,
"minecraft:element_108" : 374,
"minecraft:element_109" : 375,
"minecraft:element_110" : 376,
"minecraft:element_111" : 377,
"minecraft:element_112" : 378,
"minecraft:element_113" : 379,
"minecraft:element_114" : 380,
"minecraft:element_115" : 381,
"minecraft:element_116" : 382,
"minecraft:element_117" : 383,
"minecraft:element_118" : 384,
"minecraft:seagrass" : 385,
"minecraft:coral" : 386,
"minecraft:coral_block" : 387,
"minecraft:coral_fan" : 388,
"minecraft:coral_fan_dead" : 389,
"minecraft:coral_fan_hang" : 390,
"minecraft:coral_fan_hang2" : 391,
"minecraft:coral_fan_hang3" : 392,
"minecraft:kelp" : 393,
"minecraft:dried_kelp_block" : 394,
"minecraft:acacia_button" : 395,
"minecraft:birch_button" : 396,
"minecraft:dark_oak_button" : 397,
"minecraft:jungle_button" : 398,
"minecraft:spruce_button" : 399,
"minecraft:acacia_trapdoor" : 400,
"minecraft:birch_trapdoor" : 401,
"minecraft:dark_oak_trapdoor" : 402,
"minecraft:jungle_trapdoor" : 403,
"minecraft:spruce_trapdoor" : 404,
"minecraft:acacia_pressure_plate" : 405,
"minecraft:birch_pressure_plate" : 406,
"minecraft:dark_oak_pressure_plate" : 407,
"minecraft:jungle_pressure_plate" : 408,
"minecraft:spruce_pressure_plate" : 409,
"minecraft:carved_pumpkin" : 410,
"minecraft:sea_pickle" : 411,
"minecraft:conduit" : 412,
"minecraft:turtle_egg" : 414,
"minecraft:bubble_column" : 415,
"minecraft:barrier" : 416,
"minecraft:stone_slab3" : 417,
"minecraft:bamboo" : 418,
"minecraft:bamboo_sapling" : 419,
"minecraft:scaffolding" : 420,
"minecraft:stone_slab4" : 421,
"minecraft:double_stone_slab3" : 422,
"minecraft:double_stone_slab4" : 423,
"minecraft:granite_stairs" : 424,
"minecraft:diorite_stairs" : 425,
"minecraft:andesite_stairs" : 426,
"minecraft:polished_granite_stairs" : 427,
"minecraft:polished_diorite_stairs" : 428,
"minecraft:polished_andesite_stairs" : 429,
"minecraft:mossy_stone_brick_stairs" : 430,
"minecraft:smooth_red_sandstone_stairs" : 431,
"minecraft:smooth_sandstone_stairs" : 432,
"minecraft:end_brick_stairs" : 433,
"minecraft:mossy_cobblestone_stairs" : 434,
"minecraft:normal_stone_stairs" : 435,
"minecraft:spruce_standing_sign" : 436,
"minecraft:spruce_wall_sign" : 437,
"minecraft:smooth_stone" : 438,
"minecraft:red_nether_brick_stairs" : 439,
"minecraft:smooth_quartz_stairs" : 440,
"minecraft:birch_standing_sign" : 441,
"minecraft:birch_wall_sign" : 442,
"minecraft:jungle_standing_sign" : 443,
"minecraft:jungle_wall_sign" : 444,
"minecraft:acacia_standing_sign" : 445,
"minecraft:acacia_wall_sign" : 446,
"minecraft:darkoak_standing_sign" : 447,
"minecraft:darkoak_wall_sign" : 448,
"minecraft:lectern" : 449,
"minecraft:grindstone" : 450,
"minecraft:blast_furnace" : 451,
"minecraft:stonecutter_block" : 452,
"minecraft:smoker" : 453,
"minecraft:lit_smoker" : 454,
"minecraft:cartography_table" : 455,
"minecraft:fletching_table" : 456,
"minecraft:smithing_table" : 457,
"minecraft:barrel" : 458,
"minecraft:loom" : 459,
"minecraft:bell" : 461,
"minecraft:sweet_berry_bush" : 462,
"minecraft:lantern" : 463,
"minecraft:campfire" : 464,
"minecraft:lava_cauldron" : 465,
"minecraft:jigsaw" : 466,
"minecraft:wood" : 467,
"minecraft:composter" : 468,
"minecraft:lit_blast_furnace" : 469,
"minecraft:light_block" : 470,
"minecraft:wither_rose" : 471,
"minecraft:stickyPistonArmCollision" : 472,
"minecraft:bee_nest" : 473,
"minecraft:beehive" : 474,
"minecraft:honey_block" : 475,
"minecraft:honeycomb_block" : 476,
"minecraft:lodestone" : 477,
"minecraft:crimson_roots" : 478,
"minecraft:warped_roots" : 479,
"minecraft:crimson_stem" : 480,
"minecraft:warped_stem" : 481,
"minecraft:warped_wart_block" : 482,
"minecraft:crimson_fungus" : 483,
"minecraft:warped_fungus" : 484,
"minecraft:shroomlight" : 485,
"minecraft:weeping_vines" : 486,
"minecraft:crimson_nylium" : 487,
"minecraft:warped_nylium" : 488,
"minecraft:basalt" : 489,
"minecraft:polished_basalt" : 490,
"minecraft:soul_soil" : 491,
"minecraft:soul_fire" : 492,
"minecraft:nether_sprouts" : 493,
"minecraft:target" : 494,
"minecraft:stripped_crimson_stem" : 495,
"minecraft:stripped_warped_stem" : 496,
"minecraft:crimson_planks" : 497,
"minecraft:warped_planks" : 498,
"minecraft:crimson_door" : 499,
"minecraft:warped_door" : 500,
"minecraft:crimson_trapdoor" : 501,
"minecraft:warped_trapdoor" : 502,
"minecraft:crimson_standing_sign" : 505,
"minecraft:warped_standing_sign" : 506,
"minecraft:crimson_wall_sign" : 507,
"minecraft:warped_wall_sign" : 508,
"minecraft:crimson_stairs" : 509,
"minecraft:warped_stairs" : 510,
"minecraft:crimson_fence" : 511,
"minecraft:warped_fence" : 512,
"minecraft:crimson_fence_gate" : 513,
"minecraft:warped_fence_gate" : 514,
"minecraft:crimson_button" : 515,
"minecraft:warped_button" : 516,
"minecraft:crimson_pressure_plate" : 517,
"minecraft:warped_pressure_plate" : 518,
"minecraft:crimson_slab" : 519,
"minecraft:warped_slab" : 520,
"minecraft:crimson_double_slab" : 521,
"minecraft:warped_double_slab" : 522,
"minecraft:soul_torch" : 523,
"minecraft:soul_lantern" : 524,
"minecraft:netherite_block" : 525,
"minecraft:ancient_debris" : 526,
"minecraft:respawn_anchor" : 527,
"minecraft:blackstone" : 528,
"minecraft:polished_blackstone_bricks" : 529,
"minecraft:polished_blackstone_brick_stairs" : 530,
"minecraft:blackstone_stairs" : 531,
"minecraft:blackstone_wall" : 532,
"minecraft:polished_blackstone_brick_wall" : 533,
"minecraft:chiseled_polished_blackstone" : 534,
"minecraft:cracked_polished_blackstone_bricks" : 535,
"minecraft:gilded_blackstone" : 536,
"minecraft:blackstone_slab" : 537,
"minecraft:blackstone_double_slab" : 538,
"minecraft:polished_blackstone_brick_slab" : 539,
"minecraft:polished_blackstone_brick_double_slab" : 540,
"minecraft:chain" : 541,
"minecraft:twisting_vines" : 542,
"minecraft:nether_gold_ore" : 543,
"minecraft:crying_obsidian" : 544,
"minecraft:soul_campfire" : 545,
"minecraft:polished_blackstone" : 546,
"minecraft:polished_blackstone_stairs" : 547,
"minecraft:polished_blackstone_slab" : 548,
"minecraft:polished_blackstone_double_slab" : 549,
"minecraft:polished_blackstone_pressure_plate" : 550,
"minecraft:polished_blackstone_button" : 551,
"minecraft:polished_blackstone_wall" : 552,
"minecraft:warped_hyphae" : 553,
"minecraft:crimson_hyphae" : 554,
"minecraft:stripped_crimson_hyphae" : 555,
"minecraft:stripped_warped_hyphae" : 556,
"minecraft:chiseled_nether_bricks" : 557,
"minecraft:cracked_nether_bricks" : 558,
"minecraft:quartz_bricks" : 559
}

View file

@ -1,255 +0,0 @@
{
"minecraft:iron_shovel" : 256,
"minecraft:iron_pickaxe" : 257,
"minecraft:iron_axe" : 258,
"minecraft:flint_and_steel" : 259,
"minecraft:apple" : 260,
"minecraft:bow" : 261,
"minecraft:arrow" : 262,
"minecraft:coal" : 263,
"minecraft:diamond" : 264,
"minecraft:iron_ingot" : 265,
"minecraft:gold_ingot" : 266,
"minecraft:iron_sword" : 267,
"minecraft:wooden_sword" : 268,
"minecraft:wooden_shovel" : 269,
"minecraft:wooden_pickaxe" : 270,
"minecraft:wooden_axe" : 271,
"minecraft:stone_sword" : 272,
"minecraft:stone_shovel" : 273,
"minecraft:stone_pickaxe" : 274,
"minecraft:stone_axe" : 275,
"minecraft:diamond_sword" : 276,
"minecraft:diamond_shovel" : 277,
"minecraft:diamond_pickaxe" : 278,
"minecraft:diamond_axe" : 279,
"minecraft:stick" : 280,
"minecraft:bowl" : 281,
"minecraft:mushroom_stew" : 282,
"minecraft:golden_sword" : 283,
"minecraft:golden_shovel" : 284,
"minecraft:golden_pickaxe" : 285,
"minecraft:golden_axe" : 286,
"minecraft:string" : 287,
"minecraft:feather" : 288,
"minecraft:gunpowder" : 289,
"minecraft:wooden_hoe" : 290,
"minecraft:stone_hoe" : 291,
"minecraft:iron_hoe" : 292,
"minecraft:diamond_hoe" : 293,
"minecraft:golden_hoe" : 294,
"minecraft:wheat_seeds" : 295,
"minecraft:wheat" : 296,
"minecraft:bread" : 297,
"minecraft:leather_helmet" : 298,
"minecraft:leather_chestplate" : 299,
"minecraft:leather_leggings" : 300,
"minecraft:leather_boots" : 301,
"minecraft:chainmail_helmet" : 302,
"minecraft:chainmail_chestplate" : 303,
"minecraft:chainmail_leggings" : 304,
"minecraft:chainmail_boots" : 305,
"minecraft:iron_helmet" : 306,
"minecraft:iron_chestplate" : 307,
"minecraft:iron_leggings" : 308,
"minecraft:iron_boots" : 309,
"minecraft:diamond_helmet" : 310,
"minecraft:diamond_chestplate" : 311,
"minecraft:diamond_leggings" : 312,
"minecraft:diamond_boots" : 313,
"minecraft:golden_helmet" : 314,
"minecraft:golden_chestplate" : 315,
"minecraft:golden_leggings" : 316,
"minecraft:golden_boots" : 317,
"minecraft:flint" : 318,
"minecraft:porkchop" : 319,
"minecraft:cooked_porkchop" : 320,
"minecraft:painting" : 321,
"minecraft:golden_apple" : 322,
"minecraft:sign" : 323,
"minecraft:wooden_door" : 324,
"minecraft:bucket" : 325,
"minecraft:minecart" : 328,
"minecraft:saddle" : 329,
"minecraft:iron_door" : 330,
"minecraft:redstone" : 331,
"minecraft:snowball" : 332,
"minecraft:boat" : 333,
"minecraft:leather" : 334,
"minecraft:kelp" : 335,
"minecraft:brick" : 336,
"minecraft:clay_ball" : 337,
"minecraft:reeds" : 338,
"minecraft:paper" : 339,
"minecraft:book" : 340,
"minecraft:slime_ball" : 341,
"minecraft:chest_minecart" : 342,
"minecraft:egg" : 344,
"minecraft:compass" : 345,
"minecraft:fishing_rod" : 346,
"minecraft:clock" : 347,
"minecraft:glowstone_dust" : 348,
"minecraft:fish" : 349,
"minecraft:cooked_fish" : 350,
"minecraft:dye" : 351,
"minecraft:bone" : 352,
"minecraft:sugar" : 353,
"minecraft:cake" : 354,
"minecraft:bed" : 355,
"minecraft:repeater" : 356,
"minecraft:cookie" : 357,
"minecraft:map" : 358,
"minecraft:shears" : 359,
"minecraft:melon" : 360,
"minecraft:pumpkin_seeds" : 361,
"minecraft:melon_seeds" : 362,
"minecraft:beef" : 363,
"minecraft:cooked_beef" : 364,
"minecraft:chicken" : 365,
"minecraft:cooked_chicken" : 366,
"minecraft:rotten_flesh" : 367,
"minecraft:ender_pearl" : 368,
"minecraft:blaze_rod" : 369,
"minecraft:ghast_tear" : 370,
"minecraft:gold_nugget" : 371,
"minecraft:nether_wart" : 372,
"minecraft:potion" : 373,
"minecraft:glass_bottle" : 374,
"minecraft:spider_eye" : 375,
"minecraft:fermented_spider_eye" : 376,
"minecraft:blaze_powder" : 377,
"minecraft:magma_cream" : 378,
"minecraft:brewing_stand" : 379,
"minecraft:cauldron" : 380,
"minecraft:ender_eye" : 381,
"minecraft:speckled_melon" : 382,
"minecraft:spawn_egg" : 383,
"minecraft:experience_bottle" : 384,
"minecraft:fireball" : 385,
"minecraft:writable_book" : 386,
"minecraft:written_book" : 387,
"minecraft:emerald" : 388,
"minecraft:frame" : 389,
"minecraft:flower_pot" : 390,
"minecraft:carrot" : 391,
"minecraft:potato" : 392,
"minecraft:baked_potato" : 393,
"minecraft:poisonous_potato" : 394,
"minecraft:emptymap" : 395,
"minecraft:golden_carrot" : 396,
"minecraft:skull" : 397,
"minecraft:carrotonastick" : 398,
"minecraft:netherstar" : 399,
"minecraft:pumpkin_pie" : 400,
"minecraft:fireworks" : 401,
"minecraft:fireworkscharge" : 402,
"minecraft:enchanted_book" : 403,
"minecraft:comparator" : 404,
"minecraft:netherbrick" : 405,
"minecraft:quartz" : 406,
"minecraft:tnt_minecart" : 407,
"minecraft:hopper_minecart" : 408,
"minecraft:prismarine_shard" : 409,
"minecraft:hopper" : 410,
"minecraft:rabbit" : 411,
"minecraft:cooked_rabbit" : 412,
"minecraft:rabbit_stew" : 413,
"minecraft:rabbit_foot" : 414,
"minecraft:rabbit_hide" : 415,
"minecraft:horsearmorleather" : 416,
"minecraft:horsearmoriron" : 417,
"minecraft:horsearmorgold" : 418,
"minecraft:horsearmordiamond" : 419,
"minecraft:lead" : 420,
"minecraft:name_tag" : 421,
"minecraft:prismarine_crystals" : 422,
"minecraft:muttonraw" : 423,
"minecraft:muttoncooked" : 424,
"minecraft:armor_stand" : 425,
"minecraft:end_crystal" : 426,
"minecraft:spruce_door" : 427,
"minecraft:birch_door" : 428,
"minecraft:jungle_door" : 429,
"minecraft:acacia_door" : 430,
"minecraft:dark_oak_door" : 431,
"minecraft:chorus_fruit" : 432,
"minecraft:chorus_fruit_popped" : 433,
"minecraft:banner_pattern" : 434,
"minecraft:dragon_breath" : 437,
"minecraft:splash_potion" : 438,
"minecraft:lingering_potion" : 441,
"minecraft:sparkler" : 442,
"minecraft:command_block_minecart" : 443,
"minecraft:elytra" : 444,
"minecraft:shulker_shell" : 445,
"minecraft:banner" : 446,
"minecraft:medicine" : 447,
"minecraft:balloon" : 448,
"minecraft:rapid_fertilizer" : 449,
"minecraft:totem" : 450,
"minecraft:bleach" : 451,
"minecraft:iron_nugget" : 452,
"minecraft:ice_bomb" : 453,
"minecraft:trident" : 455,
"minecraft:beetroot" : 457,
"minecraft:beetroot_seeds" : 458,
"minecraft:beetroot_soup" : 459,
"minecraft:salmon" : 460,
"minecraft:clownfish" : 461,
"minecraft:pufferfish" : 462,
"minecraft:cooked_salmon" : 463,
"minecraft:dried_kelp" : 464,
"minecraft:nautilus_shell" : 465,
"minecraft:appleenchanted" : 466,
"minecraft:heart_of_the_sea" : 467,
"minecraft:turtle_shell_piece" : 468,
"minecraft:turtle_helmet" : 469,
"minecraft:phantom_membrane" : 470,
"minecraft:crossbow" : 471,
"minecraft:spruce_sign" : 472,
"minecraft:birch_sign" : 473,
"minecraft:jungle_sign" : 474,
"minecraft:acacia_sign" : 475,
"minecraft:darkoak_sign" : 476,
"minecraft:sweet_berries" : 477,
"minecraft:camera" : 498,
"minecraft:compound" : 499,
"minecraft:record_13" : 500,
"minecraft:record_cat" : 501,
"minecraft:record_blocks" : 502,
"minecraft:record_chirp" : 503,
"minecraft:record_far" : 504,
"minecraft:record_mall" : 505,
"minecraft:record_mellohi" : 506,
"minecraft:record_stal" : 507,
"minecraft:record_strad" : 508,
"minecraft:record_ward" : 509,
"minecraft:record_11" : 510,
"minecraft:record_wait" : 511,
"minecraft:shield" : 513,
"minecraft:campfire" : 720,
"minecraft:suspicious_stew" : 734,
"minecraft:honeycomb" : 736,
"minecraft:honey_bottle" : 737,
"minecraft:lodestonecompass" : 741,
"minecraft:netherite_ingot" : 742,
"minecraft:netherite_sword" : 743,
"minecraft:netherite_shovel" : 744,
"minecraft:netherite_pickaxe" : 745,
"minecraft:netherite_axe" : 746,
"minecraft:netherite_hoe" : 747,
"minecraft:netherite_helmet" : 748,
"minecraft:netherite_chestplate" : 749,
"minecraft:netherite_leggings" : 750,
"minecraft:netherite_boots" : 751,
"minecraft:netherite_scrap" : 752,
"minecraft:crimson_sign" : 753,
"minecraft:warped_sign" : 754,
"minecraft:crimson_door" : 755,
"minecraft:warped_door" : 756,
"minecraft:warped_fungus_on_a_stick" : 757,
"minecraft:chain" : 758,
"minecraft:record_pigstep" : 759,
"minecraft:nether_sprouts" : 760,
"minecraft:soul_campfire" : 801
}

@ -1 +1 @@
Subproject commit 555dbabe56bdf9da44c08e338f7a2321afa14ca7 Subproject commit 5c1da92b7144096449fc02c42a1adcd3fba7f52f

15
pom.xml
View file

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.geysermc</groupId> <groupId>org.geysermc</groupId>
<artifactId>geyser-parent</artifactId> <artifactId>geyser-parent</artifactId>
<version>parent</version> <version>1.2.0-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>Geyser</name> <name>Geyser</name>
<description>Allows for players from Minecraft Bedrock Edition to join Minecraft Java Edition servers.</description> <description>Allows for players from Minecraft Bedrock Edition to join Minecraft Java Edition servers.</description>
@ -71,19 +71,6 @@
</repository> </repository>
</repositories> </repositories>
<distributionManagement>
<repository>
<id>releases</id>
<name>opencollab-releases</name>
<url>https://repo.opencollab.dev/maven-releases</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>opencollab-snapshots</name>
<url>https://repo.opencollab.dev/maven-snapshots</url>
</snapshotRepository>
</distributionManagement>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>