Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-03 14:50:30 +01:00
Addd get/setBlock to the interface of ChunkSection
Dieser Commit ist enthalten in:
Ursprung
a8e3d9ec95
Commit
08528a1745
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren