Compare commits
6 Commits
1.20.2-703
...
1.20.2-712
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc6d7e9ca4 | ||
|
|
ea1df79c5d | ||
|
|
6f659aec21 | ||
|
|
5e5c48dab1 | ||
|
|
1b8acda958 | ||
|
|
bad67403c4 |
@@ -109,10 +109,10 @@ index 0000000000000000000000000000000000000000..3f74f748501d2f915869e9077dd2f220
|
||||
+}
|
||||
diff --git a/src/main/java/me/earthme/luminol/functions/GlobalServerTpsBar.java b/src/main/java/me/earthme/luminol/functions/GlobalServerTpsBar.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..98505b8ba09b93534eaa1b400d0c244ecb66e0ea
|
||||
index 0000000000000000000000000000000000000000..3023bc0e7420870e80dda75f7b044069b61a2b7e
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/me/earthme/luminol/functions/GlobalServerTpsBar.java
|
||||
@@ -0,0 +1,206 @@
|
||||
@@ -0,0 +1,204 @@
|
||||
+package me.earthme.luminol.functions;
|
||||
+
|
||||
+import com.google.common.collect.Lists;
|
||||
@@ -139,7 +139,6 @@ index 0000000000000000000000000000000000000000..98505b8ba09b93534eaa1b400d0c244e
|
||||
+public class GlobalServerTpsBar {
|
||||
+ protected static final MinecraftInternalPlugin NULL_PLUGIN = new MinecraftInternalPlugin();
|
||||
+ protected static final Map<UUID,BossBar> uuid2Bossbars = new HashMap<>();
|
||||
+ protected static final List<UUID> visibleExclude = Lists.newCopyOnWriteArrayList();
|
||||
+ protected static volatile ScheduledTask tpsbarTask = null;
|
||||
+
|
||||
+ public static void init(){
|
||||
@@ -162,16 +161,11 @@ index 0000000000000000000000000000000000000000..98505b8ba09b93534eaa1b400d0c244e
|
||||
+ }
|
||||
+
|
||||
+ public static boolean isPlayerVisible(Player player){
|
||||
+ return !visibleExclude.contains(player.getUniqueId());
|
||||
+ return ((CraftPlayer) player).getHandle().isTpsBarVisible;
|
||||
+ }
|
||||
+
|
||||
+ public static void setVisibilityForPlayer(Player target,boolean canSee){
|
||||
+ if (!canSee){
|
||||
+ visibleExclude.add(target.getUniqueId());
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ visibleExclude.remove(target.getUniqueId());
|
||||
+ ((CraftPlayer) target).getHandle().isTpsBarVisible = canSee;
|
||||
+ }
|
||||
+
|
||||
+ private static void update(){
|
||||
@@ -186,11 +180,9 @@ index 0000000000000000000000000000000000000000..98505b8ba09b93534eaa1b400d0c244e
|
||||
+ final UUID uuid = bossBarEntry.getKey();
|
||||
+ boolean shouldRemove = true;
|
||||
+
|
||||
+ for (Player player : Bukkit.getOnlinePlayers()){
|
||||
+ if (player.getUniqueId() == uuid){
|
||||
+ shouldRemove = !isPlayerVisible(player);
|
||||
+ break;
|
||||
+ }
|
||||
+ final Player target = Bukkit.getPlayer(uuid);
|
||||
+ if (target != null){
|
||||
+ shouldRemove = !isPlayerVisible(target);
|
||||
+ }
|
||||
+
|
||||
+ if (shouldRemove){
|
||||
@@ -199,7 +191,13 @@ index 0000000000000000000000000000000000000000..98505b8ba09b93534eaa1b400d0c244e
|
||||
+ }
|
||||
+
|
||||
+ for (UUID uuid : toRemove){
|
||||
+ uuid2Bossbars.remove(uuid);
|
||||
+ final BossBar removed = uuid2Bossbars.remove(uuid);
|
||||
+ if (removed != null){
|
||||
+ final Player targetPlayer = Bukkit.getPlayer(uuid);
|
||||
+ if (targetPlayer != null){
|
||||
+ targetPlayer.hideBossBar(removed);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@@ -216,7 +214,7 @@ index 0000000000000000000000000000000000000000..98505b8ba09b93534eaa1b400d0c244e
|
||||
+
|
||||
+ BossBar targetBossbar = uuid2Bossbars.get(nmsPlayer.getUUID());
|
||||
+
|
||||
+ if (targetBossbar == null && !visibleExclude.contains(nmsPlayer.getUUID()) && isPlayerVisible(apiPlayer)){
|
||||
+ if (targetBossbar == null && isPlayerVisible(apiPlayer)){
|
||||
+ targetBossbar = BossBar.bossBar(Component.text(""),0.0F, BossBar.Color.valueOf(LuminolConfig.tpsColors[3]), BossBar.Overlay.NOTCHED_20);
|
||||
+ uuid2Bossbars.put(nmsPlayer.getUUID(),targetBossbar);
|
||||
+ apiPlayer.showBossBar(targetBossbar);
|
||||
@@ -354,3 +352,41 @@ index f0bf57a7acd77eeffbeeb6743ba58166823022fd..4a1e068c27853a38db0641806626e7ac
|
||||
super.stopServer();
|
||||
//Util.shutdownExecutors(); // Paper - moved into super
|
||||
SkullBlockEntity.clear();
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 97bfb92e52c3c5ef1cd22afe2b97c204eb45025a..d7a280427442bac8cc8ccb542d24d4e0901df70a 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -278,6 +278,7 @@ public class ServerPlayer extends Player {
|
||||
// Paper start - replace player chunk loader
|
||||
private final java.util.concurrent.atomic.AtomicReference<io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances> viewDistances = new java.util.concurrent.atomic.AtomicReference<>(new io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances(-1, -1, -1));
|
||||
public io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader;
|
||||
+ public volatile boolean isTpsBarVisible = false;
|
||||
|
||||
public io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances getViewDistances() {
|
||||
return this.viewDistances.get();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 6c8f6e26687b557fcdcd65c657d8b35d3fde805e..06c92a2d3ecb3b747c2303819f72c1c41967af8c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -2216,6 +2216,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
handle.expToDrop = data.getInt("expToDrop");
|
||||
handle.keepLevel = data.getBoolean("keepLevel");
|
||||
}
|
||||
+
|
||||
+ //Luminol start - Tpsbar
|
||||
+ getHandle().isTpsBarVisible = data.getBoolean("tpsbarVisible");
|
||||
+ //Luminol end
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2237,6 +2241,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
data.putLong("lastPlayed", System.currentTimeMillis());
|
||||
data.putString("lastKnownName", handle.getScoreboardName());
|
||||
|
||||
+ //Luminol start - Tpsbar
|
||||
+ data.putBoolean("tpsbarVisible",handle.isTpsBarVisible);
|
||||
+ //Luminol end
|
||||
+
|
||||
// Paper start - persist for use in offline save data
|
||||
if (!nbttagcompound.contains("Paper")) {
|
||||
nbttagcompound.put("Paper", new CompoundTag());
|
||||
|
||||
39
patches/server/0039-Add-config-for-root-user-warning.patch
Normal file
39
patches/server/0039-Add-config-for-root-user-warning.patch
Normal file
@@ -0,0 +1,39 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: M2ke4U <79621885+MrHua269@users.noreply.github.com>
|
||||
Date: Thu, 30 Nov 2023 22:41:04 +0800
|
||||
Subject: [PATCH] Add config for root user warning
|
||||
|
||||
|
||||
diff --git a/src/main/java/me/earthme/luminol/LuminolConfig.java b/src/main/java/me/earthme/luminol/LuminolConfig.java
|
||||
index 8bf7a0235ed292d6cb3beca9b786a69148e0b4d9..7ada58f2fa83a47908723bdf1e5c5fbbc2f5ffa9 100644
|
||||
--- a/src/main/java/me/earthme/luminol/LuminolConfig.java
|
||||
+++ b/src/main/java/me/earthme/luminol/LuminolConfig.java
|
||||
@@ -33,6 +33,7 @@ public class LuminolConfig {
|
||||
public static boolean disableUsernameCheck = false;
|
||||
public static boolean disableOfflineModeWarning = false;
|
||||
public static boolean fixSpectorTeleportFolia = false;
|
||||
+ public static boolean disableRootUserWarning = false;
|
||||
|
||||
public static boolean safeTeleportation = true;
|
||||
public static boolean enableSandDuping = false;
|
||||
@@ -134,6 +135,7 @@ public class LuminolConfig {
|
||||
disableUsernameCheck = get("misc.disable_username_check",disableUsernameCheck,"Disable username check that can accept usernames with other characters(such as Chinese).Not recommended to use");
|
||||
fixSpectorTeleportFolia = get("misc.fix_folia_spector_teleport",fixSpectorTeleportFolia);
|
||||
disableOfflineModeWarning = get("misc.disable_offline_mode_warning",disableOfflineModeWarning);
|
||||
+ disableRootUserWarning = get("misc.disable_root_user_warning",disableRootUserWarning);
|
||||
|
||||
if (tpsbarEnabled){
|
||||
initTpsbar();
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 4cc62104942e58ededd5c838f4bd5c4db0d574d4..964777e992974dc02ee106ec47efd2e04f3b76c3 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -178,7 +178,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
}
|
||||
|
||||
// Paper start - detect running as root
|
||||
- if (io.papermc.paper.util.ServerEnvironment.userIsRootOrAdmin()) {
|
||||
+ if (io.papermc.paper.util.ServerEnvironment.userIsRootOrAdmin() && !LuminolConfig.disableRootUserWarning) { //Luminol - Add config for root user warning
|
||||
DedicatedServer.LOGGER.warn("****************************");
|
||||
DedicatedServer.LOGGER.warn("YOU ARE RUNNING THIS SERVER AS AN ADMINISTRATIVE OR ROOT USER. THIS IS NOT ADVISED.");
|
||||
DedicatedServer.LOGGER.warn("YOU ARE OPENING YOURSELF UP TO POTENTIAL RISKS WHEN DOING THIS.");
|
||||
1316
patches/server/0040-Kaiiju-Async-path-processing.patch
Normal file
1316
patches/server/0040-Kaiiju-Async-path-processing.patch
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user