mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Implemented Java String.hashCode() for level seed
This commit is contained in:
parent
cbf0cfde1b
commit
adbf56d754
3 changed files with 137 additions and 0 deletions
|
|
@ -241,6 +241,16 @@ class ServerAPI extends stdClass{ //Yay! I can add anything to this class in run
|
|||
$v = (int) $v;
|
||||
break;
|
||||
case "seed":
|
||||
$v = trim($v);
|
||||
if($v == "false"){
|
||||
$v = false;
|
||||
}elseif(preg_match("/[^0-9\-]/", $v) > 0){
|
||||
$str = new Java_String($v);
|
||||
$v = $str->hashCode();
|
||||
}else{
|
||||
$v = (int) $v;
|
||||
}
|
||||
break;
|
||||
case "server-id":
|
||||
$v = trim($v);
|
||||
$v = $v == "false" ? false:(preg_match("/[^0-9\-]/", $v) > 0 ? Utils::readInt(substr(md5($v, true), 0, 4)):$v);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue