AltControl implementation #7
3 changed files with 4 additions and 3 deletions
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Add table
Reference in a new issue