mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-09 11:31:49 +00:00
added some nullable and void typehints to Block API
This commit is contained in:
parent
8f0ee84277
commit
d8b1757ebc
@ -24,6 +24,7 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\math\AxisAlignedBB;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -66,7 +67,7 @@ class Air extends Transparent{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBoundingBox(){
|
public function getBoundingBox() : ?AxisAlignedBB{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ class Bed extends Transparent{
|
|||||||
return "Bed Block";
|
return "Bed Block";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
return new AxisAlignedBB(
|
return new AxisAlignedBB(
|
||||||
$this->x,
|
$this->x,
|
||||||
$this->y,
|
$this->y,
|
||||||
@ -125,7 +125,7 @@ class Bed extends Transparent{
|
|||||||
/**
|
/**
|
||||||
* @return Bed|null
|
* @return Bed|null
|
||||||
*/
|
*/
|
||||||
public function getOtherHalf(){
|
public function getOtherHalf() : ?Bed{
|
||||||
$other = $this->getSide(self::getOtherHalfSide($this->meta, $this->isHeadPart()));
|
$other = $this->getSide(self::getOtherHalfSide($this->meta, $this->isHeadPart()));
|
||||||
if($other instanceof Bed and $other->getId() === $this->getId() and $other->isHeadPart() !== $this->isHeadPart() and (($other->getDamage() & 0x03) === ($this->getDamage() & 0x03))){
|
if($other instanceof Bed and $other->getId() === $this->getId() and $other->isHeadPart() !== $this->isHeadPart() and (($other->getDamage() & 0x03) === ($this->getDamage() & 0x03))){
|
||||||
return $other;
|
return $other;
|
||||||
|
@ -116,7 +116,7 @@ class Block extends Position implements BlockIds, Metadatable{
|
|||||||
/**
|
/**
|
||||||
* @param int $meta
|
* @param int $meta
|
||||||
*/
|
*/
|
||||||
final public function setDamage(int $meta){
|
final public function setDamage(int $meta) : void{
|
||||||
if($meta < 0 or $meta > 0xf){
|
if($meta < 0 or $meta > 0xf){
|
||||||
throw new \InvalidArgumentException("Block damage values must be 0-15, not $meta");
|
throw new \InvalidArgumentException("Block damage values must be 0-15, not $meta");
|
||||||
}
|
}
|
||||||
@ -391,7 +391,7 @@ class Block extends Position implements BlockIds, Metadatable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function addVelocityToEntity(Entity $entity, Vector3 $vector){
|
public function addVelocityToEntity(Entity $entity, Vector3 $vector) : void{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -400,7 +400,7 @@ class Block extends Position implements BlockIds, Metadatable{
|
|||||||
*
|
*
|
||||||
* @param Position $v
|
* @param Position $v
|
||||||
*/
|
*/
|
||||||
final public function position(Position $v){
|
final public function position(Position $v) : void{
|
||||||
$this->x = (int) $v->x;
|
$this->x = (int) $v->x;
|
||||||
$this->y = (int) $v->y;
|
$this->y = (int) $v->y;
|
||||||
$this->z = (int) $v->z;
|
$this->z = (int) $v->z;
|
||||||
@ -497,14 +497,14 @@ class Block extends Position implements BlockIds, Metadatable{
|
|||||||
/**
|
/**
|
||||||
* @param Entity $entity
|
* @param Entity $entity
|
||||||
*/
|
*/
|
||||||
public function onEntityCollide(Entity $entity){
|
public function onEntityCollide(Entity $entity) : void{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return AxisAlignedBB|null
|
* @return AxisAlignedBB|null
|
||||||
*/
|
*/
|
||||||
public function getBoundingBox(){
|
public function getBoundingBox() : ?AxisAlignedBB{
|
||||||
if($this->boundingBox === null){
|
if($this->boundingBox === null){
|
||||||
$this->boundingBox = $this->recalculateBoundingBox();
|
$this->boundingBox = $this->recalculateBoundingBox();
|
||||||
}
|
}
|
||||||
@ -514,7 +514,7 @@ class Block extends Position implements BlockIds, Metadatable{
|
|||||||
/**
|
/**
|
||||||
* @return AxisAlignedBB|null
|
* @return AxisAlignedBB|null
|
||||||
*/
|
*/
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
return new AxisAlignedBB(
|
return new AxisAlignedBB(
|
||||||
$this->x,
|
$this->x,
|
||||||
$this->y,
|
$this->y,
|
||||||
@ -531,7 +531,7 @@ class Block extends Position implements BlockIds, Metadatable{
|
|||||||
*
|
*
|
||||||
* @return MovingObjectPosition|null
|
* @return MovingObjectPosition|null
|
||||||
*/
|
*/
|
||||||
public function calculateIntercept(Vector3 $pos1, Vector3 $pos2){
|
public function calculateIntercept(Vector3 $pos1, Vector3 $pos2) : ?MovingObjectPosition{
|
||||||
$bb = $this->getBoundingBox();
|
$bb = $this->getBoundingBox();
|
||||||
if($bb === null){
|
if($bb === null){
|
||||||
return null;
|
return null;
|
||||||
|
@ -56,7 +56,7 @@ class BlockFactory{
|
|||||||
*
|
*
|
||||||
* @param bool $force
|
* @param bool $force
|
||||||
*/
|
*/
|
||||||
public static function init(bool $force = false){
|
public static function init(bool $force = false) : void{
|
||||||
if(self::$list === null or $force){
|
if(self::$list === null or $force){
|
||||||
self::$list = new \SplFixedArray(256);
|
self::$list = new \SplFixedArray(256);
|
||||||
self::$fullList = new \SplFixedArray(4096);
|
self::$fullList = new \SplFixedArray(4096);
|
||||||
@ -341,7 +341,7 @@ class BlockFactory{
|
|||||||
* @throws \RuntimeException if something attempted to override an already-registered block without specifying the
|
* @throws \RuntimeException if something attempted to override an already-registered block without specifying the
|
||||||
* $override parameter.
|
* $override parameter.
|
||||||
*/
|
*/
|
||||||
public static function registerBlock(Block $block, bool $override = false){
|
public static function registerBlock(Block $block, bool $override = false) : void{
|
||||||
$id = $block->getId();
|
$id = $block->getId();
|
||||||
|
|
||||||
if(!$override and self::isRegistered($id)){
|
if(!$override and self::isRegistered($id)){
|
||||||
|
@ -54,7 +54,7 @@ class Cactus extends Transparent{
|
|||||||
return "Cactus";
|
return "Cactus";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
|
|
||||||
return new AxisAlignedBB(
|
return new AxisAlignedBB(
|
||||||
$this->x + 0.0625,
|
$this->x + 0.0625,
|
||||||
@ -70,7 +70,7 @@ class Cactus extends Transparent{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onEntityCollide(Entity $entity){
|
public function onEntityCollide(Entity $entity) : void{
|
||||||
$ev = new EntityDamageByBlockEvent($this, $entity, EntityDamageEvent::CAUSE_CONTACT, 1);
|
$ev = new EntityDamageByBlockEvent($this, $entity, EntityDamageEvent::CAUSE_CONTACT, 1);
|
||||||
$entity->attack($ev);
|
$entity->attack($ev);
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ class Cake extends Transparent implements FoodSource{
|
|||||||
return "Cake Block";
|
return "Cake Block";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
|
|
||||||
$f = $this->getDamage() * 0.125; //1 slice width
|
$f = $this->getDamage() * 0.125; //1 slice width
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ class Carpet extends Flowable{
|
|||||||
return ColorBlockMetaHelper::getColorFromMeta($this->meta) . " Carpet";
|
return ColorBlockMetaHelper::getColorFromMeta($this->meta) . " Carpet";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
|
|
||||||
return new AxisAlignedBB(
|
return new AxisAlignedBB(
|
||||||
$this->x,
|
$this->x,
|
||||||
|
@ -52,7 +52,7 @@ class Chest extends Transparent{
|
|||||||
return Tool::TYPE_AXE;
|
return Tool::TYPE_AXE;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
return new AxisAlignedBB(
|
return new AxisAlignedBB(
|
||||||
$this->x + 0.0625,
|
$this->x + 0.0625,
|
||||||
$this->y,
|
$this->y,
|
||||||
|
@ -57,7 +57,7 @@ class CobblestoneWall extends Transparent{
|
|||||||
return "Cobblestone Wall";
|
return "Cobblestone Wall";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
|
|
||||||
$north = $this->canConnect($this->getSide(Vector3::SIDE_NORTH));
|
$north = $this->canConnect($this->getSide(Vector3::SIDE_NORTH));
|
||||||
$south = $this->canConnect($this->getSide(Vector3::SIDE_SOUTH));
|
$south = $this->canConnect($this->getSide(Vector3::SIDE_SOUTH));
|
||||||
|
@ -51,7 +51,7 @@ class Cobweb extends Flowable{
|
|||||||
return Tool::TYPE_SWORD;
|
return Tool::TYPE_SWORD;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onEntityCollide(Entity $entity){
|
public function onEntityCollide(Entity $entity) : void{
|
||||||
$entity->resetFallDistance();
|
$entity->resetFallDistance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ class ConcretePowder extends Fallable{
|
|||||||
/**
|
/**
|
||||||
* @return null|Block
|
* @return null|Block
|
||||||
*/
|
*/
|
||||||
private function checkAdjacentWater(){
|
private function checkAdjacentWater() : ?Block{
|
||||||
for($i = 1; $i < 6; ++$i){ //Do not check underneath
|
for($i = 1; $i < 6; ++$i){ //Do not check underneath
|
||||||
if($this->getSide($i) instanceof Water){
|
if($this->getSide($i) instanceof Water){
|
||||||
return Block::get(Block::CONCRETE, $this->meta);
|
return Block::get(Block::CONCRETE, $this->meta);
|
||||||
|
@ -54,7 +54,7 @@ abstract class Door extends Transparent{
|
|||||||
return $down & 0x07 | ($isUp ? 8 : 0) | ($isRight ? 0x10 : 0);
|
return $down & 0x07 | ($isUp ? 8 : 0) | ($isRight ? 0x10 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
|
|
||||||
$f = 0.1875;
|
$f = 0.1875;
|
||||||
$damage = $this->getFullDamage();
|
$damage = $this->getFullDamage();
|
||||||
|
@ -54,7 +54,7 @@ class EndPortalFrame extends Solid{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
|
|
||||||
return new AxisAlignedBB(
|
return new AxisAlignedBB(
|
||||||
$this->x,
|
$this->x,
|
||||||
|
@ -61,7 +61,7 @@ class EndRod extends Flowable{
|
|||||||
return 14;
|
return 14;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
$m = $this->meta & ~0x01;
|
$m = $this->meta & ~0x01;
|
||||||
$width = 0.375;
|
$width = 0.375;
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ class Farmland extends Transparent{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
return new AxisAlignedBB(
|
return new AxisAlignedBB(
|
||||||
$this->x,
|
$this->x,
|
||||||
$this->y,
|
$this->y,
|
||||||
|
@ -62,7 +62,7 @@ class Fence extends Transparent{
|
|||||||
return $names[$this->meta & 0x07] ?? "Unknown";
|
return $names[$this->meta & 0x07] ?? "Unknown";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
|
|
||||||
$north = $this->canConnect($this->getSide(Vector3::SIDE_NORTH));
|
$north = $this->canConnect($this->getSide(Vector3::SIDE_NORTH));
|
||||||
$south = $this->canConnect($this->getSide(Vector3::SIDE_SOUTH));
|
$south = $this->canConnect($this->getSide(Vector3::SIDE_SOUTH));
|
||||||
|
@ -41,7 +41,7 @@ class FenceGate extends Transparent{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
|
|
||||||
if(($this->getDamage() & 0x04) > 0){
|
if(($this->getDamage() & 0x04) > 0){
|
||||||
return null;
|
return null;
|
||||||
|
@ -65,7 +65,7 @@ class Fire extends Flowable{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onEntityCollide(Entity $entity){
|
public function onEntityCollide(Entity $entity) : void{
|
||||||
$ev = new EntityDamageByBlockEvent($this, $entity, EntityDamageEvent::CAUSE_FIRE, 1);
|
$ev = new EntityDamageByBlockEvent($this, $entity, EntityDamageEvent::CAUSE_FIRE, 1);
|
||||||
$entity->attack($ev);
|
$entity->attack($ev);
|
||||||
|
|
||||||
|
@ -23,6 +23,8 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
|
use pocketmine\math\AxisAlignedBB;
|
||||||
|
|
||||||
abstract class Flowable extends Transparent{
|
abstract class Flowable extends Transparent{
|
||||||
|
|
||||||
public function canBeFlowedInto() : bool{
|
public function canBeFlowedInto() : bool{
|
||||||
@ -41,7 +43,7 @@ abstract class Flowable extends Transparent{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -47,7 +47,7 @@ class FlowerPot extends Flowable{
|
|||||||
return "Flower Pot";
|
return "Flower Pot";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
return new AxisAlignedBB(
|
return new AxisAlignedBB(
|
||||||
$this->x + 0.3125,
|
$this->x + 0.3125,
|
||||||
$this->y,
|
$this->y,
|
||||||
|
@ -44,7 +44,7 @@ class GrassPath extends Transparent{
|
|||||||
return Tool::TYPE_SHOVEL;
|
return Tool::TYPE_SHOVEL;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
return new AxisAlignedBB(
|
return new AxisAlignedBB(
|
||||||
$this->x,
|
$this->x,
|
||||||
$this->y,
|
$this->y,
|
||||||
|
@ -59,12 +59,12 @@ class Ladder extends Transparent{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onEntityCollide(Entity $entity){
|
public function onEntityCollide(Entity $entity) : void{
|
||||||
$entity->resetFallDistance();
|
$entity->resetFallDistance();
|
||||||
$entity->onGround = true;
|
$entity->onGround = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
$f = 0.1875;
|
$f = 0.1875;
|
||||||
|
|
||||||
$minX = $minZ = 0;
|
$minX = $minZ = 0;
|
||||||
|
@ -48,7 +48,7 @@ class Lava extends Liquid{
|
|||||||
return "Lava";
|
return "Lava";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onEntityCollide(Entity $entity){
|
public function onEntityCollide(Entity $entity) : void{
|
||||||
$entity->fallDistance *= 0.5;
|
$entity->fallDistance *= 0.5;
|
||||||
|
|
||||||
$ev = new EntityDamageByBlockEvent($this, $entity, EntityDamageEvent::CAUSE_LAVA, 4);
|
$ev = new EntityDamageByBlockEvent($this, $entity, EntityDamageEvent::CAUSE_LAVA, 4);
|
||||||
|
@ -26,6 +26,7 @@ namespace pocketmine\block;
|
|||||||
use pocketmine\entity\Entity;
|
use pocketmine\entity\Entity;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
use pocketmine\level\Level;
|
use pocketmine\level\Level;
|
||||||
|
use pocketmine\math\AxisAlignedBB;
|
||||||
use pocketmine\math\Vector3;
|
use pocketmine\math\Vector3;
|
||||||
|
|
||||||
abstract class Liquid extends Transparent{
|
abstract class Liquid extends Transparent{
|
||||||
@ -171,7 +172,7 @@ abstract class Liquid extends Transparent{
|
|||||||
return $vector->normalize();
|
return $vector->normalize();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addVelocityToEntity(Entity $entity, Vector3 $vector){
|
public function addVelocityToEntity(Entity $entity, Vector3 $vector) : void{
|
||||||
$flow = $this->getFlowVector();
|
$flow = $this->getFlowVector();
|
||||||
$vector->x += $flow->x;
|
$vector->x += $flow->x;
|
||||||
$vector->y += $flow->y;
|
$vector->y += $flow->y;
|
||||||
@ -444,7 +445,7 @@ abstract class Liquid extends Transparent{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ class Magma extends Solid{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onEntityCollide(Entity $entity){
|
public function onEntityCollide(Entity $entity) : void{
|
||||||
if(!$entity->isSneaking()){
|
if(!$entity->isSneaking()){
|
||||||
$ev = new EntityDamageByBlockEvent($this, $entity, EntityDamageEvent::CAUSE_FIRE, 1);
|
$ev = new EntityDamageByBlockEvent($this, $entity, EntityDamageEvent::CAUSE_FIRE, 1);
|
||||||
$entity->attack($ev);
|
$entity->attack($ev);
|
||||||
|
@ -48,7 +48,7 @@ class NetherBrickFence extends Transparent{
|
|||||||
return "Nether Brick Fence";
|
return "Nether Brick Fence";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
$width = 0.375;
|
$width = 0.375;
|
||||||
|
|
||||||
return new AxisAlignedBB(
|
return new AxisAlignedBB(
|
||||||
|
@ -26,6 +26,7 @@ namespace pocketmine\block;
|
|||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
use pocketmine\item\Tool;
|
use pocketmine\item\Tool;
|
||||||
use pocketmine\level\Level;
|
use pocketmine\level\Level;
|
||||||
|
use pocketmine\math\AxisAlignedBB;
|
||||||
use pocketmine\math\Vector3;
|
use pocketmine\math\Vector3;
|
||||||
use pocketmine\Player;
|
use pocketmine\Player;
|
||||||
use pocketmine\tile\Sign as TileSign;
|
use pocketmine\tile\Sign as TileSign;
|
||||||
@ -53,7 +54,7 @@ class SignPost extends Transparent{
|
|||||||
return "Sign Post";
|
return "Sign Post";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ class Skull extends Flowable{
|
|||||||
return "Mob Head";
|
return "Mob Head";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
//TODO: different bounds depending on attached face (meta)
|
//TODO: different bounds depending on attached face (meta)
|
||||||
return new AxisAlignedBB(
|
return new AxisAlignedBB(
|
||||||
$this->x + 0.25,
|
$this->x + 0.25,
|
||||||
|
@ -46,7 +46,7 @@ class SoulSand extends Solid{
|
|||||||
return Tool::TYPE_SHOVEL;
|
return Tool::TYPE_SHOVEL;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
|
|
||||||
return new AxisAlignedBB(
|
return new AxisAlignedBB(
|
||||||
$this->x,
|
$this->x,
|
||||||
|
@ -107,7 +107,7 @@ abstract class Stair extends Transparent{
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
|
|
||||||
if(($this->getDamage() & 0x04) > 0){
|
if(($this->getDamage() & 0x04) > 0){
|
||||||
return new AxisAlignedBB(
|
return new AxisAlignedBB(
|
||||||
|
@ -32,7 +32,7 @@ abstract class Thin extends Transparent{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
|
|
||||||
$f = 0.4375;
|
$f = 0.4375;
|
||||||
$f1 = 0.5625;
|
$f1 = 0.5625;
|
||||||
|
@ -53,7 +53,7 @@ class Trapdoor extends Transparent{
|
|||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
|
|
||||||
$damage = $this->getDamage();
|
$damage = $this->getDamage();
|
||||||
|
|
||||||
|
@ -71,11 +71,11 @@ class Vine extends Transparent{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onEntityCollide(Entity $entity){
|
public function onEntityCollide(Entity $entity) : void{
|
||||||
$entity->resetFallDistance();
|
$entity->resetFallDistance();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
|
|
||||||
$f1 = 1;
|
$f1 = 1;
|
||||||
$f2 = 1;
|
$f2 = 1;
|
||||||
|
@ -44,7 +44,7 @@ class Water extends Liquid{
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onEntityCollide(Entity $entity){
|
public function onEntityCollide(Entity $entity) : void{
|
||||||
$entity->resetFallDistance();
|
$entity->resetFallDistance();
|
||||||
if($entity->fireTicks > 0){
|
if($entity->fireTicks > 0){
|
||||||
$entity->extinguish();
|
$entity->extinguish();
|
||||||
|
@ -45,7 +45,7 @@ class WaterLily extends Flowable{
|
|||||||
return 0.6;
|
return 0.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
return new AxisAlignedBB(
|
return new AxisAlignedBB(
|
||||||
$this->x + 0.0625,
|
$this->x + 0.0625,
|
||||||
$this->y,
|
$this->y,
|
||||||
|
@ -55,7 +55,7 @@ class WoodenSlab extends Transparent{
|
|||||||
return (($this->meta & 0x08) === 0x08 ? "Upper " : "") . ($names[$this->meta & 0x07] ?? "") . " Wooden Slab";
|
return (($this->meta & 0x08) === 0x08 ? "Upper " : "") . ($names[$this->meta & 0x07] ?? "") . " Wooden Slab";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox() : ?AxisAlignedBB{
|
||||||
|
|
||||||
if(($this->meta & 0x08) > 0){
|
if(($this->meta & 0x08) > 0){
|
||||||
return new AxisAlignedBB(
|
return new AxisAlignedBB(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user