420 Commits

Author SHA1 Message Date
Dylan K. Taylor
d5e5a81cff
Don't explode when data contains invalid dye colour IDs 2021-04-28 13:39:03 +01:00
Dylan K. Taylor
2eb05a2420
Updated block factory consistency check 2021-04-27 21:00:22 +01:00
Covered123
9c1b4fd1cd
Added CancelTaskException (#4186) 2021-04-19 13:41:51 +01:00
Dylan K. Taylor
5872b2fe23
Merge remote-tracking branch 'origin/stable' 2021-04-19 13:32:15 +01:00
TheNewHEROBRINEX
8d1a1628de
Item: Remove "ench" tag when all enchantments are removed from an item (#4184)
fixes #4144
2021-04-18 20:56:07 +01:00
Dylan K. Taylor
a32eb4ebc3
Implemented coral and coral fans
this implementation is very rough due to having to hack around lots more MCPE bullshit, and currently doesn't allow dynamic coral types; but it's there. We'll clean this up after 1.13 migration is done.
2021-04-17 02:04:10 +01:00
Dylan K. Taylor
9abdcd8ee5
shut 2021-04-16 21:45:22 +01:00
Dylan K. Taylor
01c3668375
ItemFactory: Check the bounds of durability, instead of trying to catch exceptions 2021-04-16 21:30:48 +01:00
Dylan K. Taylor
81ced66bd0
BlockIdentifier: variant parameter of constructor is now mandatory 2021-04-16 20:14:29 +01:00
Dylan K. Taylor
5d83f4670a
RegionLoader: Switch to using named constructors
this makes the code more self-descriptive, and also helps to detect potential bugs.
2021-04-15 21:57:23 +01:00
Dylan K. Taylor
32c4a165cf
Removed RegionLoader::open()
this is nothing but a source of bugs.
2021-04-15 15:38:18 +01:00
Dylan K. Taylor
0312b62c8a
DataPacket no longer keeps its own serializer
since a while ago, we're anyway just discarding the internal buffer anyway when the packet is repeatedly encoded, so this doesn't serve any advantage anymore.
We do need a system to be able to reuse encoded packet buffers, but right now we're not reusing them anyway.
2021-04-09 15:37:58 +01:00
Dylan K. Taylor
06f20234f7
Scrub unused imports 2021-03-26 22:56:09 +00:00
Dylan K. Taylor
e80c1a0ce9
Split Mushroom Stem away from other mushroom variants
mushroom stem (and all-sided stem) are unique blocks, which don't drop anything and which don't stack with other shroom variants when block-picked.
They also get mapped to the same block when placed, and there's no distinction between red mushroom stem and brown mushroom stem.
2021-02-07 22:02:50 +00:00
Dylan K. Taylor
8d5cc9adc3
Merge branch 'stable' 2021-02-07 20:57:19 +00:00
Dylan K. Taylor
fd2ebd84b4
Recognize underwater TNT 2021-02-06 23:37:05 +00:00
Dylan K. Taylor
c5bdd7dd64
Added a unit test to ensure valid format of MINECRAFT_VERSION_NETWORK 2021-02-04 22:36:40 +00:00
Dylan K. Taylor
169650dc5b
MainLogger: accept timezone as a constructor parameter
this makes it easier to unit-test, as well as making it independent of Timezone.
2021-02-04 21:50:06 +00:00
Dylan K. Taylor
27b1951df7
MainLogger: accept main thread name as a constructor parameter 2021-02-04 20:55:50 +00:00
Dylan K. Taylor
709b4154d7
MainLogger: Require useFormattingCodes as a constructor parameter
this avoids needing to call Terminal::init() before starting a MainLogger. Since it inits the formatting codes anyway when log messages are first recorded, it shouldn't be necessary to pre-initialize it.
2021-02-04 19:16:22 +00:00
Dylan K. Taylor
ae75d73f48
Extract MainLoggerThread unit from MainLogger
MainLogger is no longer a Thread, as per the recent changes to pocketmine/log-pthreads.
2021-02-04 16:28:49 +00:00
Dylan K. Taylor
d4290837f3
fix build failure 2021-02-02 13:55:56 +00:00
Dylan K. Taylor
3e1ac66abf
Merge branch 'stable' 2021-02-02 13:46:29 +00:00
Dylan K. Taylor
fe731b9018
Added failing test case for region header validation
fucking PHP... what genius thought it was a good idea to cache file stats without even an attempt at keeping the cache up to date on modifications?
2021-02-02 13:43:12 +00:00
Dylan K. Taylor
bbae02264d
Merge branch 'stable' 2021-01-27 20:04:13 +00:00
Dylan K. Taylor
d39348929f Removed PLUGIN_PATH constant 2020-12-09 20:48:50 +00:00
Dylan K. Taylor
c808095978 Chunks no longer contain their own coordinates 2020-12-03 21:59:30 +00:00
Dylan K. Taylor
29f6ed3f68 Use Snooze to improve AsyncTask collection times
regardless of how long an async task takes to run, it will take a multiple of 50ms to get the result processed. This delay causes issues in some cases for stuff like generation, which causes locking of adjacent chunks, and async packet compression, which experiences elevated latency because of this problem.
This is not an ideal solution for packet compression since it will cause the sleeper handler to get hammered, but since it's already getting hammered by every packet from RakLib, I don't think that's a big problem.
2020-12-02 19:34:34 +00:00
Dylan K. Taylor
870d237260 BlockFactory::get() second parameter is now mandatory 2020-11-18 00:50:01 +00:00
Dylan K. Taylor
430d16e5f5 fixed borked test 2020-11-16 18:17:04 +00:00
Dylan K. Taylor
fd88c78d3a added test for CoralTypeIdMap
we really need a better way to guarantee exhaustiveness for this ...
2020-11-16 18:12:01 +00:00
Dylan K. Taylor
1eee24f1fa Implemented coral blocks
there are some complications with coral plants due to the fact we're stuck with R12 worlds right now - and also coral fans are a major pain to implement due to how messed up the metadata is.
2020-11-16 18:05:39 +00:00
Aericio
b2765f32e9 Implemented Barrels, closes #3672 2020-11-16 17:26:07 +00:00
Dylan K. Taylor
315962c12c Added __clone() for Chunk and SubChunk
we need this because the flatworld generator uses clone to produce new chunks, so we don't want the chunks getting fucked up.
2020-11-01 16:14:25 +00:00
Dylan K. Taylor
19bc879dc1 lose useless blank line 2020-11-01 14:24:02 +00:00
Dylan K. Taylor
be1da07ee5 tests: phpdoc cleanup 2020-11-01 14:23:44 +00:00
Dylan K. Taylor
d6d9dde0b2 imports cleanup 2020-11-01 14:23:21 +00:00
Dylan K. Taylor
73a8c90bee Merge remote-tracking branch 'origin/stable'
# Conflicts:
#	resources/vanilla
#	src/world/Explosion.php
#	tests/phpunit/item/ItemTest.php
#	tests/phpunit/world/format/io/region/RegionLoaderTest.php
#	tests/plugins/TesterPlugin/src/pmmp/TesterPlugin/tests/AsyncTaskMainLoggerTest.php
#	tests/plugins/TesterPlugin/src/pmmp/TesterPlugin/tests/AsyncTaskMemoryLeakTest.php
2020-11-01 14:21:47 +00:00
Dylan K. Taylor
e2e960e43d tests: add missing function imports 2020-10-26 15:59:42 +00:00
Dylan K. Taylor
500fd2d842 tests: strip useless phpdoc 2020-10-26 15:59:17 +00:00
Dylan K. Taylor
3f254bd49c Separated effects' MCPE ID registration from VanillaEffects 2020-10-24 18:52:20 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
a01c086481 Introduced VanillaEnchantments registry 2020-10-23 20:48:19 +01:00
Dylan K. Taylor
792f38f474 Carpet and Wool now have dynamic colours 2020-10-15 14:45:28 +01:00
Dylan K. Taylor
0ef0848c44 Concrete and ConcretePowder colour is now dynamic 2020-10-15 14:30:07 +01:00
Dylan K. Taylor
309d23acfb regenerated blockfactory consistency check 2020-10-04 19:12:36 +01:00
Dylan K. Taylor
d3a3a41d2b Revert back to separated floor/wall sign
the conditionally useless properties are problematic.
2020-10-04 17:52:23 +01:00
Dylan K. Taylor
388a19ef5d Persistent block metadata may now have mutable parts
Not allowing this makes stuff like anvil damage, colour, wood type, live/dead bit, wet/dry etc all too much hassle to deal with.
Naturally I want to get rid of this shit altogether, but first it's necessary to construct a new system that we can shift into before all this bullshit can be addressed fully, so for now we have to work within the bounds of the old system.
This change will permit dynamic colours for concrete/concrete powder etc, dynamic wood types where the wood type isn't embedded in the legacy ID, and so forth. Allowing full flexibility requires either more old system hacks or completing the migration to a new system which doesn't have these limitations. I prefer to do the latter, but this change will make it somewhat easier to do.
2020-10-04 11:40:05 +01:00
Dylan K. Taylor
5807a385cc Added stub classes for Beacon
this doesn't do anything yet, it's intended solely to prevent further loss of data.
2020-10-02 00:59:53 +01:00
Dylan K. Taylor
7a436dc47c updated blockfactory consistency check 2020-10-01 22:10:02 +01:00