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