mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: 41e6073ce [Auto] Updated Upstream (CraftBukkit) 6f93dc95d Add cause to Weather/ThunderChangeEvents (#4832) 507cf19b3 [CI-SKIP] [Auto] Rebuild Patches afe0785bf Added PlayerPurchaseEvent for standalone Merchant GUIs (#5583) 615df3d8a Fix entity motion tag from mob spawners (#5718) 2d34898b5 Add methods for getting default item attributes (#5593) d9766433e Add EntityInsideBlockEvent (#5596)
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 8a7f75baa730729dd0022fe74da15fe669eced24..c69ef7ee5e40e2557b3a3971c6fb24c9966d6809 100644
|
|
--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
|
+++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
|
@@ -1299,6 +1299,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 1b381125b16f231686b507985807028824b9d441..6cbd6b38ac77dac8ecde224849f74a6f5a4f9d98 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -2550,12 +2550,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);
|