Showing Dropping Anvil Something (Ignore)
This commit is contained in:
@@ -9,39 +9,39 @@ import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
public class CmdPoints extends FCommand {
|
||||
|
||||
public CmdPointsRemove cmdPointsRemove = new CmdPointsRemove();
|
||||
public CmdPointsSet cmdPointsSet = new CmdPointsSet();
|
||||
public CmdPointsAdd cmdPointsAdd = new CmdPointsAdd();
|
||||
public CmdPointsRemove cmdPointsRemove = new CmdPointsRemove();
|
||||
public CmdPointsSet cmdPointsSet = new CmdPointsSet();
|
||||
public CmdPointsAdd cmdPointsAdd = new CmdPointsAdd();
|
||||
|
||||
public CmdPoints() {
|
||||
super();
|
||||
this.aliases.add("points");
|
||||
public CmdPoints() {
|
||||
super();
|
||||
this.aliases.add("points");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.POINTS)
|
||||
.playerOnly()
|
||||
.build();
|
||||
this.requirements = new CommandRequirements.Builder(Permission.POINTS)
|
||||
.playerOnly()
|
||||
.build();
|
||||
|
||||
|
||||
this.addSubCommand(this.cmdPointsAdd);
|
||||
this.addSubCommand(this.cmdPointsRemove);
|
||||
this.addSubCommand(this.cmdPointsSet);
|
||||
}
|
||||
this.addSubCommand(this.cmdPointsAdd);
|
||||
this.addSubCommand(this.cmdPointsRemove);
|
||||
this.addSubCommand(this.cmdPointsSet);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
if (!FactionsPlugin.getInstance().getConfig().getBoolean("f-points.Enabled", true)) {
|
||||
context.msg(TL.GENERIC_DISABLED);
|
||||
return;
|
||||
}
|
||||
context.commandChain.add(this);
|
||||
FactionsPlugin.getInstance().cmdAutoHelp.execute(context);
|
||||
}
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
if (!FactionsPlugin.getInstance().getConfig().getBoolean("f-points.Enabled", true)) {
|
||||
context.msg(TL.GENERIC_DISABLED);
|
||||
return;
|
||||
}
|
||||
context.commandChain.add(this);
|
||||
FactionsPlugin.getInstance().cmdAutoHelp.execute(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_POINTS_DESCRIPTION;
|
||||
}
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_POINTS_DESCRIPTION;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -11,49 +11,49 @@ import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
public class CmdPointsAdd extends FCommand {
|
||||
|
||||
public CmdPointsAdd() {
|
||||
super();
|
||||
this.aliases.add("add");
|
||||
public CmdPointsAdd() {
|
||||
super();
|
||||
this.aliases.add("add");
|
||||
|
||||
this.requiredArgs.add("faction/player");
|
||||
this.requiredArgs.add("# of points");
|
||||
this.requiredArgs.add("faction/player");
|
||||
this.requiredArgs.add("# of points");
|
||||
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.ADDPOINTS)
|
||||
.build();
|
||||
}
|
||||
this.requirements = new CommandRequirements.Builder(Permission.ADDPOINTS)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
Faction faction = Factions.getInstance().getByTag(context.args.get(0));
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
Faction faction = Factions.getInstance().getByTag(context.args.get(0));
|
||||
|
||||
if (faction == null) {
|
||||
FPlayer fPlayer = context.argAsFPlayer(0);
|
||||
if (fPlayer != null) {
|
||||
faction = fPlayer.getFaction();
|
||||
}
|
||||
}
|
||||
if (faction == null) {
|
||||
FPlayer fPlayer = context.argAsFPlayer(0);
|
||||
if (fPlayer != null) {
|
||||
faction = fPlayer.getFaction();
|
||||
}
|
||||
}
|
||||
|
||||
if (faction == null || faction.isWilderness()) {
|
||||
context.msg(TL.COMMAND_POINTS_FAILURE.toString().replace("{faction}", context.args.get(0)));
|
||||
return;
|
||||
}
|
||||
if (context.argAsInt(1) <= 0) {
|
||||
context.msg(TL.COMMAND_POINTS_INSUFFICIENT);
|
||||
return;
|
||||
}
|
||||
if (faction == null || faction.isWilderness()) {
|
||||
context.msg(TL.COMMAND_POINTS_FAILURE.toString().replace("{faction}", context.args.get(0)));
|
||||
return;
|
||||
}
|
||||
if (context.argAsInt(1) <= 0) {
|
||||
context.msg(TL.COMMAND_POINTS_INSUFFICIENT);
|
||||
return;
|
||||
}
|
||||
|
||||
faction.setPoints(faction.getPoints() + context.argAsInt(1));
|
||||
faction.setPoints(faction.getPoints() + context.argAsInt(1));
|
||||
|
||||
context.msg(TL.COMMAND_POINTS_SUCCESSFUL, context.argAsInt(1), faction.getTag(), faction.getPoints());
|
||||
}
|
||||
context.msg(TL.COMMAND_POINTS_SUCCESSFUL, context.argAsInt(1), faction.getTag(), faction.getPoints());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_ADDPOINTS_DESCRIPTION;
|
||||
}
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_ADDPOINTS_DESCRIPTION;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -11,48 +11,48 @@ import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
public class CmdPointsRemove extends FCommand {
|
||||
|
||||
public CmdPointsRemove() {
|
||||
super();
|
||||
this.aliases.add("remove");
|
||||
public CmdPointsRemove() {
|
||||
super();
|
||||
this.aliases.add("remove");
|
||||
|
||||
this.requiredArgs.add("faction/player");
|
||||
this.requiredArgs.add("# of points");
|
||||
this.requiredArgs.add("faction/player");
|
||||
this.requiredArgs.add("# of points");
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.REMOVEPOINTS)
|
||||
.build();
|
||||
this.requirements = new CommandRequirements.Builder(Permission.REMOVEPOINTS)
|
||||
.build();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
Faction faction = Factions.getInstance().getByTag(context.args.get(0));
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
Faction faction = Factions.getInstance().getByTag(context.args.get(0));
|
||||
|
||||
|
||||
FPlayer fPlayer = context.argAsFPlayer(0);
|
||||
if (fPlayer != null) {
|
||||
faction = fPlayer.getFaction();
|
||||
}
|
||||
FPlayer fPlayer = context.argAsFPlayer(0);
|
||||
if (fPlayer != null) {
|
||||
faction = fPlayer.getFaction();
|
||||
}
|
||||
|
||||
if (faction == null || faction.isWilderness()) {
|
||||
context.msg(TL.COMMAND_POINTS_FAILURE.toString().replace("{faction}", context.args.get(0)));
|
||||
return;
|
||||
}
|
||||
if (faction == null || faction.isWilderness()) {
|
||||
context.msg(TL.COMMAND_POINTS_FAILURE.toString().replace("{faction}", context.args.get(0)));
|
||||
return;
|
||||
}
|
||||
|
||||
if (context.argAsInt(1) <= 0) {
|
||||
context.msg(TL.COMMAND_POINTS_INSUFFICIENT);
|
||||
return;
|
||||
}
|
||||
if (context.argAsInt(1) <= 0) {
|
||||
context.msg(TL.COMMAND_POINTS_INSUFFICIENT);
|
||||
return;
|
||||
}
|
||||
|
||||
faction.setPoints(faction.getPoints() - context.argAsInt(1));
|
||||
context.msg(TL.COMMAND_REMOVEPOINTS_SUCCESSFUL, context.argAsInt(1), faction.getTag(), faction.getPoints());
|
||||
}
|
||||
faction.setPoints(faction.getPoints() - context.argAsInt(1));
|
||||
context.msg(TL.COMMAND_REMOVEPOINTS_SUCCESSFUL, context.argAsInt(1), faction.getTag(), faction.getPoints());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_REMOVEPOINTS_DESCRIPTION;
|
||||
}
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_REMOVEPOINTS_DESCRIPTION;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -11,47 +11,47 @@ import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
public class CmdPointsSet extends FCommand {
|
||||
|
||||
public CmdPointsSet() {
|
||||
super();
|
||||
this.aliases.add("set");
|
||||
public CmdPointsSet() {
|
||||
super();
|
||||
this.aliases.add("set");
|
||||
|
||||
this.requiredArgs.add("faction/player");
|
||||
this.requiredArgs.add("# of points");
|
||||
this.requiredArgs.add("faction/player");
|
||||
this.requiredArgs.add("# of points");
|
||||
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.SETPOINTS)
|
||||
.build();
|
||||
}
|
||||
this.requirements = new CommandRequirements.Builder(Permission.SETPOINTS)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
Faction faction = Factions.getInstance().getByTag(context.args.get(0));
|
||||
@Override
|
||||
public void perform(CommandContext context) {
|
||||
Faction faction = Factions.getInstance().getByTag(context.args.get(0));
|
||||
|
||||
FPlayer fPlayer = context.argAsFPlayer(0);
|
||||
if (fPlayer != null) {
|
||||
faction = fPlayer.getFaction();
|
||||
}
|
||||
FPlayer fPlayer = context.argAsFPlayer(0);
|
||||
if (fPlayer != null) {
|
||||
faction = fPlayer.getFaction();
|
||||
}
|
||||
|
||||
if (faction == null || faction.isWilderness()) {
|
||||
context.msg(TL.COMMAND_POINTS_FAILURE.toString().replace("{faction}", context.args.get(0)));
|
||||
return;
|
||||
}
|
||||
if (faction == null || faction.isWilderness()) {
|
||||
context.msg(TL.COMMAND_POINTS_FAILURE.toString().replace("{faction}", context.args.get(0)));
|
||||
return;
|
||||
}
|
||||
|
||||
if (context.argAsInt(1) < 0) {
|
||||
context.msg(TL.COMMAND_POINTS_INSUFFICIENT);
|
||||
return;
|
||||
}
|
||||
if (context.argAsInt(1) < 0) {
|
||||
context.msg(TL.COMMAND_POINTS_INSUFFICIENT);
|
||||
return;
|
||||
}
|
||||
|
||||
faction.setPoints(context.argAsInt(1));
|
||||
context.msg(TL.COMMAND_SETPOINTS_SUCCESSFUL, context.argAsInt(1), faction.getTag(), faction.getPoints());
|
||||
}
|
||||
faction.setPoints(context.argAsInt(1));
|
||||
context.msg(TL.COMMAND_SETPOINTS_SUCCESSFUL, context.argAsInt(1), faction.getTag(), faction.getPoints());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_SETPOINTS_DESCRIPTION;
|
||||
}
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_SETPOINTS_DESCRIPTION;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user