-
-
Notifications
You must be signed in to change notification settings - Fork 26
Description
Add a new structure to register a converter of one object to another object,
Example:
register converter:
from: %classinfo%
to: %classinfo%
trigger:
#code here This allows for certain objects grabbed through reflect to be used in either Skript/addons elements or even custom elements.
In combination with this can add an EffConvert that converts the object(s) in a variable to the provided type.
convert %~objects% [in ]to %*classinfo%
Example: (Simple, as I can't think of anything advanced)
set {_var} to block at location(0,0,0)
convert {_var} to a location
{_var}.setDirection()This allows users to be able to take an object, convert it to a different type, and use whatever reflect elements they need
Finally, add an expression to get all converters (classinfos) for an object + classinfos, either registered through Skript/addons or custom converters.
[all [of the]|the] converter types (of|for) %objects%
Example:
set {_types::*} to the converter types for a block
# Output
- ItemType
- Location
- Inventory
- InventoryHolder
This allows users to be able to debug objects, seeing what all an object can be converted to.