Commit Graph

15731 Commits

Author SHA1 Message Date
Dylan K. Taylor
de3bbb71fa Merge branch 'next-minor' into next-major 2022-07-19 20:20:30 +01:00
Dylan K. Taylor
040516054f Merge branch 'stable' into next-minor 2022-07-19 20:20:10 +01:00
Dylan K. Taylor
64f0e58e60 Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable 2022-07-19 20:17:15 +01:00
Dylan K. Taylor
62f21516d1 build/generate-registry-annotations.php: allow processing a single file
this is useful for automatically invoking the script via a PhpStorm file watcher.
2022-07-19 20:17:07 +01:00
Dylan K. Taylor
c553f7cf06 build/generate-registry-annotations.php: write to stderr on error 2022-07-19 20:15:44 +01:00
Dylan K. Taylor
eccfb3bbe2 World: fix borked check 2022-07-19 17:59:53 +01:00
Dylan K. Taylor
87b840ff97 Added a hack to allow tiles to trigger client-side render updates on blocks without actually changing the block
Bedrock block entity updates don't directly trigger block rendering
updates. This is a problem when the block entity data affects the
block's appearance directly (e.g. cauldron water colour, flower pot
contents), because it means changing them won't directly result in a
client-side render update.

This hack allows tiles to spoof block updates without actually changing
the server-side block, keeping the internals and API clean of random
shitbox workarounds.

