Dunkmania101 / SpatialHarvesters

A Minecraft mod that adds harvesters that gather resources from space-time itself!
https://www.curseforge.com/minecraft/mc-mods/spatial-harvesters
MIT License
3 stars 5 forks source link

Feature Request: Ability to restrict results to specific tiers of harvesters #23

Closed Letoric closed 3 years ago

Letoric commented 3 years ago

Hello. I've been really enjoying the mod, and will continue to enjoy it. With that said, it's unable to be added to progression based packs, as it doesn't have the ability to restrict things between tiers. Is there any way you could add that in?

Thanks for the mod either way.

Dunkmania101 commented 3 years ago

Glad you like it! I've worked out how that would work. In the config, I'll add a new section with an option for each type of harvester. Each one of those will be yet another list of lists of strings. In each inner list, put the following 3 strings for each item you want to restrict: mod id, registry name, minimum tier (1 - 8, needs to be a string, not an int). The items there will then only be produced by that tier or higher. It won't apply to either of the mob harvesters, since they're only tier 8. Is that good?

Letoric commented 3 years ago

If you were able to add weight (how frequently x ore get's selected in the rolls), I think that that's a great solution to the need. Even without weight, it's great progress.Thanks for the quick response.

On Thu, Dec 24, 2020 at 9:42 AM Dunkmania101 notifications@github.com wrote:

Glad you like it! I've worked out how that would work. In the config, I'll add a new section with an option for each type of harvester. Each one of those will be yet another list of lists of strings. In each inner list, put the following 3 strings for each item you want to restrict: mod id, registry name, minimum tier (1 - 8, needs to be a string, not an int). The items there will then only be produced by that tier or higher. It won't apply to either of the mob harvesters, since they're only tier 8. Is that good?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Dunkmania101/SpatialHarvesters/issues/23#issuecomment-750914042, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGN4BNXWRNGQF4FCEVA62P3SWNOPZANCNFSM4VHSMYFQ .

Dunkmania101 commented 3 years ago

I might do the weights later. For now, the minimum tier thing is done, along with a (hopeful) fix for a rare crash with the mob harvester and some optimization/refactoring. Enjoy!

papaworld commented 3 years ago

Hi, I'd like to weigh in on this thread.

In 1.7.10 MFR had an internal list creation for the Laser Drill... Whitelist and weights based on mods that were found placing it in a File that was not accessible to edit. So, you would have to create your own Blacklist via ZenScript... that was a lot of work removing everything the original Whitelist found and cumbersome to do... add your Whitelist, then adjust weights.

In 1.12.2 Industrial Foregoing scraped the MFR idea for the Drills, opting for Whitelist JSONs in the config folder for each mod found that properly registered "ores", 1 Folder/File for 1 mod. NEAT! and easy to work with. If you didn't want a particular mod, just remove the JSON for that mod... or edit it to Blacklist a particular ore. Also, very easy to add your own customized output.

(back in 1.7.10 and 1.12.2, I programmed MFR/IF Laser Drill to only output Yellorite Ore for Big/Extreme Reactors)

1.16.x - As far as selecting which ores to receive from Spatial's self-generated list in my world... I use Mekanism's OreDictionificator (recognized as a storage device) directly connected (or piped) to the Harvester which only allows the ores I selected in the Dictionificator filter to export as Spatial Harvester goes down it's internal list of ores to export... ore's are also routed to their proper processing machines with multiple Dictionificators. Item trash-cans are also helpful.

With that said, the Tier of Harvester controls the Weight... the Dictionificator controls the Ore Output.

Super mod... definitely enjoying!

Dunkmania101 commented 3 years ago

If I understood what you said you were doing, I think it can also be done with the Resource Disabler key. It explains how to use it in the tooltip. Is that applicable?

papaworld commented 3 years ago

Hi Ya, there are 2 main approaches... hardcode/edit configs which are global and using machinery for a particular world (every world is different).

Hardcode/edit is helpful for those "annoying ore's" that are generated or too often generated that some mods have... or Custom add WhiteList... and this would be a Global customization. Your .toml does just that!! ... and I like it is not a datapack thingie.

Disabler Key (honestly, I didn't even notice it, ooops, sry). Sounds like it will fit the need... similar to RFTools Filter!! I'll give it a run. ThanX.

milkev commented 3 years ago

Is this format incorrect? with this config, ancient debris is still produced by all tiers of ore harvesters. I'm on fabric, if it makes a difference.

"min_tier_ores"=[
[
    minecraft,
    "ancient_debris",
    "6"
]
]
Dunkmania101 commented 3 years ago

I looked through the code and everything looks like it should work. As far as what you put, minecraft not being in quotes might be a problem if that's how it actually is in the file. Otherwise, it looks fine and it's probably something on my end that I'm not seeing.

milkev commented 3 years ago
"min_tier_ores"=[
[
    "minecraft",
    "ancient_debris",
    "6"
]
]

does not work either. ore is not shown as restricted in the sneak+right click, and it still produces it. i placed a new harvester just to be sure, but it didnt change anything.