mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
55 lines
2.8 KiB
Diff
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 1c407f3050ba34afd33ce66b6ef8ef682010091a..a2ba87dac005572d2617b6fe2c92f6984665588c 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 a95dbbdb1a3ce4f403eab793ec5d6820678a2116..ebff0ef7f9bf38562265fc2cd4f81f59fda2278d 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
|
@@ -1181,6 +1181,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 2c555ac0bee9e0a37fada8c04e75699f2cb311bc..3df5798e91b767aa0843a3cc520116c02b5e277e 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);
|