Skip to content

Commit

Permalink
Format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ericgrandt committed Jan 25, 2017
1 parent bce5d92 commit 739014d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
11 changes: 6 additions & 5 deletions src/main/java/com/erigitic/commands/JobCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public CommandResult execute(CommandSource src, CommandContext args) throws Comm
if (src instanceof Player) {
Player player = ((Player) src).getPlayer().get();

//Do checks here, in case we or other plugins want to bypass them in the future
// Do checks here, in case we or other plugins want to bypass them in the future
if (args.getOne("jobName").isPresent()) {
String jobName = args.getOne("jobName").get().toString().toLowerCase();

Expand All @@ -66,11 +66,12 @@ public CommandResult execute(CommandSource src, CommandContext args) throws Comm

if (job.getRequirement().isPresent()) {
JobBasedRequirement req = job.getRequirement().get();

if (req.permissionNeeded() != null && !player.hasPermission(req.permissionNeeded()))
throw new CommandException(Text.of("You're not allowed to join job \"" + jobName + "\""));

if (req.jobNeeded() != null && req.jobLevelNeeded() > teJobManager.getJobLevel(req.jobNeeded().toLowerCase(), player)) {
throw new CommandException(Text.of("You need to reach level " +
req.jobLevelNeeded() + " as a " + req.jobNeeded() + " first!"));
throw new CommandException(Text.of("You need to reach level " + req.jobLevelNeeded() + " as a " + req.jobNeeded() + " first!"));
}
}

Expand All @@ -79,8 +80,8 @@ public CommandResult execute(CommandSource src, CommandContext args) throws Comm
String jobName = teJobManager.getPlayerJob(player);

player.sendMessage(Text.of(TextColors.GRAY, "Your current job is: ", TextColors.GOLD, jobName));
player.sendMessage(Text.of(TextColors.GRAY, jobName, " Level: ", TextColors.GOLD, teJobManager.getJobLevel(jobName, player)));
player.sendMessage(Text.of(TextColors.GRAY, jobName, " Exp: ", TextColors.GOLD, teJobManager.getJobExp(jobName, player), "/", teJobManager.getExpToLevel(player), " exp\n"));
player.sendMessage(Text.of(TextColors.GRAY, teJobManager.titleize(jobName), " Level: ", TextColors.GOLD, teJobManager.getJobLevel(jobName, player)));
player.sendMessage(Text.of(TextColors.GRAY, teJobManager.titleize(jobName), " Exp: ", TextColors.GOLD, teJobManager.getJobExp(jobName, player), "/", teJobManager.getExpToLevel(player), " exp\n"));
player.sendMessage(Text.of(TextColors.GRAY, "Available Jobs: ", TextColors.GOLD, teJobManager.getJobList()));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/erigitic/commands/JobInfoCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public CommandResult execute(CommandSource src, CommandContext args) throws Comm

List<Text> lines = new ArrayList();

lines.add(Text.of(TextColors.GREEN, "[TE] Job information about ", TextColors.GOLD, optJobName.isPresent() ? optJobName.get() : teJobManager.getPlayerJob(((Player) src)),"\n"));
lines.add(Text.of(TextColors.GREEN, "Job information for ", TextColors.GOLD, optJobName.isPresent() ? optJobName.get() : teJobManager.getPlayerJob(((Player) src)),"\n\n"));

for (String s : optJob.get().getSets()) {
Optional<TEJobSet> optSet = teJobManager.getJobSet(s);
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/com/erigitic/jobs/TEJobManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public void checkForLevel(Player player) {
accountConfig.getNode(playerUUID.toString(), "jobstats", jobName, "level").setValue(playerLevel + 1);
accountConfig.getNode(playerUUID.toString(), "jobstats", jobName, "exp").setValue(playerCurExp - expToLevel);
player.sendMessage(Text.of(TextColors.GRAY, "Congratulations, you are now a level ", TextColors.GOLD,
playerLevel + 1, " ", jobName, "."));
playerLevel + 1, " ", titleize(jobName)));
}
}

Expand All @@ -318,6 +318,7 @@ public boolean jobExists(String jobName) {
return false;
}


/**
* Convert strings to titles (title -> Title)
*
Expand Down Expand Up @@ -349,7 +350,7 @@ public void setJob(Player player, String jobName) {
accountConfig.getNode(playerUUID.toString(), "jobstats", jobName, "exp").getInt(0)
);

player.sendMessage(Text.of(TextColors.GRAY, "Your job has been changed to ", TextColors.GOLD, titleize(jobName)));
player.sendMessage(Text.of(TextColors.GRAY, "Your job has been changed to ", TextColors.GOLD, jobName));

try {
accountManager.getConfigManager().save(accountConfig);
Expand Down Expand Up @@ -495,7 +496,7 @@ public void onJobSignCheck(ChangeSignEvent event) {

String jobName = lineTwoPlain.toLowerCase();
if (jobExists(lineTwoPlain)) {
lineTwo = Text.of(titleize(jobName)).toBuilder().color(TextColors.GRAY).build();
lineTwo = Text.of(jobName).toBuilder().color(TextColors.GRAY).build();
} else {
lineTwo = Text.of(jobName).toBuilder().color(TextColors.RED).build();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/erigitic/main/TotalEconomy.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
import java.text.NumberFormat;
import java.text.ParsePosition;

@Plugin(id = "totaleconomy", name = "Total Economy", version = "1.6.0", description = "All in one economy plugin for Minecraft/Sponge")
@Plugin(id = "totaleconomy", name = "Total Economy", version = "1.6.0-DEV", description = "All in one economy plugin for Minecraft/Sponge")
public class TotalEconomy {

@Inject
Expand Down

0 comments on commit 739014d

Please sign in to comment.