mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-24 22:26:46 +01:00
Fix onLoad, restore WG support
This commit is contained in:
parent
f96ba1b4b5
commit
21b4bcc21f
@ -13,7 +13,7 @@ import co.aikar.commands.CommandIssuer;
|
||||
import co.aikar.commands.CommandManager;
|
||||
import co.aikar.commands.CommandOperationContext;
|
||||
|
||||
public interface PlatformProvider {
|
||||
public interface PlatformProvider<E> {
|
||||
|
||||
Logger getLogger();
|
||||
|
||||
@ -57,6 +57,9 @@ public interface PlatformProvider {
|
||||
@Deprecated
|
||||
MMOEntity<?> getEntity(UUID uniqueId);
|
||||
|
||||
@Deprecated
|
||||
MMOEntity<?> getEntity(E uniqueId);
|
||||
|
||||
@Deprecated
|
||||
Object getChimaeraWing();
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ import java.util.logging.Logger;
|
||||
import co.aikar.commands.CommandManager;
|
||||
import co.aikar.commands.PaperCommandManager;
|
||||
|
||||
public class BukkitBootstrap extends JavaPlugin implements PlatformProvider {
|
||||
public class BukkitBootstrap extends JavaPlugin implements PlatformProvider<Entity> {
|
||||
|
||||
private mcMMO core = new mcMMO(this);
|
||||
private final BukkitPlatformScheduler scheduler = new BukkitPlatformScheduler(this);
|
||||
@ -173,7 +173,11 @@ public class BukkitBootstrap extends JavaPlugin implements PlatformProvider {
|
||||
@Override
|
||||
@Deprecated // TODO: This needs proper registration...
|
||||
public MMOEntity<?> getEntity(UUID uniqueId) {
|
||||
final Entity entity = Bukkit.getEntity(uniqueId);
|
||||
return getEntity(Bukkit.getEntity(uniqueId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public MMOEntity<?> getEntity(Entity entity) {
|
||||
if (entity instanceof Player) {
|
||||
core.getUserManager().getPlayer((Player) entity);
|
||||
} else if (entity instanceof LivingEntity) {
|
||||
@ -234,6 +238,12 @@ public class BukkitBootstrap extends JavaPlugin implements PlatformProvider {
|
||||
pluginManager.registerEvents(new WorldListener(core), this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
core.onLoad();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
core.onEnable();
|
||||
|
@ -46,6 +46,8 @@ import com.gmail.nossr50.util.sounds.SoundManager;
|
||||
import com.gmail.nossr50.worldguard.WorldGuardManager;
|
||||
import com.gmail.nossr50.worldguard.WorldGuardUtils;
|
||||
import net.shatteredlands.shatt.backup.ZipLibrary;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
@ -276,12 +278,10 @@ public class mcMMO implements McMMOApi {
|
||||
|
||||
public void onLoad()
|
||||
{
|
||||
platformProvider.onLoad();
|
||||
worldGuardUtils = new WorldGuardUtils(this); //Init WGU
|
||||
|
||||
// TODO: 2.2 - MIGRATE
|
||||
/*
|
||||
if(getServer().getPluginManager().getPlugin("WorldGuard") != null) {
|
||||
if(Bukkit.getServer().getPluginManager().getPlugin("WorldGuard") != null) {
|
||||
|
||||
if(worldGuardUtils.isWorldGuardLoaded()) {
|
||||
//Register flags
|
||||
@ -290,7 +290,6 @@ public class mcMMO implements McMMOApi {
|
||||
worldGuardManager.registerFlags();
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user