mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 14:35:35 +00:00
Added hardcore mode
This commit is contained in:
parent
2f05a03e51
commit
6e2f7af6b4
@ -74,6 +74,7 @@ class ServerAPI{
|
|||||||
"allow-flight" => false,
|
"allow-flight" => false,
|
||||||
"item-enforcement" => false,
|
"item-enforcement" => false,
|
||||||
"gamemode" => SURVIVAL,
|
"gamemode" => SURVIVAL,
|
||||||
|
"hardcore" => false,
|
||||||
"pvp" => true,
|
"pvp" => true,
|
||||||
"difficulty" => 1,
|
"difficulty" => 1,
|
||||||
"generator" => "",
|
"generator" => "",
|
||||||
|
@ -69,7 +69,7 @@ class Query{
|
|||||||
$KVdata = array(
|
$KVdata = array(
|
||||||
"splitnum" => chr(128),
|
"splitnum" => chr(128),
|
||||||
"hostname" => $this->server->name,
|
"hostname" => $this->server->name,
|
||||||
"gametype" => "SMP",
|
"gametype" => ($this->server->gamemode & 0x01) === 0 ? "SMP":"CMP",
|
||||||
"game_id" => "MINECRAFTPE",
|
"game_id" => "MINECRAFTPE",
|
||||||
"version" => CURRENT_MINECRAFT_VERSION,
|
"version" => CURRENT_MINECRAFT_VERSION,
|
||||||
"plugins" => $plist,
|
"plugins" => $plist,
|
||||||
@ -127,7 +127,7 @@ class Query{
|
|||||||
}
|
}
|
||||||
$this->server->send(0, chr(0).Utils::writeInt($sessionID).$this->longData, true, $packet["ip"], $packet["port"]);
|
$this->server->send(0, chr(0).Utils::writeInt($sessionID).$this->longData, true, $packet["ip"], $packet["port"]);
|
||||||
}else{
|
}else{
|
||||||
$this->server->send(0, chr(0).Utils::writeInt($sessionID).$this->server->name."\x00SMP\x00".$this->server->api->level->getDefault()->getName()."\x00".count($this->server->clients)."\x00".$this->server->maxClients."\x00".Utils::writeLShort($this->server->api->getProperty("server-port")).$this->server->api->getProperty("server-ip", "0.0.0.0")."\x00", true, $packet["ip"], $packet["port"]);
|
$this->server->send(0, chr(0).Utils::writeInt($sessionID).$this->server->name."\x00".(($this->server->gamemode & 0x01) === 0 ? "SMP":"CMP")."\x00".$this->server->api->level->getDefault()->getName()."\x00".count($this->server->clients)."\x00".$this->server->maxClients."\x00".Utils::writeLShort($this->server->api->getProperty("server-port")).$this->server->api->getProperty("server-ip", "0.0.0.0")."\x00", true, $packet["ip"], $packet["port"]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -797,6 +797,9 @@ class Entity extends Position{
|
|||||||
if($this->player instanceof Player){
|
if($this->player instanceof Player){
|
||||||
$this->player->blocked = true;
|
$this->player->blocked = true;
|
||||||
$this->server->api->dhandle("player.death", array("player" => $this->player, "cause" => $cause));
|
$this->server->api->dhandle("player.death", array("player" => $this->player, "cause" => $cause));
|
||||||
|
if(($this->player->gamemode & 0x01) === 0 and $this->server->api->getProperty("hardcore") == 1){
|
||||||
|
$this->server->api->ban->ban($this->player->username);
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
$this->close();
|
$this->close();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user