Fix attribute spam for bats (#744)

Co-authored-by: Camotoy <20743703+Camotoy@users.noreply.github.com>
This commit is contained in:
Encode42
2021-12-12 15:07:50 -05:00
parent 76e339a037
commit 45ae426761
17 changed files with 108 additions and 53 deletions

View File

@@ -34,13 +34,13 @@ index 03adc3b746e05bb4b0514ba4a66c101b9742ceed..ec261673ac444fd5de9c8556cde5d788
@Override
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 76209fd395c65a30201d731448f870610a1e27f2..77cde266fcd6e7d0c10fdcb5380bc80811a05016 100644
index 5d9e460c54068e0e05f975fa057a099c160a3d0d..f1df05c21fe3cce9270506bfb1882bd75d57471d 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -285,6 +285,7 @@ public abstract class LivingEntity extends Entity {
this.useItem = ItemStack.EMPTY;
this.lastClimbablePos = Optional.empty();
this.attributes = new AttributeMap(DefaultAttributes.getSupplier(type));
this.attributes = new AttributeMap(DefaultAttributes.getSupplier(type), this); // Purpur
+ this.initAttributes(); // Purpur
this.craftAttributes = new CraftAttributeMap(this.attributes); // CraftBukkit
// CraftBukkit - setHealth(getMaxHealth()) inlined and simplified to skip the instanceof check for EntityPlayer, as getBukkitEntity() is not initialized in constructor
@@ -55,10 +55,10 @@ index 76209fd395c65a30201d731448f870610a1e27f2..77cde266fcd6e7d0c10fdcb5380bc808
return this.brain;
}
diff --git a/src/main/java/net/minecraft/world/entity/ambient/Bat.java b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
index 45dd82005ff4d03041a9c42e6eacaa2b8a7dc9f8..aaf18021fe4e37d4ff3b04390268c18c47232f06 100644
index 8a6608310caf1a9046fba4e51ca0eff92c8177fc..743b5d483a230d56207a8864b5abab06d7c68e16 100644
--- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java
+++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
@@ -83,6 +83,18 @@ public class Bat extends AmbientCreature {
@@ -86,6 +86,18 @@ public class Bat extends AmbientCreature {
setDeltaMovement(mot.scale(0.9D));
}
}