Commit Graph

48 Commits

Author SHA1 Message Date
edafe9d21f Entity: Rename and document isImmobile() and friends
while I could implement server-side ability to disable entity movement, I don't think that's particularly useful. However, the intended function of this (disabling client sided AI) is useful, so it makes more sense to rename it to match its functionality, rather than changing its functionality to match the name.

closes #3130
2023-05-26 14:01:21 +01:00
289ede669d BlockTranslator: use less ambiguous function names 2023-05-05 14:47:23 +01:00
01f340985a Centralize all conversion-related stuff under TypeConverter
instead of having singletons for everything, which are a nightmare to manage for multi version
2023-05-03 16:33:17 +01:00
fba4895a17 Merge branch 'next-minor' into next-major 2022-10-31 19:11:39 +00:00
a9361b3f8b Changes for 1.19.40 2022-10-25 23:11:41 +01:00
f4de4bd971 Fixed FloatingTextParticle merge error 2022-07-24 21:41:40 +01:00
c8a8e33fc1 Merge branch 'next-minor' into next-major 2022-07-24 21:24:08 +01:00
eb916fe43d Use a falling block entity to improve client side performance of FloatingTextParticle (#4714)
Performance tests show that this has a considerable client-side performance advantage over using players. In my local tests, using 1000 floating texts in a 10x10x10 area, I observed an FPS increase from 1.5 to 8.0.
2022-07-24 18:22:21 +01:00
5e3b3a0700 Fix assert spam on debug clients 2022-07-24 17:51:02 +01:00
dea0207e4e Merge branch 'next-minor' into next-major 2022-07-13 17:06:04 +01:00
06655bee78 Updated to 1.19.10 2022-07-13 00:59:49 +01:00
09c1e161e0 Fix merge error 2022-06-29 16:54:57 +01:00
66c09fdc3b Merge branch 'next-major' into modern-world-support 2022-06-29 16:54:15 +01:00
4d9f2bc9b1 Merge branch 'next-minor' into next-major 2022-06-29 16:53:50 +01:00
784d602600 Fixed ItemBreakParticle using untranslated internal ID/meta for network data
this caused it to display particles for incorrect items. It may also have been possibly responsible for client crashes.
2022-06-29 14:01:39 +01:00
f24f2d9ca9 Hit block legacy metadata with the biggest nuke you've ever seen
This commit completely revamps the way that blocks are represented in memory at runtime.

Instead of being represented by legacy Mojang block IDs and metadata, which are dated, limited and unchangeable, we now use custom PM block IDs, which are generated from VanillaBlocks.
This means we have full control of how they are assigned, which opens the doors to finally addressing inconsistencies like glazed terracotta, stripped logs handling, etc.

To represent state, BlockDataReader and BlockDataWriter have been introduced, and are used by blocks with state information to pack said information into a binary form that can be stored on a chunk at runtime.
Conceptually it's pretty similar to legacy metadata, but the actual format shares no resemblance whatsoever to legacy metadata, and is fully controlled by PM.
This means that the 'state data' may change in serialization format at any time, so it should **NOT** be stored on disk or in a config.

In the future, this will be improved using more auto-generated code and attributes, instead of hand-baked decodeState() and encodeState(). For now, this opens the gateway to a significant expansion of features.
It's not ideal, but it's a big step forwards.
2022-06-24 23:19:37 +01:00
aa9f8781ff Merge branch 'next-minor' into next-major 2022-06-07 19:56:26 +01:00
083a35f970 Modernize property type declarations 2022-06-04 18:16:32 +01:00
38d6284671 Use PHP-CS-Fixer to enforce file header presence 2022-06-04 17:34:49 +01:00
937bb4c6ce Merge branch 'stable' into next-minor 2022-04-28 21:00:23 +01:00
cb76c149e1 Modernize property declarations in src/world/particle 2022-04-28 14:55:53 +01:00
c085bf0db4 Changes for 1.18.30 2022-04-20 13:59:50 +01:00
aae5962f6a Replace disallowed operators in src/world/ 2022-01-20 19:05:23 +00:00
04aedc6494 Updated BedrockProtocol 2021-10-23 23:54:49 +01:00
c77829f4ad Migrate packet creation to use ::create() methods in all but one case
MovePlayerPacket doesn't yet have a ::create() due to a complication with fields that aren't always present.
2021-10-23 01:46:01 +01:00
c773e43eda Updated BedrockProtocol to pmmp/BedrockProtocol@97fa88e9ef 2021-10-23 01:16:45 +01:00
742f86e022 Rename DestroyBlockParticle -> BlockBreakParticle
closes #3461

literally every other particle/sound has the subject first, followed by the (optional) verb, and finally Particle (or Sound).
In addition, we refer to breaking blocks as 'break' everywhere except here, where we refer to it as 'destroy'.
2021-05-06 18:33:18 +01:00
1e6d97a157 Merge branch 'stable' 2021-04-07 21:25:39 +01:00
72de45f0e9 Drop pocketmine/uuid for ramsey/uuid 2021-03-16 23:03:00 +00:00
66edf5a165 Particle::encode() now always returns ClientboundPacket[] 2020-10-31 15:51:17 +00:00
5661d0496f RuntimeBlockMapping::toRuntimeId() now accepts a single integer instead of id/meta
the expectation is that eventually this will receive arbitrary internal runtime IDs instead of static id/meta, and RuntimeBlockMapping doesn't really care about this crap anyway.
2020-09-20 12:16:11 +01:00
909f3f39de Block: get rid of getRuntimeId()
the runtime ID mapping should be non-global in case of multiple protocols.
2020-07-06 11:18:29 +01:00
012acdd4cb move runtime entity ID counter from EntityFactory back to Entity
EntityFactory is specialized for the purpose of deserializing data from worlds, and runtime ID assignment isn't related.
2020-06-19 21:55:49 +01:00
232ff838db Merge commit '22b5de09b476a8c1638adfaba56b210c1eb1faf0'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/level/particle/InstantEnchantParticle.php
#	src/world/sound/ExplodeSound.php
2020-05-18 20:30:00 +01:00
86db3af896 remove utils\Color, use new pocketmine/color class
we're so close to separating protocol from core !!!
2020-05-14 20:38:08 +01:00
b7cf4f01f9 remove utils\UUID, switch to pocketmine/uuid package 2020-05-11 10:46:48 +01:00
9615186afd rename PunchBlockParticle -> BlockPunchParticle 2020-05-01 12:36:31 +01:00
f3d7c320a1 move SkinAdapter stuff to convert package 2020-04-23 15:46:37 +01:00
18d48869a0 the great airgapping of recipes and itemstacks 2020-04-23 14:11:48 +01:00
67bcc1c0fb phpdoc armageddon for master, pass 1 2020-01-22 11:55:03 +00:00
cda1143a79 Merge branch 'stable' 2020-01-09 17:17:42 +00:00
c85c1c3c3f Merge commit '82d9e481d2a0a389fbbc6dfd3672fc366127febc' 2019-12-11 23:06:35 +00:00
6e9d2e1c8a InstantEnchantParticle: add Color into constructor (#3118) 2019-09-23 11:43:06 +01:00
f755ea6043 DestroyBlockParticle: keep block reference around instead of runtimeID
we'll need this for protocol abstraction
2019-08-27 19:25:55 +01:00
8557c93f04 remove GenericParticle, work on isolating network crap in particles 2019-08-19 19:26:26 +01:00
e52ba7201c add LevelEventPacket::standardParticle() sugar 2019-08-19 19:01:09 +01:00
3274db3ddc DustParticle constructor now uses Color object 2019-08-19 18:57:26 +01:00
5499ac620c Removed pocketmine subdirectory, map PSR-4 style 2019-07-30 19:14:57 +01:00