mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 09:57:43 +01:00
Dont flip shits when javascript script engine isn't available
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
From 36589593a6ae2b75e7a175cefcc5e0ff3be9c07b Mon Sep 17 00:00:00 2001
|
||||
From 31579dc05bedfcaa549efc5c7c89dc5edf69c713 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 30 Nov 2019 03:30:17 -0600
|
||||
Subject: [PATCH] Add sleep options
|
||||
@@ -9,7 +9,7 @@ Subject: [PATCH] Add sleep options
|
||||
2 files changed, 21 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
index 9d26bd1e4c..12e5ff43f9 100644
|
||||
index 9d26bd1e4c..36582a80af 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
@@ -143,6 +143,21 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
@@ -24,7 +24,7 @@ index 9d26bd1e4c..12e5ff43f9 100644
|
||||
+ try {
|
||||
+ scriptEngine.eval("time = " + world.getDayTime());
|
||||
+ return !(Boolean) scriptEngine.eval(world.purpurConfig.playerSleepCondition);
|
||||
+ } catch (javax.script.ScriptException ignore) {
|
||||
+ } catch (Exception ignore) {
|
||||
+ }
|
||||
+ }
|
||||
+ return world.isDay();
|
||||
|
||||
Reference in New Issue
Block a user