mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 09:27:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: 3dbb8926e Fix PotionSplashEvent for water splash potions (#5697) b759d006e Adds per-world spawn limits (#4837) 81de619d3 Updated Upstream (CraftBukkit) (#5786) 5e3604f1b Better fix for invulnerable crystals and improve Origin API (#5761) d5fe9c817 Updated Upstream (CraftBukkit) (#5784) Tuinity Changes: df76b3cc5 Update Upstream (Paper)
55 lines
2.9 KiB
Diff
55 lines
2.9 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/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
|
index c631e4d27518a1382869c184af41bec911cce908..2bae88b7b53d38f41808fe0177cd78a9e2bb1ce9 100644
|
|
--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
|
+++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
|
@@ -1300,6 +1300,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/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
index 6c5c950b129b5e7e7d0d614cfdbfb5c59fda86de..27cd04a4b6e0c87a300f5868f0b82fc02408a556 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -2552,12 +2552,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
|
|
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/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index 9d8056d7766925fec57b17b55f56dd8c67382b0a..742db39c2bcd0a1416108e6ee57bd8156b50c0b8 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -408,6 +408,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);
|