mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 10:57:43 +01:00
Add water damage to all mobs (#703)
Co-authored-by: SPh <sph@sphnet.in>
This commit is contained in:
@@ -5,7 +5,7 @@ Subject: [PATCH] Cows naturally aggressive to players chance
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Cow.java b/src/main/java/net/minecraft/world/entity/animal/Cow.java
|
||||
index c718697a9511ccf761467644967397b777446db9..66ecd29cc52483e0a79ec6c9c5dbf071501825d5 100644
|
||||
index 36c06895e270be41ac37a012c9c2444f5968d4c5..7900aa1db625a7f98773a574aac5c87d6057d90a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Cow.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Cow.java
|
||||
@@ -37,6 +37,7 @@ import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
@@ -16,7 +16,7 @@ index c718697a9511ccf761467644967397b777446db9..66ecd29cc52483e0a79ec6c9c5dbf071
|
||||
|
||||
public Cow(EntityType<? extends Cow> type, Level world) {
|
||||
super(type, world);
|
||||
@@ -56,12 +57,19 @@ public class Cow extends Animal {
|
||||
@@ -56,6 +57,7 @@ public class Cow extends Animal {
|
||||
@Override
|
||||
public void initAttributes() {
|
||||
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level.purpurConfig.cowMaxHealth);
|
||||
@@ -24,8 +24,9 @@ index c718697a9511ccf761467644967397b777446db9..66ecd29cc52483e0a79ec6c9c5dbf071
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPurpurBreedTime() {
|
||||
return this.level.purpurConfig.cowBreedingTicks;
|
||||
@@ -67,6 +69,12 @@ public class Cow extends Animal {
|
||||
public boolean isSensitiveToWater() {
|
||||
return this.level.purpurConfig.cowTakeDamageFromWater;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
@@ -36,7 +37,7 @@ index c718697a9511ccf761467644967397b777446db9..66ecd29cc52483e0a79ec6c9c5dbf071
|
||||
// Purpur end
|
||||
|
||||
@Override
|
||||
@@ -69,6 +77,7 @@ public class Cow extends Animal {
|
||||
@@ -74,6 +82,7 @@ public class Cow extends Animal {
|
||||
this.goalSelector.addGoal(0, new FloatGoal(this));
|
||||
this.goalSelector.addGoal(0, new net.pl3x.purpur.entity.ai.HasRider(this)); // Purpur
|
||||
this.goalSelector.addGoal(1, new PanicGoal(this, 2.0D));
|
||||
@@ -44,7 +45,7 @@ index c718697a9511ccf761467644967397b777446db9..66ecd29cc52483e0a79ec6c9c5dbf071
|
||||
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0D));
|
||||
if (level.purpurConfig.cowFeedMushrooms > 0) this.goalSelector.addGoal(3, new TemptGoal(this, 1.25D, Ingredient.of(Items.WHEAT, Blocks.RED_MUSHROOM.asItem(), Blocks.BROWN_MUSHROOM.asItem()), false)); else // Purpur
|
||||
this.goalSelector.addGoal(3, new TemptGoal(this, 1.25D, Ingredient.of(Items.WHEAT), false));
|
||||
@@ -76,10 +85,11 @@ public class Cow extends Animal {
|
||||
@@ -81,10 +90,11 @@ public class Cow extends Animal {
|
||||
this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 1.0D));
|
||||
this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6.0F));
|
||||
this.goalSelector.addGoal(7, new RandomLookAroundGoal(this));
|
||||
@@ -58,13 +59,13 @@ index c718697a9511ccf761467644967397b777446db9..66ecd29cc52483e0a79ec6c9c5dbf071
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index bd191d1b471a3b521129c3d7449e7b6c19a02d58..3206090c54ea80b96f66acdb3dcc1f01a5fb39be 100644
|
||||
index 1176bf5ed5f3cd770dfaef543c045e42d16ff55d..4d36b9359b9fa237acaa9d2dab132718ec5f35b1 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -1164,7 +1164,14 @@ public class PurpurWorldConfig {
|
||||
public double cowMaxHealth = 10.0D;
|
||||
@@ -1179,7 +1179,14 @@ public class PurpurWorldConfig {
|
||||
public int cowFeedMushrooms = 0;
|
||||
public int cowBreedingTicks = 6000;
|
||||
public boolean cowTakeDamageFromWater = false;
|
||||
+ public double cowNaturallyAggressiveToPlayersChance = 0.0D;
|
||||
+ public double cowNaturallyAggressiveToPlayersDamage = 2.0D;
|
||||
private void cowSettings() {
|
||||
@@ -76,10 +77,10 @@ index bd191d1b471a3b521129c3d7449e7b6c19a02d58..3206090c54ea80b96f66acdb3dcc1f01
|
||||
cowRidable = getBoolean("mobs.cow.ridable", cowRidable);
|
||||
cowRidableInWater = getBoolean("mobs.cow.ridable-in-water", cowRidableInWater);
|
||||
if (PurpurConfig.version < 10) {
|
||||
@@ -1175,6 +1182,8 @@ public class PurpurWorldConfig {
|
||||
cowMaxHealth = getDouble("mobs.cow.attributes.max_health", cowMaxHealth);
|
||||
@@ -1191,6 +1198,8 @@ public class PurpurWorldConfig {
|
||||
cowFeedMushrooms = getInt("mobs.cow.feed-mushrooms-for-mooshroom", cowFeedMushrooms);
|
||||
cowBreedingTicks = getInt("mobs.cow.breeding-delay-ticks", cowBreedingTicks);
|
||||
cowTakeDamageFromWater = getBoolean("mobs.cow.takes-damage-from-water", cowTakeDamageFromWater);
|
||||
+ cowNaturallyAggressiveToPlayersChance = getDouble("mobs.cow.naturally-aggressive-to-players.chance", cowNaturallyAggressiveToPlayersChance);
|
||||
+ cowNaturallyAggressiveToPlayersDamage = getDouble("mobs.cow.naturally-aggressive-to-players.damage", cowNaturallyAggressiveToPlayersDamage);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user