From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Apehum Date: Thu, 16 Dec 2021 04:23:40 +0800 Subject: [PATCH] Matter: Secure Seed command Original license: GPLv3 Original project: https://github.com/plasmoapp/matter diff --git a/net/minecraft/server/commands/SeedCommand.java b/net/minecraft/server/commands/SeedCommand.java index 7c1e18d8362be5ae885c32b05e98b9ef45942d93..e54ed64059956555767c0c01057a8319e671b1d2 100644 --- a/net/minecraft/server/commands/SeedCommand.java +++ b/net/minecraft/server/commands/SeedCommand.java @@ -12,6 +12,15 @@ public class SeedCommand { long seed = commandContext.getSource().getLevel().getSeed(); Component component = ComponentUtils.copyOnClickText(String.valueOf(seed)); commandContext.getSource().sendSuccess(() -> Component.translatable("commands.seed.success", component), false); + // Leaf start - Matter - Secure Seed command + if (org.dreeam.leaf.config.modules.misc.SecureSeed.enabled) { + su.plo.matter.Globals.setupGlobals(commandContext.getSource().getLevel()); + String seedStr = su.plo.matter.Globals.seedToString(su.plo.matter.Globals.worldSeed); + Component featureSeedComponent = ComponentUtils.copyOnClickText(seedStr); + + commandContext.getSource().sendSuccess(() -> Component.translatable(("Feature seed: %s"), featureSeedComponent), false); + } + // Leaf end - Matter - Secure Seed command return (int)seed; })); }