CraftTweaker

CraftTweaker

151M Downloads

[Request] Remove all wandering trades

zitherssd opened this issue ยท 5 comments

commented

Remove all wandering trader trades at once.

I am trying to create a custom trading pool for the wandering trader but I order to do that I need to empty the trading pool first and to do that I have to call villagerTrades.removeWanderingTrade() individually for every trade that exists in the game (including those added by other mods) so this list of things that needs to be removed becomes quite large and tedious to create

Can a simple method that removes all avaliable trades be implemented? Thanksss

Game version is 1.16

commented

So I looked into this and there are a few issues.

If we set the list to null, forge breaks when posting an event.
If we empty the list, vanilla crashes because it can't get a positive bound from an empty list (for random).

So unfortunately there isn't a solution that I am comfortable with implementing

commented

can't get a positive bound from an empty list (for random)

sounds like extremely poor implementation, should have checked if the list was empty first :|

commented

sounds like extremely poor implementation, should have checked if the list was empty first :|

Well, they do check if either list is null first, and if it is, don't run the code.

Only issue is, setting the list to null causes a Forge crash since they don't do a null check when posting an event....

commented

has that been reported to forge?

commented

Nope. You aren't really meant to edit trades like I'm doing, so the answer is probably going to be "don't do that" instead of an actual fix.

Feel free to report it if you want, but it isn't technically an issue to them