BukkitDev | GitHub

Intro

Introducing MCore! What a hoopy frood!? \O_o/

MCore stands for “MassiveCraft Core” and is a Bukkit plugin that contains components the MassiveCraft developers use for developing other Bukkit plugins.

  • Are you a server owner? Great! This page is meant for you.
  • Are you a plugin developer? Cool! MCore is open source.
  • Are you a regular player? This page may be uninteresting to you.

MCore is mainly a bunch of libraries and features that other plugins make use of, but some configuration can be done by the server owner. Especially the universe system (usys).

Versioning

Three

You may only have one version of mcore installed on your server at the same time. If you have many plugins installed that depend on mcore they must thus depend on the same mcore version.

Plugins Using MCore

Factions

Factions Logotype

CreativeGates

CGlogo2

Vampire

The Vampire Logotype

MassiveBooks

MassiveBooks Logotype

MassiveHat

MassiveHat Logotype

MassiveTickets

logo-massivetickets

The Configuration Files

The first config is the file /plugins/mcore/conf.json:

{
  "serverid": "550e8400-e29b-41d4-a716-446655440000",
  "dburi": "default",
  "alias2uri": {
    "default": "flatfile",
    "flatfile": "flatfile://mstore",
    "mongodb": "mongodb://localhost:27017/mstore"
  }
}

For a normal setup (99% of the cases) you can just leave the config file as is. You can edit this config file while the server is running but in order for the changes to take effect you must restart your server.

  • serverid: is an ID for the server. This is currently not used for anything and can be ignored.
  • dburi: is the database URI or alias for the default mstore database.
  • alias2uri: is a “recursive lookup map” for database URI aliases. For example “default” resolves like “default” → “flatfile” → “flatfile://mstore”. The value “flatfile://mstore” means use flatfile storage placing the data flatfiles in the folder “/mstore” (a sibling folder to the “/plugins” folder).

The second config is the database object mcore_conf/instance:

{
  "aliasesOuterMCore": [
    "mcore"
  ],
  "aliasesOuterMCoreUsys": [
    "usys"
  ],
  "aliasesOuterMCoreMStore": [
    "mstore"
  ],
  "usingRecipientChatEvent": true,
  "forcingOnePlayerNameCase": true,
  "permissionDeniedFormats": {
    "some.awesome.permission.node": "You must be awesome to %s.",
    "some.derp.permission.node.1", "derp",
    "some.derp.permission.node.2", "derp",
    "some.derp.permission.node.3", "derp",
    "derp": "Only derp people can %s.\nAsk a moderator to become derp."
  },
  "permissionToTpdelay": {
    "mcore.notpdelay": 0,
    "default": 10
  }
}

For a normal setup (99% of the cases) you can just leave the config file as is. You can edit this file when the server is running. The changes will automatically be loaded into the server after a few seconds.

  • aliasesOuterMCore: are the aliases for the outer /mcore command.
  • aliasesOuterMCoreUsys: are the aliases for the outer /usys command.
  • aliasesOuterMCoreMStore: are the aliases for the outer /mstore command.
  • usingRecipientChatEvent: Required for {factions_relcolor} to work but can be disabled here.
  • forcingOnePlayerNameCase: Only has effect for offline mode servers. Ensures players log on with the same capitalization all the time. This fixes bugs in other plugins that expect proper online mode behavior. Learn more from reading the source comments.
  • permissionDeniedFormats: allows you to set custom denied messages for a permission node. The lookups in this map is “recursive”. For example “some.derp.permission.node.1″ would resolve → “derp” → “Only derp people can %s.\nAsk a moderator to become derp.”.
  • permissionToTpdelay: is the normal delay in seconds before teleportation when a plugin makes use of mcore’s delayed teleportation system.

Offline mode player name case

Are you running an offline mode server? Then please focus and read all of this text.

MCore introduces a new feature that will help you in the long run but may require you to do some manual work upon installing the plugin. MCore will enforce that only one capitalization of each username is allowed since online mode is not there to help you do this. If you run unix you may have to delete your “duplicate” player.dat files. Read these links for a full understanding:

To help you plan your actions:

  • Is your server running in online mode or behind an online mode bungee cord proxy? Cool you don’t need to do anything.
  • Is your server running on windows? Cool you don’t need to do anything.
  • Would it be OK for you to delete all your player.dat files? Cool in such case I suggest you go ahead and do so since it’s the easiest solution.
  • Otherwise find the duplicate player.dat files like “steve.dat”, “Steve.dat” and “stEVE.dat” and remove all but one of them manually.
  • If you don’t have time for this you can disable the feature in the mcore conf. You will however get a buggy server. Plugins sometimes act weird without this fix. If you use Factions players will for example get kicked for inactivity 4NO raisins.

Commands

