Klasse PlayerPlaceBlueprintEvent
java.lang.Object
net.risingworld.api.events.Event
net.risingworld.api.events.player.PlayerEvent
net.risingworld.api.events.player.world.PlayerPlaceBlueprintEvent
- Alle implementierten Schnittstellen:
Cancellable
Called when a player wants to place a blueprint, i.e a blueprint which was
already created previously.
-
Feldübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibunglong
Gets the ID of the blueprint.Gets the bounds of the blueprint object.int
Gets the amount of construction elements (blocks) this blueprint contains.float
Gets the max radius of the affected area.int
Gets the amount of objects (i.e furniture, doors, lamps etc) this blueprint contains.int
int
Gets the amount of plants (vegetation) this blueprint contains.Gets the world position of the blueprint center (i.e where the blueprint will be placed).Gets the world rotation of the blueprint.getScale()
Gets the scale factor of the blueprint.boolean
Determines if the event is cancelled.void
setCancelled
(boolean cancel) Cancels this event.void
setPosition
(float x, float y, float z) Changes the world position for the blueprint (i.e the position where the blueprint will be placed).void
setPosition
(Vector3f position) Changes the world position for the blueprint (i.e the position where the blueprint will be placed).void
setRotation
(Quaternion rotation) Changes the rotation of the blueprint.void
Changes the scale factor of the blueprint.Von Klasse geerbte Methoden net.risingworld.api.events.player.PlayerEvent
getPlayer
-
Methodendetails
-
getBlueprintID
public long getBlueprintID()Gets the ID of the blueprint.- Gibt zurück:
- the blueprint ID.
-
getPlaceID
public int getPlaceID() -
getPosition
Gets the world position of the blueprint center (i.e where the blueprint will be placed). This is the same as callinggetBounds().getCenter()
- Gibt zurück:
- the blueprint world position.
-
setPosition
Changes the world position for the blueprint (i.e the position where the blueprint will be placed).- Parameter:
position
- the new target world position.
-
setPosition
public void setPosition(float x, float y, float z) Changes the world position for the blueprint (i.e the position where the blueprint will be placed).- Parameter:
x
- the new target world x position.y
- the new target world y position.z
- the new target world z position.
-
getRotation
Gets the world rotation of the blueprint.- Gibt zurück:
- the blueprint rotation.
-
setRotation
Changes the rotation of the blueprint.- Parameter:
rotation
- the new rotation.
-
getScale
Gets the scale factor of the blueprint. By default it's 1 1 1- Gibt zurück:
- the blueprint scale factor.
-
setScale
Changes the scale factor of the blueprint.- Parameter:
scale
- the new scale factor for the blueprint.
-
getBounds
Gets the bounds of the blueprint object.- Gibt zurück:
- the bounds.
- Example: Get the min position and max position of the blueprint
-
getMaxExtent
public float getMaxExtent()Gets the max radius of the affected area. This function simply compares the half extents of the bounds and returns the greatest result.- Gibt zurück:
- the max radius of the affected area.
-
getConstructionCount
public int getConstructionCount()Gets the amount of construction elements (blocks) this blueprint contains.- Gibt zurück:
- the amount of construction elements.
-
getObjectCount
public int getObjectCount()Gets the amount of objects (i.e furniture, doors, lamps etc) this blueprint contains.- Gibt zurück:
- the amount of objects.
-
getPlantCount
public int getPlantCount()Gets the amount of plants (vegetation) this blueprint contains.- Gibt zurück:
- the amount of plants.
-
isCancelled
public boolean isCancelled()Beschreibung aus Schnittstelle kopiert:Cancellable
Determines 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.- Angegeben von:
isCancelled
in SchnittstelleCancellable
- Gibt zurück:
- true if the event is cancelled, or false if not.
-
setCancelled
public void setCancelled(boolean cancel) Beschreibung aus Schnittstelle kopiert:Cancellable
Cancels this event. This means it will no longer be executed, but other plugins will still receive the event.- Angegeben von:
setCancelled
in SchnittstelleCancellable
- Parameter:
cancel
- set to true if you want to cancel this event.- Example: Cancel "PlayerEnterAreaEvent", i.e prevent player from entering an area
-