Add more api items

This commit is contained in:
Eric Stokes 2011-09-26 20:21:39 -06:00
parent f3cd433e80
commit 8fe128ec0f
3 changed files with 33 additions and 1 deletions

View File

@ -10,6 +10,7 @@ package com.onarandombox.MultiverseCore;
import com.fernferret.allpay.AllPay;
import com.fernferret.allpay.GenericBank;
import com.onarandombox.MultiverseCore.api.LoggablePlugin;
import com.onarandombox.MultiverseCore.api.MVPlugin;
import com.onarandombox.MultiverseCore.commands.*;
import com.onarandombox.MultiverseCore.configuration.DefaultConfig;
import com.onarandombox.MultiverseCore.configuration.MVConfigMigrator;
@ -41,7 +42,29 @@ import java.util.HashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
public class MultiverseCore extends JavaPlugin implements LoggablePlugin {
public class MultiverseCore extends JavaPlugin implements MVPlugin {
private static int Protocol = 1;
@Override
public String dumpVersionInfo(String buffer) {
// I'm kinda cheating on this one, since we call the init event.
return buffer;
}
@Override
public MultiverseCore getCore() {
return this;
}
@Override
public void setCore(MultiverseCore core) {
}
public int getProtocolVersion() {
return MultiverseCore.Protocol;
}
// Useless stuff to keep us going.
private static final Logger log = Logger.getLogger("Minecraft");

View File

@ -32,4 +32,12 @@ public interface MVPlugin extends LoggablePlugin {
* @param core A valid {@link MultiverseCore}.
*/
public void setCore(MultiverseCore core);
/**
* Allows Multiverse or a plugin to query another Multiverse plugin to see what version its protocol is. This number
* should change when something will break the code.
*
* @return The Integer protocol version.
*/
public int getProtocolVersion();
}

View File

@ -9,6 +9,7 @@ package com.onarandombox.MultiverseCore.listeners;
import com.fernferret.allpay.AllPay;
import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVPlugin;
import org.bukkit.event.server.PluginDisableEvent;
import org.bukkit.event.server.PluginEnableEvent;
import org.bukkit.event.server.ServerListener;