Skip to content

Commit 8e97c6e

Browse files
Merge pull request #551 from VolmitSoftware/Development
1.16.10
2 parents c943eab + 7018e0f commit 8e97c6e

File tree

8 files changed

+1407
-57
lines changed

8 files changed

+1407
-57
lines changed

build.gradle

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,18 @@
1515
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1616
*/
1717

18+
import xyz.jpenilla.runpaper.task.RunServer
19+
1820
plugins {
1921
id 'java'
2022
id 'java-library'
2123
id "io.freefair.lombok" version "6.3.0"
2224
id "com.github.johnrengelman.shadow" version "7.1.2"
2325
id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.9"
26+
id "xyz.jpenilla.run-paper" version "2.3.1"
2427
}
2528

26-
version '1.16.9-1.19.2-1.21.4'
29+
version '1.16.9-1.19.2-1.21.5'
2730
def apiVersion = '1.19'
2831
def name = getRootProject().getName() // Defined in settings.gradle
2932
def main = 'com.volmit.adapt.Adapt'
@@ -51,6 +54,13 @@ def VERSIONS = Map.of(
5154
"v1_20_4", "1.20.4-R0.1-SNAPSHOT",
5255
"v1_19_2", "1.19.2-R0.1-SNAPSHOT"
5356
)
57+
def SUPPORTED = ["1.19.1", "1.19.2", "1.19.3", "1.19.4", "1.20.1", "1.20.2", "1.20.4", "1.20.6", "1.21.1", "1.21.3", "1.21.4", "1.21.5"]
58+
def jdk = ["1.20.6", "1.21.1", "1.21.3", "1.21.4", "1.21.5"]
59+
60+
def MIN_HEAP_SIZE = "2G"
61+
def MAX_HEAP_SIZE = "8G"
62+
//Valid values are: none, truecolor, indexed256, indexed16, indexed8
63+
def COLOR = "truecolor"
5464

5565
VERSIONS.each {
5666
def key = it.key
@@ -65,6 +75,23 @@ VERSIONS.each {
6575
}
6676
}
6777
}
78+
SUPPORTED.forEach { version ->
79+
tasks.register("runServer-$version", RunServer) {
80+
group("servers")
81+
minecraftVersion(version)
82+
minHeapSize(MIN_HEAP_SIZE)
83+
maxHeapSize(MAX_HEAP_SIZE)
84+
systemProperty("disable.watchdog", "")
85+
systemProperty("net.kyori.ansi.colorLevel", COLOR)
86+
systemProperty("com.mojang.eula.agree", true)
87+
pluginJars(tasks.shadowJar.archiveFile)
88+
runDirectory.convention(layout.buildDirectory.dir("run/$version"))
89+
90+
if (jdk.contains(version)) {
91+
javaLauncher = javaToolchains.launcherFor { it.languageVersion = JavaLanguageVersion.of(21)}
92+
}
93+
}
94+
}
6895

6996
/**
7097
* Gradle is weird sometimes, we need to delete the plugin yml from the build folder to actually filter properly.
@@ -140,7 +167,7 @@ allprojects {
140167
compileOnly "com.github.angeschossen:ChestProtectAPI:3.9.1"
141168
compileOnly "com.github.TechFortress:GriefPrevention:16.18.1"
142169
implementation 'xyz.xenondevs:particle:1.8.4'
143-
implementation "com.frengor:ultimateadvancementapi-shadeable:2.4.3"
170+
implementation "com.frengor:ultimateadvancementapi-shadeable:2.5.1"
144171
implementation 'com.jeff-media:custom-block-data:2.2.3'
145172
compileOnly 'com.griefdefender:api:2.1.0-SNAPSHOT'
146173
compileOnly 'io.netty:netty-all:4.1.68.Final'

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
#
1818
distributionBase=GRADLE_USER_HOME
1919
distributionPath=wrapper/dists
20-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
20+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
2121
zipStoreBase=GRADLE_USER_HOME
2222
zipStorePath=wrapper/dists

src/main/java/com/volmit/adapt/Adapt.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ public static List<Object> initialize(String s) {
238238
}
239239

240240
public static KList<Object> initialize(String s, Class<? extends Annotation> slicedClass) {
241-
JarScanner js = new JarScanner(instance.jar(), s);
241+
JarScanner js = new JarScanner(instance.getFile(), s);
242242
KList<Object> v = new KList<>();
243243
J.attempt(js::scan);
244244
for (Class<?> i : js.getClasses()) {

src/main/java/com/volmit/adapt/api/data/WorldData.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class WorldData extends TickedObject {
4848
public WorldData(World world) {
4949
super("world-data", world.getUID().toString(), 30_000);
5050
this.world = world;
51-
mantle = new Mantle(Adapt.instance.getDataFolder("data", "mantle"), world.getMaxHeight());
51+
mantle = new Mantle(Adapt.instance.getDataFolder("data", "mantle", world.getName()), world.getMaxHeight());
5252
}
5353

5454
public static void stop() {
@@ -89,11 +89,13 @@ public void unregister() {
8989

9090
@EventHandler
9191
public void on(WorldSaveEvent e) {
92+
if (e.getWorld() != world) return;
9293
J.a(mantle::saveAll);
9394
}
9495

9596
@EventHandler
9697
public void on(WorldUnloadEvent e) {
98+
if (e.getWorld() != world) return;
9799
unregister();
98100
}
99101

0 commit comments

Comments
 (0)