mirror of
https://github.com/Zrips/Jobs.git
synced 2024-11-26 12:35:28 +01:00
Correcting income when we have same materials but different data values
This commit is contained in:
parent
a707bf8155
commit
c38fe742b4
@ -1009,7 +1009,7 @@ public class Jobs extends JavaPlugin {
|
||||
|
||||
if (jobinfo == null)
|
||||
continue;
|
||||
|
||||
|
||||
Double income = jobinfo.getIncome(level, numjobs);
|
||||
Double pointAmount = jobinfo.getPoints(level, numjobs);
|
||||
Double expAmount = jobinfo.getExperience(level, numjobs);
|
||||
|
@ -22,6 +22,7 @@ import org.bukkit.Material;
|
||||
|
||||
import com.gamingmesh.jobs.container.ActionType;
|
||||
import com.gamingmesh.jobs.container.BaseActionInfo;
|
||||
import com.gamingmesh.jobs.stuff.Debug;
|
||||
|
||||
public abstract class MaterialActionInfo extends BaseActionInfo {
|
||||
private Material material;
|
||||
|
@ -1171,13 +1171,12 @@ public class ConfigManager {
|
||||
continue;
|
||||
|
||||
if (material != null && material.getMaterial() != null && material.getMaterial() == Material.AIR) {
|
||||
log.warning("Job " + jobKey + " " + actionType.getName() + " cant recognize material! (" + key+")");
|
||||
log.warning("Job " + jobKey + " " + actionType.getName() + " cant recognize material! (" + key + ")");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (material != null && Version.isCurrentLower(Version.v1_13_R1) && meta.isEmpty())
|
||||
meta = String.valueOf(material.getData());
|
||||
|
||||
|
||||
c: if (material != null && material != CMIMaterial.NONE && material.getMaterial() != null) {
|
||||
|
||||
|
@ -21,6 +21,8 @@ package com.gamingmesh.jobs.container;
|
||||
import com.gamingmesh.jobs.Jobs;
|
||||
import com.gamingmesh.jobs.resources.jfep.Parser;
|
||||
import com.gamingmesh.jobs.stuff.ChatColor;
|
||||
import com.gamingmesh.jobs.stuff.Debug;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@ -208,7 +210,14 @@ public class Job {
|
||||
|
||||
public JobInfo getJobInfo(ActionInfo action, int level) {
|
||||
for (JobInfo info : getJobInfo(action.getType())) {
|
||||
if (info.getName().equalsIgnoreCase(action.getName()) || info.getName().equalsIgnoreCase(action.getNameWithSub())) {
|
||||
if (info.getName().equalsIgnoreCase(action.getNameWithSub()) || (info.getName() + ":" + info.getMeta()).equalsIgnoreCase(action.getNameWithSub())) {
|
||||
if (!info.isInLevelRange(level))
|
||||
break;
|
||||
return info;
|
||||
}
|
||||
}
|
||||
for (JobInfo info : getJobInfo(action.getType())) {
|
||||
if (info.getName().equalsIgnoreCase(action.getName())) {
|
||||
if (!info.isInLevelRange(level))
|
||||
break;
|
||||
return info;
|
||||
|
Loading…
Reference in New Issue
Block a user