Continuing on dungeons

This commit is contained in:
Ad5001 2017-10-31 23:27:33 +01:00
父節點 bdb77f6e81
當前提交 a671c0c29c
共有 6 個文件被更改,包括 180 次插入111 次删除

193
LICENSE
查看文件

@ -1,128 +1,113 @@
BoxOfDevs General Software License 1.1.4
Not Truly Open Source License
=========================================
This license is designed to be used with any software which would like to have no selling for profits, nor any public redistribution without giving the original author credits.
--------------------------------------------------------------------------------------------------------------------------------------
The License: refers to the BoxOfDevs International Software License 1.1.2
The Software: refers to any works licensed under The License.
The Modification: refers to any modified version of The Software.
The Redistribution: refers to any redistributions of The Software/The Modification.
The User: refers to any user of The Software licensed under The License.
The Author: refers to any developer, organisation, legal owner, or creator of The Software that has been licensed under the The License.
--------------------------------------------------------------------------------------------------------------------------------------
Section 1 - Allowances:
This license is an adaption of the Creative Commons Licenses for softwares.
Any user using and, or Distributing the Software (defined in I) exerces the Licensed Rights.
By exercising the Licenced Rights (defined below), You accept and agree to be bound by the terms and conditions of this Not Truly Open Source ("NTOS License"). To the extent the NTOS License may be interpreted as a contract, You are granted the Licenced Rights in consideration of Your acceptance of these terms and conditions, and the Author grants You such rights in consideration of benefits the Author receives from making the Software available under these terms and conditions.
I. Definitions:
- "NTOS License" refers to the legal terms of this license, described here.
- "Licensed Rights" refers the rights granted to You subject to the terms and conditions of the NTOS License, which are limited to all Copyright and Similar Rights that apply to Your use of the Software and that the Author has authority to license.
- "The Software" refers to any work, code and software binaries licensed under the NTOS License.
- "The Author" refers the orginal author of the Software, the one that licenced the Software under the NTOS License.
- "the User", "User", "You", and "Your" refers the individual or entity exercising the Licenced Rights under the NTOS License.
- "the Modification" refers to based of the Software.
- "the Modification's Author" refers to an User that Distributes the Modificaction including more than 10% of the Software's code.
- "Code" refers to any part of the code located in the Software.
- "the Based Software" refers to work other than the Software using the Code. The used Code must not be larger than 10% of the code of the Software. Otherwise, the work is a Modification.
- "the Based Software's Author" refers to an User that created the
- "The End User" refers to the individual person accessing and, or using the Software. The End User may be or not the same as the User.
- "Exceptions and Limitations" refers to the fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Software.
- "Copyright and Similar Rights" refers to the copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the Licenced Rights are labeled or categorized. For purposes of the NTOS License, the Licenced Rights specified in II(2)(a)-(b) are not Copyright and Similar Rights.
- "Distribute" refers to any way of providing The End User an access to the Software either by a downloading Platform or from any internet connected process allowing the user to access the Software content.
- "NonCommercial" means not primarily intended for or directed towards commercial advantage or monetary compensation. For purposes of the NTOS License, the exchange of the Software for other material subject to Copyright and Similar Rights by digital file-sharing or similar means is NonCommercial provided there is no payment of monetary compensation in connection with the exchange.
- "Sui Generis Database Rights" refers to the Licenced Rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
1. Both The User & The Author Can:
a. Modify private copies of The Software and use in any way they wish.
Section II. Scope.
2. The User Can:
a. Request new features, support, or more rights from The Author.
b. Redistribute The Software/The Modification, ensuring The User gives all appropriate credit to The Author and alerting The Author to The Redistribution.
1. License grant.
a. Subject to the terms and conditions of the NTOS License, the Author hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licenced Rights in the Software to:
A. reproduce and Distribute the Software, in whole or in part, for NonCommercial purposes only; and
B. produce, reproduce, and Distribute Modification for NonCommercial purposes only.
b. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, the NTOS License does not apply, and You do not need to comply with its terms and conditions.
c. Term. The term of the NTOS License is specified in Section VI(1).
d. Downstream recipients.
Offer from the Author Software. Every recipient of the Software automatically receives an offer from the Author to exercise the Licenced Rights under the terms and conditions of the NTOS License.
Additional offer from the Author Modification. Every recipient of Modification from You automatically receives an offer from the Author to exercise the Licenced Rights in the Modification under the conditions of the the Modification's Author's License You apply.
No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Software if doing so restricts exercise of the Licenced Rights by any recipient of the Software.
e. No endorsement. Nothing in the NTOS License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Software is, connected with, or sponsored, endorsed, or granted official status by, the Author or others designated to receive attribution as provided in Section III(1)(a)(A)(i).
2. Other rights.
a. Moral rights, such as the right of integrity, are not licensed under the NTOS License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Author waives and/or agrees not to assert any such rights held by the Author to the limited extent necessary to allow You to exercise the Licenced Rights, but not otherwise.
b. Patent and trademark rights are not licensed under the NTOS License.
c. To the extent possible, the Author waives any right to collect royalties from You for the exercise of the Licenced Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Author expressly reserves any right to collect such royalties, including when the Software is used other than for NonCommercial purposes.
3. The Author Can:
a. Change or update The Software in any way they wish, ensuring they follow the other terms of The License.
b. Change which license The Software/The Modification is licensed under.
c. Grant extra rights to The User who has requested them.
d. Reserve the right to request The User to take down their instance of The Software/The Modification/The Redistribution.
Section III. License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the following conditions.
Section 2 - Restrictions:
1. Both The User & The Author Cannot:
a. Introduce any malicious code into The Software/The Modification.
b. Sell any part of The Software/The Modification for profit.
1. Attribution.
a. If You Distribute the Software (including in modified, or based form), You must:
A. retain the following if it is supplied by the Author with the Software:
i. identification of the creator(s) of the Software and any others designated to receive attribution, in any reasonable manner requested by the Author (including by pseudonym if designated);
ii. a copyright notice;
iii. a notice that refers to the NTOS License;
iv. a notice that refers to the disclaimer of warranties;
v. a URI or hyperlink to the Software to the extent reasonably practicable;
indicate if You modified the Software and retain an indication of any previous modifications; and
indicate the Software is licensed under the NTOS License, and include the text of, or the URI or hyperlink to, the NTOS License.
b. You may satisfy the conditions in Section III(1)(a) in any reasonable manner based on the medium, means, and context in which You Distribute the Software. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
c. If requested by the Author, You must remove any of the information required by Section III(1)(a)(A) to the extent reasonably practicable.
2. The User Cannot:
a. Hold The Author responsible for any unknown errors.
b. Claim The Software/The Modification/The Redistribution as entirely The User's product.
c. Use the software without crediting the Author.
2. Distribute ALike
In addition to the conditions in Section III(1), if You Distribute the Modification You produce, the following conditions also apply.
A. The Modification Author's License You apply must be the NTOS License
B. You must include the text of, or the URI or hyperlink to, the Modification's Author's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Distribute the Modification.
C. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Modification that restrict exercise of the rights granted under the Modification's Author's License You apply.
D. You may not apply any fee to access the Modification
3. The Author Cannot:
a. Restrict The User in any way not specified by The License.
b. Distribute any form of The Software without proper documentation.
3. Distribution of code
In addition to the conditions in Section III(1), if You Distribute a Based Software, the following conditions also apply:
A. You must include the text of, or the URI or hyperlink to, refering to this License. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Distribute the Based Software.
B. You must also include Section III(1)(a)(A)(ii-v) in the the Based Software Code.
Term. The term of this License is specified in Section 6(a).
Media and formats; technical modifications allowed. The Author authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Author waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this License, simply making modifications authorized by this Section 2(a)(4) never produces Modification.
Section IV. Sui Generis Database Rights.
Downstream recipients.
Offer from the Author Software. Every recipient of the Software automatically receives an offer from the Author to exercise the Licensed Rights under the terms and conditions of this License.
Additional offer from the Author the Modification. Every recipient of the Modification from You automatically receives an offer from the Author to exercise the Licensed Rights in the Modification under the conditions of the Adapter’s License You apply.
No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Software if doing so restricts exercise of the Licensed Rights by any recipient of the Software.
No endorsement. Nothing in this License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Software is, connected with, or sponsored, endorsed, or granted official status by, the Author or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Software:
Other rights.
Moral rights, such as the right of integrity, are not licensed under this License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Author waives and/or agrees not to assert any such rights held by the Author to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
Patent and trademark rights are not licensed under this License.
To the extent possible, the Author waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Author expressly reserves any right to collect such royalties.
for the avoidance of doubt, Section II(1)(a) grants You the right to extract, reuse, reproduce, and Dstribute all or a substantial portion of the contents of the database for NonCommercial purposes only;
if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is the Modification, including for purposes of Section III(2); and
You must comply with the conditions in Section III(1) if You Distribute all or a substantial portion of the contents of the database.
Section 3 License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the following conditions.
a) Attribution.
If You Share the Software (including in modified form), You must:
retain the following if it is supplied by the Author with the Software:
identification of the creator(s) of the Software and any others designated to receive attribution, in any reasonable manner requested by the Author (including by pseudonym if designated);
a copyright notice;
a notice that refers to this License;
a notice that refers to the disclaimer of warranties;
a URI or hyperlink to the Software to the extent reasonably practicable;
indicate if You modified the Software and retain an indication of any previous modifications; and
indicate the Software is licensed under this License, and include the text of, or the URI or hyperlink to, this License.
You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Software. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
If requested by the Author, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.
b) ShareAlike.
In addition to the conditions in Section 3(a), if You Share the Modification You produce, the following conditions also apply.
The Adapter’s License You apply must be a BoxOfDevs General License with the same License Elements, this version or later, or a BY-SA Compatible License.
You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share the Modification.
You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Modification that restrict exercise of the rights granted under the Adapter's License You apply.
c) Forever Open Source.
In addition to the conditions in Section 3(a) and Section 3(b), if You Share the Modification You produce, the following conditions also apply.
The Adapted work must have an open source existing repertory, accessible by anyone anytime linked in the Redistribution Description/Documentation.
You may not restrict anyone from accessing the source code, use it, and redistribute it under anything not explicily specified by the License.
d) Free.
In addition to the conditions in Section 3(a), Section 3(b) and Section 3(c), if You Share by any way Modification and/or the Software You produce, the following conditions also apply.
The Work must be redistributed entirely free, under this license.
You may not impose fees to anyone that gets the Modification/The Software.
For the avoidance of doubt, this Section IV supplements and does not replace Your obligations under the NTOS License where the Licensed Rights include other Copyright and Similar Rights.
Section 4 Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Software:
Section V Disclaimer of Warranties and Limitation of Liability.
for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database;
if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Modification, including for purposes of Section 3(b); and
You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
1. Unless otherwise separately undertaken by the Author, to the extent possible, the Author offers the Software as-is and as-available, and makes no representations or warranties of any kind concerning the Software, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.
2. To the extent possible, in no event will the Author be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of the NTOS License or use of the Software, even if the Author has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.
For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this License where the Licensed Rights include other Copyright and Similar Rights.
3. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
Section 5 Disclaimer of Warranties and Limitation of Liability.
Unless otherwise separately undertaken by the Author, to the extent possible, the Author offers the Software as-is and as-available, and makes no representations or warranties of any kind concerning the Software, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.
To the extent possible, in no event will the Author be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this License or use of the Software, even if the Author has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.
Section VI Term and Termination.
The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
The NTOS License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with the NTOS License, then Your rights under the NTOS License terminate automatically.
Section 6 Term and Termination.
This License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this License, then Your rights under this License terminate automatically.
Where Your right to use the Software has terminated under Section 6(a), it reinstates:
automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
upon express reinstatement by the Author.
For the avoidance of doubt, this Section 6(b) does not affect any right the Author may have to seek remedies for Your violations of the NTOS License.
For the avoidance of doubt, the Author may also offer the Software under separate terms or conditions or stop distributing the Software at any time; however, doing so will not terminate the NTOS License.
Sections I, V, VI, VII, and VI survive termination of the NTOS License.
Where Your right to use the Software has terminated under Section 6(a), it reinstates:
automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
upon express reinstatement by the Author.
For the avoidance of doubt, this Section 6(b) does not affect any right the Author may have to seek remedies for Your violations of this License.
For the avoidance of doubt, the Author may also offer the Software under separate terms or conditions or stop distributing the Software at any time; however, doing so will not terminate this License.
Sections 1, 5, 6, 7, and 8 survive termination of this License.
Section VII Other Terms and Conditions.
Section 7 Other Terms and Conditions.
The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
Any arrangements, understandings, or agreements regarding the Software not stated herein are separate from and independent of the terms and conditions of the NTOS License.
The Author shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
Any arrangements, understandings, or agreements regarding the Software not stated herein are separate from and independent of the terms and conditions of this License.
In the event that The License is updated/changed on the official github repository/on the official website, you automatically agree.
The Author is not required to notify The User that The License has been updated/changed.
Section VIII Interpretation.
Section 8 Interpretation.
For the avoidance of doubt, this License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Software that could lawfully be made without permission under this License.
For the avoidance of doubt, the NTOS License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Software that could lawfully be made without permission under the NTOS License.
To the extent possible, if any provision of the NTOS License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from the NTOS License without affecting the enforceability of the remaining terms and conditions.
No term or condition of the NTOS License will be waived and no failure to comply consented to unless expressly agreed to by the Author.
Nothing in the NTOS License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Author or You, including from the legal processes of any jurisdiction or authority.
To the extent possible, if any provision of this License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this License without affecting the enforceability of the remaining terms and conditions.
No term or condition of this License will be waived and no failure to comply consented to unless expressly agreed to by the Author.
Nothing in this License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Author or You, including from the legal processes of any jurisdiction or authority.
Copyright (C) Ad5001 2017
In case of a specific issue not specified in the NTOSL, Berne Convention for the Protection of Literary and Artistic Works, which reserves all rights to the Author applies. You can find Berne Convention for the Protection of Literary and Artistic Works at http://www.wipo.int/treaties/en/text.jsp?file_id=283698.

