Added EndPortalFrame, fixed block names and added new stone blobs in flat

This commit is contained in:
ArkQuark 2023-02-24 17:06:11 +03:00
parent 612e09e0cc
commit 7255fbc3ad
40 changed files with 107 additions and 30 deletions

View file

@ -21,7 +21,7 @@ class CarpetBlock extends FlowableBlock{
14 => "Red Carpet",
15 => "Black Carpet",
);
$this->name = $names[$this->meta];
$this->name = $names[$this->meta & 0x15];
$this->hardness = 0;
$this->isFullBlock = false;
$this->isSolid = true;

View file

@ -0,0 +1,10 @@
<?php
class EndPortalFrameBlock extends TransparentBlock{
public function __construct($meta = 0){
parent::__construct(END_PORTAL_FRAME, $meta, "End Portal Frame");
$this->isFullBlock = false;
$this->hardness = 3600000;
//direction is isset in this version?
}
}

View file

@ -5,16 +5,19 @@ class FarmlandBlock extends TransparentBlock{
parent::__construct(FARMLAND, $meta, "Farmland");
$this->hardness = 3;
}
public function getDrops(Item $item, Player $player){
return array(
array(DIRT, 0, 1),
);
return [
[DIRT, 0, 1]
];
}
public function hasCrops(){
//TODO vanilla 0.8.1 detection method
$b = $this->getSide(1);
return $b->isTransparent && $b->id != 0;
}
public function onUpdate($type){
if($type === BLOCK_UPDATE_NORMAL){
if(!$this->getSide(1)->isTransparent){
@ -41,10 +44,9 @@ class FarmlandBlock extends TransparentBlock{
public function getBlockID($x, $y, $z){
return $this->level->level->getBlockID($x, $y, $z); //PMFLevel method
}
}
public function checkWater(){
for($x = $this->x - 4; $x <= $this->x + 4; $x++){
for($y = $this->y; $y <= $this->y + 1; $y++){
for($z = $this->z - 4; $z <= $this->z + 4; $z++){
@ -56,6 +58,5 @@ class FarmlandBlock extends TransparentBlock{
}
}
return false;
}
}

View file

@ -6,7 +6,4 @@ class FenceBlock extends TransparentBlock{
$this->isFullBlock = false;
$this->hardness = 15;
}
}

View file

@ -11,7 +11,7 @@ class SlabBlock extends TransparentBlock{
4 => "Brick",
5 => "Stone Brick",
6 => "Quartz",
7 => "",
7 => "", //hum?
);
$this->name = (($this->meta & 0x08) === 0x08 ? "Upper ":"") . $names[$this->meta & 0x07] . " Slab";
if(($this->meta & 0x08) === 0x08){

View file

@ -82,7 +82,7 @@ class WoodSlabBlock extends TransparentBlock{
public function getDrops(Item $item, Player $player){
return array(
array($this->id, $this->meta & 0x07, 1),
array($this->id, $this->meta & 0x07, 1),
);
}
}