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@f7e3976 Revert "Legacy data should look for legacy materials (Fixes #6618)" (Fixes #6664) PaperMC/Paper@ce1e7e8 Fix jline relocation (#6677) PaperMC/Paper@3e8fb21 Suggest PlayerPostRespawnEvent if changing player state (#6679) PaperMC/Paper@2b404b0 Fix nullability on Block#breakNaturally (#6651) PaperMC/Paper@8ee9bdd Fix stacktrace deobf where thrownProxy got initialized before rewriting (#6684) PaperMC/Paper@fce7905 Option to prevent NBT copy in smithing recipes (#6671) PaperMC/Paper@3b2b835 Fix click event when vanilla scoreboard name coloring is enabled (#6652) PaperMC/Paper@425edfa More CommandBlock API (#5746) PaperMC/Paper@6847f57 Improve ItemStack#editMeta (#6502) PaperMC/Paper@6703c13 Preserve overstacked loot (#5943) PaperMC/Paper@0032236 Make Levels Use Correct Spawn Settings (#6419) PaperMC/Paper@4a27a4a Update head rotation in missing places (#5481) PaperMC/Paper@ebfd70b Use null for null resource pack prompts (#6572) PaperMC/Paper@826acaf Fix plugin provides load order (#6687) PaperMC/Paper@f905057 Prevent unintended light block manipulation (#6601) PaperMC/Paper@45c4f90 Readd root/admin user detection (#6593) PaperMC/Paper@e8830b2 Revert "Readd root/admin user detection (#6593)" (#6699) PaperMC/Paper@cc38c16 Updated Upstream (Bukkit/CraftBukkit) (#6638) PaperMC/Paper@7dd7c0c [ci skip] update issue template to remove checkboxes and add datapacks (#6702) PaperMC/Paper@bde7b98 Make legacyRenderer a ViewerUnaware renderer (#6691) PaperMC/Paper@e391591 Update paperweight to 1.1.12 (#6653) PaperMC/Paper@e14aff9 Don't count named piglins and hoglins towards mob cap (#6452) PaperMC/Paper@a978f41 Start console thread after PaperConfig & MinecraftServer.console are initialized (#6716) PaperMC/Paper@b1f0cbd [ci skip] Remove redundant/broken readme badges (#6715) PaperMC/Paper@e3ef498 [ci skip] remove markdown from issue template (#6705) PaperMC/Paper@7ebf08a Handle missing Spawn Egg item meta for 1.17 mobs (#6700) PaperMC/Paper@90f717f Add missing team sidebar display slots (#6690)
59 lines
3.5 KiB
Diff
59 lines
3.5 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 a2542b5d72393b6e0a06bd5e21c1e4e9a7f52860..33e36a80edbc80f0f562842ed690dccc13cc2e94 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
@@ -1142,6 +1142,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 7b0696ddb8c1d815b5bf5897865703579add0728..e4bb19855fd2cf885742f56d06e76faa85965b0b 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -2731,12 +2731,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
|
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/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index d330d23e63e3da106e8a44545792adfffc8d7918..31ddbe88a7a2d4e0b1f0dc9afdff738e4f457f96 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -297,6 +297,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);
|
|
@@ -314,6 +315,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);
|
|
}
|
|
|
|
public int snowballDamage = -1;
|