mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 00:47:42 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: b75eeca0 Boost light task priority to ensure it doesnt hold up chunk loads 3d2bc848 Ensure VillagerTrades doesn't load async - fixes #3495 e470f1ef Add more information to Timing Reports f4a47db6 Improve Thread Pool usage to allow single threads for single cpu servers a4fe910f Fix sounds when using worldedit regen command 70ad51a8 Updated Upstream (Bukkit/CraftBukkit) d7cfa4fa Improve legacy format serialization more
72 lines
3.8 KiB
Diff
72 lines
3.8 KiB
Diff
From 51b33f8d3829e9fa3553bea216c0f8a654da942c 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
|
|
|
|
---
|
|
.../java/net/minecraft/server/EntityChicken.java | 14 +++++++++++++-
|
|
.../java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
|
2 files changed, 15 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..1c9b0ce61b 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
|
|
@@ -57,6 +66,9 @@ public class EntityChicken extends EntityAnimal {
|
|
super.initAttributes();
|
|
this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(4.0D);
|
|
this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.25D);
|
|
+ if (world.purpurConfig.chickenRetaliate) {
|
|
+ this.getAttributeMap().b(GenericAttributes.ATTACK_DAMAGE).setValue(2.0D);
|
|
+ }
|
|
}
|
|
|
|
@Override
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index e6ab2fde43..6962d17b9b 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -361,6 +361,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);
|
|
@@ -368,6 +369,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
|
|
|