Configurable chance for wolves to spawn rabid

Configurable chance to spawn a wolf that is rabid.
Rabid wolves attack all players, mobs, and animals.
This commit is contained in:
Encode42
2025-01-10 00:28:49 -08:00
committed by granny
parent ce45f0538f
commit 19fb31302f
9 changed files with 77 additions and 130 deletions

View File

@@ -1,18 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Encode42 <me@encode42.dev>
Date: Tue, 8 Dec 2020 17:15:15 -0500
Subject: [PATCH] Rabid Wolf API
diff --git a/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/com/destroystokyo/paper/entity/ai/VanillaGoal.java
index 9ef2111b60ace1a088c8c3d4707b26c06f14037c..6eea8fbe575c4570c2b760c9828f8ec5b81c7202 100644
--- a/com/destroystokyo/paper/entity/ai/VanillaGoal.java
+++ b/com/destroystokyo/paper/entity/ai/VanillaGoal.java
@@ -449,6 +449,7 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Phantom> ORBIT_CRYSTAL = GoalKey.of(Phantom.class, NamespacedKey.minecraft("orbit_crystal"));
GoalKey<Drowned> DROWNED_ATTACK_VILLAGER = GoalKey.of(Drowned.class, NamespacedKey.minecraft("drowned_attack_villager"));
GoalKey<Zombie> ZOMBIE_ATTACK_VILLAGER = GoalKey.of(Zombie.class, NamespacedKey.minecraft("zombie_attack_villager"));
+ GoalKey<Wolf> AVOID_RABID_WOLF = GoalKey.of(Wolf.class, NamespacedKey.minecraft("avoid_rabid_wolf"));
// Purpur end
private static <T extends Mob> GoalKey<T> create(final String key, final Class<T> type) {

View File

@@ -1,6 +1,6 @@
--- a/generated/com/destroystokyo/paper/entity/ai/VanillaGoal.java
+++ b/generated/com/destroystokyo/paper/entity/ai/VanillaGoal.java
@@ -441,6 +_,20 @@
@@ -441,6 +_,23 @@
GoalKey<Zombie> ZOMBIE_ATTACK_TURTLE_EGG = create("zombie_attack_turtle_egg", Zombie.class);
@@ -17,6 +17,9 @@
+ GoalKey<Drowned> DROWNED_ATTACK_VILLAGER = GoalKey.of(Drowned.class, NamespacedKey.minecraft("drowned_attack_villager"));
+ GoalKey<Zombie> ZOMBIE_ATTACK_VILLAGER = GoalKey.of(Zombie.class, NamespacedKey.minecraft("zombie_attack_villager"));
+ // Purpur end - Add option to disable zombie aggressiveness towards villagers when lagging
+ // Purpur start - Configurable chance for wolves to spawn rabid
+ GoalKey<Wolf> AVOID_RABID_WOLF = GoalKey.of(Wolf.class, NamespacedKey.minecraft("avoid_rabid_wolf"));
+ // Purpur end - Configurable chance for wolves to spawn rabid
+
private static <T extends Mob> GoalKey<T> create(final String key, final Class<T> type) {
return GoalKey.of(type, NamespacedKey.minecraft(key));

View File

@@ -1,14 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Encode42 <me@encode42.dev>
Date: Tue, 8 Dec 2020 17:15:15 -0500
Subject: [PATCH] Rabid Wolf API
diff --git a/src/main/java/org/bukkit/entity/Wolf.java b/src/main/java/org/bukkit/entity/Wolf.java
index c73489f4b745bc84501ce94f0227b034d9768eae..a97129e71f16ec691759add664bdfd35ab90aaed 100644
--- a/src/main/java/org/bukkit/entity/Wolf.java
+++ b/src/main/java/org/bukkit/entity/Wolf.java
@@ -108,4 +108,20 @@ public interface Wolf extends Tameable, Sittable, io.papermc.paper.entity.Collar
@@ -108,4 +_,20 @@
return Registry.WOLF_VARIANT.getOrThrow(NamespacedKey.minecraft(key));
}
}

View File

