Skip to content

Commit

Permalink
Use teleportAsync for Purpur's teleportIfOutsideBorder config option
Browse files Browse the repository at this point in the history
  • Loading branch information
PureGero committed Jul 1, 2024
1 parent 1a73826 commit c0fbbb9
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: PureGero <puregero@gmail.com>
Date: Mon, 1 Jul 2024 14:11:36 +0900
Subject: [PATCH] Purpur teleportIfOutsideBorder - use teleportAsync


diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index e95c20639d5da73bab0d23acc67e81cd09e3e168..b02568c6568af81a631033594880002a4a8caeea 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -441,7 +441,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
double d1 = this.level().getWorldBorder().getDamagePerBlock();

if (d1 > 0.0D) {
- if (level().purpurConfig.teleportIfOutsideBorder && this instanceof ServerPlayer serverPlayer) { serverPlayer.teleport(io.papermc.paper.util.MCUtil.toLocation(level(), ((ServerLevel) level()).getSharedSpawnPos())); return; } // Purpur
+ if (level().purpurConfig.teleportIfOutsideBorder && this instanceof ServerPlayer serverPlayer) { serverPlayer.getBukkitEntity().teleportAsync(io.papermc.paper.util.MCUtil.toLocation(level(), ((ServerLevel) level()).getSharedSpawnPos())); return; } // Purpur // ShreddedPaper - use teleportAsync
this.hurt(this.damageSources().outOfBorder(), (float) Math.max(1, Mth.floor(-d0 * d1)));
}
}

0 comments on commit c0fbbb9

Please sign in to comment.