Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 6 additions & 3 deletions BuildBiomeManager/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import net.minecrell.pluginyml.bukkit.BukkitPluginDescription.PluginLoadOrder.STARTUP

group = "me.cjcrafter"
version = "3.7.3"
version = "3.7.4"

plugins {
`java-library`
id("io.github.goooler.shadow") version "8.1.7"
id("com.gradleup.shadow") version "8.3.3"
id("net.minecrell.plugin-yml.bukkit") version "0.6.0"
}

Expand All @@ -15,6 +15,7 @@ bukkit {
name = "BiomeManager"
apiVersion = "1.16"
load = STARTUP // required to register biomes before world load
foliaSupported = true

authors = listOf("CJCrafter")
depend = listOf("ProtocolLib", "MechanicsCore")
Expand Down Expand Up @@ -55,11 +56,13 @@ tasks.shadowJar {
include(project(":Biome_1_20_R4"))
include(project(":Biome_1_21_R1"))

relocate("org.bstats", "me.cjcrafter.biomemanager.lib.bstats") {
relocate("org.bstats", "com.cjcrafter.biomemanager.lib.bstats") {
include(dependency("org.bstats:"))
}
}

relocate("com.cjcrafter.foliascheduler", "me.deecaad.core.lib.scheduler")

// This doesn't actually include any dependencies, this relocates all references
// to the mechanics core lib.
relocate("net.kyori", "me.deecaad.core.lib")
Expand Down
4 changes: 3 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
}

repositories {
mavenLocal()
mavenCentral()

maven(url="https://hub.spigotmc.org/nexus/content/repositories/snapshots/") // Spigot
Expand All @@ -14,7 +15,8 @@ repositories {
dependencies {
compileOnly("org.spigotmc:spigot-api:1.20.4-R0.1-SNAPSHOT")
compileOnly("com.comphenix.protocol:ProtocolLib:5.1.0")
compileOnly("com.cjcrafter:mechanicscore:3.4.1")
compileOnly("com.cjcrafter:foliascheduler:0.6.0")
compileOnly("com.cjcrafter:mechanicscore:3.4.13-FOLIA")
compileOnly("com.sk89q.worldedit:worldedit-bukkit:7.2.13")

// adventure
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/me/cjcrafter/biomemanager/BiomeManager.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package me.cjcrafter.biomemanager;

import com.cjcrafter.foliascheduler.FoliaCompatibility;
import com.cjcrafter.foliascheduler.ServerImplementation;
import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.ProtocolManager;
import com.comphenix.protocol.events.PacketAdapter;
Expand Down Expand Up @@ -42,9 +44,12 @@ public class BiomeManager extends JavaPlugin {
public EditModeListener editModeListener;
public BiomeRandomizer biomeRandomizer;

private ServerImplementation scheduler;

public void onLoad() {
INSTANCE = this;
debug = new Debugger(getLogger(), 2);
scheduler = new FoliaCompatibility(this).getServerImplementation();
}

@Override
Expand Down Expand Up @@ -170,6 +175,10 @@ public Debugger getDebug() {
return debug;
}

public ServerImplementation getScheduler() {
return scheduler;
}

public static BiomeManager inst() {
return INSTANCE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.scheduler.BukkitRunnable;

public class AutoSaveListener implements Listener {

Expand All @@ -24,11 +23,6 @@ public void onLeave(PlayerQuitEvent event) {

// When an OP player leaves the server, this MIGHT mean that they are
// rejoining to see their changes to the biome.
new BukkitRunnable() {
@Override
public void run() {
BiomeManager.inst().saveToConfig();
}
}.runTaskAsynchronously(BiomeManager.inst());
BiomeManager.inst().getScheduler().async().runNow(() -> BiomeManager.inst().saveToConfig());
}
}