Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
2577344
implement platform specific schedulers
CrazyDev05 Jun 13, 2025
ba6fac5
more helper methods
CrazyDev05 Jun 13, 2025
35b879f
get iris to load on folia, but it will not load worlds as this is cur…
CrazyDev05 Jun 13, 2025
e461c1e
fix updater and mob spawning instantly failing
CrazyDev05 Jun 14, 2025
7570064
fix locate command not teleporting
CrazyDev05 Jun 14, 2025
0957b9b
Merge branch 'dev' into feat/folia
CrazyDev05 Jun 15, 2025
1c5fe01
handle failing world creation
CrazyDev05 Jun 15, 2025
ebdfb94
Merge branch 'dev' into feat/folia
CrazyDev05 Jun 17, 2025
d61b220
handle failing restart command better
CrazyDev05 Jun 18, 2025
96a384c
fix modern tile states not applying
CrazyDev05 Jun 18, 2025
bef99f1
fix effects
CrazyDev05 Jun 18, 2025
cf0bc81
replace scheduler and paperlib with platform utils
CrazyDev05 Jun 19, 2025
fa3e35f
fix pregen save chunk failing
CrazyDev05 Jun 19, 2025
c8eab22
fix a few sync teleports
CrazyDev05 Jun 19, 2025
42a26a1
fix spawning empty particles and improve message for invalid tile states
CrazyDev05 Jun 19, 2025
b440d02
fix iris what commands
CrazyDev05 Jun 19, 2025
fd39710
update platform utils
CrazyDev05 Jun 23, 2025
c3442ab
Merge branch 'dev' into feat/folia
CrazyDev05 Jul 19, 2025
fcbbd21
apply folia modification to 1.21.7 nms
CrazyDev05 Jul 19, 2025
49d2392
use platform utils for regen
CrazyDev05 Jul 19, 2025
68a214e
move platform utils to the version catalog
CrazyDev05 Jul 19, 2025
bddc62f
fix object saving
CrazyDev05 Jul 19, 2025
f7ac827
don't relocate platform utils for now
CrazyDev05 Jul 25, 2025
2f16c0c
Merge branch 'dev' into feat/folia
CrazyDev05 Jul 25, 2025
d5ec6a1
fix loot not being applied
CrazyDev05 Jul 26, 2025
bd722fd
Merge branch 'dev' into feat/folia
CrazyDev05 Aug 2, 2025
bd07f5d
add link for Worlds to bring back world creation on folia
CrazyDev05 Aug 2, 2025
dc8cf0a
remove last usages of the bukkit scheduler
CrazyDev05 Aug 2, 2025
aaf2f2f
fix teleport after world creation
CrazyDev05 Aug 2, 2025
bf6af9a
Merge branch 'dev' into feat/folia
CrazyDev05 Aug 2, 2025
bddc061
make chunk retrieval to teleport async
CrazyDev05 Aug 2, 2025
b8219fa
Merge branch 'dev' into feat/folia
CrazyDev05 Sep 6, 2025
e06724f
Merge branch 'refs/heads/dev' into feat/folia
CrazyDev05 Sep 21, 2025
6d3edff
make studio tools work on folia
CrazyDev05 Sep 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import com.volmit.nmstools.NMSToolsExtension
import com.volmit.nmstools.NMSToolsPlugin
import de.undercouch.gradle.tasks.download.Download
import xyz.jpenilla.runpaper.task.RunServer
import xyz.jpenilla.runtask.service.DownloadsAPIService
import kotlin.system.exitProcess

