Class PlayerPlaceConstructionEvent
java.lang.Object
net.risingworld.api.events.Event
net.risingworld.api.events.player.PlayerEvent
net.risingworld.api.events.player.world.PlayerConstructionEvent
net.risingworld.api.events.player.world.PlayerPlaceConstructionEvent
- All Implemented Interfaces:
Cancellable
Called when a player places a construction element.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Gets the amount of additional elements the player wants to place in a row (multi-placement) along the x axis.int
Gets the amount of additional elements the player wants to place in a row (multi-placement) along the y axis.int
Gets the amount of additional elements the player wants to place in a row (multi-placement) along the z axis.void
setColor
(int color) void
setPosition
(float x, float y, float z) Changes the world position of the construction element.void
setPosition
(Vector3f position) Changes the world position of the construction element.void
setRotation
(float pitch, float yaw, float roll) Changes the rotation of the construction element.void
setRotation
(Quaternion rotation) Changes the rotation of the construction element.void
setSize
(float x, float y, float z) Changes the size of the construction element.void
Changes the size of the construction element.void
setTextureID
(int texture) Sets the texture of the construction element.void
setTypeID
(byte id) Sets the type ID of the construction element.Methods inherited from class net.risingworld.api.events.player.world.PlayerConstructionEvent
getChunkPositionX, getChunkPositionY, getChunkPositionZ, getConstructionDefinition, getGlobalID, getTexture, getTypeID, isCancelled, setCancelled
Methods inherited from class net.risingworld.api.events.player.PlayerEvent
getPlayer
-
Method Details
-
setTypeID
public void setTypeID(byte id) Sets the type ID of the construction element.- Parameters:
id
- the new type ID.
-
setTextureID
public void setTextureID(int texture) Sets the texture of the construction element.- Parameters:
texture
- the new texture ID. If this is a "poster" construction element, the texture ID is the custom image ID.
-
setPosition
Changes the world position of the construction element.- Parameters:
position
- the new world position of the construction element.
-
setPosition
public void setPosition(float x, float y, float z) Changes the world position of the construction element.- Parameters:
x
- the new world x position of the construction element.y
- the new world y position of the construction element.z
- the new world z position of the construction element.
-
setRotation
Changes the rotation of the construction element.- Parameters:
rotation
- the new construction element rotation. Set to null to reset the rotation (Quaternion.IDENTITY).
-
setRotation
public void setRotation(float pitch, float yaw, float roll) Changes the rotation of the construction element.- Parameters:
pitch
- the new x angle, as euler rotation (pitch).yaw
- the new y angle, as euler rotation (yaw).roll
- the new z angle, as euler rotation (roll).
-
setSize
Changes the size of the construction element.- Parameters:
size
- the new size (x, y, z, as a Vector3f) of the construction element.
-
setSize
public void setSize(float x, float y, float z) Changes the size of the construction element.- Parameters:
x
- the new size of the construction element along the x axis.y
- the new size of the construction element along the y axis.z
- the new size of the construction element along the z axis.
-
setColor
public void setColor(int color) -
getMultiPlaceRowX
public int getMultiPlaceRowX()Gets the amount of additional elements the player wants to place in a row (multi-placement) along the x axis. By default this is 0.- Returns:
- the amount of elements the player wants to place in a row along x.
-
getMultiPlaceRowY
public int getMultiPlaceRowY()Gets the amount of additional elements the player wants to place in a row (multi-placement) along the y axis. By default this is 0.- Returns:
- the amount of elements the player wants to place in a row along y.
-
getMultiPlaceRowZ
public int getMultiPlaceRowZ()Gets the amount of additional elements the player wants to place in a row (multi-placement) along the z axis. By default this is 0.- Returns:
- the amount of elements the player wants to place in a row along z.
-