Some commands in a console window.

  • /mcore use the mcore command
  • /mcore usys use the usys command
  • /mcore mstore use the mstore command
  • /mcore id see the server id
  • /mcore hearsound,hearsounds <sound(s)> hear a sound
    Example: /mcore hearsound WITHER_SPAWN,0.5,1.4 LEVEL_UP,1.0,1.0
  • /mcore v,version display plugin version and information

Note that /mcore usys and /mcore mstore also are available as top-level-commands /usys and /mstore.

  • /mstore stats show mstore statistics
  • /mstore listcolls [db=default] list collections in a database
  • /mstore copydb <from> <to> copy database content
  • /usys m,multiverse manage multiverses
  • /usys m,multiverse l,list [page=1] list multiverses
  • /usys m,multiverse s,show <multiverse> show multiverse
  • /usys m,multiverse n,new <multiverse> create new multiverse
  • /usys m,multiverse d,del <multiverse> delete multiverse
  • /usys u,universe manage universes
  • /usys u,universe n,new <universe> <multiverse> create new universe in multiverse
  • /usys u,universe d,del <universe> <multiverse> delete multiverse
  • /usys u,universe c,clear <universe> <multiverse> clear universe in multiverse
  • /usys w,world <world> <universe> <multiverse> set a worlds universe in a multiverse
  • /usys a,aspect manage aspects
  • /usys a,aspect l,list [page=1] list aspects
  • /usys a,aspect s,show <aspect> show aspect
  • /usys a,aspect u,use <aspect> <multiverse> set multiverse for aspect

The universe system (usys)

An image of two universes. There is 3 worlds in the universe to the left and 5 worlds in the universe to the right.

The purpose of usys is to offer awesome “multiworld support“. This is best described by example.

An example

Say you are using the vampire plugin and have 5 worlds on your server. The 2 worlds creativeherp and creativederp are creativemode worlds. The 3 worlds survivalfoo, survivalbar and survivalzoot are survivalmode worlds.

Wouldn’t it be great if players could be vampires in the survival-mode worlds but not in the creative-mode worlds? Players are supposed to roleplay in the survival-mode worlds and vampirism is great fun when roleplaying. However in the creative-mode worlds there’s no roleplaying going on and vampirism is irritating and unwanted.

With usys you could then create two universes in your default multiverse:

  • Universe “survival” contains worlds “survivalfoo”, “survivalbar” and “survivalzoot”.
  • Universe “creative” contains worlds “creativederp” and “creativederp”.

Then you point the aspect “vampire_player” to use the default multiverse (this is acctually the case by default)

The Details

  • Each multiverse contains many universes.
  • Each universe contains many worlds.
  • Each world belongs to exactly one universe. (in each multiverse)
  • Each aspect use a certain multiverse.

There’s an undeletable multiverse called “default”.
There’s an undeletable universe called “default” in each multiverse.

An aspect will use the “default” multiverse if nothing else is specified.
A world will use the “default” universe if nothing else is specified.

Aspects are supplied by plugins. The plugin Vampire does for example have two aspects called “vampire_player” and “vampire_config”:

  1. vampire_player: Everything related to player state
    • Is the player a vampire or not?
    • What was the infection reason?
  2. vampire_config: Config options for balancing
    • What is the splash potion radius for holy water?
    • What items are considered wooden stakes?

Multiverses are templates saying what universes exist and what worlds are in them. You will find yourself reusing multiverses, that is pointing many aspects to use the same multiverse.

Tips and Trix

Do you want to remove a world from a universe?
Just assign it to the default universe.

The data store system (mstore)

Store all the things!

MCore contains a data storage/persistence system. With a default config you find all this “data” as flat-files in the folder “mstore” in you server folder.

An especially nice feature is that the storage system polls for changes in the backend. You can change the “.json”-flatfiles during runtime and the changes will be loaded into the server. It is thus possible to point two servers to the same database although data may get lost every once in a while due to write conflicts.

The store system uses GSON for serialization and can use either flatfile or mongodb backend. You specify what database you want to use in the configuration.

Permissions and plugin.yaml

Yes! Open that jarfile \:D/

Protip: Yes! You should open/unzip that mcore.jar jar-file. Open and take a look at the file plugin.yaml directly. Bellow follows the content of that file (but since Cayorion is lazy it’s probably not updated).

