mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
Added EndPortalFrame, fixed block names and added new stone blobs in flat
This commit is contained in:
parent
612e09e0cc
commit
7255fbc3ad
40 changed files with 107 additions and 30 deletions
|
|
@ -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;
|
||||
|
|
|
|||
10
src/material/block/nonfull/EndPortalFrame.php
Normal file
10
src/material/block/nonfull/EndPortalFrame.php
Normal 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?
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,4 @@ class FenceBlock extends TransparentBlock{
|
|||
$this->isFullBlock = false;
|
||||
$this->hardness = 15;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -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){
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -13,7 +13,7 @@ class CyanFlowerBlock extends FlowableBlock{
|
|||
8 => "Oxeye Daisy",
|
||||
];
|
||||
public function __construct($meta = 0){
|
||||
parent::__construct(CYAN_FLOWER, $meta, nullsafe(self::$names[$meta], "Poppy"));
|
||||
parent::__construct(CYAN_FLOWER, $meta, self::$names[$meta & 0x08]);
|
||||
$this->hardness = 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ class TallGrassBlock extends FlowableBlock{
|
|||
1 => "Tall Grass",
|
||||
2 => "Fern",
|
||||
);
|
||||
$this->name = $names[$this->meta & 0x03];
|
||||
$this->name = $names[$this->meta & 0x02];
|
||||
$this->hardness = 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,14 @@
|
|||
<?php
|
||||
|
||||
class DirtBlock extends SolidBlock{
|
||||
public function __construct(){
|
||||
parent::__construct(DIRT, 0, "Dirt");
|
||||
public function __construct($meta = 0){
|
||||
parent::__construct(DIRT, $meta, "Dirt");
|
||||
$this->isActivable = true;
|
||||
$names = array(
|
||||
0 => "Dirt",
|
||||
1 => "Grassless Dirt",
|
||||
);
|
||||
$this->name = $names[$this->meta & 0x01];
|
||||
$this->hardness = 2.5;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ class Leaves2Block extends TransparentBlock{
|
|||
];
|
||||
|
||||
public function __construct($meta = 0){
|
||||
parent::__construct(LEAVES2, $meta, nullsafe(self::$names[$meta & 0x03], "Leaves"));
|
||||
parent::__construct(LEAVES2, $meta, self::$names[$meta & 0x01]);
|
||||
$this->hardness = 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ class PlanksBlock extends SolidBlock{
|
|||
4 => "Acacia Wooden Planks",
|
||||
5 => "Dark Oak Wooden Planks",
|
||||
);
|
||||
$this->name = $names[$this->meta];
|
||||
$this->name = $names[$this->meta & 0x05];
|
||||
$this->hardness = 15;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ class QuartzBlock extends SolidBlock{
|
|||
0 => "Quartz Block",
|
||||
1 => "Chiseled Quartz Block",
|
||||
2 => "Quartz Pillar",
|
||||
3 => "Quartz Pillar",
|
||||
3 => "Quartz Pillar", //why 2 pillars?
|
||||
);
|
||||
$this->name = $names[$this->meta & 0x03];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ class SandBlock extends FallableBlock{
|
|||
0 => "Sand",
|
||||
1 => "Red Sand"
|
||||
];
|
||||
$this->name = $names[$this->meta];
|
||||
$this->name = $names[$this->meta & 0x01];
|
||||
$this->hardness = 2.5;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class StainedClayBlock extends SolidBlock{
|
|||
14 => "Red Stained Clay",
|
||||
15 => "Black Stained Clay",
|
||||
);
|
||||
$this->name = $names[$this->meta & 0x03];
|
||||
$this->name = $names[$this->meta & 0x15];
|
||||
$this->hardness = 30;
|
||||
}
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ class StainedClayBlock extends SolidBlock{
|
|||
public function getDrops(Item $item, Player $player){
|
||||
if($item->getPickaxeLevel() >= 1){
|
||||
return array(
|
||||
array(STAINED_CLAY, $this->meta & 0x03, 1),
|
||||
array(STAINED_CLAY, $this->meta & 0x15, 1)
|
||||
);
|
||||
}else{
|
||||
return array();
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class StoneBlock extends SolidBlock{
|
|||
5 => "Andesite",
|
||||
6 => "Polished Andesite",
|
||||
);
|
||||
$this->name = $names[$this->meta];
|
||||
$this->name = $names[$this->meta & 0x06];
|
||||
$this->hardness = 30;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class WoolBlock extends SolidBlock{
|
|||
14 => "Red Wool",
|
||||
15 => "Black Wool",
|
||||
);
|
||||
$this->name = $names[$this->meta];
|
||||
$this->name = $names[$this->meta & 0x15];
|
||||
$this->hardness = 4;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue