2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
|
|
Date: Wed, 21 Apr 2021 15:58:19 -0700
|
|
|
|
Subject: [PATCH] Added 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
|
2023-02-07 16:55:53 +01:00
|
|
|
index 95d354bbe1e54893b3a39dae9a6414564c322fbb..f480718d3f86094f839b7dffe30871982717569e 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
2022-12-07 21:16:54 +01:00
|
|
|
@@ -248,6 +248,11 @@ public abstract class Player extends LivingEntity {
|
2021-06-11 14:02:28 +02:00
|
|
|
|
|
|
|
if (this.isSleeping()) {
|
|
|
|
++this.sleepCounter;
|
|
|
|
+ // Paper start
|
|
|
|
+ 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
|
|
|
|
if (this.sleepCounter > 100) {
|
|
|
|
this.sleepCounter = 100;
|
|
|
|
}
|