Skip to content

Finished some todos - #177

Open
xii69 wants to merge 1 commit into
Wind-Development:masterfrom
xii69:master
Open

xii69 wants to merge 1 commit into
Wind-Development:masterfrom
xii69:master

Conversation

@xii69

@xii69 xii69 commented Sep 19, 2026

Copy link
Copy Markdown

Added hasEnchantments method for better code style
Throwing an exception instead of replacing the given value with the maximum / minumum allowed in Vanilla commands
Added configuration options for NachoSpigot commands

Throwing an exception instead of replacing the given value with the maximum / minumum allowed in Vanilla commands
Added configuration options for NachoSpigot commands

@windcolor-dev windcolor-dev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Other than that, looks good!

boolean conflicts = false;

if (!force && !enchantments.isEmpty()) { // TODO: Improve this to use a "hasEnchantments" call
if (!force && !item.hasEnchantments()) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It should be fine to keep this like how it was before.

I don't think a hasEnchantments method was added in newer API.

boolean conflicts = false;

if (!force && !enchantments.isEmpty()) { // TODO: Improve this to use a "hasEnchantments" call
if (!force && !item.hasEnchantments()) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
if (!force && !item.hasEnchantments()) {
if (!force && !enchantments.isEmpty()) {

return meta == null ? ImmutableMap.<Enchantment, Integer>of() : meta.getEnchants();
}

// WindSpigot start

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can remove this, same reason as above

Comment on lines +407 to +417
// WindSpigot start
/**
* Checks if this ItemStack has any enchantments.
*
* @return True if this has any enchantments
*/
public boolean hasEnchantments() {
return !getEnchantments().isEmpty();
}
// WindSpigot stop

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// WindSpigot start
/**
* Checks if this ItemStack has any enchantments.
*
* @return True if this has any enchantments
*/
public boolean hasEnchantments() {
return !getEnchantments().isEmpty();
}
// WindSpigot stop

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