mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
Fix stuck in portals
This commit is contained in:
54
patches/server/0171-Fix-stuck-in-portals.patch
Normal file
54
patches/server/0171-Fix-stuck-in-portals.patch
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
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 d92b8afe9d6471b66069527e8bd9a6ec370605ae..d6e51245ea2615d7db263c73757db74a5daaad8a 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||||
|
@@ -2419,12 +2419,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 157300c0320a136d36994d463a69a5b0fe022683..fecf180cfbc7295f55380fc50e7ae18573443844 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||||
|
@@ -1180,6 +1180,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 242fa7d0acca116f5efcc64066c66b8dca12bce4..8b99ae30d3808f3379ea27ecc2926b5baa778205 100644
|
||||||
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
@@ -332,6 +332,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);
|
||||||
Reference in New Issue
Block a user