Skript icon indicating copy to clipboard operation
Skript copied to clipboard

Add piglin bartering event

Open Efnilite opened this issue 1 year ago • 8 comments

Description

Adds support for the PiglinBarterEvent and adds the barter input and barter output expressions.


Target Minecraft Versions: 1.16.5+ (event was added in Spigot 1.16.5) Requirements: none Related Issues: none

Efnilite avatar Jun 06 '24 15:06 Efnilite

Looks good, the only thing missing is some tests! This would need JUnit tests, so if you're not comfortable with adding those, please let me know and I can add some for you.

thanks for the offer :) idm trying myself though. do you mean this? if not, where can i find the appropriate format or example?

Efnilite avatar Jun 06 '24 21:06 Efnilite

Looks good, the only thing missing is some tests! This would need JUnit tests, so if you're not comfortable with adding those, please let me know and I can add some for you.

thanks for the offer :) idm trying myself though. do you mean this? if not, where can i find the appropriate format or example?

Yup, the tests in that folder as well as this package are what you want to look at

sovdeeth avatar Jun 06 '24 21:06 sovdeeth

Looks good, the only thing missing is some tests! This would need JUnit tests, so if you're not comfortable with adding those, please let me know and I can add some for you.

thanks for the offer :) idm trying myself though. do you mean this? if not, where can i find the appropriate format or example?

Yup, the tests in that folder as well as this package are what you want to look at

I'm not so sure on how to fix the current error that occurs in <1.16.5 versions, should I use reflection or is there a better and prefered way? It should be visible in the

Efnilite avatar Jun 08 '24 11:06 Efnilite

Your expressions aren't gated behind class exists checks

sovdeeth avatar Jun 08 '24 12:06 sovdeeth

Your expressions aren't gated behind class exists checks

which expressions in which file do you mean? in the java file i have this rn https://github.com/SkriptLang/Skript/blob/cb4f148c441180071bf7f3412299a5fb2dc22ab1/src/test/java/org/skriptlang/skript/test/tests/syntaxes/events/EvtPiglinBarterTest.java#L47

Efnilite avatar Jun 08 '24 12:06 Efnilite

Barter drops and barter input are registered without checking if the event class exists. I'm not sure if that's the root cause of the test exception, I didn't look closely.

sovdeeth avatar Jun 08 '24 13:06 sovdeeth

Aight, should be good now

Efnilite avatar Jun 15 '24 21:06 Efnilite

You can use EventValueExpression to specify that it's exclusively from an event

TheLimeGlass avatar Jul 21 '24 04:07 TheLimeGlass