Closed ybw0014 closed 1 month ago
@ybw0014 Two questions:
@ybw0014 Two questions:
- Is this change compatible with previous versions of slimefun?
- Would it be necessary to update the spigot-api dependency?
Remove the wrapping ItemStack wont hurt anything. basically nothing changed, as the inner SlimefunItemStack
is already an ItemStack
.
The suggestion was accepted and approved. Closing this PR, as the complete adjustment being made in another PR will be applied to all related occurrences.
Although sf official version doesnt support 1.21 yet, it is worth applying this PR before getting lots of issues reported when sf supports 1.21. Our forked Slimefun has been updated to 1.21, and there are exceptions thrown in the console when opening certain item's recipe in the guide.
Paper delegates ItemStack in 1.21 (https://github.com/PaperMC/Paper/pull/10852). When you want to create an
ItemStack
by passing an extendedItemStack
instance (e.g.SlimefunItemStack
) to the constructor, like this:It will throw exception when you later trying to add this new ItemStack to the inventory in ChestMenu,
I noticed that all the occurrences of
new ItemStack(Supreme*)
appear in the recipe; it is unnecessary to pass them to a new ItemStack; instead, pass the SlimefunItemStack to the recipe array directly. This PR removes the unnecessary wraps so that they will not cause issues on 1.21 paper servers.