@@ -1929,12 +1929,12 @@ index 354ec2b987882d8f40ef4ac5257183d2fda73bb8..98cb91574c8d2bdb6d180256f657ecc6
this.turtle.setDeltaMovement(this.turtle.getDeltaMovement().add(0.0, this.turtle.getSpeed() * d1 * 0.1, 0.0));
}
diff --git a/net/minecraft/world/entity/animal/Wolf.java b/net/minecraft/world/entity/animal/Wolf.java
index 362b2d049080ffa1b0763146c31fc2ce6d337e51..32efe3af5f4f046f2935686eeba8cf0a40f23bfc 100644
index 6eea7ecd42c39645b5a37b58ee1ccb830160c6d5..dacaed7a05d8e7105dd945b7708de6f90e7fc83e 100644
--- a/net/minecraft/world/entity/animal/Wolf.java
+++ b/net/minecraft/world/entity/animal/Wolf.java
@@ -115,9 +115,32 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol
this.setPathfindingMalus(PathType.DANGER_POWDER_SNOW, -1.0F);
@@ -172,9 +172,32 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol
}
// Purpur end - Configurable chance for wolves to spawn rabid
+ // Purpur start - Ridables
+ @Override
@@ -1965,7 +1965,7 @@ index 362b2d049080ffa1b0763146c31fc2ce6d337e51..32efe3af5f4f046f2935686eeba8cf0a
this.goalSelector.addGoal(1, new TamableAnimal.TamableAnimalPanicGoal(1.5, DamageTypeTags.PANIC_ENVIRONMENTAL_CAUSES));
this.goalSelector.addGoal(2, new SitWhenOrderedToGoal(this));
this.goalSelector.addGoal(3, new Wolf.WolfAvoidEntityGoal<>(this, Llama.class, 24.0F, 1.5, 1.5));
@@ -129,6 +152,7 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol
@@ -187,6 +210,7 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol
this.goalSelector.addGoal(9, new BegGoal(this, 8.0F));
this.goalSelector.addGoal(10, new LookAtPlayerGoal(this, Player.class, 8.0F));
this.goalSelector.addGoal(10, new RandomLookAroundGoal(this));
@@ -4678,7 +4678,7 @@ index 9061e0b6544d6a31a4dc5b51037f608031a00553..c79e03267b0030e844746945f947616c
protected void defineSynchedData(SynchedEntityData.Builder builder) {
super.defineSynchedData(builder);
diff --git a/net/minecraft/world/entity/monster/ZombifiedPiglin.java b/net/minecraft/world/entity/monster/ZombifiedPiglin.java
index c7eab22fe4a0541ebdba96961521271ee5619cd4..f2d5866c10e82098d0276320cb3aa3f652b27477 100644
index f1e25786ef687b4680db1cca96a5ae6068e93946..369f1224ea787ae034d86d0e92696882304cb271 100644
--- a/net/minecraft/world/entity/monster/ZombifiedPiglin.java
+++ b/net/minecraft/world/entity/monster/ZombifiedPiglin.java
@@ -63,6 +63,23 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {

View File

@@ -422,7 +422,7 @@ index c27bb9e8a4a5e8fdc8ae28dae820385966b8b44c..b66440f5cfbd714c6d2f5b7f66b4e755
protected void registerGoals() {
this.eatBlockGoal = new EatBlockGoal(this);
diff --git a/net/minecraft/world/entity/animal/SnowGolem.java b/net/minecraft/world/entity/animal/SnowGolem.java
index 7bd5d82a11dda36389913925406a8a2c8e86abf6..d52082d991f6a2ce9d6909610785643d10b8cdbe 100644
index 17b41cfd9080cbb4def219cd91276e5a6d2a02a6..4f0d2ede28adbe412d208609a96eacc1309b8115 100644
--- a/net/minecraft/world/entity/animal/SnowGolem.java
+++ b/net/minecraft/world/entity/animal/SnowGolem.java
@@ -66,6 +66,14 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
@@ -497,10 +497,10 @@ index 98cb91574c8d2bdb6d180256f657ecc67987a6fe..4f0fbbb2caeda6d1477d3297fd68f802
this.entityData.set(HOME_POS, homePos);
}
diff --git a/net/minecraft/world/entity/animal/Wolf.java b/net/minecraft/world/entity/animal/Wolf.java
index 32efe3af5f4f046f2935686eeba8cf0a40f23bfc..9768a336c260572022a140e95d0b0bf084dfc9e9 100644
index dacaed7a05d8e7105dd945b7708de6f90e7fc83e..589cc82e47300f8e982a3f20a406ce5e031ebc7b 100644
--- a/net/minecraft/world/entity/animal/Wolf.java
+++ b/net/minecraft/world/entity/animal/Wolf.java
@@ -137,6 +137,14 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol
@@ -194,6 +194,14 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol
}
// Purpur end - Ridables
@@ -1049,7 +1049,7 @@ index c6eeaf7b460408acfdf89d988b47b08eab7df4c5..148ae4bca77874545a2a05fb7f29f9ac
return Guardian.createAttributes().add(Attributes.MOVEMENT_SPEED, 0.3F).add(Attributes.ATTACK_DAMAGE, 8.0).add(Attributes.MAX_HEALTH, 80.0);
}
diff --git a/net/minecraft/world/entity/monster/EnderMan.java b/net/minecraft/world/entity/monster/EnderMan.java
index 7340fcd9e07d8839845db506d6c51878e01cc6d9..809caddf1446d909803bd2c87369596fcee40e9d 100644
index 4feb8ebe2c50b7b1ba7e868cc3bd182a9801c631..c845481aa48c4c0d670058866351e1c9f5a35fc6 100644
--- a/net/minecraft/world/entity/monster/EnderMan.java
+++ b/net/minecraft/world/entity/monster/EnderMan.java
@@ -107,6 +107,14 @@ public class EnderMan extends Monster implements NeutralMob {
@@ -1644,7 +1644,7 @@ index c79e03267b0030e844746945f947616c1b6e4726..610e5e5330462646034c5667c15245fd
protected void defineSynchedData(SynchedEntityData.Builder builder) {
super.defineSynchedData(builder);
diff --git a/net/minecraft/world/entity/monster/ZombifiedPiglin.java b/net/minecraft/world/entity/monster/ZombifiedPiglin.java
index f2d5866c10e82098d0276320cb3aa3f652b27477..486906b860b3ccbeb1702d9bd7a5d9f11f534b1a 100644
index 369f1224ea787ae034d86d0e92696882304cb271..1424954f5b4cf0fbe821425cd741b4b5c1bfed50 100644
--- a/net/minecraft/world/entity/monster/ZombifiedPiglin.java
+++ b/net/minecraft/world/entity/monster/ZombifiedPiglin.java
@@ -80,6 +80,14 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {

View File

@@ -312,10 +312,10 @@ index 4f0fbbb2caeda6d1477d3297fd68f802e4f3a9ca..edbccb7ca27aa8a1917eb8b35b3ba860
this.entityData.set(HOME_POS, homePos);
}
diff --git a/net/minecraft/world/entity/animal/Wolf.java b/net/minecraft/world/entity/animal/Wolf.java
index 9768a336c260572022a140e95d0b0bf084dfc9e9..1bc9c1449ccc59d59ba40783958cfbaadbc2b9c1 100644
index 589cc82e47300f8e982a3f20a406ce5e031ebc7b..5e236dcab31cefb893bba3569a0ca0a70560c066 100644
--- a/net/minecraft/world/entity/animal/Wolf.java
+++ b/net/minecraft/world/entity/animal/Wolf.java
@@ -145,6 +145,13 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol
@@ -202,6 +202,13 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol
}
// Purpur end - Configurable entity base attributes

View File

@@ -1,18 +1,8 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Encode42 <me@encode42.dev>
Date: Tue, 8 Dec 2020 17:15:15 -0500
Subject: [PATCH] Configurable chance for wolves to spawn rabid
Configurable chance to spawn a wolf that is rabid.
Rabid wolves attack all players, mobs, and animals.
diff --git a/net/minecraft/world/entity/animal/Wolf.java b/net/minecraft/world/entity/animal/Wolf.java
index 539eba7148be12eb05c907ed86b0cea975424874..966fe4544212cc831ae617bc2eb05189102ff470 100644
--- a/net/minecraft/world/entity/animal/Wolf.java
+++ b/net/minecraft/world/entity/animal/Wolf.java
@@ -103,6 +103,37 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol
return entitytypes == EntityType.SHEEP || entitytypes == EntityType.RABBIT || entitytypes == EntityType.FOX;
@@ -94,6 +_,37 @@
EntityType<?> type = entity.getType();
return type == EntityType.SHEEP || type == EntityType.RABBIT || type == EntityType.FOX;
};
+ // Purpur start - Configurable chance for wolves to spawn rabid
+ private boolean isRabid = false;
@@ -48,10 +38,10 @@ index 539eba7148be12eb05c907ed86b0cea975424874..966fe4544212cc831ae617bc2eb05189
private static final float START_HEALTH = 8.0F;
private static final float TAME_HEALTH = 40.0F;
private static final float ARMOR_REPAIR_UNIT = 0.125F;
@@ -159,6 +190,31 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol
return this.level().purpurConfig.wolfBreedingTicks;
@@ -115,12 +_,39 @@
this.setPathfindingMalus(PathType.DANGER_POWDER_SNOW, -1.0F);
}
// Purpur end - Make entity breeding times configurable
+ // Purpur start - Configurable chance for wolves to spawn rabid
+ public boolean isRabid() {
+ return this.isRabid;
@@ -77,57 +67,57 @@ index 539eba7148be12eb05c907ed86b0cea975424874..966fe4544212cc831ae617bc2eb05189
+ }
+ }
+ // Purpur end - Configurable chance for wolves to spawn rabid
+
@Override
protected void registerGoals() {
this.goalSelector.addGoal(1, new FloatGoal(this));
@@ -166,6 +222,7 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol
this.goalSelector.addGoal(1, new TamableAnimal.TamableAnimalPanicGoal(1.5D, DamageTypeTags.PANIC_ENVIRONMENTAL_CAUSES));
this.goalSelector.addGoal(1, new TamableAnimal.TamableAnimalPanicGoal(1.5, DamageTypeTags.PANIC_ENVIRONMENTAL_CAUSES));
this.goalSelector.addGoal(2, new SitWhenOrderedToGoal(this));
this.goalSelector.addGoal(3, new Wolf.WolfAvoidEntityGoal<>(this, Llama.class, 24.0F, 1.5D, 1.5D));
this.goalSelector.addGoal(3, new Wolf.WolfAvoidEntityGoal<>(this, Llama.class, 24.0F, 1.5, 1.5));
+ this.goalSelector.addGoal(3, new AvoidRabidWolfGoal(this, 24.0F, 1.5D, 1.5D)); // Purpur - Configurable chance for wolves to spawn rabid
this.goalSelector.addGoal(4, new LeapAtTargetGoal(this, 0.4F));
this.goalSelector.addGoal(5, new MeleeAttackGoal(this, 1.0D, true));
this.goalSelector.addGoal(6, new FollowOwnerGoal(this, 1.0D, 10.0F, 2.0F));
@@ -179,7 +236,7 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol
this.goalSelector.addGoal(5, new MeleeAttackGoal(this, 1.0, true));
this.goalSelector.addGoal(6, new FollowOwnerGoal(this, 1.0, 10.0F, 2.0F));
@@ -133,7 +_,7 @@
this.targetSelector.addGoal(2, new OwnerHurtTargetGoal(this));
this.targetSelector.addGoal(3, (new HurtByTargetGoal(this, new Class[0])).setAlertOthers());
this.targetSelector.addGoal(3, new HurtByTargetGoal(this).setAlertOthers());
this.targetSelector.addGoal(4, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, this::isAngryAt));
- this.targetSelector.addGoal(5, new NonTameRandomTargetGoal<>(this, Animal.class, false, Wolf.PREY_SELECTOR));
+ // this.targetSelector.addGoal(5, new NonTameRandomTargetGoal<>(this, Animal.class, false, Wolf.PREY_SELECTOR)); // Purpur - moved to updatePathfinders()
- this.targetSelector.addGoal(5, new NonTameRandomTargetGoal<>(this, Animal.class, false, PREY_SELECTOR));
+ // this.targetSelector.addGoal(5, new NonTameRandomTargetGoal<>(this, Animal.class, false, PREY_SELECTOR)); // Purpur - Configurable chance for wolves to spawn rabid - moved to updatePathfinders()
this.targetSelector.addGoal(6, new NonTameRandomTargetGoal<>(this, Turtle.class, false, Turtle.BABY_ON_LAND_SELECTOR));
this.targetSelector.addGoal(7, new NearestAttackableTargetGoal<>(this, AbstractSkeleton.class, false));
this.targetSelector.addGoal(8, new ResetUniversalAngerTargetGoal<>(this, true));
@@ -228,6 +285,7 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol
public void addAdditionalSaveData(CompoundTag nbt) {
super.addAdditionalSaveData(nbt);
nbt.putByte("CollarColor", (byte) this.getCollarColor().getId());
+ nbt.putBoolean("Purpur.IsRabid", this.isRabid); // Purpur - Configurable chance for wolves to spawn rabid
this.getVariant().unwrapKey().ifPresent((resourcekey) -> {
nbt.putString("variant", resourcekey.location().toString());
});
@@ -245,6 +303,10 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol
if (nbt.contains("CollarColor", 99)) {
this.setCollarColor(DyeColor.byId(nbt.getInt("CollarColor")));
@@ -182,6 +_,7 @@
public void addAdditionalSaveData(CompoundTag compound) {
super.addAdditionalSaveData(compound);
compound.putByte("CollarColor", (byte)this.getCollarColor().getId());
+ compound.putBoolean("Purpur.IsRabid", this.isRabid); // Purpur - Configurable chance for wolves to spawn rabid
this.getVariant().unwrapKey().ifPresent(resourceKey -> compound.putString("variant", resourceKey.location().toString()));
this.addPersistentAngerSaveData(compound);
}
@@ -196,6 +_,10 @@
if (compound.contains("CollarColor", 99)) {
this.setCollarColor(DyeColor.byId(compound.getInt("CollarColor")));
}
+ // Purpur start - Configurable chance for wolves to spawn rabid
+ this.isRabid = nbt.getBoolean("Purpur.IsRabid");
+ this.isRabid = compound.getBoolean("Purpur.IsRabid");
+ this.updatePathfinders(false);
+ // Purpur end - Configurable chance for wolves to spawn rabid
this.readPersistentAngerSaveData(this.level(), nbt);
this.readPersistentAngerSaveData(this.level(), compound);
}
@@ -263,6 +325,10 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol
@@ -215,6 +_,10 @@
}
this.setVariant(holder1);
this.setVariant(holder);
+ // Purpur start - Configurable chance for wolves to spawn rabid
+ this.isRabid = world.getLevel().purpurConfig.wolfNaturalRabid > 0.0D && random.nextDouble() <= world.getLevel().purpurConfig.wolfNaturalRabid;
+ this.isRabid = level.getLevel().purpurConfig.wolfNaturalRabid > 0.0D && random.nextDouble() <= level.getLevel().purpurConfig.wolfNaturalRabid;
+ this.updatePathfinders(false);
+ // Purpur end - Configurable chance for wolves to spawn rabid
return super.finalizeSpawn(world, difficulty, spawnReason, (SpawnGroupData) entityData);
return super.finalizeSpawn(level, difficulty, spawnReason, spawnGroupData);
}
@@ -306,6 +372,11 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol
@@ -263,6 +_,11 @@
public void tick() {
super.tick();
if (this.isAlive()) {
@@ -138,13 +128,13 @@ index 539eba7148be12eb05c907ed86b0cea975424874..966fe4544212cc831ae617bc2eb05189
+ // Purpur end - Configurable chance for wolves to spawn rabid
this.interestedAngleO = this.interestedAngle;
if (this.isInterested()) {
this.interestedAngle += (1.0F - this.interestedAngle) * 0.4F;
@@ -536,6 +607,20 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol
itemstack.consume(1, player);
this.interestedAngle = this.interestedAngle + (1.0F - this.interestedAngle) * 0.4F;
@@ -481,6 +_,20 @@
itemInHand.consume(1, player);
this.tryToTame(player);
return InteractionResult.SUCCESS_SERVER;
+ // Purpur start - Configurable chance for wolves to spawn rabid
+ } else if (this.level().purpurConfig.wolfMilkCuresRabies && itemstack.getItem() == Items.MILK_BUCKET && this.isRabid()) {
+ } else if (this.level().purpurConfig.wolfMilkCuresRabies && itemInHand.getItem() == Items.MILK_BUCKET && this.isRabid()) {
+ if (!player.isCreative()) {
+ player.setItemInHand(hand, new ItemStack(Items.BUCKET));
+ }
@@ -157,48 +147,6 @@ index 539eba7148be12eb05c907ed86b0cea975424874..966fe4544212cc831ae617bc2eb05189
+ }
+ return InteractionResult.SUCCESS_SERVER;
+ // Purpur end - Configurable chance for wolves to spawn rabid
} else {
return super.mobInteract(player, hand);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java
index ecd33b4add46acbe4e4f8879c0601220423d66ca..001f131117c277e46f4a94f73da36d1b219fe3cd 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java
@@ -146,4 +146,15 @@ public class CraftWolf extends CraftTameableAnimal implements Wolf {
return this.getKey().hashCode();
}
}
+ // Purpur start - Configurable chance for wolves to spawn rabid
+ @Override
+ public boolean isRabid() {
+ return getHandle().isRabid();
+ }
+
+ @Override
+ public void setRabid(boolean isRabid) {
+ getHandle().setRabid(isRabid);
+ }
+ // Purpur end - Configurable chance for wolves to spawn rabid
}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 09bf59c95f57f5beb718e74d99a6399317cf1222..ece3de874b4ad6dd9f17190281dcad2eab6a3097 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -2064,6 +2064,8 @@ public class PurpurWorldConfig {
public boolean wolfControllable = true;
public double wolfMaxHealth = 8.0D;
public double wolfScale = 1.0D;
+ public boolean wolfMilkCuresRabies = true;
+ public double wolfNaturalRabid = 0.0D;
public int wolfBreedingTicks = 6000;
private void wolfSettings() {
wolfRidable = getBoolean("mobs.wolf.ridable", wolfRidable);
@@ -2076,6 +2078,8 @@ public class PurpurWorldConfig {
}
wolfMaxHealth = getDouble("mobs.wolf.attributes.max_health", wolfMaxHealth);
wolfScale = Mth.clamp(getDouble("mobs.wolf.attributes.scale", wolfScale), 0.0625D, 16.0D);
+ wolfMilkCuresRabies = getBoolean("mobs.wolf.milk-cures-rabid-wolves", wolfMilkCuresRabies);
+ wolfNaturalRabid = getDouble("mobs.wolf.spawn-rabid-chance", wolfNaturalRabid);
wolfBreedingTicks = getInt("mobs.wolf.breeding-delay-ticks", wolfBreedingTicks);
}
return super.mobInteract(player, hand);

View File

@@ -0,0 +1,18 @@
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java
@@ -146,4 +_,15 @@
return this.getKey().hashCode();
}
}
+ // Purpur start - Configurable chance for wolves to spawn rabid
+ @Override
+ public boolean isRabid() {
+ return getHandle().isRabid();
+ }
+
+ @Override
+ public void setRabid(boolean isRabid) {
+ getHandle().setRabid(isRabid);
+ }
+ // Purpur end - Configurable chance for wolves to spawn rabid
}

View File

@@ -2055,6 +2055,8 @@ public class PurpurWorldConfig {
public boolean wolfControllable = true;
public double wolfMaxHealth = 8.0D;
public double wolfScale = 1.0D;
public boolean wolfMilkCuresRabies = true;
public double wolfNaturalRabid = 0.0D;
public int wolfBreedingTicks = 6000;
private void wolfSettings() {
wolfRidable = getBoolean("mobs.wolf.ridable", wolfRidable);
@@ -2067,6 +2069,8 @@ public class PurpurWorldConfig {
}
wolfMaxHealth = getDouble("mobs.wolf.attributes.max_health", wolfMaxHealth);
wolfScale = Mth.clamp(getDouble("mobs.wolf.attributes.scale", wolfScale), 0.0625D, 16.0D);
wolfMilkCuresRabies = getBoolean("mobs.wolf.milk-cures-rabid-wolves", wolfMilkCuresRabies);
wolfNaturalRabid = getDouble("mobs.wolf.spawn-rabid-chance", wolfNaturalRabid);
wolfBreedingTicks = getInt("mobs.wolf.breeding-delay-ticks", wolfBreedingTicks);
}