mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2024-12-27 05:00:08 +08:00
Added WECUI protocol version support. Eventually, this will disable WECUI until the user updates, but not yet.
This commit is contained in:
parent
72b2c90c19
commit
8cdfd65218
@ -32,6 +32,7 @@
|
|||||||
import com.sk89q.worldedit.LocalSession;
|
import com.sk89q.worldedit.LocalSession;
|
||||||
import com.sk89q.worldedit.WorldEdit;
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
import com.sk89q.worldedit.WorldEditException;
|
import com.sk89q.worldedit.WorldEditException;
|
||||||
|
import com.sk89q.worldedit.cui.CUIEvent;
|
||||||
|
|
||||||
public class WorldEditCommands {
|
public class WorldEditCommands {
|
||||||
private static final DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z");
|
private static final DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z");
|
||||||
@ -78,10 +79,13 @@ public void reload(CommandContext args, LocalSession session, LocalPlayer player
|
|||||||
usage = "",
|
usage = "",
|
||||||
desc = "Complete CUI handshake",
|
desc = "Complete CUI handshake",
|
||||||
min = 0,
|
min = 0,
|
||||||
max = 0
|
max = 1
|
||||||
)
|
)
|
||||||
public void cui(CommandContext args, LocalSession session, LocalPlayer player,
|
public void cui(CommandContext args, LocalSession session, LocalPlayer player,
|
||||||
EditSession editSession) throws WorldEditException {
|
EditSession editSession) throws WorldEditException {
|
||||||
|
if (args.getInteger(0, -1) < CUIEvent.MIN_PROTOCOL) {
|
||||||
|
player.printError("You are using an outdated version of WorldEdit CUI! The CUI may have reduced functionality until you update.");
|
||||||
|
}
|
||||||
session.setCUISupport(true);
|
session.setCUISupport(true);
|
||||||
session.dispatchCUISetup(player);
|
session.dispatchCUISetup(player);
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,10 @@
|
|||||||
package com.sk89q.worldedit.cui;
|
package com.sk89q.worldedit.cui;
|
||||||
|
|
||||||
public interface CUIEvent {
|
public interface CUIEvent {
|
||||||
|
|
||||||
|
// The required protocol versions for communicating with the CUI
|
||||||
|
public static final int MIN_PROTOCOL = 0, CURRENT_PROTOCOL = 0;
|
||||||
|
|
||||||
public String getTypeId();
|
public String getTypeId();
|
||||||
|
|
||||||
public String[] getParameters();
|
public String[] getParameters();
|
||||||
|
Loading…
Reference in New Issue
Block a user