From 8d00ef381d8d199b3dfe6c21c6f9c7af18598e74 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Wed, 29 May 2013 23:30:07 +0200 Subject: [PATCH] Fixed Hardcore flags --- src/API/ServerAPI.php | 3 +++ src/world/Entity.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/API/ServerAPI.php b/src/API/ServerAPI.php index ffc76699..5eb872e8 100644 --- a/src/API/ServerAPI.php +++ b/src/API/ServerAPI.php @@ -270,6 +270,9 @@ class ServerAPI{ } $this->config->set($n, $v); } + if($this->getProperty("hardcore") == 1 and $this->getProperty("difficulty") < 3){ + $this->setProperty("difficulty", 3); + } } public function init(){ diff --git a/src/world/Entity.php b/src/world/Entity.php index 2d424f6b..717b10fb 100644 --- a/src/world/Entity.php +++ b/src/world/Entity.php @@ -797,7 +797,7 @@ class Entity extends Position{ if($this->player instanceof Player){ $this->player->blocked = true; $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){ + if($this->server->api->getProperty("hardcore") == 1){ $this->server->api->ban->ban($this->player->username); } }else{