Railcraft

Railcraft

34M Downloads

[Suggestion] Option to disable dungeon loot

TheDeviantCrafter opened this issue ยท 9 comments

commented

Is your feature request related to a problem? Please describe.

A majority of the ingots, plates and gears added to dungeon loot have no use in my pack. Less loved metals like lead and aluminum were removed, and recipes that used them were changed.

Due to a myriad of issues with Railcraft, I have to leave the ingots, plates and gears enabled in the config. These items are then added to dungeon loot, which I don't like.

Describe the solution you'd like
Add a config option to stop Railcraft from adding loot to vanilla loot tables. The Railcraft village structure can be unaffected by this, since removing Railcraft items would leave it empty. It's mostly rails anyway.

Describe alternatives you've considered
I've tried using LootTweaker to remove the items, but to be honest it's way over my head.

Disabling plates, ingots or gears in the config causes certain trades to disappear, and makes the Railcraft village chest generate empty.

Disabling the entire world generation module would probably work, but this would also remove abyssal and quarried stone which are simply too beautiful to eliminate.

Additional context
Add any other context or screenshots about the feature request here.

commented

See the comments in #1532. It is just that vanilla customizations are limited to per world so that you cannot help with global custom loot tables.

commented

I don't quite follow what's being discussed in that issue. Quite a few mods add configs for exactly this situation. How is Railcraft different?

commented

#1532 (comment)
Read the first link about loot table. Loot tables can be customized without extra config; you just need to put you desired loot table files in the data/loot_tables directory for each world/save (not global like mod configs)
Mojang never cared enough to add a (default) global config. As a result, I am trying to make a mod to resolve that, though I am not working much on it as I am fixing bugs for Railcraft.

commented

We have zero ability to dynamically control loot tables thanks to some questionable decisions by Mojang and the Forge team. This already causes us a fair bit of problems as the loot parser dies inelegantly when it encounters a disabled item, preventing any loot from spawning.

So aside from overriding the loot table configs yourself as Liach describes, there isn't much to be done.

commented

Ah, isn't there LootTableLoadEvent?

It won't let you change loot tables generated in existing worlds but any new worlds would allow you add item's to the appropriate loot tables dynamically.

commented

@mallrat208 If you have that energy to write a loot table for every type of item that can be disabled in railcraft for each type of loot environment, you can write them all and ask us to load them with that event. Or we can use dynamic additions without jsons (I guess?).

Again, see #1532 (comment).
If you don't mind, you can create a new world, try not to access any loot, and edit the loot table in data/loot_tables folder under the world save folder.

commented

Make sure you have CraftTweaker2 and LootTweaker installed.

Here's the "code" (to be placed in a zs file in the scripts folder) to remove all Railcraft loot using LootTweaker
import loottweaker.vanilla.loot.LootTables; LootTables.getTable("minecraft:chests/abandoned_mineshaft").removePool("railcraft_tools"); LootTables.getTable("minecraft:chests/abandoned_mineshaft").removePool("railcraft_resources"); LootTables.getTable("minecraft:chests/abandoned_mineshaft").removePool("railcraft_carts");

It seems that items can't currently be removed one by one (although you can remove 1 or more of the pools and then re-add items).

commented

I suggest clearing railcraft loot tables for the best result.

commented

Ah, turns out our loot table injection is somewhat broken. Fix coming.