mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 18:07:43 +01:00
Dont flip shits when javascript script engine isn't available
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
From 28e2152ff57c891c2736b59121f6ba15471a4b5a Mon Sep 17 00:00:00 2001
|
||||
From 8744eed26c1d415e410c070f23fda74b0a9fa902 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 26 Dec 2019 22:08:37 -0600
|
||||
Subject: [PATCH] Add player death exp control options
|
||||
@@ -9,7 +9,7 @@ Subject: [PATCH] Add player death exp control options
|
||||
2 files changed, 16 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
index 12e5ff43f9..427a32cdd7 100644
|
||||
index 12e5ff43f9..5ffd2a2f51 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
@@ -1862,9 +1862,18 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
@@ -26,7 +26,7 @@ index 12e5ff43f9..427a32cdd7 100644
|
||||
+ scriptEngine.eval("expTotal = " + expTotal);
|
||||
+ scriptEngine.eval("exp = " + exp);
|
||||
+ toDrop = (int) Math.round((Double) scriptEngine.eval(world.purpurConfig.playerDeathExpDropEquation));
|
||||
+ } catch (javax.script.ScriptException ignore) {
|
||||
+ } catch (Exception ignore) {
|
||||
+ toDrop = expLevel * 7;
|
||||
+ }
|
||||
+ return Math.min(toDrop, world.purpurConfig.playerDeathExpDropMax);
|
||||
|
||||
Reference in New Issue
Block a user