FastCraft

FastCraft

138k Downloads

FastCraftPlus needs an update to 1.12

Fonzee9 opened this issue ยท 5 comments

commented

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.

commented

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())) {

commented

:)

commented

Achievements have prerequesites, so you can't get the Getting Wood Getting Wood achievement if you don't have the Taking Inventory Taking Inventory achievement.

Achievements

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.

commented

What if you removed that tiny code and just did player.hasPlayedBefore in the other one