mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 10:57:43 +01:00
Include all Airplane patches
This commit is contained in:
54
patches/server/0165-Fix-stuck-in-portals.patch
Normal file
54
patches/server/0165-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 4b7ab2405a7d49ae085d64e482d4a851f18263d6..c27ce317c7acaf7ddd926c982d08e0539e045e28 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -2427,12 +2427,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 3f00d66685479f3bec8cccb7a0b0988584122436..5c01d6609403c7aa8fe6e31faae485910db74a03 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -1161,6 +1161,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 a494a9e15456cf684c62957e8563ef06627695f9..c268ec1b3b3e558283d869629079049343b2f15d 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -350,6 +350,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