main: com.massivecraft.mcore.MCore
name: mcore
version: 6.9.0
website: http://massivecraft.com/mcore
authors: [Cayorion]
description: §eMCore stands for MassiveCraft Core and is a plugin that contains libraries and features that other plugins make use of. §aCayorion §efrom the minecraft server §aMassiveCraft §eis the lead programmer. Feel free to visit us at §bhttp://massivecraft.com
load: startup
permissions:
# -------------------------------------------- #
# THE REAL NODES
# -------------------------------------------- #
# cmd
  mcore.cmd.mcore: {description: use the mcore command, default: false}
  mcore.cmd.mcore.id: {description: see the server id, default: false}
  mcore.cmd.mcore.version: {description: diplay plugin version, default: false}
  mcore.cmd.mcore.hearsound: {description: hear a sound, default: false}
  mcore.cmd.mcore.mstore: {description: use the mstore command, default: false}
  mcore.cmd.mcore.mstore.stats: {description: show mstore statistics, default: false}
  mcore.cmd.mcore.mstore.listcolls: {description: list collections in a database, default: false}
  mcore.cmd.mcore.mstore.copydb: {description: copy database content, default: false}
  mcore.cmd.mcore.usys: {description: use the usys command, default: false}
  mcore.cmd.mcore.usys.multiverse: {description: manage multiverses, default: false}
  mcore.cmd.mcore.usys.multiverse.list: {description: list multiverses, default: false}
  mcore.cmd.mcore.usys.multiverse.show: {description: show multiverse, default: false}
  mcore.cmd.mcore.usys.multiverse.new: {description: create new multiverse, default: false}
  mcore.cmd.mcore.usys.multiverse.del: {description: delete multiverse, default: false}
  mcore.cmd.mcore.usys.universe: {description: manage universes, default: false}
  mcore.cmd.mcore.usys.universe.new: {description: create new universe in multiverse, default: false}
  mcore.cmd.mcore.usys.universe.del: {description: delete universe in multiverse, default: false}
  mcore.cmd.mcore.usys.universe.clear: {description: clear universe in multiverse, default: false}
  mcore.cmd.mcore.usys.world: {description: set a worlds universe in a multiverse, default: false}
  mcore.cmd.mcore.usys.aspect: {description: manage aspects, default: false}
  mcore.cmd.mcore.usys.aspect.list: {description: list aspects, default: false}
  mcore.cmd.mcore.usys.aspect.show: {description: show aspect, default: false}
  mcore.cmd.mcore.usys.aspect.use: {description: set multiverse for aspect, default: false}
# misc
  mcore.notpdelay: {description: teleport without delay, default: false}
# -------------------------------------------- #
# STAR NOTATION
# -------------------------------------------- #
  mcore.*:
    default: false
    children:
      mcore.cmd.mcore: true
      mcore.cmd.mcore.id: true
      mcore.cmd.mcore.version: true
      mcore.cmd.mcore.hearsound: true
      mcore.cmd.mcore.mstore: true
      mcore.cmd.mcore.mstore.stats: true
      mcore.cmd.mcore.mstore.listcolls: true
      mcore.cmd.mcore.mstore.copydb: true
      mcore.cmd.mcore.usys: true
      mcore.cmd.mcore.usys.multiverse: true
      mcore.cmd.mcore.usys.multiverse.list: true
      mcore.cmd.mcore.usys.multiverse.show: true
      mcore.cmd.mcore.usys.multiverse.new: true
      mcore.cmd.mcore.usys.multiverse.del: true
      mcore.cmd.mcore.usys.universe: true
      mcore.cmd.mcore.usys.universe.new: true
      mcore.cmd.mcore.usys.universe.del: true
      mcore.cmd.mcore.usys.universe.clear: true
      mcore.cmd.mcore.usys.world: true
      mcore.cmd.mcore.usys.aspect: true
      mcore.cmd.mcore.usys.aspect.list: true
      mcore.cmd.mcore.usys.aspect.show: true
      mcore.cmd.mcore.usys.aspect.use: true
      mcore.notpdelay: true
# -------------------------------------------- #
# KITS
# -------------------------------------------- #
  mcore.kit.operator:
    default: op
    children:
      mcore.*: true
  mcore.kit.rank3:
    default: false
    children:
      mcore.kit.rank2: true
  mcore.kit.rank2:
    default: false
    children:
      mcore.kit.rank1: true
  mcore.kit.rank1:
    default: false
    children:
      mcore.kit.rank0: true
      mcore.cmd.mcore.id: true
      mcore.cmd.mcore.mstore: true
      mcore.cmd.mcore.mstore.stats: true
      mcore.cmd.mcore.mstore.listcolls: true
      mcore.cmd.mcore.usys: true
      mcore.cmd.mcore.usys.multiverse: true
      mcore.cmd.mcore.usys.multiverse.list: true
      mcore.cmd.mcore.usys.multiverse.show: true
      mcore.cmd.mcore.usys.aspect: true
      mcore.cmd.mcore.usys.aspect.list: true
      mcore.cmd.mcore.usys.aspect.show: true
      mcore.notpdelay: true
  mcore.kit.rank0:
    default: false
    children:
      mcore.cmd.mcore: true
      mcore.cmd.mcore.hearsound: true
      mcore.cmd.mcore.version: true
  mcore.kit.default:
    default: true
    children:
      mcore.kit.rank0: true