Fix legal issues

This commit is contained in:
thebigsmileXD 2017-05-16 12:02:29 +02:00
parent 1f10807c7b
commit 2767113421
7 changed files with 14 additions and 8 deletions

3
.gitmodules vendored
View file

@ -1,3 +0,0 @@
[submodule "resources/mcpe-default-addon"]
path = resources/mcpe-default-addon
url = https://github.com/dktapps/mcpe-default-addon.git

View file

@ -46,4 +46,14 @@ 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. ### 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> <img src="https://raw.githubusercontent.com/Ad5001/BetterGen/master/imgs/bushes.png" style="width: 500px"></img>
-----
# Notice:
### To generate loot like in vanilla MCPE, you have to put the default behaviour pack contents of the game into the "addon" folder.
### Due to legal issues we are not able to include these directly into the repository.
### You can get them here: https://aka.ms/behaviorpacktemplate or here https://github.com/dktapps/mcpe-default-addon for an optimised version
### The folder has to look like this:
<img src="https://raw.githubusercontent.com/Ad5001/BetterGen/master/imgs/addon_setup.png" style="width: 500px"></img>
All content here is copyrighted (C) Ad5001 2017. Infos about this copyright can be found in the license file. All content here is copyrighted (C) Ad5001 2017. Infos about this copyright can be found in the license file.

BIN
imgs/addon_setup.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View file

@ -1 +0,0 @@
[]

@ -1 +0,0 @@
Subproject commit f74c0588519ea390f5a09270d9c5d28d53e2de57

View file

@ -88,7 +88,8 @@ class Main extends PluginBase implements Listener {
Generator::addGenerator(BetterNormal::class, "betternormal"); Generator::addGenerator(BetterNormal::class, "betternormal");
if ($this->isOtherNS()) $this->getLogger()->warning("Tesseract detected. Note that Tesseract is not up to date with the generation structure and some generation features may be limited or not working"); if ($this->isOtherNS()) $this->getLogger()->warning("Tesseract detected. Note that Tesseract is not up to date with the generation structure and some generation features may be limited or not working");
@mkdir($this->getDataFolder()); @mkdir($this->getDataFolder());
if (!in_array($this->getDataFolder() . 'resources\mcpe-default-addon\.', $this->getResources())) $this->getLogger()->alert('The loot files are missing! Make sure you got all files / did git clone --recursive'); @mkdir($this->getDataFolder() . 'addon');
if ((($files = @scandir($this->getDataFolder() . 'addon')) && count($files) <= 2)) $this->getLogger()->alert('The loot files are missing, this means no loot will generate! You can get them here: https://aka.ms/behaviorpacktemplate or here https://github.com/dktapps/mcpe-default-addon for an optimised version');
} }
/** /**
@ -324,7 +325,7 @@ class Main extends PluginBase implements Listener {
if (!$tile instanceof TileChest) return; if (!$tile instanceof TileChest) return;
//Check if lootchest (or already generated loot) //Check if lootchest (or already generated loot)
if (!isset($tile->namedtag->generateLoot)) return; if (!isset($tile->namedtag->generateLoot)) return;
$table = new LootTable($config = new Config(self::getInstance()->getDataFolder() . '\\resources\\mcpe-default-addon\\' . $tile->namedtag->generateLoot . '.json')); $table = new LootTable($config = new Config(self::getInstance()->getDataFolder() . 'addon\\' . $tile->namedtag->generateLoot . '.json', Config::DETECT, []));
$size = $tile->getInventory()->getSize(); $size = $tile->getInventory()->getSize();
$loot = $table->getRandomLoot($random); $loot = $table->getRandomLoot($random);
$items = array_pad($loot, $size, Item::get(0)); $items = array_pad($loot, $size, Item::get(0));

View file

@ -56,7 +56,7 @@ class LootTable {
$val = $rolls["entries"][$this->getRandomWeightedElement($array)]; $val = $rolls["entries"][$this->getRandomWeightedElement($array)];
//typecheck //typecheck
if ($val["type"] == "loot_table") { if ($val["type"] == "loot_table") {
$loottable = new LootTable(new Config(Main::getInstance()->getDataFolder() . '\\resources\\mcpe-default-addon\\' . $val["name"] . ".json")); $loottable = new LootTable(new Config(Main::getInstance()->getDataFolder() . 'addon\\' . $val["name"] . ".json", Config::DETECT, []));
$items = array_merge($items, $loottable->getRandomLoot($random)); $items = array_merge($items, $loottable->getRandomLoot($random));
unset($loottable); unset($loottable);
} elseif ($val["type"] == "item") { } elseif ($val["type"] == "item") {