Add config option to completely disable any wine#83
Open
FinnSetchell wants to merge 1 commit into
Open
Conversation
Adds a 'disabled_wines' config list. A disabled wine can't be crafted (fermentation barrel, apple press, or Create), is hidden from the creative menu / JEI / REI / recipe book, isn't sold by the winemaker villager or wandering trader, and existing bottles can't be drunk. The wine_collector advancement is rebuilt to stay completable. Items stay registered to avoid world corruption.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Adds a
disabled_wineslist to the config that lets you completely disable any wine. Once a wine is disabled you can't craft it (fermentation barrel, apple press, or Create), it won't show up in the creative menu, JEI/REI, or the recipe book, the winemaker villager and wandering trader won't sell it, and any bottles you already have can't be drunk. Thewine_collectoradvancement still works, and the item stays registered so existing worlds don't break.Why I made it
I wanted to remove a specific wine from a modpack without deleting the item outright, since that would corrupt any world that already had it.
Using it
Add item IDs to the
disabled_wineslist, either inconfig/vinery/config.json5or through the in-game config screen (Cloth / Mod Menu → Disabled Wines):How it works
It's basically one main hook plus a few small guards, all reading the same list:
RecipeManagerMixin): at the tail ofRecipeManager#applyI drop any recipe whose result is a disabled wine, no matter the recipe type. That single hook handles the fermentation barrel, the apple press, and Create. Create'sProcessingRecipe#getResultItemreturns its first output, and every Vinery wine recipe only has one output. JEI, REI, and the recipe book all read from the syncedRecipeManager, so they hide it automatically.TabRegistry): wines go through anacceptWinehelper that skips disabled ones.DrinkBlockItem#use): returnsfailfor a disabled wine, so leftover bottles do nothing.VillagerUtil.SellItemFactory#getOfferreturnsnullfor disabled wines, which covers the winemaker villager on both loaders, andWanderingWinemakerEntity#updateTradesfilters its offers.VineryServerDataProvider):wine_collectorneeds you to hold every wine at once, so I rebuild it without the disabled wines (using the Moonlight dynamic data pack that's already there) so it stays completable.get_wineis an OR list, so it's already fine.Testing
I built and ran it on both Fabric and Forge (1.20.1) with
vinery:eisweindisabled:Removed 2 recipe(s)(the fermentation one and the Create mixing one), and eiswein was gone from JEI and creative and couldn't be crafted or drunk.Removed 1 recipe(s), same behaviour.