Evening, I'm currently building a server and i'd like to know that if with this plugin http://dev.bukkit.org/bukkit-plugins/jobs/ we could be able to do the following: On the mining job you wouldn't be able to mine diamond ore unless you were level 5. Is there any way to do it? Thank you
It's possible actually. I might look into it once I finish the other plugin I'm working on at the moment.
Import that jar into the IDE. Then look at the following code (Taken from the source of the plugin): Code:java public static void action(JobsPlayer jPlayer, ActionInfo info, double multiplier) { List<JobProgression> progression = jPlayer.getJobProgression(); int numjobs = progression.size(); // no job if (numjobs == 0) { Job jobNone = Jobs.getNoneJob(); if (jobNone != null) { Double income = jobNone.getIncome(info, 1, numjobs); if (income != null) Jobs.getEconomy().pay(jPlayer, income*multiplier); } } else { for (JobProgression prog : progression) { int level = prog.getLevel(); Double income = prog.getJob().getIncome(info, level, numjobs); if (income != null) { Double exp = prog.getJob().getExperience(info, level, numjobs); if (ConfigManager.getJobsConfiguration().addXpPlayer()) { Player player = getServer().getPlayer(jPlayer.getName()); if (player != null) { /** Minecraft experience is calculated in whole numbers only.* Calculate the fraction of an experience point and perform a dice roll.* That way jobs that give fractions of experience points will slowly give* experience in the aggregate*/ int expInt = exp.intValue(); double remainder = exp.doubleValue() - expInt; if (Math.abs(remainder) > Math.random()) { if (exp.doubleValue() < 0) { expInt--; } else { expInt++; } } player.giveExp(expInt); } } // give income Jobs.getEconomy().pay(jPlayer, income*multiplier); int oldLevel = prog.getLevel(); if (prog.addExperience(exp*multiplier)) Jobs.getPlayerManager().performLevelUp(jPlayer, prog.getJob(), oldLevel); } This should give a basic idea how to.