-
-
Notifications
You must be signed in to change notification settings - Fork 413
A Complete Portal Module #8210
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
base: dev/feature
Are you sure you want to change the base?
A Complete Portal Module #8210
Conversation
""") | ||
@Since("2.4") | ||
@Events("portal_create") | ||
public class ExprPortalBlocks extends SimpleExpression<Block> { |
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.
Sovde's request on converting to EVE
.examples( | ||
"on portal exit:", | ||
"\tbroadcast \"%event-entity% is exiting a portal at %event-location%\"", | ||
"\tadd 2 to vector y of event-vector") |
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 explanation for what event-vector is
Skript.registerEvent("Portal / End Gateway", EvtPortal.class, events, "[player] portal", "entity portal") | ||
.description( | ||
"Called when a player or an entity uses a nether portal, end portal or end gateway. Note that events with keyword 'entity' does not apply to players.", | ||
"<a href='#EffCancelEvent'>Cancel the event</a> to prevent the entity from teleporting." | ||
).keywords( | ||
"player", "entity" | ||
).examples( | ||
"on portal:", | ||
"\tbroadcast \"%player% has entered a %event-portaltype%!\"", | ||
"", | ||
"on player portal:", | ||
"\tplayer's world is world(\"wilderness\")", | ||
"\tset world of event-location to player's world", | ||
"\tadd 9000 to x-pos of event-location", | ||
"", | ||
"on entity portal:", | ||
"\tbroadcast \"A %type of event-entity% has entered a portal!" | ||
).since("1.0, 2.5.3 (entities), INSERT VERSION (location changers, end gateway)"); |
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.
Skript.registerEvent("Portal / End Gateway", EvtPortal.class, events, "[player] portal", "entity portal") | |
.description( | |
"Called when a player or an entity uses a nether portal, end portal or end gateway. Note that events with keyword 'entity' does not apply to players.", | |
"<a href='#EffCancelEvent'>Cancel the event</a> to prevent the entity from teleporting." | |
).keywords( | |
"player", "entity" | |
).examples( | |
"on portal:", | |
"\tbroadcast \"%player% has entered a %event-portaltype%!\"", | |
"", | |
"on player portal:", | |
"\tplayer's world is world(\"wilderness\")", | |
"\tset world of event-location to player's world", | |
"\tadd 9000 to x-pos of event-location", | |
"", | |
"on entity portal:", | |
"\tbroadcast \"A %type of event-entity% has entered a portal!" | |
).since("1.0, 2.5.3 (entities), INSERT VERSION (location changers, end gateway)"); | |
Skript.registerEvent("Portal / End Gateway", EvtPortal.class, events, "[player] portal", "entity portal") | |
.description( | |
"Called when a player or an entity uses a nether portal, end portal or end gateway. Note that events with keyword 'entity' does not apply to players.", | |
"<a href='#EffCancelEvent'>Cancel the event</a> to prevent the entity from teleporting.") | |
.keywords("player", "entity") | |
.examples( | |
"on portal:", | |
"\tbroadcast \"%player% has entered a %event-portaltype%!\"", | |
"", | |
"on player portal:", | |
"\tplayer's world is world(\"wilderness\")", | |
"\tset world of event-location to player's world", | |
"\tadd 9000 to x-pos of event-location", | |
"", | |
"on entity portal:", | |
"\tbroadcast \"A %type of event-entity% has entered a portal!") | |
.since("1.0, 2.5.3 (entities), INSERT VERSION (location changers, end gateway)"); |
you should also use the """ text blocks here to clean it up.
on portal: | ||
wait 1 tick | ||
set portal cooldown of event-entity to 5 seconds | ||
""") |
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.
""") | |
""") |
Problem
Skript is lacking a few portal related features, while some still consists of legacy code.
Solution
This PR adds some missing portal related features (refer to section below), enhances existing ones, and finally they all reunite into its a single module as part of modernizing Skript registrations.
Changes
event-portaltype
ExprPortal
toExprPortalBlocks
due to former name was ambiguousTesting Completed
JUnit tests were implemented at
EvtPortalTest.java
andPortalTest.sk
, covering every portal related events and expressions supported.Supporting Information
At this date of PR creation, this PR was designed ahead of time with proposed Skript 2.14 standards, which includes dropping Spigot support and Minecraft versions below 1.21, which is why tests below 1.21 will fail.
Completes: none
Related: none