⚙️
T-MiniGameAPI
WebsiteDiscord
1.4.0
1.4.0
  • 🏠Home
  • 💻Maven and Gradle
  • 📦Minigame setup
  • 🖱️Plugins are using this libarary
  • Basic features
    • 🗺️Configuration
      • 🎯Configurators
      • 🔴Override Configuartors
    • 🖱️Commands
      • 🧔Parent commands
      • 🧒Sub commands
      • 📑Tab completer
      • ®️Command registration
    • 🧑Models
      • 📦File model
        • 🟢Single file
        • 🟠Many files
      • 💡DB model
      • 🧑‍🦱Users
    • 📔Loaders
      • 📗Loader
        • 📂File loader
        • 💾Database loader
    • 💬Library commands
  • Minigame features
    • 🅰️Arena system
      • 🟢Arena
      • 🔵ArenaManager
    • 🎮Game system
      • 🔴Game Manager
      • 🔵Game State
      • 🟡Users in game
      • 🟢Teams
    • ⏰Timers
      • 😀SimpleTimer
      • ✨XpTimer
    • 🪙Coins system
      • 🟢UserCoins
      • 🔵UserCoinsManager
    • ✨Statistics system
      • 🟢Default statistics system
      • 🔵Your own statistics system
    • 💥Cosmetics system
      • 📀Cosmetic
        • 💕ParticleCosmetic
      • ✳️Cosmetics Manager
      • 🧒Users' cosmetics
        • 💿UserCosmeticsManager
        • ✅UserCosmetics
  • Addons
    • 🎁What is addon?
    • 🖍️How to create addon?
    • 📃Addons list
Powered by GitBook
On this page
  1. Basic features
  2. Models

File model

PreviousModelsNextSingle file

Last updated 1 year ago

The file model represents objects that will be saved in YAML file.

There are two types of file models:

  • Saving everything to one file (SingleFile annotation)

  • Saving one object to one file (ManyFiles annotation )

Every file model must have IdSection annotation on Id field.

The field which is annotated IdSection annotation is a unique key in YAML file, which represents one object. It is a primary section of an object in YAML file.

Saving, and updating YAML files system is based on Bukkit serialization.

Every file model must be registered in the main class.

ConfigurationSerialization.registerClass(UserCoins.class); //without alias
ConfigurationSerialization.registerClass(UserCoins.class, "UserCoins"); //with alias 

In the file model constructor must be called init method.

File model methods:

ConfigurationFile getConfigurationFile(); //gets information about file
🧑
📦
https://www.spigotmc.org/threads/tutorial-bukkit-custom-serialization.148781/www.spigotmc.org