mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
Fixup enderpearl patch
This commit is contained in:
parent
eca2f8fdd0
commit
92c68e2367
2 changed files with 8 additions and 11 deletions
|
@ -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
|
||||||
|
|
|
@ -42,23 +42,16 @@ diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownEnderpear
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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
|
||||||
@@ -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 {
|
@@ -0,0 +0,0 @@ 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 a new issue