查看文件

@ -46,4 +46,8 @@ Welcome user to the home of a new PocketMine World Generator which features 9 ne
### These two biomes now are a bit better by the additions of bushes.
<img src="https://raw.githubusercontent.com/Ad5001/BetterGen/master/imgs/bushes.png" style="width: 500px"></img>
All content here is copyrighted (C) Ad5001 2017. Infos about this copyright can be found in the license file.
# Contributors:
BetterGen wouldn't be here today without the following guys who have made this plugin possible to get where it is now:
Ad5001
thebigsmileXD
wyt3dr4g0n

查看文件

@ -14,6 +14,9 @@
# @version 1.1
name: BetterGen
author: Ad5001
contributors:
- thebigsmileXD (XenialDan)
- wyt3dr4g0n
main: Ad5001\BetterGen\Main
version: 1.1
load: STARTUP

查看文件

@ -0,0 +1,70 @@
<?php
/**
* ____ __ __ ____
* /\ _`\ /\ \__ /\ \__ /\ _`\
* \ \ \L\ \ __ \ \ ,_\\ \ ,_\ __ _ __ \ \ \L\_\ __ ___
* \ \ _ <' /'__`\\ \ \/ \ \ \/ /'__`\/\`'__\\ \ \L_L /'__`\ /' _ `\
* \ \ \L\ \/\ __/ \ \ \_ \ \ \_ /\ __/\ \ \/ \ \ \/, \/\ __/ /\ \/\ \
* \ \____/\ \____\ \ \__\ \ \__\\ \____\\ \_\ \ \____/\ \____\\ \_\ \_\
* \/___/ \/____/ \/__/ \/__/ \/____/ \/_/ \/___/ \/____/ \/_/\/_/
* Tomorrow's pocketmine generator.
* @author Ad5001 <mail@ad5001.eu>, XenialDan <https://github.com/thebigsmileXD>
* @link https://github.com/Ad5001/BetterGen
* @category World Generator
* @api 3.0.0
* @version 1.1
*/
namespace Ad5001\BetterGen\populator;
use Ad5001\BetterGen\utils\BuildingUtils;
use Ad5001\BetterGen\structure\Dungeons;
use pocketmine\block\Block;
use pocketmine\level\ChunkManager;
use pocketmine\level\Level;
use pocketmine\math\Vector3;
use pocketmine\utils\Random;
class DungeonPopulator extends AmountPopulator {
/** @var ChunkManager */
protected $level;
/**
* Populates the chunk
*
* @param ChunkManager $level
* @param int $chunkX
* @param int $chunkZ
* @param Random $random
* @return void
*/
public function populate(ChunkManager $level, $chunkX, $chunkZ, Random $random) {
$this->level = $level;
$amount = $this->getAmount($random);
if($amount == 5) { // 1 out of 10 chunks
$x = $random->nextRange($chunkX << 4, ($chunkX << 4) + 15);
$z = $random->nextRange($chunkZ << 4, ($chunkZ << 4) + 15);
$y = $random->nextRange(10, $this->getHighestWorkableBlock($x, $z));
$d = new Dungeons();
$d->placeObject($level, $x, $y, $z, $random);
}
}
/**
* Gets the top block (y) on an x and z axes
* @param int $x
* @param int $z
*/
protected function getHighestWorkableBlock($x, $z) {
for($y = Level::Y_MAX - 1; $y > 0; -- $y) {
$b = $this->level->getBlockIdAt($x, $y, $z);
if ($b === Block::DIRT or $b === Block::GRASS or $b === Block::PODZOL or $b === Block::SAND or $b === Block::SNOW_BLOCK or $b === Block::SANDSTONE) {
break;
} elseif ($b !== 0 and $b !== Block::SNOW_LAYER and $b !== Block::WATER) {
return - 1;
}
}
return ++$y;
}
}

