diff options
author | Walker Selby <git@walkerselby.com> | 2022-10-19 03:52:00 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-19 12:52:00 +0200 |
commit | 744e2268e5debc773114579d118069cbc8aa288d (patch) | |
tree | a2423114c8ce65477f6958afeb5e15b2dc7f7fab | |
parent | 04f8a44c150ab46997bbde53b8a4cf65aaa39327 (diff) | |
download | NotEnoughUpdates-744e2268e5debc773114579d118069cbc8aa288d.tar.gz NotEnoughUpdates-744e2268e5debc773114579d118069cbc8aa288d.tar.bz2 NotEnoughUpdates-744e2268e5debc773114579d118069cbc8aa288d.zip |
Update DevTestCommand developer check (#351)
* Update DevTestCommand.java
Update DEV_TESTERS to be UUID based rather than string literals of usernames.
Update logic to check for UUIDs rather than usernames.
* Add Detection for developer environment
Add a check for if they are using a deobfuscatedEnvironment, which would allow them to use the dev commands. Thanks @romangraef
Co-Authored-By: Roman / Linnea Gräf <roman.graef@gmail.com>
* Update DevTestCommand.java
* Revert Last Change
* Add egirlefe per request
* Add efefury per request
Co-authored-by: Roman / Linnea Gräf <roman.graef@gmail.com>
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java index 972557c8..c4c8a408 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java @@ -34,6 +34,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; +import net.minecraft.launchwrapper.Launch; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; @@ -48,18 +49,20 @@ public class DevTestCommand extends ClientCommandBase { private static final List<String> DEV_TESTERS = Arrays.asList( - "moulberry", - "lucycoconut", - "ironm00n", - "ariyio", - "throwpo", - "lrg89", - "dediamondpro", - "lulonaut", - "craftyoldminer", - "eisengolem", - "whalker", - "ascynx" + "d0e05de7-6067-454d-beae-c6d19d886191", // moulberry + "66502b40-6ac1-4d33-950d-3df110297aab", // lucycoconut + "a5761ff3-c710-4cab-b4f4-3e7f017a8dbf", // ironm00n + "5d5c548a-790c-4fc8-bd8f-d25b04857f44", // ariyio + "53924f1a-87e6-4709-8e53-f1c7d13dc239", // throwpo + "d3cb85e2-3075-48a1-b213-a9bfb62360c1", // lrg89 + "0b4d470f-f2fb-4874-9334-1eaef8ba4804", // dediamondpro + "ebb28704-ed85-43a6-9e24-2fe9883df9c2", // lulonaut + "698e199d-6bd1-4b10-ab0c-52fedd1460dc", // craftyoldminer + "8a9f1841-48e9-48ed-b14f-76a124e6c9df", // eisengolem + "a7d6b3f1-8425-48e5-8acc-9a38ab9b86f7", // whalker + "0ce87d5a-fa5f-4619-ae78-872d9c5e07fe", // ascynx + "a049a538-4dd8-43f8-87d5-03f09d48b4dc", // egirlefe + "7a9dc802-d401-4d7d-93c0-8dd1bc98c70d" // efefury ); private static final String[] DEV_FAIL_STRINGS = { @@ -88,7 +91,8 @@ public class DevTestCommand extends ClientCommandBase { @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { - if (!DEV_TESTERS.contains(Minecraft.getMinecraft().thePlayer.getName().toLowerCase())) { + if (!DEV_TESTERS.contains(Minecraft.getMinecraft().thePlayer.getUniqueID().toString()) + && !(boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment")) { if (devFailIndex >= DEV_FAIL_STRINGS.length) { throw new Error("L") { @Override |