{"id":15175124,"url":"https://github.com/carmjos/bukkitjsonserializer","last_synced_at":"2025-10-26T09:30:58.316Z","repository":{"id":38328386,"uuid":"500597891","full_name":"CarmJos/BukkitJSONSerializer","owner":"CarmJos","description":"A JSON serialize/deserialize util for bukkit's ConfigurationSerialization.","archived":false,"fork":false,"pushed_at":"2024-09-27T16:56:03.000Z","size":461,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-09-28T12:03:20.677Z","etag":null,"topics":["bukkit","deserialization","json","serialization","spigot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CarmJos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["CarmJos"],"custom":["https://donate.carm.cc"]}},"created_at":"2022-06-06T21:24:55.000Z","updated_at":"2024-09-27T13:21:52.000Z","dependencies_parsed_at":"2023-02-09T14:16:32.230Z","dependency_job_id":"d9c7d610-5a28-4827-bc57-a31e611a03e3","html_url":"https://github.com/CarmJos/BukkitJSONSerializer","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarmJos%2FBukkitJSONSerializer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarmJos%2FBukkitJSONSerializer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarmJos%2FBukkitJSONSerializer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarmJos%2FBukkitJSONSerializer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CarmJos","download_url":"https://codeload.github.com/CarmJos/BukkitJSONSerializer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219863300,"owners_count":16555950,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bukkit","deserialization","json","serialization","spigot"],"created_at":"2024-09-27T12:03:30.408Z","updated_at":"2025-10-26T09:30:57.995Z","avatar_url":"https://github.com/CarmJos.png","language":"Java","funding_links":["https://github.com/sponsors/CarmJos","https://donate.carm.cc"],"categories":[],"sub_categories":[],"readme":"# BukkitJSONSerializer\n\n[![version](https://img.shields.io/github/v/release/CarmJos/BukkitJSONSerializer)](https://github.com/CarmJos/BukkitJSONSerializer/releases)\n[![License](https://img.shields.io/github/license/CarmJos/BukkitJSONSerializer)](https://www.gnu.org/licenses/lgpl-3.0.html)\n[![workflow](https://github.com/CarmJos/BukkitJSONSerializer/actions/workflows/maven.yml/badge.svg?branch=master)](https://github.com/CarmJos/BukkitJSONSerializer/actions/workflows/maven.yml)\n[![CodeFactor](https://www.codefactor.io/repository/github/carmjos/BukkitJSONSerializer/badge)](https://www.codefactor.io/repository/github/carmjos/BukkitJSONSerializer)\n![CodeSize](https://img.shields.io/github/languages/code-size/CarmJos/BukkitJSONSerializer)\n![](https://visitor-badge.glitch.me/badge?page_id=BukkitJSONSerializer.readme)\n\nA JSON serialize/deserialize util for bukkit's ConfigurationSerialization.\n\n## Usage\n\n### Basic usage\n\nFirst, we should get the serializer instance or create a new one.\n\n```java\nBukkitJSONSerializer serializer = BukkitJSONSerializer.get();\n```\n\nThen, we could use `serializeToJSON(ConfigurationSerializable)` to serialize a object to JSON.\n\n```jave\nLocation location = new Location(Bukkit.getWorlds().get(0), -100.5, 100, 105.5);\nString serialized = serializer.serializeToJSON(location);\n// -\u003e {\"world\":\"world\",\"x\":-100.5,\"y\":100,\"z\":105.5,\"yaw\":0.0,\"pitch\":0.0}\n```\n\nWhen we need to read the object, just use `deserializeJSON(json,typeClass)` to deserialize the JSON\nstring.\n\n```java\nLocation location = serializer.deserializeJSON(json, Location.class);\n// Location{world=world, x=-100.5, y=100, z=105.5, pitch=0.0, yaw=0.0}\n```\n\nOr use `deserializeSON(json,typeClass,defaultValue)` if we need a default value.\n\n### JSONSerializable class\n\nThis project provided an interface `JSONSerializable` which provided a default method to serialize itself to JSON.\n\n```java\npublic interface JSONSerializable extends ConfigurationSerializable {\n\n    default @NotNull String serializeToJSON() {\n        return BukkitJSONSerializer.serializeToJSON(this);\n    }\n\n}\n```\n\n## Dependency Usage\n\n\u003cdetails\u003e\n\u003csummary\u003eMaven dependency\u003c/summary\u003e\n\n```xml\n\n\u003cproject\u003e\n    \u003crepositories\u003e\n\n        \u003crepository\u003e\n            \u003c!--Using central repository--\u003e\n            \u003cid\u003emaven\u003c/id\u003e\n            \u003cname\u003eMaven Central\u003c/name\u003e\n            \u003curl\u003ehttps://repo1.maven.org/maven2\u003c/url\u003e\n        \u003c/repository\u003e\n\n        \u003crepository\u003e\n            \u003c!--Using github repository--\u003e\n            \u003cid\u003eBukkitJSONSerializer\u003c/id\u003e\n            \u003curl\u003ehttps://raw.githubusercontent.com/CarmJos/BukkitJSONSerializer/repo/\u003c/url\u003e\n        \u003c/repository\u003e\n\n    \u003c/repositories\u003e\n\n    \u003cdependencies\u003e\n\n        \u003cdependency\u003e\n            \u003cgroupId\u003ecc.carm.lib\u003c/groupId\u003e\n            \u003cartifactId\u003ebukkitjsonserializer\u003c/artifactId\u003e\n            \u003cversion\u003e[LATEST RELEASE]\u003c/version\u003e\n            \u003cscope\u003ecompile\u003c/scope\u003e\n        \u003c/dependency\u003e\n\n    \u003c/dependencies\u003e\n\n\u003c/project\u003e\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eGradle dependency\u003c/summary\u003e\n\n```groovy\nrepositories {\n\n    mavenCentral() // Using central repository.\n\n    // Using github repositories.\n    maven { url 'https://raw.githubusercontent.com/CarmJos/BukkitJSONSerializer/repo/' }\n\n}\n\ndependencies {\n    api \"cc.carm.lib:bukkitjsonserializer:[LATEST RELEASE]\"\n}\n```\n\n\u003c/details\u003e\n\n## Open Source License.\n\nThe project using [GNU LESSER GENERAL PUBLIC LICENSE](https://www.gnu.org/licenses/lgpl-3.0.html) .\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarmjos%2Fbukkitjsonserializer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarmjos%2Fbukkitjsonserializer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarmjos%2Fbukkitjsonserializer/lists"}