Conversation
|
|
||
| // <--[event] | ||
| // @Events | ||
| // projectkorra player|entity dies|death|killed by <ability> |
There was a problem hiding this comment.
This is a really awkward event format -- maybe do projectkorra <entity> dies with switch by:<ability>
| // @Triggers when an entity dies from bending. | ||
| // | ||
| // @Context | ||
| // <context.ability> returns ElementTag(String) of the ability's name. |
There was a problem hiding this comment.
(String) is not a thing, and either way you don't need to specify types so heavily, just <context.ability> returns the ability's name.
| @Override | ||
| public boolean matches(ScriptPath path) { | ||
| String ability = path.eventArgLowerAt(4); | ||
| // Check if event applies to any ability |
There was a problem hiding this comment.
Don't need comments that just say what the next line is doing (unless there's something unclear that needs explanation)
| } | ||
|
|
||
| @EventHandler | ||
| public void onAbilityStart(EntityBendingDeathEvent event) { |
Removed types in @context Removed comments Fixed method name
|
Done |
|
|
||
| // <--[event] | ||
| // @Events | ||
| // projectkorra entity dies|death|killed |
There was a problem hiding this comment.
This should be <entity> ie dynamic match the entity
There was a problem hiding this comment.
also the three dies/death/killed variants are silly, pick one
|
|
||
| @Override | ||
| public boolean matches(ScriptPath path) { | ||
| if ((path.eventArgLowerAt(3).equals("by")) && (ability == null || !path.tryArgObject(4, ability))) { |
removed variants removed line 50 (and like from other events)
|
Done |
|
please don't touch the 'resolve' button |
|
Understood |
| // --> | ||
|
|
||
| public EntityBendingDeathScriptEvent() { | ||
| registerCouldMatcher("projectkorra entity killed"); |
There was a problem hiding this comment.
The meta projectkorra <entity> killed has an entity matcher, but the code doesn't seem to - need to have the same syntax in here, and check for the entity matcher in matches (ScriptPath#tryArgObject)
|
|
||
| @Override | ||
| public ScriptEntryData getScriptEntryData() { | ||
| return new BukkitScriptEntryData(PlayerTag.mirrorBukkitPlayer(event.getAbility().getPlayer()), null); |
There was a problem hiding this comment.
Can use the single-entity constructor, I.e. just pass in the player
|
What's the status here? There's been unaddressed comments waiting for two months now |
|
Apologies. I plan on working on them very soon. I have had a family member pass away and have been preoccupied with other emergencies. |
Take 3:
pull request #424
pull request #423
lib modifications & extra contributor removed.