▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
Моды/oopsk
oopsk

oopsk

a Skript addon that aims to add limited object-oriented programming tools to Skript in a non-invasive manner.

48
2
Все версииoopsk 1.0-beta2

oopsk 1.0-beta2

Beta3 мес. назад

Список изменений

beta 2

Beta 2 introduces some very interesting features, namely concrete types and custom converters. These crack open the very heart of Skript's internals, so I'm rather tentative about declaring them stable. They should be treated with care. I want to double down on the advice that you should always reload all scripts after editing a struct template. This is even more important with the registration of types and converters, now. If you are encountering weird behavior, reload all and see if it still occurs.

concrete types:

struct alpha:
    b: bravo struct
    c: number

struct bravo:
    d: string = "bravo"
    
function test(input: alpha struct):
    broadcast {_input}->b->d # should always print "bravo"

Concrete types means you can now use _ struct as a type in fields, functions, and more! This should help with specifying typing in your custom functions and nested structs.

custom converters

struct ServerPlayer:
    player: player
    money: number
    max_health: number
    converts to:
        player via this->player
        location via this->player's location

Custom converters (<type> via <expression>) allow you to register types that Skript can convert your struct object to automatically. This lets you do things like teleport {struct} to me if you have a player/entity converter for the struct. Due to restrictions with Skript's converter system and the hacking I have to do to make this work, this will not register chaining converters for you, so if you provide a player converter, Skript will not be able to convert it to a location despite the existence of a player->location converter it could chain with. Use with care!

Changelog:

  • Allows options in fields
  • Allow single Object fields to accept any type in acceptChange (thanks @miberss)
  • Adds concrete types for struct templates.
  • Adds custom converters for struct types.

Full Changelog: https://github.com/sovdeeth/oopsk/compare/1.0-beta1...1.0-beta2

Файлы

oopsk-1.0-beta2.jar(3.41 MiB)
Основной
Скачать

Метаданные

Канал релиза

Beta

Номер версии

1.0-beta2

Загрузчики

Paper

Версии игры

1.19.4–1.21.10

Загрузок

30

Дата публикации

3 мес. назад

Загрузил

ID версии

Главная