Skip to content

Conversation

@njsharpe
Copy link
Contributor

@njsharpe njsharpe commented Feb 9, 2022

  • Split Utility into StringUtil & NumberUtil for organization.
  • Added functions to StringUtil that may come in handy.
  • Added min(...) to NumberUtil for consistency.
  • Added fake enchantment for use in ItemBuilder, in the case we want an item with the enchantment glow with no special effects.

Other notes:
Personally, there are things I really like about your ItemBuilder, but technically speaking it doesn't "build" anything. A builder class should not modify the resulting item as the methods are called, it should keep everything separate until a build() method is called, to which it will then take all stored variables and combine them into an ItemStack.

@CosimoTiger CosimoTiger merged commit 55e7051 into CosimoTiger:master Feb 9, 2022
@CosimoTiger
Copy link
Owner

I specifically avoid making ItemBuilder a bloatware of countless variables that each have to be referenced and modified - my version takes less memory overall. The goal of the ItemBuilder is to allow chaining of ItemStack modifications, quickly modify existing ItemStacks and perhaps take different types of input (e.g. List and String[]). Additionally, I want this to be dependent on Bukkit's definition of ItemStack rather than having to change the variables in the ItemBuilder in the future.

I'm aware it's not necessarily a 'builder', I can't quite find a truer name, but I'm definitely not going to change the very useful function to fit a very close enough name.

@CosimoTiger
Copy link
Owner

Thank you for your contribution though! 😊

@CosimoTiger CosimoTiger self-assigned this Aug 23, 2024
@CosimoTiger CosimoTiger added feature New feature or request for one deprecated This feature is no longer in use or was abandoned labels Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deprecated This feature is no longer in use or was abandoned feature New feature or request for one

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants