Code Monkey home page Code Monkey logo

mc-iman's Introduction

IMan - Minecraft Inventory Manager Plugin

Logo

Index

About

This plugin provides inventory managment API for other plugins and respective commands for in-game use.

Warning: plugin isn't finished yet, it's just a preview.

Download

See releases page.

Installation

Installation method varies depending on your goal: wheater you want just to add plugin to your server or use it's API from another plugin.

As Plugin

Download latest plugin release and just put a jar in your server's plugins folder.

As Dependency

First, add MoonTalk repository to your pom.xml:

<repository>
    <id>moontalk<id>
    <url>https://repo.moontalk.space/repository/maven-releases/</id>
</repository>

Second, add plugin to your dependencies:

<dependency>
    <groupId>space.moontalk.mc</groupId>
    <artifactId>iman<artifactId>
    <version>1.1.1</version>
</dependency>

Done.

Building

To build plugin you need to install Maven first. Next just cd to plugin folder run mvn verify. Done.

Commands:

Command Description
/inventory list [player name] list player's inventories
/inventory ls [player name] ^
/inventory save <inventory name> [player name] save player's inventory
/inventory set <inventory name> [player name] set player's inventory
/inventory remove <inventory name> [player name] remove player's inventory
/inventory rm <inventory name> [player name] ^

/inv alias is also available.

API:

To use API you have to get plugin object and then get it's PersistenceManager object using following method:

@NonNull PersistenceManager getPersistenceManager()

The following is the list of PersistenceManager methods.

List player's inventories:

@NonNull List<@NonNull String> getInvenotriesNames(@NonNull Player player) throws Exception

Save player's inventory:

void saveInventory(@NonNull Player player, @NonNull String name) throws Exception

Set player's inventory:

void setInventory(@NonNull Player player, @NonNull String name) throws Exception

Remove player's inventory:

void removeInventory(@NonNull Player player, @NonNull String inventoryName) throws Exception

Configuration:

You can configure plugin's messages and persistence properties. The following is a set of property tables divided by sections.

message Section:

This section specifies messages that the plugins sends under certain criteria. Messages can contain placeholders like <player>. For example of using placeholders see default config.

Message Shown when
failed-to-save-inventory inventory saving failed due to server's internal error
failed-to-set-inventory inventory reading failed due to server's internal error
failed-to-remove-inventory inventory removing failed due to server's internal error
missing-your-inventories you issue /inv list and had no saved inventories
missing-inventories /inv list <player name> issued and specified player had no saved inventories
your-inventories you issue /inv list and had saved inventories (inventory list header)
inventories /inv list <player name> issued and specified player had saved inventories (inventory list header)
inventory /inv list [player name] and you (or specified player) had saved inventories (inventory list item)
save-your-inventory /inv save <inventory name> [your name] issued
save-inventory /inv save <inventory name> <player name> issued
set-your-inventory /inv set <inventory name> [your name] issued
set-inventory /inv set <inventory name> <player name> issued
remove-your-inventory /inv remove <inventory name> [your name] issued
remove-inventory /inv remove <inventory name> <player name> issued

persistence Section:

This section specifies how and where to store inventories.

Option Value Description
method file Specifies storage method (whether to store data in plain files or in database (only file storage is now available))
dir-name string Specifies directory name where to store data if specified method is file

Warning: currently options of this section doesn't effect plugin's behavior.

Permissions:

Plugin provides you a list of permissions for every subcommand and it's every variation.

Permission Allowes to Default
iman.inv run any subcommand op
iman.inv.list list inventories op
iman.inv.list.self list your own inventories true
iman.inv.list.other list others' inventories op
iman.inv.save save inventories op
iman.inv.save.self save your own inventory op
iman.inv.save.other save others' inventory op
iman.inv.set set inventories op
iman.inv.set.self set your own inventory op
iman.inv.set.other set others' inventory op
iman.inv.remove remove inventories op
iman.inv.remove.self remove your own inventories op
iman.inv.remove.other remove others' inventories op

mc-iman's People

Contributors

maksim2498 avatar

Stargazers

Michelin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.