-
-
Notifications
You must be signed in to change notification settings - Fork 371
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
Adds Enchantment Glint Syntaxes #6638
base: dev/feature
Are you sure you want to change the base?
Adds Enchantment Glint Syntaxes #6638
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs tests
src/main/java/ch/njol/skript/effects/EffForceEnchantmentGlint.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/effects/EffForceEnchantmentGlint.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth adding an expression to give with/without enchantment glint
%itemtypes% with[:out] enchantment glint [override]
The following will be added in the coming hours:
|
src/main/java/ch/njol/skript/effects/EffForceEnchantmentGlint.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/expressions/ExprEnchantmentGlint.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/expressions/ExprItemWithEnchantmentGlint.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from other requested changes looks fine to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems unnecessary to me to have an Expression, Condition, and Effect for the same thing. I think we should pick between Condition and Effect versus Expression (I think the former may be preferrable as I am not really a fan of boolean expressions). I'd like to gather some thoughts on this :)
I'm in agreement, in most cases a condition and effect flow much better. I'm not as opposed to having multiple ways to do the same thing, though, so I'd be ok with leaving the expression in too. |
For this case, how about I scrap the condition syntax? As the user can use the expression to check whether the override is set or not. |
I honestly might rather see the expression scrapped, but I'd like opinions from others. |
If the meta is set to true, the ItemStack will glint if there’s no enchantment, where vice versa the ItemStack will not glint if there’s an enchantment. Setting it to null removes the enforcement. So if this expression is retained, it will return |
The condition alone will return true if there’s an override — it could be set to either With the expression retained + the new set {_} to whether enchantment glint override is set
set {_} to whether enchantment glint override is not set
set {_} to whether enchantment glint override is true
set {_} to whether enchantment glint override is false |
Sorry for the confusion. We could maybe have another condition like |
re: using set/not set as intended states |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests failing
Apologies for the commit spam due to test suite configuration in Gradle tasks in |
1.20.6 requires java 21, so it's under skriptTestJava21 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a quick look over and some suggestions
src/main/java/ch/njol/skript/expressions/ExprItemWithEnchantmentGlint.java
Outdated
Show resolved
Hide resolved
test "item with enchantment glint" when running minecraft "1.20.5": | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts about adding some test using the parse section testing most if not all patterns?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I approved this before but for some reason it's back in my queue, it still looks fine.
src/main/java/ch/njol/skript/conditions/CondItemEnchantmentGlint.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/effects/EffForceEnchantmentGlint.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/expressions/ExprItemWithEnchantmentGlint.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/effects/EffForceEnchantmentGlint.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think we should look into how the conditions can be modified so that we do not need to include a boolean expression
…into feature/expr-enchantment-glint
Description
This PR adds the enchantment glint syntaxes into Skript!
Target Minecraft Versions: Minecraft 1.20.5
Requirements: Spigot 1.20.5
Related Issues: none