mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Chickens can retaliate
This commit is contained in:
61
patches/server/0125-Chickens-can-retaliate.patch
Normal file
61
patches/server/0125-Chickens-can-retaliate.patch
Normal file
@@ -0,0 +1,61 @@
|
||||
From e843c88d0d91a40286f0f30777aac9ad33f09c58 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sun, 12 Apr 2020 13:19:34 -0500
|
||||
Subject: [PATCH] Chickens can retaliate
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityChicken.java | 11 ++++++++++-
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
2 files changed, 12 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityChicken.java b/src/main/java/net/minecraft/server/EntityChicken.java
|
||||
index 5505b7ee94..b8ea9b3260 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityChicken.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityChicken.java
|
||||
@@ -38,13 +38,22 @@ public class EntityChicken extends EntityAnimal {
|
||||
protected void initPathfinder() {
|
||||
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
||||
this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
||||
- this.goalSelector.a(1, new PathfinderGoalPanic(this, 1.4D));
|
||||
+ //this.goalSelector.a(1, new PathfinderGoalPanic(this, 1.4D)); // Purpur - moved down
|
||||
this.goalSelector.a(2, new PathfinderGoalBreed(this, 1.0D));
|
||||
this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.0D, false, EntityChicken.bD));
|
||||
this.goalSelector.a(4, new PathfinderGoalFollowParent(this, 1.1D));
|
||||
this.goalSelector.a(5, new PathfinderGoalRandomStrollLand(this, 1.0D));
|
||||
this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F));
|
||||
this.goalSelector.a(7, new PathfinderGoalRandomLookaround(this));
|
||||
+ // Purpur start
|
||||
+ if (world.purpurConfig.chickenRetaliate) {
|
||||
+ this.goalSelector.a(1, new PathfinderGoalMeleeAttack(this, 1.0D, false));
|
||||
+ this.targetSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this));
|
||||
+ this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this));
|
||||
+ } else {
|
||||
+ this.goalSelector.a(1, new PathfinderGoalPanic(this, 1.4D));
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index f1cca7219e..ef34a3482e 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -381,6 +381,7 @@ public class PurpurWorldConfig {
|
||||
public boolean chickenDontLayEggsWhenRidden = false;
|
||||
public int chickenEggsHatchWhenDespawnedMax = 0;
|
||||
public int chickenEggsHatchWhenDespawnedRange = 10;
|
||||
+ public boolean chickenRetaliate = false;
|
||||
private void chickenSettings() {
|
||||
chickenRidable = getBoolean("mobs.chicken.ridable", chickenRidable);
|
||||
chickenRidableInWater = getBoolean("mobs.chicken.ridable-in-water", chickenRidableInWater);
|
||||
@@ -388,6 +389,7 @@ public class PurpurWorldConfig {
|
||||
chickenDontLayEggsWhenRidden = getBoolean("mobs.chicken.dont-lay-eggs-when-ridden", chickenDontLayEggsWhenRidden);
|
||||
chickenEggsHatchWhenDespawnedMax = getInt("mobs.chicken.eggs-hatch-when-despawned.max", chickenEggsHatchWhenDespawnedMax);
|
||||
chickenEggsHatchWhenDespawnedRange = getInt("mobs.chicken.eggs-hatch-when-despawned.range", chickenEggsHatchWhenDespawnedRange);
|
||||
+ chickenRetaliate = getBoolean("mobs.chicken.retaliate", chickenRetaliate);
|
||||
}
|
||||
|
||||
public boolean codRidable = false;
|
||||
--
|
||||
2.24.0
|
||||
|
||||
Reference in New Issue
Block a user