skript-parser
skript-parser copied to clipboard
Feature/type attributes
Adds a new registration system for types to easily register additional behavior for types, like ranges, default changers, arithmetic, and more. My goal primarily was to provide addon developers with a system to easily bundle attributes together.
Additionally:
- Reworked ExprDifference and removed its quirky conversion methods. I might add a better conversion system, but probably for the type attributes themselves rather than in the expression class.
- Reworked ExprRange.
- Refactored a lot of code, and improved the registration of PropertyConditionals and PropertyExpressions.
This pull request will be completed later with some other additions:
- [x] A conversion system to easily convert an object to a type with a specific attribute. I will see how I will implement it later.
- [ ] Container attribute for things that contain other things (except lists). Currently only strings contain other strings, but in the Bukkit implementation, inventories act as containers.
- [ ] ~~Comparable attribute, issuing the removal of the Comparator system and moving it to the attribute system.~~ After consideration, I decided that type attributes should only be for one type, and not multiple types at once, which the current comparator system supports.
- [ ] NumericalArithmetic with multiply, power, division and other math functions.
- [ ] a
getZeroValue()function for the Arithmetic attribute, so it can be used to reset variables for example.