mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
motion packet spam fix, explosion optimizations, tnt gravity fix
This commit is contained in:
parent
6e8d7bead3
commit
69d5589191
4 changed files with 96 additions and 53 deletions
|
|
@ -8,9 +8,10 @@ class PrimedTNT extends Entity{
|
|||
if(!isset($this->data["fuse"])){
|
||||
$this->data["fuse"] = 0;
|
||||
}
|
||||
$this->hasGravity = true;
|
||||
$this->gravity = 0.04;
|
||||
$this->setHealth(10000000, "generic");
|
||||
$this->server->schedule(5, [$this, "updateFuse"], [], true);
|
||||
$this->update();
|
||||
}
|
||||
|
||||
public function getMetadata(){
|
||||
|
|
@ -18,7 +19,14 @@ class PrimedTNT extends Entity{
|
|||
$d[16]["value"] = (int) max(0, $this->data["fuse"] - (microtime(true) - $this->spawntime) * 20);
|
||||
return $d;
|
||||
}
|
||||
|
||||
public function createSaveData(){
|
||||
$data = parent::createSaveData();
|
||||
|
||||
$data["fuse"] = $this->data["fuse"];
|
||||
$data["power"] = $this->data["power"];
|
||||
|
||||
return $data;
|
||||
}
|
||||
public function updateFuse(){
|
||||
if($this->closed === true){
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue