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