Fix compile

Recover on unknown command error
Fixes #1224
Close #1213 (fixed elsewhere)
Fixes #1212
This commit is contained in:
Jesse Boyd
2016-06-28 19:55:51 +10:00
parent f8e97f14d6
commit 06682b18a5
10 changed files with 106 additions and 39 deletions

View File

@@ -484,6 +484,23 @@ public abstract class Command {
return getCommandString() + " " + args + "]";
}
public Collection<Command> tabOf(PlotPlayer player, String[] input, boolean space, String... args) {
/*
<player>
<alias>
<world>
<id>
<#>
*/
// int index = input.length - (space ? 0 : 1);
// List<Command> result = new ArrayList<>();
// for (String arg : args) {
// String[] split = arg.split(" ");
// }
// TODO
return new ArrayList<>();
}
public Collection<Command> tab(PlotPlayer player, String[] args, boolean space) {
switch (args.length) {
case 0:

View File

@@ -75,11 +75,11 @@ public class PlotListener {
Optional<Boolean> flyFlag = plot.getFlag(Flags.FLY);
if (flyFlag.isPresent()) {
boolean flight = player.getFlight();
PlotGameMode gamemode = player.getGameMode();
if (flight != (gamemode == PlotGameMode.CREATIVE || gamemode == PlotGameMode.SPECTATOR)) {
player.setPersistentMeta("flight", ByteArrayUtilities.booleanToBytes(player.getFlight()));
}
if (flyFlag.get() != player.getFlight()) {
PlotGameMode gamemode = player.getGameMode();
if (flight != (gamemode == PlotGameMode.CREATIVE || gamemode == PlotGameMode.SPECTATOR)) {
player.setPersistentMeta("flight", ByteArrayUtilities.booleanToBytes(player.getFlight()));
}
player.setFlight(flyFlag.get());
}
}
@@ -209,6 +209,8 @@ public class PlotListener {
PlotGameMode gameMode = player.getGameMode();
if (gameMode == PlotGameMode.SURVIVAL || gameMode == PlotGameMode.ADVENTURE) {
player.setFlight(false);
} else if (player.getFlight() != true) {
player.setFlight(true);
}
}
}