fix: 1000 years old core issue fixed with simple math function

(hopefully)
This commit is contained in:
Chayapak Supasakul 2026-01-08 17:25:14 +07:00
parent 590b954c30
commit 6dc1c26a85
Signed by: ChomeNS
SSH key fingerprint: SHA256:0YoxhdyXsgbc0nfeB2N6FYE60mxMU7DS4uCUMaw2mvA

View file

@ -181,7 +181,7 @@ public class CommandCore implements Listener {
if (world == null || noPos == null) return;
// also delete the old core
if (withPos != null) {
if (withPos != null && !isSingleBlock) {
pendingCommands.add(
String.format(
"fill %d %d %d %d %d %d air",
@ -246,7 +246,7 @@ public class CommandCore implements Listener {
if (player == null || connection == null) return;
final int distanceSquared = player.chunkPosition().distanceSquared(new ChunkPos(origin));
final int distance = (int) Math.sqrt(distanceSquared);
final int distance = (int) Math.sqrt(Math.abs(distanceSquared));
final int simulationDistance = connection.getLevel().getServerSimulationDistance();