From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Sat, 26 Jun 2021 23:05:12 -0500
Subject: [PATCH] Add permission bypass for portal waiting


diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index bae254bd927cf1715a98c55354941c2341f69694..8d62bbb4fb818bea940bbac565cb8e30cb85818e 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -184,6 +184,7 @@ public abstract class Player extends LivingEntity {
     // Paper end
     public boolean isCritical = false; // Purpur
     public boolean flyingFallDamage = false; // Purpur
+    public boolean canPortalInstant = false; // Purpur
 
     // CraftBukkit start
     public boolean fauxSleeping;
@@ -465,7 +466,7 @@ public abstract class Player extends LivingEntity {
 
     @Override
     public int getPortalWaitTime() {
-        return this.abilities.invulnerable ? 1 : 80;
+        return this.abilities.invulnerable || canPortalInstant ? 1 : 80; // Purpur
     }
 
     @Override
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index 7c7d05852dd463331110d1dcb71b4d4f5312900f..5939aeff08fd1216c53f3af15362dddfa1e207c9 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -245,6 +245,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
     @Override
     public void recalculatePermissions() {
         this.perm.recalculatePermissions();
+        getHandle().canPortalInstant = hasPermission("purpur.portal.instant"); // Purpur
     }
 
     @Override
