-
-
Notifications
You must be signed in to change notification settings - Fork 446
Entity Gliding #8588
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
Open
AnOwlBe
wants to merge
23
commits into
SkriptLang:dev/feature
Choose a base branch
from
AnOwlBe:feature/EvtGlideStateChange
base: dev/feature
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Entity Gliding #8588
Changes from 3 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
ef781fb
Removes entitytoggleglideevent from simplevents removes boolean expre…
AnOwlBe 1acc1c8
Fix SimpleEvents
AnOwlBe 3339cb1
Fix SimpleEvents attempt #2
AnOwlBe 9f1a0ab
Implemented suggestions
AnOwlBe 40a2b98
Implemented syntax change
AnOwlBe 0c1acee
Changes ExprGlidingState.java from deletion to deprecated
AnOwlBe 7857ac4
Update src/main/java/ch/njol/skript/expressions/ExprGlidingState.java
AnOwlBe eca4427
Update src/main/java/org/skriptlang/skript/bukkit/entity/elements/eff…
AnOwlBe d9bf39d
Warning message for ExprGlidingState
AnOwlBe bf44c32
Update src/main/java/ch/njol/skript/expressions/ExprGlidingState.java
AnOwlBe e869391
Some fixes
AnOwlBe be3cef5
Merge remote-tracking branch 'origin/feature/EvtGlideStateChange' int…
AnOwlBe 59b8d6a
Update src/main/java/org/skriptlang/skript/bukkit/entity/EntityModule…
AnOwlBe ba1c283
Update src/main/java/org/skriptlang/skript/bukkit/entity/EntityModule…
AnOwlBe 6b3a176
Update src/main/java/org/skriptlang/skript/bukkit/entity/elements/eff…
AnOwlBe 7a637c0
Update src/main/java/org/skriptlang/skript/bukkit/entity/elements/eff…
AnOwlBe 40b81ab
Update src/main/java/org/skriptlang/skript/bukkit/entity/elements/eff…
AnOwlBe 2e2bb33
Update src/main/java/org/skriptlang/skript/bukkit/entity/EntityModule…
AnOwlBe 730a7a6
Update src/main/java/org/skriptlang/skript/bukkit/entity/EntityModule…
AnOwlBe 53d0bc1
Changes to printing deprecation warning
AnOwlBe 36afed3
Merge remote-tracking branch 'origin/feature/EvtGlideStateChange' int…
AnOwlBe 75a5e9c
Merge branch 'dev/feature' into feature/EvtGlideStateChange
AnOwlBe a3d0e30
Merge branch 'dev/feature' into feature/EvtGlideStateChange
AnOwlBe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 0 additions & 53 deletions
53
src/main/java/ch/njol/skript/expressions/ExprGlidingState.java
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
src/main/java/org/skriptlang/skript/bukkit/entity/elements/effects/EffGlide.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| package org.skriptlang.skript.bukkit.entity.elements.effects; | ||
|
|
||
| import ch.njol.skript.doc.Description; | ||
| import ch.njol.skript.doc.Example; | ||
| import ch.njol.skript.doc.Name; | ||
| import ch.njol.skript.doc.Since; | ||
| import ch.njol.skript.lang.Effect; | ||
| import ch.njol.skript.lang.Expression; | ||
| import ch.njol.skript.lang.SkriptParser.ParseResult; | ||
| import ch.njol.skript.lang.SyntaxStringBuilder; | ||
| import ch.njol.util.Kleenean; | ||
| import org.bukkit.entity.LivingEntity; | ||
| import org.bukkit.event.Event; | ||
| import org.jetbrains.annotations.Nullable; | ||
| import org.skriptlang.skript.registration.SyntaxInfo; | ||
| import org.skriptlang.skript.registration.SyntaxRegistry; | ||
|
|
||
| @Name("Make Entity Glide") | ||
| @Description(""" | ||
| Makes an entity start/stop gliding. | ||
|
AnOwlBe marked this conversation as resolved.
Outdated
|
||
| """) | ||
| @Example("make last spawned zombie start gliding") | ||
| @Since("INSERT VERSION") | ||
| public class EffGlide extends Effect { | ||
|
|
||
| public static void register(SyntaxRegistry registry) { | ||
| registry.register( | ||
| SyntaxRegistry.EFFECT, | ||
| SyntaxInfo.builder(EffGlide.class) | ||
| .addPatterns( | ||
| "make %livingentities% ((start|begin) gliding|glide)", | ||
| "make %livingentities% (stop[ ]gliding|no longer glide)" | ||
|
AnOwlBe marked this conversation as resolved.
Outdated
|
||
| ) | ||
| .supplier(EffGlide::new) | ||
| .build() | ||
| ); | ||
| } | ||
|
|
||
| private Expression<LivingEntity> entities; | ||
| private boolean negated; | ||
|
|
||
| @Override | ||
| public boolean init(Expression<?>[] expressions, int matchedPattern, Kleenean isDelayed, ParseResult parseResult) { | ||
| entities = (Expression<LivingEntity>) expressions[0]; | ||
| negated = matchedPattern == 1; | ||
| return true; | ||
| } | ||
|
|
||
| @Override | ||
| protected void execute(Event event) { | ||
| for (LivingEntity entity : entities.getArray(event)) { | ||
| entity.setGliding(!negated); | ||
| } | ||
| } | ||
|
|
||
| @Override | ||
| public String toString(@Nullable Event event, boolean debug) { | ||
| return new SyntaxStringBuilder(event, debug) | ||
| .append("make", entities) | ||
| .appendIf(negated, "false") | ||
|
AnOwlBe marked this conversation as resolved.
Outdated
|
||
| .append("glide") | ||
| .toString(); | ||
| } | ||
|
|
||
| } | ||
|
AnOwlBe marked this conversation as resolved.
|
||
|
|
||
|
AnOwlBe marked this conversation as resolved.
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.