You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix elytra pickup issue causing immediate drop - #44
This pull request introduces new gameplay logic to prevent players from possessing Elytra items and refactors an existing mixin for clarity. The main focus is on removing Elytra from player inventories and equipment slots each server tick, as well as renaming the mixin class and updating its references for better maintainability.
Gameplay mechanics changes:
Added two ServerTickEvents.END_LEVEL_TICK listeners in TheJourneyMatters.java to (1) remove all Elytra items from player inventories and drop them, and (2) unequip Elytra from the chest slot and drop it if worn by any player.
Codebase refactoring:
Renamed the mixin class from TJMMixin to BlockItemMixin in BlockItemMixin.java for clearer intent and maintainability.
Updated the mixin registration in overworldinfrastructure.mixins.json to reference BlockItemMixin instead of TJMMixin.
Dependency updates:
Added necessary imports in TheJourneyMatters.java to support Elytra removal logic.
Adds Elytra cleanup listeners, but the current matching logic does not remove all Elytras, including damaged, enchanted, duplicate, or offhand items. The code documentation is also outdated.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Two critical findings in TheJourneyMatters.java would stop the code from compiling because null is passed to Player#drop's primitive boolean parameter, and the second listener is redundant and would drop a duplicate stack.
The lambda parameter for END_LEVEL_TICK is a ServerLevel, not a server, so server is misleading. Rename it to world to match the existing listener in this file, and use world.players(). Line 58 also uses spaces instead of tabs, which the fix below corrects.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Unresolved critical findings remain, most notably passing null to a primitive boolean parameter in Player#drop, which would prevent compilation, along with a moderate issue where the wrong Elytra stack is dropped.
This chest-slot listener never removes anything. Inventory#getContainerSize() includes the armor slots, so the first listener already removes and drops a worn Elytra before this one runs. Delete the block to keep the removal logic in one place. If it is kept, use == instead of .equals and drop the original chest stack instead of a new ItemStack.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces new gameplay logic to prevent players from possessing Elytra items and refactors an existing mixin for clarity. The main focus is on removing Elytra from player inventories and equipment slots each server tick, as well as renaming the mixin class and updating its references for better maintainability.
Gameplay mechanics changes:
ServerTickEvents.END_LEVEL_TICKlisteners inTheJourneyMatters.javato (1) remove all Elytra items from player inventories and drop them, and (2) unequip Elytra from the chest slot and drop it if worn by any player.Codebase refactoring:
TJMMixintoBlockItemMixininBlockItemMixin.javafor clearer intent and maintainability.overworldinfrastructure.mixins.jsonto referenceBlockItemMixininstead ofTJMMixin.Dependency updates:
TheJourneyMatters.javato support Elytra removal logic.closes #3