85136b7b4a
Entity: Attach to level & chunk after initEntity() call, not before
...
this avoids leaving garbage entities attached to chunks when exceptions are thrown during initEntity().
2018-06-09 16:59:22 +01:00
47742d74c8
Player: Drop load queue on level switch
...
This ensures that the player doesn't request bad chunks if it was teleported from an invalid level.
2018-06-09 16:21:41 +01:00
ca54c8d78e
Merge branch 'master' of https://github.com/pmmp/pocketmine-mp
2018-06-09 16:21:01 +01:00
601811f0f8
Player: Account for the possibility of Level being null in switchLevel()
...
the Entity base also accounts for this, and assuming that this is automatically valid is causing lots of crashes. I am not sure of the circumstances under which this is suddenly becoming null, but this shouldn't assume that the level is valid nonetheless.
2018-06-09 16:20:51 +01:00
aeb551b317
Remove double use of spl_object_hash ( #2226 )
2018-06-09 14:15:50 +01:00
37b445f210
Updated Math dependency
2018-06-09 13:05:25 +01:00
d04991feb6
Level: Avoid chunk sending bugs caused by duplicate chunks with wrong coordinates
...
If the same chunk is set into multiple different places in the world, the chunk's position is no longer able to be relied on, because it will have the position of the last place it was set. This results in chunks not getting sent correctly when the same chunk is set in multiple places.
This avoids the bug by using known valid coordinates (using chunk hashes) to establish the real coordinates, and also adds an assert to notify developers should they unintentionally set a duplicate chunk by mistake.
2018-06-09 11:25:45 +01:00
c327b3d2c4
AsyncPool: be less dependent on Server in the code
...
The goal is to remove the Server things from here completely.
2018-06-08 20:08:23 +01:00
af69418a55
PlainBiome: reduce maximum elevation
2018-06-08 13:04:45 +01:00
8cd311bcb4
GroundCover: don't replace liquid with can-be-flowed-into blocks
...
fixes snow layers generating underwater
2018-06-08 11:15:19 +01:00
78ec3937bf
BiomeSelector: drastically simplified implementation and made more robust
...
- Doesn't need to be pre-populated with biomes prior to calculating the heatmap - now population of biomes is entirely dependent on the lookup function, improving consistency
- Uses an abstract class method for lookup instead of callback (use anonymous class instead)
- Faster because the heatmap is directly populated with biomes instead of biome IDs, removing an unnecessary lookup.
2018-06-08 10:19:08 +01:00
4e3e807741
Biome: Added UnknownBiome class to avoid astonishing behaviour on unknown biomes
2018-06-08 10:19:08 +01:00
8c6161a4f2
Biome: make biomes list use an SplFixedArray
2018-06-08 10:19:08 +01:00
c8a87b14d5
PopulationTask: actually fix locks not getting released in generation errors
2018-06-07 23:53:59 +01:00
8fca7cc68d
Apply some typehints to generators
2018-06-07 20:22:35 +01:00
45f940681a
Make Normal->pickBiome() private
2018-06-07 20:21:26 +01:00
e3c97d7d5e
Flat: clean up more garbage
2018-06-07 20:18:04 +01:00
172abef2a7
Flat: clean up generation of base chunk
2018-06-07 20:11:29 +01:00
709abb02e6
Generator: remove more dead incomplete code
...
again, this can be added when and if it's actually implemented.
2018-06-07 19:54:51 +01:00
428ca29e4b
Remove dead bedrockDepth fields from generator
...
yes, this is not implemented yet. fields for this can be added when proper bedrock generation is implemented. For now, it's just dead code.
2018-06-07 19:52:56 +01:00
f61ad20f6b
Remove a whole bunch of dead copy-pasted code from Nether generator
2018-06-07 19:51:27 +01:00
3c9af5cd6d
Generator: small reduction of code duplication
2018-06-07 19:49:51 +01:00
996935e9b2
Cleaned up level seed handling
2018-06-07 19:39:24 +01:00
3707a41b67
Server: small cleanup to seed handling
2018-06-07 18:25:44 +01:00
354b2dc5d1
and an extra note just in case
2018-06-07 15:20:51 +01:00
0c70b83d81
LevelProvider: workaround bug fixed in b54197904d
for previously-affected worlds
2018-06-07 15:18:42 +01:00
083a1e1ff6
GeneratorManager: Make addGenerator() throw exceptions instead of returning false
2018-06-07 14:34:26 +01:00
17b58357fb
GeneratorManager: add documentation for functions
2018-06-07 14:30:19 +01:00
96a4dbb7d8
GeneratorManager: add typehints
2018-06-07 14:24:01 +01:00
5eec683110
Generator: Moved generator registering things to a separate GeneratorManager class
...
this isolates the concerns of the Generator class, and also removes cyclic dependencies between the Generator class and its descendents.
2018-06-07 13:48:01 +01:00
0bca3cd481
Generator: Move static noise functions to Noise instance methods
2018-06-07 13:40:10 +01:00
b54197904d
Fixed imported worlds getting PM classpaths written into their level.dat for generator
...
This will not fix existing worlds affected by this bug.
2018-06-07 13:20:50 +01:00
fb484087a8
Entity: Remove unnecessary scheduleUpdate() call from initEntity()
...
this is already done by the constructor
2018-06-07 12:53:59 +01:00
14914781fc
Added exception throws when a closed tile or entity attempts to schedule itself for updating
...
I can't believe it took so long to find what was causing these stdClass bugs.
2018-06-07 12:37:26 +01:00
fdd5b7b9c9
Entity: Fixed despawn flagging not kicking in until scheduling updates on entities
2018-06-07 12:34:23 +01:00
c83c0eb935
Entity: Move responsibility of checking for despawn to Level
...
this ensures that flagging for despawn will always work as intended, including when onUpdate() is overridden.
2018-06-07 12:31:21 +01:00
b331f8e1c9
AsyncWorker: added removeFromThreadStore()
...
and use it instead of overwriting with null things, which still occupies memory
2018-06-07 10:12:50 +01:00
ee787974f2
AsyncWorker: Use statics for thread-local worker storage instead of globals
2018-06-07 09:59:32 +01:00
73e56c8a36
Utils: Make kill() use static MainLogger instead of global variable
2018-06-07 09:29:53 +01:00
5f7c884255
Reduce AsyncWorker default memory limit to 256MB
...
a worker shouldn't be using as much memory as the main server thread would, so 1024MB is extremely excessive.
2018-06-06 18:49:48 +01:00
2b5e6b790f
BanList: rename poorly-named parameter
2018-06-06 18:18:06 +01:00
1a21041d00
AsyncPool: Parameterize worker memory limit instead of calling back into Server
2018-06-06 18:00:56 +01:00
7b17a83227
Level: fix chunk locks not getting released on generation errors
2018-06-06 11:42:29 +01:00
edd150971e
CommandReader: Use statics for thread-local storage instead of globals
2018-06-06 10:06:52 +01:00
38f4afb17c
Make sure that test failures kill the build
2018-06-05 19:49:22 +01:00
9d16863b1a
Convert some TesterPlugin tests into PHPUnit tests, add PHPUnit configuration
2018-06-05 19:33:21 +01:00
41a179e6e1
BlockFactory: fix bug in light filters which could result in negative light levels (and therefore wraparounds)
2018-06-05 18:12:45 +01:00
3a31c531af
Level: remove unused import
2018-06-05 13:04:24 +01:00
e081b7dffa
PermissibleBase: fix typehints of calculateChildPermissions()
2018-06-05 11:14:36 +01:00
0233ae1eb6
Updated TesterPlugin submodule
2018-06-04 21:17:48 +01:00