Fix bad reflection

This commit is contained in:
libraryaddict 2020-08-12 17:01:39 +12:00
parent 325e73d059
commit d751a15c6a

View File

@ -1511,11 +1511,8 @@ public class ReflectionManager {
Object iBlockData = idMethod.invoke(null, id); Object iBlockData = idMethod.invoke(null, id);
Class iBlockClass = getNmsClass("IBlockData"); Class iBlockClass = getNmsClass("IBlockData");
Method getBlock = getNmsMethod(iBlockClass, "getBlock");
Object block = getBlock.invoke(iBlockData);
return (BlockData) getCraftMethod("block.data.type.CraftBlockData", "fromData", iBlockClass) return (BlockData) getCraftMethod("block.data.type.CraftBlockData", "fromData", iBlockClass)
.invoke(null, block); .invoke(null, iBlockData);
} }
catch (Exception ex) { catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();