Package net.risingworld.api.events.world
Class FireworkEvent
java.lang.Object
net.risingworld.api.events.Event
net.risingworld.api.events.world.FireworkEvent
- All Implemented Interfaces:
Cancellable
Called when a firework is triggered (e.g caused by a firework rocket).
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionfloatSets a color intensity factor (start and end color will be multiplied with this factor).Gets the end color of the firework.Gets the global world position of the firework.Gets the related item which caused this firework (e.g firework rocket).Gets the player who is responsible for this firework.getSize()Gets the size of the firework.Gets the start color of the firework.booleanDetermines if the event is cancelled.voidsetCancelled(boolean cancel) Cancels this event.voidsetColorIntensity(float intensity) Changes the color intensity factor (start and end color will be multiplied with this factor).voidsetEndColor(float r, float g, float b, float a) Changes the end color of the firework.voidsetEndColor(ColorRGBA color) Changes the end color of the firework.voidsetPosition(float x, float y, float z) Changes the global world position of the firework.voidsetPosition(Vector3f position) Changes the global world position of the firework.voidsetSize(float size) Sets the size of the firework.voidsetSize(float x, float y, float z) Sets the size of the firework.voidSets the size of the firework.voidsetStartColor(float r, float g, float b, float a) Changes the start color of the firework.voidsetStartColor(ColorRGBA color) Changes the start color of the firework.
-
Method Details
-
getPosition
Gets the global world position of the firework.- Returns:
- the global position, as a Vector3f.
-
setPosition
Changes the global world position of the firework.- Parameters:
position- the new position.
-
setPosition
public void setPosition(float x, float y, float z) Changes the global world position of the firework.- Parameters:
x- the new x position.y- the new y position.z- the new z position.
-
getSize
Gets the size of the firework.- Returns:
- the size, as a Vector3f.
-
setSize
Sets the size of the firework.- Parameters:
size- the new firework size.
-
setSize
public void setSize(float size) Sets the size of the firework.- Parameters:
size- the size along all axes.
-
setSize
public void setSize(float x, float y, float z) Sets the size of the firework.- Parameters:
x- the size along x axis.y- the size along y axis.z- the size along z axis.
-
getStartColor
Gets the start color of the firework.- Returns:
- the firework start color.
-
setStartColor
Changes the start color of the firework.- Parameters:
color- the new color.
-
setStartColor
public void setStartColor(float r, float g, float b, float a) Changes the start color of the firework.- Parameters:
r- the red component of the new color.g- the green component of the new color.b- the blue component of the new color.a- the alpha (transparency) component of the new color.
-
getEndColor
Gets the end color of the firework.- Returns:
- the firework end color.
-
setEndColor
Changes the end color of the firework.- Parameters:
color- the new color.
-
setEndColor
public void setEndColor(float r, float g, float b, float a) Changes the end color of the firework.- Parameters:
r- the red component of the new color.g- the green component of the new color.b- the blue component of the new color.a- the alpha (transparency) component of the new color.
-
getColorIntensity
public float getColorIntensity()Sets a color intensity factor (start and end color will be multiplied with this factor).- Returns:
- the color intensity factor.
-
setColorIntensity
public void setColorIntensity(float intensity) Changes the color intensity factor (start and end color will be multiplied with this factor).- Parameters:
intensity- the new intensity for the color.
-
getRelatedItem
Gets the related item which caused this firework (e.g firework rocket). If this firework wasn't caused by an item, this function returns null.- Returns:
- the item which caused this firework, or null if there is no related item.
-
getRelatedPlayer
Gets the player who is responsible for this firework. Returns null if this firework is not triggered by a player.- Returns:
- the player who triggered this firework, or null if this firework wasn't caused by a player.
-
isCancelled
public boolean isCancelled()Description copied from interface:CancellableDetermines if the event is cancelled. If an event is cancelled, it will no longer be executed, but other plugins will still receive the event.
Please note: If the event is threaded, cancellation has no effect, i.e the event will still be executed.- Specified by:
isCancelledin interfaceCancellable- Returns:
- true if the event is cancelled, or false if not.
-
setCancelled
public void setCancelled(boolean cancel) Description copied from interface:CancellableCancels this event. This means it will no longer be executed, but other plugins will still receive the event.- Specified by:
setCancelledin interfaceCancellable- Parameters:
cancel- set to true if you want to cancel this event.- Example: Cancel "PlayerEnterAreaEvent", i.e prevent player from entering an area
-