Skip to content

Commit

Permalink
Add config options to modify resistance potion modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
Meldexun committed Mar 3, 2023
1 parent 51424e8 commit c48bfe3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,19 @@ public class ConfigPotionCore
@RLConfig.RLCraftTwoEightTwo("true")
@RLConfig.RLCraftTwoNine("true")
public boolean additiveResistanceStacking = true;

@Config.Comment("Requires patchPotionCoreResistance patch! Resistance of the resistance potion attribute modifier.")
@Config.Name("Resistance Potion Modifier Amount")
@RLConfig.ImprovementsOnly("0.2")
@RLConfig.RLCraftTwoEightTwo("0.2")
@RLConfig.RLCraftTwoNine("0.2")
public double resistanceAmount = 0.2D;

@Config.Comment("Requires patchPotionCoreResistance patch! Operation of the resistance potion attribute modifier.")
@Config.Name("Resistance Potion Modifier Operation")
@RLConfig.ImprovementsOnly("2")
@RLConfig.RLCraftTwoEightTwo("2")
@RLConfig.RLCraftTwoNine("2")
public int resistanceOperation = 2;

}
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ public static PotionEffect onAddTipsyEffect(PotionEffect potionEffect)

public static Potion resistance_registerPotionAttributeModifier(Potion potion, IAttribute attribute,
String uniqueId, double ammount, int operation) {
// skip registration of attribute modifier
return potion;
// override registration of attribute modifier
return potion.registerPotionAttributeModifier(attribute, uniqueId, ModConfig.server.potioncore.resistanceAmount,
ModConfig.server.potioncore.resistanceOperation);
}

public static double getAdjustedDamageResistanceAttribute(EntityLivingBase entity) {
Expand Down

0 comments on commit c48bfe3

Please sign in to comment.