mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 12:39:43 +00:00
Structure.php rewrite, all structures(except smallfarm) are probably broken now
This commit is contained in:
parent
64b9e376ca
commit
96a62953fa
9 changed files with 141 additions and 186 deletions
|
|
@ -32,6 +32,7 @@ class PocketMinecraftServer{
|
||||||
|
|
||||||
console("[INFO] Starting Minecraft PE server on " . ($this->serverip === "0.0.0.0" ? "*" : $this->serverip) . ":" . $this->port);
|
console("[INFO] Starting Minecraft PE server on " . ($this->serverip === "0.0.0.0" ? "*" : $this->serverip) . ":" . $this->port);
|
||||||
EntityRegistry::registerEntities();
|
EntityRegistry::registerEntities();
|
||||||
|
Structures::initialize();
|
||||||
define("BOOTUP_RANDOM", Utils::getRandomBytes(16));
|
define("BOOTUP_RANDOM", Utils::getRandomBytes(16));
|
||||||
$this->serverID = $this->serverID === false ? Utils::readLong(substr(Utils::getUniqueID(true, $this->serverip . $this->port), 8)) : $this->serverID;
|
$this->serverID = $this->serverID === false ? Utils::readLong(substr(Utils::getUniqueID(true, $this->serverip . $this->port), 8)) : $this->serverID;
|
||||||
$this->seed = $this->seed === false ? Utils::readInt(Utils::getRandomBytes(4, false)) : $this->seed;
|
$this->seed = $this->seed === false ? Utils::readInt(Utils::getRandomBytes(4, false)) : $this->seed;
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,12 @@ class MyceliumBlock extends SolidBlock{
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onActivate(Item $item, Player $player){ //uwu
|
public function onActivate(Item $item, Player $player){ //uwu
|
||||||
|
/*if(mt_rand(0, 1) === 0){
|
||||||
|
Structures::$SMALLFARM_VILLAGE->rotate90deg($this->level, $this->x, $this->y, $this->z)->build($this->level, $this->x, $this->y, $this->z);
|
||||||
|
}else{
|
||||||
|
Structures::$SMALLFARM_VILLAGE->build($this->level, $this->x, $this->y, $this->z);
|
||||||
|
}*/
|
||||||
|
|
||||||
//(new WoodHutStructure())->build($this->level, $this->getX(), $this->getY(), $this->getZ());
|
//(new WoodHutStructure())->build($this->level, $this->getX(), $this->getY(), $this->getZ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,77 +1,74 @@
|
||||||
<?php
|
<?php
|
||||||
/*XYZ in Structure String:
|
/*XYZ in Structure String:
|
||||||
|
|
||||||
|--→x+
|
|--->x+
|
||||||
|
|
|
|
||||||
↓z+
|
|z+
|
||||||
*/
|
*/
|
||||||
abstract class Structure{
|
abstract class Structure{
|
||||||
const MAP_NO_KEY = -255;
|
const MAP_NO_KEY = -127;
|
||||||
const LEVEL_RSV1 = 1;
|
protected $structure;
|
||||||
private static $structure, $tmpStructure;
|
protected $map;
|
||||||
private $map;
|
public $width, $length;
|
||||||
public $api, $pm, $width, $length, $name;
|
public $name;
|
||||||
|
|
||||||
public function __construct($width = 0, $length = 0, $name = "Unknown", $map = []){
|
public function __construct(){
|
||||||
$this->pm = ServerAPI::request();
|
foreach($this->structure as &$s){
|
||||||
$this->api = $this->pm->api;
|
foreach($s as &$e){
|
||||||
$this->width = $width;
|
if(strlen($e) < $this->length){
|
||||||
$this->length = $length;
|
$e .= str_repeat(" ", $this->length - strlen($e));
|
||||||
$this->name = $name;
|
}
|
||||||
$this->map = $map;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getName(){
|
|
||||||
return $this->name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setName($name){
|
|
||||||
$this->name = $name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function parseMeta($meta){
|
|
||||||
if(!is_numeric($meta)){
|
|
||||||
$arrmeta = explode(" ", $meta);
|
|
||||||
if($arrmeta[0] === "random"){
|
|
||||||
$meta = mt_rand($arrmeta[1], $arrmeta[2]);
|
|
||||||
}else{
|
|
||||||
$meta = 0; //undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $meta;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getMappingFor($char){
|
|
||||||
if(!isset($this->map[$char])) return Structure::MAP_NO_KEY;
|
|
||||||
$blockClass = is_array($this->map[$char]) ? $this->map[$char][0] : $this->map[$char];
|
|
||||||
return new $blockClass(isset($this->map[$char][1]) ? $this->parseMeta($this->map[$char][1]) : 0, isset($this->map[$char][2]) ? $this->map[$char][2] : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function placeBlock($level, $char, &$vector){
|
|
||||||
if($char == "") return;
|
|
||||||
if($level instanceof Level){
|
|
||||||
$block = $this->getMappingFor($char);
|
|
||||||
//var_dump($block);
|
|
||||||
if($block === Structure::MAP_NO_KEY){
|
|
||||||
//console("Failed to get block!");
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
$level->setBlockRaw($vector, $block);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function build($level, $centerX, $centerY, $centerZ, $structure = 0){
|
protected function getMappingFor($char){
|
||||||
//console("building ".$this->name);
|
return nullsafe($this->map[$char], self::MAP_NO_KEY);
|
||||||
$offsetX = 0;
|
}
|
||||||
$offsetZ = 0;
|
|
||||||
foreach($structure as $offsetY => $blocksXZ){
|
protected function placeBlock(Level $level, $char, $vector){
|
||||||
|
if($char === "" || (($mk = $this->getMappingFor($char)) === self::MAP_NO_KEY)) return;
|
||||||
|
$id = is_array($mk) ? $mk[0] : $mk;
|
||||||
|
$meta = is_array($mk) ? $mk[1] : 0;
|
||||||
|
return $level->setBlock($vector, BlockAPI::get($id, $meta));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function init(){}
|
||||||
|
|
||||||
|
protected function getFinalStructure(Level $level, $x, $y, $z){
|
||||||
|
return $this->structure;
|
||||||
|
}
|
||||||
|
public function rotate90deg(Level $level, $x, $y, $z){
|
||||||
|
$str = $this->getFinalStructure($level, $x, $y, $z);
|
||||||
|
foreach($str as &$arr){
|
||||||
|
foreach($arr as &$e){
|
||||||
|
$e = str_split($e);
|
||||||
|
}
|
||||||
|
$new = [];
|
||||||
|
for($i = 0; $i < $this->length; ++$i){
|
||||||
|
$new[] = implode("", array_reverse(array_column($arr, $i)));
|
||||||
|
}
|
||||||
|
$arr = $new;
|
||||||
|
}
|
||||||
|
return (clone $this)->setStructure($str, $this->length, $this->width);
|
||||||
|
}
|
||||||
|
private function setStructure($struct, $width, $length){
|
||||||
|
$this->structure = $struct;
|
||||||
|
$this->width = $width;
|
||||||
|
$this->length = $length;
|
||||||
|
console("Modifed");
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
public function build(Level $level, $centerX, $centerY, $centerZ){
|
||||||
|
$offsetX = $offsetZ = 0;
|
||||||
|
$centWidth = floor($this->width / 2);
|
||||||
|
$centLength = floor($this->length / 2);
|
||||||
|
foreach($this->getFinalStructure($level, $centerX, $centerY, $centerZ) as $offsetY => $blocksXZ){
|
||||||
foreach($blocksXZ as $blocks){
|
foreach($blocksXZ as $blocks){
|
||||||
$blocks = rtrim($blocks);
|
$blocks = rtrim($blocks);
|
||||||
foreach(str_split($blocks) as $block){
|
foreach(str_split($blocks) as $block){
|
||||||
if($centerY + $offsetY == 128) return false;
|
if($centerY + $offsetY == 128) return false;
|
||||||
$vector = new Vector3($centerX - floor($this->width / 2) + $offsetX, $centerY + $offsetY, $centerZ + $offsetZ);
|
$this->placeBlock($level, $block, new Vector3($centerX - $centWidth + $offsetX, $centerY + $offsetY, $centerZ - $centLength + $offsetZ));
|
||||||
//$tempVector->setXYZ($x, $centerY + $offsetY, $z);
|
|
||||||
$this->placeBlock($level, $block, $vector);
|
|
||||||
++$offsetX;
|
++$offsetX;
|
||||||
}
|
}
|
||||||
++$offsetZ;
|
++$offsetZ;
|
||||||
|
|
@ -79,8 +76,6 @@ abstract class Structure{
|
||||||
}
|
}
|
||||||
$offsetZ = 0;
|
$offsetZ = 0;
|
||||||
}
|
}
|
||||||
//console("builded!");
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class StrongholdLibraryStructure{
|
class StrongholdLibraryStructure{
|
||||||
public static $width = 14;
|
public $width = 14;
|
||||||
public static $length = 15;
|
public $length = 15;
|
||||||
public static $tmpStructure;
|
public $structure = [
|
||||||
public static $structure = [
|
|
||||||
-1 => [
|
-1 => [
|
||||||
"SSSSSSSSSSSSSS",
|
"SSSSSSSSSSSSSS",
|
||||||
"SSSSSSSSSSSSSS",
|
"SSSSSSSSSSSSSS",
|
||||||
|
|
@ -194,7 +193,7 @@ class StrongholdLibraryStructure{
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
public static function replaceStoneBricks(){
|
public function replaceStoneBricks(){
|
||||||
foreach(self::$structure as $layerInt => $layer){
|
foreach(self::$structure as $layerInt => $layer){
|
||||||
foreach($layer as $key => $str){
|
foreach($layer as $key => $str){
|
||||||
$line = str_split($str);
|
$line = str_split($str);
|
||||||
|
|
@ -214,7 +213,7 @@ class StrongholdLibraryStructure{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function placeCobweb(){
|
public function placeCobweb(){
|
||||||
foreach(self::$tmpStructure as $layerInt => $layer){
|
foreach(self::$tmpStructure as $layerInt => $layer){
|
||||||
if($layerInt >= 0 and $layerInt <= 3){
|
if($layerInt >= 0 and $layerInt <= 3){
|
||||||
foreach($layer as $key => $str){
|
foreach($layer as $key => $str){
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,9 @@
|
||||||
|
|
||||||
class StrongholdPortalRoomStructure extends Structure{
|
class StrongholdPortalRoomStructure extends Structure{
|
||||||
public $width = 11;
|
public $width = 11;
|
||||||
public $length = 16;
|
public $length = 16;
|
||||||
public $name = "Portal Room";
|
public $name = "Portal Room";
|
||||||
private static $tmpStructure;
|
protected $structure = [
|
||||||
private static $structure = [
|
|
||||||
-1 => [
|
-1 => [
|
||||||
"SSSSSSSSSSS",
|
"SSSSSSSSSSS",
|
||||||
"SSSSSSSSSSS",
|
"SSSSSSSSSSS",
|
||||||
|
|
@ -133,7 +132,7 @@ class StrongholdPortalRoomStructure extends Structure{
|
||||||
"SSSSSSSSSSS",
|
"SSSSSSSSSSS",
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
private $map = [
|
protected $map = [
|
||||||
"S" => "StoneBricksBlock",
|
"S" => "StoneBricksBlock",
|
||||||
"M" => ["StoneBricksBlock", 1],
|
"M" => ["StoneBricksBlock", 1],
|
||||||
"C" => ["StoneBricksBlock", 2],
|
"C" => ["StoneBricksBlock", 2],
|
||||||
|
|
@ -195,10 +194,10 @@ class StrongholdPortalRoomStructure extends Structure{
|
||||||
parent::__construct($this->width, $this->length, $this->name, $this->map);
|
parent::__construct($this->width, $this->length, $this->name, $this->map);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function build($level, $x, $y, $z, $structure = 0){
|
/*public function build($level, $x, $y, $z, $structure = 0){
|
||||||
$this->replaceStoneBricks();
|
$this->replaceStoneBricks();
|
||||||
$this->placeEyes();
|
$this->placeEyes();
|
||||||
|
|
||||||
parent::build($level, $x, $y, $z, self::$tmpStructure);
|
parent::build($level, $x, $y, $z, self::$tmpStructure);
|
||||||
}
|
}*/ // TODO
|
||||||
}
|
}
|
||||||
|
|
@ -1,14 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class SmallFarmStructure extends Structure{
|
class SmallFarmStructure extends Structure{
|
||||||
public $width = 7;
|
public $width = 7;
|
||||||
public $length = 9;
|
public $length = 9;
|
||||||
public $name = "Small Farm";
|
public $name = "Small Farm";
|
||||||
private static $tmpStructure;
|
protected $structure = [
|
||||||
private static $structure = [
|
|
||||||
-1 => [
|
|
||||||
//add sand, clay if here isn't air
|
|
||||||
],
|
|
||||||
0 => [
|
0 => [
|
||||||
"WWWWWWW",
|
"WWWWWWW",
|
||||||
"WFFwFFW",
|
"WFFwFFW",
|
||||||
|
|
@ -19,87 +15,55 @@ class SmallFarmStructure extends Structure{
|
||||||
"WFFwFFW",
|
"WFFwFFW",
|
||||||
"WFFwFFW",
|
"WFFwFFW",
|
||||||
"WWWWWWW",
|
"WWWWWWW",
|
||||||
]
|
],
|
||||||
|
1 => [
|
||||||
|
"",
|
||||||
|
" RR RR ",
|
||||||
|
" RR RR ",
|
||||||
|
" RR RR ",
|
||||||
|
" RR RR ",
|
||||||
|
" RR RR ",
|
||||||
|
" RR RR ",
|
||||||
|
" RR RR ",
|
||||||
|
"",
|
||||||
|
],
|
||||||
];
|
];
|
||||||
private $map = [
|
|
||||||
"W" => "WoodBlock",
|
protected $map = [
|
||||||
"F" => "FarmlandBlock",
|
"W" => WOOD,
|
||||||
"w" => "WaterBlock",
|
"F" => FARMLAND,
|
||||||
"H" => ["WheatBlock", 0],
|
"w" => WATER,
|
||||||
"C" => ["CarrotBlock", 0],
|
" " => 0,
|
||||||
"P" => ["PotatoBlock", 0],
|
"D" => DIRT
|
||||||
"B" => ["BeetrootBlock", 0],
|
|
||||||
" " => "AirBlock"
|
|
||||||
];
|
];
|
||||||
|
protected function getFinalStructure(Level $level, $x, $y, $z)
|
||||||
private function generateCrops(){
|
{
|
||||||
self::$tmpStructure = self::$structure;
|
if(!$level->getBlockWithoutVector($x, $y - 1, $z)->isSolid){
|
||||||
$f = Utils::randomFloat();
|
$structCopy = $this->structure;
|
||||||
if($f <= 0.5){
|
$structCopy[-1] = array_fill(0, $this->length, str_repeat("D", $this->width)); //TODO sand or clay, check for the whole row of water?
|
||||||
parent::setName("Wheat ".$this->name);
|
return $structCopy;
|
||||||
self::$tmpStructure[1] = [
|
|
||||||
"",
|
|
||||||
" HH HH ",
|
|
||||||
" HH HH ",
|
|
||||||
" HH HH ",
|
|
||||||
" HH HH ",
|
|
||||||
" HH HH ",
|
|
||||||
" HH HH ",
|
|
||||||
" HH HH ",
|
|
||||||
"",
|
|
||||||
];
|
|
||||||
}
|
|
||||||
elseif($f <= 0.7){
|
|
||||||
parent::setName("Carrot ".$this->name);
|
|
||||||
self::$tmpStructure[1] = [
|
|
||||||
"",
|
|
||||||
" CC CC ",
|
|
||||||
" CC CC ",
|
|
||||||
" CC CC ",
|
|
||||||
" CC CC ",
|
|
||||||
" CC CC ",
|
|
||||||
" CC CC ",
|
|
||||||
" CC CC ",
|
|
||||||
"",
|
|
||||||
];
|
|
||||||
}
|
|
||||||
elseif($f <= 0.9){
|
|
||||||
parent::setName("Potato ".$this->name);
|
|
||||||
self::$tmpStructure[1] = [
|
|
||||||
"",
|
|
||||||
" PP PP ",
|
|
||||||
" PP PP ",
|
|
||||||
" PP PP ",
|
|
||||||
" PP PP ",
|
|
||||||
" PP PP ",
|
|
||||||
" PP PP ",
|
|
||||||
" PP PP ",
|
|
||||||
"",
|
|
||||||
];
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
parent::setName("Beetroot ".$this->name);
|
|
||||||
self::$tmpStructure[1] = [
|
|
||||||
"",
|
|
||||||
" BB BB ",
|
|
||||||
" BB BB ",
|
|
||||||
" BB BB ",
|
|
||||||
" BB BB ",
|
|
||||||
" BB BB ",
|
|
||||||
" BB BB ",
|
|
||||||
" BB BB ",
|
|
||||||
"",
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
return parent::getFinalStructure($level, $x, $y, $z);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __construct(){
|
|
||||||
parent::__construct($this->width, $this->length, $this->name, $this->map);
|
protected function getMappingFor($char){
|
||||||
}
|
if($char === "R"){
|
||||||
|
$f = Utils::randomFloat();
|
||||||
public function build($level, $x, $y, $z, $structure = 0){
|
|
||||||
$this->generateCrops();
|
if($f <= 0.5){
|
||||||
|
return [WHEAT_BLOCK, 0];
|
||||||
parent::build($level, $x, $y, $z, self::$tmpStructure);
|
}
|
||||||
|
if($f <= 0.7){
|
||||||
|
return [CARROT_BLOCK, 0];
|
||||||
|
}
|
||||||
|
if($f <= 0.9){
|
||||||
|
return [POTATO_BLOCK, 0];
|
||||||
|
}
|
||||||
|
return [BEETROOT_BLOCK, 0];
|
||||||
|
}
|
||||||
|
return parent::getMappingFor($char);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class SmallHouseStructure extends Structure{
|
class SmallHouseStructure extends Structure{
|
||||||
public $width = 5;
|
public $width = 5;
|
||||||
public $length = 5;
|
public $length = 5;
|
||||||
public $name = "Small House";
|
public $name = "Small House";
|
||||||
private static $tmpStructure;
|
protected $structure = [
|
||||||
private static $structure = [
|
|
||||||
0 => [
|
0 => [
|
||||||
"CCCCC",
|
"CCCCC",
|
||||||
"CCCCC",
|
"CCCCC",
|
||||||
|
|
@ -42,7 +41,7 @@ class SmallHouseStructure extends Structure{
|
||||||
"WWWWW",
|
"WWWWW",
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
private $map = [
|
protected $map = [
|
||||||
"C" => "CobbleStoneBlock",
|
"C" => "CobbleStoneBlock",
|
||||||
"P" => "PlanksBlock",
|
"P" => "PlanksBlock",
|
||||||
"W" => "WoodBlock",
|
"W" => "WoodBlock",
|
||||||
|
|
@ -53,10 +52,6 @@ class SmallHouseStructure extends Structure{
|
||||||
" " => "AirBlock"
|
" " => "AirBlock"
|
||||||
];
|
];
|
||||||
|
|
||||||
public function __construct(){
|
|
||||||
parent::__construct($this->width, $this->length, $this->name, $this->map);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function generateFence(){
|
private function generateFence(){
|
||||||
self::$tmpStructure = self::$structure;
|
self::$tmpStructure = self::$structure;
|
||||||
if(Utils::chance(50)){
|
if(Utils::chance(50)){
|
||||||
|
|
@ -75,9 +70,9 @@ class SmallHouseStructure extends Structure{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function build($level, $x, $y, $z, $structure = 0){
|
/*public function build($level, $x, $y, $z, $structure = 0){
|
||||||
$this->generateFence();
|
$this->generateFence();
|
||||||
|
|
||||||
parent::build($level, $x, $y, $z, self::$tmpStructure);
|
parent::build($level, $x, $y, $z, self::$tmpStructure);
|
||||||
}
|
}*/ //TODO
|
||||||
}
|
}
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class VillageLibraryStructure extends Structure{
|
class VillageLibraryStructure extends Structure{
|
||||||
public $width = 9;
|
public $width = 9;
|
||||||
public $length = 8;
|
public $length = 8;
|
||||||
public $name = "Library";
|
public $name = "Library";
|
||||||
private static $structure = [
|
protected $structure = [
|
||||||
0 => [
|
0 => [
|
||||||
" S ",
|
" S ",
|
||||||
"CCCCCCCCC",
|
"CCCCCCCCC",
|
||||||
|
|
@ -96,7 +96,7 @@ class VillageLibraryStructure extends Structure{
|
||||||
"",
|
"",
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
private $map = [
|
protected $map = [
|
||||||
"S" => ["CobbleStoneStairsBlock", 2],
|
"S" => ["CobbleStoneStairsBlock", 2],
|
||||||
"C" => "CobbleStoneBlock",
|
"C" => "CobbleStoneBlock",
|
||||||
"P" => "PlanksBlock",
|
"P" => "PlanksBlock",
|
||||||
|
|
@ -115,10 +115,11 @@ class VillageLibraryStructure extends Structure{
|
||||||
];
|
];
|
||||||
|
|
||||||
public function __construct(){
|
public function __construct(){
|
||||||
parent::__construct($this->width, $this->length, $this->name, $this->map);
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
public function build($level, $x, $y, $z, $structure = 0){
|
public function build($level, $x, $y, $z, $structure = 0){
|
||||||
parent::build($level, $x, $y, $z, self::$structure);
|
parent::build($level, $x, $y, $z, self::$structure);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class WoodHutStructure extends Structure{
|
class WoodHutStructure extends Structure{
|
||||||
public $width = 4;
|
public $width = 4;
|
||||||
public $length = 6;
|
public $length = 6;
|
||||||
public $name = "Wood Hut";
|
public $name = "Wood Hut";
|
||||||
private static $tmpStructure;
|
protected $structure = [
|
||||||
private static $structure = [
|
|
||||||
0 => [
|
0 => [
|
||||||
" S ",
|
" S ",
|
||||||
"CCCC",
|
"CCCC",
|
||||||
|
|
@ -39,7 +38,7 @@ class WoodHutStructure extends Structure{
|
||||||
"WPPW",
|
"WPPW",
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
private $map = [
|
protected $map = [
|
||||||
"S" => ["CobbleStoneStairsBlock", 2],
|
"S" => ["CobbleStoneStairsBlock", 2],
|
||||||
"C" => "CobbleStoneBlock",
|
"C" => "CobbleStoneBlock",
|
||||||
"P" => "PlanksBlock",
|
"P" => "PlanksBlock",
|
||||||
|
|
@ -93,14 +92,10 @@ class WoodHutStructure extends Structure{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __construct(){
|
/*public function build($level, $x, $y, $z, $structure = 0){
|
||||||
parent::__construct($this->width, $this->length, $this->name, $this->map);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function build($level, $x, $y, $z, $structure = 0){
|
|
||||||
$this->generateRoof();
|
$this->generateRoof();
|
||||||
$this->generateTable();
|
$this->generateTable();
|
||||||
|
|
||||||
parent::build($level, $x, $y, $z, self::$tmpStructure);
|
parent::build($level, $x, $y, $z, self::$tmpStructure);
|
||||||
}
|
}*/ //TODO
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue