Files
Purpur/patches/server/0164-Fix-stuck-in-portals.patch
BillyGalbreath d93887a156 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
5b20df6bf added PlayerNameEntityEvent
ff9c82444 Add worldborder events
616b1f3cd consider enchants for destroy speed
aaef1d5cc fix file conversion
674d8f7f7 Make discovered maps config work in treasure maps from loot tables too
be1687914 stop firing pressure plate EntityInteractEvent for ignored entities (fixes #4962)
7d56f38ed Do not use the bukkit singleton for the GUI (Fixes #5301)
4c9bdf53a Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5299)
8647bd130 Improve ServerGUI
fcc6d3359 Throw proper exception on empty JsonList file
17d2e1291 Fix interact event in adventure mode
964e0bf42 MC-29274: Fix Wither hostility towards players
9e24a5213 Fixed furnace cook-speed multiplier losing precision when calculating cook time
c7e42faa3 Do not create unnecessary copies of the passenger list
40881ad67 added tnt minecarts to the tnt height nerf
26be708f4 Remove streams from SensorNearest
5b5989b21 fix nullability of playerlist header/footer, closes #5290
45bc531dd Fix Material#getTranslationKey for Block Materials (#5294)
2021-03-04 21:45:44 -06:00

55 lines
2.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <blake.galbreath@gmail.com>
Date: Thu, 14 Jan 2021 16:48:10 -0600
Subject: [PATCH] Fix stuck in portals
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 68e019869c3a5907a63cbed59958b25a028d349e..9718812a3b5b4fe68c55390a52f7686cd78e44cd 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -2411,12 +2411,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
return new Vec2F(this.pitch, this.yaw);
}
+ public BlockPosition portalPos = BlockPosition.ZERO; // Purpur
public void d(BlockPosition blockposition) {
if (this.ai()) {
+ if (!(world.purpurConfig.playerFixStuckPortal && this instanceof EntityPlayer && !blockposition.equals(portalPos))) // Purpur
this.resetPortalCooldown();
} else if (world.purpurConfig.entitiesCanUsePortals || this instanceof EntityPlayer) { // Purpur
if (!this.world.isClientSide && !blockposition.equals(this.ac)) {
this.ac = blockposition.immutableCopy();
+ portalPos = BlockPosition.ZERO; // Purpur
}
this.inPortal = true;
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 0e5581e363f80735549cfbc5259eb044828e483b..67f822e64013540dd890e0269c8f770f7c029405 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -1161,6 +1161,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
playerlist.d(this);
worldserver1.removePlayer(this);
this.dead = false;
+ this.portalPos = MCUtil.toBlockPosition(exit); // Purpur
// CraftBukkit end
this.spawnIn(worldserver);
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index a494a9e15456cf684c62957e8563ef06627695f9..c268ec1b3b3e558283d869629079049343b2f15d 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -350,6 +350,11 @@ public class PurpurWorldConfig {
});
}
+ public boolean playerFixStuckPortal = false;
+ private void playerFixStuckPortal() {
+ playerFixStuckPortal = getBoolean("gameplay-mechanics.player.fix-stuck-in-portal", playerFixStuckPortal);
+ }
+
public boolean teleportIfOutsideBorder = false;
private void teleportIfOutsideBorder() {
teleportIfOutsideBorder = getBoolean("gameplay-mechanics.player.teleport-if-outside-border", teleportIfOutsideBorder);