Class PlayerPlaceVegetationEvent
java.lang.Object
net.risingworld.api.events.Event
net.risingworld.api.events.player.PlayerEvent
net.risingworld.api.events.player.world.PlayerVegetationEvent
net.risingworld.api.events.player.world.PlayerPlaceVegetationEvent
- All Implemented Interfaces:
Cancellable
- Direct Known Subclasses:
PlayerCreativePlaceVegetationEvent
Called when the player places a plant (saplings, seedlings etc).
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Gets the growth time for this plant in seconds.boolean
Gets whether or not this plant can grow.void
setGrowthTime
(int growthTime) Sets the growth time (in seconds) for this plant.void
setPosition
(float x, float y, float z) Changes the plant position.void
setPosition
(Vector3f position) Changes the plant position.void
setRotation
(float pitch, float yaw, float roll) Changes the plant rotation.void
setRotation
(Quaternion rotation) Changes the plant rotation.void
setTypeID
(short typeID) Sets the type ID of the plant.Methods inherited from class net.risingworld.api.events.player.world.PlayerVegetationEvent
getChunkPositionX, getChunkPositionY, getChunkPositionZ, getGlobalID, getPlant, getPlantDefinition, getTypeID, isCancelled, setCancelled
Methods inherited from class net.risingworld.api.events.player.PlayerEvent
getPlayer
-
Constructor Details
-
PlayerPlaceVegetationEvent
protected PlayerPlaceVegetationEvent(long pointer)
-
-
Method Details
-
setTypeID
public void setTypeID(short typeID) Sets the type ID of the plant.- Parameters:
typeID
- the new plant type ID.
-
setPosition
Changes the plant position.- Parameters:
position
- the new plant world position.
-
setPosition
public void setPosition(float x, float y, float z) Changes the plant position.- Parameters:
x
- the new plant world x position.y
- the new plant world y position.z
- the new plant world z position.
-
setRotation
Changes the plant rotation.- Parameters:
rotation
- the new plant rotation. Set to null to reset the rotation (Quaternion.IDENTITY).
-
setRotation
public void setRotation(float pitch, float yaw, float roll) Changes the plant rotation.- 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).
-
isGrowable
public boolean isGrowable()Gets whether or not this plant can grow.- Returns:
- true if this plant can grow (e.g saplings, seedlings etc), false if not.
-
getGrowthTime
public int getGrowthTime()Gets the growth time for this plant in seconds. The growth time determines how long it takes until this plant grows (reaching the next growth stage). Returns 0 if this plant cannot grow.- Returns:
- the growth time, in seconds.
-
setGrowthTime
public void setGrowthTime(int growthTime) Sets the growth time (in seconds) for this plant. Only works for plants which are growable (seeisGrowable()
).- Parameters:
growthTime
- the new growth duration in seconds.
-