Made //fast display a different message if the argument matches the current mode

This commit is contained in:
Wizjany 2011-10-29 13:32:26 -04:00
parent 2b9f0be8df
commit 2719308ada

View File

@ -76,7 +76,7 @@ public class GeneralCommands {
boolean light = args.hasFlag('f'); boolean light = args.hasFlag('f');
String newState = args.getString(0, null); String newState = args.getString(0, null);
Boolean dir = newState.equals("on") ? true : newState.equals("off") ? false : null; Boolean dir = newState == null ? null : newState.equals("on") ? true : newState.equals("off") ? false : null;
boolean hadFast = session.hasFastMode(); boolean hadFast = session.hasFastMode();
boolean hadLight = session.hasFastLighting(); boolean hadLight = session.hasFastLighting();
@ -89,7 +89,7 @@ public class GeneralCommands {
session.setFastLighting(setLight); session.setFastLighting(setLight);
} }
player.print("Fast mode " + (!setFast ? "disabled." : player.print("Fast mode " + (setFast == hadFast ? "already " : "") + (!setFast ? "disabled." :
("enabled. You may need to rejoin to see changes" ("enabled. You may need to rejoin to see changes"
+ (setLight ? "and lighting in affected chunks may be wrong." : ".")))); + (setLight ? "and lighting in affected chunks may be wrong." : "."))));
} }