mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Updated blocks bounding boxes
This commit is contained in:
parent
f0f9bccb4b
commit
c47e359262
@ -44,11 +44,7 @@ class Air extends Transparent{
|
||||
}
|
||||
|
||||
public function getBoundingBox(){
|
||||
return new AxisAlignedBB(0, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
public function collidesWithBB(AxisAlignedBB $bb, &$list = []){
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@ -32,6 +32,10 @@ class Beetroot extends Flowable{
|
||||
$this->hardness = 0;
|
||||
}
|
||||
|
||||
public function getBoundingBox(){
|
||||
return null;
|
||||
}
|
||||
|
||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||
$down = $this->getSide(0);
|
||||
if($down->getID() === self::FARMLAND){
|
||||
|
@ -54,4 +54,9 @@ class BrownMushroom extends Flowable{
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getBoundingBox(){
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@ -32,6 +32,11 @@ class Carrot extends Flowable{
|
||||
$this->hardness = 0;
|
||||
}
|
||||
|
||||
public function getBoundingBox(){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||
$down = $this->getSide(0);
|
||||
if($down->getID() === self::FARMLAND){
|
||||
|
@ -31,6 +31,11 @@ class CyanFlower extends Flowable{
|
||||
$this->hardness = 0;
|
||||
}
|
||||
|
||||
public function getBoundingBox(){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||
$down = $this->getSide(0);
|
||||
if($down->getID() === 2 or $down->getID() === 3 or $down->getID() === 60){
|
||||
|
@ -31,6 +31,11 @@ class Dandelion extends Flowable{
|
||||
$this->hardness = 0;
|
||||
}
|
||||
|
||||
public function getBoundingBox(){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||
$down = $this->getSide(0);
|
||||
if($down->getID() === 2 or $down->getID() === 3 or $down->getID() === 60){
|
||||
|
@ -30,6 +30,11 @@ class DeadBush extends Flowable{
|
||||
$this->hardness = 0;
|
||||
}
|
||||
|
||||
public function getBoundingBox(){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public function onUpdate($type){
|
||||
if($type === Level::BLOCK_UPDATE_NORMAL){
|
||||
if($this->getSide(0)->isTransparent === true){ //Replace with common break method
|
||||
|
@ -33,6 +33,11 @@ class Fire extends Flowable{
|
||||
$this->hardness = 0;
|
||||
}
|
||||
|
||||
public function getBoundingBox(){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public function getDrops(Item $item){
|
||||
return [];
|
||||
}
|
||||
|
@ -33,6 +33,11 @@ class Ladder extends Transparent{
|
||||
$this->hardness = 2;
|
||||
}
|
||||
|
||||
public function getBoundingBox(){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||
if($target->isTransparent === false){
|
||||
$faces = array(
|
||||
|
@ -33,6 +33,11 @@ class Lava extends Liquid{
|
||||
$this->hardness = 0;
|
||||
}
|
||||
|
||||
public function getBoundingBox(){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||
$ret = $this->getLevel()->setBlock($this, $this, true, false, true);
|
||||
$this->getLevel()->scheduleUpdate(clone $this, 40);
|
||||
|
@ -32,6 +32,11 @@ class MelonStem extends Flowable{
|
||||
$this->hardness = 0;
|
||||
}
|
||||
|
||||
public function getBoundingBox(){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||
$down = $this->getSide(0);
|
||||
if($down->getID() === self::FARMLAND){
|
||||
|
@ -32,6 +32,11 @@ class Potato extends Flowable{
|
||||
$this->hardness = 0;
|
||||
}
|
||||
|
||||
public function getBoundingBox(){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||
$down = $this->getSide(0);
|
||||
if($down->getID() === self::FARMLAND){
|
||||
|
@ -32,6 +32,11 @@ class PumpkinStem extends Flowable{
|
||||
$this->hardness = 0;
|
||||
}
|
||||
|
||||
public function getBoundingBox(){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||
$down = $this->getSide(0);
|
||||
if($down->getID() === self::FARMLAND){
|
||||
|
@ -31,6 +31,11 @@ class RedMushroom extends Flowable{
|
||||
$this->hardness = 0;
|
||||
}
|
||||
|
||||
public function getBoundingBox(){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public function onUpdate($type){
|
||||
if($type === Level::BLOCK_UPDATE_NORMAL){
|
||||
if($this->getSide(0)->isTransparent === true){ //Replace with common break method
|
||||
|
@ -49,6 +49,11 @@ class Sapling extends Flowable{
|
||||
$this->hardness = 0;
|
||||
}
|
||||
|
||||
public function getBoundingBox(){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||
$down = $this->getSide(0);
|
||||
if($down->getID() === self::GRASS or $down->getID() === self::DIRT or $down->getID() === self::FARMLAND){
|
||||
|
@ -33,6 +33,11 @@ class SignPost extends Transparent{
|
||||
$this->hardness = 5;
|
||||
}
|
||||
|
||||
public function getBoundingBox(){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||
if($face !== 0){
|
||||
$faces = array(
|
||||
|
@ -34,6 +34,11 @@ class SnowLayer extends Flowable{
|
||||
$this->hardness = 0.5;
|
||||
}
|
||||
|
||||
public function getBoundingBox(){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||
$down = $this->getSide(0);
|
||||
if($down instanceof Solid){
|
||||
|
@ -32,6 +32,11 @@ class Sugarcane extends Flowable{
|
||||
$this->hardness = 0;
|
||||
}
|
||||
|
||||
public function getBoundingBox(){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public function getDrops(Item $item){
|
||||
return array(
|
||||
array(Item::SUGARCANE, 0, 1),
|
||||
|
@ -37,6 +37,11 @@ class TallGrass extends Flowable{
|
||||
$this->hardness = 0;
|
||||
}
|
||||
|
||||
public function getBoundingBox(){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public function onUpdate($type){
|
||||
if($type === Level::BLOCK_UPDATE_NORMAL){
|
||||
if($this->getSide(0)->isTransparent === true){ //Replace with common break method
|
||||
|
@ -31,6 +31,11 @@ class Torch extends Flowable{
|
||||
$this->hardness = 0;
|
||||
}
|
||||
|
||||
public function getBoundingBox(){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public function onUpdate($type){
|
||||
if($type === Level::BLOCK_UPDATE_NORMAL){
|
||||
$side = $this->getDamage();
|
||||
|
@ -27,6 +27,11 @@ class WallSign extends SignPost{
|
||||
Transparent::__construct(self::WALL_SIGN, $meta, "Wall Sign");
|
||||
}
|
||||
|
||||
public function getBoundingBox(){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public function onUpdate($type){
|
||||
return false;
|
||||
}
|
||||
|
@ -33,6 +33,11 @@ class Water extends Liquid{
|
||||
$this->hardness = 500;
|
||||
}
|
||||
|
||||
public function getBoundingBox(){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||
$ret = $this->getLevel()->setBlock($this, $this, true, false, true);
|
||||
$this->getLevel()->scheduleUpdate(clone $this, 10);
|
||||
|
@ -32,6 +32,11 @@ class Wheat extends Flowable{
|
||||
$this->hardness = 0;
|
||||
}
|
||||
|
||||
public function getBoundingBox(){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||
$down = $this->getSide(0);
|
||||
if($down->getID() === self::FARMLAND){
|
||||
|
@ -960,7 +960,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
//$face = -1;
|
||||
}
|
||||
|
||||
if($hand->isSolid === true and count($this->getCollidingEntities($hand->getBoundingBox())) > 0){
|
||||
if($hand->isSolid === true and $hand->getBoundingBox() !== null and count($this->getCollidingEntities($hand->getBoundingBox())) > 0){
|
||||
return false; //Entity in block
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user