mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@1e5d1db Call StructureGrowEvent for mangrove propagule (#8023) PaperMC/Paper@385f313 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#8092) PaperMC/Paper@fbb11db Add missing EntityDropItemEvent calls (#5674) PaperMC/Paper@c879064 Call EntityDropItemEvent for goats dropping horns (#8094)
59 lines
3.6 KiB
Diff
59 lines
3.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <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/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
index 1de4f239dfb63250b7143e89e97487d048b99776..bc5d5a2a48cfc6b4257d1cc3ac73d8ec5300721d 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
@@ -1185,6 +1185,7 @@ public class ServerPlayer extends Player {
|
|
playerlist.sendPlayerPermissionLevel(this);
|
|
worldserver1.removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION);
|
|
this.unsetRemoved();
|
|
+ this.portalPos = net.minecraft.server.MCUtil.toBlockPosition(exit); // Purpur
|
|
|
|
// CraftBukkit end
|
|
this.setLevel(worldserver);
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
index 46a01989cd2d10ac4f41c7c0a86b0e915e6dbe90..3753502af217ed6d06f03d250a069b1e0be7ebe5 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -2879,12 +2879,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
return Vec3.directionFromRotation(this.getRotationVector());
|
|
}
|
|
|
|
+ public BlockPos portalPos = BlockPos.ZERO; // Purpur
|
|
public void handleInsidePortal(BlockPos pos) {
|
|
if (this.isOnPortalCooldown()) {
|
|
+ if (!(level.purpurConfig.playerFixStuckPortal && this instanceof Player && !pos.equals(portalPos))) // Purpur
|
|
this.setPortalCooldown();
|
|
} else if (level.purpurConfig.entitiesCanUsePortals || this instanceof ServerPlayer) { // Purpur
|
|
if (!this.level.isClientSide && !pos.equals(this.portalEntrancePos)) {
|
|
this.portalEntrancePos = pos.immutable();
|
|
+ portalPos = BlockPos.ZERO; // Purpur
|
|
}
|
|
|
|
this.isInsidePortal = true;
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index 804a90cfb82d194de5b0f985e04a1fa7f89c29b0..a9654a4935c625852070255e443c669bd80d332a 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -332,6 +332,7 @@ public class PurpurWorldConfig {
|
|
public int playerDeathExpDropMax = 100;
|
|
public boolean teleportIfOutsideBorder = false;
|
|
public boolean totemOfUndyingWorksInInventory = false;
|
|
+ public boolean playerFixStuckPortal = false;
|
|
private void playerSettings() {
|
|
if (PurpurConfig.version < 19) {
|
|
boolean oldVal = getBoolean("gameplay-mechanics.player.idle-timeout.mods-target", idleTimeoutTargetPlayer);
|
|
@@ -349,6 +350,7 @@ public class PurpurWorldConfig {
|
|
playerDeathExpDropMax = getInt("gameplay-mechanics.player.exp-dropped-on-death.maximum", playerDeathExpDropMax);
|
|
teleportIfOutsideBorder = getBoolean("gameplay-mechanics.player.teleport-if-outside-border", teleportIfOutsideBorder);
|
|
totemOfUndyingWorksInInventory = getBoolean("gameplay-mechanics.player.totem-of-undying-works-in-inventory", totemOfUndyingWorksInInventory);
|
|
+ playerFixStuckPortal = getBoolean("gameplay-mechanics.player.fix-stuck-in-portal", playerFixStuckPortal);
|
|
}
|
|
|
|
private static boolean projectileDespawnRateSettingsMigrated = false;
|