mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 18:07:43 +01:00
Updated Upstream (Paper)
Upstream has released updates that appears to apply and compile correctly Paper Changes: 8ce3dd5f [CI-SKIP] Fix Mojang API Brigadier dep - THIS IS NOT A NEW BUILD 00d760a5 Fix build due to spigot changing the build timestamp process 842e040c Updated Upstream (Bukkit/CraftBukkit/Spigot) c03260a2 Add getter and setter for villager's numberOfRestocksToday (#3231) fe366fbe null check tracker for entity metadata update - Fixes #3070 fdf41b74 Implement Brigadier Mojang API e0ea2e0e Entity Activation Range 2.0! Major improvements to restoring behavior 10396d28 Fix Tracking Range mismatch on Vehicle/Passenger checks
This commit is contained in:
@@ -1,71 +0,0 @@
|
||||
From 2422eb999f076057c56730aea8c7f10125bce5a5 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 5505b7ee9..1c9b0ce61 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 0347b729c..b557353ac 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
|
||||
|
||||
Reference in New Issue
Block a user