From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Wed, 21 Apr 2021 15:58:19 -0700 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 b4d1caa4c853ce4b88d53fb6f69ad437d3dcb381..d6960cfe647f7ad8c2279b30d8af8a0e11be829f 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java @@ -248,6 +248,11 @@ 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; } + } + // Paper end - Add PlayerDeepSleepEvent if (this.sleepCounter > 100) { this.sleepCounter = 100; }