Patch 3#4
Conversation
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/13001707314
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/13094301661
closes pmmp#6500 This fixes break time animations for mining fatigue and haste, and improves the underwater and on-ground behaviour. on-ground is still not quite right for reasons not related to this PR (see pmmp#6547). I'm also not quite sure the underwater logic is correct (in water vs underwater?) but it's definitely better than what we have currently.
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/13126338048
This PR significantly improves performance of entity movement calculation. Previous attempts to optimise this were ineffective, as they used a cache to mitigate the cost of recomputing AABBs. Entities tend to move around randomly, so the non-cached pathway really needed to be optimized. This change improves performance on multiple fronts: 1) avoiding Block allocations for blocks with 1x1x1 AABBs and with no AABBs (the most common) 2) avoiding Block allocations and overlapping intersection checks unless a stateID is specifically known to potentially exceed its cell boundaries (like fences) 3) avoiding overlapping AABB checks when overlaps can't make any difference anyway (cubes) Together, these changes improve the performance of World->getBlockCollisionBoxes() by a factor of 5. In real-world terms, this shows up as a major performance improvement in situations with lots of entities moving in random directions. Testing with item entities showed an increase from 400 to 1200 moving items with the same CPU usage. This change is built on the assumption that `Block->recalculateCollisionBoxes()` and its overrides don't interact with any world. This is technically possible due to the crappy design of the `Block` architecture, but should be avoided. As a world is not available during `RuntimeBlockStateRegistry` initialization, attempting to interact with a world during `recalculateCollisionBoxes()` will now cause a crash. This turned out to be a problem for `ChorusPlant`, which was fixed by 70fb9bb. The correct solution in this case was to use dynamic states similar to how we currently deal with fence connections.
there's no technical reason not to support this, since it doesn't violate any assumptions and the type returned is a base anyway. this enables implementing stuff like snow cauldrons in a plugin, which previously would require reflection due to the minecraft:cauldron deserializer being registered already. it also enables overriding IDs to map to custom blocks, which might be useful for overriding some functionality (although this is inadvisable - and won't alter the usage of stuff like VanillaBlocks::WHATEVER()). we do *not* allow overriding serializers, since type IDs are expected to be paired to block implementations, and allowing them to be reassigned could lead to crashes if the new class was incorrect. So the correct approach for overriding nether portals would be to create a custom type ID as if you were adding a fully custom item. This will also allow other plugins to distinguish between your implementation and the built-in one.
this command dumps a human-readable version of pmmp/mapping palette mapping files to a .txt file. may be useful for debugging issues with the schema generator or the upgrade process.
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/13488997706
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/13610829991
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/13666455727
see pmmp#6635 for rationale on why we want to get rid of this for now, this rule will prevent this anti-feature from being used in new code
this makes sure wrong parameters don't show up as core errors, as seen in crash report 12373907 closes pmmp#6642
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/13743358576
…mp#6643) this was causing TNT and falling blocks to briefly appear half a block lower than their true position, because their positions are measured from the center and not the base.
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/13754675430
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/13825107599
these are noisy and cause conflicts. Since they also usually cause new errors to be reported, we often can't directly update it anyway. Better to test & update this locally.
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/13868087288
this has such a big impact on performance that I think this is warranted. Should also make it more obvious what the GC is doing without needing to enable ALL debug info.
…ally registered if not, this will cause random crashes in core code, which assumes that state IDs found on runtime chunk memory are valid and registered. this problem exists in other places too, and probably requires a rethink of how we're dealing with this, but for now, this will do as a band-aid.
Co-authored-by: Dylan K. Taylor <dktapps@pmmp.io>
|
Caution Review failedThe pull request is closed. WalkthroughThis pull request introduces a broad set of modifications across repository configurations, changelogs, dependency definitions, and core system files. Updates include enhanced warning messages in bug report templates, refined dependency handling in Dependabot, and simplified support messaging in workflow files. Changelog documents for versions 5.26.0 and 5.27.0 now detail performance improvements and compatibility warnings. Several classes have been updated with new properties, methods, and refined logging while deprecating obsolete functionality. New features include enhanced copper block serialization/deserialization, improved entity sound packet structures, and robust static analysis rules, alongside minor documentation and testing adjustments. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller as Deserialization Caller
participant DS as BlockStateToObjectDeserializer
participant Registry as RuntimeBlockStateRegistry
participant Copper as Copper Deserializer Logic
Caller->>DS: deserialize(blockStateData)
DS->>DS: deserializeToStateId(blockStateData)
DS->>Registry: Validate state ID exists
Registry-->>DS: Confirm state ID
DS->>DS: registerCopperDeserializers()
DS->>Copper: mapCopper(...)
Copper-->>DS: Returns copper mapping
DS-->>Caller: Deserialized state ID
sequenceDiagram
participant Player as Player
participant Handler as SurvivalBlockBreakHandler
participant Effects as Effect Checker
participant Viewer as Client Viewer
Player->>Handler: Initiate block break
Handler->>Handler: calculateBreakProgressPerTick()
Handler->>Effects: Check ground, underwater, Haste, Mining Fatigue
Effects-->>Handler: Return modifier values
Handler->>Viewer: update() sends new break progress packet
Viewer-->>Player: Receives updated break progress
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (43)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Related issues & PRs
Changes
API changes
Behavioural changes
Backwards compatibility
Follow-up
Tests
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Refactor/Chores