Add a special case for floodgate and offline uuids

floodgate spoofs uuids, but plugins such as luckperms get the uuid that the server uses, causing problems
if this option is configured properly, such things won't happen
This commit is contained in:
Ivan Pekov 2020-12-29 08:52:57 +02:00
parent 58e66daeb4
commit 011dd344e4
No known key found for this signature in database
GPG Key ID: BC975C392D9CA3A3
2 changed files with 30 additions and 0 deletions

View File

@ -18,6 +18,7 @@ This is an overview over all patches that are currently used.
| server | Add NBT API as a first-class lib | tr7zw | |
| api | Add StructureLocateEvent | dfsek | |
| server | Add StructureLocateEvent | dfsek | |
| server | Add a special case for floodgate and offline uuids | Ivan Pekov | |
| server | Add component util | William Blake Galbreath | |
| api | Add last tick time API | Ivan Pekov | tr7zw |
| server | Add last tick time API | Ivan Pekov | tr7zw |

View File

@ -0,0 +1,29 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ivan Pekov <ivan@mrivanplays.com>
Date: Tue, 29 Dec 2020 08:47:43 +0200
Subject: [PATCH] Add a special case for floodgate and offline uuids
floodgate spoofs uuids, but plugins such as luckperms get the uuid that the server uses, causing problems
if this option is configured properly, such things won't happen
diff --git a/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java b/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java
index 2d4fb0a4664578f8d5c23db854eb8f2764724940..00c600d74ba84cb564b9b22f53f279a93839d71f 100644
--- a/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java
+++ b/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java
@@ -225,7 +225,16 @@ public class YatopiaConfig {
fixFallDistance = getBoolean("settings.fixFallDistance", false);
}
+ public static boolean usingFloodgate = false;
+ private static void usingFloodgate() {
+ usingFloodgate = getBoolean("settings.using-floodgate", false);
+ }
+
public static boolean shouldUseOfflineUUID() {
+ if (usingFloodgate) {
+ // never cuz floodgate spoofs an uuid
+ return false;
+ }
if (org.spigotmc.SpigotConfig.bungee && com.destroystokyo.paper.PaperConfig.bungeeOnlineMode) {
return false;
}