From 0558e7d923dc1e5d6d6ca8fa84bc9edda649d090 Mon Sep 17 00:00:00 2001 From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com> Date: Wed, 21 Jun 2023 04:42:46 +0300 Subject: [PATCH] Fix funny respawn animation & respawn button not working --- patches/server/0003-Threaded-Regions.patch | 15 ++++++++------- ...ate-access-when-waking-players-up-during.patch | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/patches/server/0003-Threaded-Regions.patch b/patches/server/0003-Threaded-Regions.patch index 81bc61b..93b3943 100644 --- a/patches/server/0003-Threaded-Regions.patch +++ b/patches/server/0003-Threaded-Regions.patch @@ -18691,7 +18691,7 @@ index b38c4cbcf0405d82c7b6e018e80a3174e460c1a4..37b90c70196717c3a68b6d3b652e5716 public void unsetRemoved() { this.removalReason = null; diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index a189461330a4d427a7450d504ef13de3605497e3..99192dd2da243b3e5992adcef525c500dd9db958 100644 +index a189461330a4d427a7450d504ef13de3605497e3..302d380985ffa28e21f592d163e1a0f77172762d 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -482,7 +482,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -18703,7 +18703,7 @@ index a189461330a4d427a7450d504ef13de3605497e3..99192dd2da243b3e5992adcef525c500 if (this.lastHurtByPlayerTime > 0) { --this.lastHurtByPlayerTime; -@@ -628,11 +628,13 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -628,11 +628,14 @@ public abstract class LivingEntity extends Entity implements Attackable { return true; } @@ -18714,12 +18714,13 @@ index a189461330a4d427a7450d504ef13de3605497e3..99192dd2da243b3e5992adcef525c500 + if (this.deathTime >= 20 && !this.level().isClientSide() && !this.isRemoved() && !this.broadcastedDeath) { // Folia - region threading this.level().broadcastEntityEvent(this, (byte) 60); - this.remove(Entity.RemovalReason.KILLED); ++ this.broadcastedDeath = true; // Folia - region threading - death has been broadcasted + if (!(this instanceof ServerPlayer)) this.remove(Entity.RemovalReason.KILLED); // Folia - region threading - don't remove, we want the tick scheduler to be running + if ((this instanceof ServerPlayer)) this.unRide(); // Folia - region threading - unmount player when dead } } -@@ -853,9 +855,9 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -853,9 +856,9 @@ public abstract class LivingEntity extends Entity implements Attackable { } this.hurtTime = nbt.getShort("HurtTime"); @@ -18731,7 +18732,7 @@ index a189461330a4d427a7450d504ef13de3605497e3..99192dd2da243b3e5992adcef525c500 String s = nbt.getString("Team"); PlayerTeam scoreboardteam = this.level().getScoreboard().getPlayerTeam(s); if (!this.level().paperConfig().scoreboards.allowNonPlayerEntitiesOnScoreboards && !(this instanceof net.minecraft.world.entity.player.Player)) { scoreboardteam = null; } // Paper -@@ -1135,7 +1137,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1135,7 +1138,7 @@ public abstract class LivingEntity extends Entity implements Attackable { } public boolean addEffect(MobEffectInstance mobeffect, @Nullable Entity entity, EntityPotionEffectEvent.Cause cause) { @@ -18740,7 +18741,7 @@ index a189461330a4d427a7450d504ef13de3605497e3..99192dd2da243b3e5992adcef525c500 if (this.isTickingEffects) { this.effectsToProcess.add(new ProcessableEffect(mobeffect, cause)); return true; -@@ -2310,7 +2312,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -2310,7 +2313,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @Nullable public LivingEntity getKillCredit() { @@ -18749,7 +18750,7 @@ index a189461330a4d427a7450d504ef13de3605497e3..99192dd2da243b3e5992adcef525c500 } public final float getMaxHealth() { -@@ -3446,7 +3448,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3446,7 +3449,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.pushEntities(); this.level().getProfiler().pop(); // Paper start @@ -18758,7 +18759,7 @@ index a189461330a4d427a7450d504ef13de3605497e3..99192dd2da243b3e5992adcef525c500 if (this.xo != this.getX() || this.yo != this.getY() || this.zo != this.getZ() || this.yRotO != this.getYRot() || this.xRotO != this.getXRot()) { 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()); -@@ -4106,7 +4108,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -4106,7 +4109,7 @@ public abstract class LivingEntity extends Entity implements Attackable { BlockPos blockposition = BlockPos.containing(d0, d1, d2); Level world = this.level(); diff --git a/patches/server/0015-Skip-worldstate-access-when-waking-players-up-during.patch b/patches/server/0015-Skip-worldstate-access-when-waking-players-up-during.patch index c2684f0..5cebeb6 100644 --- a/patches/server/0015-Skip-worldstate-access-when-waking-players-up-during.patch +++ b/patches/server/0015-Skip-worldstate-access-when-waking-players-up-during.patch @@ -22,10 +22,10 @@ index 84dce5ec9d43d6f148cd8a7d19e503ce4c9900fd..d58e8211fc765c61548ac2a180de87dd // CraftBukkit start diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 99192dd2da243b3e5992adcef525c500dd9db958..511ec694f3336a5d7276d171dd2345ed2ea1acac 100644 +index 302d380985ffa28e21f592d163e1a0f77172762d..3c60ad621019c1daad5a0a379f7f925ce44d2d38 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -4276,6 +4276,11 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -4277,6 +4277,11 @@ public abstract class LivingEntity extends Entity implements Attackable { } });