geforkt von Mirrors/Paper
Added the concept of an Explosive.
By: sunkid <sunkid@iminurnetz.com>
Dieser Commit ist enthalten in:
Ursprung
05163fbadc
Commit
8e7ef46f6f
30
paper-api/src/main/java/org/bukkit/entity/Explosive.java
Normale Datei
30
paper-api/src/main/java/org/bukkit/entity/Explosive.java
Normale Datei
@ -0,0 +1,30 @@
|
||||
package org.bukkit.entity;
|
||||
|
||||
/**
|
||||
* A representation of an explosive entity
|
||||
*/
|
||||
public interface Explosive extends Entity {
|
||||
/**
|
||||
* Set the radius affected by this explosive's explosion
|
||||
* @param yield
|
||||
*/
|
||||
public void setYield(float yield);
|
||||
|
||||
/**
|
||||
* Return the radius or yield of this explosive's explosion
|
||||
* @return the radius of blocks affected
|
||||
*/
|
||||
public float getYield();
|
||||
|
||||
/**
|
||||
* Set whether or not this explosive's explosion causes fire
|
||||
* @param isIncendiary
|
||||
*/
|
||||
public void setIsIncendiary(boolean isIncendiary);
|
||||
|
||||
/**
|
||||
* Return whether or not this explosive creates a fire when exploding
|
||||
* @return true if the explosive creates fire, false otherwise
|
||||
*/
|
||||
public boolean isIncendiary();
|
||||
}
|
@ -2,7 +2,5 @@ package org.bukkit.entity;
|
||||
|
||||
/**
|
||||
* Represents a Fireball.
|
||||
*
|
||||
* @author Cogito
|
||||
*/
|
||||
public interface Fireball extends Entity {}
|
||||
public interface Fireball extends Explosive {}
|
||||
|
@ -1,12 +1,18 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package org.bukkit.entity;
|
||||
|
||||
/**
|
||||
* Represents a Primed TNT.
|
||||
*
|
||||
* @author Cogito
|
||||
*
|
||||
*/
|
||||
public interface TNTPrimed extends Entity {}
|
||||
public interface TNTPrimed extends Explosive {
|
||||
/**
|
||||
* Set the number of ticks until the TNT blows up after being primed.
|
||||
* @param fuseTicks
|
||||
*/
|
||||
public void setFuseTicks(int fuseTicks);
|
||||
|
||||
/**
|
||||
* Retrieve the number of ticks until the explosion of this TNTPrimed entity
|
||||
* @return the number of ticks until this TNTPrimed explodes
|
||||
*/
|
||||
public int getFuseTicks();
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package org.bukkit.event.entity;
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Explosive;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
public class ExplosionPrimeEvent extends EntityEvent implements Cancellable {
|
||||
@ -15,6 +16,10 @@ public class ExplosionPrimeEvent extends EntityEvent implements Cancellable {
|
||||
this.fire = fire;
|
||||
}
|
||||
|
||||
public ExplosionPrimeEvent(Explosive explosive) {
|
||||
this(explosive, explosive.getYield(), explosive.isIncendiary());
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren