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

Correcting income when we have same materials but different data values

This commit is contained in:
Zrips 2020-02-15 17:48:22 +02:00
parent a707bf8155
commit c38fe742b4
4 changed files with 14 additions and 5 deletions

View File

@ -22,6 +22,7 @@ import org.bukkit.Material;
import com.gamingmesh.jobs.container.ActionType; import com.gamingmesh.jobs.container.ActionType;
import com.gamingmesh.jobs.container.BaseActionInfo; import com.gamingmesh.jobs.container.BaseActionInfo;
import com.gamingmesh.jobs.stuff.Debug;
public abstract class MaterialActionInfo extends BaseActionInfo { public abstract class MaterialActionInfo extends BaseActionInfo {
private Material material; private Material material;

View File

@ -1178,7 +1178,6 @@ public class ConfigManager {
if (material != null && Version.isCurrentLower(Version.v1_13_R1) && meta.isEmpty()) if (material != null && Version.isCurrentLower(Version.v1_13_R1) && meta.isEmpty())
meta = String.valueOf(material.getData()); meta = String.valueOf(material.getData());
c: if (material != null && material != CMIMaterial.NONE && material.getMaterial() != null) { c: if (material != null && material != CMIMaterial.NONE && material.getMaterial() != null) {
// Need to include those ones and count as regular blocks // Need to include those ones and count as regular blocks

View File

@ -21,6 +21,8 @@ package com.gamingmesh.jobs.container;
import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.resources.jfep.Parser; import com.gamingmesh.jobs.resources.jfep.Parser;
import com.gamingmesh.jobs.stuff.ChatColor; import com.gamingmesh.jobs.stuff.ChatColor;
import com.gamingmesh.jobs.stuff.Debug;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@ -208,7 +210,14 @@ public class Job {
public JobInfo getJobInfo(ActionInfo action, int level) { public JobInfo getJobInfo(ActionInfo action, int level) {
for (JobInfo info : getJobInfo(action.getType())) { 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)) if (!info.isInLevelRange(level))
break; break;
return info; return info;