mirror of
https://github.com/Zrips/Jobs.git
synced 2025-02-13 02:41:34 +01:00
Better item recognition
This commit is contained in:
parent
374cca2b22
commit
6354efab91
@ -12,12 +12,8 @@
|
|||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.8.0_161"/>
|
||||||
<attributes>
|
<classpathentry exported="true" kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
|
||||||
</attributes>
|
|
||||||
</classpathentry>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
|
@ -1,8 +1,13 @@
|
|||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||||
|
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||||
|
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||||
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
|
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||||
org.eclipse.jdt.core.compiler.source=1.7
|
org.eclipse.jdt.core.compiler.source=1.8
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -96,6 +96,7 @@ import com.gamingmesh.jobs.listeners.PistonProtectionListener;
|
|||||||
import com.gamingmesh.jobs.selection.SelectionManager;
|
import com.gamingmesh.jobs.selection.SelectionManager;
|
||||||
import com.gamingmesh.jobs.stuff.ActionBar;
|
import com.gamingmesh.jobs.stuff.ActionBar;
|
||||||
import com.gamingmesh.jobs.stuff.CMIScoreboardManager;
|
import com.gamingmesh.jobs.stuff.CMIScoreboardManager;
|
||||||
|
import com.gamingmesh.jobs.stuff.Debug;
|
||||||
import com.gamingmesh.jobs.stuff.FurnaceBrewingHandling;
|
import com.gamingmesh.jobs.stuff.FurnaceBrewingHandling;
|
||||||
import com.gamingmesh.jobs.stuff.Loging;
|
import com.gamingmesh.jobs.stuff.Loging;
|
||||||
import com.gamingmesh.jobs.stuff.RawMessage;
|
import com.gamingmesh.jobs.stuff.RawMessage;
|
||||||
|
@ -62,7 +62,6 @@ public class MythicMobs4 implements MythicMobInterface {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDisplayName(String id) {
|
public String getDisplayName(String id) {
|
||||||
Debug.D(id);
|
|
||||||
MythicMob mm = MMAPI.getMythicMob(id);
|
MythicMob mm = MMAPI.getMythicMob(id);
|
||||||
if (mm != null)
|
if (mm != null)
|
||||||
return mm.getDisplayName();
|
return mm.getDisplayName();
|
||||||
|
@ -21,8 +21,10 @@ package com.gamingmesh.jobs.actions;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
|
|
||||||
|
import com.gamingmesh.jobs.Jobs;
|
||||||
import com.gamingmesh.jobs.container.ActionInfo;
|
import com.gamingmesh.jobs.container.ActionInfo;
|
||||||
import com.gamingmesh.jobs.container.ActionType;
|
import com.gamingmesh.jobs.container.ActionType;
|
||||||
|
import com.gamingmesh.jobs.stuff.VersionChecker.Version;
|
||||||
|
|
||||||
public class BlockActionInfo extends MaterialActionInfo implements ActionInfo {
|
public class BlockActionInfo extends MaterialActionInfo implements ActionInfo {
|
||||||
public BlockActionInfo(Block block, ActionType type) {
|
public BlockActionInfo(Block block, ActionType type) {
|
||||||
@ -30,6 +32,8 @@ public class BlockActionInfo extends MaterialActionInfo implements ActionInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static byte getData(Block block) {
|
private static byte getData(Block block) {
|
||||||
|
if (Jobs.getVersionCheckManager().getVersion().isEqualOrHigher(Version.v1_13_R1))
|
||||||
|
return 0;
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
byte data = block.getData();
|
byte data = block.getData();
|
||||||
if (block.getType() == Material.COCOA)
|
if (block.getType() == Material.COCOA)
|
||||||
|
@ -456,7 +456,7 @@ public class editjobs implements Cmd {
|
|||||||
player.sendMessage(ChatColor.GOLD + "Automatically changing block to GLOWING_REDSTONE_ORE. Please update your configuration.");
|
player.sendMessage(ChatColor.GOLD + "Automatically changing block to GLOWING_REDSTONE_ORE. Please update your configuration.");
|
||||||
player.sendMessage(ChatColor.GOLD + "In vanilla minecraft, REDSTONE_ORE changes to GLOWING_REDSTONE_ORE when interacted with.");
|
player.sendMessage(ChatColor.GOLD + "In vanilla minecraft, REDSTONE_ORE changes to GLOWING_REDSTONE_ORE when interacted with.");
|
||||||
player.sendMessage(ChatColor.GOLD + "In the future, Jobs using REDSTONE_ORE instead of GLOWING_REDSTONE_ORE may fail to work correctly.");
|
player.sendMessage(ChatColor.GOLD + "In the future, Jobs using REDSTONE_ORE instead of GLOWING_REDSTONE_ORE may fail to work correctly.");
|
||||||
material = CMIMaterial.GLOWING_REDSTONE_ORE;
|
material = CMIMaterial.REDSTONE_ORE;
|
||||||
}
|
}
|
||||||
|
|
||||||
type = material.toString();
|
type = material.toString();
|
||||||
|
@ -250,7 +250,7 @@ public class ConfigManager {
|
|||||||
Jobs.getPluginLogger().warning("Automatically changing block to GLOWING_REDSTONE_ORE. Please update your configuration.");
|
Jobs.getPluginLogger().warning("Automatically changing block to GLOWING_REDSTONE_ORE. Please update your configuration.");
|
||||||
Jobs.getPluginLogger().warning("In vanilla minecraft, REDSTONE_ORE changes to GLOWING_REDSTONE_ORE when interacted with.");
|
Jobs.getPluginLogger().warning("In vanilla minecraft, REDSTONE_ORE changes to GLOWING_REDSTONE_ORE when interacted with.");
|
||||||
Jobs.getPluginLogger().warning("In the future, Jobs using REDSTONE_ORE instead of GLOWING_REDSTONE_ORE may fail to work correctly.");
|
Jobs.getPluginLogger().warning("In the future, Jobs using REDSTONE_ORE instead of GLOWING_REDSTONE_ORE may fail to work correctly.");
|
||||||
material = CMIMaterial.GLOWING_REDSTONE_ORE;
|
material = CMIMaterial.REDSTONE_ORE;
|
||||||
}
|
}
|
||||||
// END HACK
|
// END HACK
|
||||||
|
|
||||||
@ -832,7 +832,7 @@ public class ConfigManager {
|
|||||||
myKey = myKey.split("-")[0];
|
myKey = myKey.split("-")[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
CMIMaterial material = CMIMaterial.get(myKey);
|
CMIMaterial material = CMIMaterial.get(myKey + (subType));
|
||||||
|
|
||||||
if (material == null)
|
if (material == null)
|
||||||
material = CMIMaterial.get(myKey.replace(" ", "_").toUpperCase());
|
material = CMIMaterial.get(myKey.replace(" ", "_").toUpperCase());
|
||||||
@ -901,7 +901,7 @@ public class ConfigManager {
|
|||||||
Jobs.getPluginLogger().warning("Automatically changing block to GLOWING_REDSTONE_ORE. Please update your configuration.");
|
Jobs.getPluginLogger().warning("Automatically changing block to GLOWING_REDSTONE_ORE. Please update your configuration.");
|
||||||
Jobs.getPluginLogger().warning("In vanilla minecraft, REDSTONE_ORE changes to GLOWING_REDSTONE_ORE when interacted with.");
|
Jobs.getPluginLogger().warning("In vanilla minecraft, REDSTONE_ORE changes to GLOWING_REDSTONE_ORE when interacted with.");
|
||||||
Jobs.getPluginLogger().warning("In the future, Jobs using REDSTONE_ORE instead of GLOWING_REDSTONE_ORE may fail to work correctly.");
|
Jobs.getPluginLogger().warning("In the future, Jobs using REDSTONE_ORE instead of GLOWING_REDSTONE_ORE may fail to work correctly.");
|
||||||
material = CMIMaterial.GLOWING_REDSTONE_ORE;
|
material = CMIMaterial.REDSTONE_ORE;
|
||||||
}
|
}
|
||||||
// END HACK
|
// END HACK
|
||||||
|
|
||||||
@ -1023,6 +1023,36 @@ public class ConfigManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch (actionType) {
|
||||||
|
case BREED:
|
||||||
|
case CUSTOMKILL:
|
||||||
|
case BREW:
|
||||||
|
case EXPLORE:
|
||||||
|
case FISH:
|
||||||
|
case KILL:
|
||||||
|
case MILK:
|
||||||
|
case MMKILL:
|
||||||
|
case SHEAR:
|
||||||
|
case TAME:
|
||||||
|
break;
|
||||||
|
case TNTBREAK:
|
||||||
|
case SMELT:
|
||||||
|
case REPAIR:
|
||||||
|
case PLACE:
|
||||||
|
case ENCHANT:
|
||||||
|
case DYE:
|
||||||
|
case EAT:
|
||||||
|
case CRAFT:
|
||||||
|
case BREAK:
|
||||||
|
if (Jobs.getVersionCheckManager().getVersion().isEqualOrHigher(Version.v1_13_R1)){
|
||||||
|
subType = "";
|
||||||
|
meta = "";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
jobInfo.add(new JobInfo(actionType, id, meta, type + subType, income, incomeEquation, experience, expEquation, pointsEquation, points, fromlevel,
|
jobInfo.add(new JobInfo(actionType, id, meta, type + subType, income, incomeEquation, experience, expEquation, pointsEquation, points, fromlevel,
|
||||||
untilLevel, section.getCurrentPath(), softIncomeLimit, softExpLimit, softPointsLimit));
|
untilLevel, section.getCurrentPath(), softIncomeLimit, softExpLimit, softPointsLimit));
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,7 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
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;
|
||||||
|
|
||||||
public class Job {
|
public class Job {
|
||||||
// job info
|
// job info
|
||||||
@ -225,6 +226,7 @@ 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.getName()) || info.getName().equalsIgnoreCase(action.getNameWithSub())) {
|
||||||
if (!info.isInLevelRange(level))
|
if (!info.isInLevelRange(level))
|
||||||
|
@ -95,6 +95,7 @@ import com.gamingmesh.jobs.container.ExploreRespond;
|
|||||||
import com.gamingmesh.jobs.container.FastPayment;
|
import com.gamingmesh.jobs.container.FastPayment;
|
||||||
import com.gamingmesh.jobs.container.JobProgression;
|
import com.gamingmesh.jobs.container.JobProgression;
|
||||||
import com.gamingmesh.jobs.container.JobsPlayer;
|
import com.gamingmesh.jobs.container.JobsPlayer;
|
||||||
|
import com.gamingmesh.jobs.stuff.Debug;
|
||||||
import com.gamingmesh.jobs.stuff.FurnaceBrewingHandling;
|
import com.gamingmesh.jobs.stuff.FurnaceBrewingHandling;
|
||||||
import com.gamingmesh.jobs.stuff.FurnaceBrewingHandling.ownershipFeedback;
|
import com.gamingmesh.jobs.stuff.FurnaceBrewingHandling.ownershipFeedback;
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
@ -1334,7 +1335,7 @@ public class JobsPaymentListener implements Listener {
|
|||||||
if (event.isCancelled())
|
if (event.isCancelled())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (CMIMaterial.get(block).equals(CMIMaterial.FURNACE) || CMIMaterial.get(block).equals(CMIMaterial.BURNING_FURNACE)) {
|
if (CMIMaterial.get(block).equals(CMIMaterial.FURNACE) || CMIMaterial.get(block).equals(CMIMaterial.LEGACY_BURNING_FURNACE)) {
|
||||||
|
|
||||||
ownershipFeedback done = FurnaceBrewingHandling.registerFurnaces(event.getPlayer(), block);
|
ownershipFeedback done = FurnaceBrewingHandling.registerFurnaces(event.getPlayer(), block);
|
||||||
if (done.equals(ownershipFeedback.tooMany)) {
|
if (done.equals(ownershipFeedback.tooMany)) {
|
||||||
|
@ -247,7 +247,7 @@ public class FurnaceBrewingHandling {
|
|||||||
|
|
||||||
public static ownershipFeedback registerFurnaces(Player player, Block block) {
|
public static ownershipFeedback registerFurnaces(Player player, Block block) {
|
||||||
|
|
||||||
if (!CMIMaterial.get(block).equals(CMIMaterial.FURNACE) && !CMIMaterial.get(block).equals(CMIMaterial.BURNING_FURNACE)) {
|
if (!CMIMaterial.get(block).equals(CMIMaterial.FURNACE) && !CMIMaterial.get(block).equals(CMIMaterial.LEGACY_BURNING_FURNACE)) {
|
||||||
return ownershipFeedback.invalid;
|
return ownershipFeedback.invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -345,7 +345,7 @@ public class FurnaceBrewingHandling {
|
|||||||
if (block == null)
|
if (block == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!CMIMaterial.get(block).equals(CMIMaterial.FURNACE) && !CMIMaterial.get(block).equals(CMIMaterial.BURNING_FURNACE)) {
|
if (!CMIMaterial.get(block).equals(CMIMaterial.FURNACE) && !CMIMaterial.get(block).equals(CMIMaterial.LEGACY_BURNING_FURNACE)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
block.removeMetadata(JobsPaymentListener.furnaceOwnerMetadata, Jobs.getInstance());
|
block.removeMetadata(JobsPaymentListener.furnaceOwnerMetadata, Jobs.getInstance());
|
||||||
|
Loading…
Reference in New Issue
Block a user