Slimefun

Slimefun

3M Downloads

Crafting with renamed items without slimefun_item nbt flag

TheDevTec opened this issue ยท 7 comments

commented

๐Ÿ“ Description (REQUIRED)

Players can craft items using slimefun and normal items (renamed to slimefun items via the /item name command (they cannot add NBT tag "slimefun_item"), this renamed item can then be used in crafting or another SF block, which further processes the item into another item)

๐Ÿ“‘ Steps to reproduce the Issue (REQUIRED)

https://imgur.com/a/5lK15xH

๐Ÿ’ก Expected behavior (REQUIRED)

So I would like to ask you if it would be possible to add an NBT check for all items inserted into crafting or another SF block to process items instead of checking the displayname of the item.

๐Ÿงญ Environment (REQUIRED)

  • Server Software: git-Yatopia-ver/1.16.5-32 (MC: 1.16.5)
  • Minecraft Version: 1.16.5
  • Slimefun Version: DEV - 819 (git 854c333)
commented

You are not supposed to rename slimefun items thats why they are blocked from anvils

commented

That's true, but there should be a check on this by the plugin so that this thing doesn't happen - using normal items as SF items.
What I was looking at is that the plugin automatically adds an NBT tag about whether it is an SF item or not, so why not use it?

commented

You are not able to rename items using color codes in Minecraft.
Slimefun simply does not support this behaviour due to technical limitations.

commented

Bukkit NBT system is new here, but there is still a possibility through reflections and NMS to get to it "manually"
But you're right, it would like to rewrite a lot of things in the plugin and it could take a long time, I take note.

commented

Neither NMS-code or reflection-based methods are relevant here.
The API is there since MC 1.14 (technically 1.13 as a draft).
It's just that the entire crafting system (all machines, every single item and all addons) use a very old, rusty and not flexible enough system which makes this integration completely impossible.
The entire item/recipe/crafting/machine system would need to be rewritten.
And then there are hundreds of servers which still have a lot of pre-2019 items in circulation which do not have these NBT tags applied, so when that rewrite comes around... there'll be a flood of "help my item no longer works" reports.
It's all very complicated but it's being rewritten very carefully since years and will still take a long time to get there.
For now, the system simply doesn't support it.

commented

Could I know the reason why it can't be converted to an NBT system instead of DisplayName?

commented

Bukkit's NBT system is very new and only items crafted after mid-2019 will actually have these NBT tags.
To fully utilise this it requires (and required) an almost entire rewrite of the whole plugin.
This has been going on since 2 years now as you can see, but the majority of it does not support it and won't support it in any reasonable amount of time.
It is not an easy fix and it took years to get here and will likely still take a year or more to get there as well.

And that is a more of an optimistic estimate given that we all do this for free in our spare time.