Item Blacklist

VictiniX888

New Member
Jul 29, 2019
285
-2
0
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...
 

ljfa

New Member
Jul 29, 2019
2,761
-46
0
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.
 

VictiniX888

New Member
Jul 29, 2019
285
-2
0
Well, the first one you suggested works, so I'll go with that :p
Also, thanks for the tip on debugging, really helped out!