9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-23 17:09:26 +00:00

Update Paper

This commit is contained in:
MC_XiaoHei
2024-07-12 14:34:28 +08:00
parent eb7eadd0a0
commit 2b772e4265
118 changed files with 202 additions and 201 deletions

View File

@@ -0,0 +1,25 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
Date: Tue, 27 Feb 2024 03:27:48 -0500
Subject: [PATCH] Fix NPE during creating GUI graph
diff --git a/src/main/java/com/destroystokyo/paper/gui/RAMDetails.java b/src/main/java/com/destroystokyo/paper/gui/RAMDetails.java
index 039a86034928a5eb7aaa2d7ca76a7bddcca346bd..7bf45a85d51ea0e2c6dfa1c5f2f07f99dab0bca6 100644
--- a/src/main/java/com/destroystokyo/paper/gui/RAMDetails.java
+++ b/src/main/java/com/destroystokyo/paper/gui/RAMDetails.java
@@ -59,7 +59,13 @@ public class RAMDetails extends JList<String> {
GraphData data = RAMGraph.DATA.peekLast();
Vector<String> vector = new Vector<>();
- double[] tps = org.bukkit.Bukkit.getTPS();
+ // Leaves start - Fix potential NPE during creating GUI graph
+ double[] tps = new double[]{
+ server.tps1.getAverage(),
+ server.tps5.getAverage(),
+ server.tps15.getAverage()
+ };
+ // Leaves end
String[] tpsAvg = new String[tps.length];
for ( int g = 0; g < tps.length; g++) {