forked from GeyserMC/Geyser
Small changes
This commit is contained in:
parent
e4ab4b336c
commit
516fc51162
3 changed files with 5 additions and 5 deletions
|
@ -34,6 +34,6 @@ public class BlockTranslator {
|
|||
}
|
||||
|
||||
public BlockEntry getBlockEntry(String javaIdentifier) {
|
||||
return Toolbox.JAVA_IDENTIFIER_TO_ENTRY.get(javaIdentifier);
|
||||
return Toolbox.JAVA_IDENTIFIER_TO_BLOCK_ENTRY.get(javaIdentifier);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,13 +77,13 @@ public class JavaChunkDataTranslator extends PacketTranslator<ServerChunkDataPac
|
|||
levelChunkPacket.setData(payload);
|
||||
session.getUpstream().sendPacket(levelChunkPacket);
|
||||
} else {
|
||||
final int xOffset = packet.getColumn().getX() << 4;
|
||||
final int zOffset = packet.getColumn().getZ() << 4;
|
||||
Chunk[] chunks = packet.getColumn().getChunks();
|
||||
for (int i = 0; i < chunks.length; i++) {
|
||||
Chunk chunk = chunks[i];
|
||||
if (chunk == null) continue;
|
||||
final int xOffset = packet.getColumn().getX() << 4;
|
||||
final int yOffset = i * 16;
|
||||
final int zOffset = packet.getColumn().getZ() << 4;
|
||||
for (int x = 0; x < 16; x++) {
|
||||
for (int y = 0; y < 16; y++) {
|
||||
for (int z = 0; z < 16; z++) {
|
||||
|
|
|
@ -50,7 +50,7 @@ public class Toolbox {
|
|||
|
||||
public static final Int2ObjectMap<ItemEntry> ITEM_ENTRIES = new Int2ObjectOpenHashMap<>();
|
||||
public static final Int2ObjectMap<BlockEntry> BLOCK_ENTRIES = new Int2ObjectOpenHashMap<>();
|
||||
public static final Map<String, BlockEntry> JAVA_IDENTIFIER_TO_ENTRY = new HashMap<>();
|
||||
public static final Map<String, BlockEntry> JAVA_IDENTIFIER_TO_BLOCK_ENTRY = new HashMap<>();
|
||||
|
||||
public static void init() {
|
||||
InputStream stream = GeyserConnector.class.getClassLoader().getResourceAsStream("bedrock/runtime_block_states.dat");
|
||||
|
@ -141,7 +141,7 @@ public class Toolbox {
|
|||
}
|
||||
BlockEntry blockEntry = new BlockEntry(javaEntry.getKey(), javaIndex, bedrockIndex);
|
||||
BLOCK_ENTRIES.put(javaIndex, blockEntry);
|
||||
JAVA_IDENTIFIER_TO_ENTRY.put(javaEntry.getKey(), blockEntry);
|
||||
JAVA_IDENTIFIER_TO_BLOCK_ENTRY.put(javaEntry.getKey(), blockEntry);
|
||||
continue javaLoop;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue