mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 02:17:42 +01:00
Separate ridable and controllable configs
This commit is contained in:
@@ -7,7 +7,7 @@ Configurable chance to spawn a wolf that is rabid.
|
||||
Rabid wolves attack all players, mobs, and animals.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Wolf.java b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
|
||||
index 9f23279f7e3aedb758082c672656d5e4b160c074..38c69ddde8a54482a1de60387bace297869c47f3 100644
|
||||
index 749e007fc0a703ca9baa58490b3b7641611d2aa4..6be2d2c2b3eb33cb8657a2cdfb49c49cb83964c2 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
|
||||
@@ -11,6 +11,7 @@ import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
@@ -93,7 +93,7 @@ index 9f23279f7e3aedb758082c672656d5e4b160c074..38c69ddde8a54482a1de60387bace297
|
||||
private static final float START_HEALTH = 8.0F;
|
||||
private static final float TAME_HEALTH = 20.0F;
|
||||
private float interestedAngle;
|
||||
@@ -124,6 +162,37 @@ public class Wolf extends TamableAnimal implements NeutralMob {
|
||||
@@ -129,6 +167,37 @@ public class Wolf extends TamableAnimal implements NeutralMob {
|
||||
public int getPurpurBreedTime() {
|
||||
return this.level.purpurConfig.wolfBreedingTicks;
|
||||
}
|
||||
@@ -131,7 +131,7 @@ index 9f23279f7e3aedb758082c672656d5e4b160c074..38c69ddde8a54482a1de60387bace297
|
||||
// Purpur end
|
||||
|
||||
@Override
|
||||
@@ -132,6 +201,7 @@ public class Wolf extends TamableAnimal implements NeutralMob {
|
||||
@@ -137,6 +206,7 @@ public class Wolf extends TamableAnimal implements NeutralMob {
|
||||
this.goalSelector.addGoal(1, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
|
||||
this.goalSelector.addGoal(2, new SitWhenOrderedToGoal(this));
|
||||
this.goalSelector.addGoal(3, new Wolf.WolfAvoidEntityGoal<>(this, Llama.class, 24.0F, 1.5D, 1.5D));
|
||||
@@ -139,7 +139,7 @@ index 9f23279f7e3aedb758082c672656d5e4b160c074..38c69ddde8a54482a1de60387bace297
|
||||
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, false));
|
||||
@@ -145,7 +215,7 @@ public class Wolf extends TamableAnimal implements NeutralMob {
|
||||
@@ -150,7 +220,7 @@ public class Wolf extends TamableAnimal implements NeutralMob {
|
||||
this.targetSelector.addGoal(2, new OwnerHurtTargetGoal(this));
|
||||
this.targetSelector.addGoal(3, (new HurtByTargetGoal(this, new Class[0])).setAlertOthers());
|
||||
this.targetSelector.addGoal(4, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, this::isAngryAt));
|
||||
@@ -148,7 +148,7 @@ index 9f23279f7e3aedb758082c672656d5e4b160c074..38c69ddde8a54482a1de60387bace297
|
||||
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));
|
||||
@@ -190,6 +260,7 @@ public class Wolf extends TamableAnimal implements NeutralMob {
|
||||
@@ -195,6 +265,7 @@ public class Wolf extends TamableAnimal implements NeutralMob {
|
||||
public void addAdditionalSaveData(CompoundTag nbt) {
|
||||
super.addAdditionalSaveData(nbt);
|
||||
nbt.putByte("CollarColor", (byte) this.getCollarColor().getId());
|
||||
@@ -156,7 +156,7 @@ index 9f23279f7e3aedb758082c672656d5e4b160c074..38c69ddde8a54482a1de60387bace297
|
||||
this.addPersistentAngerSaveData(nbt);
|
||||
}
|
||||
|
||||
@@ -199,6 +270,10 @@ public class Wolf extends TamableAnimal implements NeutralMob {
|
||||
@@ -204,6 +275,10 @@ public class Wolf extends TamableAnimal implements NeutralMob {
|
||||
if (nbt.contains("CollarColor", 99)) {
|
||||
this.setCollarColor(DyeColor.byId(nbt.getInt("CollarColor")));
|
||||
}
|
||||
@@ -167,7 +167,7 @@ index 9f23279f7e3aedb758082c672656d5e4b160c074..38c69ddde8a54482a1de60387bace297
|
||||
|
||||
this.readPersistentAngerSaveData(this.level, nbt);
|
||||
}
|
||||
@@ -243,6 +318,11 @@ public class Wolf extends TamableAnimal implements NeutralMob {
|
||||
@@ -248,6 +323,11 @@ public class Wolf extends TamableAnimal implements NeutralMob {
|
||||
public void tick() {
|
||||
super.tick();
|
||||
if (this.isAlive()) {
|
||||
@@ -179,7 +179,7 @@ index 9f23279f7e3aedb758082c672656d5e4b160c074..38c69ddde8a54482a1de60387bace297
|
||||
this.interestedAngleO = this.interestedAngle;
|
||||
if (this.isInterested()) {
|
||||
this.interestedAngle += (1.0F - this.interestedAngle) * 0.4F;
|
||||
@@ -440,6 +520,20 @@ public class Wolf extends TamableAnimal implements NeutralMob {
|
||||
@@ -445,6 +525,20 @@ public class Wolf extends TamableAnimal implements NeutralMob {
|
||||
|
||||
return InteractionResult.SUCCESS;
|
||||
}
|
||||
@@ -222,19 +222,19 @@ index f856b42201c17f8da21251e54fcf052336916e70..ac0803d42be2f36a2f40487ee31413d0
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index f43bcc77b36bcb1af5fff7f96bceac06599b0f4e..371aa602dc35eab9e09816130e5e0a24bf899a82 100644
|
||||
index ca40f12a245d57f1887adc599eef2fbf4f85c209..dd874c0576d0f5986717c28a9d267b7590ff18ff 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -1745,6 +1745,8 @@ public class PurpurWorldConfig {
|
||||
public boolean wolfRidable = false;
|
||||
@@ -1872,6 +1872,8 @@ public class PurpurWorldConfig {
|
||||
public boolean wolfRidableInWater = false;
|
||||
public boolean wolfControllable = true;
|
||||
public double wolfMaxHealth = 8.0D;
|
||||
+ public boolean wolfMilkCuresRabies = true;
|
||||
+ public double wolfNaturalRabid = 0.0D;
|
||||
public int wolfBreedingTicks = 6000;
|
||||
private void wolfSettings() {
|
||||
wolfRidable = getBoolean("mobs.wolf.ridable", wolfRidable);
|
||||
@@ -1755,6 +1757,8 @@ public class PurpurWorldConfig {
|
||||
@@ -1883,6 +1885,8 @@ public class PurpurWorldConfig {
|
||||
set("mobs.wolf.attributes.max_health", oldValue);
|
||||
}
|
||||
wolfMaxHealth = getDouble("mobs.wolf.attributes.max_health", wolfMaxHealth);
|
||||
|
||||
Reference in New Issue
Block a user