查看文件

@ -47,14 +47,21 @@ class Dungeons extends PopulatorObject {
public function placeObject(ChunkManager $level, $x, $y, $z, Random $random) {
$xDepth = 2 + $random->nextBoundedInt(4);
$zDepth = 2 + $random->nextBoundedInt(4);
BuildingUtils::fillCallback(new Vector3($x + $xDepth, $y, $x + $zDepth), new Vector3($x - $xDepth, $y, $z - $zDepth), function($v3, $level, $v3n2, $xDepth, $zDepth, $random) {
if($v3->x == $v3n2->x + $xDepth || $v3->x == $v3n2->x - $xDepth || $v3->y == $v3n2->y || $v3->y == $v3n2->y + 5 || $v3->z == $v3n2->z + $zDepth || $v3->z == $v3n2->z - $zDepth) {
echo "Building dungeon at $x, $y, $z\n";
BuildingUtils::fillCallback(new Vector3($x + $xDepth, $y, $x + $zDepth), new Vector3($x - $xDepth, $y + 5, $z - $zDepth), function($v3, $level, $v3n2, $xDepth, $zDepth, $random) {
if($v3->x == $v3n2->x + $xDepth ||
$v3->x == $v3n2->x - $xDepth ||
$v3->y == $v3n2->y ||
$v3->y == $v3n2->y + 5 ||
$v3->z == $v3n2->z + $zDepth ||
$v3->z == $v3n2->z - $zDepth) {
if($random->nextBoolean()) {
$level->setBlockIdAt($v3->x, $v3->y, $v3->z, Block::MOSSY_STONE);
$level->setBlockIdAt($v3->x, $v3->y, $v3->z, Block::MOSS_STONE);
} else {
$level->setBlockIdAt($v3->x, $v3->y, $v3->z, Block::COBBLESTONE);
}
} else {
$level->setBlockIdAt($v3->x, $v3->y, $v3->z, Block::AIR);
}
}, $level, new Vector3($x, $y, $z), $xDepth, $zDepth, $random);
$level->setBlockIdAt($x, $y + 1, $z, Block::MOB_SPAWNER);

查看文件

@ -84,8 +84,8 @@ class BuildingUtils {
list($pos1, $pos2) = self::minmax($pos1, $pos2);
$return = [];
for($x = $pos1->x; $x >= $pos2->x; $x --) for($y = $pos1->y; $y >= $pos2->y; $y --) for($z = $pos1->z; $z >= $pos2->z; $z --) {
$return[] = call_user_func($call, new Vector3($x, $y, $z), ...$params);
}
$return[] = call_user_func($call, new Vector3($x, $y, $z), ...$params);
}
return $return;
}