ClassySK by novystxr 
Object orientation for skript in the form of classes
Events
0
Expressions
6
Effects
2
Conditions
1
Types
3
Sections
1
Structures
1
Total
14
Object orientation for skript in the form of classes
Events
0
Expressions
6
Effects
2
Conditions
1
Types
3
Sections
1
Structures
1
Total
14
- fixed an issue where classes would be registered before methods/field were validated meaning if it failed you would get 'A class named '%s' already exists' error. whoops
Changes:
- Fixed index out of bounds exception when performing an add/remove from a single field containing no value
- Changed the method call pattern to support call chaining
- Method arguments are no longer internally formatted as lowercase, which could potentially cause issues
1.0.0 Full Release
Changes since the last pre-release
- New instance now supports nested sections. For example:
myField: new instance of Example:
otherField: 1
otherField: 2
- Methods now support keyed expressions for list arguments
- Runtime integrity check for field/method calls: prints runtime errors if the signature at runtime isn't assignable to the type reported at parse time
- Class de-registration now happens cleanly every time the structure is unloaded, no longer needing a separate clean-up listener and reducing the chance of stale classes being left in server memory. Static fields and tracked instances are now stored independently.
- Class Wrapper has been changed to Class Reference since it no longer actually wraps an instance, this has been reflected in patterns. The class reference object is planned to be used in future updates as an entry point to reflection.
- Minor method optimizations
Features included in this version
- Fields and Methods (can be static or non-static)
- Public/Private access modifiers
- Serialization for instances (can be saved after restarts)
- Parse time instance type guessing (with optional [class hints](https://github.com/novystar/ClassySK/wiki/Class-Hints))
- Ability to get the class of an instance and check what type it is
- A new instance section where you can specify initial values for fields
Potentially Breaking Changes
Class Options have been outright removed. I decided to remove them while the addon is still in pre-release since they were sort of a bandaid solution for things that should really be fleshed out features. I have plans to incorporate the same functionality in better ways (like additional keywords.. etc)
Other Changes:
ClassySK is an addon that adds proper object orientation capabilities to skript in the form of classes. Allowing you to write powerful, defensive code and explore OOP concepts within skript!
Roadmap
Nothing here is set in stone but these are my future ambitions regarding the project (in no particular order)
- Inheritance: extending other classes
- Abstract Methods: unimplemented methods that should be implemented by inheritors
- Constant fields: fields that cant be changed after creation
- Transient fields: Fields that don't get saved
- Method and Field Reflection
- Custom types (maybe): I have an idea to possibly achieve this using bytebuddy and converters but it is unlikely to happen until skript supports clean type deregistration.
Code Examples