add back optimizing hopper searches (#5839)
This commit is contained in:
parent
a0056c36f1
commit
3846367c2d
333 changed files with 147 additions and 132 deletions
22
patches/server/0653-Added-PlayerDeepSleepEvent.patch
Normal file
22
patches/server/0653-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 c0b18656637cdc1ee6938c70aa281a71551e75dd..20b286fc905fa77f0d862305b73f3f74f73cfccd 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