Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 12:30:06 +01:00
d5f1ffc2e6
With the new chunk system it doesn't hurt too much to (temporarily) remove this until implemented in a safer manner
23 Zeilen
1.1 KiB
Diff
23 Zeilen
1.1 KiB
Diff
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
|
|
index caa0995fc4282c795783e6fa98843ce0cb594b17..bb3a4088db91f59982a9a2532ccd3001d0cba80a 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
|
|
+ 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;
|
|
}
|