project uses tabs instead of spaces(as in CONTRIBUTING.md)

This commit is contained in:
GameHerobrine 2022-12-26 07:01:28 +03:00
parent f00318b6ed
commit 62571f26cd
115 changed files with 2291 additions and 2364 deletions

View file

@ -49,24 +49,24 @@ class Minecart extends Vehicle{
}
public function interactWith(Entity $e, $action){
if($action === InteractPacket::ACTION_HOLD && $e->isPlayer() && $this->canRide($e)){
$this->linkedEntity = $e;
$e->isRiding = true;
$this->linkEntity($e, SetEntityLinkPacket::TYPE_RIDE);
return true;
}
if($e->isPlayer() && $action === InteractPacket::ACTION_HOLD){
$this->linkEntity($e, SetEntityLinkPacket::TYPE_REMOVE);
$this->linkedEntity = 0;
$e->isRiding = false;
return true;
}
parent::interactWith($e, $action);
if($action === InteractPacket::ACTION_HOLD && $e->isPlayer() && $this->canRide($e)){
$this->linkedEntity = $e;
$e->isRiding = true;
$this->linkEntity($e, SetEntityLinkPacket::TYPE_RIDE);
return true;
}
if($e->isPlayer() && $action === InteractPacket::ACTION_HOLD){
$this->linkEntity($e, SetEntityLinkPacket::TYPE_REMOVE);
$this->linkedEntity = 0;
$e->isRiding = false;
return true;
}
parent::interactWith($e, $action);
}
public function canRide($e)
{
return !($this->linkedEntity instanceof Entity) && !$e->isRiding;
}
public function canRide($e)
{
return !($this->linkedEntity instanceof Entity) && !$e->isRiding;
}
}