Skip to content

Don't show inspect contents on objects without contents#264

Merged
spnda merged 1 commit intospnda:masterfrom
TheDiscordian:InspectFix
Feb 17, 2024
Merged

Don't show inspect contents on objects without contents#264
spnda merged 1 commit intospnda:masterfrom
TheDiscordian:InspectFix

Conversation

@TheDiscordian
Copy link
Contributor

Fixes #263.

@TheDiscordian TheDiscordian requested a review from spnda as a code owner February 15, 2024 17:52
Copy link
Owner

@spnda spnda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it would make sense to remove the ternary here as there's no need for it anyway, as far as I can tell.

@TheDiscordian
Copy link
Contributor Author

TheDiscordian commented Feb 15, 2024

I guess it would make sense to remove the ternary here as there's no need for it anyway, as far as I can tell.

It looks like the ternary is there to handle offsetting other items:

            if (PlayerInventoryClipboard.contains(player.getUniqueId().toString())) {
                setItemStack(
                    getSize() - 4 - rightItemOffset,
                    Material.KNOWLEDGE_BOOK,
                    TranslationKey.INVENTORIES__PASTE_CONFIGURATION
                );
            }
            setItemStack(
                getSize() - 3 - rightItemOffset,
                Material.PAPER,
                TranslationKey.INVENTORIES__COPY_CONFIGURATION
            );
        }

        if (!isNotProtected && state.menuPermissions.contains(BlockAccessMenuEvent.MenuPermission.INFO)) {
            setItemStack(
                getSize() - 2 - rightItemOffset,
                Material.OAK_SIGN,
                TranslationKey.INVENTORIES__BLOCK_INFO
            );

I can change it to a boolean, and remove the references to the offset in these lines if you think it won't have side effects. However this code looks good to me.

@spnda spnda merged commit a2dc550 into spnda:master Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Can Take the Telescope from Menu

2 participants