diff options
Diffstat (limited to 'patches/server/0544-Add-PlayerDeepSleepEvent.patch')
-rw-r--r-- | patches/server/0544-Add-PlayerDeepSleepEvent.patch | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/patches/server/0544-Add-PlayerDeepSleepEvent.patch b/patches/server/0544-Add-PlayerDeepSleepEvent.patch index 2ab7a9763f..fe75f0e3c2 100644 --- a/patches/server/0544-Add-PlayerDeepSleepEvent.patch +++ b/patches/server/0544-Add-PlayerDeepSleepEvent.patch @@ -5,16 +5,18 @@ Subject: [PATCH] Add PlayerDeepSleepEvent 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 10caa677309c5a8191830c98597468079e784459..caa71993f3ee344151a3e053ba527b868c13251b 100644 +index 10caa677309c5a8191830c98597468079e784459..f47874dc9270d177aa7c39266e36713d0c934640 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -246,6 +246,11 @@ public abstract class Player extends LivingEntity { +@@ -246,6 +246,13 @@ public abstract class Player extends LivingEntity { if (this.isSleeping()) { ++this.sleepCounter; + // Paper start - Add PlayerDeepSleepEvent -+ if (this.sleepCounter == 100) { -+ if (!new io.papermc.paper.event.player.PlayerDeepSleepEvent((org.bukkit.entity.Player) getBukkitEntity()).callEvent()) { this.sleepCounter = Integer.MIN_VALUE; } ++ if (this.sleepCounter == SLEEP_DURATION) { ++ if (!new io.papermc.paper.event.player.PlayerDeepSleepEvent((org.bukkit.entity.Player) getBukkitEntity()).callEvent()) { ++ this.sleepCounter = Integer.MIN_VALUE; ++ } + } + // Paper end - Add PlayerDeepSleepEvent if (this.sleepCounter > 100) { |