Files
Purpur/patches/server/0165-Fix-stuck-in-portals.patch
BillyGalbreath 3dd9f46453 Updated Upstream (Paper, Tuinity, & Airplane)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
8c74d3126 Updated Upstream (Bukkit) (#5359)
fd3c66a91 bug #5362 - correctly pass "render type" when registering a new scoreboard objective
39c487b37 Add per-command perms for paper command
cdbf2578c Add Item Rarity API (#5352)
d80e43647 [CI-SKIP] Removal from the MIT list (#5345)

Tuinity Changes:
aea6b8347 Merge dev/playerchunkloading
722c7ca8a Use hash table for maintaing changed block set
98ae59d85 Custom table implementation for blockstate state lookups
8b8704fb6 Oprimise map impl for tracked players
ea71d6ba4 Optimise snow & ice in chunk ticking
9871d4ce5 Remove chunk lookup & lambda allocation from counting mobs
5a4a35f3e Add patreon
7d93d9618 Refactor data management for region manager
c3035219f Change license from MIT to LGPLv3

Airplane Changes:
580f380b6 Updated Upstream (Tuinity)
82253fd36 Early return optimization for target finding
9572643bb Cache entityhuman display name
5df98254f Remove iterators from inventory contains
18d2be193 Merge pull request #14 from violetwtf/patch-1
f716d4c33 Merge pull request #13 from violetwtf/master
128cbe519 Reduce entity chunk ticking checks from 3 to 1
03ac0933b Skip copying unloading tile entities
97dd027b5 Smaller pool size for tracking
9e9f57be4 Only set up Flare if token is available
2021-03-14 18:21:36 -05: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 4b7ab2405a7d49ae085d64e482d4a851f18263d6..c27ce317c7acaf7ddd926c982d08e0539e045e28 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -2427,12 +2427,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 5a602de5b9ff436e7cfb70c39475be34beddfb8d..5cf4a2b41d7f088eeb7c8003b8b889f370a4d214 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);