1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-29 14:05:25 +01:00

Fixed /jobs browse not works in console

- Some changes in version checking message
- CROPS changed to WHEAT for default
(No version update in plugin.yml because of the check)
This commit is contained in:
montlikadani 2018-10-12 15:59:56 +02:00
parent 67f7ea97c4
commit 804933a294
5 changed files with 55 additions and 24 deletions

View File

@ -82,9 +82,9 @@ public class browse implements Cmd {
String hoverMsg = ""; String hoverMsg = "";
if (!one.getDescription().isEmpty()) { if (!one.getDescription().isEmpty())
hoverMsg += one.getDescription().replace("/n", ""); hoverMsg += one.getDescription().replace("/n", "");
}
if (one.getMaxLevel(sender) > 0) { if (one.getMaxLevel(sender) > 0) {
if (!hoverMsg.isEmpty()) if (!hoverMsg.isEmpty())
hoverMsg += " \n"; hoverMsg += " \n";
@ -121,15 +121,12 @@ public class browse implements Cmd {
sender.sendMessage(Jobs.getLanguage().getMessage("command.browse.output.jobHeader", "[jobname]", j.getName())); sender.sendMessage(Jobs.getLanguage().getMessage("command.browse.output.jobHeader", "[jobname]", j.getName()));
if (j.getMaxLevel(sender) > 0) { if (j.getMaxLevel(sender) > 0)
sender.sendMessage(Jobs.getLanguage().getMessage("command.info.help.newMax", "[max]", j.getMaxLevel(sender))); sender.sendMessage(Jobs.getLanguage().getMessage("command.info.help.newMax", "[max]", j.getMaxLevel(sender)));
}
if (Jobs.getGCManager().ShowTotalWorkers) { if (Jobs.getGCManager().ShowTotalWorkers)
sender.sendMessage(Jobs.getLanguage().getMessage("command.browse.output.totalWorkers", "[amount]", j.getTotalPlayers())); sender.sendMessage(Jobs.getLanguage().getMessage("command.browse.output.totalWorkers", "[amount]", j.getTotalPlayers()));
}
if (Jobs.getGCManager().useDynamicPayment && Jobs.getGCManager().ShowPenaltyBonus) { if (Jobs.getGCManager().useDynamicPayment && Jobs.getGCManager().ShowPenaltyBonus) {
if ((int) (j.getBonus() * 100) < 0) if ((int) (j.getBonus() * 100) < 0)
sender.sendMessage(Jobs.getLanguage().getMessage("command.browse.output.penalty", "[amount]", (int) (j.getBonus() * 100) * -1)); sender.sendMessage(Jobs.getLanguage().getMessage("command.browse.output.penalty", "[amount]", (int) (j.getBonus() * 100) * -1));
@ -157,19 +154,51 @@ public class browse implements Cmd {
} else { } else {
if (j == null) { if (j == null) {
sender.sendMessage(Jobs.getLanguage().getMessage("command.browse.output.newHeader", "[amount]", jobList.size())); sender.sendMessage(Jobs.getLanguage().getMessage("command.browse.output.newHeader", "[amount]", jobList.size()));
} else { for (Job one : jobList) {
String msg = "";
if (!one.getDescription().isEmpty())
msg += one.getDescription().replace("/n", "");
if (one.getMaxLevel(sender) > 0) {
if (!msg.isEmpty())
msg += " \n";
msg += Jobs.getLanguage().getMessage("command.info.help.newMax", "[max]", one.getMaxLevel(sender));
}
if (Jobs.getGCManager().ShowTotalWorkers) {
if (!msg.isEmpty())
msg += " \n";
msg += Jobs.getLanguage().getMessage("command.browse.output.totalWorkers", "[amount]", one.getTotalPlayers());
}
if (Jobs.getGCManager().useDynamicPayment && Jobs.getGCManager().ShowPenaltyBonus) {
if (!msg.isEmpty())
msg += " \n";
if ((int) (one.getBonus() * 100) < 0)
msg += Jobs.getLanguage().getMessage("command.browse.output.penalty", "[amount]", (int) (one.getBonus() * 100) * -1);
else
msg += Jobs.getLanguage().getMessage("command.browse.output.bonus", "[amount]", (int) (one.getBonus() * 100));
}
if (!msg.isEmpty())
msg += " \n";
msg += Jobs.getLanguage().getMessage("command.browse.output.consoleList", "[jobname]", one.getName());
sender.sendMessage(msg);
}
} else {
sender.sendMessage(Jobs.getLanguage().getMessage("command.browse.output.jobHeader", "[jobname]", j.getName())); sender.sendMessage(Jobs.getLanguage().getMessage("command.browse.output.jobHeader", "[jobname]", j.getName()));
if (j.getMaxLevel(sender) > 0) { if (j.getMaxLevel(sender) > 0)
sender.sendMessage(Jobs.getLanguage().getMessage("command.info.help.newMax", "[max]", j.getMaxLevel(sender))); sender.sendMessage(Jobs.getLanguage().getMessage("command.info.help.newMax", "[max]", j.getMaxLevel(sender)));
}
if (Jobs.getGCManager().ShowTotalWorkers) { if (Jobs.getGCManager().ShowTotalWorkers)
sender.sendMessage(Jobs.getLanguage().getMessage("command.browse.output.totalWorkers", "[amount]", j.getTotalPlayers())); sender.sendMessage(Jobs.getLanguage().getMessage("command.browse.output.totalWorkers", "[amount]", j.getTotalPlayers()));
}
if (Jobs.getGCManager().useDynamicPayment && Jobs.getGCManager().ShowPenaltyBonus) { if (Jobs.getGCManager().useDynamicPayment && Jobs.getGCManager().ShowPenaltyBonus) {
if ((int) (j.getBonus() * 100) < 0) if ((int) (j.getBonus() * 100) < 0)
sender.sendMessage(Jobs.getLanguage().getMessage("command.browse.output.penalty", "[amount]", (int) (j.getBonus() * 100) * -1)); sender.sendMessage(Jobs.getLanguage().getMessage("command.browse.output.penalty", "[amount]", (int) (j.getBonus() * 100) * -1));

View File

@ -432,6 +432,7 @@ public class LanguageManager {
c.get("command.browse.output.newHeader", "&2========== [amount] Available Jobs ========="); c.get("command.browse.output.newHeader", "&2========== [amount] Available Jobs =========");
c.get("command.browse.output.list", " &8[place]. &7[jobname]"); c.get("command.browse.output.list", " &8[place]. &7[jobname]");
c.get("command.browse.output.consoleList", " &6[jobname]");
c.get("command.browse.output.click", "&bClick on the job to see more info about it!"); c.get("command.browse.output.click", "&bClick on the job to see more info about it!");
c.get("command.browse.output.detailed", "&bClick to see more detailed list on job actions"); c.get("command.browse.output.detailed", "&bClick to see more detailed list on job actions");

View File

@ -8,7 +8,6 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.Jobs;
@ -135,13 +134,14 @@ public class VersionChecker {
if (newVersion == null || newVersion.equalsIgnoreCase(currentVersion)) if (newVersion == null || newVersion.equalsIgnoreCase(currentVersion))
return; return;
List<String> msg = Arrays.asList( List<String> msg = Arrays.asList(
ChatColor.GREEN + "*********************** " + plugin.getDescription().getName() + " **************************", "&a*********************** &e" + plugin.getDescription().getName() + "&a **************************",
ChatColor.GREEN + "* " + newVersion + " is now available! Your version: " + currentVersion, "&a* &e" + newVersion + " is now available! Your version: &e" + currentVersion,
ChatColor.GREEN + "* " + ChatColor.DARK_GREEN + plugin.getDescription().getWebsite(), "&a* &2" + plugin.getDescription().getWebsite(),
ChatColor.GREEN + "************************************************************"); "&a* Or get the dev. builds from &2https://github.com/Zrips/Jobs/releases",
"&a************************************************************");
for (String one : msg) for (String one : msg)
if (player != null) if (player != null)
player.sendMessage(one); player.sendMessage(org.bukkit.ChatColor.translateAlternateColorCodes('&', one));
} }
}); });
} }

View File

@ -1287,7 +1287,7 @@ Jobs:
income: 1.5 income: 1.5
points: 1.5 points: 1.5
experience: 3.0 experience: 3.0
CROPS-7: WHEAT-7:
income: 1.5 income: 1.5
points: 1.5 points: 1.5
experience: 3.0 experience: 3.0
@ -1348,7 +1348,7 @@ Jobs:
points: 1 points: 1
experience: 1.0 experience: 1.0
Place: Place:
CROPS-0: WHEAT-0:
income: 3.0 income: 3.0
points: 3 points: 3
experience: 3.0 experience: 3.0

View File

@ -282,7 +282,7 @@ command:
info: '&eBarkácsol' info: '&eBarkácsol'
none: '%jobname% nem kap pénzt, ha barkácsol.' none: '%jobname% nem kap pénzt, ha barkácsol.'
drink: drink:
info: '&eMegiszik' info: '&eMegisz'
none: '%jobname% nem kap pénzt, ha iszik.' none: '%jobname% nem kap pénzt, ha iszik.'
smelt: smelt:
info: '&eOlvaszt' info: '&eOlvaszt'
@ -330,7 +330,7 @@ command:
args: '[munkanév]' args: '[munkanév]'
error: error:
alreadyin: '&cMár csatlakoztál a(z) %jobname%&c munkához!' alreadyin: '&cMár csatlakoztál a(z) %jobname%&c munkához!'
fullslots: '&cNem tudsz csatlakozni a(z) %jobname% munkához, mert nincsenek rendelkezésre álló helyek.' fullslots: '&cNem tudsz csatlakozni a(z) %jobname%&c munkához, mert nincsenek rendelkezésre álló helyek.'
maxjobs: '&cMár túl sok munkát vállaltál.' maxjobs: '&cMár túl sok munkát vállaltál.'
rejoin: '&cNem csatlakozhatsz ebbe a munkába. Várj [time]' rejoin: '&cNem csatlakozhatsz ebbe a munkába. Várj [time]'
rejoin: '&aKattints ide, hogy újra csatlakozz ebbe a munkába: ' rejoin: '&aKattints ide, hogy újra csatlakozz ebbe a munkába: '
@ -366,6 +366,7 @@ command:
bonus: ' &2Bónusz: &a[amount]%' bonus: ' &2Bónusz: &a[amount]%'
newHeader: '&2========== [amount] ELÉRHETŐ MUNKÁK =========' newHeader: '&2========== [amount] ELÉRHETŐ MUNKÁK ========='
list: ' &8[place]. &7[jobname]' list: ' &8[place]. &7[jobname]'
consoleList: ' &6[jobname]'
click: '&bTovábbi információkért kattints a munkára!' click: '&bTovábbi információkért kattints a munkára!'
detailed: '&bKattints ide a munka részleteinek mutatásához.' detailed: '&bKattints ide a munka részleteinek mutatásához.'
jobHeader: '&2========== [jobname] =========' jobHeader: '&2========== [jobname] ========='
@ -415,7 +416,7 @@ command:
error: error:
alreadyin: '&cA játékos már dolgozik %jobname% munkánál.' alreadyin: '&cA játékos már dolgozik %jobname% munkánál.'
output: output:
target: 'Most már a(z) %jobname% munkánál dolgozik.' target: '&aMost már a(z) %jobname%&a munkánál dolgozik.'
top: top:
help: help:
info: 'Top %amount% játékosok a ranglistán.' info: 'Top %amount% játékosok a ranglistán.'