Add portal permission bypass

This commit is contained in:
William Blake Galbreath
2025-01-11 22:19:05 -08:00
committed by granny
parent 407adcda52
commit d760f5436f
5 changed files with 23 additions and 44 deletions

View File

@@ -1,10 +1,11 @@
--- a/net/minecraft/world/entity/player/Player.java
+++ b/net/minecraft/world/entity/player/Player.java
@@ -200,11 +_,19 @@
@@ -200,11 +_,20 @@
private int currentImpulseContextResetGraceTime;
public boolean affectsSpawning = true; // Paper - Affects Spawning API
public net.kyori.adventure.util.TriState flyingFallDamage = net.kyori.adventure.util.TriState.NOT_SET; // Paper - flying fall damage
+ public int burpDelay = 0; // Purpur - Burp delay
+ public boolean canPortalInstant = false; // Purpur - Add portal permission bypass
// CraftBukkit start
public boolean fauxSleeping;

View File

@@ -9,3 +9,12 @@
while (level.getBlockState(pos).is(this)) {
pos = pos.below();
}
@@ -129,7 +_,7 @@
@Override
public int getPortalTransitionTime(ServerLevel level, Entity entity) {
return entity instanceof Player player
- ? Math.max(
+ ? player.canPortalInstant ? 1 : Math.max( // Purpur - Add portal permission bypass
0,
level.getGameRules()
.getInt(

View File

@@ -0,0 +1,10 @@
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -273,6 +_,7 @@
@Override
public void recalculatePermissions() {
this.perm.recalculatePermissions();
+ getHandle().canPortalInstant = hasPermission("purpur.portal.instant"); // Purpur - Add portal permission bypass
}
@Override