Fixup enderpearl patch
This commit is contained in:
parent
310c718ed5
commit
295703efb6
|
@ -237,3 +237,7 @@ public org.bukkit.craftbukkit.inventory.CraftMetaFirework getNBT(Lorg/bukkit/Fir
|
||||||
|
|
||||||
# Vanilla command permission fixes
|
# Vanilla command permission fixes
|
||||||
public-f com.mojang.brigadier.tree.CommandNode requirement
|
public-f com.mojang.brigadier.tree.CommandNode requirement
|
||||||
|
|
||||||
|
# Block Enderpearl Travel Exploit
|
||||||
|
public net.minecraft.world.entity.projectile.Projectile cachedOwner
|
||||||
|
public net.minecraft.world.entity.projectile.Projectile ownerUUID
|
||||||
|
|
|
@ -39,26 +39,19 @@ index e4294219be68c6f99cd0e5ea8330fae6dc03ddde..b09f52330b50879d5594b21302e70ca6
|
||||||
|
|
||||||
this.leftOwner = nbt.getBoolean("LeftOwner");
|
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
|
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 541ca82405d0b4d1457dcd63b58dc61eb67482d6..002725b24f0eaee10a9a529c847dfb78538c6bd4 100644
|
index 541ca82405d0b4d1457dcd63b58dc61eb67482d6..1b2ada3663cc0739782ac591f2ee1f6d0fb94841 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/projectile/ThrownEnderpearl.java
|
--- a/src/main/java/net/minecraft/world/entity/projectile/ThrownEnderpearl.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownEnderpearl.java
|
+++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownEnderpearl.java
|
||||||
@@ -12,6 +12,7 @@ import net.minecraft.world.entity.monster.Endermite;
|
@@ -108,6 +108,16 @@ public class ThrownEnderpearl extends ThrowableItemProjectile {
|
||||||
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;
|
|
||||||
@@ -108,6 +109,15 @@ public class ThrownEnderpearl extends ThrowableItemProjectile {
|
|
||||||
super.tick();
|
super.tick();
|
||||||
}
|
}
|
||||||
|
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ if (this.level.paperConfig.disableEnderpearlExploit) {
|
+ 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()));
|
+ final net.minecraft.server.level.ChunkHolder chunkHolder = ((net.minecraft.server.level.ServerChunkCache) this.level.getChunkSource()).chunkMap.getVisibleChunkIfPresent(net.minecraft.world.level.ChunkPos.asLong(this.blockPosition()));
|
||||||
+ if (chunkHolder == null || net.minecraft.server.level.ChunkHolder.getFullChunkStatus(chunkHolder.getTicketLevel()).isOrAfter(net.minecraft.server.level.ChunkHolder.FullChunkStatus.ENTITY_TICKING)) {
|
+ if (chunkHolder == null || !net.minecraft.server.level.ChunkHolder.getFullChunkStatus(chunkHolder.getTicketLevel()).isOrAfter(net.minecraft.server.level.ChunkHolder.FullChunkStatus.ENTITY_TICKING)) {
|
||||||
+ this.setOwner(null);
|
+ this.cachedOwner = null;
|
||||||
|
+ this.ownerUUID = null;
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
|
|
Loading…
Reference in New Issue