Thatsmusic99 / HeadsPlus-Archived

A Minecraft heads plugin with many different features that make it unique in multiple ways.
https://www.spigotmc.org/resources/headsplus-1-8-x-1-12-x.40265/
MIT License
11 stars 6 forks source link

fix crafting following spigot patch to catch async recipe add #28

Closed steve4744 closed 5 years ago

steve4744 commented 5 years ago

Hi,

I've noticed that crafting heads in HP has been broken on Spigot 1.13.2 since the patch below was applied on Jan 6th.

async recipe add

This stopped the recipes being added async, and as the IllegalStateException is ignored in the code, there were no errors on joining, but none of the crafting recipes were created. So this PR is just adds the recipes synchronously.

The recipe names also seem to be over long with "headsplus:headsplus_hp....."

2019-03-28_23 44 06

Don't know what you think, but unless it has any knock on effects anywhere else, I thought it might look neater something like:

2019-03-29_00 33 12

Thanks, Steve

Thatsmusic99 commented 5 years ago

Thought this was open as an issue but this does save a headache and a half - cheers!

The main reason it was all async was because the intensity of the method can cause a server to lag slightly, and I will test that myself to ensure that it works fine regardless.

Another possible effect is the actual textures of the heads not working - of which is always a pain in the neck to get working, since they never load when I try to set up the recipes upon startup. I will make sure they work, and if not, will try and see if another plan that could even possibly be less intense will work.

And lastly. Didn’t think recipes would display the headsplus: before the recipes’ NamespacedKey, and did get worried the recipes could’ve gotten overrided. Looks like I was wrong - in conclusion, yeah, that looks much better.

Will pull this change later to test for myself. Thanks once again!

steve4744 commented 5 years ago

Yeah, I can see why you did it async - it makes sense. I suppose an alternative would be to leave the method async but run the Bukkit.addRecipe(recipe) as a sync task from within it?

Thatsmusic99 commented 5 years ago

Head textures work fine. Thank goodness for that!