mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
Fixed #339 Creative players have their inventory cleared on death [gh#339]
This commit is contained in:
parent
3fa1bd3a05
commit
c37c6da42d
1 changed files with 2 additions and 3 deletions
|
|
@ -143,12 +143,11 @@ class Entity extends Position{
|
|||
}
|
||||
|
||||
public function getDrops(){
|
||||
if($this->class === ENTITY_PLAYER and ($this->player->gamemode & 0x00) === 0){
|
||||
if($this->class === ENTITY_PLAYER and ($this->player->gamemode & 0x01) === 0){
|
||||
$inv = array();
|
||||
$air = BlockAPI::getItem(AIR, 0, 0);
|
||||
for($i = 0; $i < PLAYER_SURVIVAL_SLOTS; ++$i){
|
||||
$slot = $this->player->getSlot($i);
|
||||
$this->player->setSlot($i, $air);
|
||||
$this->player->setSlot($i, BlockAPI::getItem(AIR, 0, 0));
|
||||
if($slot->getID() !== AIR and $slot->count > 0){
|
||||
$inv[] = array($slot->getID(), $slot->getMetadata(), $slot->count);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue