JohnnyJayJay / spigot-maps

A library to simplify the use of customised maps in Spigot.
GNU Lesser General Public License v3.0
48 stars 4 forks source link

1.16.1 item meta can't cast into map meta #10

Closed kate-gg closed 4 years ago

kate-gg commented 4 years ago

1.16.1 server item meta can't cast into map meta

To Reproduce Steps to reproduce the behavior:

  1. Using 1.16.1 (purpur fork) server
  2. create map itemstack form libary

Expected behavior create an map itemstack

Screenshots, Code & Stack Traces "java.lang.ClassCastException: org.bukkit.craftbukkit.v1_16_R1.inventory.CraftMetaItem cannot be cast to org.bukkit.inventory.meta.MapMeta"

Spigot Version: Purpur-1.16.1

JohnnyJayJay commented 4 years ago

Sorry for the late response, I didn't receive a notification for this issue.

I cannot reproduce your issue, I'm afraid. Can you send more context, such as some code and your build.gradle/pom.xml?

JohnnyJayJay commented 4 years ago

Also, the full stack trace would be helpful.

kate-gg commented 4 years ago

I lost the code now, but it problem of casting v1_16_R1.inventory.CraftMetaItem to org.bukkit.inventory.meta.MapMeta I change an code a bit from v1_16_R1.inventory.CraftMetaItem to Bukkit itemMeta and it's fixed an issue on 1.16.1

JohnnyJayJay commented 4 years ago

Well, as I said, everything works fine for me on 1.16.1. Without code, stack trace and further information about the environment I can't do much unfortunately.

kate-gg commented 4 years ago

then i think an issue is from purpur itself thank for reply

JohnnyJayJay commented 4 years ago

I actually don't think that. Another person seems to have the same issue and they don't use purpur.

JohnnyJayJay commented 4 years ago

I'll leave this issue open for now, in case you come back to it or someone else experiences the same, just reply here again.

ChristianDouglas commented 4 years ago

https://paste.helpch.at/ijenivuhof.md

Heres my full stack trace, here is my grade build file https://paste.helpch.at/funetitiza.coffeescript

JohnnyJayJay commented 4 years ago

I did not mean to close this issue with the above commit lol. But thanks to @Aj3douglas 's help we seem to have identified the issue. The reason is that Material.MAP is not the correct material for non-legacy API versions. When I tested it, I used a legacy API version and therefore it was replaced by Material.LEGACY_MAP, which works correctly. There is now a version check in this.

kate-gg commented 4 years ago

Didn't you try Material.FILLED_MAP

JohnnyJayJay commented 4 years ago

See commit 04bc7d6 .