Added the concept of an Explosive.
This commit is contained in:
parent
79815f7d9a
commit
82475d3497
30
src/main/java/org/bukkit/entity/Explosive.java
Normal file
30
src/main/java/org/bukkit/entity/Explosive.java
Normal file
@ -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.
|
* Represents a Fireball.
|
||||||
*
|
|
||||||
* @author Cogito
|
|
||||||
*/
|
*/
|
||||||
public interface Fireball extends Entity {}
|
public interface Fireball extends Explosive {}
|
||||||
|
@ -1,12 +1,18 @@
|
|||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
package org.bukkit.entity;
|
package org.bukkit.entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a Primed TNT.
|
* 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;
|
package org.bukkit.event.entity;
|
||||||
|
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.Explosive;
|
||||||
import org.bukkit.event.Cancellable;
|
import org.bukkit.event.Cancellable;
|
||||||
|
|
||||||
public class ExplosionPrimeEvent extends EntityEvent implements Cancellable {
|
public class ExplosionPrimeEvent extends EntityEvent implements Cancellable {
|
||||||
@ -15,6 +16,10 @@ public class ExplosionPrimeEvent extends EntityEvent implements Cancellable {
|
|||||||
this.fire = fire;
|
this.fire = fire;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ExplosionPrimeEvent(Explosive explosive) {
|
||||||
|
this(explosive, explosive.getYield(), explosive.isIncendiary());
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isCancelled() {
|
public boolean isCancelled() {
|
||||||
return cancel;
|
return cancel;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user