413 Commits

Author SHA1 Message Date
Dylan K. Taylor
af678f985d
All types of coral now have fully dynamic types 2021-05-19 22:49:44 +01:00
Dylan K. Taylor
b33bf1f433
Unfuck banners ... 2021-04-28 18:44:21 +01:00
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
a44203a3d4
Separate BannerPatternLayer from BannerPatternType 2021-04-28 12:47:42 +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
01c3668375
ItemFactory: Check the bounds of durability, instead of trying to catch exceptions 2021-04-16 21:30:48 +01:00
Dylan K. Taylor
da51f106de
ItemFactory/BlockFactory: give more specific class descriptions
these classes both have a very specific purpose now, which is much lesser than it was in PM3.
2021-04-16 21:27:28 +01:00
Dylan K. Taylor
c979ab8aa0
Be more specific with documentation of ItemFactory::register() and BlockFactory::register() 2021-04-16 21:24:16 +01:00
Dylan K. Taylor
6071746993
Mark ItemFactory::get() and BlockFactory::get() as @deprecated 2021-04-16 21:16:27 +01:00
Dylan K. Taylor
49438d360d
RegistryUtils: generate ordered doc comments
this makes things easier to find, especially in the large ones like VanillaBlocks.
2021-03-22 16:16:28 +00:00
Dylan K. Taylor
90161f24e3
Added script to update registry/enum docblocks 2021-03-22 16:00:09 +00:00
Dylan K. Taylor
eb9a68edee
Further refactors to prepare for y=-64 lower limit 2021-03-18 00:08:16 +00:00
Dylan K. Taylor
c61f66d973
Removed ext-ds dependency 2021-02-11 15:40:37 +00:00
Dylan K. Taylor
b03ca1953a
Remove usage of Ds\Deque from WritableBookBase
ext-ds is not well maintained, and also not very well written. I'm planning to drop this extension for stability's sake.
2021-02-11 14:07:49 +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
079e794339
Armor: fixed item disappearing when switching two of the same armour pieces
Player->useHeldItem() assumes that if the old item == the new item, we want to set the item back into the inventory if it's modified in-place. Therefore, we don't modify the item in-place to bypass the problem.

