3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-09-08 22:02:50 +02:00

Addd get/setBlock to the interface of ChunkSection

Dieser Commit ist enthalten in:
Matsv 2017-06-01 15:44:41 +02:00
Ursprung a8e3d9ec95
Commit 08528a1745
3 geänderte Dateien mit 14 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -3,6 +3,10 @@ package us.myles.ViaVersion.api.minecraft.chunks;
import io.netty.buffer.ByteBuf;
public interface ChunkSection {
int getBlock(int x, int y, int z);
void setBlock(int x, int y, int z, int type, int data);
int getBlockId(int x, int y, int z);
void writeBlocks(ByteBuf output) throws Exception;

Datei anzeigen

@ -48,8 +48,12 @@ public class ChunkSection1_9_1_2 implements ChunkSection {
}
public int getBlockId(int x, int y, int z) {
return getBlock(x, y, z) >> 4;
}
public int getBlock(int x, int y, int z) {
int index = blocks[index(x, y, z)];
return palette.get(index) >> 4;
return palette.get(index);
}
/**

Datei anzeigen

@ -47,8 +47,12 @@ public class ChunkSection1_9to1_8 implements ChunkSection {
}
public int getBlockId(int x, int y, int z) {
return getBlock(x, y, z) >> 4;
}
public int getBlock(int x, int y, int z) {
int index = blocks[index(x, y, z)];
return palette.get(index) >> 4;
return palette.get(index);
}
/**