it compiles \o/

This commit is contained in:
granny
2024-10-26 23:46:33 -07:00
parent ab8264ec21
commit 76614d2235
92 changed files with 484 additions and 443 deletions

View File

@@ -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 bbdc5eb28c2be570866070d2d055a97721f46d94..54effd4230d1b231ef94a3e3948a535e6ba15537 100644
index bbdc5eb28c2be570866070d2d055a97721f46d94..37687335041ae47725c6931e2c7d54c192e2de36 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
@@ -103,6 +103,37 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol
@@ -16,7 +16,7 @@ index bbdc5eb28c2be570866070d2d055a97721f46d94..54effd4230d1b231ef94a3e3948a535e
};
+ // Purpur start - rabid wolf spawn chance
+ private boolean isRabid = false;
+ private static final Predicate<LivingEntity> RABID_PREDICATE = entity -> entity instanceof net.minecraft.server.level.ServerPlayer || entity instanceof Mob;
+ private static final TargetingConditions.Selector RABID_PREDICATE = (entity, ignored) -> entity instanceof net.minecraft.server.level.ServerPlayer || entity instanceof net.minecraft.world.entity.Mob;
+ private final net.minecraft.world.entity.ai.goal.Goal PATHFINDER_VANILLA = new NonTameRandomTargetGoal<>(this, Animal.class, false, PREY_SELECTOR);
+ private final net.minecraft.world.entity.ai.goal.Goal PATHFINDER_RABID = new NonTameRandomTargetGoal<>(this, LivingEntity.class, false, RABID_PREDICATE);
+ private static final class AvoidRabidWolfGoal extends AvoidEntityGoal<Wolf> {
@@ -182,7 +182,7 @@ index ecd33b4add46acbe4e4f8879c0601220423d66ca..1506a8c0fa490726eb4a4ae14f3aa194
+ // Purpur end
}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 71b5f351c539584ccb1d215b7d4dce3e4541ac41..bb30d75feae68fdf2714fe51c8ddc8ef71fc647c 100644
index 14fe426bac1cc6711b264a03e472f3b48b8f9b07..8f2f978dbd10b742c6bfad36fb0e0aaf37e4deeb 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -2045,6 +2045,8 @@ public class PurpurWorldConfig {