add back optimizing ServerLevel chunk checking methods
This commit is contained in:
parent
309b99b12f
commit
9f8876e92f
267 changed files with 150 additions and 147 deletions
22
patches/server/0664-Added-PlayerDeepSleepEvent.patch
Normal file
22
patches/server/0664-Added-PlayerDeepSleepEvent.patch
Normal file
|
@ -0,0 +1,22 @@
|
|||
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 183b621cbf6fbe7cec144af69fd74461b2471142..d286d88a3c3f93dbfa92de9421e320c92cd96350 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -247,6 +247,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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue