Disband exploit fixed
This commit is contained in:
parent
12caa1b9d4
commit
f1a42749da
@ -45,13 +45,15 @@ public class CmdDisband extends FCommand {
|
||||
|
||||
boolean isMyFaction = fme != null && faction == myFaction;
|
||||
|
||||
if (!fme.isAdminBypassing() && isMyFaction) {
|
||||
Access access = myFaction.getAccess(fme, PermissableAction.DISBAND);
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.ADMIN) {
|
||||
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "disband faction");
|
||||
|
||||
if (!fme.isAdminBypassing()) {
|
||||
Access access = faction.getAccess(fme, PermissableAction.DISBAND);
|
||||
if (access != Access.ALLOW || fme.getRole() != Role.ADMIN) {
|
||||
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "disband " + faction.getTag());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!faction.isNormal()) {
|
||||
msg(TL.COMMAND_DISBAND_IMMUTABLE.toString());
|
||||
return;
|
||||
@ -64,7 +66,7 @@ public class CmdDisband extends FCommand {
|
||||
|
||||
// check for tnt before disbanding.
|
||||
|
||||
if (!disbandMap.containsKey(me.getUniqueId().toString()) && faction.getTnt() > 0 && isMyFaction) {
|
||||
if (!disbandMap.containsKey(me.getUniqueId().toString()) && faction.getTnt() > 0) {
|
||||
msg(TL.COMMAND_DISBAND_CONFIRM.toString().replace("{tnt}", faction.getTnt() + ""));
|
||||
disbandMap.put(me.getUniqueId().toString(), faction.getId());
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(P.p, new Runnable() {
|
||||
|
@ -41,6 +41,7 @@ public class CmdPower extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
double powerBoost = target.getPowerBoost();
|
||||
String boost = (powerBoost == 0.0) ? "" : (powerBoost > 0.0 ? TL.COMMAND_POWER_BONUS.toString() : TL.COMMAND_POWER_PENALTY.toString()) + powerBoost + ")";
|
||||
msg(TL.COMMAND_POWER_POWER, target.describeTo(fme, true), target.getPowerRounded(), target.getPowerMaxRounded(), boost);
|
||||
|
@ -806,7 +806,7 @@ public enum TL {
|
||||
GENERIC_YOU("you"),
|
||||
GENERIC_YOURFACTION("your faction"),
|
||||
GENERIC_NOPERMISSION("<b>You don't have permission to %1$s."),
|
||||
GENERIC_FPERM_NOPERMISSION("&7Your faction leader does not allow you to %1$s."),
|
||||
GENERIC_FPERM_NOPERMISSION("&7The faction leader does not allow you to &c%1$s."),
|
||||
GENERIC_DOTHAT("do that"), //Ugh nuke this from high orbit
|
||||
GENERIC_NOPLAYERMATCH("<b>No player match found for \"<p>%1$s<b>\"."),
|
||||
GENERIC_NOPLAYERFOUND("<b>No player \"<p>%1$s<b>\" could not be found."),
|
||||
|
Loading…
Reference in New Issue
Block a user