Skip to content

Custom Converters + Converter Syntax #137

@Absolutionism

Description

@Absolutionism

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions