mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Milk Keeps Beneficial Effects
This commit is contained in:
@@ -72,6 +72,14 @@
|
||||
|
||||
return d;
|
||||
}
|
||||
@@ -1063,6 +_,7 @@
|
||||
Iterator<MobEffectInstance> iterator = this.activeEffects.values().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
MobEffectInstance effect = iterator.next();
|
||||
+ if (cause == EntityPotionEffectEvent.Cause.MILK && !this.level().purpurConfig.milkClearsBeneficialEffects && effect.getEffect().value().isBeneficial()) continue; // Purpur - Milk Keeps Beneficial Effects
|
||||
EntityPotionEffectEvent event = CraftEventFactory.callEntityPotionEffectChangeEvent(this, effect, null, cause, EntityPotionEffectEvent.Action.CLEARED);
|
||||
if (event.isCancelled()) {
|
||||
continue;
|
||||
@@ -1372,6 +_,24 @@
|
||||
this.stopSleeping();
|
||||
}
|
||||
|
||||
@@ -14,6 +14,15 @@
|
||||
@Override
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(0, new FloatGoal(this));
|
||||
@@ -89,7 +_,7 @@
|
||||
this,
|
||||
new ItemStack(Items.MILK_BUCKET),
|
||||
SoundEvents.WANDERING_TRADER_REAPPEARED,
|
||||
- wanderingTrader -> this.canDrinkMilk && this.level().isDay() && wanderingTrader.isInvisible() // Paper - Add more WanderingTrader API
|
||||
+ wanderingTrader -> level().purpurConfig.milkClearsBeneficialEffects && this.canDrinkMilk && this.level().isDay() && wanderingTrader.isInvisible() // Paper - Add more WanderingTrader API // // Purpur - Milk Keeps Beneficial Effects
|
||||
)
|
||||
);
|
||||
this.goalSelector.addGoal(1, new TradeWithPlayerGoal(this));
|
||||
@@ -133,8 +_,10 @@
|
||||
return InteractionResult.CONSUME;
|
||||
}
|
||||
|
||||
@@ -144,6 +144,7 @@ public class PurpurWorldConfig {
|
||||
public boolean persistentTileEntityLore = false;
|
||||
public boolean persistentTileEntityDisplayName = true;
|
||||
public int mobLastHurtByPlayerTime = 100;
|
||||
public boolean milkClearsBeneficialEffects = true;
|
||||
private void miscGameplayMechanicsSettings() {
|
||||
useBetterMending = getBoolean("gameplay-mechanics.use-better-mending", useBetterMending);
|
||||
alwaysTameInCreative = getBoolean("gameplay-mechanics.always-tame-in-creative", alwaysTameInCreative);
|
||||
@@ -177,6 +178,7 @@ public class PurpurWorldConfig {
|
||||
persistentTileEntityLore = getBoolean("gameplay-mechanics.persistent-tileentity-lore", persistentTileEntityLore);
|
||||
persistentTileEntityDisplayName = getBoolean("gameplay-mechanics.persistent-tileentity-display-name", persistentTileEntityDisplayName);
|
||||
mobLastHurtByPlayerTime = getInt("gameplay-mechanics.mob-last-hurt-by-player-time", mobLastHurtByPlayerTime);
|
||||
milkClearsBeneficialEffects = getBoolean("gameplay-mechanics.milk-clears-beneficial-effects", milkClearsBeneficialEffects);
|
||||
}
|
||||
|
||||
public int daytimeTicks = 12000;
|
||||
|
||||
Reference in New Issue
Block a user