mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-02 14:29:07 +01:00
Wrong version check before checking for slabs
This commit is contained in:
parent
72a7644074
commit
e43208ce22
@ -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()) {
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user