Faction Missions Implemented + Allowed Console to give points now
This commit is contained in:
@@ -13,6 +13,7 @@ import com.massivecraft.factions.cmd.relational.CmdRelationNeutral;
|
||||
import com.massivecraft.factions.cmd.relational.CmdRelationTruce;
|
||||
import com.massivecraft.factions.cmd.roles.CmdDemote;
|
||||
import com.massivecraft.factions.cmd.roles.CmdPromote;
|
||||
import com.massivecraft.factions.missions.CmdMissions;
|
||||
import com.massivecraft.factions.shop.CmdShop;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import org.bukkit.Bukkit;
|
||||
@@ -129,6 +130,7 @@ public class FCmdRoot extends FCommand {
|
||||
public CmdLogout cmdLogout = new CmdLogout();
|
||||
public CmdNotifications cmdNotifications = new CmdNotifications();
|
||||
public CmdShop cmdShop = new CmdShop();
|
||||
public CmdMissions cmdMissions = new CmdMissions();
|
||||
|
||||
|
||||
|
||||
@@ -250,6 +252,10 @@ public class FCmdRoot extends FCommand {
|
||||
this.addSubCommand(this.cmdFGlobal);
|
||||
this.addSubCommand(this.cmdViewChest);
|
||||
|
||||
if(P.p.getConfig().getBoolean("Missions-Enabled")){
|
||||
this.addSubCommand(this.cmdMissions);
|
||||
}
|
||||
|
||||
if(P.p.getConfig().getBoolean("F-Shop.Enabled")){
|
||||
this.addSubCommand(this.cmdShop);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class CmdPoints extends FCommand {
|
||||
@Override
|
||||
public void perform() {
|
||||
if (!P.p.getConfig().getBoolean("f-points.Enabled", true)) {
|
||||
fme.msg(TL.GENERIC_DISABLED);
|
||||
msg(TL.GENERIC_DISABLED);
|
||||
return;
|
||||
}
|
||||
this.commandChain.add(this);
|
||||
|
||||
@@ -45,16 +45,17 @@ public class CmdPointsAdd extends FCommand {
|
||||
}
|
||||
|
||||
if (faction == null || faction.isWilderness()) {
|
||||
fme.msg(TL.COMMAND_POINTS_FAILURE.toString().replace("{faction}", args.get(0)));
|
||||
msg(TL.COMMAND_POINTS_FAILURE.toString().replace("{faction}", args.get(0)));
|
||||
return;
|
||||
}
|
||||
if(argAsInt(1) <= 0){
|
||||
fme.msg(TL.COMMAND_POINTS_INSUFFICIENT);
|
||||
msg(TL.COMMAND_POINTS_INSUFFICIENT);
|
||||
return;
|
||||
}
|
||||
|
||||
faction.setPoints(faction.getPoints() + argAsInt(1));
|
||||
fme.msg(TL.COMMAND_POINTS_SUCCESSFUL, argAsInt(1), faction.getTag(), faction.getPoints());
|
||||
|
||||
msg(TL.COMMAND_POINTS_SUCCESSFUL, argAsInt(1), faction.getTag(), faction.getPoints());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -43,17 +43,17 @@ public class CmdPointsRemove extends FCommand {
|
||||
}
|
||||
|
||||
if (faction == null || faction.isWilderness()) {
|
||||
fme.msg(TL.COMMAND_POINTS_FAILURE.toString().replace("{faction}", args.get(0)));
|
||||
msg(TL.COMMAND_POINTS_FAILURE.toString().replace("{faction}", args.get(0)));
|
||||
return;
|
||||
}
|
||||
|
||||
if(argAsInt(1) <= 0){
|
||||
fme.msg(TL.COMMAND_POINTS_INSUFFICIENT);
|
||||
msg(TL.COMMAND_POINTS_INSUFFICIENT);
|
||||
return;
|
||||
}
|
||||
|
||||
faction.setPoints(faction.getPoints() - argAsInt(1));
|
||||
fme.msg(TL.COMMAND_REMOVEPOINTS_SUCCESSFUL, argAsInt(1), faction.getTag(), faction.getPoints());
|
||||
msg(TL.COMMAND_REMOVEPOINTS_SUCCESSFUL, argAsInt(1), faction.getTag(), faction.getPoints());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -42,17 +42,17 @@ public class CmdPointsSet extends FCommand {
|
||||
}
|
||||
|
||||
if (faction == null || faction.isWilderness()) {
|
||||
fme.msg(TL.COMMAND_POINTS_FAILURE.toString().replace("{faction}", args.get(0)));
|
||||
msg(TL.COMMAND_POINTS_FAILURE.toString().replace("{faction}", args.get(0)));
|
||||
return;
|
||||
}
|
||||
|
||||
if(argAsInt(1) < 0){
|
||||
fme.msg(TL.COMMAND_POINTS_INSUFFICIENT);
|
||||
msg(TL.COMMAND_POINTS_INSUFFICIENT);
|
||||
return;
|
||||
}
|
||||
|
||||
faction.setPoints(argAsInt(1));
|
||||
fme.msg(TL.COMMAND_SETPOINTS_SUCCESSFUL, argAsInt(1), faction.getTag(), faction.getPoints());
|
||||
msg(TL.COMMAND_SETPOINTS_SUCCESSFUL, argAsInt(1), faction.getTag(), faction.getPoints());
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user