Add cuiVersion to LocalSession and set it via incoming CUI event

Refactor region selectors to handle legacy versions a bit better.
Because chat doesn't allow the section sign to be sent, I have to send non-color codes. Meh.
closes #158
This commit is contained in:
Yetanotherx
2011-12-31 23:16:39 -05:00
committed by zml2008
parent 616f9a2360
commit 3b87953da0
12 changed files with 220 additions and 129 deletions

View File

@ -32,7 +32,6 @@ import com.sk89q.worldedit.LocalPlayer;
import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.cui.CUIEvent;
public class WorldEditCommands {
private static final DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z");
@ -79,13 +78,10 @@ public class WorldEditCommands {
usage = "",
desc = "Complete CUI handshake",
min = 0,
max = 1
max = 0
)
public void cui(CommandContext args, LocalSession session, LocalPlayer player,
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.dispatchCUISetup(player);
}