geforkt von Mirrors/Paper
046466f3ba
* Re-arrange most chunk system patches to front Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
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 0960e5ecc25fad3eb46a871c2749dd176b812460..a6bd94ed379ef1ab0ffe71183aef3cf3061fd092 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
|
@@ -254,6 +254,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;
|
|
}
|