Skip to content

Commit

Permalink
Add back Secure Seed
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreeam-qwq committed Jul 19, 2024
1 parent b432368 commit 8aa8b7d
Show file tree
Hide file tree
Showing 19 changed files with 169 additions and 322 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,23 @@ Original license: GPLv3
Original project: https://github.com/plasmoapp/matter

diff --git a/src/main/java/net/minecraft/server/commands/SeedCommand.java b/src/main/java/net/minecraft/server/commands/SeedCommand.java
index 0b500b19a99fa6c2740c0db350a166462668df9c..e0516ed524fe55277adb3e2c4571ca40c334c5ef 100644
index 0b500b19a99fa6c2740c0db350a166462668df9c..a34f06460ac8eb2ee05cd0e6facc3f08418aff70 100644
--- a/src/main/java/net/minecraft/server/commands/SeedCommand.java
+++ b/src/main/java/net/minecraft/server/commands/SeedCommand.java
@@ -6,12 +6,27 @@ import net.minecraft.commands.Commands;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.ComponentUtils;

+// Leaf start - Matter - Feature Secure Seed
+import su.plo.matter.Globals;
+// Leaf end - Matter
+
public class SeedCommand {
public static void register(CommandDispatcher<CommandSourceStack> dispatcher, boolean dedicated) {
dispatcher.register(Commands.literal("seed").requires(source -> !dedicated || source.hasPermission(2)).executes(context -> {
@@ -12,6 +12,17 @@ public class SeedCommand {
long l = context.getSource().getLevel().getSeed();
Component component = ComponentUtils.copyOnClickText(String.valueOf(l));
context.getSource().sendSuccess(() -> Component.translatable("commands.seed.success", component), false);
+
+ // Leaf start - Matter - SecureSeed Command
+ if (org.dreeam.leaf.config.modules.misc.SecureSeed.enabled) {
+ Globals.setupGlobals(context.getSource().getLevel());
+ String seedStr = Globals.seedToString(Globals.worldSeed);
+ su.plo.matter.Globals.setupGlobals(context.getSource().getLevel());
+ String seedStr = su.plo.matter.Globals.seedToString(su.plo.matter.Globals.worldSeed);
+ Component featureSeedComponent = ComponentUtils.copyOnClickText(seedStr);
+
+ context.getSource().sendSuccess(() -> Component.translatable(("Feature seed: %s"), featureSeedComponent), false);
+ }
+ // Leaf end - Matter
+ // Leaf end - Matter - SecureSeed Command
+
return (int)l;
}));
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 8aa8b7d

Please sign in to comment.