mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 00:47:42 +01:00
Fix chickens crashing server if retaliate is enabled
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
From c4779abb7e9a4c114128b2c3358b6f88f7fc3578 Mon Sep 17 00:00:00 2001
|
||||
From 141f81a229d60cfd704a429e83fddb8e9d594008 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
|
||||
|
||||
---
|
||||
.../net/minecraft/server/EntityChicken.java | 21 ++++++++++++++++++-
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||
2 files changed, 25 insertions(+), 1 deletion(-)
|
||||
.../net/minecraft/server/EntityChicken.java | 23 +++++++++++++++++--
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 5 ++++
|
||||
2 files changed, 26 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityChicken.java b/src/main/java/net/minecraft/server/EntityChicken.java
|
||||
index c6ee92343..ae1f4cb49 100644
|
||||
index c6ee92343a..fa97552bb4 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityChicken.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityChicken.java
|
||||
@@ -20,14 +20,33 @@ public class EntityChicken extends EntityAnimal {
|
||||
@@ -39,7 +39,7 @@ index c6ee92343..ae1f4cb49 100644
|
||||
+ protected void initAttributes(World world) {
|
||||
+ if (world != null) {
|
||||
+ if (world.purpurConfig.chickenRetaliate) {
|
||||
+ this.getAttributeMap().getAttribute(GenericAttributes.ATTACK_DAMAGE).setValue(2.0D);
|
||||
+ this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(2.0D);
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
@@ -47,8 +47,17 @@ index c6ee92343..ae1f4cb49 100644
|
||||
|
||||
@Override
|
||||
protected float b(EntityPose entitypose, EntitySize entitysize) {
|
||||
@@ -35,7 +54,7 @@ public class EntityChicken extends EntityAnimal {
|
||||
}
|
||||
|
||||
public static AttributeProvider.Builder eL() {
|
||||
- return EntityInsentient.p().a(GenericAttributes.MAX_HEALTH, 4.0D).a(GenericAttributes.MOVEMENT_SPEED, 0.25D);
|
||||
+ return EntityInsentient.p().a(GenericAttributes.MAX_HEALTH, 4.0D).a(GenericAttributes.MOVEMENT_SPEED, 0.25D).a(GenericAttributes.ATTACK_DAMAGE, 0.0D); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 12e263d21..77cdd94d5 100644
|
||||
index 12e263d216..77cdd94d54 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -96,6 +96,11 @@ public class PurpurWorldConfig {
|
||||
|
||||
Reference in New Issue
Block a user