▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
Плагины/MongoDB Loader
MongoDB Loader

MongoDB Loader

Modern MongoDB connectivity for Minecraft servers. One jar that auto-detects Bukkit, Spigot, Paper, BungeeCord, Velocity or Sponge and bundles the latest MongoDB Java driver. A dependency library: other plugins use it, it adds no gameplay itself.

Оцените первым
66
0

MongoDB Loader

Modern MongoDB database connectivity for Minecraft servers.

MongoDB Loader is a library plugin that gives other plugins a working MongoDB connection. It bundles the current mongodb-driver-sync library, so plugins that need a database do not each have to ship their own driver.

It adds no gameplay features on its own. It is a dependency: install it, and the plugins that need MongoDB will use it.

Key features

  • Universal platform support. Works across Bukkit, Spigot, Paper, BungeeCord, Velocity and Sponge.
  • Latest MongoDB driver, kept current.
  • Automatic platform detection. A single jar works everywhere.
  • Zero configuration. Drop it in and start the server.
  • Developer friendly, with a small integration surface.
  • Performance optimised, minimal overhead and efficient connections.

Installing

Download mongodb-loader-<version>.jar and put it in:

PlatformFolder
Bukkit, Spigot, Paperplugins/
BungeeCordplugins/
Velocityplugins/
Spongemods/

Start the server and it detects the platform by itself. Then install whatever plugins depend on it.

For plugin developers

Declare it as a dependency:

Bukkit, Spigot, Paper (plugin.yml)

depend: [MongoDBLoader]
# or, if optional
softdepend: [MongoDBLoader]

BungeeCord (bungee.yml)

depends: [MongoDBLoader]
# or, if optional
softDepends: [MongoDBLoader]

Velocity (velocity-plugin.json)

{
  "dependencies": [
    { "id": "mongodb-loader", "optional": false }
  ]
}

Sponge

@Plugin("your-plugin-id")
@Dependency("mongodb-loader")
public class YourPlugin {
    // ...
}

Then use the driver as normal:

import com.mongodb.client.MongoClient;
import com.mongodb.client.MongoClients;
import com.mongodb.client.MongoDatabase;
import org.bukkit.plugin.java.JavaPlugin;

public class YourPlugin extends JavaPlugin {
    private MongoClient mongoClient;
    private MongoDatabase database;

    @Override
    public void onEnable() {
        mongoClient = MongoClients.create("mongodb://localhost:27017");
        database = mongoClient.getDatabase("minecraft_server");
        getLogger().info("Connected to MongoDB!");
    }
}

Compatibility

Minecraft 1.13 and newer. Server side only.

Source and issues: https://github.com/AshleyThew/mongodb-loader

Партнёрский материал

Сервер для плагина MongoDB Loader - как у профи

Плагин MongoDB Loader создан для серверов: на своём сервере вы настраиваете его под себя и решаете, кому играть. Создать сервер с плагином MongoDB Loader для друзей можно за пару минут - BungeeHost всё уже подготовил.

Часто задаваемые вопросы

Совместимость

Minecraft: Java Edition

26.3.x26.2.x26.1.x1.21.x1.20.x1.19.x1.18.x1.17.x1.16.x1.15.x1.14.x1.13.x

Поддерживаемые окружения

Сервер

Ссылки

Детали

Лицензия:
Опубликован:2 месяца назад
Обновлён:1 месяц назад
Главная