mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
mob bodies should drop
This commit is contained in:
parent
157f794c7f
commit
0aaa0e70df
4 changed files with 12 additions and 15 deletions
|
|
@ -1457,12 +1457,8 @@ class Entity extends Position
|
|||
}else{
|
||||
$pk = new EntityEventPacket;
|
||||
$pk->eid = $this->eid;
|
||||
$pk->event = 3;
|
||||
$pk->event = EntityEventPacket::ENTITY_DEAD;
|
||||
$this->server->api->player->broadcastPacket($this->level->players, $pk);
|
||||
$this->server->api->dhandle("entity.event", [
|
||||
"entity" => $this,
|
||||
"event" => 3
|
||||
]); // Entity dead
|
||||
}
|
||||
if($this->player instanceof Player){
|
||||
$this->player->blocked = true;
|
||||
|
|
@ -1474,7 +1470,7 @@ class Entity extends Position
|
|||
$this->server->api->ban->ban($this->player->username);
|
||||
}
|
||||
} else{
|
||||
$this->close();
|
||||
$this->server->api->schedule(40, [$this, "close"], []);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class Sheep extends Animal{
|
|||
}
|
||||
$pk = new EntityEventPacket;
|
||||
$pk->eid = $this->eid;
|
||||
$pk->event = 10;
|
||||
$pk->event = EntityEventPacket::ENTITY_ANIM_10;
|
||||
$this->server->api->player->broadcastPacket($this->level->players, $pk);
|
||||
$this->server->schedule(38, [$this, "setSheared"], false);
|
||||
$this->level->setblock(new Position($this->x, $this->y-1, $this->z, $this->level), new DirtBlock());
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@ class EntityEventPacket extends RakNetDataPacket{
|
|||
public $event;
|
||||
|
||||
const ENTITY_DAMAGE = 2;
|
||||
|
||||
const ENTITY_DEAD = 3;
|
||||
const ENTITY_ANIM_10 = 10;
|
||||
public function pid(){
|
||||
return ProtocolInfo::ENTITY_EVENT_PACKET;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,13 +86,13 @@ class LevelImport{
|
|||
}
|
||||
$chunks->map = null;
|
||||
$chunks = null;
|
||||
if(file_exists$this->path . "level.dat") @unlink($this->path . "level.dat");
|
||||
if(file_exists$this->path . "level.dat_old") @unlink($this->path . "level.dat_old");
|
||||
if(file_exists$this->path . "player.dat") @unlink($this->path . "player.dat");
|
||||
if(file_exists$this->path . "entities.dat") @unlink($this->path . "entities.dat");
|
||||
if(file_exists$this->path . "chunks.dat") @unlink($this->path . "chunks.dat");
|
||||
if(file_exists$this->path . "chunks.dat.gz") @unlink($this->path . "chunks.dat.gz");
|
||||
if(file_exists$this->path . "tiles.dat") @unlink($this->path . "tiles.dat");
|
||||
if(file_exists($this->path . "level.dat")) @unlink($this->path . "level.dat");
|
||||
if(file_exists($this->path . "level.dat_old")) @unlink($this->path . "level.dat_old");
|
||||
if(file_exists($this->path . "player.dat")) @unlink($this->path . "player.dat");
|
||||
if(file_exists($this->path . "entities.dat")) @unlink($this->path . "entities.dat");
|
||||
if(file_exists($this->path . "chunks.dat")) @unlink($this->path . "chunks.dat");
|
||||
if(file_exists($this->path . "chunks.dat.gz")) @unlink($this->path . "chunks.dat.gz");
|
||||
if(file_exists($this->path . "tiles.dat")) @unlink($this->path . "tiles.dat");
|
||||
unset($chunks, $level, $entities, $tiles, $nbt);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue