mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 17:07:43 +01:00
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 8010b0c68b99c2e8986d01a4635e1a37f4313dbe..ea9523fc977ec4a96bf113c33d0f9643f0cf7419 100644
|
|
--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
|
+++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
|
@@ -1291,6 +1291,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 2545b0891a299301a8d9e194e795b0f3856f2178..fdd374232ced8f4da675afaee3f5278c036ef112 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -2551,12 +2551,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 edb7f82c0ebadd05095917f303be9c6f72a4a893..3dd8868ab3f1675ff5e7547285f9a89b9d56cd63 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -396,6 +396,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);
|