• The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

Item Blacklist

VictiniX888

New Member
So I'm making an item blacklist for this thing that dupes items, and I'm kinda stuck with it.
What I'm trying to do is have a String array in the config file and in the onItemRightClick method, loop through it and if the item is present, don't let it dupe the item.

onItemRightClick: https://github.com/VictiniX888/JARM.../victinix/jarm/items/magic/Ditto.java#L34-L42
Config: https://github.com/VictiniX888/JARM...ictinix/jarm/libs/Configurations.java#L80-L82

The chest won't get duped, but the torch will. I have no idea why. Everything else works fine...
 
Not sure what's wrong there but maybe a different approach will help
Maybe you can just get the name of the item the player is holding and look that up in the blacklist. In this case you wouldn't need to split the modid part like that but just could have "minecraft:torch" there.

Another approach is to have the blacklist not as an array of strings, but rather a set of Items that you create on initialization. Then only items need to be compared and not strings.

Edit: If you want to find out the problem with yourcurrent code, debugging should help. Put a breakpoint at the method and run the game in debug mode.
 
Back
Top