fixed unmount (hopefully one last time)

This commit is contained in:
GameHerobrine 2024-06-08 22:57:49 +03:00
parent 5f5c2b82de
commit fb13a6123b
10 changed files with 100 additions and 36 deletions

View file

@ -78,6 +78,27 @@ class Minecart extends Vehicle{
];
}
public function update($now){
if($this->closed === true){
return false;
}
}
public function close()
{
parent::close();
if($this->linkedEntity != 0){
$ent = $this->level->entityList[$this->linkedEntity] ?? false;
if($ent instanceof Entity){
$ent->stopRiding();
}else{
ConsoleAPI::warn("$this is being ridden by invalid entity {$this->linkedEntity}");
}
}
}
public function isPushable(){
return false; //TODO replace with true
}