public class SpawnSign
extends java.lang.Object
Constructor and Description |
---|
SpawnSign(com.bergerkiller.bukkit.common.BlockLocation location) |
Modifier and Type | Method and Description |
---|---|
long |
getInterval()
Gets the interval to spawn at, measured in milliseconds.
|
com.bergerkiller.bukkit.common.BlockLocation |
getLocation()
Gets the location of the spawn sign
|
long |
getNextSpawnTime()
Gets the timestamp ( currentTimeMillis() ) for when the next spawn occurs.
|
long |
getRemaining(long currentTime)
Gets the duration in milliseconds until this spawn sign should spawn next.
|
SpawnableGroup |
getSpawnableGroup()
Gets the spawnable group that is spawned by this spawn sign
|
double |
getSpawnForce()
Gets the speed at which the train is launched after spawning
|
static double |
getSpawnForce(SignActionEvent event) |
static long |
getSpawnTime(SignActionEvent event) |
org.bukkit.World |
getWorld()
Gets the (cached) world information of the sign
|
boolean |
hasInterval()
Gets whether this spawn sign periodically spawns
|
boolean |
isActive()
Checks whether this spawn sign is powered by redstone / active
|
boolean |
isNearChunk(int x,
int z)
Checks whether this spawn sign is nearby a particular chunk
|
static boolean |
isValid(SignActionEvent event) |
void |
load(SignActionEvent signEvent)
Loads spawn sign information by parsing the information stored on a spawn sign
|
void |
loadChunksAsync(double percent)
Queues additional chunks for loading asynchronously in preparation for a spawn
|
void |
loadChunksAsyncReset()
Called after the spawn sign goes back to a longer-term slumber
|
void |
nextSpawnTime()
Resets the spawn timer right after an interval spawn was performed
|
static SpawnSign |
read(java.io.DataInputStream stream) |
void |
remove()
Removes this spawn sign from the spawn sign manager
|
void |
resetSpawnTime()
Resets the spawn timer, causing this sign to spawn when the interval elapses.
|
void |
spawn()
Attempts to spawn a train from this sign right this instant
|
void |
spawn(SignActionEvent sign)
Attempts to spawn a train from this sign, using the sign action information, right this instant
|
java.lang.String |
toString() |
void |
write(java.io.DataOutputStream stream) |
public SpawnSign(com.bergerkiller.bukkit.common.BlockLocation location)
public void load(SignActionEvent signEvent)
signEvent
- of the spawn sign to parsepublic com.bergerkiller.bukkit.common.BlockLocation getLocation()
public boolean hasInterval()
public long getInterval()
public long getRemaining(long currentTime)
currentTime
- from which to measure remaining timepublic long getNextSpawnTime()
public boolean isActive()
public double getSpawnForce()
public SpawnableGroup getSpawnableGroup()
public void resetSpawnTime()
public void nextSpawnTime()
public org.bukkit.World getWorld()
public void loadChunksAsync(double percent)
percent
- of chunks that should be loadedpublic void loadChunksAsyncReset()
public boolean isNearChunk(int x, int z)
x
- - coordinate of the chunk to probez
- - coordinate of the chunk to probepublic void remove()
public void spawn()
public void spawn(SignActionEvent sign)
sign
- event infopublic java.lang.String toString()
toString
in class java.lang.Object
public void write(java.io.DataOutputStream stream) throws java.io.IOException
java.io.IOException
public static SpawnSign read(java.io.DataInputStream stream) throws java.io.IOException
java.io.IOException
public static double getSpawnForce(SignActionEvent event)
public static long getSpawnTime(SignActionEvent event)
public static boolean isValid(SignActionEvent event)