Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ShopBuyEvent.java and CategoryContent.java #1060

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

KKiiya
Copy link
Contributor

@KKiiya KKiiya commented Jan 3, 2025

Updated ShopBuyEvent.java and CategoryContent.java to allow getting the slot that was clicked for the purchase and slight readibility improvements

Fixed tag apply for 1.18.2, 1.17.1, 1.12.2 and 1.8.8 where the tag wouldnt get applied ever (because the NBTTag was getting applied only if the item was null with no additive tags)
Tag wouldnt get applied either in this part
Updated ShopBuyEvent.java and CategoryContent.java to allow getting the slot that was clicked for the purchase and slight readibility improvements
} else {
ct = contentTiers.get(shopCache.getContentTier(getIdentifier()));
}
if (!shopCache.hasCachedItem(this)) ct = contentTiers.get(0);
Copy link
Owner

Choose a reason for hiding this comment

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

we boomers. we do not like this code style without brackets

@@ -46,17 +47,35 @@ public ShopBuyEvent(Player buyer, ICategoryContent categoryContent) {
this.categoryContent = categoryContent;
this.buyer = buyer;
this.arena = null;
this.slot = -1;
Copy link
Owner

Choose a reason for hiding this comment

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

use a Integer object so we can return null when no slot is clicked

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.

2 participants