geforkt von Mirrors/AxiomPaperPlugin
Fix negative chunk coordinate conversion
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Dieser Commit ist enthalten in:
Ursprung
5797d0e0be
Commit
307fe08bd6
@ -46,13 +46,16 @@ public class SetBlockPacketListener implements AxiomPacketListener {
|
|||||||
int x = getX.invoke(pos);
|
int x = getX.invoke(pos);
|
||||||
int y = getY.invoke(pos);
|
int y = getY.invoke(pos);
|
||||||
int z = getZ.invoke(pos);
|
int z = getZ.invoke(pos);
|
||||||
|
int cx = x / 16 - (x < 0 ? 1 : 0);
|
||||||
|
int cy = y / 16 - (y < 0 ? 1 : 0);
|
||||||
|
int cz = z / 16 - (z < 0 ? 1 : 0);
|
||||||
|
|
||||||
// Update blocks
|
// Update blocks
|
||||||
if(RegionProtection.getProtection.apply(player, world).canBuildInSection(x / 16, y / 16, z / 16)) {
|
if(RegionProtection.getProtection.apply(player, world).canBuildInSection(cx, cy, cz)) {
|
||||||
if (updateNeighbors) {
|
if (updateNeighbors) {
|
||||||
setBlock.invoke(AxiomPaper.convert(player.getWorld()), pos, state, 3);
|
setBlock.invoke(AxiomPaper.convert(player.getWorld()), pos, state, 3);
|
||||||
} else {
|
} else {
|
||||||
ChunkSectionModifier section = new ChunkSectionModifier(player.getWorld(), x / 16, y / 16, z / 16);
|
ChunkSectionModifier section = new ChunkSectionModifier(player.getWorld(), cx, cy, cz);
|
||||||
section.setState(x & 0xF, y & 0xF, z & 0xF, state);
|
section.setState(x & 0xF, y & 0xF, z & 0xF, state);
|
||||||
section.finish();
|
section.finish();
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren