-
-
Notifications
You must be signed in to change notification settings - Fork 394
Damage Source #7876
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?
Damage Source #7876
Conversation
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.
I'm still not a huge fan of having some sources be editable and some not
I'd like some others' opinions on the topic, whether it should be allowed as is or if sources should be only editable upon creation (say, within the exprsec). It would mean the wrapper class wouldn't be needed.
I'm in agreeance with sovde here, a damage source should only be modifiable via the exprsec as a means to limit ambiguity, unsure how it would allow removal of the wrapper, it's still needed I would assume unless we store custom information onto the event. |
You can just store a builder on the exprsection, yes |
We would still need the wrapper for a couple of reasons. I feel the wrapper should be kept, since |
The event-value thing could be easily done via just building the builder when necessary, but I see your point about future proofing given this api still seems very unfinished. |
src/main/java/org/skriptlang/skript/bukkit/damagesource/elements/ExprDamageLocation.java
Outdated
Show resolved
Hide resolved
btw, can you remove the |
src/main/java/org/skriptlang/skript/bukkit/damagesource/elements/ExprDamageLocation.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/damagesource/elements/ExprSecDamageSource.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/damagesource/elements/ExprDamageType.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/damagesource/DamageSourceWrapper.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/damagesource/MutableDamageSource.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/damagesource/elements/CondIsIndirect.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/damagesource/elements/EVECreatedDamageSource.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/damagesource/elements/ExprSecDamageSource.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/damagesource/elements/ExprDamageType.java
Show resolved
Hide resolved
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.
seems good
src/main/java/org/skriptlang/skript/bukkit/damagesource/elements/CondWasIndirect.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/damagesource/elements/CondWasIndirect.java
Outdated
Show resolved
Hide resolved
public class ExprDirectEntity extends SimplePropertyExpression<DamageSource, Entity> implements DamageSourceExperiment { | ||
|
||
static { | ||
registerDefault(ExprDirectEntity.class, Entity.class, "direct entity", "damagesources"); |
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.
i was thinking about the direct/indirect syntaxes and had a possible suggestion
Since direct entity of ...
doesn't really mean much on its own, what do you think about:
[in]direct (source|cause) of %damagesource%
I'm not sure about source of source or whatever, and maybe it'd be better to include the work 'entity'.
You can also combine this class and the indirect class
idk it might be better it might be worse, let me know what you think
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.
i think that could be good
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.
I would prefer to keep the 3 elements separated since DamageSource
is still experimental. Even if there was a high likelihood that the behavior wouldn't change.
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.
What do you think about the syntax change, though?
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.
I think this is looking really good so far. Here's what I found
src/main/java/org/skriptlang/skript/bukkit/damagesource/DamageSourceModule.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/damagesource/DamageSourceModule.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/damagesource/DamageSourceModule.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/damagesource/elements/CondScalesWithDifficulty.java
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/damagesource/elements/ExprSecDamageSource.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/damagesource/elements/ExprSecDamageSource.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/bukkit/damagesource/elements/ExprSecDamageSource.java
Outdated
Show resolved
Hide resolved
…urce # Conflicts: # src/main/java/ch/njol/skript/registrations/Feature.java
Problem
No current support for Damage Sources, including reading and checking data of damage sources, no previous event values for damage sources, and unable to create custom damage sources
Solution
New module for damage sources. Adds expressions and conditions to get/set/check the data of damage sources
Updates
EffHealth
to allow use of custom damage sourcesDamageSourceWrapper
for a continuous data setting of a custom damage source.Testing Completed
The newly created test file
Supporting Information
Had to add an ignore list in
ClassLoaderTest
because when loading theDamageSourceWrapper
on 1.19.4, was throwing an exception.Completes: none
Related: none