mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-01 02:46:41 +00:00
Implemented PlatformManager, Platform over old platform registration method.
This commit is contained in:
@ -23,6 +23,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.command.ServerCommandManager;
|
||||
@ -40,10 +41,12 @@ import com.sk89q.worldedit.ServerInterface;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
|
||||
public class ForgeServerInterface extends ServerInterface {
|
||||
private MinecraftServer server;
|
||||
private ForgeBiomeTypes biomes;
|
||||
private final WorldEditMod mod;
|
||||
private final MinecraftServer server;
|
||||
private final ForgeBiomeTypes biomes;
|
||||
|
||||
public ForgeServerInterface() {
|
||||
public ForgeServerInterface(WorldEditMod mod) {
|
||||
this.mod = mod;
|
||||
this.server = FMLCommonHandler.instance().getMinecraftServerInstance();
|
||||
this.biomes = new ForgeBiomeTypes();
|
||||
}
|
||||
@ -114,4 +117,9 @@ public class ForgeServerInterface extends ServerInterface {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public LocalConfiguration getConfiguration() {
|
||||
return mod.getConfig();
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ import java.util.jar.JarFile;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.zip.ZipEntry;
|
||||
|
||||
import com.sk89q.worldedit.extension.platform.PlatformRejectionException;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
@ -92,8 +93,13 @@ public class WorldEditMod {
|
||||
|
||||
@EventHandler
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
this.server = new ForgeServerInterface();
|
||||
this.controller = new WorldEdit(this.server, this.config);
|
||||
this.server = new ForgeServerInterface(this);
|
||||
this.controller = WorldEdit.getInstance();
|
||||
try {
|
||||
controller.getPlatformManager().register(server);
|
||||
} catch (PlatformRejectionException e) {
|
||||
throw new RuntimeException("Failed to register with WorldEdit", e);
|
||||
}
|
||||
}
|
||||
|
||||
public ForgeConfiguration getConfig() {
|
||||
|
Reference in New Issue
Block a user