mirror of
https://github.com/YatopiaMC/Yatopia.git
synced 2025-03-01 18:51:14 +01:00
* Updated Upstream and Sidestream(s) (Paper/Purpur/Origami) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 2299159bb Add option to fix items merging through blocks (#5334) d8c20ddc7 Fix PlayerBucketEmptyEvent result itemstack (#5698) ceb3762fb Add PufferFishStateChangeEvent (#5606) cd4defec0 [CI-SKIP] Update version checker to use V2 downloads API (#5728) b9f2a673d Limit item frame cursors on maps (#5730) 81a537c1f Add PlayerKickEvent causes (#5648) b7976b956 Add More Lidded Block API (#5707) Purpur Changes: b88aef3a Fix Paper#4748 - Shulkerbox allow oversized stacks 9fec1bae Updated Upstream (Paper) 2aacc766 Update Toothpick to 1.1.0-SNAPSHOT a08d7470 Configurable anvil cumulative cost (#352) Origami Changes: 3b8adab Fix importing of classes not working if their directory doesn't exist * Updated Upstream and Sidestream(s) (Paper/Tuinity/Purpur/Empirecraft/Origami) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 525d0e3d3 fix beacon activate/deactivate events (#5646) e403d6aaf [Auto] Updated Upstream (CraftBukkit) 6bcd8b57c Updated Upstream (CraftBukkit) (#5742) 501cc9448 Reset villager inventory on cancelled pickup event (#5738) 3f72a549b Exit with non-zero exit code when killed by watchdog (#5732) a8d7ad099 Updated Upstream (Bukkit/CraftBukkit) (#5735) Tuinity Changes: e9c8348 Revert entity ticking chunk map for tracker Purpur Changes: 687936be Updated Upstream (Paper) 4c2d7e56 Fix advancement triggers on entity death 49a0fb90 Fix oversized shulker box dupe e92d259e Fix raid captains not giving voluntary exile advancement a97fdc48 Config to broadcast the death message to the affected player (#363) 9bf8e165 Add burn in daylight API for LivingEntity (#331) 96460068 Fix dupe bug caused by SPIGOT-6452 2618c24f Revert "allow disabling offline mode message on an ONLINE MODE proxy" aa79fa5c allow disabling offline mode message on an ONLINE MODE proxy 830141ca Bee can work when raining or at night (#365) ae6ca468 Updated Upstream (Paper) d99cc6e8 [ci-skip] Add better issue templates (#360) Empirecraft Changes: 12009c31 Updated Paper 5305540d Updated Paper 1043bd94 Revert "Call EntityPickupItemEvent for villagers" CB commit 820b9bdf Updated Paper Origami Changes: 64fba4f Fix importing of classes not working if their directory doesn't exist 3b8adab Fix importing of classes not working if their directory doesn't exist * rebuild Patches
68 lines
3.5 KiB
Diff
68 lines
3.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: ishland <ishlandmc@yeah.net>
|
|
Date: Wed, 27 Jan 2021 20:16:47 +0800
|
|
Subject: [PATCH] Preload ProtocolLib EnumWrappers
|
|
|
|
Currently, ProtocolLib load EnumWrappers lazily and causing memory effects issues. This patch preloads EnumWrappers to prevent further NPE.
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
index 5392a9bc509008ecfcdad44189c903fd5b57285c..cda0f9bf15fead921ced0e984dc9cf80ead88286 100644
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
@@ -1092,6 +1092,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
|
// Paper end
|
|
|
|
PaperJvmChecker.checkJvm(); // Paper jvm version nag
|
|
+ if (org.yatopiamc.yatopia.server.YatopiaConfig.fixProtocolLib) org.yatopiamc.yatopia.server.util.YatopiaPreloadProtocolLib.run(); // Yatopia
|
|
com.tuinity.tuinity.config.TuinityConfig.createWorldSections = false; // Tuinity - don't let plugin created worlds fill our config
|
|
org.spigotmc.WatchdogThread.tick(); // Paper
|
|
org.spigotmc.WatchdogThread.hasStarted = true; // Paper
|
|
diff --git a/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java b/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java
|
|
index b246e6450130964cf91d0be81fbddae6598d9d8c..fce7ce0efca340cf5820cdcbe010c9fdeae7cafc 100644
|
|
--- a/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java
|
|
+++ b/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java
|
|
@@ -266,4 +266,9 @@ public class YatopiaConfig {
|
|
logPlayerLoginLoc = getBoolean("settings.log-player-login-location", logPlayerLoginLoc);
|
|
}
|
|
|
|
+ public static boolean fixProtocolLib = true;
|
|
+ private static void protocolLib() {
|
|
+ fixProtocolLib = getBoolean("settings.fix-protocollib", fixProtocolLib);
|
|
+ }
|
|
+
|
|
}
|
|
diff --git a/src/main/java/org/yatopiamc/yatopia/server/util/YatopiaPreloadProtocolLib.java b/src/main/java/org/yatopiamc/yatopia/server/util/YatopiaPreloadProtocolLib.java
|
|
new file mode 100644
|
|
index 0000000000000000000000000000000000000000..85906aa00163a4626b16190e2e48385bc5eba801
|
|
--- /dev/null
|
|
+++ b/src/main/java/org/yatopiamc/yatopia/server/util/YatopiaPreloadProtocolLib.java
|
|
@@ -0,0 +1,28 @@
|
|
+package org.yatopiamc.yatopia.server.util;
|
|
+
|
|
+import net.minecraft.server.MinecraftServer;
|
|
+import org.bukkit.Bukkit;
|
|
+import org.bukkit.plugin.Plugin;
|
|
+import org.bukkit.plugin.SimplePluginManager;
|
|
+
|
|
+import java.lang.reflect.Method;
|
|
+
|
|
+public class YatopiaPreloadProtocolLib {
|
|
+
|
|
+ public synchronized static void run() {
|
|
+ try {
|
|
+ final SimplePluginManager pluginManager = (SimplePluginManager) Bukkit.getPluginManager();
|
|
+ final Plugin protocolLib = pluginManager.getPlugin("ProtocolLib");
|
|
+ if(protocolLib != null && protocolLib.isEnabled()) {
|
|
+ MinecraftServer.LOGGER.info("Yatopia: Attempting to fix ProtocolLib");
|
|
+ final Method initialize = Class.forName("com.comphenix.protocol.wrappers.EnumWrappers", true, protocolLib.getClass().getClassLoader()).getDeclaredMethod("initialize");
|
|
+ initialize.setAccessible(true);
|
|
+ initialize.invoke(null);
|
|
+ synchronized (YatopiaPreloadProtocolLib.class) {
|
|
+ }
|
|
+ }
|
|
+ } catch (Throwable t) {
|
|
+ MinecraftServer.LOGGER.warn("Unable to fix ProtocolLib", t);
|
|
+ }
|
|
+ }
|
|
+}
|