mirror of
https://gitlab.com/distant-horizons-team/distant-horizons-server-plugin.git
synced 2026-11-07 09:52:41 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b04ae153e | ||
|
|
f7f723b7c6 | ||
|
|
4e8cb7fdf2 | ||
|
|
3e49275c63 | ||
|
|
d349cd038e | ||
|
|
5452cab99a | ||
|
|
f22fb514b2 | ||
|
|
3e5fa994dc | ||
|
|
e5989134cc | ||
|
|
8c830e30ae | ||
|
|
aca9769658 | ||
|
|
6aa41955fe | ||
|
|
50730d0f11 | ||
|
|
2f4a070be8 | ||
|
|
0c76ae7748 | ||
|
|
b8b6bd1b84 | ||
|
|
49beaea384 | ||
|
|
1b71004a64 | ||
|
|
3e530589f4 | ||
|
|
43695a4c22 | ||
|
|
b57d40742f | ||
|
|
6e78561671 | ||
|
|
d48fe0934f | ||
|
|
7a2992d47c | ||
|
|
de03cad4f0 |
No files matched your search
@@ -0,0 +1 @@
|
||||
ko_fi: jimckf
|
||||
@@ -21,10 +21,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up JDK 17
|
||||
- name: Set up JDK 21
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '17'
|
||||
java-version: '21'
|
||||
distribution: 'temurin'
|
||||
cache: maven
|
||||
- name: Build with Maven
|
||||
|
||||
@@ -25,10 +25,13 @@ replay_pid*
|
||||
|
||||
# IntelliJ IDEA project config
|
||||
/.idea
|
||||
/*.iml
|
||||
|
||||
# Maven output
|
||||
/dependency-reduced-pom.xml
|
||||
/target
|
||||
/jars
|
||||
|
||||
# Test server
|
||||
/server
|
||||
/folia
|
||||
@@ -1,6 +1,6 @@
|
||||
# Server-side support for [Distant Horizons](https://gitlab.com/jeseibel/distant-horizons)
|
||||
|
||||
DH Support is a Bukkit/Spigot/Paper server plugin that transmits Level Of Detail (LOD) data to connected clients in order to provide a much higher view distance than Minecraft normally would allow. Distant Horizons _will_ work fine without this plugin, but then each client will have to be within normal view distance of chunks to load them, and they will not receive updates for distant chunks when they change.
|
||||
DH Support is a Bukkit/Spigot/Paper/Folia server plugin that transmits Level Of Detail (LOD) data to players with Distant Horizons installed. Distant Horizons _will_ work fine without this plugin, but then each client will have to be within normal view distance of chunks to load them, and they will not receive updates for distant chunks when they change.
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -10,10 +10,12 @@ Download the [latest release](https://github.com/Jckf/DH-Support/releases) and d
|
||||
|
||||
The default values should be pretty solid, but you may tweak them to better suit your specific needs. Everything you need to know should be in config.yml.
|
||||
|
||||
## Compilation
|
||||
## Building
|
||||
|
||||
The project uses Maven, so just run `mvn` in the project directory to compile and package a new JAR.
|
||||
|
||||
## Contribution
|
||||
|
||||
There are several ways to contribute to this project. You can offer your feedback on [the DH Discord](https://discord.gg/xAB8G4cENx) in [this thread](https://discord.com/channels/881614130614767666/1154490009735417989), report any issues or bugs you find, or attack an open issue and submit a pull request.
|
||||
There are several ways to contribute to this project. You can offer your feedback on [the DH Discord](https://discord.gg/xAB8G4cENx) in [this thread](https://discord.com/channels/881614130614767666/1154490009735417989), report any issues or bugs you find, attack an open issue and submit a pull request, or even [leave a donation](https://ko-fi.com/jimckf) ❤️
|
||||
|
||||

|
||||
@@ -0,0 +1,27 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>DHSupport-${mc.api-version}${mc.api-version-patch}</artifactId>
|
||||
|
||||
<parent>
|
||||
<groupId>no.jckf</groupId>
|
||||
<artifactId>DHSupport</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>./pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<mc.api-version>1.16</mc.api-version>
|
||||
<mc.api-version-patch>.5</mc.api-version-patch>
|
||||
<dhs.read-forge-byte>true</dhs.read-forge-byte>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>${mc.api-version}${mc.api-version-patch}-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,27 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>DHSupport-${mc.api-version}${mc.api-version-patch}</artifactId>
|
||||
|
||||
<parent>
|
||||
<groupId>no.jckf</groupId>
|
||||
<artifactId>DHSupport</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>./pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<mc.api-version>1.17</mc.api-version>
|
||||
<mc.api-version-patch>.1</mc.api-version-patch>
|
||||
<dhs.read-forge-byte>true</dhs.read-forge-byte>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.papermc.paper</groupId>
|
||||
<artifactId>paper-api</artifactId>
|
||||
<version>${mc.api-version}${mc.api-version-patch}-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,27 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>DHSupport-${mc.api-version}${mc.api-version-patch}</artifactId>
|
||||
|
||||
<parent>
|
||||
<groupId>no.jckf</groupId>
|
||||
<artifactId>DHSupport</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>./pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<mc.api-version>1.18</mc.api-version>
|
||||
<mc.api-version-patch>.2</mc.api-version-patch>
|
||||
<dhs.read-forge-byte>true</dhs.read-forge-byte>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.papermc.paper</groupId>
|
||||
<artifactId>paper-api</artifactId>
|
||||
<version>${mc.api-version}${mc.api-version-patch}-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,27 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>DHSupport-${mc.api-version}${mc.api-version-patch}</artifactId>
|
||||
|
||||
<parent>
|
||||
<groupId>no.jckf</groupId>
|
||||
<artifactId>DHSupport</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>./pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<mc.api-version>1.19</mc.api-version>
|
||||
<mc.api-version-patch>.2</mc.api-version-patch>
|
||||
<dhs.read-forge-byte>true</dhs.read-forge-byte>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.papermc.paper</groupId>
|
||||
<artifactId>paper-api</artifactId>
|
||||
<version>${mc.api-version}${mc.api-version-patch}-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,27 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>DHSupport-${mc.api-version}${mc.api-version-patch}</artifactId>
|
||||
|
||||
<parent>
|
||||
<groupId>no.jckf</groupId>
|
||||
<artifactId>DHSupport</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>./pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<mc.api-version>1.19</mc.api-version>
|
||||
<mc.api-version-patch>.4</mc.api-version-patch>
|
||||
<dhs.read-forge-byte>true</dhs.read-forge-byte>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.papermc.paper</groupId>
|
||||
<artifactId>paper-api</artifactId>
|
||||
<version>${mc.api-version}${mc.api-version-patch}-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,27 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>DHSupport-${mc.api-version}${mc.api-version-patch}</artifactId>
|
||||
|
||||
<parent>
|
||||
<groupId>no.jckf</groupId>
|
||||
<artifactId>DHSupport</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>./pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<mc.api-version>1.20</mc.api-version>
|
||||
<mc.api-version-patch>.1</mc.api-version-patch>
|
||||
<dhs.read-forge-byte>true</dhs.read-forge-byte>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.papermc.paper</groupId>
|
||||
<artifactId>paper-api</artifactId>
|
||||
<version>${mc.api-version}${mc.api-version-patch}-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,27 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>DHSupport-${mc.api-version}${mc.api-version-patch}</artifactId>
|
||||
|
||||
<parent>
|
||||
<groupId>no.jckf</groupId>
|
||||
<artifactId>DHSupport</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>./pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<mc.api-version>1.20</mc.api-version>
|
||||
<mc.api-version-patch>.2</mc.api-version-patch>
|
||||
<dhs.read-forge-byte>true</dhs.read-forge-byte>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.papermc.paper</groupId>
|
||||
<artifactId>paper-api</artifactId>
|
||||
<version>${mc.api-version}${mc.api-version-patch}-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,27 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>DHSupport-${mc.api-version}${mc.api-version-patch}</artifactId>
|
||||
|
||||
<parent>
|
||||
<groupId>no.jckf</groupId>
|
||||
<artifactId>DHSupport</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>./pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<mc.api-version>1.20</mc.api-version>
|
||||
<mc.api-version-patch>.4</mc.api-version-patch>
|
||||
<dhs.read-forge-byte>true</dhs.read-forge-byte>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.papermc.paper</groupId>
|
||||
<artifactId>paper-api</artifactId>
|
||||
<version>${mc.api-version}${mc.api-version-patch}-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,25 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>DHSupport-${mc.api-version}</artifactId>
|
||||
|
||||
<parent>
|
||||
<groupId>no.jckf</groupId>
|
||||
<artifactId>DHSupport</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>./pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<mc.api-version>1.20.6</mc.api-version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.papermc.paper</groupId>
|
||||
<artifactId>paper-api</artifactId>
|
||||
<version>${mc.api-version}-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,25 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>DHSupport-${mc.api-version}</artifactId>
|
||||
|
||||
<parent>
|
||||
<groupId>no.jckf</groupId>
|
||||
<artifactId>DHSupport</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>./pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<mc.api-version>1.21</mc.api-version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.papermc.paper</groupId>
|
||||
<artifactId>paper-api</artifactId>
|
||||
<version>${mc.api-version}-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -2,14 +2,18 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>no.jckf</groupId>
|
||||
<name>dh-support</name>
|
||||
<version>0.2.2</version>
|
||||
<artifactId>DHSupport</artifactId>
|
||||
<version>${revision}</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<properties>
|
||||
<jdk>17</jdk>
|
||||
<revision>0.3.0</revision>
|
||||
<jdk>21</jdk>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<main.class>no.jckf.dhsupport.bukkit.DhSupportBukkitPlugin</main.class>
|
||||
<mc.api-version></mc.api-version>
|
||||
<mc.api-version-patch></mc.api-version-patch>
|
||||
<dhs.read-forge-byte></dhs.read-forge-byte>
|
||||
</properties>
|
||||
|
||||
<developers>
|
||||
@@ -30,16 +34,19 @@
|
||||
<id>spigot-repo</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots</url>
|
||||
</repository>
|
||||
|
||||
<repository>
|
||||
<id>papermc</id>
|
||||
<url>https://repo.papermc.io/repository/maven-public</url>
|
||||
</repository>
|
||||
|
||||
<repository>
|
||||
<id>jitpack</id>
|
||||
<url>https://jitpack.io</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.21-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.bstats</groupId>
|
||||
<artifactId>bstats-bukkit</artifactId>
|
||||
@@ -50,7 +57,7 @@
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>33.2.1-jre</version>
|
||||
<version>33.3.0-jre</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -67,11 +74,17 @@
|
||||
<version>1.8.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.technicallycoded</groupId>
|
||||
<artifactId>FoliaLib</artifactId>
|
||||
<version>v0.4.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<defaultGoal>clean install</defaultGoal>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<defaultGoal>clean package</defaultGoal>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
@@ -83,6 +96,19 @@
|
||||
<source>${jdk}</source>
|
||||
<target>${jdk}</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
|
||||
<compilerArgs>
|
||||
<arg>-Xplugin:Manifold</arg>
|
||||
<arg>-AREAD_FORGE_BYTE=${dhs.read-forge-byte}</arg>
|
||||
</compilerArgs>
|
||||
|
||||
<annotationProcessorPaths>
|
||||
<path>
|
||||
<groupId>systems.manifold</groupId>
|
||||
<artifactId>manifold-preprocessor</artifactId>
|
||||
<version>2024.1.30</version>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
@@ -92,7 +118,7 @@
|
||||
<version>3.6.0</version>
|
||||
|
||||
<configuration>
|
||||
<shadedArtifactAttached>true</shadedArtifactAttached>
|
||||
<shadedArtifactAttached>false</shadedArtifactAttached>
|
||||
<shadedClassifierName>all</shadedClassifierName>
|
||||
|
||||
<relocations>
|
||||
@@ -105,6 +131,11 @@
|
||||
<pattern>org.bstats</pattern>
|
||||
<shadedPattern>no.jckf.dhsupport.bstats</shadedPattern>
|
||||
</relocation>
|
||||
|
||||
<relocation>
|
||||
<pattern>com.tcoded.folialib</pattern>
|
||||
<shadedPattern>no.jckf.dhsupport.folialib</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
</configuration>
|
||||
|
||||
@@ -117,16 +148,55 @@
|
||||
</goals>
|
||||
|
||||
<configuration>
|
||||
<filters>
|
||||
<filter>
|
||||
<artifact>*:*</artifact>
|
||||
<excludes>
|
||||
<exclude>META-INF/*</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
</filters>
|
||||
<artifactSet>
|
||||
<includes>
|
||||
<include>org.lz4</include>
|
||||
<include>org.bstats</include>
|
||||
<include>com.github.technicallycoded</include>
|
||||
</includes>
|
||||
</artifactSet>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>2.8</version>
|
||||
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
|
||||
<goals>
|
||||
<goal>copy</goal>
|
||||
</goals>
|
||||
|
||||
<configuration>
|
||||
<outputDirectory>jars</outputDirectory>
|
||||
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>${project.artifactId}</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>${project.packaging}</type>
|
||||
<destFileName>DHS-${project.version}_for_MC-${mc.api-version}${mc.api-version-patch}.jar</destFileName>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
<resources>
|
||||
@@ -150,4 +220,17 @@
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
<modules>
|
||||
<module>pom-1.16.5.xml</module>
|
||||
<module>pom-1.17.1.xml</module>
|
||||
<module>pom-1.18.2.xml</module>
|
||||
<module>pom-1.19.2.xml</module>
|
||||
<module>pom-1.19.4.xml</module>
|
||||
<module>pom-1.20.1.xml</module>
|
||||
<module>pom-1.20.2.xml</module>
|
||||
<module>pom-1.20.4.xml</module>
|
||||
<module>pom-1.20.6.xml</module>
|
||||
<module>pom-1.21.xml</module>
|
||||
</modules>
|
||||
</project>
|
||||
@@ -18,12 +18,15 @@
|
||||
|
||||
package no.jckf.dhsupport.bukkit;
|
||||
|
||||
import no.jckf.dhsupport.core.configuration.Configuration;
|
||||
import no.jckf.dhsupport.core.configuration.WorldConfiguration;
|
||||
import no.jckf.dhsupport.core.world.WorldInterface;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public class BukkitWorldInterface implements WorldInterface
|
||||
{
|
||||
@@ -31,15 +34,21 @@ public class BukkitWorldInterface implements WorldInterface
|
||||
|
||||
protected Block block;
|
||||
|
||||
public BukkitWorldInterface(World world)
|
||||
protected Configuration config;
|
||||
|
||||
protected WorldConfiguration worldConfig;
|
||||
|
||||
public BukkitWorldInterface(World world, Configuration config)
|
||||
{
|
||||
this.world = world;
|
||||
this.config = config;
|
||||
this.worldConfig = new WorldConfiguration(this, config);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorldInterface newInstance()
|
||||
{
|
||||
return new BukkitWorldInterface(this.world);
|
||||
return new BukkitWorldInterface(this.world, this.config);
|
||||
}
|
||||
|
||||
// Shitty cache :)
|
||||
@@ -52,6 +61,39 @@ public class BukkitWorldInterface implements WorldInterface
|
||||
return this.block;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UUID getId()
|
||||
{
|
||||
return this.world.getUID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return this.world.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean chunkExists(int x, int z)
|
||||
{
|
||||
int chunkX = (int) Math.floor((double) x / 16);
|
||||
int chunkZ = (int) Math.floor((double) z / 16);
|
||||
|
||||
boolean alreadyLoaded = this.world.isChunkLoaded(chunkX, chunkZ);
|
||||
|
||||
if (alreadyLoaded) {
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean exists = this.world.loadChunk(chunkX, chunkZ, false);
|
||||
|
||||
if (exists) {
|
||||
this.world.unloadChunk(chunkX, chunkZ, false);
|
||||
}
|
||||
|
||||
return exists;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinY()
|
||||
{
|
||||
@@ -135,4 +177,10 @@ public class BukkitWorldInterface implements WorldInterface
|
||||
{
|
||||
return this.getBlock(x, y, z).getBlockData().getMaterial().isTransparent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Configuration getConfig()
|
||||
{
|
||||
return this.worldConfig;
|
||||
}
|
||||
}
|
||||
@@ -18,11 +18,15 @@
|
||||
|
||||
package no.jckf.dhsupport.bukkit;
|
||||
|
||||
import com.tcoded.folialib.FoliaLib;
|
||||
import no.jckf.dhsupport.bukkit.handler.ConfigLoader;
|
||||
import no.jckf.dhsupport.bukkit.handler.Handler;
|
||||
import no.jckf.dhsupport.bukkit.handler.PluginMessageProxy;
|
||||
import no.jckf.dhsupport.bukkit.handler.WorldHandler;
|
||||
import no.jckf.dhsupport.core.DhSupport;
|
||||
import no.jckf.dhsupport.core.configuration.DhsConfig;
|
||||
import no.jckf.dhsupport.core.scheduling.GenericScheduler;
|
||||
import no.jckf.dhsupport.paper.PaperScheduler;
|
||||
import org.bstats.bukkit.Metrics;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
@@ -36,6 +40,8 @@ public class DhSupportBukkitPlugin extends JavaPlugin
|
||||
|
||||
protected Metrics metrics;
|
||||
|
||||
protected FoliaLib foliaLib;
|
||||
|
||||
protected final Map<Class<? extends Handler>, Handler> handlers = new HashMap<>()
|
||||
{{
|
||||
this.put(ConfigLoader.class, null);
|
||||
@@ -48,6 +54,8 @@ public class DhSupportBukkitPlugin extends JavaPlugin
|
||||
this.dhSupport = new DhSupport();
|
||||
this.dhSupport.setLogger(this.getLogger());
|
||||
|
||||
this.foliaLib = new FoliaLib(this);
|
||||
|
||||
this.metrics = new Metrics(this, 21843);
|
||||
|
||||
for (Class<? extends Handler> className : this.handlers.keySet()) {
|
||||
@@ -69,6 +77,16 @@ public class DhSupportBukkitPlugin extends JavaPlugin
|
||||
|
||||
this.dhSupport.onEnable();
|
||||
|
||||
if (this.foliaLib.isFolia()) {
|
||||
this.getLogger().info("Using Paper scheduler.");
|
||||
|
||||
this.dhSupport.setScheduler(new PaperScheduler(this, this.foliaLib));
|
||||
} else {
|
||||
this.getLogger().info("Using generic scheduler.");
|
||||
|
||||
this.dhSupport.setScheduler(new GenericScheduler(this.getDhSupport().getConfig().getInt(DhsConfig.GENERIC_SCHEDULER_THREADS)));
|
||||
}
|
||||
|
||||
this.getServer().getPluginManager().registerEvents(new WorldHandler(this), this);
|
||||
|
||||
this.getLogger().info("Ready 😀");
|
||||
|
||||
@@ -41,7 +41,7 @@ public class WorldHandler implements Listener
|
||||
|
||||
protected void addWorldInterface(World world)
|
||||
{
|
||||
this.plugin.getDhSupport().setWorldInterface(world.getUID(), new BukkitWorldInterface(world));
|
||||
this.plugin.getDhSupport().setWorldInterface(world.getUID(), new BukkitWorldInterface(world, this.plugin.getDhSupport().getConfig()));
|
||||
}
|
||||
|
||||
protected void removeWorldInterface(World world)
|
||||
|
||||
@@ -27,6 +27,7 @@ import no.jckf.dhsupport.core.handler.LodHandler;
|
||||
import no.jckf.dhsupport.core.handler.PlayerConfigHandler;
|
||||
import no.jckf.dhsupport.core.handler.PluginMessageHandler;
|
||||
import no.jckf.dhsupport.core.message.plugin.PluginMessageSender;
|
||||
import no.jckf.dhsupport.core.scheduling.Scheduler;
|
||||
import no.jckf.dhsupport.core.world.WorldInterface;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@@ -34,8 +35,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class DhSupport implements Configurable
|
||||
@@ -44,15 +44,15 @@ public class DhSupport implements Configurable
|
||||
|
||||
protected Logger logger;
|
||||
|
||||
protected Scheduler scheduler;
|
||||
|
||||
protected Map<UUID, WorldInterface> worldInterfaces = new HashMap<>();
|
||||
|
||||
protected PluginMessageHandler pluginMessageHandler;
|
||||
|
||||
protected PluginMessageSender pluginMessageSender;
|
||||
|
||||
protected ExecutorService executor;
|
||||
|
||||
protected Map<UUID, Map<String, byte[]>> lodCache = new HashMap<>();
|
||||
protected Map<UUID, Map<String, byte[]>> lodCache = new ConcurrentHashMap<>();
|
||||
|
||||
public DhSupport()
|
||||
{
|
||||
@@ -62,8 +62,6 @@ public class DhSupport implements Configurable
|
||||
|
||||
public void onEnable()
|
||||
{
|
||||
this.executor = Executors.newFixedThreadPool(4);
|
||||
|
||||
(new PlayerConfigHandler(this, this.pluginMessageHandler)).register();
|
||||
(new LodHandler(this, this.pluginMessageHandler)).register();
|
||||
|
||||
@@ -77,6 +75,16 @@ public class DhSupport implements Configurable
|
||||
}
|
||||
}
|
||||
|
||||
public void setScheduler(Scheduler scheduler)
|
||||
{
|
||||
this.scheduler = scheduler;
|
||||
}
|
||||
|
||||
public Scheduler getScheduler()
|
||||
{
|
||||
return this.scheduler;
|
||||
}
|
||||
|
||||
public void setWorldInterface(UUID id, @Nullable WorldInterface worldInterface)
|
||||
{
|
||||
if (worldInterface == null) {
|
||||
@@ -149,7 +157,12 @@ public class DhSupport implements Configurable
|
||||
|
||||
public CompletableFuture<Lod> queueBuilder(LodBuilder builder)
|
||||
{
|
||||
return CompletableFuture.supplyAsync(builder::generate, this.executor);
|
||||
return this.getScheduler().runRegional(
|
||||
builder.worldInterface.getId(),
|
||||
builder.position.getX() * 64,
|
||||
builder.position.getZ() * 64,
|
||||
builder::generate
|
||||
);
|
||||
}
|
||||
|
||||
public CompletableFuture<byte[]> getLodData(UUID worldId, SectionPosition position)
|
||||
|
||||
@@ -99,15 +99,15 @@ public class LodBuilder
|
||||
}
|
||||
}
|
||||
|
||||
String compositeKey = biome + "|" + material;
|
||||
//String compositeKey = biome + "|" + material + "|" + this.worldInterface.getBlockStateAsStringAt(worldX, worldY, worldZ);
|
||||
//String compositeKey = biome + "|" + material;
|
||||
String compositeKey = biome + "|" + material + "|" + this.worldInterface.getBlockStateAsStringAt(worldX, worldY, worldZ);
|
||||
|
||||
@Nullable
|
||||
Integer id = mapMap.get(compositeKey);
|
||||
|
||||
if (id == null) {
|
||||
idMappings.add(new IdMapping(biome, material, null));
|
||||
//idMappings.add(new IdMapping(biome, material, this.worldInterface.getBlockPropertiesAt(worldX, worldY, worldZ)));
|
||||
//idMappings.add(new IdMapping(biome, material, null));
|
||||
idMappings.add(new IdMapping(biome, material, this.worldInterface.getBlockPropertiesAt(worldX, worldY, worldZ)));
|
||||
id = idMappings.size() - 1;
|
||||
mapMap.put(compositeKey, id);
|
||||
}
|
||||
|
||||
@@ -38,6 +38,16 @@ public abstract class DhsConfig
|
||||
|
||||
public static String LOGIN_DATA_SYNC_RC_LIMIT = "login_data_sync_rc_limit";
|
||||
|
||||
public static String GENERIC_SCHEDULER_THREADS = "generic_scheduler_threads";
|
||||
|
||||
public static String GENERATE_NEW_CHUNKS = "generate_new_chunks";
|
||||
|
||||
public static String LEVEL_KEY_PREFIX = "level_key_prefix";
|
||||
|
||||
public static String BORDER_CENTER = "border_center";
|
||||
|
||||
public static String BORDER_RADIUS = "border_radius";
|
||||
|
||||
public static Collection<String> getKeys()
|
||||
{
|
||||
List<String> keys = new ArrayList<>();
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package no.jckf.dhsupport.core.configuration;
|
||||
|
||||
import no.jckf.dhsupport.core.world.WorldInterface;
|
||||
|
||||
public class WorldConfiguration extends Configuration
|
||||
{
|
||||
protected static String WORLD_PREFIX = "worlds.%s.";
|
||||
|
||||
protected WorldInterface world;
|
||||
|
||||
protected Configuration config;
|
||||
|
||||
public WorldConfiguration(WorldInterface world, Configuration config)
|
||||
{
|
||||
this.world = world;
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(String key, Object value)
|
||||
{
|
||||
this.config.set(WORLD_PREFIX.formatted(this.world.getName()) + key, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object get(String key)
|
||||
{
|
||||
Object specific = this.config.get(WORLD_PREFIX.formatted(this.world.getName()) + key);
|
||||
|
||||
return specific == null ? this.config.get(key) : specific;
|
||||
}
|
||||
}
|
||||
@@ -19,9 +19,15 @@
|
||||
package no.jckf.dhsupport.core.handler;
|
||||
|
||||
import no.jckf.dhsupport.core.DhSupport;
|
||||
import no.jckf.dhsupport.core.configuration.Configuration;
|
||||
import no.jckf.dhsupport.core.configuration.DhsConfig;
|
||||
import no.jckf.dhsupport.core.dataobject.Lod;
|
||||
import no.jckf.dhsupport.core.dataobject.SectionPosition;
|
||||
import no.jckf.dhsupport.core.message.plugin.ExceptionMessage;
|
||||
import no.jckf.dhsupport.core.message.plugin.FullDataChunkMessage;
|
||||
import no.jckf.dhsupport.core.message.plugin.FullDataSourceRequestMessage;
|
||||
import no.jckf.dhsupport.core.message.plugin.FullDataSourceResponseMessage;
|
||||
import no.jckf.dhsupport.core.world.WorldInterface;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -48,12 +54,73 @@ public class LodHandler
|
||||
this.pluginMessageHandler.getEventBus().registerHandler(FullDataSourceRequestMessage.class, (requestMessage) -> {
|
||||
//this.dhSupport.info("LOD request for " + requestMessage.getPosition().getX() + " x " + requestMessage.getPosition().getZ());
|
||||
|
||||
int myBufferId = this.bufferId++;
|
||||
|
||||
// TODO: Some sort of Player wrapper or interface object. Bukkit classes should not be imported here.
|
||||
UUID worldUuid = Bukkit.getPlayer(requestMessage.getSender()).getWorld().getUID();
|
||||
|
||||
this.dhSupport.getLodData(worldUuid, requestMessage.getPosition())
|
||||
WorldInterface world = this.dhSupport.getWorldInterface(worldUuid);
|
||||
|
||||
Configuration config = world.getConfig();
|
||||
|
||||
SectionPosition position = requestMessage.getPosition();
|
||||
|
||||
String borderCenter = config.getString(DhsConfig.BORDER_CENTER);
|
||||
Integer borderRadius =config.getInt(DhsConfig.BORDER_RADIUS);
|
||||
|
||||
if (borderCenter != null && borderRadius != null) {
|
||||
String[] centerXz = borderCenter.split(",");
|
||||
|
||||
if (centerXz.length != 2) {
|
||||
this.dhSupport.warning("Border for world " + world.getName() + " is misconfigured.");
|
||||
} else {
|
||||
int centerX = Integer.getInteger(centerXz[0]);
|
||||
int centerZ = Integer.getInteger(centerXz[1]);
|
||||
|
||||
int minX = centerX - borderRadius;
|
||||
int maxX = centerX + borderRadius;
|
||||
|
||||
int minZ = centerZ - borderRadius;
|
||||
int maxZ = centerZ + borderRadius;
|
||||
|
||||
int lowerLodX = position.getX() * 64;
|
||||
int higherLodX = lowerLodX + 64;
|
||||
|
||||
int lowerLodZ = position.getZ() * 64;
|
||||
int higherLodZ = lowerLodZ + 64;
|
||||
|
||||
if (higherLodX < minX || lowerLodX > maxX || higherLodZ < minZ || lowerLodZ > maxZ) {
|
||||
ExceptionMessage exceptionMessage = new ExceptionMessage();
|
||||
exceptionMessage.isResponseTo(requestMessage);
|
||||
exceptionMessage.setTypeId(ExceptionMessage.TYPE_REQUEST_REJECTED);
|
||||
exceptionMessage.setMessage("World border");
|
||||
this.pluginMessageHandler.sendPluginMessage(requestMessage.getSender(), exceptionMessage);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boolean generate = config.getBool(DhsConfig.GENERATE_NEW_CHUNKS);
|
||||
|
||||
if (!generate) {
|
||||
for (int relativeChunkX = 0; relativeChunkX < Lod.width / 16; relativeChunkX++) {
|
||||
for (int relativeChunkZ = 0; relativeChunkZ < Lod.width / 16; relativeChunkZ++) {
|
||||
int worldX = position.getX() * 64 + relativeChunkX * 16;
|
||||
int worldZ = position.getZ() * 64 + relativeChunkZ * 16;
|
||||
|
||||
if (!world.chunkExists(worldX, worldZ)) {
|
||||
ExceptionMessage exceptionMessage = new ExceptionMessage();
|
||||
exceptionMessage.isResponseTo(requestMessage);
|
||||
exceptionMessage.setTypeId(ExceptionMessage.TYPE_REQUEST_REJECTED);
|
||||
exceptionMessage.setMessage("Fog of war");
|
||||
this.pluginMessageHandler.sendPluginMessage(requestMessage.getSender(), exceptionMessage);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int myBufferId = this.bufferId++;
|
||||
|
||||
this.dhSupport.getLodData(worldUuid, position)
|
||||
.thenAccept((lod) -> {
|
||||
int chunkCount = (int) Math.ceil((double) lod.length / CHUNK_SIZE);
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import no.jckf.dhsupport.core.configuration.DhsConfig;
|
||||
import no.jckf.dhsupport.core.message.plugin.CurrentLevelKeyMessage;
|
||||
import no.jckf.dhsupport.core.message.plugin.RemotePlayerConfigMessage;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class PlayerConfigHandler
|
||||
{
|
||||
@@ -41,19 +42,28 @@ public class PlayerConfigHandler
|
||||
{
|
||||
this.pluginMessageHandler.getEventBus().registerHandler(RemotePlayerConfigMessage.class, (configMessage) -> {
|
||||
// TODO: Some sort of Player wrapper or interface object. Bukkit classes should not be imported here.
|
||||
// TODO: Should this be unique?
|
||||
String levelKey = Bukkit.getPlayer(configMessage.getSender()).getWorld().getName();
|
||||
Player player = Bukkit.getPlayer(configMessage.getSender());
|
||||
|
||||
Configuration dhsConfig = this.dhSupport.getWorldInterface(player.getWorld().getUID()).getConfig();
|
||||
|
||||
String levelKeyPrefix = dhsConfig.getString(DhsConfig.LEVEL_KEY_PREFIX);
|
||||
String levelKey = player.getWorld().getName();
|
||||
|
||||
if (levelKeyPrefix != null) {
|
||||
levelKey = levelKeyPrefix + levelKey;
|
||||
}
|
||||
|
||||
this.dhSupport.info("Received DH config for " + player.getName() + " in " + levelKey);
|
||||
|
||||
CurrentLevelKeyMessage levelKeyResponse = new CurrentLevelKeyMessage();
|
||||
levelKeyResponse.setKey(levelKey);
|
||||
this.pluginMessageHandler.sendPluginMessage(configMessage.getSender(), levelKeyResponse);
|
||||
|
||||
Configuration dhsConfig = this.dhSupport.getConfig();
|
||||
Configuration clientConfig = configMessage.toConfiguration();
|
||||
|
||||
// This is not very flexible, but will do for now.
|
||||
for (String key : DhsConfig.getKeys()) {
|
||||
//this.dhSupport.getLogger().info("Config key " + key + ":");
|
||||
for (String key : RemotePlayerConfigMessage.KEYS) {
|
||||
this.dhSupport.getLogger().info("Config key " + key + ":");
|
||||
|
||||
Object dhsValue = dhsConfig.get(key);
|
||||
Object clientValue = clientConfig.get(key);
|
||||
@@ -62,15 +72,15 @@ public class PlayerConfigHandler
|
||||
if (dhsValue instanceof Boolean dhsBool && clientValue instanceof Boolean clientBool) {
|
||||
keepValue = dhsBool && clientBool;
|
||||
|
||||
//this.dhSupport.getLogger().info(" Server " + (dhsBool ? "Y" : "N") + " or client " + (clientBool ? "Y" : "N") + " = " + ((boolean) keepValue ? "Y" : "N"));
|
||||
this.dhSupport.getLogger().info(" Server " + (dhsBool ? "Y" : "N") + " or client " + (clientBool ? "Y" : "N") + " = " + ((boolean) keepValue ? "Y" : "N"));
|
||||
} else if (dhsValue instanceof Integer dhsInt && clientValue instanceof Integer clientInt) {
|
||||
keepValue = dhsInt < clientInt ? dhsInt : clientInt;
|
||||
|
||||
//this.dhSupport.getLogger().info(" Server " + dhsInt + " or client " + clientInt + " = " + keepValue);
|
||||
this.dhSupport.getLogger().info(" Server " + dhsInt + " or client " + clientInt + " = " + keepValue);
|
||||
} else {
|
||||
keepValue = null;
|
||||
|
||||
//this.dhSupport.getLogger().info(" Uhh... 😵💫");
|
||||
this.dhSupport.getLogger().info(" Uhh... 😵💫");
|
||||
}
|
||||
|
||||
clientConfig.set(key, keepValue);
|
||||
|
||||
@@ -105,6 +105,10 @@ public class PluginMessageHandler
|
||||
|
||||
Decoder decoder = new Decoder(data);
|
||||
|
||||
#if READ_FORGE_BYTE == "true"
|
||||
decoder.readByte();
|
||||
#endif
|
||||
|
||||
// Read the client's protocol version.
|
||||
short protocolVersion = decoder.readShort();
|
||||
|
||||
|
||||
@@ -25,6 +25,15 @@ import no.jckf.dhsupport.core.configuration.DhsConfig;
|
||||
|
||||
public class RemotePlayerConfigMessage extends PluginMessage
|
||||
{
|
||||
public static String[] KEYS = {
|
||||
DhsConfig.RENDER_DISTANCE,
|
||||
DhsConfig.DISTANT_GENERATION_ENABLED,
|
||||
DhsConfig.FULL_DATA_REQUEST_CONCURRENCY_LIMIT,
|
||||
DhsConfig.REAL_TIME_UPDATES_ENABLED,
|
||||
DhsConfig.LOGIN_DATA_SYNC_ENABLED,
|
||||
DhsConfig.LOGIN_DATA_SYNC_RC_LIMIT,
|
||||
};
|
||||
|
||||
protected int renderDistance;
|
||||
|
||||
protected boolean distantGenerationEnabled;
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package no.jckf.dhsupport.core.scheduling;
|
||||
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class GenericScheduler implements Scheduler
|
||||
{
|
||||
protected ExecutorService executor;
|
||||
|
||||
public GenericScheduler(int threads)
|
||||
{
|
||||
this.executor = Executors.newFixedThreadPool(threads);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <U> CompletableFuture<U> run(Supplier<U> supplier)
|
||||
{
|
||||
return CompletableFuture.supplyAsync(supplier, this.executor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <U> CompletableFuture<U> runRegional(UUID worldId, int x, int z, Supplier<U> supplier)
|
||||
{
|
||||
return this.run(supplier);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package no.jckf.dhsupport.core.scheduling;
|
||||
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public interface Scheduler
|
||||
{
|
||||
<U> CompletableFuture<U> run(Supplier<U> supplier);
|
||||
|
||||
<U> CompletableFuture<U> runRegional(UUID worldId, int x, int z, Supplier<U> supplier);
|
||||
}
|
||||
@@ -18,12 +18,21 @@
|
||||
|
||||
package no.jckf.dhsupport.core.world;
|
||||
|
||||
import java.util.Map;
|
||||
import no.jckf.dhsupport.core.configuration.Configurable;
|
||||
|
||||
public interface WorldInterface
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface WorldInterface extends Configurable
|
||||
{
|
||||
WorldInterface newInstance();
|
||||
|
||||
UUID getId();
|
||||
|
||||
String getName();
|
||||
|
||||
boolean chunkExists(int x, int z);
|
||||
|
||||
int getMinY();
|
||||
|
||||
int getMaxY();
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package no.jckf.dhsupport.paper;
|
||||
|
||||
import com.tcoded.folialib.FoliaLib;
|
||||
import no.jckf.dhsupport.core.scheduling.Scheduler;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class PaperScheduler implements Scheduler
|
||||
{
|
||||
protected JavaPlugin plugin;
|
||||
|
||||
protected FoliaLib foliaLib;
|
||||
|
||||
public PaperScheduler(JavaPlugin plugin, FoliaLib foliaLib)
|
||||
{
|
||||
this.plugin = plugin;
|
||||
this.foliaLib = foliaLib;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <U> CompletableFuture<U> run(Supplier<U> supplier)
|
||||
{
|
||||
CompletableFuture<U> future = new CompletableFuture<>();
|
||||
|
||||
this.foliaLib.getScheduler().runAsync((task) -> {
|
||||
future.complete(supplier.get());
|
||||
});
|
||||
|
||||
return future;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <U> CompletableFuture<U> runRegional(UUID worldId, int x, int z, Supplier<U> supplier)
|
||||
{
|
||||
CompletableFuture<U> future = new CompletableFuture<>();
|
||||
|
||||
Location location = new Location(
|
||||
this.plugin.getServer().getWorld(worldId),
|
||||
x,
|
||||
0,
|
||||
z
|
||||
);
|
||||
|
||||
this.foliaLib.getScheduler().runAtLocation(
|
||||
location,
|
||||
(task) -> future.complete(supplier.get())
|
||||
);
|
||||
|
||||
return future;
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,58 @@
|
||||
# Maximum supported render distance. Clients will be capped to this value.
|
||||
# Required.
|
||||
# Default: 128
|
||||
render_distance: 128
|
||||
|
||||
# TODO
|
||||
# Is LOD generation enabled at all?
|
||||
# Disable if you only want to use the plugin for level key info in a proxied setup.
|
||||
# Required.
|
||||
# Default: true
|
||||
distant_generation_enabled: true
|
||||
|
||||
# TODO
|
||||
# Number of parallel LOD requests per client.
|
||||
# Required.
|
||||
# Default: 20
|
||||
full_data_request_concurrency_limit: 20
|
||||
|
||||
# TODO
|
||||
real_time_updates_enabled: true
|
||||
# Currently unsupported.
|
||||
# Required.
|
||||
# Default: false
|
||||
real_time_updates_enabled: false
|
||||
|
||||
# TODO
|
||||
login_data_sync_enabled: true
|
||||
# Currently unsupported.
|
||||
# Required.
|
||||
# Default: false
|
||||
login_data_sync_enabled: false
|
||||
|
||||
# TODO
|
||||
# Currently unsupported.
|
||||
# Required.
|
||||
# Default: 50
|
||||
login_data_sync_rc_limit: 50
|
||||
|
||||
# If a client requests LODs with chunks that don't exist, should those chunks be generated?
|
||||
# Required.
|
||||
# Default: true
|
||||
generate_new_chunks: true
|
||||
|
||||
# When running DHS on a proxied server, set this to a value that is unique to this specific server.
|
||||
# Optional.
|
||||
#level_key_prefix:
|
||||
|
||||
# World specific settings.
|
||||
# You can override any of the above settings on a per-world basis.
|
||||
worlds:
|
||||
world:
|
||||
# Limit LOD generation to within this area.
|
||||
# Optional.
|
||||
#border_center: 0,0
|
||||
#border_radius: 5000
|
||||
|
||||
# It might make sense to have a lower view distance in the nether, since visibility will be low simply because of
|
||||
# the level design anyway.
|
||||
world_nether:
|
||||
render_distance: 64
|
||||
|
||||
# Number of worker threads used to generate LODs.
|
||||
# Required, except on Folia.
|
||||
# Default: 4
|
||||
generic_scheduler_threads: 4
|
||||
@@ -1,4 +1,7 @@
|
||||
name: DHSupport
|
||||
version: 0.2.2
|
||||
main: no.jckf.dhsupport.bukkit.DhSupportBukkitPlugin
|
||||
api-version: 1.21
|
||||
version: ${project.version}
|
||||
main: ${main.class}
|
||||
api-version: ${mc.api-version}
|
||||
prefix: DHS
|
||||
load: STARTUP
|
||||
folia-supported: true
|
||||
Reference in new issue
Block a user