diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java b/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java index d8536326..681682e6 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/ItemManager.java @@ -2257,7 +2257,7 @@ public class ItemManager { if (!isSlab(block.getType())) return SlabType.NOTSLAB; - if (Jobs.getVersionCheckManager().getVersion().isEqualOrHigher(Version.v1_10_R1.v1_13_R1)) { + if (Jobs.getVersionCheckManager().getVersion().isEqualOrHigher(Version.v1_13_R1)) { if (block.getBlockData() instanceof org.bukkit.block.data.type.Slab) { org.bukkit.block.data.type.Slab slab = (org.bukkit.block.data.type.Slab) block.getBlockData(); switch (slab.getType()) { diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/ItemReflection.java b/src/main/java/com/gamingmesh/jobs/CMILib/ItemReflection.java index b1f22f97..8247ff97 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/ItemReflection.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/ItemReflection.java @@ -4,6 +4,7 @@ package com.gamingmesh.jobs.CMILib; +import java.lang.reflect.Field; import java.lang.reflect.Method; import org.bukkit.Bukkit; @@ -67,6 +68,23 @@ public class ItemReflection { } public static String getItemMinecraftName(ItemStack item) { + try { + Object nmsStack = asNMSCopy(item); + Field field = Item.getField("REGISTRY"); + Object reg = field.get(field); + Method meth = reg.getClass().getMethod("b", Object.class); + meth.setAccessible(true); + Method secmeth = nmsStack.getClass().getMethod("getItem"); + Object res2 = secmeth.invoke(nmsStack); + Object res = meth.invoke(reg, res2); + return res.toString(); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + public static String getItemRealName(ItemStack item) { try { Object nmsStack = asNMSCopy(item); Method itemMeth = Item.getMethod("getById", int.class); diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 22aa200f..31047628 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,7 +1,7 @@ name: Jobs description: Jobs Plugin for the BukkitAPI main: com.gamingmesh.jobs.Jobs -version: 4.7.0 +version: 4.7.1 api-version: 1.13 website: https://www.spigotmc.org/resources/jobs-reborn.4216/ author: phrstbrn