add server base seed
This commit is contained in:
parent
b01b602728
commit
252c157cf0
3 changed files with 4 additions and 2 deletions
|
@ -461,6 +461,8 @@ public abstract class Config {
|
||||||
|
|
||||||
@Var(name = "password", nonDefault = true)
|
@Var(name = "password", nonDefault = true)
|
||||||
public static String password = "";
|
public static String password = "";
|
||||||
|
@Var(name = "baseSeed", nonDefault = true)
|
||||||
|
public static String seed = "";
|
||||||
|
|
||||||
static {
|
static {
|
||||||
for(Field field : Config.class.getDeclaredFields()) {
|
for(Field field : Config.class.getDeclaredFields()) {
|
||||||
|
|
|
@ -11,7 +11,6 @@ import java.io.FileInputStream;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
@ -21,7 +20,6 @@ import common.collect.Maps;
|
||||||
import common.util.Util;
|
import common.util.Util;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.zip.GZIPInputStream;
|
import java.util.zip.GZIPInputStream;
|
||||||
import java.util.zip.GZIPOutputStream;
|
import java.util.zip.GZIPOutputStream;
|
||||||
|
|
||||||
|
|
|
@ -293,6 +293,8 @@ public final class WorldServer extends AWorldServer {
|
||||||
this.chunkDir = new File(new File("chunk"), dim.getDimensionName());
|
this.chunkDir = new File(new File("chunk"), dim.getDimensionName());
|
||||||
if(!debug) {
|
if(!debug) {
|
||||||
this.chunkDir.mkdirs();
|
this.chunkDir.mkdirs();
|
||||||
|
if(!Config.seed.isEmpty())
|
||||||
|
this.rand.setSeed((long)Config.seed.hashCode() ^ ~((long)dim.getDimensionName().hashCode()));
|
||||||
this.seed = this.rand.longv();
|
this.seed = this.rand.longv();
|
||||||
this.dimension.setSeed(this.seed);
|
this.dimension.setSeed(this.seed);
|
||||||
TagObject tag = null;
|
TagObject tag = null;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue