FastCraftPlus needs an update to 1.12
Fonzee9 opened this issue ยท 5 comments
Thanks for the heads up! It's currently finals week for me, so I'll have to wait a few days to work on this.
Caused by: java.lang.UnsupportedOperationException: Not supported in this Minecraft version.
at org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer.hasAchievement(CraftPlayer.java:574) ~[craftbukkit.jar:git-Spigot-1ffab67-240f16d]
It looks like Player::hasAchievement() is no longer supported.
https://github.com/BenWoodworth/FastCraft/blob/v0.26.5/src/main/java/co/kepler/fastcraftplus/util/RecipeUtil.java#L76
The function was deprecated because Minecraft doesn't use achievements anymore... who knew? ๐คทโโ๏ธ
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/browse/src/main/java/org/bukkit/entity/Player.java#433
I'm going to have to read up on how advancements work, because they replace achievements in 1.12.
Would player.hasPlayedBefore work?
Edit: It should work ๐
Edit 2: I attempted to fix the problem but i am unaware on how to compile a .jar link to the hopefully fix https://pastebin.com/y5dr06EB
Edit 3: I replaced if (a.getParent() == null || player.hasAchievement(a.getParent())) { with this instead (a.getParent() == null || player.hasPlayedBefore(a.getParent())) {
Achievements have prerequesites, so you can't get the Getting Wood achievement if you don't have the Taking Inventory achievement.
The if statement makes sure I'm only giving an achievement if the player has the previous achievements. I'm also pretty sure that the code in the if statement will throw an error too.