From b67e02f8e9c2c8d3ee1baf4f3f7edc9a251b3a64 Mon Sep 17 00:00:00 2001 From: Magnus Ulf Date: Sun, 17 Feb 2019 14:30:25 +0100 Subject: [PATCH] Make f powerboost commands more granular close #16 --- plugin.yml | 37 ++++++++++-- src/com/massivecraft/factions/Perm.java | 6 ++ .../factions/cmd/CmdFactions.java | 2 +- ...rBoost.java => CmdFactionsPowerboost.java} | 8 +-- ...ava => CmdFactionsPowerboostAbstract.java} | 60 ++++++++++--------- .../cmd/CmdFactionsPowerboostFaction.java | 15 +++++ ...CmdFactionsPowerboostFactionAbstract.java} | 8 +-- .../cmd/CmdFactionsPowerboostFactionAdd.java | 15 +++++ .../CmdFactionsPowerboostFactionMultiply.java | 15 +++++ .../cmd/CmdFactionsPowerboostFactionSet.java | 15 +++++ .../cmd/CmdFactionsPowerboostFactionShow.java | 15 +++++ .../cmd/CmdFactionsPowerboostFactionTake.java | 15 +++++ .../cmd/CmdFactionsPowerboostPlayer.java | 15 +++++ ... CmdFactionsPowerboostPlayerAbstract.java} | 8 +-- .../cmd/CmdFactionsPowerboostPlayerAdd.java | 15 +++++ .../CmdFactionsPowerboostPlayerMultiply.java | 15 +++++ .../cmd/CmdFactionsPowerboostPlayerSet.java | 15 +++++ .../cmd/CmdFactionsPowerboostPlayerShow.java | 15 +++++ .../cmd/CmdFactionsPowerboostPlayerTake.java | 15 +++++ 19 files changed, 263 insertions(+), 46 deletions(-) rename src/com/massivecraft/factions/cmd/{CmdFactionsPowerBoost.java => CmdFactionsPowerboost.java} (57%) rename src/com/massivecraft/factions/cmd/{CmdFactionsPowerBoostAbstract.java => CmdFactionsPowerboostAbstract.java} (63%) create mode 100644 src/com/massivecraft/factions/cmd/CmdFactionsPowerboostFaction.java rename src/com/massivecraft/factions/cmd/{CmdFactionsPowerBoostFaction.java => CmdFactionsPowerboostFactionAbstract.java} (64%) create mode 100644 src/com/massivecraft/factions/cmd/CmdFactionsPowerboostFactionAdd.java create mode 100644 src/com/massivecraft/factions/cmd/CmdFactionsPowerboostFactionMultiply.java create mode 100644 src/com/massivecraft/factions/cmd/CmdFactionsPowerboostFactionSet.java create mode 100644 src/com/massivecraft/factions/cmd/CmdFactionsPowerboostFactionShow.java create mode 100644 src/com/massivecraft/factions/cmd/CmdFactionsPowerboostFactionTake.java create mode 100644 src/com/massivecraft/factions/cmd/CmdFactionsPowerboostPlayer.java rename src/com/massivecraft/factions/cmd/{CmdFactionsPowerBoostPlayer.java => CmdFactionsPowerboostPlayerAbstract.java} (64%) create mode 100644 src/com/massivecraft/factions/cmd/CmdFactionsPowerboostPlayerAdd.java create mode 100644 src/com/massivecraft/factions/cmd/CmdFactionsPowerboostPlayerMultiply.java create mode 100644 src/com/massivecraft/factions/cmd/CmdFactionsPowerboostPlayerSet.java create mode 100644 src/com/massivecraft/factions/cmd/CmdFactionsPowerboostPlayerShow.java create mode 100644 src/com/massivecraft/factions/cmd/CmdFactionsPowerboostPlayerTake.java diff --git a/plugin.yml b/plugin.yml index 6cf67d44..68e764a0 100644 --- a/plugin.yml +++ b/plugin.yml @@ -71,9 +71,18 @@ permissions: factions.perm.viewall: {description: view all perms held by, default: false} factions.player: {description: show player information} factions.powerboost: {description: manage powerboost, default: false} - factions.powerboost.faction: {description: show faction powerboost, default: false} - factions.powerboost.player: {description: show player powerboost, default: false} - factions.powerboost.set: {description: set powerboost, default: false} + factions.powerboost.faction: {description: manage faction powerboost, default: false} + factions.powerboost.faction.add: {description: add to faction powerboost, default: false} + factions.powerboost.faction.multiply: {description: multiply faction powerboost, default: false} + factions.powerboost.faction.set: {description: set faction powerboost, default: false} + factions.powerboost.faction.show: {description: show faction powerboost, default: false} + factions.powerboost.faction.take: {description: take faction powerboost, default: false} + factions.powerboost.player: {description: manage player powerboost, default: false} + factions.powerboost.player.add: {description: add to player powerboost, default: false} + factions.powerboost.player.multiply: {description: multiply player powerboost, default: false} + factions.powerboost.player.set: {description: set player powerboost, default: false} + factions.powerboost.player.show: {description: show player powerboost, default: false} + factions.powerboost.player.take: {description: take player powerboost, default: false} factions.rank: {description: manage/show ranks, default: false} factions.rank.show: {description: show rank, default: false} factions.rank.set: {description: set rank, default: false} @@ -185,8 +194,17 @@ permissions: factions.player: true factions.powerboost: true factions.powerboost.faction: true + factions.powerboost.faction.add: true + factions.powerboost.faction.multiply: true + factions.powerboost.faction.set: true + factions.powerboost.faction.show: true + factions.powerboost.faction.take: true factions.powerboost.player: true - factions.powerboost.set: true + factions.powerboost.player.add: true + factions.powerboost.player.multiply: true + factions.powerboost.player.set: true + factions.powerboost.player.show: true + factions.powerboost.player.take: true factions.rank: true factions.rank.show: true factions.rank.set: true @@ -247,7 +265,14 @@ permissions: default: false children: factions.kit.rank1: true - factions.powerboost.set: true + factions.powerboost.faction.add: true + factions.powerboost.faction.multiply: true + factions.powerboost.faction.set: true + factions.powerboost.faction.take: true + factions.powerboost.player.add: true + factions.powerboost.player.multiply: true + factions.powerboost.player.set: true + factions.powerboost.player.take: true factions.join.others: true factions.leader.any: true factions.officer.any: true @@ -324,7 +349,9 @@ permissions: factions.promote: true factions.powerboost: true factions.powerboost.faction: true + factions.powerboost.faction.show: true factions.powerboost.player: true + factions.powerboost.player.show: true factions.rank: true factions.rank.show: true factions.rank.set: true diff --git a/src/com/massivecraft/factions/Perm.java b/src/com/massivecraft/factions/Perm.java index 17988c80..d20397ac 100644 --- a/src/com/massivecraft/factions/Perm.java +++ b/src/com/massivecraft/factions/Perm.java @@ -1,6 +1,7 @@ package com.massivecraft.factions; import com.massivecraft.massivecore.Identified; +import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.util.PermissionUtil; import org.bukkit.permissions.Permissible; @@ -65,5 +66,10 @@ public enum Perm implements Identified { return PermissionUtil.hasPermission(permissible, this); } + + public void hasOrThrow(Permissible permissible) throws MassiveException + { + PermissionUtil.hasPermissionOrThrow(permissible, this); + } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactions.java b/src/com/massivecraft/factions/cmd/CmdFactions.java index cd033a54..f876e9ce 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactions.java +++ b/src/com/massivecraft/factions/cmd/CmdFactions.java @@ -58,7 +58,7 @@ public class CmdFactions extends FactionsCommand public CmdFactionsUnstuck cmdFactionsUnstuck = new CmdFactionsUnstuck(); public CmdFactionsOverride cmdFactionsOverride = new CmdFactionsOverride(); public CmdFactionsDisband cmdFactionsDisband = new CmdFactionsDisband(); - public CmdFactionsPowerBoost cmdFactionsPowerBoost = new CmdFactionsPowerBoost(); + public CmdFactionsPowerboost cmdFactionsPowerBoost = new CmdFactionsPowerboost(); public CmdFactionsSetpower cmdFactionsSetpower = new CmdFactionsSetpower(); public CmdFactionsMoneyconvert cmdFactionsMoneyconvert = new CmdFactionsMoneyconvert(); public CmdFactionsConfig cmdFactionsConfig = new CmdFactionsConfig(); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboost.java similarity index 57% rename from src/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java rename to src/com/massivecraft/factions/cmd/CmdFactionsPowerboost.java index 1f057632..cd4a3d38 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboost.java @@ -1,19 +1,19 @@ package com.massivecraft.factions.cmd; -public class CmdFactionsPowerBoost extends FactionsCommand +public class CmdFactionsPowerboost extends FactionsCommand { // -------------------------------------------- // // FIELDS // -------------------------------------------- // - public CmdFactionsPowerBoostPlayer cmdFactionsPowerBoostPlayer = new CmdFactionsPowerBoostPlayer(); - public CmdFactionsPowerBoostFaction cmdFactionsPowerBoostFaction = new CmdFactionsPowerBoostFaction(); + public CmdFactionsPowerboostPlayer cmdFactionsPowerBoostPlayer = new CmdFactionsPowerboostPlayer(); + public CmdFactionsPowerboostFaction cmdFactionsPowerBoostFaction = new CmdFactionsPowerboostFaction(); // -------------------------------------------- // // CONSTRUCT // -------------------------------------------- // - public CmdFactionsPowerBoost() + public CmdFactionsPowerboost() { // Child this.addChild(this.cmdFactionsPowerBoostPlayer); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoostAbstract.java b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostAbstract.java similarity index 63% rename from src/com/massivecraft/factions/cmd/CmdFactionsPowerBoostAbstract.java rename to src/com/massivecraft/factions/cmd/CmdFactionsPowerboostAbstract.java index df536599..4317d07f 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoostAbstract.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostAbstract.java @@ -2,26 +2,33 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Factions; import com.massivecraft.factions.FactionsParticipator; -import com.massivecraft.factions.Perm; import com.massivecraft.massivecore.MassiveException; import com.massivecraft.massivecore.command.type.Type; -import com.massivecraft.massivecore.command.type.TypeNullable; import com.massivecraft.massivecore.command.type.primitive.TypeDouble; import com.massivecraft.massivecore.util.Txt; -public abstract class CmdFactionsPowerBoostAbstract extends FactionsCommand +public abstract class CmdFactionsPowerboostAbstract extends FactionsCommand { // -------------------------------------------- // // CONSTRUCT // -------------------------------------------- // - protected CmdFactionsPowerBoostAbstract(Type parameterType, String parameterName) + protected CmdFactionsPowerboostAbstract(Type parameterType, String parameterName) { // Parameters this.addParameter(parameterType, parameterName); - this.addParameter(TypeNullable.get(TypeDouble.get()), "amount", "show"); + if (!this.getClass().getSimpleName().contains("Show")) + { + this.addParameter(TypeDouble.get(), "amount"); + } } - + + // -------------------------------------------- // + // ABSTRACT + // -------------------------------------------- // + + public abstract double calcNewPowerboost(double current, double d); + // -------------------------------------------- // // OVERRIDE // -------------------------------------------- // @@ -31,35 +38,32 @@ public abstract class CmdFactionsPowerBoostAbstract extends FactionsCommand { // Parameters FactionsParticipator factionsParticipator = this.readArg(); - Double powerBoost = this.readArg(factionsParticipator.getPowerBoost()); - + + boolean updated = false; // Try set the powerBoost - boolean updated = this.trySet(factionsParticipator, powerBoost); + if (this.argIsSet(1)) + { + // Yes updated + updated = true; + + // Calc powerboost + double current = factionsParticipator.getPowerBoost(); + double number = this.readArg(); + double powerBoost = this.calcNewPowerboost(current, number); + + // Set + factionsParticipator.setPowerBoost(powerBoost); + } // Inform - this.informPowerBoost(factionsParticipator, powerBoost, updated); + this.informPowerBoost(factionsParticipator, updated); } - - private boolean trySet(FactionsParticipator factionsParticipator, Double powerBoost) throws MassiveException - { - // Trying to set? - if (!this.argIsSet(1)) return false; - - // Check set permissions - if (!Perm.POWERBOOST_SET.has(sender, true)) throw new MassiveException(); - - // Set - factionsParticipator.setPowerBoost(powerBoost); - - // Return - return true; - } - - private void informPowerBoost(FactionsParticipator factionsParticipator, Double powerBoost, boolean updated) + + private void informPowerBoost(FactionsParticipator factionsParticipator, boolean updated) { // Prepare + Double powerBoost = factionsParticipator.getPowerBoost(); String participatorDescribe = factionsParticipator.describeTo(msender, true); - powerBoost = powerBoost == null ? factionsParticipator.getPowerBoost() : powerBoost; String powerDescription = Txt.parse(Double.compare(powerBoost, 0D) >= 0 ? "bonus" : "penalty"); String when = updated ? "now " : ""; String verb = factionsParticipator.equals(msender) ? "have" : "has"; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostFaction.java b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostFaction.java new file mode 100644 index 00000000..b489b900 --- /dev/null +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostFaction.java @@ -0,0 +1,15 @@ +package com.massivecraft.factions.cmd; + +public class CmdFactionsPowerboostFaction extends FactionsCommand +{ + // -------------------------------------------- // + // FIELDS + // -------------------------------------------- // + + public CmdFactionsPowerboostFactionShow cmdFactionsPowerBoostFactionShow = new CmdFactionsPowerboostFactionShow(); + public CmdFactionsPowerboostFactionSet cmdFactionsPowerBoostFactionSet = new CmdFactionsPowerboostFactionSet(); + public CmdFactionsPowerboostFactionAdd cmdFactionsPowerBoostFactionAdd = new CmdFactionsPowerboostFactionAdd(); + public CmdFactionsPowerboostFactionTake cmdFactionsPowerBoostFactionTake = new CmdFactionsPowerboostFactionTake(); + public CmdFactionsPowerboostFactionMultiply cmdFactionsPowerBoostFactionMultiply = new CmdFactionsPowerboostFactionMultiply(); + +} diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoostFaction.java b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostFactionAbstract.java similarity index 64% rename from src/com/massivecraft/factions/cmd/CmdFactionsPowerBoostFaction.java rename to src/com/massivecraft/factions/cmd/CmdFactionsPowerboostFactionAbstract.java index 623f1bf0..0f42212d 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoostFaction.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostFactionAbstract.java @@ -2,15 +2,15 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.cmd.type.TypeFaction; -public class CmdFactionsPowerBoostFaction extends CmdFactionsPowerBoostAbstract +public abstract class CmdFactionsPowerboostFactionAbstract extends CmdFactionsPowerboostAbstract { // -------------------------------------------- // // CONSTRUCT // -------------------------------------------- // - - public CmdFactionsPowerBoostFaction() + + public CmdFactionsPowerboostFactionAbstract() { super(TypeFaction.get(), "faction"); } - + } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostFactionAdd.java b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostFactionAdd.java new file mode 100644 index 00000000..2b6ec876 --- /dev/null +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostFactionAdd.java @@ -0,0 +1,15 @@ +package com.massivecraft.factions.cmd; + +public class CmdFactionsPowerboostFactionAdd extends CmdFactionsPowerboostFactionAbstract +{ + // -------------------------------------------- // + // OVERRIDE + // -------------------------------------------- // + + @Override + public double calcNewPowerboost(double current, double d) + { + return current + d; + } + +} diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostFactionMultiply.java b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostFactionMultiply.java new file mode 100644 index 00000000..a30de437 --- /dev/null +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostFactionMultiply.java @@ -0,0 +1,15 @@ +package com.massivecraft.factions.cmd; + +public class CmdFactionsPowerboostFactionMultiply extends CmdFactionsPowerboostFactionAbstract +{ + // -------------------------------------------- // + // OVERRIDE + // -------------------------------------------- // + + @Override + public double calcNewPowerboost(double current, double d) + { + return current * d; + } + +} diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostFactionSet.java b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostFactionSet.java new file mode 100644 index 00000000..772c8b51 --- /dev/null +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostFactionSet.java @@ -0,0 +1,15 @@ +package com.massivecraft.factions.cmd; + +public class CmdFactionsPowerboostFactionSet extends CmdFactionsPowerboostFactionAbstract +{ + // -------------------------------------------- // + // OVERRIDE + // -------------------------------------------- // + + @Override + public double calcNewPowerboost(double current, double d) + { + return d; + } + +} diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostFactionShow.java b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostFactionShow.java new file mode 100644 index 00000000..b29f2682 --- /dev/null +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostFactionShow.java @@ -0,0 +1,15 @@ +package com.massivecraft.factions.cmd; + +public class CmdFactionsPowerboostFactionShow extends CmdFactionsPowerboostFactionAbstract +{ + // -------------------------------------------- // + // OVERRIDE + // -------------------------------------------- // + + @Override + public double calcNewPowerboost(double current, double d) + { + throw new UnsupportedOperationException(); + } + +} diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostFactionTake.java b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostFactionTake.java new file mode 100644 index 00000000..8b4262e5 --- /dev/null +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostFactionTake.java @@ -0,0 +1,15 @@ +package com.massivecraft.factions.cmd; + +public class CmdFactionsPowerboostFactionTake extends CmdFactionsPowerboostFactionAbstract +{ + // -------------------------------------------- // + // OVERRIDE + // -------------------------------------------- // + + @Override + public double calcNewPowerboost(double current, double d) + { + return current - d; + } + +} diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostPlayer.java b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostPlayer.java new file mode 100644 index 00000000..45276eeb --- /dev/null +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostPlayer.java @@ -0,0 +1,15 @@ +package com.massivecraft.factions.cmd; + +public class CmdFactionsPowerboostPlayer extends FactionsCommand +{ + // -------------------------------------------- // + // FIELDS + // -------------------------------------------- // + + public CmdFactionsPowerboostPlayerShow cmdFactionsPowerBoostPlayerShow = new CmdFactionsPowerboostPlayerShow(); + public CmdFactionsPowerboostPlayerSet cmdFactionsPowerBoostPlayerSet = new CmdFactionsPowerboostPlayerSet(); + public CmdFactionsPowerboostPlayerAdd cmdFactionsPowerBoostPlayerAdd = new CmdFactionsPowerboostPlayerAdd(); + public CmdFactionsPowerboostPlayerTake cmdFactionsPowerBoostPlayerTake = new CmdFactionsPowerboostPlayerTake(); + public CmdFactionsPowerboostPlayerMultiply cmdFactionsPowerBoostPlayerMultiply = new CmdFactionsPowerboostPlayerMultiply(); + +} diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoostPlayer.java b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostPlayerAbstract.java similarity index 64% rename from src/com/massivecraft/factions/cmd/CmdFactionsPowerBoostPlayer.java rename to src/com/massivecraft/factions/cmd/CmdFactionsPowerboostPlayerAbstract.java index b12073a5..9f952576 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoostPlayer.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostPlayerAbstract.java @@ -2,15 +2,15 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.cmd.type.TypeMPlayer; -public class CmdFactionsPowerBoostPlayer extends CmdFactionsPowerBoostAbstract +public abstract class CmdFactionsPowerboostPlayerAbstract extends CmdFactionsPowerboostAbstract { // -------------------------------------------- // // CONSTRUCT // -------------------------------------------- // - - public CmdFactionsPowerBoostPlayer() + + public CmdFactionsPowerboostPlayerAbstract() { super(TypeMPlayer.get(), "player"); } - + } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostPlayerAdd.java b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostPlayerAdd.java new file mode 100644 index 00000000..558efb7a --- /dev/null +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostPlayerAdd.java @@ -0,0 +1,15 @@ +package com.massivecraft.factions.cmd; + +public class CmdFactionsPowerboostPlayerAdd extends CmdFactionsPowerboostPlayerAbstract +{ + // -------------------------------------------- // + // OVERRIDE + // -------------------------------------------- // + + @Override + public double calcNewPowerboost(double current, double d) + { + return current + d; + } + +} diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostPlayerMultiply.java b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostPlayerMultiply.java new file mode 100644 index 00000000..466e4692 --- /dev/null +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostPlayerMultiply.java @@ -0,0 +1,15 @@ +package com.massivecraft.factions.cmd; + +public class CmdFactionsPowerboostPlayerMultiply extends CmdFactionsPowerboostPlayerAbstract +{ + // -------------------------------------------- // + // OVERRIDE + // -------------------------------------------- // + + @Override + public double calcNewPowerboost(double current, double d) + { + return current * d; + } + +} diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostPlayerSet.java b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostPlayerSet.java new file mode 100644 index 00000000..c04fb51e --- /dev/null +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostPlayerSet.java @@ -0,0 +1,15 @@ +package com.massivecraft.factions.cmd; + +public class CmdFactionsPowerboostPlayerSet extends CmdFactionsPowerboostPlayerAbstract +{ + // -------------------------------------------- // + // OVERRIDE + // -------------------------------------------- // + + @Override + public double calcNewPowerboost(double current, double d) + { + return d; + } + +} diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostPlayerShow.java b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostPlayerShow.java new file mode 100644 index 00000000..6a52ca02 --- /dev/null +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostPlayerShow.java @@ -0,0 +1,15 @@ +package com.massivecraft.factions.cmd; + +public class CmdFactionsPowerboostPlayerShow extends CmdFactionsPowerboostPlayerAbstract +{ + // -------------------------------------------- // + // OVERRIDE + // -------------------------------------------- // + + @Override + public double calcNewPowerboost(double current, double d) + { + throw new UnsupportedOperationException(); + } + +} diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostPlayerTake.java b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostPlayerTake.java new file mode 100644 index 00000000..2f58e222 --- /dev/null +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPowerboostPlayerTake.java @@ -0,0 +1,15 @@ +package com.massivecraft.factions.cmd; + +public class CmdFactionsPowerboostPlayerTake extends CmdFactionsPowerboostPlayerAbstract +{ + // -------------------------------------------- // + // OVERRIDE + // -------------------------------------------- // + + @Override + public double calcNewPowerboost(double current, double d) + { + return current - d; + } + +}