Updated Upstream (Paper)

Upstream has released updates that appears to apply and compile correctly

Paper Changes:
d94d6a29 Optimise IEntityAccess#getPlayerByUUID (#2842)
4237539e Guard against serializing mismatching chunk coordinate (#2844)
c1f57657 Updated Upstream (CraftBukkit)
f5569fd3 Fix SkullMeta.setPlayerProfile() (#2833)
2f527126 Update upstream CB
4151617d Update no chunk loads for hoppers and double chests patch (#2777)
d224bc03 [CI-SKIP] Passage outdated (#2776)
db3af11c Fix race condition with regionfile being closed right after getting one (#2812)
a817508f [CI-SKIP] Update dependency version in README.md (#2817)
9aeba7c9 Prevent bees loading chunks checking hive position (#2828)
This commit is contained in:
William Blake Galbreath
2020-01-12 05:02:57 -06:00
parent f0b888053b
commit 7760fa6dfb
18 changed files with 120 additions and 183 deletions

View File

@@ -0,0 +1,57 @@
From 78814b9dd98e6a67af2e12a03e4934545c92c071 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
---
.../java/net/minecraft/server/EntityHuman.java | 15 ++++++++++++---
.../java/net/pl3x/purpur/PurpurWorldConfig.java | 7 +++++++
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index 3957daf751..15e342454c 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -1858,9 +1858,18 @@ public abstract class EntityHuman extends EntityLiving {
@Override
protected int getExpValue(EntityHuman entityhuman) {
if (!this.world.getGameRules().getBoolean(GameRules.KEEP_INVENTORY) && !this.isSpectator()) {
- int i = this.expLevel * 7;
-
- return i > 100 ? 100 : i;
+ // Purpur start
+ int toDrop;
+ try {
+ scriptEngine.eval("expLevel = " + expLevel);
+ scriptEngine.eval("expTotal = " + expTotal);
+ scriptEngine.eval("exp = " + exp);
+ toDrop = (int) Math.round((Double) scriptEngine.eval(world.purpurConfig.playerDeathExpDropEquation));
+ } catch (ScriptException ignore) {
+ toDrop = expLevel * 7;
+ }
+ return Math.min(toDrop, world.purpurConfig.playerDeathExpDropMax);
+ // Purpur end
} else {
return 0;
}
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 060eac7121..8bde402422 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -167,6 +167,13 @@ public class PurpurWorldConfig {
elytraDamagePerTridentBoost = getInt("elytra.damage-per-boost.trident", elytraDamagePerTridentBoost);
}
+ public String playerDeathExpDropEquation = "expLevel * 7";
+ public int playerDeathExpDropMax = 100;
+ private void playerSettings() {
+ playerDeathExpDropEquation = getString("player.exp-dropped-on-death.equation", playerDeathExpDropEquation);
+ playerDeathExpDropMax = getInt("player.exp-dropped-on-death.maximum", playerDeathExpDropMax);
+ }
+
public boolean idleTimeoutKick = true;
public boolean idleTimeoutTickNearbyEntities = false;
public boolean idleTimeoutCountAsSleeping = false;
--
2.24.0