closes #4022
2021-02-03 17:05:16 +00:00
Dylan K. Taylor
a9f8afa077
Banner: remove Deque usages
originally I introduced this to make it easier to implement the various APIs addPattern removePattern etc, but those were later removed in favour of simple getPatterns() and setPatterns(), allowing plugin developers to use ext-ds APIs to manipulate patterns.
However, ds poses a number of headaches because of mutability combined with by-ref semantics, which make it a pain to use these on the APIs because we can't guarantee that they won't be modified.
As much as arrays suck, they have two significant advantages over ext-ds: 1) they have copy-on-write semantics, and 2) they support PHP 8.0 without any extra work from me.
2021-01-15 00:17:56 +00:00
Dylan K. Taylor
9228f006d4
Merge remote-tracking branch 'origin/stable'
# Conflicts:
#	composer.json
#	composer.lock
#	resources/vanilla
#	src/CrashDump.php
#	src/PocketMine.php
#	src/pocketmine/Server.php
#	src/pocketmine/item/Bucket.php
#	src/pocketmine/item/Item.php
#	src/pocketmine/level/format/Chunk.php
#	src/pocketmine/level/format/io/leveldb/LevelDB.php
#	src/pocketmine/level/format/io/region/McRegion.php
#	src/pocketmine/network/mcpe/protocol/BatchPacket.php
#	src/pocketmine/tile/Furnace.php
#	src/pocketmine/utils/UUID.php
#	src/utils/ServerKiller.php
2020-12-20 20:54:13 +00:00
Dylan K. Taylor
2af15557b9 Merge branch 'stable'
# Conflicts:
#	.travis.yml
#	resources/vanilla
#	src/block/BlockToolType.php
#	src/network/mcpe/protocol/types/entity/MetadataProperty.php
#	tests/travis/setup-php.yml
2020-12-11 22:44:04 +00:00
Dylan K. Taylor
6cf875ca3a Item: rename onActivate() to onInteractBlock() 2020-11-09 19:33:13 +00:00
Dylan K. Taylor
3c6a64f91b Fixed armour equipment logic, close #3896
this isn't perfect because the client expects to be the boss here and is also inconsistent.
2020-11-09 13:32:12 +00:00
Dylan K. Taylor
4e91009492 Armor: fixed equipping when right-clicking air instead of a block
this action (which is more accurately referred to as 'activate item' or 'use item' in other areas) always fires on right-click when holding any item, whether aiming at a block or not.
2020-11-09 12:47:36 +00:00
David
b059e0b475
Item: fixed wrong tag being removed during serialization of custom name (#3894) 2020-11-07 01:25:37 +00:00
Dylan K. Taylor
142102a054 ItemFactory: remap bucket:9 and bucket:11 to their appropriate counterparts 2020-11-03 19:44:57 +00:00
Dylan K. Taylor
12e185e3f6 Relocate EntityLegacyIds to pocketmine\data\bedrock package 2020-11-01 17:07:34 +00:00
Dylan K. Taylor
4c0c2ebd24 CS cleanup 2020-10-26 15:56:30 +00:00
Dylan K. Taylor
cf7f50af06 Fixed test failure 2020-10-24 18:25:42 +01:00
Dylan K. Taylor
c5b925a213 Moved EnchantmentIds to pocketmine/data/bedrock package 2020-10-24 18:24:39 +01:00
Dylan K. Taylor
f3f7ff9237 Enchantment internal IDs are now dynamic 2020-10-24 18:21:31 +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
9947e13121 Yank constants out of Enchantment base class 2020-10-23 21:04:27 +01:00
Dylan K. Taylor
a01c086481 Introduced VanillaEnchantments registry 2020-10-23 20:48:19 +01:00
Dylan K. Taylor
7f9c4355f0 Revert back to floor/wall banner variants
this code largely duplicates the same code in FloorSign/WallSign and needs to be de-duplicated.
2020-10-04 19:05:43 +01:00
Dylan K. Taylor
505d4e402f ItemFactory: do not reuse the same itemstack instance for air()
this is mutable, so it's possible for plugins to mess with it and break everything that references it.
2020-10-04 18:36:46 +01:00
Dylan K. Taylor
c42a6d7552 ItemBlock no longer depends on legacy ID/metadata 2020-10-04 18:27:20 +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
e6bf7278fc Sign: remove obsolete clone hook
this is no longer required because SignText is not mutable anymore.
2020-10-04 17:24:40 +01:00
Dylan K. Taylor
7b02cc3efd Implemented #3836: Replace setCancelled() in events with cancel() and uncancel()
The motivation for this is to prevent passing a dynamic argument to cancellation, which in almost all cases is a bug in user code. This same mistake also appears in a few places in the PM core (as seen in this commit), but in those cases the mistakes were mostly harmless since they were taking place before the event was actually called.
closes #3836
2020-09-26 14:31:56 +01:00
Dylan T
bf401421fa
Implemented bamboo (#3762) 2020-08-16 20:39:51 +01:00
Jack Honour
ff2a3baa8e
Implemented Jukebox & Records (#3742)
Co-authored-by: Dylan K. Taylor <odigiman@gmail.com>
2020-08-07 21:07:58 +01:00
Dylan K. Taylor
2b044195a5 Update for pocketmine/math Axis refactor 2020-08-06 14:38:54 +01:00
Dylan K. Taylor
2e0f7102e8 ItemBlock: remove superfluous doc comments generated by PhpStorm 2020-08-01 16:06:38 +01:00
Dylan K. Taylor
9872bb4cb8 Enchantment: remove dead classes 2020-07-17 14:41:04 +01:00
Dylan K. Taylor
9b52af62b6 Item: skip a step when decoding PC itemstacks 2020-07-10 21:32:39 +01:00
Dylan K. Taylor
279abb871d Remove all usages of CompoundTag->hasTag()
in pretty much every case, these usages really wanted to read the tag's contents anyway, which can be combined with a getTag() and instanceof call for more concise and static analysis friendly code.
In the few cases where the tag contents wasn't needed, it still wanted to check the type, which, again, can be done in a more static analysis friendly way by just using getTag() and instanceof.
2020-07-10 21:01:43 +01:00
Dylan K. Taylor
68c408268c Separate dye colour ID management from DyeColor enum 2020-07-05 19:04:22 +01:00
Govdim
7f81507ea1
Add Releasable interface (#3664)
closes #3301
2020-06-30 21:09:10 +01:00
Dylan K. Taylor
74a919353f Food: remove unused import 2020-06-29 22:52:04 +01:00
Dylan K. Taylor
670ad9eb9d Position: rename getWorldNonNull() to getWorld(), remove original getWorld() 2020-06-29 21:19:46 +01:00
Dylan K. Taylor
0b05fd1987 added missing file 2020-06-29 18:54:47 +01:00