-
-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add option to make ravagers afraid of rabbits
resolves #713
- Loading branch information
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
patches/server/0294-option-to-make-ravagers-afraid-of-rabbits.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: granny <[email protected]> | ||
Date: Tue, 7 May 2024 04:59:57 -0700 | ||
Subject: [PATCH] option to make ravagers afraid of rabbits | ||
|
||
https://github.com/PurpurMC/Purpur/discussions/713 | ||
|
||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Ravager.java b/src/main/java/net/minecraft/world/entity/monster/Ravager.java | ||
index 9551bd7c9bed37cf17910e7f71b82ed20fb2d759..dbfcca8adb7afa7a3101f22c2bc48aff6abae4a2 100644 | ||
--- a/src/main/java/net/minecraft/world/entity/monster/Ravager.java | ||
+++ b/src/main/java/net/minecraft/world/entity/monster/Ravager.java | ||
@@ -111,6 +111,7 @@ public class Ravager extends Raider { | ||
super.registerGoals(); | ||
this.goalSelector.addGoal(0, new FloatGoal(this)); | ||
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur | ||
+ if (level().purpurConfig.ravagerAvoidRabbits) this.goalSelector.addGoal(3, new net.minecraft.world.entity.ai.goal.AvoidEntityGoal<>(this, net.minecraft.world.entity.animal.Rabbit.class, 6.0F, 1.0D, 1.2D)); // Purpur | ||
this.goalSelector.addGoal(4, new MeleeAttackGoal(this, 1.0D, true)); | ||
this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 0.4D)); | ||
this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6.0F)); | ||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java | ||
index 710511db0e882d9795c2a1ff31570fbb05fbb0f1..d8de8710d9b8cf2ae5c434b2b0b27e76ffbbe4bf 100644 | ||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java | ||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java | ||
@@ -2412,6 +2412,7 @@ public class PurpurWorldConfig { | ||
public boolean ravagerTakeDamageFromWater = false; | ||
public List<Block> ravagerGriefableBlocks = new ArrayList<>(); | ||
public boolean ravagerAlwaysDropExp = false; | ||
+ public boolean ravagerAvoidRabbits = false; | ||
private void ravagerSettings() { | ||
ravagerRidable = getBoolean("mobs.ravager.ridable", ravagerRidable); | ||
ravagerRidableInWater = getBoolean("mobs.ravager.ridable-in-water", ravagerRidableInWater); | ||
@@ -2442,6 +2443,7 @@ public class PurpurWorldConfig { | ||
} | ||
}); | ||
ravagerAlwaysDropExp = getBoolean("mobs.ravager.always-drop-exp", ravagerAlwaysDropExp); | ||
+ ravagerAvoidRabbits = getBoolean("mobs.ravager.avoid-rabbits", ravagerAvoidRabbits); | ||
} | ||
|
||
public boolean salmonRidable = false; |