aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server
diff options
context:
space:
mode:
authorFireInstall <[email protected]>2024-03-23 20:27:30 +0100
committerGitHub <[email protected]>2024-03-23 20:27:30 +0100
commit9ec7dfcbc41c6e625de0050b6997160a75df9f44 (patch)
treeecfae4a17b8258b5ceb8fa4cb340e023b8031e8a /patches/server
parent88419b207579533646ab011da886030ea9ea4862 (diff)
downloadPaper-9ec7dfcbc41c6e625de0050b6997160a75df9f44.tar.gz
Paper-9ec7dfcbc41c6e625de0050b6997160a75df9f44.zip
Move invisible setting up to entities (#10346)
Diffstat (limited to 'patches/server')
-rw-r--r--patches/server/0586-Missing-Entity-API.patch42
-rw-r--r--patches/server/0627-Add-Raw-Byte-Entity-Serialization.patch9
-rw-r--r--patches/server/0677-Entity-powdered-snow-API.patch7
-rw-r--r--patches/server/0772-Collision-API.patch9
-rw-r--r--patches/server/0798-Add-entity-knockback-API.patch4
-rw-r--r--patches/server/0816-ItemStack-damage-API.patch4
-rw-r--r--patches/server/0817-Friction-API.patch4
-rw-r--r--patches/server/0843-Add-Entity-Body-Yaw-API.patch10
-rw-r--r--patches/server/0910-API-for-an-entity-s-scoreboard-name.patch4
9 files changed, 65 insertions, 28 deletions
diff --git a/patches/server/0586-Missing-Entity-API.patch b/patches/server/0586-Missing-Entity-API.patch
index 501d3329dd..b2f850af74 100644
--- a/patches/server/0586-Missing-Entity-API.patch
+++ b/patches/server/0586-Missing-Entity-API.patch
@@ -29,6 +29,7 @@ public net.minecraft.world.entity.animal.AbstractSchoolingFish schoolSize
public net.minecraft.world.entity.animal.Rabbit moreCarrotTicks
public net.minecraft.world.entity.AreaEffectCloud ownerUUID
public net.minecraft.world.entity.animal.MushroomCow stewEffects
+public net.minecraft.world.entity.Entity FLAG_INVISIBLE
Co-authored-by: Nassim Jahnke <[email protected]>
Co-authored-by: Jake Potrebic <[email protected]>
@@ -37,6 +38,7 @@ Co-authored-by: SoSeDiK <[email protected]>
Co-authored-by: booky10 <[email protected]>
Co-authored-by: Amin <[email protected]>
Co-authored-by: TrollyLoki <[email protected]>
+Co-authored-by: FireInstall <[email protected]>
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
index 8117578ced94aa6bf01871f6526a388385c4adf2..59699c59fdfc611177fdb3136f84ab539b17d9c9 100644
@@ -667,6 +669,28 @@ index fc0f0e841dc974d080e1abb9bbafb5165801131f..d657fd2c507a5b215aeab0a5f3e9c2ee
+ }
+ // Paper end
}
+diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+index 07158732dd6a5b7d622b7f2ea10ca87b50365b8a..dd1ca63d2d6e4c8606c28380f81b79b7ee211a35 100644
+--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+@@ -1078,4 +1078,17 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
+ return set;
+ }
+ // Paper end
++
++ // Paper start - move up invisibility
++ @Override
++ public boolean isInvisible() {
++ return this.getHandle().isInvisible();
++ }
++
++ @Override
++ public void setInvisible(boolean invisible) {
++ this.getHandle().persistentInvisibility = invisible;
++ this.getHandle().setSharedFlag(Entity.FLAG_INVISIBLE, invisible);
++ }
++ // Paper end - move up invisibility
+ }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java
index 73cb7aa01af3eed71b05b1a539f082b26dcd8d60..e1a2f0924da6ebcdf332040f922226af5d8a2d45 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java
@@ -761,12 +785,22 @@ index 2cec61a1bb050c1ef81c5fc3d0afafe9ff29d459..97fa4e1e70203194bd939618b2fad926
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
-index 9ce82b203e37ff1f5a7618fe864ed7616bd8d52e..9a7a670c1e99674e8a554342165b7b77001083fc 100644
+index 9ce82b203e37ff1f5a7618fe864ed7616bd8d52e..6218f15194b7ae0b17f7f1dab78b1337779edb27 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
-@@ -913,6 +913,22 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
- this.getHandle().persistentInvisibility = invisible;
- this.getHandle().setSharedFlag(5, invisible);
+@@ -905,14 +905,29 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
+
+ @Override
+ public boolean isInvisible() {
+- return this.getHandle().isInvisible();
++ return super.isInvisible(); // Paper - move invisibility up to Entity - diff on change
+ }
+
+ @Override
+ public void setInvisible(boolean invisible) {
+- this.getHandle().persistentInvisibility = invisible;
+- this.getHandle().setSharedFlag(5, invisible);
++ super.setInvisible(invisible); // Paper - move invisibility up to Entity
}
+ // Paper start
+ @Override
diff --git a/patches/server/0627-Add-Raw-Byte-Entity-Serialization.patch b/patches/server/0627-Add-Raw-Byte-Entity-Serialization.patch
index 436c536f74..b57a9d9bb2 100644
--- a/patches/server/0627-Add-Raw-Byte-Entity-Serialization.patch
+++ b/patches/server/0627-Add-Raw-Byte-Entity-Serialization.patch
@@ -7,7 +7,7 @@ Subject: [PATCH] Add Raw Byte Entity Serialization
public net.minecraft.world.entity.Entity setLevel(Lnet/minecraft/world/level/Level;)V
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
-index 822666e1199e0851136d88b2b556d8d17843d902..e6ef67a7a2eab5314c95e751895b4d4ce71c91b8 100644
+index 7dbbf0884b70acb37c3400364736fa8f6b68c964..5dce3d38ecd7b7639f02f3e1e92f3723f4a42c39 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2078,6 +2078,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -27,10 +27,10 @@ index 822666e1199e0851136d88b2b556d8d17843d902..e6ef67a7a2eab5314c95e751895b4d4c
return this.isPassenger() ? false : this.saveAsPassenger(nbt);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
-index 07158732dd6a5b7d622b7f2ea10ca87b50365b8a..411e2eed16d5b774900fc12f5ad782ab229dde97 100644
+index 08d63e104ddc079af6349b6b3665cadae1c619ad..6a31fb773798e911e731c35e2d52eb1073ed9f07 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
-@@ -1077,5 +1077,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
+@@ -1077,6 +1077,16 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
}
return set;
}
@@ -45,7 +45,8 @@ index 07158732dd6a5b7d622b7f2ea10ca87b50365b8a..411e2eed16d5b774900fc12f5ad782ab
+ return !this.entity.valid && this.entity.level().addFreshEntity(this.entity, reason);
+ }
// Paper end
- }
+
+ // Paper start - move up invisibility
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 609b103cb9af3b0554bf1116306874fe98c8534c..3f582c5653e13875cce4ef8ecd279d8a3d2b2dc2 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
diff --git a/patches/server/0677-Entity-powdered-snow-API.patch b/patches/server/0677-Entity-powdered-snow-API.patch
index 9976726fc5..e06e388df9 100644
--- a/patches/server/0677-Entity-powdered-snow-API.patch
+++ b/patches/server/0677-Entity-powdered-snow-API.patch
@@ -7,10 +7,10 @@ Subject: [PATCH] Entity powdered snow API
public net.minecraft.world.entity.monster.Skeleton inPowderSnowTime
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
-index 411e2eed16d5b774900fc12f5ad782ab229dde97..71f9b7bbbabae9291fdb9f902f3f69c13e715c0e 100644
+index 6a31fb773798e911e731c35e2d52eb1073ed9f07..6a8251ae85f192925493b3e084c0e53820a9be97 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
-@@ -1087,5 +1087,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
+@@ -1087,6 +1087,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
this.entity.setRot(location.getYaw(), location.getPitch());
return !this.entity.valid && this.entity.level().addFreshEntity(this.entity, reason);
}
@@ -20,7 +20,8 @@ index 411e2eed16d5b774900fc12f5ad782ab229dde97..71f9b7bbbabae9291fdb9f902f3f69c1
+ return getHandle().isInPowderSnow || getHandle().wasInPowderSnow; // depending on the location in the entity "tick" either could be needed.
+ }
// Paper end
- }
+
+ // Paper start - move up invisibility
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java
index a0ea54181de6c6685deef265cbe9f66aabbca42b..6f98da9be6aef35e3b5c940188b872459a383c8e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java
diff --git a/patches/server/0772-Collision-API.patch b/patches/server/0772-Collision-API.patch
index c4952054b5..da2d02ef43 100644
--- a/patches/server/0772-Collision-API.patch
+++ b/patches/server/0772-Collision-API.patch
@@ -22,13 +22,14 @@ index fbcf1320ef9c1817b24aa8724cd6cf07319c20b9..5680e9772a2d90e997d2d0aacdda9edd
// Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
-index 9ea189c26c6a5fae84bcc7ed098426d8c001cd5e..b7fceba1c7138a5c1d78bf058c9f2d32dbc1d292 100644
+index a47e8994b52576d88fa90b7a86cbe0fb7493fa6d..3cdc8787c6a481da6cb294208eebce0636a58d4f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
-@@ -1125,4 +1125,19 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
- return getHandle().isInPowderSnow || getHandle().wasInPowderSnow; // depending on the location in the entity "tick" either could be needed.
+@@ -1138,4 +1138,20 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
+ this.getHandle().setSharedFlag(Entity.FLAG_INVISIBLE, invisible);
}
- // Paper end
+ // Paper end - move up invisibility
++
+ // Paper start - Collision API
+ @Override
+ public boolean collidesAt(@org.jetbrains.annotations.NotNull Location location) {
diff --git a/patches/server/0798-Add-entity-knockback-API.patch b/patches/server/0798-Add-entity-knockback-API.patch
index 7086303073..afe4ca229a 100644
--- a/patches/server/0798-Add-entity-knockback-API.patch
+++ b/patches/server/0798-Add-entity-knockback-API.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Add entity knockback API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
-index e559af05c58b7d9c940cea9f48c0f4bd0aad756c..cb585a82e52697d84f3da25a150b663c8c286f58 100644
+index 354c32f67d06228477c723f7e4dbe27116e59a9b..4363f55707101362c1df60b73ab23d3d4c9c0675 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
-@@ -1073,5 +1073,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
+@@ -1072,5 +1072,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
}
throw new IllegalArgumentException(entityCategory + " is an unrecognized entity category");
}
diff --git a/patches/server/0816-ItemStack-damage-API.patch b/patches/server/0816-ItemStack-damage-API.patch
index 933e8cf6e8..9525df8c4c 100644
--- a/patches/server/0816-ItemStack-damage-API.patch
+++ b/patches/server/0816-ItemStack-damage-API.patch
@@ -11,10 +11,10 @@ the logic associated with damaging them
public net.minecraft.world.entity.LivingEntity entityEventForEquipmentBreak(Lnet/minecraft/world/entity/EquipmentSlot;)B
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
-index cb585a82e52697d84f3da25a150b663c8c286f58..7ba726584ce4a58654b8a8b9604f0cca762b3f42 100644
+index 4363f55707101362c1df60b73ab23d3d4c9c0675..ed436eed7617665e77627dd05d17b8e5a7366f25 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
-@@ -1074,6 +1074,53 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
+@@ -1073,6 +1073,53 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
throw new IllegalArgumentException(entityCategory + " is an unrecognized entity category");
}
diff --git a/patches/server/0817-Friction-API.patch b/patches/server/0817-Friction-API.patch
index cb41b035bb..c7825d86c1 100644
--- a/patches/server/0817-Friction-API.patch
+++ b/patches/server/0817-Friction-API.patch
@@ -133,10 +133,10 @@ index 1a291dd8a287db30e71dcb315599fc4b038764c4..30d62ee4d5cd2ddacb8783b5bbbf475d
public int getHealth() {
return this.getHandle().health;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
-index 7ba726584ce4a58654b8a8b9604f0cca762b3f42..d7492b969750fddca8bf09fdf2e91b146db03dc4 100644
+index ed436eed7617665e77627dd05d17b8e5a7366f25..e8ef40fed546608d995fd31dc8a9721c00537749 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
-@@ -1121,6 +1121,18 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
+@@ -1120,6 +1120,18 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
});
}
diff --git a/patches/server/0843-Add-Entity-Body-Yaw-API.patch b/patches/server/0843-Add-Entity-Body-Yaw-API.patch
index 1131f49d45..526a085ebb 100644
--- a/patches/server/0843-Add-Entity-Body-Yaw-API.patch
+++ b/patches/server/0843-Add-Entity-Body-Yaw-API.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Add Entity Body Yaw API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
-index 69dc7d9cc9ebd681d842099e2de521fd11ff5242..ba915f1b3cd00c8afe39ece9c9e68737673777f5 100644
+index 034bfd80ea7d1958eba3e057010379bf4b3661c9..dbb463e8aabe4afce6e119f0d91caff96911384d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1136,6 +1136,31 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -38,13 +38,13 @@ index 69dc7d9cc9ebd681d842099e2de521fd11ff5242..ba915f1b3cd00c8afe39ece9c9e68737
+ return this.entity.getBukkitYaw();
+ }
// Paper end
- // Paper start - Collision API
- @Override
+
+ // Paper start - move up invisibility
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
-index d7492b969750fddca8bf09fdf2e91b146db03dc4..3302d8e9b7c2c48b20dd257f4699b263d3bc52dc 100644
+index e8ef40fed546608d995fd31dc8a9721c00537749..fbe1d5051f8767db240e4d0c256f4a1088c4339c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
-@@ -1113,6 +1113,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
+@@ -1112,6 +1112,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
this.damageItemStack0(this.getHandle().getItemBySlot(nmsSlot), amount, nmsSlot);
}
diff --git a/patches/server/0910-API-for-an-entity-s-scoreboard-name.patch b/patches/server/0910-API-for-an-entity-s-scoreboard-name.patch
index 1df4442214..a93b609b72 100644
--- a/patches/server/0910-API-for-an-entity-s-scoreboard-name.patch
+++ b/patches/server/0910-API-for-an-entity-s-scoreboard-name.patch
@@ -7,10 +7,10 @@ Was obtainable through different methods, but you had to use different
methods depending on the implementation of Entity you were working with.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
-index 282a1cebc0cdb6253d024dd399ef794335883662..fec2f96cfc42559c44d5d2e907d0706c674dfda7 100644
+index 1de3a2ed64dcd222bc90d3917c08e12af56450b4..fd7a3176cdd07f50e4e56d98827672042cdf5944 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
-@@ -1192,4 +1192,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
+@@ -1206,4 +1206,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
return !this.getHandle().level().noCollision(this.getHandle(), aabb);
}
// Paper end - Collision API