mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
PMF & Multiworld [part 2]
This commit is contained in:
parent
9b212ae034
commit
5938747083
39 changed files with 239 additions and 301 deletions
|
|
@ -41,25 +41,24 @@ class SlabBlock extends TransparentBlock{
|
|||
$this->name = (($this->meta & 0x08) === 0x08 ? "Upper ":"") . $names[$this->meta & 0x07] . " Slab";
|
||||
}
|
||||
|
||||
public function place(BlockAPI $level, Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||
if($block->inWorld === true){
|
||||
$this->meta = $this->meta & 0x07;
|
||||
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||
$this->meta &= 0x07;
|
||||
if($face === 0){
|
||||
if($target->getID() === SLAB and ($target->getMetadata() & 0x08) === 0x08 and ($target->getMetadata() & 0x07) === ($this->meta & 0x07)){
|
||||
$level->setBlock($target, DOUBLE_SLAB, $this->meta & 0x07);
|
||||
$this->level->setBlock($target, BlockAPI::get(DOUBLE_SLAB, $this->meta));
|
||||
return true;
|
||||
}else{
|
||||
$this->meta |= 0x08;
|
||||
}
|
||||
}elseif($face === 1){
|
||||
if($target->getID() === SLAB and ($target->getMetadata() & 0x08) === 0 and ($target->getMetadata() & 0x07) === ($this->meta & 0x07)){
|
||||
$level->setBlock($target, DOUBLE_SLAB, $this->meta & 0x07);
|
||||
$this->level->setBlock($target, BlockAPI::get(DOUBLE_SLAB, $this->meta));
|
||||
return true;
|
||||
}
|
||||
}elseif(!$player->entity->inBlock($block->x, $block->y, $block->z)){
|
||||
if($block->getID() === SLAB){
|
||||
if(($block->getMetadata() & 0x07) === ($this->meta & 0x07)){
|
||||
$level->setBlock($block, DOUBLE_SLAB, $this->meta & 0x07);
|
||||
$this->level->setBlock($block, BlockAPI::get(DOUBLE_SLAB, $this->meta));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -74,10 +73,8 @@ class SlabBlock extends TransparentBlock{
|
|||
if($block->getID() === SLAB and ($target->getMetadata() & 0x07) !== ($this->meta & 0x07)){
|
||||
return false;
|
||||
}
|
||||
$level->setBlock($block, $this->id, $this->meta);
|
||||
$this->level->setBlock($block, $this);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public function getDrops(Item $item, Player $player){
|
||||
return array(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue