mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-15 08:25:21 +01:00
Merge branch 'dev-world-scripts' of https://github.com/Grasscutters/Grasscutter into development
This commit is contained in:
@@ -137,6 +137,9 @@ public class ConfigContainer {
|
||||
public int bindPort = 22102;
|
||||
/* This is the port used in the default region. */
|
||||
public int accessPort = 0;
|
||||
/* Entities within a certain range will be loaded for the player */
|
||||
public int loadEntitiesForPlayerRange = 100;
|
||||
public boolean enableScriptInBigWorld = false;
|
||||
public boolean enableConsole = true;
|
||||
public GameOptions gameOptions = new GameOptions();
|
||||
public JoinOptions joinOptions = new JoinOptions();
|
||||
|
||||
@@ -9,6 +9,7 @@ import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -103,7 +104,7 @@ public final class FileUtils {
|
||||
|
||||
result = Arrays.stream(f.listFiles()).map(File::toPath).toList();
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package emu.grasscutter.utils;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import com.github.davidmoten.rtreemulti.geometry.Point;
|
||||
import dev.morphia.annotations.Entity;
|
||||
import emu.grasscutter.net.proto.VectorOuterClass.Vector;
|
||||
|
||||
@@ -162,4 +162,20 @@ public class Position implements Serializable {
|
||||
.setZ(this.getZ())
|
||||
.build();
|
||||
}
|
||||
public Point toPoint(){
|
||||
return Point.create(x,y,z);
|
||||
}
|
||||
|
||||
/**
|
||||
* To XYZ array for Spatial Index
|
||||
*/
|
||||
public double[] toDoubleArray(){
|
||||
return new double[]{ x, y, z};
|
||||
}
|
||||
/**
|
||||
* To XZ array for Spatial Index (Blocks)
|
||||
*/
|
||||
public double[] toXZDoubleArray(){
|
||||
return new double[]{x, z};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user