Skip to content

Commit

Permalink
Fixed #347
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim203 committed Feb 18, 2024
1 parent c4cc692 commit 0fa3101
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@

import io.micronaut.context.ApplicationContext;
import io.micronaut.inject.qualifiers.Qualifiers;
import java.nio.file.Path;
import org.bukkit.plugin.java.JavaPlugin;
import org.geysermc.floodgate.core.FloodgatePlatform;
import org.geysermc.floodgate.isolation.library.LibraryManager;
import org.geysermc.floodgate.spigot.util.SpigotProtocolSupportHandler;
import org.geysermc.floodgate.spigot.util.SpigotProtocolSupportListener;
import org.slf4j.LoggerFactory;

import java.nio.file.Path;

public class SpigotPlatform extends FloodgatePlatform {
private final JavaPlugin plugin;
private ApplicationContext context;
Expand All @@ -57,6 +58,17 @@ protected void onContextCreated(ApplicationContext context) {
this.context = context;
}

@Override
public void load() {
try {
Class.forName("org.spigotmc.SpigotConfig");
} catch (ClassNotFoundException ignored) {
throw new IllegalStateException("Floodgate doesn't work on CraftBukkit! Please use Paper or Spigot instead.");
}

super.load();
}

@Override
public void enable() throws RuntimeException {
super.enable();
Expand Down

0 comments on commit 0fa3101

Please sign in to comment.