Skip to content

Commit b14aabe

Browse files
authored
Implement missing method isFire in AbstractDamageSource (#2451)
1 parent 7e6c50f commit b14aabe

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

src/main/java/org/spongepowered/api/event/cause/entity/damage/source/common/AbstractDamageSource.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public abstract class AbstractDamageSource implements DamageSource {
4646
private final boolean explosive;
4747
private final boolean magic;
4848
private final boolean creative;
49+
private final boolean fire;
4950
private final double exhaustion;
5051

5152
protected AbstractDamageSource(AbstractDamageSourceBuilder<?, ?> builder) {
@@ -56,6 +57,7 @@ protected AbstractDamageSource(AbstractDamageSourceBuilder<?, ?> builder) {
5657
this.explosive = builder.explosion;
5758
this.magic = builder.magical;
5859
this.creative = builder.creative;
60+
this.fire = builder.fire;
5961
if (builder.exhaustion != null) {
6062
this.exhaustion = builder.exhaustion;
6163
} else if (this.absolute || this.bypassesArmor) {
@@ -100,6 +102,11 @@ public boolean doesAffectCreative() {
100102
return this.creative;
101103
}
102104

105+
@Override
106+
public boolean isFire() {
107+
return this.fire;
108+
}
109+
103110
@Override
104111
public double exhaustion() {
105112
return this.exhaustion;

src/main/java/org/spongepowered/api/event/cause/entity/damage/source/common/AbstractDamageSourceBuilder.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ public B from(final T value) {
107107
this.explosion = value.isExplosive();
108108
this.creative = value.doesAffectCreative();
109109
this.magical = value.isMagic();
110+
this.fire = value.isFire();
110111
this.exhaustion = value.exhaustion();
111112
this.damageType = value.type();
112113
return (B) this;
@@ -120,6 +121,7 @@ public B reset() {
120121
this.absolute = false;
121122
this.magical = false;
122123
this.creative = false;
124+
this.fire = false;
123125
this.exhaustion = null;
124126
this.damageType = null;
125127
return (B) this;

src/main/java/org/spongepowered/api/event/cause/entity/damage/source/common/AbstractEntityDamageSource.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public abstract class AbstractEntityDamageSource implements EntityDamageSource {
3939
private final boolean explosive;
4040
private final boolean magic;
4141
private final boolean creative;
42+
private final boolean fire;
4243
private final double exhaustion;
4344
private final Entity source;
4445

@@ -50,6 +51,7 @@ protected AbstractEntityDamageSource(AbstractEntityDamageSourceBuilder<?, ?> bui
5051
this.explosive = builder.explosion;
5152
this.magic = builder.magical;
5253
this.creative = builder.creative;
54+
this.fire = builder.fire;
5355
if (builder.exhaustion != null) {
5456
this.exhaustion = builder.exhaustion;
5557
} else if (this.absolute || this.bypassesArmor) {
@@ -100,6 +102,11 @@ public boolean doesAffectCreative() {
100102
return this.creative;
101103
}
102104

105+
@Override
106+
public boolean isFire() {
107+
return this.fire;
108+
}
109+
103110
@Override
104111
public double exhaustion() {
105112
return this.exhaustion;

src/main/java/org/spongepowered/api/event/cause/entity/damage/source/common/AbstractIndirectEntityDamageSource.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public abstract class AbstractIndirectEntityDamageSource implements IndirectEnti
3939
private final boolean explosive;
4040
private final boolean magic;
4141
private final boolean creative;
42+
private final boolean fire;
4243
private final double exhaustion;
4344
private final Entity source;
4445
private final Entity indirect;
@@ -51,6 +52,7 @@ protected AbstractIndirectEntityDamageSource(AbstractIndirectEntityDamageSourceB
5152
this.explosive = builder.explosion;
5253
this.magic = builder.magical;
5354
this.creative = builder.creative;
55+
this.fire = builder.fire;
5456
if (builder.exhaustion != null) {
5557
this.exhaustion = builder.exhaustion;
5658
} else if (this.absolute || this.bypassesArmor) {
@@ -102,6 +104,11 @@ public boolean doesAffectCreative() {
102104
return this.creative;
103105
}
104106

107+
@Override
108+
public boolean isFire() {
109+
return this.fire;
110+
}
111+
105112
@Override
106113
public Entity indirectSource() {
107114
return this.indirect;

0 commit comments

Comments
 (0)