Add checks for survival only mode
This commit is contained in:
parent
f4075075f2
commit
e40f091961
1 changed files with 10 additions and 0 deletions
|
@ -218,6 +218,11 @@ public class CommandProcessor {
|
|||
}
|
||||
public boolean processCommand(String args) {
|
||||
if (args.length() > 0) {
|
||||
if (Config.getConfig().survivalOnly && SongPlayer.MC.interactionManager.getCurrentGameMode() != GameMode.SURVIVAL) {
|
||||
SongPlayer.addChatMessage("§cTo play in survival only mode, you must be in survival mode to start with.");
|
||||
return true;
|
||||
}
|
||||
|
||||
SongHandler.getInstance().loadSong(args);
|
||||
return true;
|
||||
}
|
||||
|
@ -1177,6 +1182,11 @@ public class CommandProcessor {
|
|||
}
|
||||
public boolean processCommand(String args) {
|
||||
if (args.length() == 0) {
|
||||
if (!SongHandler.getInstance().isIdle()) {
|
||||
SongPlayer.addChatMessage("§cYou cannot change this setting while playing or building");
|
||||
return true;
|
||||
}
|
||||
|
||||
Config.getConfig().survivalOnly = !Config.getConfig().survivalOnly;
|
||||
if (Config.getConfig().survivalOnly) {
|
||||
SongPlayer.addChatMessage("§6Enabled survival only mode");
|
||||
|
|
Loading…
Reference in a new issue