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@487109f Readd 0414 use distance map to optimise entity tracker (#9868) PaperMC/Paper@230682d Add raw iron & raw copper blocks to anti xray defaults (#7622) PaperMC/Paper@44057da Remove duplicate water-sensitivity damage for unaware mobs (#9908) PaperMC/Paper@f78d7ce Remove "fix-curing-zombie-villager-discount" exploit option (#9895) PaperMC/Paper@aa6c4c1 Include packet class name in packet encoding error messages (#9907) PaperMC/Paper@6592fed Use a server impl for hopper event to track get/setItem calls (#9905) PaperMC/Paper@bffb08c Deprecate Player#boostElytra (#9899) PaperMC/Paper@43c3432 Add entity API for getting the combined gene of a Panda (#9891) PaperMC/Paper@15a0de2 Make Team extend ForwardingAudience (#9852) PaperMC/Paper@0cdce89 Fix a bunch of stuff with player spawn locations (#9887) PaperMC/Paper@8a3980c Add API to get the collision shape of a block before it's placed (#9821) PaperMC/Paper@23860da Add predicate for block when raytracing (#9691) PaperMC/Paper@75d04e9 Broadcast take item packets with collector as source (#9884) PaperMC/Paper@2553f30 fix secure profile with proxy online mode (#9700) PaperMC/Paper@e289acc Add more API to LingeringPotionSplashEvent (#9901) PaperMC/Paper@8cafc07 Added missing enchantables to material tags (#9888)
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 51efe3a87ca54423e8bb8c23d226bf3e23ac8862..6ecabc14a4f50086790536b28e68b6ea25b27495 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
@@ -1268,6 +1268,7 @@ public class ServerPlayer extends Player {
|
|
playerlist.sendPlayerPermissionLevel(this);
|
|
worldserver1.removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION);
|
|
this.unsetRemoved();
|
|
+ this.portalPos = io.papermc.paper.util.MCUtil.toBlockPosition(exit); // Purpur
|
|
|
|
// CraftBukkit end
|
|
this.setServerLevel(worldserver);
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
index bfd8eb90479bdb1cad6343c04995788b31b3e05c..5790e3f1d5e2c43f401bfd93e85ddee799a6aad2 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -3096,12 +3096,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 4352f37b8568c7e9ce8cce66c2a1b36d6d9f8520..10c019d14fb20835a01c31dc4546d1c70cde6948 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -333,6 +333,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);
|
|
@@ -348,6 +349,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;
|