1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 11:45:51 +00:00

Replace deprecated code

This commit is contained in:
SoSeDiK 2019-03-27 22:48:34 +02:00
parent 2c62cae68e
commit 8a1cb8dad9

View File

@ -2,7 +2,6 @@ package me.mrCookieSlime.Slimefun;
import java.io.File;
import me.mrCookieSlime.Slimefun.listeners.*;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.entity.Player;
@ -16,7 +15,6 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.scheduler.BukkitRunnable;
import me.mrCookieSlime.CSCoreLibPlugin.CSCoreLib;
import me.mrCookieSlime.CSCoreLibPlugin.PluginUtils;
@ -61,6 +59,8 @@ import me.mrCookieSlime.Slimefun.api.energy.ItemEnergy;
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset;
import me.mrCookieSlime.Slimefun.api.item_transport.CargoNet;
import me.mrCookieSlime.Slimefun.api.item_transport.ChestManipulator;
import me.mrCookieSlime.Slimefun.listeners.*;
import net.coreprotect.CoreProtect;
import net.coreprotect.CoreProtectAPI;
@ -85,7 +85,6 @@ public class SlimefunStartup extends JavaPlugin {
// Supported Versions of Minecraft
final String[] supported = {"v1_13_"};
@SuppressWarnings("deprecation")
@Override
public void onEnable() {
CSCoreLibLoader loader = new CSCoreLibLoader(this);
@ -340,17 +339,13 @@ public class SlimefunStartup extends JavaPlugin {
ticker = new TickerTask();
// Starting all ASYNC Tasks
getServer().getScheduler().scheduleAsyncRepeatingTask(this, new AutoSavingTask(), 1200L, config.getInt("options.auto-save-delay-in-minutes") * 60L * 20L);
getServer().getScheduler().scheduleAsyncRepeatingTask(this, ticker, 100L, config.getInt("URID.custom-ticker-delay"));
getServer().getScheduler().runTaskTimerAsynchronously(this, new AutoSavingTask(), 1200L, config.getInt("options.auto-save-delay-in-minutes") * 60L * 20L);
getServer().getScheduler().runTaskTimerAsynchronously(this, ticker, 100L, config.getInt("URID.custom-ticker-delay"));
getServer().getScheduler().scheduleAsyncRepeatingTask(this, new Runnable() {
@Override
public void run() {
getServer().getScheduler().runTaskTimerAsynchronously(this, () -> {
for (GitHubConnector connector : GitHubConnector.connectors) {
connector.pullFile();
}
}
}, 80L, 60 * 60 * 20L);
// Hooray!
@ -360,11 +355,8 @@ public class SlimefunStartup extends JavaPlugin {
coreProtect = getServer().getPluginManager().isPluginEnabled("CoreProtect");
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new BukkitRunnable() {
@Override
public void run() {
getServer().getScheduler().runTaskLater(this, () -> {
exoticGarden = getServer().getPluginManager().isPluginEnabled("ExoticGarden"); // Had to do it this way, otherwise it seems disabled.
}
}, 0);
if (clearlag) new ClearLaggIntegration(this);
@ -517,4 +509,5 @@ public class SlimefunStartup extends JavaPlugin {
public CoreProtectAPI getCoreProtectAPI() {
return coreProtectAPI;
}
}