Commit Graph

12584 Commits

Author SHA1 Message Date
4549522289 Rename Chunk::getSubChunkChecked() -> getSubChunk() 2020-10-31 23:12:03 +00:00
e09d78238f Removed EmptySubChunk and SubChunkInterface 2020-10-31 23:10:31 +00:00
13d7b7ee1a Removed final remaining usages of Chunk::getSubChunk()
this clears the way to get rid of EmptySubChunk.
2020-10-31 23:07:36 +00:00
f50be1ba63 Chunk: Use getSubChunkChecked() in getFullBlock() 2020-10-31 23:06:12 +00:00
bacfcf258e World: remove unused function 2020-10-31 23:00:27 +00:00
8ee70dc30a SimpleChunkManager: fix missing mask in getBlockAt() 2020-10-31 22:55:56 +00:00
40f9cd16cb phpstan: drop a bunch of obsolete ignoredErrors from l8 baseline 2020-10-31 22:52:00 +00:00
d94877f5d2 fix build 2020-10-31 22:51:24 +00:00
01001dca74 Use Chunk::getSubChunkChecked() in places where we know that an invalid coordinate cannot be requested 2020-10-31 22:48:41 +00:00
b270029161 Rename Chunk::getWritableSubChunk() -> Chunk::getSubChunkChecked()
this is not specific to 'writable', it's just an opt-in to checked bounds so that an EmptySubChunk will never be received.
2020-10-31 22:46:33 +00:00
5701e733cc World: fixed a crash in getFullBlock() when used on ungenerated terrain 2020-10-31 22:36:12 +00:00
f5807ac049 World::getBlockAt() now doesn't assume that AIR has a fullStateId of 0 2020-10-31 22:22:02 +00:00
d0470a80ab SimpleChunkManager: remove post-mature optimisation
these methods are not used in hot paths and are inherently slow anyway, not to mention the introduction of morton codes eliminating the hashtable indexing problem.
2020-10-31 22:02:36 +00:00
ddda2d1e64 Remove $create parameter from ChunkManager::getChunk()
this restores SimpleChunkManager's behaviour to PM3, removing the need for GeneratorChunkManager (although I'm dubious whether SubChunkExplorer makes any sense in there any more now that we have morton in the mix).
2020-10-31 21:54:51 +00:00
dec235abab World: don't create a new chunk just to read biome info
the chunk won't be generated, so we can provide the default result without creating a new chunk for no reason.
2020-10-31 21:29:39 +00:00
de867f1b86 World: don't create an empty chunk just for accessing the highest block
this is pointless since the chunk will not be generated anyway, so it serves no end to create it.
2020-10-31 21:27:16 +00:00
f0d62cf4ce World: don't try to load chunks to read light levels
sync chunk load is useless here because lighting isn't immediately calculated anyway and it isn't available directly from the chunk when loaded.
2020-10-31 20:38:15 +00:00
68f5eada32 added fire extinguishing sound, closes #2777 2020-10-31 20:18:06 +00:00
f67ab094f2 fix build 2020-10-31 16:51:14 +00:00
5f7b0994b9 World: rename get(HighestAdjacent)BlockSkyLight(At) to make it clear these are **potentials**, not the actual light level 2020-10-31 16:47:34 +00:00
241a50387b World: added getHighestAdjacentRealBlockSkyLight()
this is the same as its 'non-real' counterpart, but it accounts for time of day.
2020-10-31 16:44:42 +00:00
0b92e96e14 Player: set silent flag in spectator 2020-10-31 16:10:02 +00:00
8be0c0da0d Implemented a silent property on entities and Entity->broadcastSound()
fixes #3516
2020-10-31 16:07:18 +00:00
66edf5a165 Particle::encode() now always returns ClientboundPacket[] 2020-10-31 15:51:17 +00:00
5a320f22b7 Sound::encode() now always returns an array 2020-10-31 15:48:46 +00:00
0cbc5c9a4a region: harden handling of ByteArrayTag
previously this would just explode if the wrong length of data was given.
2020-10-31 15:37:06 +00:00
058bb3a91a World: do not execute neighbour block updates on unloaded chunks
we might also need to delay this if any adjacent chunk is also not loaded, in case the block wants to access adjacent blocks during its neighbour update.
2020-10-29 13:37:14 +00:00
cfb9cc8999 fix build failure 2020-10-29 13:22:35 +00:00
b079772d32 World: do not include unloaded or unlit chunks in getHighestAdjacentBlock(Sky)Light() 2020-10-29 13:05:25 +00:00
3c892182fd World: change some usages of getOrLoadChunk() to getChunk()
these usages don't require getOrLoadChunk() because they already check for unloaded chunks anyway.
2020-10-29 12:57:33 +00:00
092a69e415 update phpstan baseline 2020-10-29 12:18:29 +00:00
3e1263eb79 Chunk: remove all proxy APIs to lighting information
these aren't used by internals and they shouldn't be used by plugins either.
2020-10-29 12:11:06 +00:00
ddc0f137e7 changelog: VanillaEffects -> VanillaEnchantments (#3884) [ci skip] 2020-10-27 21:51:55 +00:00
587a4c0095 non-exhaustive updates to changelog [ci skip] 2020-10-27 19:35:03 +00:00
797e0996f4 PopulationTask: Do not include light when serializing chunks (either way)
non-populated chunks shouldn't be light-populated anyway, but in some cases they are (bug or plugin interference).
chunks which were already populated might get modified by adjacent chunk populations, which should invalidate their lighting because generation doesn't track which blocks were changed, so the whole chunk should be recalculated.
2020-10-27 18:42:30 +00:00
1859dac789 Implemented self-contained (pass 1) chunk relighting
this doesn't handle propagating light across chunk borders yet, since that's much more complex to implement.
2020-10-27 18:29:32 +00:00
014317381f Sugarcane: deduplicate growth code
this also fixes sugarcane attempting to grow past the top of the world (closes #3883).
2020-10-27 18:05:41 +00:00
0ecd68e4a7 LightUpdate: remove premature optimisation which breaks when mass-update lighting is used
when setBlockSkyLightArray/setBlockLightArray was used, currentLightArray would retain a reference to the old light array, which would cause false readings if SubChunkExplorer didn't move away from that subchunk and back.
This causes a small degradation of performance, but I think it can be implemented differently anyway.
This also fixes #3816.
2020-10-27 18:01:31 +00:00
05ab75b5ce PopulationTask: do not calculate lighting for chunks
we do this ondemand now, which means this is just wasting CPU for the vast majority of generated chunks.
2020-10-27 17:03:57 +00:00
31c2c3abb5 SubChunkExplorer::moveTo() now returns a status
this can be used by SubChunkExplorer subclasses to implement specialized logic.
2020-10-26 16:25:21 +00:00
390bc631c8 SubChunk: added moveToChunk() 2020-10-26 16:04:31 +00:00
8bab9cc108 RegionWorldProvider: use morton2d directly instead of abusing chunkHash()
while these currently do the same thing, it's very confusing and creates an unnecessary dependency on World.
2020-10-26 15:34:32 +00:00
d6ed542fcd Merge remote-tracking branch 'origin/stable' into master
# Conflicts:
#	composer.json
#	composer.lock
#	src/CrashDump.php
#	src/pocketmine/Server.php
#	src/pocketmine/level/format/io/region/McRegion.php
#	tests/phpstan/configs/check-explicit-mixed-baseline.neon
#	tests/phpstan/configs/l7-baseline.neon
#	tests/phpstan/configs/l8-baseline.neon
#	tests/travis/setup-php.yml
2020-10-26 16:18:53 +00:00
4c0c2ebd24 CS cleanup 2020-10-26 15:56:30 +00:00
0b550b346b imports cleanup 2020-10-26 15:43:25 +00:00
3f254bd49c Separated effects' MCPE ID registration from VanillaEffects 2020-10-24 18:52:20 +01:00
cf7f50af06 Fixed test failure 2020-10-24 18:25:42 +01:00
c5b925a213 Moved EnchantmentIds to pocketmine/data/bedrock package 2020-10-24 18:24:39 +01:00
f3f7ff9237 Enchantment internal IDs are now dynamic 2020-10-24 18:21:31 +01:00
47976bac34 Moved enchantment ID handling to pocketmine/data/bedrock package
this permits plugins to register their own enchantments mapped to MCPE IDs again.
2020-10-24 17:59:46 +01:00