mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
added keepinventory into extra.properties
This commit is contained in:
parent
57f8067434
commit
a39791f092
5 changed files with 9 additions and 5 deletions
|
|
@ -14,6 +14,7 @@ class Entity extends Position
|
|||
public $fallDistance = 0;
|
||||
public static $updateOnTick, $allowedAI;
|
||||
public static $allowFly = true;
|
||||
public static $keepInventory = false;
|
||||
public $canBeAttacked;
|
||||
public $moveTime, $lookTime, $idleTime, $knockbackTime = 0;
|
||||
public $attackTimeout = 0;
|
||||
|
|
@ -341,6 +342,9 @@ class Entity extends Position
|
|||
{
|
||||
if($this->class === ENTITY_PLAYER and $this->player instanceof Player and ($this->player->gamemode & 0x01) === 0){
|
||||
$inv = [];
|
||||
if(self::$keepInventory){
|
||||
return [];
|
||||
}
|
||||
for($i = 0; $i < PLAYER_SURVIVAL_SLOTS; ++ $i){
|
||||
$slot = $this->player->getSlot($i);
|
||||
$this->player->setSlot($i, BlockAPI::getItem(AIR, 0, 0));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue