-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: LivingEntity fire overhaul (#2122)
* feat: LivingEntity fire overhaul * chore: missed method change
- Loading branch information
Showing
7 changed files
with
240 additions
and
136 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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/net/minestom/server/event/entity/EntityFireEvent.java
This file was deleted.
Oops, something went wrong.
38 changes: 38 additions & 0 deletions
38
src/main/java/net/minestom/server/event/entity/EntityFireExtinguishEvent.java
This file contains 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,38 @@ | ||
package net.minestom.server.event.entity; | ||
|
||
import net.minestom.server.entity.Entity; | ||
import net.minestom.server.event.trait.CancellableEvent; | ||
import net.minestom.server.event.trait.EntityInstanceEvent; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class EntityFireExtinguishEvent implements EntityInstanceEvent, CancellableEvent { | ||
|
||
private final Entity entity; | ||
private boolean natural; | ||
|
||
private boolean cancelled; | ||
|
||
public EntityFireExtinguishEvent(Entity entity, boolean natural) { | ||
this.entity = entity; | ||
this.natural = natural; | ||
} | ||
|
||
public boolean isNatural() { | ||
return natural; | ||
} | ||
|
||
@Override | ||
public boolean isCancelled() { | ||
return cancelled; | ||
} | ||
|
||
@Override | ||
public void setCancelled(boolean cancel) { | ||
this.cancelled = cancel; | ||
} | ||
|
||
@Override | ||
public @NotNull Entity getEntity() { | ||
return entity; | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
src/main/java/net/minestom/server/event/entity/EntitySetFireEvent.java
This file contains 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,42 @@ | ||
package net.minestom.server.event.entity; | ||
|
||
import net.minestom.server.entity.Entity; | ||
import net.minestom.server.event.trait.CancellableEvent; | ||
import net.minestom.server.event.trait.EntityInstanceEvent; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class EntitySetFireEvent implements EntityInstanceEvent, CancellableEvent { | ||
|
||
private final Entity entity; | ||
private int ticks; | ||
|
||
private boolean cancelled; | ||
|
||
public EntitySetFireEvent(Entity entity, int ticks) { | ||
this.entity = entity; | ||
this.ticks = ticks; | ||
} | ||
|
||
public int getFireTicks() { | ||
return ticks; | ||
} | ||
|
||
public void setFireTicks(int ticks) { | ||
this.ticks = ticks; | ||
} | ||
|
||
@Override | ||
public boolean isCancelled() { | ||
return cancelled; | ||
} | ||
|
||
@Override | ||
public void setCancelled(boolean cancel) { | ||
this.cancelled = cancel; | ||
} | ||
|
||
@Override | ||
public @NotNull Entity getEntity() { | ||
return entity; | ||
} | ||
} |
Oops, something went wrong.