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

Fix event-value time states #671 #3149

Merged
merged 3 commits into from
Jul 17, 2020
Merged

Conversation

TheLimeGlass
Copy link
Collaborator

@TheLimeGlass TheLimeGlass commented Jul 15, 2020

Description

Fix time states #671

What this fix does is basically if the ExprEventValue setTime gets changed at some point. It will refresh it's getters which are done correctly now from my EventValue default expression pull 2cadc16

This is required because WrapperExpression's init method is called after the expression it's wrapping, which can't be changed unless the wrapper expression is a subtype of the expression it's wrapping, so this fix is suitable.

Related Issues

#671

on block place:
	if future block will be dirt:
		broadcast "Test 1. placed dirt"
	else if past block was short grass:
		broadcast "Test 1. placed on short grass"
	else:
		broadcast "Test 1. block place"

on fading of ice:
	if past block was ice:
		broadcast "Should be messaged"
		if future block will be water:
			broadcast "Should be messaged 2"

on fading of leaves:
	if past block was leaves:
		broadcast "Should be messaged"
		if future block will be air:
			broadcast "Should be messaged 2"

This fixes time states only working with event-values, aka the main area of this usage, but
Expressions are suppose to check with their default expression and convert to get it's event-values getters. Example:

on block place:
        # This below is suppose to grab any default expressions of the type the expression is.
	# But... it doesn't.
	if past block at event-location was short grass:
		broadcast "&6Test 2. placed on short grass"

I've made this issue into a separate issue #3150

@TheLimeGlass
Copy link
Collaborator Author

TheLimeGlass commented Jul 16, 2020

Simple ingame test: Place ice and lava next to it. The test script posted should broadcast correctly when the ice melts in 30 seconds or so.

Copy link
Contributor

@ShaneBeee ShaneBeee left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for this one!

@TheLimeGlass
Copy link
Collaborator Author

TheLimeGlass commented Jul 16, 2020

All these syntax work again! I think there are some issues involving these

{"(1¦neither|) %objects@-1% (was|were)(|2¦(n't| not|4¦ neither)) ((greater|more|higher|bigger|larger) than|above) %objects%", Relation.GREATER},
{"(1¦neither|) %objects@-1% (was|were)(|2¦(n't| not|4¦ neither)) (greater|more|higher|bigger|larger|above) [than] or (equal to|the same as) %objects%", Relation.GREATER_OR_EQUAL},
{"(1¦neither|) %objects@-1% (was|were)(|2¦(n't| not|4¦ neither)) ((less|smaller) than|below) %objects%", Relation.SMALLER},
{"(1¦neither|) %objects@-1% (was|were)(|2¦(n't| not|4¦ neither)) (less|smaller|below) [than] or (equal to|the same as) %objects%", Relation.SMALLER_OR_EQUAL},
{"(1¦neither|) %objects@-1% (2¦)((was|were) (not|4¦neither)|wasn't|weren't) [equal to] %objects%", Relation.EQUAL},
{"(1¦neither|) %objects@-1% (was|were) [(equal to|the same as)] %objects%", Relation.EQUAL},
{"(1¦neither|) %objects@-1% (was|were) between %objects% and %objects%", Relation.EQUAL},
{"(1¦neither|) %objects@-1% (2¦)(was not|were not|wasn't|weren't) between %objects% and %objects%", Relation.EQUAL},
{"(1¦neither|) %objects@1% (will be|2¦(will (not|4¦neither) be|won't be)) ((greater|more|higher|bigger|larger) than|above) %objects%", Relation.GREATER},
{"(1¦neither|) %objects@1% (will be|2¦(will (not|4¦neither) be|won't be)) (greater|more|higher|bigger|larger|above) [than] or (equal to|the same as) %objects%", Relation.GREATER_OR_EQUAL},
{"(1¦neither|) %objects@1% (will be|2¦(will (not|4¦neither) be|won't be)) ((less|smaller) than|below) %objects%", Relation.SMALLER},
{"(1¦neither|) %objects@1% (will be|2¦(will (not|4¦neither) be|won't be)) (less|smaller|below) [than] or (equal to|the same as) %objects%", Relation.SMALLER_OR_EQUAL},
{"(1¦neither|) %objects@1% (2¦)((will (not|4¦neither) be|won't be)|(isn't|aren't|is not|are not) (turning|changing) [in]to) [equal to] %objects%", Relation.EQUAL},
{"(1¦neither|) %objects@1% (will be [(equal to|the same as)]|(is|are) (turning|changing) [in]to) %objects%", Relation.EQUAL},
{"(1¦neither|) %objects@1% will be between %objects% and %objects%", Relation.EQUAL},
{"(1¦neither|) %objects@1% (2¦)(will not be|won't be) between %objects% and %objects%", Relation.EQUAL}

@ShaneBeee ShaneBeee merged commit 73565b8 into SkriptLang:master Jul 17, 2020
@TheLimeGlass TheLimeGlass deleted the fix671 branch February 16, 2023 22:01
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