your current location:首页 > news>Prism Config MineCraft

Prism Config MineCraft

2024-12-15 02:43:03|Myriagame |source:minecraft skins

Minecraft images

Overview

Let you write the lightweight configuration library of your configuration file efficiently and elegantly.

Dance with me

For ordinary users, PRISM Config contains a fabric.mod.json, so it can be loaded as a Fabric module;Any loader is loaded on any game version.

For developers, you need to add Prism Config to your project, and you need to add the following in your Build.gradle (.kts):

Grovy DSL:

 repositories {// ... maven {name = "nova committee-release" url = "https://maven.nova- committee.cn/rellll Eases/"} maven {name= "Nova Committee-Snapshot" url = "https://maven.nova- committee.cn/snapshots/"}} de pendencies {// ... Implementation "io.github .prismwork: Prismconfig: 0.2.0: All "// If you already include the library required by PRISM Config in your project, you can also choose a smaller jar.(Gson, jankson ...) // iOO.GITHUB.prism: Prismconfig: 0.2.0 "} 

Kotlin dsl:

 repositories {// ... maven {name = "nova committee-release" url = uri ("https: //maven.nova- committeee. cn/releases/")}Maven {name = "Nova Committee-Snapshot" url = Uri ("https://maven.nova- committee.cn/snapshots/")}} Dependencies {// ... Implem Entation ("IO.GITHUB.PRISMWORK: PRISMCONFIG: 0.2.0: all ")) // If you already include the library required by Prism Config in your project, you can also choose a smaller jar.(Gson, JANKSON ...) // Implementation ("IO.GITHUB.prism: PRISMCONFIG: 0.2.0")} 
PRISM Config's default provides JSON (GSON), Jankson, Toml 0.4.0 (Toml4j) serializer and dependent serializer.

You can use the following code to convert the string to the configuration file object:

 String Content; MyConfig Config = PrismConfig.getInstance (). Serialize (myconfig.class, conferences, defaults erializers.getInstance ().is written in json5); 

You can use the following code to convert the configuration file object into a string:

 myconfig content; string config = prismconfig.getinstance (). DESerialize (myconfig.class, confau, defoon ltDeserializers.getInstance ().Is written in json5); 
You can also write it directly to the file:

 MyConfig Content; File Configfile; PrismConfig.getInstance (). DeserializeandWrite (MyConfig.class, Content, Content, Content, DefaultDeserializers.getInstance ().Config is written in json5 configfile); 

To write your own serialization/back -sequencer, you can use the following code (we take serialization as an example):

 string content; prismconfig.getInstance (). Serialize (myconfig.class, content, (string)-> {{ // Do your own parsing here}); 

Used library

Jankson made by Falkreon is open source with the MIT protocol.

The GSON produced by Google is open source with Apache-2.0 protocol.

The Toml4J made by Moandji Ezana is open source with the MIT protocol.

The goal of MC Encyclopedia (MCMOD.CN) is to provide players with a better environment for MOD learning and research, and accept and cultivate more hardcore players.Provide Minecraft (Minecraft) MOD (module) item data introduction, tutorial strategy and MOD download, and is committed to improving the player's game experience.About the encyclopedia Encyclopedia help development log Donate Encyclopedia to follow the encyclopedia B station = "Fa Fa-Anagle-Right"> Opinions feedback Email © CopyRight Mc Encyclopedia 2013-2024 mcmod.cn |

Minecraft images

In addition to other statements, MCMOD.CN, all open public editing content uses the BY-NC-SA 3.0 protocol.

Minecraft images

Minecraft images