SkriptLang / Skript

Skript is a Spigot plugin which allows server admins to customize their server easily, but without the hassle of programming a plugin or asking/paying someone to program a plugin for them.
https://docs.skriptlang.org
GNU General Public License v3.0
1.07k stars 369 forks source link

HashMap isn't possible to save in the database #7211

Closed yhdev7935 closed 2 days ago

yhdev7935 commented 2 days ago

Skript/Server Version

[21:53:44 INFO]: [Skript] Server Version: 1.21.1-119-7cd4f2c (MC: 1.21.1)
[21:53:44 INFO]: [Skript] Skript Version: 2.10.0-beta1 (skriptlang-github)

Bug Description

after saving the HashMap in variables and turning the server off and on, it is all deleted.

Expected Behavior

Data should be remained even if the server is turned off and on.

Steps to Reproduce

firstly, define the function like this.

import:
    java.util.HashMap

function getHashMap() :: object:
    return new HashMap()

image

After restarting the server.. {639BFC4A-0122-4E80-8943-AEA1488EBFC2}

Errors or Screenshots

No response

Other

No response

Agreement

Fusezion commented 2 days ago

A hash map is not registered under skript's classinfos as such it has no serializer. This happens to anything without a serializer i.e. entities, colors (blue, red, green), inventories, firework effects and many many more things.

This isn't a bug as much as just something not supported, I don't even think skript-reflect would be able to easily serialize things especially maps