fixes #5174
fixes #4944
2022-07-19 17:47:46 +01:00
Dylan K. Taylor
f64e306fb8 Make BlockIdMetaUpgrader API less dumb
the old impl prevented registering more than one meta -> state mapping since the legacy numeric ID map would throw an exception if attempting to map the same ID more than once.
2022-07-19 16:21:56 +01:00
Dylan K. Taylor
9a8902d1fe LegacyToStringMap: don't throw if the existing mapping is the same as the one we want to register
this was making it inconvenient for plugins to use BlockIdMetaUpgrader->addMapping(), because the block legacy ID map contains IDs up to 1.16, but the table of mapped 1.12 blockstates only goes up to ... well ... 1.12. This left a gap of several versions' blocks unable to be mapped.
2022-07-19 16:08:05 +01:00
Dylan K. Taylor
b36b65927c BlockDataUpgrader: expose BlockIdMetaUpgrader via getter 2022-07-19 16:02:35 +01:00
Dylan K. Taylor
afaf9dbc88 Rename LegacyBlockStateMapper -> BlockIdMetaUpgrader
this more accurately describes what it's used for.
2022-07-19 15:32:08 +01:00
Dylan K. Taylor
b0a492c063 Move simple block (de)serializer registrations into their own functions 2022-07-18 18:47:30 +01:00
Dylan K. Taylor
6d4279671e A giant hack to cut down code needed for runtime block serialization by 50%
this also avoids repeated information and inconsistencies.
2022-07-18 18:25:41 +01:00
Dylan K. Taylor
cf34f88a67 Make Block::decodeState() and encodeState() more codegen-friendly 2022-07-18 15:48:03 +01:00
Dylan K. Taylor
b8d1b00985 phpstan fail very sad :( 2022-07-18 15:26:14 +01:00
Dylan K. Taylor
8660dfe576 Generate traits for runtime enum serialization instead of helper classes 2022-07-18 15:16:33 +01:00
Dylan K. Taylor
172bd9a129 ... 2022-07-17 21:24:27 +01:00
Dylan K. Taylor
012b668537 Avoid bogus assumptions about block and item NBT on tiles 2022-07-17 21:23:41 +01:00
IvanCraft623
fec89b7803 Lava burns entities for only 8 seconds in Bedrock (#5173) 2022-07-17 20:50:15 +01:00
Dylan K. Taylor
4f2f9b4352 Block::readStateFromWorld() now returns the block object that should be used for the target position
this enables changing the block type completely if the situation calls for it.
2022-07-16 20:04:08 +01:00
Dylan K. Taylor
b3f8b5ff37 Fix CS 2022-07-16 20:01:29 +01:00
Dylan K. Taylor
81edb1bed4 GlassBottle: implement filling using API changes from 4afd3dcabf
closes #4827
2022-07-16 20:00:43 +01:00
Dylan K. Taylor
d0ff6d2e36 Enable various types of interaction to return items to the player, without needing to have a bunch of boilerplate creative mode and held item checks
it became glaringly obvious that this was needed because of #4827 and #4868.

this is further needed with the addition of cauldrons.
2022-07-16 19:50:33 +01:00
Dylan K. Taylor
4afd3dcabf Merge branch 'next-minor' into next-major 2022-07-16 15:11:19 +01:00
Dylan K. Taylor
4e3964ffce Armor: added clearCustomColor() 2022-07-16 15:10:07 +01:00
Dylan K. Taylor
c7f5215a51 5.0.0-ALPHA3 is next 2022-07-14 22:54:29 +01:00
Dylan K. Taylor
66f2116e57 Release 5.0.0-ALPHA2 5.0.0-ALPHA2 2022-07-14 22:54:28 +01:00
Dylan K. Taylor
c15c59ae0d changelog for 5.0.0-ALPHA2
[ci skip]
2022-07-14 22:52:07 +01:00
Dylan K. Taylor
07786dc4bc RuntimeDataWriter: fixed doc comment 2022-07-14 22:51:12 +01:00
Dylan K. Taylor
259f44e57c Merge branch 'next-minor' into next-major 2022-07-14 22:05:04 +01:00
Dylan K. Taylor
93254523e6 Merge branch 'stable' into next-minor 2022-07-14 22:04:38 +01:00
Dylan K. Taylor
2b61c025c2 Workaround items in blockentity NBT not being processed correctly in 1.19.10
closes #5154

this hack sends only the bare essential data to create the tiles in LevelChunkPacket,
and then separately sending the full tile data using BlockActorDataPacket afterwards.

This is necessary because the client doesn't handle items correctly in NBT when chunks are sent without using the SubChunkRequest system.
In 4.6 this is observed with incorrect items shown in item frames; in 5.0 it's seen with items simply not showing up at all (difference due to modernization of the serialization format in 5.0).
2022-07-14 21:54:01 +01:00
Dylan K. Taylor
e5804df24b Merge branch 'next-minor' into next-major 2022-07-14 20:59:13 +01:00
Dylan K. Taylor
e00f8e3a32 Merge branch 'stable' into next-minor 2022-07-14 20:59:06 +01:00
Dylan K. Taylor
c8320fe849 Merge branch 'next-minor' into next-major 2022-07-14 20:50:49 +01:00
Dylan K. Taylor
e2855aadff Simplify handling of broken transactions for crafting and friends
this allows stuff like smithing tables to work without needing any extra hacks.

Implementing enchanting or anvils would require some extra work, but I don't plan to implement those under the legacy transaction system anyway.
2022-07-14 20:50:06 +01:00
Dylan K. Taylor
21ed5a450f Updated BlockFactory consistency check 2022-07-14 20:42:16 +01:00
Dylan K. Taylor
ba2baba7cc Added netherite blocks and items 2022-07-14 20:39:09 +01:00
Dylan K. Taylor
c7133bc2e6 InGamePacketHandler: don't kick the player out of inventory windows on actor events
this is sent when the player crafts something using an anvil.
2022-07-14 20:36:11 +01:00
Dylan K. Taylor
d4f4fda442 Merge branch 'next-minor' into next-major 2022-07-14 19:54:50 +01:00
Dylan K. Taylor
4d6ec66270 Merge branch 'stable' into next-minor 2022-07-14 19:54:38 +01:00
Dylan K. Taylor
baf75089f5 Entity: cancel fire damage for fireproof entities 2022-07-14 19:53:25 +01:00
Dylan K. Taylor
b4ce5ed515 ItemDeserializer: throw a more specific exception on unknown items 2022-07-14 19:16:15 +01:00
Dylan K. Taylor
eb8fb63409 Added cartography and smithing tables
these have working inventories, and their crafting menus will 'just work' once the items for the associated recipes have been implemented (maps, netherite).
2022-07-14 18:01:47 +01:00
Ali
705df7d508 EffectManager: remove redundant check (#5153) 2022-07-14 17:56:18 +01:00
Dylan K. Taylor
91719051e2 BlockStateToBlockObjectDeserializer: removed TODO mess
these were useful when writing the initial version from scratch; not so much for implementing random blocks
2022-07-14 16:50:08 +01:00
Dylan K. Taylor
d321094081 Added hanging roots 2022-07-14 16:47:55 +01:00
Dylan K. Taylor
323d31005f Added glowing item frames 2022-07-14 16:24:20 +01:00
Dylan K. Taylor
0c7370e564 Added wither rose 2022-07-14 16:07:16 +01:00
Dylan K. Taylor
3dd4c42fd3 Merge branch 'next-minor' into next-major 2022-07-14 16:06:35 +01:00