diff --git a/patches/server/Block-Enderpearl-Travel-Exploit.patch b/patches/server/Block-Enderpearl-Travel-Exploit.patch index 0f5cc3bc59..d121f3631c 100644 --- a/patches/server/Block-Enderpearl-Travel-Exploit.patch +++ b/patches/server/Block-Enderpearl-Travel-Exploit.patch @@ -38,3 +38,31 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } this.leftOwner = nbt.getBoolean("LeftOwner"); +diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownEnderpearl.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownEnderpearl.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/ThrownEnderpearl.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownEnderpearl.java +@@ -0,0 +0,0 @@ import net.minecraft.world.entity.monster.Endermite; + import net.minecraft.world.entity.player.Player; + import net.minecraft.world.item.Item; + import net.minecraft.world.item.Items; ++import net.minecraft.world.level.ChunkPos; + import net.minecraft.world.level.GameRules; + import net.minecraft.world.level.Level; + import net.minecraft.world.phys.EntityHitResult; +@@ -0,0 +0,0 @@ public class ThrownEnderpearl extends ThrowableItemProjectile { + super.tick(); + } + ++ // Paper start ++ if (this.level.paperConfig.disableEnderpearlExploit) { ++ final net.minecraft.server.level.ChunkHolder chunkHolder = ((net.minecraft.server.level.ServerChunkCache) this.level.getChunkSource()).chunkMap.getVisibleChunkIfPresent(ChunkPos.asLong(this.blockPosition())); ++ if (chunkHolder == null || net.minecraft.server.level.ChunkHolder.getFullChunkStatus(chunkHolder.getTicketLevel()).isOrAfter(net.minecraft.server.level.ChunkHolder.FullChunkStatus.ENTITY_TICKING)) { ++ this.setOwner(null); ++ } ++ } ++ // Paper end ++ + } + + @Nullable