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

Adds Enchantment Glint Syntaxes #6638

Open
wants to merge 31 commits into
base: dev/feature
Choose a base branch
from

Conversation

NotSoDelayed
Copy link
Contributor

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

Copy link
Member

@sovdeeth sovdeeth left a comment

Choose a reason for hiding this comment

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

needs tests

@sovdeeth sovdeeth added the feature Pull request adding a new feature. label May 3, 2024
Copy link
Contributor

@Fusezion Fusezion left a 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]

@NotSoDelayed
Copy link
Contributor Author

The following will be added in the coming hours:

  • Expression to get preset enchantment glint items
  • Condition of whether an item has enchantment glint override
  • TESTS!!

Copy link
Contributor

@Fusezion Fusezion left a 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

@NotSoDelayed NotSoDelayed requested a review from sovdeeth May 5, 2024 04:45
@sovdeeth sovdeeth added the feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. label May 5, 2024
Copy link
Member

@APickledWalrus APickledWalrus left a 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 :)

@sovdeeth
Copy link
Member

sovdeeth commented May 6, 2024

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.

@NotSoDelayed
Copy link
Contributor Author

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 :)

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.

@APickledWalrus
Copy link
Member

I honestly might rather see the expression scrapped, but I'd like opinions from others.

@NotSoDelayed
Copy link
Contributor Author

NotSoDelayed commented Jun 26, 2024

…. though what is the purpose of explicitly setting it to false?

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 true, false, and null.

@NotSoDelayed
Copy link
Contributor Author

NotSoDelayed commented Jun 26, 2024

The condition alone will return true if there’s an override — it could be set to either true or false. So this only tells the user that there’s an enforcement, but the value is unknown to them without the expression.

With the expression retained + the new whether %condition% expression, the user can do the following:

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

@APickledWalrus
Copy link
Member

APickledWalrus commented Jun 26, 2024

Sorry for the confusion. We could maybe have another condition like %itemtypes% are forced [not] to glint? Might be worth seeing what others think.

@sovdeeth
Copy link
Member

The condition alone will return true if there’s an override — it could be set to either true or false. So this only tells the user that there’s an enforcement, but the value is unknown to them without the expression.

With the expression retained + the new whether %condition% expression, the user can do the following:

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

re: using set/not set as intended states
I don't like this, because it means that the expression returning nothing is good and intended. Which conflicts with how skript returns nothing when it fails to get the right type. If you get none from {_item}'s enchant glint override, then you don't know if it's working as intended or if {_item} is actually a number, or just not set. A second condition/pattern to handle that behavior would be better, imo.

Copy link
Member

@sovdeeth sovdeeth left a comment

Choose a reason for hiding this comment

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

tests failing

@NotSoDelayed
Copy link
Contributor Author

Apologies for the commit spam due to test suite configuration in Gradle tasks in skriptTestJava17 only has up to 1.20.4 somehow.

@sovdeeth
Copy link
Member

sovdeeth commented Jul 1, 2024

Apologies for the commit spam due to test suite configuration in Gradle tasks in skriptTestJava17 only has up to 1.20.4 somehow.

1.20.6 requires java 21, so it's under skriptTestJava21

Copy link
Contributor

@Fusezion Fusezion left a 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

Comment on lines +1 to +2
test "item with enchantment glint" when running minecraft "1.20.5":

Copy link
Contributor

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?

Copy link
Member

@Moderocky Moderocky left a 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.

Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Pull request adding a new feature. up for debate When the decision is yet to be debated on the issue in question
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants