From fe67553bd8378a88f33989c7b8b899560f7c4726 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Fri, 11 Mar 2022 00:12:40 +1300 Subject: [PATCH] Fixes #637, can now turn off random UUIDs --- .../java/me/libraryaddict/disguise/DisguiseConfig.java | 4 ++++ .../me/libraryaddict/disguise/disguisetypes/Disguise.java | 4 ++++ plugin/src/main/resources/configs/sanity.yml | 7 ++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/plugin/src/main/java/me/libraryaddict/disguise/DisguiseConfig.java b/plugin/src/main/java/me/libraryaddict/disguise/DisguiseConfig.java index d764daf9..fc5ae16d 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/DisguiseConfig.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/DisguiseConfig.java @@ -278,6 +278,9 @@ public class DisguiseConfig { @Getter @Setter private static String data; + @Getter + @Setter + private static boolean randomUUIDS; public static boolean isArmorstandsName() { return getPlayerNameType() == PlayerNameType.ARMORSTANDS; @@ -646,6 +649,7 @@ public class DisguiseConfig { setViewSelfDisguisesDefault(config.getBoolean("ViewSelfDisguisesDefault")); setContactMojangServers(config.getBoolean("ContactMojangServers")); setDisguiseRadiusMax(config.getInt("DisguiseRadiusMax")); + setRandomUUIDS(config.getBoolean("RandomUUIDs")); String apiKey = config.getString("MineSkinAPIKey"); if (apiKey != null && apiKey.matches("[a-zA-Z0-9]{8,}")) { diff --git a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java index 691d82a6..cadcb0d7 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java @@ -118,6 +118,10 @@ public abstract class Disguise { } public UUID getUUID() { + if (!isPlayerDisguise() && !DisguiseConfig.isRandomUUIDS() && getEntity() != null) { + return getEntity().getUniqueId(); + } + // Partial fix for disguises serialized in older versions if (this.uuid == null) { this.uuid = ReflectionManager.getRandomUUID(); diff --git a/plugin/src/main/resources/configs/sanity.yml b/plugin/src/main/resources/configs/sanity.yml index 12dfe20f..602d4b8c 100644 --- a/plugin/src/main/resources/configs/sanity.yml +++ b/plugin/src/main/resources/configs/sanity.yml @@ -38,4 +38,9 @@ CarpetableLlama: false # Can a player interact with a non-saddled horse of any type, to give it a saddle? # This does not change what you can ride or control! -SaddleableHorse: false \ No newline at end of file +SaddleableHorse: false + +# You shouldn't need to touch this, but if you do; This was added so scoreboard stuff that affects a certain UUID, will still continue to affect that UUID +# This doesn't affect player disguises as those would be severely impacted +# If you are getting issues using this, please do not report them. You disable this at your own risk. +RandomUUIDs: true \ No newline at end of file