13
0
geforkt von Mirrors/Paper

Added the concept of an Explosive.

By: sunkid <sunkid@iminurnetz.com>
Dieser Commit ist enthalten in:
Bukkit/Spigot 2011-06-14 10:55:47 -07:00
Ursprung 05163fbadc
Commit 8e7ef46f6f
4 geänderte Dateien mit 49 neuen und 10 gelöschten Zeilen

Datei anzeigen

@ -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();
}

Datei anzeigen

@ -2,7 +2,5 @@ package org.bukkit.entity;
/**
* Represents a Fireball.
*
* @author Cogito
*/
public interface Fireball extends Entity {}
public interface Fireball extends Explosive {}

Datei anzeigen

@ -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();
}

Datei anzeigen

@ -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;
}