mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-17 20:11:21 +02:00
Merge pull request #199 from evonuts/master
Clean PR for /eco reset broadcast messages.
This commit is contained in:
@@ -78,6 +78,8 @@ disabledToSpawnMob=\u00a74Spawning this mob was disabled in the config file.
|
|||||||
dontMoveMessage=\u00a76Teleportation will commence in\u00a7c {0}\u00a76. Don''t move.
|
dontMoveMessage=\u00a76Teleportation will commence in\u00a7c {0}\u00a76. Don''t move.
|
||||||
downloadingGeoIp=Downloading GeoIP database ... this might take a while (country: 0.6 MB, city: 20MB)
|
downloadingGeoIp=Downloading GeoIP database ... this might take a while (country: 0.6 MB, city: 20MB)
|
||||||
duplicatedUserdata=Duplicated userdata: {0} and {1}
|
duplicatedUserdata=Duplicated userdata: {0} and {1}
|
||||||
|
ecoResetAll=\u00a76All player balances on this server have been reset to \u00a7c{0}.
|
||||||
|
ecoResetAllOnline=\u00a76All online player balances have been reset to \u00a7c{0}.
|
||||||
durability=\u00a76This tool has \u00a7c{0}\u00a76 uses left.
|
durability=\u00a76This tool has \u00a7c{0}\u00a76 uses left.
|
||||||
enableUnlimited=\u00a76Giving unlimited amount of\u00a7c {0} \u00a76to {1}.
|
enableUnlimited=\u00a76Giving unlimited amount of\u00a7c {0} \u00a76to {1}.
|
||||||
enabled=enabled
|
enabled=enabled
|
||||||
|
@@ -31,6 +31,8 @@ public class Commandeco extends EssentialsCommand
|
|||||||
|
|
||||||
if (args[1].contentEquals("**"))
|
if (args[1].contentEquals("**"))
|
||||||
{
|
{
|
||||||
|
boolean ecoResetAll = false;
|
||||||
|
ISettings settings = ess.getSettings();
|
||||||
for (String sUser : ess.getUserMap().getAllUniqueUsers())
|
for (String sUser : ess.getUserMap().getAllUniqueUsers())
|
||||||
{
|
{
|
||||||
final IUser player = ess.getUserMap().getUser(sUser);
|
final IUser player = ess.getUserMap().getUser(sUser);
|
||||||
@@ -48,14 +50,22 @@ public class Commandeco extends EssentialsCommand
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case RESET:
|
case RESET:
|
||||||
ISettings settings = ess.getSettings();
|
|
||||||
player.setMoney(amount == 0 ? settings.getData().getEconomy().getStartingBalance() : amount);
|
player.setMoney(amount == 0 ? settings.getData().getEconomy().getStartingBalance() : amount);
|
||||||
|
ecoResetAll = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (ecoResetAll == true)
|
||||||
|
{
|
||||||
|
ess.broadcastMessage(null, _("ecoResetAll", settings.getData().getEconomy().getCurrencySymbol() + amount));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (args[1].contentEquals("*"))
|
else if (args[1].contentEquals("*"))
|
||||||
{
|
{
|
||||||
|
boolean ecoResetAllOnline = false;
|
||||||
|
ISettings settings = ess.getSettings();
|
||||||
for (Player onlinePlayer : server.getOnlinePlayers())
|
for (Player onlinePlayer : server.getOnlinePlayers())
|
||||||
{
|
{
|
||||||
final IUser player = ess.getUserMap().getUser(onlinePlayer);
|
final IUser player = ess.getUserMap().getUser(onlinePlayer);
|
||||||
@@ -74,11 +84,15 @@ public class Commandeco extends EssentialsCommand
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case RESET:
|
case RESET:
|
||||||
ISettings settings = ess.getSettings();
|
|
||||||
player.setMoney(amount == 0 ? settings.getData().getEconomy().getStartingBalance() : amount);
|
player.setMoney(amount == 0 ? settings.getData().getEconomy().getStartingBalance() : amount);
|
||||||
|
ecoResetAllOnline = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (ecoResetAllOnline == true)
|
||||||
|
{
|
||||||
|
ess.broadcastMessage(null, _("ecoResetAllOnline", settings.getData().getEconomy().getCurrencySymbol() + amount));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user