Commit Graph

361 Commits

Author SHA1 Message Date
Dylan K. Taylor
1c6a2b66f7 Merge remote-tracking branch 'origin/next-minor' into next-major 2022-09-29 22:38:26 +01:00
Dylan T
41970feb57 Entity: Fire EntitySpawnEvent/ItemSpawnEvent on the first entity tick, instead of in the constructor (#5314)
This allows plugins to modify the entity via setters in EntitySpawnEvent without their changes getting overwritten by setter calls directly after the 'new YourEntity' statement.

As well as benefiting plugins, this also clears a path for a BC-breaking change in PM5 (to have the programmer use addEntity() to spawn entities, instead of the constructor doing it, which will improve on a number of data handling aspects).

fixes #4973

This targets next-minor because it has some side effects on plugins that depended on the old behaviour, such as VanillaHopper, so it's not suitable for a patch release.
2022-09-29 22:30:12 +01:00
IvanCraft623
1366a43c22 Implement Turtle Shell (#5235) 2022-09-28 18:19:15 +01:00
Dylan K. Taylor
bda0ca23b4 Living: deprecated hasLineOfSight() 2022-09-28 17:34:51 +01:00
Dylan K. Taylor
a6cc611e9f Merge branch 'next-minor' into next-major 2022-09-28 01:06:11 +01:00
Dylan K. Taylor
86a2f8e360 Merge branch 'stable' into next-minor 2022-09-28 01:01:51 +01:00
IvanCraft623
5e5661de75 Play burp sound when consuming a FoodSource (#5158) 2022-09-27 17:21:55 +01:00
Dylan K. Taylor
9295afe8b9 Merge branch 'next-minor' into next-major 2022-09-24 18:12:38 +01:00
Dylan K. Taylor
a7dfa0907c Merge branch 'stable' into next-minor 2022-09-24 18:07:56 +01:00
IvanCraft623
83a136a176 EntityFactory: Avoid code duplication on validation of creation functions (#5294) 2022-09-24 13:55:24 +01:00
Ali
3c55db531d HealthBoostEffect: Ensure that current health is within limits after reducing max health on removal(#5303) 2022-09-24 13:45:12 +01:00
Dylan K. Taylor
b39eaaf91f Merge branch 'next-minor' into next-major 2022-09-21 15:07:11 +01:00
Dylan K. Taylor
89e29448ee Merge branch 'stable' into next-minor 2022-09-20 20:18:06 +01:00
Dylan K. Taylor
23e98a30f5 ItemEntity: don't ignore parent's savable state 2022-09-20 14:50:35 +01:00
Dylan K. Taylor
5bc7ca6569 ItemEntity: disable saving if the contained item is air or has a zero count 2022-09-20 14:45:10 +01:00
IvanCraft623
9f97654f6f Update InstantDamage and Regeneration values (#5279) 2022-09-15 20:26:37 +01:00
Dylan K. Taylor
f80ffd8de0 Merge branch 'next-minor' into next-major 2022-09-15 13:59:21 +01:00
Eren A. Akyol
82ba7903c8 Fixed wrong key being used for entity type ID in save data (#5288)
closes #5260
2022-09-15 13:40:48 +01:00
Dylan K. Taylor
3d03bb1301 Fix CS 2022-09-15 12:01:26 +01:00
Dylan K. Taylor
88eafdd614 Improve type info for RegistryTrait::getAll() and its users 2022-09-02 19:57:22 +01:00
Dylan K. Taylor
6dd5fec4ea ExperienceManager: remove superfluous doc comment 2022-09-02 19:38:23 +01:00
Dylan K. Taylor
f88c4d9a8c Remove more unnecessary local static variable usages
these are never mutated. Local constants would be better, if we had those.
2022-09-02 19:19:04 +01:00
Dylan K. Taylor
1ecb10acba Merge branch 'next-minor' into next-major 2022-08-21 19:19:07 +01:00
Dylan K. Taylor
c9626c610b Skin: Correctly handle errors produced by commented JSON decoder 2022-08-16 17:35:23 +01:00
Dylan K. Taylor
dce8bd6d21 CS: Standardize new with braces 2022-08-15 17:16:23 +01:00
Dylan K. Taylor
43a3151de3 Merge branch 'next-minor' into next-major 2022-08-14 18:49:19 +01:00
Dylan K. Taylor
df7a1fcba6 Changes for 1.19.20 2022-08-09 19:06:05 +01:00
Dylan K. Taylor
c8a8e33fc1 Merge branch 'next-minor' into next-major 2022-07-24 21:24:08 +01:00
Dylan K. Taylor
5e3b3a0700 Fix assert spam on debug clients 2022-07-24 17:51:02 +01:00
Dylan K. Taylor
ba2baba7cc Added netherite blocks and items 2022-07-14 20:39:09 +01:00
Dylan K. Taylor
d4f4fda442 Merge branch 'next-minor' into next-major 2022-07-14 19:54:50 +01:00
Dylan K. Taylor
baf75089f5 Entity: cancel fire damage for fireproof entities 2022-07-14 19:53:25 +01:00
Ali
705df7d508 EffectManager: remove redundant check (#5153) 2022-07-14 17:56:18 +01:00
Dylan K. Taylor
3dd4c42fd3 Merge branch 'next-minor' into next-major 2022-07-14 16:06:35 +01:00
Dylan K. Taylor
75d7adfb2d WitherEffect: fixed incorrect damage interval 2022-07-14 16:05:35 +01:00
Dylan K. Taylor
dea0207e4e Merge branch 'next-minor' into next-major 2022-07-13 17:06:04 +01:00
Dylan K. Taylor
06655bee78 Updated to 1.19.10 2022-07-13 00:59:49 +01:00
Dylan K. Taylor
c67e42a723 Add a hook to enable blocks to react to projectiles colliding with them
this enables implementing blocks such as the target block.
2022-07-07 01:44:13 +01:00
Dylan K. Taylor
0a23e91329 Rename BlockFactory::fromFullBlock() -> BlockFactory::fromStateId() 2022-07-05 13:46:19 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
1533fcf8f6 Separate block legacy data upgrading from block deserialization
this commit provides a central place where all block data can go to be upgraded to the latest version (currently 1.19), irrespective of how old it is.

Previously I had issues during debugging, because it wasn't possible to just upgrade a block without deserializing it into a Block object, which isn't currently supported for many blocks.
This commit solves that problem by separating the upgrading from the deserialization.
2022-06-23 16:45:02 +01:00
Dylan K. Taylor
680615eed8 Namespace rename 2022-06-08 15:54:45 +01:00
Dylan K. Taylor
1ff69136a3 Merge branch 'next-major' into modern-world-support 2022-06-07 20:01:40 +01:00
Dylan K. Taylor
aa9f8781ff Merge branch 'next-minor' into next-major 2022-06-07 19:56:26 +01:00
Dylan K. Taylor
1584768c80 PaintingMotive: fixed botched painting fix from 0ea3861d43
I knew I should have used a singleton for this ...
2022-06-07 15:48:20 +01:00
Dylan K. Taylor
13bb1c26fb ItemTranslator now operates directly using Item, rather than using item ID/meta + ItemFactory
in almost all cases where ItemTranslator is used, an Item already exists, so it doesn't make any sense to make ItemTranslator go and create another item instance just to pass to ‰ItemSerializer.
2022-06-06 20:51:26 +01:00
Dylan K. Taylor
5c85aa6e58 Eliminate remaining usages of legacy block ID+meta on disk
flower pots loaded from vanilla worlds should now correctly display the plant inside
2022-06-05 21:49:51 +01:00
Dylan K. Taylor
d2613039ed Replace BlockLegacyIds usages with BlockTypeIds where possible 2022-06-05 21:17:10 +01:00
Dylan K. Taylor
f2dc9187f0 Use covariant types for InventoryHolder and Container implementors 2022-06-05 18:49:48 +01:00
Dylan K. Taylor
083a35f970 Modernize property type declarations 2022-06-04 18:16:32 +01:00