1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-04 23:37:49 +01:00

Some changes in config

- Now if the player not joined in the job then the placeholder not showing in the chat.
- Fix NullPointerException (again...)
This commit is contained in:
montlikadani 2018-10-15 17:06:40 +02:00
parent 7307b815dc
commit 9dfa9177d1
6 changed files with 57 additions and 31 deletions

View File

@ -167,7 +167,7 @@ public class VersionChecker {
if (player != null)
player.sendMessage(one);
else
Bukkit.getConsoleSender().sendMessage(one);
Jobs.consoleMsg(one);
}
});
}

View File

@ -138,7 +138,7 @@ public class LanguageManager {
c.get("general.error.noinfoByPlayer", "&cNo information found by [%playername%] player name!");
c.get("general.error.ingame", "&cYou can use this command only in game!");
c.get("general.error.fromconsole", "&cYou can use this command only from console!");
c.get("general.error.worldisdisabled", "&cYou cant use command in this world!");
c.get("general.error.worldisdisabled", "&cYou can't use command in this world!");
c.get("general.error.newFurnaceRegistration", "&eRegistered new ownership for furnace &7[current]&e/&f[max]");
c.get("general.error.newBrewingRegistration", "&eRegistered new ownership for brewing stand &7[current]&e/&f[max]");
@ -327,7 +327,7 @@ public class LanguageManager {
c.get("command.give.help.args", "[playername] [jobname] [itemname]");
Jobs.getGCManager().commandArgs.put("give", Arrays.asList("[playername]", "[jobname]", "[jobitemname]"));
c.get("command.give.output.notonline", "&4Player [%playername%] is not online!");
c.get("command.give.output.noitem", "&4Cant find any item by given name!");
c.get("command.give.output.noitem", "&4Can't find any item by given name!");
c.get("command.info.help.title", "&2*** &eJobs&2 ***");
c.get("command.info.help.info", "Show how much each job is getting paid and for what.");
@ -358,45 +358,45 @@ public class LanguageManager {
c.get("command.info.gui.max", "&eMax level:&f ");
c.get("command.info.gui.back", "&e<<< Back");
c.get("command.info.output.break.info", "Break");
c.get("command.info.output.break.info", "&eBreak");
c.get("command.info.output.break.none", "%jobname% does not get money for breaking blocks.");
c.get("command.info.output.tntbreak.info", "TNTBreak");
c.get("command.info.output.tntbreak.info", "&eTNTBreak");
c.get("command.info.output.tntbreak.none", "%jobname% does not get money for breaking blocks with tnt.");
c.get("command.info.output.place.info", "Place");
c.get("command.info.output.place.info", "&ePlace");
c.get("command.info.output.place.none", "%jobname% does not get money for placing blocks.");
c.get("command.info.output.kill.info", "Kill");
c.get("command.info.output.kill.info", "&eKill");
c.get("command.info.output.kill.none", "%jobname% does not get money for killing monsters.");
c.get("command.info.output.mmkill.info", "MMKill");
c.get("command.info.output.mmkill.info", "&eMMKill");
c.get("command.info.output.mmkill.none", "%jobname% does not get money for killing Mythic monsters.");
c.get("command.info.output.fish.info", "Fish");
c.get("command.info.output.fish.info", "&eFish");
c.get("command.info.output.fish.none", "%jobname% does not get money from fishing.");
c.get("command.info.output.craft.info", "Craft");
c.get("command.info.output.craft.info", "&eCraft");
c.get("command.info.output.craft.none", "%jobname% does not get money from crafting.");
c.get("command.info.output.drink.info", "Drink");
c.get("command.info.output.drink.info", "&eDrink");
c.get("command.info.output.drink.none", "%jobname% does not get money for drinking.");
c.get("command.info.output.smelt.info", "Smelt");
c.get("command.info.output.smelt.info", "&eSmelt");
c.get("command.info.output.smelt.none", "%jobname% does not get money from smelting.");
c.get("command.info.output.brew.info", "Brew");
c.get("command.info.output.brew.info", "&eBrew");
c.get("command.info.output.brew.none", "%jobname% does not get money from brewing.");
c.get("command.info.output.eat.info", "Eat");
c.get("command.info.output.eat.info", "&eEat");
c.get("command.info.output.eat.none", "%jobname% does not get money from eating food.");
c.get("command.info.output.dye.info", "Dye");
c.get("command.info.output.dye.info", "&eDye");
c.get("command.info.output.dye.none", "%jobname% does not get money from dyeing.");
c.get("command.info.output.enchant.info", "Enchant");
c.get("command.info.output.enchant.info", "&eEnchant");
c.get("command.info.output.enchant.none", "%jobname% does not get money from enchanting.");
c.get("command.info.output.repair.info", "Repair");
c.get("command.info.output.repair.info", "&eRepair");
c.get("command.info.output.repair.none", "%jobname% does not get money from repairing.");
c.get("command.info.output.breed.info", "Breed");
c.get("command.info.output.breed.info", "&eBreed");
c.get("command.info.output.breed.none", "%jobname% does not get money from breeding.");
c.get("command.info.output.tame.info", "Tame");
c.get("command.info.output.tame.info", "&eTame");
c.get("command.info.output.tame.none", "%jobname% does not get money from taming.");
c.get("command.info.output.milk.info", "Milk");
c.get("command.info.output.milk.info", "&eMilk");
c.get("command.info.output.milk.none", "%jobname% does not get money from milking cows.");
c.get("command.info.output.shear.info", "Shear");
c.get("command.info.output.shear.info", "&eShear");
c.get("command.info.output.shear.none", "%jobname% does not get money from shearing sheeps.");
c.get("command.info.output.explore.info", "Explore");
c.get("command.info.output.explore.info", "&eExplore");
c.get("command.info.output.explore.none", "%jobname% does not get money from exploring.");
c.get("command.info.output.custom-kill.info", "Custom kill");
c.get("command.info.output.custom-kill.info", "&eCustom kill");
c.get("command.info.output.custom-kill.none", "%jobname% does not get money from custom player kills.");
c.get("command.playerinfo.help.info", "Show how much each job is getting paid and for what on another player.");
@ -487,7 +487,7 @@ public class LanguageManager {
c.get("command.top.help.info", "Shows top %amount% players by jobs name.");
c.get("command.top.help.args", "[jobname]");
Jobs.getGCManager().commandArgs.put("top", Arrays.asList("[jobname]"));
c.get("command.top.error.nojob", "Cant find any job with this name.");
c.get("command.top.error.nojob", "Can't find any job with this name.");
c.get("command.top.output.topline", "&aTop&e %amount% &aplayers by &e%jobname% &ajob");
c.get("command.top.output.list", "&e%number%&a. &e%playername% &alvl &e%level% &awith&e %exp% &aexp");
c.get("command.top.output.prev", "&e<<<<< Prev page &2|");
@ -496,7 +496,7 @@ public class LanguageManager {
c.get("command.gtop.help.info", "Shows top %amount% players by global jobs level.");
c.get("command.gtop.help.args", "");
c.get("command.gtop.error.nojob", "Cant find any information.");
c.get("command.gtop.error.nojob", "Can't find any information.");
c.get("command.gtop.output.topline", "&aTop&e %amount% &aplayers by global job level");
c.get("command.gtop.output.list", "&e%number%&a. &e%playername% &alvl &e%level% &awith&e %exp% &aexp");
c.get("command.gtop.output.prev", "&e<<<<< Prev page &2|");
@ -604,7 +604,7 @@ public class LanguageManager {
c.get("message.cowtimer", "&eYou still need to wait &6%time% &esec to get paid for this job.");
c.get("message.blocktimer", "&eYou need to wait: &3[time] &esec more to get paid for this!");
c.get("message.placeblocktimer", "&eYou cant place block faster than &6[time] &esec interval in same place!");
c.get("message.placeblocktimer", "&eYou can't place block faster than &6[time] &esec interval in same place!");
c.get("message.taxes", "&3[amount] &eserver taxes where transfered to this account");
c.get("message.boostStarted", "&eJobs boost time have been started!");

View File

@ -15,7 +15,6 @@ import com.gamingmesh.jobs.CMILib.ItemManager.CMIMaterial;
import com.gamingmesh.jobs.container.JobInfo;
import com.gamingmesh.jobs.container.LocaleReader;
import com.gamingmesh.jobs.container.NameList;
import com.gamingmesh.jobs.stuff.Debug;
public class NameTranslatorManager {

View File

@ -928,7 +928,7 @@ public class JobsPlayer {
this.qProgression.put(job.getName(), g);
List<QuestProgression> pr = new ArrayList<QuestProgression>();
List<QuestProgression> pr = new ArrayList<>();
for (Entry<String, QuestProgression> one : tmp.entrySet()) {
pr.add(one.getValue());
}

View File

@ -573,6 +573,14 @@ public class JobsListener implements Listener {
honorific = "";
String format = event.getFormat();
// check if the player is in the job
for (Job job : Jobs.getJobs()) {
if (!jPlayer.isInJob(job))
format = format.replace("%1$s", "");
return;
}
format = format.replace("%1$s", honorific + "%1$s");
event.setFormat(format);
}
@ -589,6 +597,12 @@ public class JobsListener implements Listener {
if (honorific.equalsIgnoreCase(" "))
honorific = "";
String format = event.getFormat();
// check if the player is in the job
for (Job job : Jobs.getJobs()) {
if (!jPlayer.isInJob(job))
format = format.replace("{jobs}", "");
return;
}
if (!format.contains("{jobs}"))
return;
format = format.replace("{jobs}", honorific);
@ -607,6 +621,12 @@ public class JobsListener implements Listener {
if (honorific.equalsIgnoreCase(" "))
honorific = "";
String format = event.getFormat();
// check if the player is in the job
for (Job job : Jobs.getJobs()) {
if (!jPlayer.isInJob(job))
format = format.replace("{jobs}", "");
return;
}
if (!format.contains("{jobs}"))
return;
format = format.replace("{jobs}", honorific);

View File

@ -127,6 +127,13 @@ command:
args: '[játékos]'
output:
reseted: '&eA fizetési határértékek alaphelyzetbe álltak: &2%playername%'
resetquest:
help:
info: 'A játékosok küldetés visszaállítása'
args: '[játékos] (munkanév)'
output:
reseted: '&eKüldetés visszaállítva: &2%playername%'
noQuests: '&eNincs egy küldetés sem.'
help:
output:
info: '/jobs - A további lehetőségekért.'
@ -196,7 +203,7 @@ command:
stats:
help:
info: 'Kilistázza azokat a munkákat, amelyikbe beléptél.'
args: '[játékosnév]'
args: '[játékos]'
error:
nojob: '&cElőször csatlakozz egy munkához.'
output: ' lvl%joblevel% %jobname% : %jobxp%/%jobmaxxp% xp'
@ -383,7 +390,7 @@ command:
clearownership:
help:
info: 'Tulajdonjog törlése.'
args: '(játékosnév)'
args: '(játékos)'
output:
cleared: '&2Eltávolítva &7[furnaces] &2kemence &7[brewing] &2főzet'
quests:
@ -566,7 +573,7 @@ command:
edititembonus:
help:
info: 'Elembónusz bónuszának szerkesztése'
args: '[list/add/remove] [munka név] [itemBoostName]'
args: '[list/add/remove] [munkanév] [itemBoostName]'
message:
skillup:
broadcast: '%playername% játékost előléptették a %titlename% %jobname% munkában.'