fix selection splitting

This commit is contained in:
Daniella / Tove 2024-05-31 21:04:04 +02:00
parent ed03536d5a
commit daf7635cef
Signed by: TudbuT
GPG key ID: B3CF345217F202D3
3 changed files with 4 additions and 3 deletions

View file

@ -78,6 +78,7 @@ public class RemoteEventManager {
private void runServer() {
try {
id = 0;
peers = 1;
server.setSoTimeout(1);
while(server != null) {
try {
@ -89,7 +90,7 @@ public class RemoteEventManager {
s.getOutputStream().flush();
s.setSoTimeout(1);
clients.add(s);
publish(new RemoteInitEvent(clients.size()));
publish(new RemoteInitEvent(clients.size() + 1));
BaseBand.notify("[Remote] Client connected.");
} else {
s.close();

View file

@ -18,7 +18,7 @@ public class BlockUtils {
zSideLength = sideLength;
for (int i = 0; i < selections.length; i++) {
BlockPos pos1 = selection.pos1.add(xSideLength * i, 0, zSideLength * i);
BlockPos pos2 = selection.pos2.add(Math.min(xSideLength * (i + 1), size.getX()), 0, Math.min(zSideLength * (i + 1), size.getZ()));
BlockPos pos2 = selection.pos2.add(Math.min(xSideLength * (i + 1), size.getX() - 1), 0, Math.min(zSideLength * (i + 1), size.getZ() - 1));
selections[i] = new Selection(pos1, pos2);
}
return selections;

View file

@ -18,7 +18,7 @@ public class Selection {
public long area() {
Vec3i size = size();
return (long) size.getX() * size.getX() * size.getX();
return (long) size.getX() * size.getY() * size.getZ();
}
public long longestSide() {