Malorolam / LootBags

Other
21 stars 31 forks source link

Loot tables and the config #75

Closed GreatOrator closed 7 years ago

GreatOrator commented 7 years ago

So found out by accident that players can edit the configs to drop whatever they want and it is used rather than what may be on a server.

For example, server blacklists diamond but the client side config says drop 64, the bags will still drop diamonds despite the server config

Any chance you can put a check in place to sync the server side and ignore the local?

Malorolam commented 7 years ago

Yeah, I'll get that fixed.

Malorolam commented 7 years ago

Further investigation has indicated that the issue is with the JEI addon showing the client's version of the loot tables, the game will use the server version of the loot tables, so changing the configs does nothing.

GreatOrator commented 7 years ago

Normally I would agree, but I have people on a server that has the correct config but the client is using an older config (have not pushed out a pack update yet) and they are still getting the items from the old config

Malorolam commented 7 years ago

That is not possible, I have tested behavior for both configs, the server-side bag data is used for determine what items a bag will give. Now, if the bag has been opened, the inventory is saved and will persist, even if the configs are changed.

GreatOrator commented 7 years ago

I did not believe it either so tested it locally by changing my config then connecting to the server. I would not have reported it if I did not replicate it.

Malorolam commented 7 years ago

I cannot duplicate the behavior locally with a test server and client, so clearly something else is the issue. I need to know the pack you're using and the server and client config sets that are confirmed to cause the issue.

GreatOrator commented 7 years ago

tolkiencraft III on curse, and the current download has the "broken" configs. For the server change the config to blacklist the silver and gold coins listed in the main lootbag config (on the client they are not)

Malorolam commented 7 years ago

Okay, this is exactly what I did:

  1. Downloaded the client-side version from Curse and the server-side from their Github, installing both, omitting the world download as ain't nobody got time to download 2.5gb of world.
  2. Did not touch the client-side config at all.
  3. In the server lootbags.cfg, added tolkientweaks:silver_coin:0 tolkientweaks:gold_coin:0 to the Global Blacklist and removed the respective Global Whitelist entries for those coins.
  4. Tested the client and server both locally, opping myself and opening about 30 common lootbags. No gold or silver coins.
  5. Not convinced, I shut down the server and added to the Global Whitelist minecraft:stone:0:1:1:800
  6. Relaunching the server and opening 30 more common bags gave me a wide selection of stone appearing, confirming that the server is controlling the loot drops.

What I think is that your server config still has the gold and silver coins added to the global whitelist, which supersedes the blacklist.

GreatOrator commented 7 years ago

Ahhhh, ok, that makes sense then. So you do not need the global whitelist then? I thought that was used to define drops to add to the bags in general then the blacklist in the bag config determined what would actually drop from them.

Malorolam commented 7 years ago

How it works priority-wise is that the bag whitelist>bag blacklist>general whitelist>general blacklist>ChestGenHook source, with the general lists controlled per bag by the range of general loot weighting allowed.

GreatOrator commented 7 years ago

Ok, so then you suggest using the bag white list over the bag blacklist and those over the global?

The wiki made it sound like you had to add them to the global whitelist before you could set them to not be included in the bag...or at least the way I interpreted it.

If so, will rework the way I am adding the items to the bags.

Malorolam commented 7 years ago

So the intended purpose of each of the four lists are:

So, unless Tolkien tweaks adds the coins to any of the vanilla loot tables, they won't show up in the bags unless you whitelist them somewhere.

GreatOrator commented 7 years ago

Thank you! That explains it so well! So individual bag whitelist sounds to be the best way not the general whitelist. Either way problem and mystery solved.