BetterGen icon indicating copy to clipboard operation
BetterGen copied to clipboard

Chest data packs folder not being created

Open xinghao2003 opened this issue 7 years ago • 12 comments
trafficstars

[22:21:23] [Asynchronous Worker #1 thread/CRITICAL]: ErrorException: "file_get_contents(/root/pm02/plugins/BetterGen/resources/loots/mineshaft.json): failed to open stream: No such file or directory" (EXCEPTION) in "BetterGen-master/src/Ad5001/BetterGen/loot/LootTable" at line 71
[22:21:23] [Asynchronous Worker #1 thread/DEBUG]: #0 (): pocketmine\error_handler(integer 2, string file_get_contents(/root/pm02/plugins/BetterGen/resources/loots/mineshaft.json): failed to open stream: No such file or directory, string /root/pm02/plugins/BetterGen-master/src/Ad5001/BetterGen/loot/LootTable.php, integer 71, array Array())
[22:21:23] [Asynchronous Worker #1 thread/DEBUG]: #1 BetterGen-master/src/Ad5001/BetterGen/loot/LootTable(71): file_get_contents(string /root/pm02/plugins/BetterGen/resources/loots/mineshaft.json)
[22:21:23] [Asynchronous Worker #1 thread/DEBUG]: #2 BetterGen-master/src/Ad5001/BetterGen/populator/MineshaftPopulator(173): Ad5001\BetterGen\loot\LootTable::buildLootTable(pocketmine\math\Vector3 object, integer 2, pocketmine\utils\Random object)
[22:21:23] [Asynchronous Worker #1 thread/DEBUG]: #3 BetterGen-master/src/Ad5001/BetterGen/populator/MineshaftPopulator(332): Ad5001\BetterGen\populator\MineshaftPopulator->generateMineshaftPart(integer 321, integer 38, integer 209, integer 1, pocketmine\utils\Random object)
[22:21:23] [Asynchronous Worker #1 thread/DEBUG]: #4 BetterGen-master/src/Ad5001/BetterGen/populator/MineshaftPopulator(135): Ad5001\BetterGen\populator\MineshaftPopulator->generateMineshaftPart(integer 323, integer 38, integer 209, integer 0, pocketmine\utils\Random object)
[22:21:23] [Asynchronous Worker #1 thread/DEBUG]: #5 BetterGen-master/src/Ad5001/BetterGen/populator/MineshaftPopulator(135): Ad5001\BetterGen\populator\MineshaftPopulator->generateMineshaftPart(integer 317, integer 38, integer 209, integer 0, pocketmine\utils\Random object)
[22:21:23] [Asynchronous Worker #1 thread/DEBUG]: #6 BetterGen-master/src/Ad5001/BetterGen/populator/MineshaftPopulator(345): Ad5001\BetterGen\populator\MineshaftPopulator->generateMineshaftPart(integer 312, integer 38, integer 209, integer 0, pocketmine\utils\Random object)
[22:21:23] [Asynchronous Worker #1 thread/DEBUG]: #7 BetterGen-master/src/Ad5001/BetterGen/populator/MineshaftPopulator(335): Ad5001\BetterGen\populator\MineshaftPopulator->generateMineshaftPart(integer 310, integer 34, integer 209, integer 2, pocketmine\utils\Random object)
[22:21:23] [Asynchronous Worker #1 thread/DEBUG]: #8 BetterGen-master/src/Ad5001/BetterGen/populator/MineshaftPopulator(329): Ad5001\BetterGen\populator\MineshaftPopulator->generateMineshaftPart(integer 310, integer 34, integer 206, integer 0, pocketmine\utils\Random object)
[22:21:23] [Asynchronous Worker #1 thread/DEBUG]: #9 BetterGen-master/src/Ad5001/BetterGen/populator/MineshaftPopulator(176): Ad5001\BetterGen\populator\MineshaftPopulator->generateMineshaftPart(integer 307, integer 34, integer 206, integer 1, pocketmine\utils\Random object)
[22:21:23] [Asynchronous Worker #1 thread/DEBUG]: #10 BetterGen-master/src/Ad5001/BetterGen/populator/MineshaftPopulator(69): Ad5001\BetterGen\populator\MineshaftPopulator->generateMineshaftPart(integer 313, integer 34, integer 206, integer 1, pocketmine\utils\Random object)
[22:21:23] [Asynchronous Worker #1 thread/DEBUG]: #11 BetterGen-master/src/Ad5001/BetterGen/generator/BetterNormal(392): Ad5001\BetterGen\populator\MineshaftPopulator->populate(pocketmine\level\SimpleChunkManager object, integer 19, integer 13, pocketmine\utils\Random object)
[22:21:23] [Asynchronous Worker #1 thread/DEBUG]: #12 src/pocketmine/level/generator/PopulationTask(109): Ad5001\BetterGen\generator\BetterNormal->populateChunk(integer 19, integer 13)
[22:21:23] [Asynchronous Worker #1 thread/DEBUG]: #13 src/pocketmine/scheduler/AsyncTask(67): pocketmine\level\generator\PopulationTask->onRun()
[22:21:23] [Asynchronous Worker #1 thread/DEBUG]: #14 (): pocketmine\scheduler\AsyncTask->run()
[22:21:23] [Server thread/CRITICAL]: Could not execute asynchronous task PopulationTask: Task crashed

xinghao2003 avatar Jan 29 '18 14:01 xinghao2003

Have you tried on the latest version of master? This should be fixed

Ad5001 avatar Jan 29 '18 17:01 Ad5001

@Ad5001 I confirm, there is a mistake .I'm using the latest version of master. Fix please.

ghost avatar Jan 29 '18 19:01 ghost

@ad5001 I'll submit a PR to fix this. The problem is: It's looking for the /plugins/BetterGen/resources/loots/mineshaft.json file. Currently, the plug-in simply does not generate ANY loots files. This can be solved by manually creating the files and directories then copying and pasting the contenst from this repo to the new files, or through a code change.

AvgZing avatar Jan 29 '18 19:01 AvgZing

Still working on this. Heads up: There's built in functions for getting DataFolder instead of PlugiNFolder.

AvgZing avatar Feb 16 '18 01:02 AvgZing

Note that on async thread, you cannot call pluins method

Ad5001 avatar Feb 16 '18 07:02 Ad5001

No? it seems to be working in my modified fix...

AvgZing avatar Feb 16 '18 13:02 AvgZing

It depends if you generated a new world or used the debug command. The debug command is called on the main thread whereas the other ones in the generator is called in the Async one.

Ad5001 avatar Feb 16 '18 16:02 Ad5001

I'll try both when I get a chance

AvgZing avatar Feb 16 '18 22:02 AvgZing

Is there anything I can do to help? I'm running pocketmine-mp 1.7dev build 717 (in a docker container), and would love to have a functional custom generator. The rolling hills are getting a bit old. ;)

skinlayers avatar Feb 17 '18 20:02 skinlayers

@skinlayers The best way you could help the project if you aren't a developer is by both/either testing the unstable branch (helps us testing new features) and spreading the word around you about this project :)

Ad5001 avatar Feb 17 '18 22:02 Ad5001

I'm primarily server admin (day job) who knows bash and python, but I also know a little bit of PHP, Java, and Ruby. But "unstable" branch do you mean the "loottables" branch or "master"?

skinlayers avatar Feb 18 '18 01:02 skinlayers

master mainly. Loottable is mainly inactive

Ad5001 avatar Feb 18 '18 10:02 Ad5001