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

@@ -192,7 +192,7 @@ index 645c1dc9bd09b135a641759c76ce8d957b9bd488..03adc3b746e05bb4b0514ba4a66c101b
protected ParticleOptions getInkParticle() {
return ParticleTypes.GLOW_SQUID_INK;
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index fe7e22d9a69d69dfcce63faa28e90945ea45fc49..76209fd395c65a30201d731448f870610a1e27f2 100644
index fe7e22d9a69d69dfcce63faa28e90945ea45fc49..5d9e460c54068e0e05f975fa057a099c160a3d0d 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -217,9 +217,9 @@ public abstract class LivingEntity extends Entity {
@@ -208,7 +208,24 @@ index fe7e22d9a69d69dfcce63faa28e90945ea45fc49..76209fd395c65a30201d731448f87061
protected int lerpSteps;
protected double lerpX;
protected double lerpY;
@@ -2585,7 +2585,7 @@ public abstract class LivingEntity extends Entity {
@@ -284,7 +284,7 @@ public abstract class LivingEntity extends Entity {
this.effectsDirty = true;
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.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
this.entityData.set(LivingEntity.DATA_HEALTH_ID, (float) this.getAttribute(Attributes.MAX_HEALTH).getValue());
@@ -335,6 +335,7 @@ public abstract class LivingEntity extends Entity {
public static AttributeSupplier.Builder createLivingAttributes() {
return AttributeSupplier.builder().add(Attributes.MAX_HEALTH).add(Attributes.KNOCKBACK_RESISTANCE).add(Attributes.MOVEMENT_SPEED).add(Attributes.ARMOR).add(Attributes.ARMOR_TOUGHNESS);
}
+ public boolean shouldSendAttribute(Attribute attribute) { return true; } // Purpur
@Override
protected void checkFallDamage(double heightDifference, boolean onGround, BlockState landedState, BlockPos landedPosition) {
@@ -2585,7 +2586,7 @@ public abstract class LivingEntity extends Entity {
}
protected long lastJumpTime = 0L; // Paper
@@ -217,7 +234,7 @@ index fe7e22d9a69d69dfcce63faa28e90945ea45fc49..76209fd395c65a30201d731448f87061
double d0 = (double) this.getJumpPower() + this.getJumpBoostPower();
Vec3 vec3d = this.getDeltaMovement();
// Paper start
@@ -3321,8 +3321,10 @@ public abstract class LivingEntity extends Entity {
@@ -3321,8 +3322,10 @@ public abstract class LivingEntity extends Entity {
this.pushEntities();
this.level.getProfiler().pop();
// Paper start
@@ -230,7 +247,7 @@ index fe7e22d9a69d69dfcce63faa28e90945ea45fc49..76209fd395c65a30201d731448f87061
Location from = new Location(this.level.getWorld(), this.xo, this.yo, this.zo, this.yRotO, this.xRotO);
Location to = new Location (this.level.getWorld(), this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot());
io.papermc.paper.event.entity.EntityMoveEvent event = new io.papermc.paper.event.entity.EntityMoveEvent(this.getBukkitLivingEntity(), from, to.clone());
@@ -3332,6 +3334,21 @@ public abstract class LivingEntity extends Entity {
@@ -3332,6 +3335,21 @@ public abstract class LivingEntity extends Entity {
absMoveTo(event.getTo().getX(), event.getTo().getY(), event.getTo().getZ(), event.getTo().getYaw(), event.getTo().getPitch());
}
}
@@ -327,6 +344,41 @@ index 8200e33ed4ebcae8a27cccf2a28daba5e10cf75d..b7e3091e9ce5b634c73ac573cf205278
+ }
+ // Purpur end
}
diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
index 9cbfda029782385d1a7987f5be46d450bd8a758e..718b3fbf5b92d9979de7775e1d40420bb7cf439b 100644
--- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
+++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
@@ -22,13 +22,20 @@ public class AttributeMap {
private final Map<Attribute, AttributeInstance> attributes = Maps.newHashMap();
private final Set<AttributeInstance> dirtyAttributes = Sets.newHashSet();
private final AttributeSupplier supplier;
+ private final net.minecraft.world.entity.LivingEntity entity; // Purpur
public AttributeMap(AttributeSupplier defaultAttributes) {
+ // Purpur start
+ this(defaultAttributes, null);
+ }
+ public AttributeMap(AttributeSupplier defaultAttributes, net.minecraft.world.entity.LivingEntity entity) {
+ this.entity = entity;
+ // Purpur end
this.supplier = defaultAttributes;
}
private void onAttributeModified(AttributeInstance instance) {
- if (instance.getAttribute().isClientSyncable()) {
+ if (instance.getAttribute().isClientSyncable() && (entity == null || entity.shouldSendAttribute(instance.getAttribute()))) { // Purpur
this.dirtyAttributes.add(instance);
}
@@ -40,7 +47,7 @@ public class AttributeMap {
public Collection<AttributeInstance> getSyncableAttributes() {
return this.attributes.values().stream().filter((attribute) -> {
- return attribute.getAttribute().isClientSyncable();
+ return attribute.getAttribute().isClientSyncable() && (entity == null || entity.shouldSendAttribute(attribute.getAttribute())); // Purpur
}).collect(Collectors.toList());
}
diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java b/src/main/java/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java
index 6a4a0ba0f8f96dd8566b3164bbbceeaa37b548f1..65d0b0e7856eaa61e26b0af750bb7959f5a225f7 100644
--- a/src/main/java/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java
@@ -479,7 +531,7 @@ index 7df56705a4a0de2dc4ff7ab133fc26612c219162..60d21d6171b9af20a4c6fcc0d564a31a
}
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 29dfbcecfbb2560e6ecde997abd5224a16c08c94..45dd82005ff4d03041a9c42e6eacaa2b8a7dc9f8 100644
index 29dfbcecfbb2560e6ecde997abd5224a16c08c94..8a6608310caf1a9046fba4e51ca0eff92c8177fc 100644
--- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java
+++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
@@ -19,6 +19,7 @@ import net.minecraft.world.entity.EntityDimensions;
@@ -490,7 +542,7 @@ index 29dfbcecfbb2560e6ecde997abd5224a16c08c94..45dd82005ff4d03041a9c42e6eacaa2b
import net.minecraft.world.entity.Pose;
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
import net.minecraft.world.entity.ai.attributes.Attributes;
@@ -42,9 +43,48 @@ public class Bat extends AmbientCreature {
@@ -42,9 +43,51 @@ public class Bat extends AmbientCreature {
public Bat(EntityType<? extends Bat> type, Level world) {
super(type, world);
@@ -500,6 +552,9 @@ index 29dfbcecfbb2560e6ecde997abd5224a16c08c94..45dd82005ff4d03041a9c42e6eacaa2b
+ // Purpur start
+ @Override
+ public boolean shouldSendAttribute(net.minecraft.world.entity.ai.attributes.Attribute attribute) { return attribute != Attributes.FLYING_SPEED; } // Fixes log spam on clients
+
+ @Override
+ public boolean isRidable() {
+ return level.purpurConfig.batRidable;
+ }
@@ -539,7 +594,7 @@ index 29dfbcecfbb2560e6ecde997abd5224a16c08c94..45dd82005ff4d03041a9c42e6eacaa2b
@Override
public boolean isFlapping() {
return !this.isResting() && this.tickCount % Bat.TICKS_PER_FLAP == 0;
@@ -94,7 +134,7 @@ public class Bat extends AmbientCreature {
@@ -94,7 +137,7 @@ public class Bat extends AmbientCreature {
protected void pushEntities() {}
public static AttributeSupplier.Builder createAttributes() {
@@ -548,7 +603,7 @@ index 29dfbcecfbb2560e6ecde997abd5224a16c08c94..45dd82005ff4d03041a9c42e6eacaa2b
}
public boolean isResting() {
@@ -126,6 +166,14 @@ public class Bat extends AmbientCreature {
@@ -126,6 +169,14 @@ public class Bat extends AmbientCreature {
@Override
protected void customServerAiStep() {

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));
}
}

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] LivingEntity safeFallDistance
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 77cde266fcd6e7d0c10fdcb5380bc80811a05016..bdbe89f21408c46a3ab1f6d8a58d93c94e50975f 100644
index f1df05c21fe3cce9270506bfb1882bd75d57471d..ab868741cdb9ad20c81d4ed3561d498d25fcbf12 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -252,6 +252,7 @@ public abstract class LivingEntity extends Entity {
@@ -16,7 +16,7 @@ index 77cde266fcd6e7d0c10fdcb5380bc80811a05016..bdbe89f21408c46a3ab1f6d8a58d93c9
public boolean forceDrops;
public ArrayList<org.bukkit.inventory.ItemStack> drops = new ArrayList<org.bukkit.inventory.ItemStack>();
public final org.bukkit.craftbukkit.attribute.CraftAttributeMap craftAttributes;
@@ -350,8 +351,8 @@ public abstract class LivingEntity extends Entity {
@@ -351,8 +352,8 @@ public abstract class LivingEntity extends Entity {
this.tryAddSoulSpeed();
}
@@ -27,7 +27,7 @@ index 77cde266fcd6e7d0c10fdcb5380bc80811a05016..bdbe89f21408c46a3ab1f6d8a58d93c9
if (!landedState.isAir()) {
double d1 = Math.min((double) (0.2F + f / 15.0F), 2.5D);
@@ -1904,7 +1905,7 @@ public abstract class LivingEntity extends Entity {
@@ -1905,7 +1906,7 @@ public abstract class LivingEntity extends Entity {
MobEffectInstance mobeffect = this.getEffect(MobEffects.JUMP);
float f2 = mobeffect == null ? 0.0F : (float) (mobeffect.getAmplifier() + 1);

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Disable loot drops on death by cramming
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index bdbe89f21408c46a3ab1f6d8a58d93c94e50975f..c577fd1f3e89ee5749c5dc952c0b9a722098bac4 100644
index ab868741cdb9ad20c81d4ed3561d498d25fcbf12..d2944ac5002f77dee2ae111b4f529471ab265c59 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1711,10 +1711,12 @@ public abstract class LivingEntity extends Entity {
@@ -1712,10 +1712,12 @@ public abstract class LivingEntity extends Entity {
this.dropEquipment(); // CraftBukkit - from below
if (this.shouldDropLoot() && this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {

View File

@@ -17,10 +17,10 @@ index 7af5b443983d557199100c0ab5044e96ebf52d9b..36569048c8ba952270b8ca1e492292ca
public void absMoveTo(double x, double y, double z) {
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index c577fd1f3e89ee5749c5dc952c0b9a722098bac4..000283ea471b4755fa63f965579f98f0b746f15c 100644
index d2944ac5002f77dee2ae111b4f529471ab265c59..eec8fe7566a7911d1250286ecf525c851baecc8e 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -2910,7 +2910,7 @@ public abstract class LivingEntity extends Entity {
@@ -2911,7 +2911,7 @@ public abstract class LivingEntity extends Entity {
}
}

View File

@@ -18,10 +18,10 @@ index 36569048c8ba952270b8ca1e492292cab5f13ae6..99e383d2d7403b19d207d912608e03da
&& this.getY() >= this.level.paperConfig.netherVoidTopDamageHeight)) {
// Paper end
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 000283ea471b4755fa63f965579f98f0b746f15c..87cf71ae44c361770a8d5143dd2091395cbd0130 100644
index eec8fe7566a7911d1250286ecf525c851baecc8e..d5d315122326e923dd47ec25c59d81d413839829 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -2402,7 +2402,7 @@ public abstract class LivingEntity extends Entity {
@@ -2403,7 +2403,7 @@ public abstract class LivingEntity extends Entity {
@Override
protected void outOfWorld() {

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Implement elytra settings
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 87cf71ae44c361770a8d5143dd2091395cbd0130..68415084deacf8d1f82f27e6fbaae1d0d598510c 100644
index d5d315122326e923dd47ec25c59d81d413839829..3756da97a8404ea573a66f3f160cfbfd857b12e5 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3381,7 +3381,16 @@ public abstract class LivingEntity extends Entity {
@@ -3382,7 +3382,16 @@ public abstract class LivingEntity extends Entity {
int j = i / 10;
if (j % 2 == 0) {

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Add option to teleport to spawn if outside world border
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index d37aa315753ffff5601d42987beae7af4a267ce1..80a57d726ee663aa37a3b93c883f835a2ebc765e 100644
index ae40f50a33f676059738625773127ff9ae181be0..295658d4b479e8a3e825f0b5ce5dfc2c7c55a0fe 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -2537,5 +2537,25 @@ public class ServerPlayer extends Player {
@@ -35,7 +35,7 @@ index d37aa315753ffff5601d42987beae7af4a267ce1..80a57d726ee663aa37a3b93c883f835a
+ // Purpur end
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 782c49ebd9574aa68de4693fec20c6130f656c23..17828733fff18cb3159dd75280aa1f1b32ac088f 100644
index 3756da97a8404ea573a66f3f160cfbfd857b12e5..e2d1c4f0084f981d2541313fb8cdb0b9edd71f71 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -43,6 +43,7 @@ import net.minecraft.network.syncher.EntityDataAccessor;
@@ -46,7 +46,7 @@ index 782c49ebd9574aa68de4693fec20c6130f656c23..17828733fff18cb3159dd75280aa1f1b
import net.minecraft.server.level.ServerChunkCache;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
@@ -408,6 +409,7 @@ public abstract class LivingEntity extends Entity {
@@ -409,6 +410,7 @@ public abstract class LivingEntity extends Entity {
double d1 = this.level.getWorldBorder().getDamagePerBlock();
if (d1 > 0.0D) {
@@ -55,7 +55,7 @@ index 782c49ebd9574aa68de4693fec20c6130f656c23..17828733fff18cb3159dd75280aa1f1b
}
}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 48d207b696acebb9be35b43f46e98dd11448f0e6..0936ed03cf94cf534535524561791ef454b1df7e 100644
index 971fef23a4381221164834e2c8f30aaf7ee7cd45..72ea3dd638758bd5b7aae281b28a873b4056502c 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -231,6 +231,7 @@ public class PurpurWorldConfig {

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Totems work in inventory
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 17828733fff18cb3159dd75280aa1f1b32ac088f..4904abec73580eee50c12a8edcb6e743805b018e 100644
index e2d1c4f0084f981d2541313fb8cdb0b9edd71f71..527fd1662b8ff007fbc383b0061f70b2bbd5cafe 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1512,6 +1512,19 @@ public abstract class LivingEntity extends Entity {
@@ -1513,6 +1513,19 @@ public abstract class LivingEntity extends Entity {
}
}
@@ -29,7 +29,7 @@ index 17828733fff18cb3159dd75280aa1f1b32ac088f..4904abec73580eee50c12a8edcb6e743
event.setCancelled(itemstack == null);
this.level.getCraftServer().getPluginManager().callEvent(event);
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 7d41d9c5e35bb451f214b67b20c05e30f63ab9d4..d10be85bd30dcf5eba755152954be35a43e8b8b4 100644
index 5e1111ca9cbb0a5896e28d830ddc2529afc58ae9..4e8dc2ba5db4c30993a8ecedebe3f09ba2ec8205 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -232,6 +232,7 @@ public class PurpurWorldConfig {

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Add mobGriefing bypass to everything affected
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index acefb8f2ca9fe3ec389e85e88601fefebb39c662..38dd50d9f815f7f3df74ebac227b82cbb0ddf63f 100644
index 527fd1662b8ff007fbc383b0061f70b2bbd5cafe..d0fbbaaa48d7e199ab22bc0b089f2ad45fe816ee 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1683,7 +1683,7 @@ public abstract class LivingEntity extends Entity {
@@ -1684,7 +1684,7 @@ public abstract class LivingEntity extends Entity {
boolean flag = false;
if (this.dead && adversary instanceof WitherBoss) { // Paper

View File

@@ -34,10 +34,10 @@ index 861dd2603a82b26cb0f003b5defc34446feb6fdf..1c819db60f278ba902471ae69720f6ff
}
return;
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 aaf18021fe4e37d4ff3b04390268c18c47232f06..a97038d02d2edeb52c555457469467efa77d13df 100644
index 743b5d483a230d56207a8864b5abab06d7c68e16..ef5cd71dcbaa4f86977fe9ae76042c49c144da9c 100644
--- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java
+++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
@@ -95,6 +95,11 @@ public class Bat extends AmbientCreature {
@@ -98,6 +98,11 @@ public class Bat extends AmbientCreature {
this.getAttribute(Attributes.ARMOR_TOUGHNESS).setBaseValue(this.level.purpurConfig.batArmorToughness);
this.getAttribute(Attributes.ATTACK_KNOCKBACK).setBaseValue(this.level.purpurConfig.batAttackKnockback);
}

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] One Punch Man!
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 38dd50d9f815f7f3df74ebac227b82cbb0ddf63f..2de5d21239c89b1e00d75d9c418b661be2d4f7aa 100644
index d0fbbaaa48d7e199ab22bc0b089f2ad45fe816ee..24b2d3b768f0b3fd0bd2238419aec6e06bcb1a70 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -2137,6 +2137,20 @@ public abstract class LivingEntity extends Entity {
@@ -2138,6 +2138,20 @@ public abstract class LivingEntity extends Entity {
((ServerPlayer) damagesource.getEntity()).awardStat(Stats.DAMAGE_DEALT_ABSORBED, Math.round(f2 * 10.0F));
}

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Drowning Settings
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 8288841cfff9854f8ab50c37bf14d82dad3b2917..c9e2c9ba46a39c1555fec5d94c988753f6feca20 100644
index cd173751f517cf8024e65870f057a73462e5ff5e..733b943080948de76fb81dcd2545b20bfc704c1e 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -502,7 +502,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
@@ -27,10 +27,10 @@ index 8288841cfff9854f8ab50c37bf14d82dad3b2917..c9e2c9ba46a39c1555fec5d94c988753
public int getAirSupply() {
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 934bb735c1948113b01f9ba6799ecc1ad92dbb76..b036b0145a83eeb424beb261483b0515518dacd5 100644
index 24b2d3b768f0b3fd0bd2238419aec6e06bcb1a70..a46e6d55731c7877fd50329b1ad37951e1f02784 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -420,7 +420,7 @@ public abstract class LivingEntity extends Entity {
@@ -421,7 +421,7 @@ public abstract class LivingEntity extends Entity {
if (flag1) {
this.setAirSupply(this.decreaseAirSupply(this.getAirSupply()));
@@ -39,7 +39,7 @@ index 934bb735c1948113b01f9ba6799ecc1ad92dbb76..b036b0145a83eeb424beb261483b0515
this.setAirSupply(0);
Vec3 vec3d = this.getDeltaMovement();
@@ -432,7 +432,7 @@ public abstract class LivingEntity extends Entity {
@@ -433,7 +433,7 @@ public abstract class LivingEntity extends Entity {
this.level.addParticle(ParticleTypes.BUBBLE, this.getX() + d2, this.getY() + d3, this.getZ() + d4, vec3d.x, vec3d.y, vec3d.z);
}
@@ -49,7 +49,7 @@ index 934bb735c1948113b01f9ba6799ecc1ad92dbb76..b036b0145a83eeb424beb261483b0515
}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index a3204f9a70846a589c54bda34d1575648e4a48aa..f67e57204a2be5076c7d14ab513d205378134a60 100644
index 07a0d10351298c3b55de9fc9389d90eb7abfb698..878a338c70ef4f0b08004210279693122470a817 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -122,6 +122,15 @@ public class PurpurWorldConfig {

View File

@@ -6,10 +6,10 @@ Subject: [PATCH] Configurable mob blindness
Ported from https://github.com/raltsmc/mobblindness
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index b036b0145a83eeb424beb261483b0515518dacd5..2c5d453f57b28008e5b98cf6aec044cb3ffb2385 100644
index a46e6d55731c7877fd50329b1ad37951e1f02784..9da2d74f38110abfeaa42ac15b4523dfe7db7e07 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -987,6 +987,17 @@ public abstract class LivingEntity extends Entity {
@@ -988,6 +988,17 @@ public abstract class LivingEntity extends Entity {
if (entitytypes == EntityType.SKELETON && itemstack.is(Items.SKELETON_SKULL) || entitytypes == EntityType.ZOMBIE && itemstack.is(Items.ZOMBIE_HEAD) || entitytypes == EntityType.CREEPER && itemstack.is(Items.CREEPER_HEAD)) {
d0 *= 0.5D;
}
@@ -28,7 +28,7 @@ index b036b0145a83eeb424beb261483b0515518dacd5..2c5d453f57b28008e5b98cf6aec044cb
return d0;
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 70df00057ceb30f5c5f5ed6a141ebf278876628e..4766ff27a4dab68877b0517b7698aa800e747a3f 100644
index 5be12ae7635d8fce57fbff7b52e7480fe970ebc3..78e1a64946daec89d7724fd966c3ecdc346f468c 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -459,6 +459,7 @@ public class PurpurWorldConfig {

View File

@@ -29,7 +29,7 @@ index 549417d7bf6953f668bb8b0ab38f8c8b877b7a90..953506523b7bd5835bd727d9d4e6759f
// Purpur end
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index b7c03d7d872599476e92b0ba62af8c473f04fcad..ca7e980732b4017f5147e2c372bd4c8dc7f7315c 100644
index 9da2d74f38110abfeaa42ac15b4523dfe7db7e07..953c27e0ea5bc5d38f24cf69d40bb80dcb33da91 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -262,6 +262,7 @@ public abstract class LivingEntity extends Entity {
@@ -40,7 +40,7 @@ index b7c03d7d872599476e92b0ba62af8c473f04fcad..ca7e980732b4017f5147e2c372bd4c8d
@Override
public float getBukkitYaw() {
@@ -764,6 +765,7 @@ public abstract class LivingEntity extends Entity {
@@ -765,6 +766,7 @@ public abstract class LivingEntity extends Entity {
dataresult.resultOrPartial(logger::error).ifPresent((nbtbase) -> {
nbt.put("Brain", nbtbase);
});
@@ -48,7 +48,7 @@ index b7c03d7d872599476e92b0ba62af8c473f04fcad..ca7e980732b4017f5147e2c372bd4c8d
}
@Override
@@ -839,6 +841,11 @@ public abstract class LivingEntity extends Entity {
@@ -840,6 +842,11 @@ public abstract class LivingEntity extends Entity {
this.brain = this.makeBrain(new Dynamic(NbtOps.INSTANCE, nbt.get("Brain")));
}
@@ -60,7 +60,7 @@ index b7c03d7d872599476e92b0ba62af8c473f04fcad..ca7e980732b4017f5147e2c372bd4c8d
}
// CraftBukkit start
@@ -3401,6 +3408,27 @@ public abstract class LivingEntity extends Entity {
@@ -3402,6 +3409,27 @@ public abstract class LivingEntity extends Entity {
this.hurt(DamageSource.DROWN, 1.0F);
}

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Toggle for kinetic damage
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index ca7e980732b4017f5147e2c372bd4c8dc7f7315c..8ca536d4c7ba1ec860638cdebcfbd2832c91eded 100644
index 953c27e0ea5bc5d38f24cf69d40bb80dcb33da91..b6022415925d365931a1110f727d5a22a04b9cee 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -2796,7 +2796,11 @@ public abstract class LivingEntity extends Entity {
@@ -2797,7 +2797,11 @@ public abstract class LivingEntity extends Entity {
if (f4 > 0.0F) {
this.playSound(this.getFallDamageSound((int) f4), 1.0F, 1.0F);

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Halloween options and optimizations
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 a97038d02d2edeb52c555457469467efa77d13df..0d90c90bf20d127f410de2aad2ca3c2d989e9576 100644
index ef5cd71dcbaa4f86977fe9ae76042c49c144da9c..df62c7a24560f305832e925afa7ce7b182bb1b35 100644
--- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java
+++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
@@ -309,7 +309,7 @@ public class Bat extends AmbientCreature {
@@ -312,7 +312,7 @@ public class Bat extends AmbientCreature {
int i = world.getMaxLocalRawBrightness(pos);
byte b0 = 4;
@@ -17,7 +17,7 @@ index a97038d02d2edeb52c555457469467efa77d13df..0d90c90bf20d127f410de2aad2ca3c2d
b0 = 7;
} else if (random.nextBoolean()) {
return false;
@@ -319,6 +319,7 @@ public class Bat extends AmbientCreature {
@@ -322,6 +322,7 @@ public class Bat extends AmbientCreature {
}
}