aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0071-handle-NaN-health-absorb-values-and-repair-bad-data.patch
diff options
context:
space:
mode:
authorSpottedleaf <[email protected]>2023-06-07 22:21:04 -0700
committerSpottedleaf <[email protected]>2023-06-07 22:26:06 -0700
commit819facd7c4343f6783d1a4ee84345d5b99ef47ce (patch)
tree67933d38087dbc5713d3669c03ccb4d167521ca6 /patches/server/0071-handle-NaN-health-absorb-values-and-repair-bad-data.patch
parent0c4a1c449662e842432f4458dbb2e26a0dbc66ff (diff)
downloadPaper-819facd7c4343f6783d1a4ee84345d5b99ef47ce.tar.gz
Paper-819facd7c4343f6783d1a4ee84345d5b99ef47ce.zip
rewrite chunk system checkpoint
Diffstat (limited to 'patches/server/0071-handle-NaN-health-absorb-values-and-repair-bad-data.patch')
-rw-r--r--patches/server/0071-handle-NaN-health-absorb-values-and-repair-bad-data.patch57
1 files changed, 0 insertions, 57 deletions
diff --git a/patches/server/0071-handle-NaN-health-absorb-values-and-repair-bad-data.patch b/patches/server/0071-handle-NaN-health-absorb-values-and-repair-bad-data.patch
deleted file mode 100644
index 0b7f0a14f9..0000000000
--- a/patches/server/0071-handle-NaN-health-absorb-values-and-repair-bad-data.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Aikar <[email protected]>
-Date: Sun, 27 Sep 2015 01:18:02 -0400
-Subject: [PATCH] handle NaN health/absorb values and repair bad data
-
-
-diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index 1238da8b035a0b0dd3d00557ca0de7a82f5fdf53..5e40ee2695b7ed50fddc0e8226f0b1b4879cd510 100644
---- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
-+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-@@ -795,7 +795,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
-
- @Override
- public void readAdditionalSaveData(CompoundTag nbt) {
-- this.setAbsorptionAmount(nbt.getFloat("AbsorptionAmount"));
-+ // Paper start - jvm keeps optimizing the setter
-+ float absorptionAmount = nbt.getFloat("AbsorptionAmount");
-+ if (Float.isNaN(absorptionAmount)) {
-+ absorptionAmount = 0;
-+ }
-+ this.setAbsorptionAmount(absorptionAmount);
-+ // Paper end
- if (nbt.contains("Attributes", 9) && this.level() != null && !this.level().isClientSide) {
- this.getAttributes().load(nbt.getList("Attributes", 10));
- }
-@@ -1313,6 +1319,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
- }
-
- public void setHealth(float health) {
-+ // Paper start
-+ if (Float.isNaN(health)) { health = getMaxHealth(); if (this.valid) {
-+ System.err.println("[NAN-HEALTH] " + getScoreboardName() + " had NaN health set");
-+ } } // Paper end
- // CraftBukkit start - Handle scaled health
- if (this instanceof ServerPlayer) {
- org.bukkit.craftbukkit.entity.CraftPlayer player = ((ServerPlayer) this).getBukkitEntity();
-@@ -3482,7 +3492,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
- }
-
- public void setAbsorptionAmount(float amount) {
-- if (amount < 0.0F) {
-+ if (amount < 0.0F || Float.isNaN(amount)) { // Paper
- amount = 0.0F;
- }
-
-diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 04e9a84b36f7f702e34216513348a0871ade22e5..877f82735c407c1d567628fafc7c7fd6adebb410 100644
---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-@@ -2096,6 +2096,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
- }
-
- public void setRealHealth(double health) {
-+ if (Double.isNaN(health)) {return;} // Paper
- this.health = health;
- }
-