9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2025-12-24 01:09:16 +00:00

Fix inverted explosion visibity check

This commit is contained in:
Samsuik
2024-11-24 18:27:38 +00:00
parent 877990205f
commit 989441f605

View File

@@ -735,7 +735,7 @@ index 5b3a886c624b36557cbfaccdc3fb05a46a4ba36a..b05ecbfd33c9924ae0d3afcfc3756a35
// CraftBukkit start - respect vanish API
if (flag && !player.getBukkitEntity().canSee(this.entity.getBukkitEntity())) { // Paper - only consider hits
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 2a622f2d796ecb42598d230319804d06f0a30808..4ac8c7b3878b3df7b9cb812f99a47e2f9fc7f408 100644
index 2a622f2d796ecb42598d230319804d06f0a30808..7a64aaeecafe067e832a82a77113495164467599 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -594,6 +594,21 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
@@ -771,7 +771,7 @@ index 2a622f2d796ecb42598d230319804d06f0a30808..4ac8c7b3878b3df7b9cb812f99a47e2f
+ // In 1.22 and later this should be replaced with sending the motion through a PlayerPositionPacket.
+ // The problem here is SetEntityMotion is capped to 3.9 b/pt and the only other alternate mean was
+ // implemented in 1.21.3. I believe it's best to just wait on this issue and deal with this hack.
+ if (this.checkExplosionVisibility(vec3d, entityplayer)) {
+ if (!this.checkExplosionVisibility(vec3d, entityplayer)) {
+ position = new Vec3(0.0, -1024.0, 0.0);
+ particle = net.minecraft.core.particles.ParticleTypes.SMOKE;
+ }