mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-07 16:26:13 +00:00
Random Changes
This commit is contained in:
@@ -6,8 +6,6 @@ import cloud.commandframework.arguments.standard.EnumArgument;
|
||||
import cloud.commandframework.arguments.standard.LongArgument;
|
||||
import cloud.commandframework.context.CommandContext;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.dfsek.terra.addons.manifest.api.MonadAddonInitializer;
|
||||
import com.dfsek.terra.addons.manifest.api.monad.Do;
|
||||
import com.dfsek.terra.addons.manifest.api.monad.Get;
|
||||
@@ -27,6 +25,8 @@ import com.dfsek.terra.api.util.Rotation;
|
||||
import com.dfsek.terra.api.util.function.monad.Monad;
|
||||
import com.dfsek.terra.api.util.reflection.TypeKey;
|
||||
|
||||
import java.util.random.RandomGenerator;
|
||||
import java.util.random.RandomGeneratorFactory;
|
||||
|
||||
public class StructureCommandAddon implements MonadAddonInitializer {
|
||||
private static Registry<Structure> getStructureRegistry(CommandContext<CommandSender> sender) {
|
||||
@@ -57,9 +57,13 @@ public class StructureCommandAddon implements MonadAddonInitializer {
|
||||
structure.generate(
|
||||
sender.position().toInt(),
|
||||
sender.world(),
|
||||
((Long) context.get("seed") == 0) ? new Random() : new Random(context.get("seed")),
|
||||
context.get("rotation")
|
||||
);
|
||||
((Long) context.get("seed") == 0)
|
||||
? RandomGeneratorFactory.<RandomGenerator.SplittableGenerator>of("Xoroshiro128PlusPlus")
|
||||
.create()
|
||||
: RandomGeneratorFactory.<RandomGenerator.SplittableGenerator>of("Xoroshiro128PlusPlus")
|
||||
.create(context.get("seed")),
|
||||
context.get("rotation")
|
||||
);
|
||||
})
|
||||
.permission("terra.structures.generate")
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user