Charles445 / SimpleDifficulty

Difficulty mod based on Tough as Nails
MIT License
14 stars 9 forks source link

Add config option to enable/disable heat and cold potions. #15

Closed zachcheatham closed 3 years ago

Charles445 commented 3 years ago

I'll need to do this same thing with enchantments at some point... I'm unsure about the need to do it with potions though. Is there a reason to stop potions registering vs. making them uncraftable / have no duration?

zachcheatham commented 3 years ago

I actually forgot to remove the recipes as well. Do you think it would be better to only remove their recipes? If only the recipe was removed, the potion is still available for people to grab via creative. I'm not sure what the standard is there.

I'm working with someone on a pack where they don't want players to be able to use those potions.

Charles445 commented 3 years ago

Yeah, usually the standard is to just make the item unobtainable or worthless. Unless there are mods that read from the entire potion registry, removing the recipes is good enough. Craft tweaker's broken and can't make them unobtainable, but we can certainly make them worthless and hide them a little.


I think the safest solution for the modpack would be to go into the simpledifficulty.cfg and find and change this config

I:ResistancePotionDurationLong=21
I:ResistancePotionDurationShort=21

That'll make the potions pretty much worthless, as they'll only last a second. (I chose 21 ticks here to make sure the duration tooltip still shows up. Setting them both to 1 tick works, but has no tooltip)

After that, add a craft tweaker script that hides the custom potions in JEI.

mods.jei.JEI.removeAndHide(.withTag({Potion: "simpledifficulty:cold_resist_type"})); mods.jei.JEI.removeAndHide(.withTag({Potion: "simpledifficulty:cold_resist_type"})); mods.jei.JEI.removeAndHide(.withTag({Potion: "simpledifficulty:cold_resist_type"})); mods.jei.JEI.removeAndHide(.withTag({Potion: "simpledifficulty:long_cold_resist_type"})); mods.jei.JEI.removeAndHide(.withTag({Potion: "simpledifficulty:long_cold_resist_type"})); mods.jei.JEI.removeAndHide(.withTag({Potion: "simpledifficulty:long_cold_resist_type"})); mods.jei.JEI.removeAndHide(.withTag({Potion: "simpledifficulty:heat_resist_type"})); mods.jei.JEI.removeAndHide(.withTag({Potion: "simpledifficulty:heat_resist_type"})); mods.jei.JEI.removeAndHide(.withTag({Potion: "simpledifficulty:heat_resist_type"})); mods.jei.JEI.removeAndHide(.withTag({Potion: "simpledifficulty:long_heat_resist_type"})); mods.jei.JEI.removeAndHide(.withTag({Potion: "simpledifficulty:long_heat_resist_type"})); mods.jei.JEI.removeAndHide(.withTag({Potion: "simpledifficulty:long_heat_resist_type"}));

clocktic commented 3 years ago

Hello, this is the mentioned friend. My goal for the pack is to remove potion recipes and brewing stand and replace it with rustic's alchemy system. I hit a bump when it came to removing the cold/heat resist potions. I've been using brewing.removeRecipe from CraftTweaker to remove brewing recipes but I'm unable to remove those specific potion recipes. People will still be able to see the brewing recipes in JEI when checking out items such as magma_chunk/ice_chunk, I can try to work around this but I'm still confused on why brewing.removeRecipe wont work on those potions. I lack programming skills so forgive me for any inconvenience.

This is what I used: brewing.removeRecipe(.withTag({Potion: "minecraft:awkward"}), ); brewing.removeRecipe(.withTag({Potion: "minecraft:awkward"}), );

Charles445 commented 3 years ago

I have no clue, it didn't work when I tried it either. Are you able to remove other mods' potions with craft tweaker? If so, which mods' potions were you able to remove?

clocktic commented 3 years ago

I've tried other modded potions and they do work with brewing.removeRecipe. I've looked at modded potions that also used the minecraft awkward potion in its brewing recipe and they were also removable.

I've tested this on this mod https://www.curseforge.com/minecraft/mc-mods/potion-plus which also uses custom items and awkward potions in some of its brewing recipe. (ex. was able to remove the "Effect Remover" Potion recipe)

Charles445 commented 3 years ago

Okay, I figured it out. CraftTweaker is only able to remove potion recipes that are considered "vanilla" recipes. That means the recipes were made without using Forge's brewing recipe system.

While I'm pretty sure modders are supposed to use the Forge brewing recipe system, there doesn't seem to be any issue in using the vanilla one, so I'm going to switch to using it in 0.3.4

Once SimpleDifficulty 0.3.4 comes out, this CraftTweaker script will work:

brewing.removeRecipe(.withTag({Potion:"minecraft:awkward"}), ); brewing.removeRecipe(.withTag({Potion:"minecraft:awkward"}), ); brewing.removeRecipe(.withTag({Potion:"minecraft:awkward"}), ); brewing.removeRecipe(.withTag({Potion:"minecraft:awkward"}), ); brewing.removeRecipe(.withTag({Potion:"minecraft:awkward"}), ); brewing.removeRecipe(.withTag({Potion:"minecraft:awkward"}), );

Charles445 commented 3 years ago

The mod has been updated to 0.3.4, the CraftTweaker script I posted in the previous comment should work now!

zachcheatham commented 3 years ago

Thanks, Charles!