2021-06-11 12:02:28 +00: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
|
2022-01-01 03:05:42 +00:00
|
|
|
index af0ff22ab9fde658b10604f08d29c28071a9fd06..ec44db1e6a6c92d8aff241b5f9acf743d3088fea 100644
|
2021-06-11 12:02:28 +00:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
2021-11-24 20:43:28 +00:00
|
|
|
@@ -245,6 +245,11 @@ public abstract class Player extends LivingEntity {
|
2021-06-11 12:02:28 +00: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;
|
|
|
|
}
|