/*
Expand Down Expand Up @@ -94,6 +95,9 @@ nmsBindings.forEach { key, value ->
compileOnly(project(":core"))
compileOnly(rootProject.libs.annotations)
compileOnly(rootProject.libs.byteBuddy.core)
compileOnly(rootProject.libs.platformUtils) {
isTransitive = false
}
}
}

Expand All @@ -111,6 +115,22 @@ nmsBindings.forEach { key, value ->
systemProperty("iris.suppressReporting", !errorReporting)
jvmArgs("-javaagent:${project(":core:agent").tasks.jar.flatMap { it.archiveFile }.get().asFile.absolutePath}")
}

tasks.register<RunServer>("runFolia-$key") {
group = "servers"
downloadsApiService = DownloadsAPIService.folia(project)
minecraftVersion(value.split("-")[0])
minHeapSize = serverMinHeap
maxHeapSize = serverMaxHeap
pluginJars(tasks.jar.flatMap { it.archiveFile })
javaLauncher = javaToolchains.launcherFor { languageVersion = JavaLanguageVersion.of(jvmVersion.getOrDefault(key, 21))}
runDirectory.convention(layout.buildDirectory.dir("run/$key"))
systemProperty("disable.watchdog", "")
systemProperty("net.kyori.ansi.colorLevel", color)
systemProperty("com.mojang.eula.agree", true)
systemProperty("iris.suppressReporting", !errorReporting)
jvmArgs("-javaagent:${project(":core:agent").tasks.jar.flatMap { it.archiveFile }.get().asFile.absolutePath}")
}
}

tasks {
Expand Down Expand Up @@ -195,6 +215,7 @@ allprojects {
maven("https://mvn.lumine.io/repository/maven-public/") // mythic
maven("https://nexus.phoenixdevt.fr/repository/maven-public/") //MMOItems
maven("https://repo.onarandombox.com/content/groups/public/") //Multiverse Core
maven("https://repo.thenextlvl.net/releases") //Worlds
}

dependencies {
Expand Down
15 changes: 12 additions & 3 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,21 @@ dependencies {
isTransitive = false
}
compileOnly(libs.multiverseCore)
compileOnly(libs.worlds)

// Shaded
implementation(slimjarHelper("spigot"))
implementation(rootProject.libs.platformUtils) {
isTransitive = false
}

// Dynamically Loaded
slim(libs.paralithic)
slim(libs.paperlib)
slim(libs.adventure.api)
slim(libs.adventure.minimessage)
slim(libs.adventure.platform)
slim(libs.adventure.gson)
slim(libs.adventure.legacy)
slim(libs.bstats)
slim(libs.sentry)

Expand Down Expand Up @@ -108,6 +113,11 @@ dependencies {
slim(libs.mavenCore)
}
}

constraints {
slim(libs.gson)
compileOnly(libs.gson)
}
}

java {
Expand All @@ -131,8 +141,7 @@ slimJar {
))

relocate("com.dfsek.paralithic", "$lib.paralithic")
relocate("io.papermc.lib", "$lib.paper")
relocate("net.kyori", "$lib.kyori")
relocate("net.kyori.audience", "$lib.audience")
relocate("org.bstats", "$lib.metrics")
relocate("io.sentry", "$lib.sentry")
relocate("org.apache.maven", "$lib.maven")
Expand Down
24 changes: 16 additions & 8 deletions core/src/main/java/com/volmit/iris/Iris.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
import com.volmit.iris.util.scheduling.Queue;
import com.volmit.iris.util.scheduling.ShurikenQueue;
import lombok.NonNull;
import de.crazydev22.platformutils.Platform;
import de.crazydev22.platformutils.PlatformUtils;
import org.bukkit.*;
import org.bukkit.block.data.BlockData;
import org.bukkit.command.Command;
Expand All @@ -79,6 +81,7 @@
import java.lang.annotation.Annotation;
import java.net.URL;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.function.Predicate;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
Expand All @@ -95,6 +98,7 @@ public class Iris extends VolmitPlugin implements Listener {
public static MultiverseCoreLink linkMultiverseCore;
public static IrisCompat compat;
public static FileWatcher configWatcher;
public static Platform platform;
private static VolmitSender sender;
private static Thread shutdownHook;

Expand Down Expand Up @@ -313,15 +317,14 @@ public static void safeguard(String format, Object... args) {
@SuppressWarnings("deprecation")
public static void later(NastyRunnable object) {
try {
Bukkit.getScheduler().scheduleAsyncDelayedTask(instance, () ->
{
platform.getAsyncScheduler().runDelayed(task -> {
try {
object.run();
} catch (Throwable e) {
e.printStackTrace();
Iris.reportError(e);
}
}, RNG.r.i(100, 1200));
}, RNG.r.i(5, 60), TimeUnit.SECONDS);
} catch (IllegalPluginAccessException ignored) {

}
Expand Down Expand Up @@ -441,6 +444,7 @@ public Iris() {

private void enable() {
services = new KMap<>();
platform = PlatformUtils.createPlatform(this);
setupAudience();
Bindings.setupSentry();
initialize("com.volmit.iris.core.service").forEach((i) -> services.put((Class<? extends IrisService>) i.getClass(), (IrisService) i));
Expand All @@ -456,7 +460,7 @@ private void enable() {
services.values().forEach(this::registerListener);
addShutdownHook();
J.s(() -> {
J.a(IrisSafeguard::suggestPaper);
//J.a(IrisSafeguard::suggestPaper); //TODO reimplement this
J.a(() -> IO.delete(getTemp()));
J.a(LazyPregenerator::loadLazyGenerators, 100);
J.a(this::bstats);
Expand Down Expand Up @@ -506,8 +510,13 @@ public void checkForBukkitWorlds(Predicate<String> filter) {
WorldCreator c = new WorldCreator(s)
.generator(gen)
.environment(dim.getEnvironment());
INMS.get().createWorld(c);
Iris.info(C.LIGHT_PURPLE + "Loaded " + s + "!");
INMS.get().createWorldAsync(c)
.thenAccept(w -> Iris.info(C.LIGHT_PURPLE + "Loaded " + s + "!"))
.exceptionally(e -> {
Iris.error("Failed to load world " + s + "!");
e.printStackTrace();
return null;
});
} catch (Throwable e) {
Iris.error("Failed to load world " + s + "!");
e.printStackTrace();
Expand All @@ -528,7 +537,7 @@ private void autoStartStudio() {
J.s(() -> {
for (Player i : getServer().getOnlinePlayers()) {
i.setGameMode(GameMode.SPECTATOR);
i.teleport(new Location(w, 0, 200, 0));
platform.teleportAsync(i, new Location(w, 0, 200, 0));
}
});
});
Expand Down Expand Up @@ -562,7 +571,6 @@ public void onEnable() {

public void onDisable() {
services.values().forEach(IrisService::onDisable);
Bukkit.getScheduler().cancelTasks(this);
HandlerList.unregisterAll((Plugin) this);
postShutdown.forEach(Runnable::run);
super.onDisable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,14 @@ public static void restart() {
Iris.warn("New data pack entries have been installed in Iris! Restarting server!");
Iris.warn("This will only happen when your pack changes (updates/first time setup)");
Iris.warn("(You can disable this auto restart in iris settings)");
if (!Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "restart")) {
Iris.warn("Looks like the restart command didn't work. Stopping the server instead!");
Bukkit.shutdown();
}
J.s(() -> {
Iris.warn("Looks like the restart command didn't work. Stopping the server instead!");
Bukkit.shutdown();
}, 100);
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "restart");
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;

import java.io.*;
import java.util.List;
Expand Down Expand Up @@ -158,13 +157,8 @@ public void teleport(
return;
}

new BukkitRunnable() {
@Override
public void run() {
target.teleport(world.getSpawnLocation());
new VolmitSender(target).sendMessage(C.GREEN + "You have been teleported to " + world.getName() + ".");
}
}.runTask(Iris.instance);
Iris.platform.teleportAsync(target, world.getSpawnLocation()).thenRun(() ->
new VolmitSender(target).sendMessage(C.GREEN + "You have been teleported to " + world.getName() + "."));
}

@Decree(description = "Print version information")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void setTile(int xx, int yy, int zz, TileData tile) {
public Engine getEngine() {
return null;
}
};
}.sync(world);
}

@Decree(description = "Check the composition of an object")
Expand Down
Loading