Hide dropped item names - #33
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 430ad76653
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } else if (entityType == EntityTypes.ITEM) { | ||
| spoofDroppedItemMetadata(entityData, settings); |
There was a problem hiding this comment.
Cache dropped item entities before spoofing metadata
When a dropped item is spawned, EntityTracker.handleSpawnEntity returns for any non-LIVINGENTITY, and repo-wide search shows cache insertion only happens through spawnEntity/addLivingEntity; therefore MetadataSpoofer.onPacketSend sees cachedEntity == null and returns before this new ITEM branch can run. In the inspected SPAWN_ENTITY → ENTITY_METADATA flow, dropped item custom_name/item_name components are never removed.
Useful? React with 👍 / 👎.
| names: | ||
| enabled: true |
There was a problem hiding this comment.
Load the new names toggle from config
When an admin sets spoof.entity-data.items.names.enabled: false, this option has no effect because ConfigManager.setItemOptions still only reads enabled, stack-amount, durability, and enchantments, leaving Settings.Items.names at its default true. This makes the newly documented opt-out ineffective for any loaded configuration.
Useful? React with 👍 / 👎.
430ad76 to
acca92c
Compare
|
It's better to set it to "space" rather than just unsetting it |
|
Sorry, good point. I changed it to set both name components to a single blank space instead of removing them. |
Fixes #26.
Removes custom_name and item_name components from dropped item metadata before clients receive it.
Tested: