3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-04 23:30:17 +01:00
Dieser Commit ist enthalten in:
AJ Ferguson 2020-02-05 20:23:06 -09:00
Ursprung e4ab4b336c
Commit 516fc51162
3 geänderte Dateien mit 5 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -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);
}
}

Datei anzeigen

@ -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++) {

Datei anzeigen

@ -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;
}
}