mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2025-01-10 09:47:42 +01:00
Update PaperLib usage
This commit is contained in:
parent
c099cab081
commit
5eda67adcd
28
pom.xml
28
pom.xml
@ -60,12 +60,14 @@
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
|
||||
<shadedArtifactAttached>false</shadedArtifactAttached>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
<minimizeJar>true</minimizeJar>
|
||||
<artifactSet>
|
||||
<includes>
|
||||
<include>com.songoda:SongodaCore</include>
|
||||
<include>io.papermc:paperlib</include>
|
||||
</includes>
|
||||
</artifactSet>
|
||||
<filters>
|
||||
@ -83,6 +85,10 @@
|
||||
<pattern>com.songoda.core</pattern>
|
||||
<shadedPattern>${project.groupId}.skyblock.core</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>io.papermc.lib</pattern>
|
||||
<shadedPattern>${project.groupId}.paperlib</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
</configuration>
|
||||
</execution>
|
||||
@ -100,6 +106,10 @@
|
||||
<id>spigot-repo</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>papermc</id>
|
||||
<url>https://papermc.io/repo/repository/maven-public/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>minecraft-repo</id>
|
||||
<url>https://libraries.minecraft.net/</url>
|
||||
@ -126,11 +136,29 @@
|
||||
</repository>
|
||||
</repositories>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.papermc</groupId>
|
||||
<artifactId>paperlib</artifactId>
|
||||
<version>1.0.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.destroystokyo.papermc</groupId>
|
||||
<artifactId>paper</artifactId>
|
||||
<version>1.15.2</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>io.papermc</groupId>
|
||||
<artifactId>paperlib</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.15</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.MilkBowl</groupId>
|
||||
|
@ -45,6 +45,7 @@ import com.songoda.skyblock.visit.VisitManager;
|
||||
import com.songoda.skyblock.visit.VisitTask;
|
||||
import com.songoda.skyblock.world.WorldManager;
|
||||
import com.songoda.skyblock.world.generator.VoidGenerator;
|
||||
import io.papermc.lib.PaperLib;
|
||||
import net.coreprotect.CoreProtect;
|
||||
import net.coreprotect.CoreProtectAPI;
|
||||
import org.bukkit.Bukkit;
|
||||
@ -94,6 +95,7 @@ public class SkyBlock extends SongodaPlugin {
|
||||
private CoreProtectAPI coreProtectAPI;
|
||||
|
||||
private boolean paper;
|
||||
private boolean paperAsync;
|
||||
|
||||
private final GuiManager guiManager = new GuiManager(this);
|
||||
|
||||
@ -110,11 +112,14 @@ public class SkyBlock extends SongodaPlugin {
|
||||
public void onPluginEnable() {
|
||||
|
||||
paper = false;
|
||||
/*try {
|
||||
try {
|
||||
Class.forName("com.destroystokyo.paper.PaperConfig");
|
||||
paper = true;
|
||||
Bukkit.getLogger().info("Enabling Paper hooks");
|
||||
} catch (ClassNotFoundException ignored) {}*/
|
||||
paperAsync = Bukkit.spigot().getPaperConfig().getBoolean("settings.async-chunks.enable", false);
|
||||
this.getLogger().info("Enabling Paper hooks");
|
||||
} catch (ClassNotFoundException ignored) {
|
||||
PaperLib.suggestPaper(this);
|
||||
}
|
||||
|
||||
// Run Songoda Updater
|
||||
SongodaCore.registerPlugin(this, 17, CompatibleMaterial.GRASS_BLOCK);
|
||||
@ -429,4 +434,8 @@ public class SkyBlock extends SongodaPlugin {
|
||||
public boolean isPaper() {
|
||||
return paper;
|
||||
}
|
||||
|
||||
public boolean isPaperAsync() {
|
||||
return paperAsync;
|
||||
}
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ public final class IslandScan extends BukkitRunnable {
|
||||
final Map<World, List<ChunkSnapshot>> snapshots = new HashMap<>(3);
|
||||
|
||||
|
||||
if (skyblock.isPaper() && Bukkit.spigot().getPaperConfig().getBoolean("settings.async-chunks.enable", false)) {
|
||||
if (skyblock.isPaperAsync()) {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
populate(snapshots, IslandWorld.Normal, true);
|
||||
if (hasNether) populate(snapshots, IslandWorld.Nether, true);
|
||||
|
Loading…
Reference in New Issue
Block a user