Skip to content

Commit

Permalink
Fixes locale references to aoneblock.
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Apr 19, 2020
1 parent 57d9425 commit 9a14d44
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public AdminSanityCheck(CompositeCommand islandCommand) {

@Override
public void setup() {
setParametersHelp("oneblock.commands.admin.sanity.parameters");
setDescription("oneblock.commands.admin.sanity.description");
setParametersHelp("aoneblock.commands.admin.sanity.parameters");
setDescription("aoneblock.commands.admin.sanity.description");
// Permission
setPermission("admin.sanity");
addon = (AOneBlock)getAddon();
Expand All @@ -37,7 +37,7 @@ public boolean canExecute(User user, String label, List<String> args) {
// Check phase
Optional<OneBlockPhase> opPhase = addon.getOneBlockManager().getPhase(args.get(0).toUpperCase());
if (!opPhase.isPresent()) {
user.sendMessage("oneblock.commands.admin.setchest.unknown-phase");
user.sendMessage("aoneblock.commands.admin.setchest.unknown-phase");
return false;
} else {
phase = opPhase.get();
Expand All @@ -54,7 +54,7 @@ public boolean execute(User user, String label, List<String> args) {
addon.getOneBlockManager().getProbs(phase);
}
if (user.isPlayer()) {
user.sendMessage("oneblock.commands.admin.setchest.see-console");
user.sendMessage("aoneblock.commands.admin.setchest.see-console");
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public AdminSetChestCommand(CompositeCommand islandCommand) {

@Override
public void setup() {
setParametersHelp("oneblock.commands.admin.setchest.parameters");
setDescription("oneblock.commands.admin.setchest.description");
setParametersHelp("aoneblock.commands.admin.setchest.parameters");
setDescription("aoneblock.commands.admin.setchest.description");
// Permission
setPermission("admin.setchest");
setOnlyPlayer(true);
Expand All @@ -56,7 +56,7 @@ public boolean canExecute(User user, String label, List<String> args) {
// Check phase
Optional<OneBlockPhase> opPhase = addon.getOneBlockManager().getPhase(args.get(0).toUpperCase());
if (!opPhase.isPresent()) {
user.sendMessage("oneblock.commands.admin.setchest.unknown-phase");
user.sendMessage("aoneblock.commands.admin.setchest.unknown-phase");
return false;
} else {
phase = opPhase.get();
Expand All @@ -66,19 +66,19 @@ public boolean canExecute(User user, String label, List<String> args) {
try {
rarity = Rarity.valueOf(args.get(1).toUpperCase());
} catch (Exception e) {
user.sendMessage("oneblock.commands.admin.setchest.unknown-rarity");
user.sendMessage("aoneblock.commands.admin.setchest.unknown-rarity");
return false;
}

// Check that player is looking at a chest
Block target = user.getPlayer().getTargetBlock(null, 5);
if (!target.getType().equals(Material.CHEST)) {
user.sendMessage("oneblock.commands.admin.setchest.look-at-chest");
user.sendMessage("aoneblock.commands.admin.setchest.look-at-chest");
return false;
}
chest = (Chest)target.getState();
if (chest.getInventory().getHolder() instanceof DoubleChest) {
user.sendMessage("oneblock.commands.admin.setchest.only-single-chest");
user.sendMessage("aoneblock.commands.admin.setchest.only-single-chest");
return false;
}
return true;
Expand All @@ -96,14 +96,14 @@ public boolean execute(User user, String label, List<String> args) {
}
}
if (items.isEmpty()) {
user.sendMessage("oneblock.commands.admin.setchest.chest-is-empty");
user.sendMessage("aoneblock.commands.admin.setchest.chest-is-empty");
return false;
}
phase.addChest(items, rarity);
if (addon.getOneBlockManager().saveOneBlockConfig()) {
user.sendMessage("oneblock.commands.admin.setchest.success");
user.sendMessage("aoneblock.commands.admin.setchest.success");
} else {
user.sendMessage("oneblock.commands.admin.setchest.failure");
user.sendMessage("aoneblock.commands.admin.setchest.failure");
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public AdminSetCountCommand(CompositeCommand islandCommand) {

@Override
public void setup() {
setParametersHelp("oneblock.commands.admin.setcount.parameters");
setDescription("oneblock.commands.admin.setcount.description");
setParametersHelp("aoneblock.commands.admin.setcount.parameters");
setDescription("aoneblock.commands.admin.setcount.description");
// Permission
setPermission("admin.setcount");
addon = (AOneBlock)getAddon();
Expand Down Expand Up @@ -62,7 +62,7 @@ public boolean canExecute(User user, String label, List<String> args) {
public boolean execute(User user, String label, List<String> args) {
OneBlockIslands i = addon.getOneBlocksIsland(island);
i.setBlockNumber(count);
user.sendMessage("oneblock.commands.admin.setcount.set", TextVariables.NUMBER, String.valueOf(i.getBlockNumber()), TextVariables.NAME, getPlayers().getName(targetUUID));
user.sendMessage("aoneblock.commands.admin.setcount.set", TextVariables.NUMBER, String.valueOf(i.getBlockNumber()), TextVariables.NAME, getPlayers().getName(targetUUID));
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public IslandCountCommand(CompositeCommand islandCommand) {

@Override
public void setup() {
setDescription("oneblock.commands.count.description");
setDescription("aoneblock.commands.count.description");
setOnlyPlayer(true);
// Permission
setPermission("count");
Expand All @@ -43,7 +43,7 @@ public boolean canExecute(User user, String label, List<String> args) {
public boolean execute(User user, String label, List<String> args) {
getIslands().getProtectedIslandAt(user.getLocation()).ifPresent(island -> {
OneBlockIslands i = addon.getOneBlocksIsland(island);
user.sendMessage("oneblock.commands.count.info", TextVariables.NUMBER, String.valueOf(i.getBlockNumber()), TextVariables.NAME, i.getPhaseName());
user.sendMessage("aoneblock.commands.count.info", TextVariables.NUMBER, String.valueOf(i.getBlockNumber()), TextVariables.NAME, i.getPhaseName());
});
return true;
}
Expand Down

0 comments on commit 9a14d44

Please sign in to comment.