Class PlayerPlaceObjectEvent
java.lang.Object
net.risingworld.api.events.Event
net.risingworld.api.events.player.PlayerEvent
net.risingworld.api.events.player.world.PlayerObjectEvent
net.risingworld.api.events.player.world.PlayerPlaceObjectEvent
- All Implemented Interfaces:
Cancellable
Called when a player places an objects (furniture, doors, lamps, chests etc).
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
getColor()
long
Gets the info ID of the object.Gets the world position of the object as a Vector3f.Gets the rotation of the object as a Quaternion.getScale()
Gets the scale factor of the object along the x, y and z axis.byte
Gets the current status of the object.void
setColor
(int rgba) void
setPosition
(float x, float y, float z) Changes the object world position.void
setPosition
(Vector3f position) Changes the object world position.void
setRotation
(Quaternion rotation) Changes the object rotation.Methods inherited from class net.risingworld.api.events.player.world.PlayerObjectEvent
getChunkPositionX, getChunkPositionY, getChunkPositionZ, getGlobalID, getObject, getObjectDefinition, getTypeID, isCancelled, setCancelled
Methods inherited from class net.risingworld.api.events.player.PlayerEvent
getPlayer
-
Method Details
-
getPosition
Gets the world position of the object as a Vector3f.- Returns:
- the global object position as a Vector3f.
-
getRotation
Gets the rotation of the object as a Quaternion.- Returns:
- the object rotation as a Quaternion.
-
getScale
Gets the scale factor of the object along the x, y and z axis. By default, it's 1 1 1.- Returns:
- the object scale factor, as a Vector3f.
-
getColor
public int getColor() -
getStatus
public byte getStatus()Gets the current status of the object. The status is only used by some objects, e.g. doors (usually status 0 == closed, status 1 == opened), chests (status only represents the visual state, like doors), furnaces etc.- Returns:
- the object status.
-
getInfoID
public long getInfoID()Gets the info ID of the object. For regular objects, the info ID is usually -1 (so it's unused), only objects which hold additional information have an info ID (e.g for a chest, the info ID is the global chest ID, for furnaces, it is the global furnace ID etc).- Returns:
- the object info ID.
-
setColor
public void setColor(int rgba) -
setPosition
Changes the object world position.- Parameters:
position
- the new object world position.
-
setPosition
public void setPosition(float x, float y, float z) Changes the object world position.- Parameters:
x
- the new object world x position.y
- the new object world y position.z
- the new object world z position.
-
setRotation
Changes the object rotation.- Parameters:
rotation
- the new object rotation. Set to null to reset the rotation (Quaternion.IDENTITY).
-