2424 */
2525package org .spongepowered .api .event .cause .entity .damage ;
2626
27- import org .spongepowered .api .Sponge ;
2827import org .spongepowered .api .entity .Entity ;
2928import org .spongepowered .api .event .cause .entity .damage .source .DamageSource ;
3029import org .spongepowered .api .registry .DefaultedRegistryValue ;
30+ import org .spongepowered .api .tag .Tag ;
3131import org .spongepowered .api .util .Nameable ;
3232import org .spongepowered .api .util .annotation .CatalogedBy ;
3333
3434/**
35- * A {@link DamageType} is a type of "grouping" for {@link DamageSource}s since
36- * a {@link DamageSource} instance can be inherently different from another
37- * {@link DamageSource} by virtue of the {@link Object} backing the source.
38- * Furthermore, it is impossible to refer to {@link DamageSource}s statically
39- * due to the nature of constructing them. It is possible however, that the
40- * parent {@link Object} being referred to as the "damage source" can damage
41- * an {@link Entity} with varying {@link DamageType}s depending on the
42- * circumstances.
35+ * A {@link DamageType} is a type of "grouping" for {@link DamageSource}s since a {@link DamageSource} instance can be inherently different from
36+ * another {@link DamageSource} by virtue of the {@link Object} backing the source. Furthermore, it is impossible to refer to {@link DamageSource}s
37+ * statically due to the nature of constructing them. It is possible however, that the parent {@link Object} being referred to as the "damage source"
38+ * can damage an {@link Entity} with varying {@link DamageType}s depending on the circumstances.
4339 */
4440@ CatalogedBy (DamageTypes .class )
4541public interface DamageType extends DefaultedRegistryValue , Nameable {
@@ -54,16 +50,37 @@ static Builder builder() {
5450 }
5551
5652 /**
57- * A builder to create {@link DamageType}s.
53+ * Gets the amount of exhaustion this {@link DamageType} will add to the entity, generally only to players.
54+ * <p>
55+ * TODO check this facts:
56+ * <p>In vanilla gameplay this is set to 0.1 by default and
57+ * overridden to 0 if the type is set to be absolute or
58+ * as overriding armor.</p>
59+ *
60+ * @return The increase in exhaustion
5861 */
59- interface Builder extends org .spongepowered .api .util .Builder <DamageType , Builder > {
62+ double exhaustion ();
63+
64+ /**
65+ * Checks whether this damage types matches a damage type tag.
66+ *
67+ * @param tag The tag to check.
68+ * @return true if this damage type matches the damage type tag.
69+ */
70+ boolean is (Tag <DamageType > tag );
71+
72+ /**
73+ * Returns the damage scaling.
74+ *
75+ * @return the damage scaling
76+ */
77+ DamageScaling scaling ();
78+
79+ /**
80+ * Returns the damage effect.
81+ *
82+ * @return the damage effect
83+ */
84+ DamageEffect effect ();
6085
61- /**
62- * Sets the name of the {@link DamageType}.
63- *
64- * @param name The name
65- * @return This builder, for chaining
66- */
67- Builder name (String name );
68- }
6986}
0 commit comments