Package net.risingworld.api.events.world
Klasse ItemTransformEvent
java.lang.Object
net.risingworld.api.events.Event
net.risingworld.api.events.world.ItemTransformEvent
- Alle implementierten Schnittstellen:
Cancellable
Called when a world item transforms, i.e when the item id changes. Usually this happens
when cooking food or smelting ores (so this event is triggered when the item changes
its state from raw to cooked, or if the ore is smelted into an ingot etc)
Example: If ore gets crushed by grinder, randomly turn it into a gold ingot Example: Notify furnace owner when ore is smelted
-
Verschachtelte Klassen - Übersicht
Modifizierer und TypKlasseBeschreibungstatic enum
Determines why theItemTransformEvent
was triggered exactly (i.e what caused the item to transform). -
Feldübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibunggetItem()
Gets the world item that's about to transform.Gets the meta object that was involved in this process, i.e the object that processed the items.int
Gets the new stack size of the item.short
Gets the new target item type ID.long
Gets the unique global ID of the meta object which processsed this item (e.g the furnace ID).Gets the definition of the related meta object (which processes this item, e.g the furnace, grinder etc).short
Gets the type ID of the meta object.Gets the processing type (related to the meta object processing this item), i.e how the item was processed.Gets the trigger of the item transformation, i.e what caused the item to transform.boolean
Determines if the event is cancelled.void
setCancelled
(boolean cancel) Cancels this event.void
setNewStack
(int newStack) Overrides the stack size of the item.void
setNewTypeID
(short newTypeID) Overrides the target item type ID.
-
Methodendetails
-
getItem
Gets the world item that's about to transform.- Gibt zurück:
- the world item that's about to transform.
-
getNewTypeID
public short getNewTypeID()Gets the new target item type ID. This means this item will transform to this item (e.g ifgetItem()
returns a raw steak,getNewTypeID()
would usually return the type ID of a cooked steak etc).- Gibt zurück:
- the new type ID.
-
getNewStack
public int getNewStack()Gets the new stack size of the item.- Gibt zurück:
- the new stack size (amount of items).
-
setNewTypeID
public void setNewTypeID(short newTypeID) Overrides the target item type ID.- Parameter:
newTypeID
- the new type ID.
-
setNewStack
public void setNewStack(int newStack) Overrides the stack size of the item.- Parameter:
newStack
- the new stack size (amount of items).
-
getObjectID
public long getObjectID()Gets the unique global ID of the meta object which processsed this item (e.g the furnace ID). Returns -1 if the transform wasn't triggered by a meta object (furnace, grinder etc).- Gibt zurück:
- the meta object ID.
-
getObjectTypeID
public short getObjectTypeID()Gets the type ID of the meta object.- Gibt zurück:
- the meta object type ID.
-
getTrigger
Gets the trigger of the item transformation, i.e what caused the item to transform.- Gibt zurück:
- the trigger of the item transformation.
-
getMetaObject
Gets the meta object that was involved in this process, i.e the object that processed the items. For example, this is a furnace which smelted ores, or a grinder which crushed items etc. Only ifgetTrigger()
isTrigger.MetaObject
, else null is returned.- Gibt zurück:
- the object that was involved in this event (e.g furnace, grinder, grill etc), or null if no object was involved.
-
getObjectInfoDefinition
Gets the definition of the related meta object (which processes this item, e.g the furnace, grinder etc). It provides more information about how this item was processed and about the meta object.- Gibt zurück:
- the related meta object definition.
-
getProcessingType
Gets the processing type (related to the meta object processing this item), i.e how the item was processed. If the item was not processed by an object, null is returned.- Gibt zurück:
- the processing type (resulting into the item transformation), or null if the item transform was not related to an object.
-
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
-