mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 05:36:46 +01:00
These commands cannot work for online players, period.
This commit is contained in:
parent
1c328e7ac7
commit
ea32cb9e12
@ -52,8 +52,6 @@ public class McgodCommand implements CommandExecutor {
|
|||||||
|
|
||||||
McMMOPlayer mcMMOPlayer = Users.getPlayer(args[0]);
|
McMMOPlayer mcMMOPlayer = Users.getPlayer(args[0]);
|
||||||
|
|
||||||
// If the mcMMOPlayer doesn't exist, create a temporary profile and
|
|
||||||
// check if it's present in the database. If it's not, abort the process.
|
|
||||||
if (mcMMOPlayer == null) {
|
if (mcMMOPlayer == null) {
|
||||||
profile = new PlayerProfile(args[0], false);
|
profile = new PlayerProfile(args[0], false);
|
||||||
|
|
||||||
@ -61,20 +59,24 @@ public class McgodCommand implements CommandExecutor {
|
|||||||
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sender.sendMessage(LocaleLoader.getString("Commands.Offline"));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
profile = mcMMOPlayer.getProfile();
|
||||||
|
Player player = mcMMOPlayer.getPlayer();
|
||||||
|
|
||||||
|
if (!player.isOnline()) {
|
||||||
|
sender.sendMessage(LocaleLoader.getString("Commands.Offline"));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (profile.getGodMode()) {
|
||||||
|
player.sendMessage(LocaleLoader.getString("Commands.GodMode.Disabled"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
profile = mcMMOPlayer.getProfile();
|
player.sendMessage(LocaleLoader.getString("Commands.GodMode.Enabled"));
|
||||||
Player player = mcMMOPlayer.getPlayer();
|
|
||||||
|
|
||||||
// Check if the player is online before we try to send them a message.
|
|
||||||
if (player.isOnline()) {
|
|
||||||
if (profile.getGodMode()) {
|
|
||||||
player.sendMessage(LocaleLoader.getString("Commands.GodMode.Disabled"));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
player.sendMessage(LocaleLoader.getString("Commands.GodMode.Enabled"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
profile.toggleGodMode();
|
profile.toggleGodMode();
|
||||||
|
@ -28,8 +28,14 @@ public class McrefreshCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
profile = Users.getPlayer(sender.getName()).getProfile();
|
profile = Users.getPlayer(sender.getName()).getProfile();
|
||||||
|
|
||||||
|
profile.setRecentlyHurt(0);
|
||||||
|
profile.resetCooldowns();
|
||||||
|
profile.resetToolPrepMode();
|
||||||
|
profile.resetAbilityMode();
|
||||||
|
|
||||||
sender.sendMessage(LocaleLoader.getString("Ability.Generic.Refresh"));
|
sender.sendMessage(LocaleLoader.getString("Ability.Generic.Refresh"));
|
||||||
break;
|
return true;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
if (!Permissions.hasPermission(sender, "mcmmo.commands.mcrefresh.others")) {
|
if (!Permissions.hasPermission(sender, "mcmmo.commands.mcrefresh.others")) {
|
||||||
@ -39,7 +45,6 @@ public class McrefreshCommand implements CommandExecutor {
|
|||||||
|
|
||||||
McMMOPlayer mcMMOPlayer = Users.getPlayer(args[0]);
|
McMMOPlayer mcMMOPlayer = Users.getPlayer(args[0]);
|
||||||
|
|
||||||
// If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process.
|
|
||||||
if (mcMMOPlayer == null) {
|
if (mcMMOPlayer == null) {
|
||||||
profile = new PlayerProfile(args[0], false);
|
profile = new PlayerProfile(args[0], false);
|
||||||
|
|
||||||
@ -47,28 +52,29 @@ public class McrefreshCommand implements CommandExecutor {
|
|||||||
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else {
|
|
||||||
profile = mcMMOPlayer.getProfile();
|
|
||||||
Player player = mcMMOPlayer.getPlayer();
|
|
||||||
|
|
||||||
// Check if the player is online before we try to send them a message.
|
sender.sendMessage(LocaleLoader.getString("Commands.Offline"));
|
||||||
if (player.isOnline()) {
|
return true;
|
||||||
player.sendMessage(LocaleLoader.getString("Ability.Generic.Refresh"));
|
}
|
||||||
}
|
profile = mcMMOPlayer.getProfile();
|
||||||
|
Player player = mcMMOPlayer.getPlayer();
|
||||||
|
|
||||||
|
if (!player.isOnline()) {
|
||||||
|
sender.sendMessage(LocaleLoader.getString("Commands.Offline"));
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
profile.setRecentlyHurt(0);
|
||||||
|
profile.resetCooldowns();
|
||||||
|
profile.resetToolPrepMode();
|
||||||
|
profile.resetAbilityMode();
|
||||||
|
|
||||||
|
player.sendMessage(LocaleLoader.getString("Ability.Generic.Refresh"));
|
||||||
sender.sendMessage(LocaleLoader.getString("Commands.mcrefresh.Success", args[0]));
|
sender.sendMessage(LocaleLoader.getString("Commands.mcrefresh.Success", args[0]));
|
||||||
break;
|
return true;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
profile.setRecentlyHurt(0);
|
|
||||||
profile.resetCooldowns();
|
|
||||||
profile.resetToolPrepMode();
|
|
||||||
profile.resetAbilityMode();
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,16 +50,24 @@ public class McabilityCommand implements CommandExecutor {
|
|||||||
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sender.sendMessage(LocaleLoader.getString("Commands.Offline"));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Player player = mcMMOPlayer.getPlayer();
|
||||||
|
profile = mcMMOPlayer.getProfile();
|
||||||
|
|
||||||
|
if (!player.isOnline()) {
|
||||||
|
sender.sendMessage(LocaleLoader.getString("Commands.Offline"));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (profile.getAbilityUse()) {
|
||||||
|
player.sendMessage(LocaleLoader.getString("Commands.Ability.Off"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
profile = mcMMOPlayer.getProfile();
|
player.sendMessage(LocaleLoader.getString("Commands.Ability.On"));
|
||||||
|
|
||||||
if (profile.getAbilityUse()) {
|
|
||||||
mcMMOPlayer.getPlayer().sendMessage(LocaleLoader.getString("Commands.Ability.Off"));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
mcMMOPlayer.getPlayer().sendMessage(LocaleLoader.getString("Commands.Ability.On"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
profile.toggleAbilityUse();
|
profile.toggleAbilityUse();
|
||||||
|
@ -437,6 +437,7 @@ Commands.mmoupdate.Start=[[GRAY]]Starting conversion...
|
|||||||
Commands.mmoupdate.Finish=[[GREEN]]Conversion finished!
|
Commands.mmoupdate.Finish=[[GREEN]]Conversion finished!
|
||||||
Commands.ModDescription=[[RED]]- Read brief mod description
|
Commands.ModDescription=[[RED]]- Read brief mod description
|
||||||
Commands.NoConsole=This command does not support console usage.
|
Commands.NoConsole=This command does not support console usage.
|
||||||
|
Commands.Offline=[[RED]]This command does not work for offline players.
|
||||||
Commands.Other=[[GREEN]]--OTHER COMMANDS--
|
Commands.Other=[[GREEN]]--OTHER COMMANDS--
|
||||||
Commands.Party.Header=[[RED]]-----[][[GREEN]]PARTY[[RED]][]-----
|
Commands.Party.Header=[[RED]]-----[][[GREEN]]PARTY[[RED]][]-----
|
||||||
Commands.Party.Status=[[DARK_GRAY]]NAME: [[WHITE]]{0} {1}
|
Commands.Party.Status=[[DARK_GRAY]]NAME: [[WHITE]]{0} {1}
|
||||||
|
Loading…
Reference in New Issue
Block a user