mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Replace disallowed operators in src/block/
This commit is contained in:
@ -90,11 +90,11 @@ class Slab extends Transparent{
|
||||
return true;
|
||||
}
|
||||
|
||||
if($blockReplace instanceof Slab and !$blockReplace->slabType->equals(SlabType::DOUBLE()) and $blockReplace->isSameType($this)){
|
||||
if($blockReplace instanceof Slab && !$blockReplace->slabType->equals(SlabType::DOUBLE()) && $blockReplace->isSameType($this)){
|
||||
if($blockReplace->slabType->equals(SlabType::TOP())){ //Trying to combine with top slab
|
||||
return $clickVector->y <= 0.5 or (!$isClickedBlock and $face === Facing::UP);
|
||||
return $clickVector->y <= 0.5 || (!$isClickedBlock && $face === Facing::UP);
|
||||
}else{
|
||||
return $clickVector->y >= 0.5 or (!$isClickedBlock and $face === Facing::DOWN);
|
||||
return $clickVector->y >= 0.5 || (!$isClickedBlock && $face === Facing::DOWN);
|
||||
}
|
||||
}
|
||||
|
||||
@ -102,9 +102,9 @@ class Slab extends Transparent{
|
||||
}
|
||||
|
||||
public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
|
||||
if($blockReplace instanceof Slab and !$blockReplace->slabType->equals(SlabType::DOUBLE()) and $blockReplace->isSameType($this) and (
|
||||
($blockReplace->slabType->equals(SlabType::TOP()) and ($clickVector->y <= 0.5 or $face === Facing::UP)) or
|
||||
($blockReplace->slabType->equals(SlabType::BOTTOM()) and ($clickVector->y >= 0.5 or $face === Facing::DOWN))
|
||||
if($blockReplace instanceof Slab && !$blockReplace->slabType->equals(SlabType::DOUBLE()) && $blockReplace->isSameType($this) && (
|
||||
($blockReplace->slabType->equals(SlabType::TOP()) && ($clickVector->y <= 0.5 || $face === Facing::UP)) ||
|
||||
($blockReplace->slabType->equals(SlabType::BOTTOM()) && ($clickVector->y >= 0.5 || $face === Facing::DOWN))
|
||||
)){
|
||||
//Clicked in empty half of existing slab
|
||||
$this->slabType = SlabType::DOUBLE();
|
||||
|
Reference in New Issue
Block a user