moorkop / mccy-engine

Provides a web based "Minecraft Server as a Service" (MCaaS?) to deploy Minecraft server containers on any Docker Swarm cluster or standalone Engine instance.
Apache License 2.0
12 stars 4 forks source link

Optional Forge modules in the create form? #6

Closed sshipway closed 8 years ago

sshipway commented 8 years ago

It would be a nice idea to be able to select Forge modules for the new instance.

Using the read-only /mods and /config mounts (added in my pull req) you could pass a module set to the new container, without compromising your use of SEED or WORLD or needing a /data mount. You would need to have a preset library of modules in the container-yard, though, sorted out by Minecraft version 1.7.2/1.7.10/1.8 and filter the available list according to the selected version, and/or allow modules to be uploaded.

Of course, world saves that require certain modules to be present can always have the module included in the save zip itself. However it would be nice to be able to select them on the flay , particularly for module developers who would want to upload their latest module for testing.

itzg commented 8 years ago

Research note: it's going to help that Forge mod jars contain a top level mcmod.info that looks like

[
{
  "modid": "Vending",
  "name": "Vending",
  "description": "Adds a vending block that lets you sell items.",
  "version": "1.3.1",
  "credits": "",
  "logoFile": "/icon.png",
  "mcversion": "1.8",
  "url": "",
  "updateUrl": "",
  "authors": [ "AUTOMATIC_MAIDEN", "kamilx3" ],
  "parent":"",
  "screenshots": [],
  "dependencies": []
}
]

where mcversion can be used to simplify/ensure like-versioned mods.

sshipway commented 8 years ago

I've only written a couple of forge modules, but I'm not sure that Forge actually uses this field to enforce when the module is loaded; I think it is more informational. This is because a module may say '1.7.2' but it will work for 1.7.x where 2<=x<10. Forge also allows modules to be located in version-numbered subdirs which are only loaded with that particular version. Still, this may be of use to enable/disable module options in the selection GUI, or to pick which version of a module to load, or to give warnings. The module version, on the other hand, is definitely used to compare clientside and serverside module versions and to error if they do not match.

itzg commented 8 years ago

Yeah...basically my hope with the mcinfo is that we could let users drag and drop one or more mod jars and extract at least the basics like name, description, and MC version. I'll look at the Forge docs and pick some random, older mods and see if the mcversion field is reliable enough. Even if auto-inspection gets it "wrong", the user could be given an option to manually fix up the attributes.

itzg commented 8 years ago

...seems to be a stable specification at least

https://github.com/MinecraftForge/FML/wiki/FML-mod-information-file

itzg commented 8 years ago

...but already found one I had sitting around that didn't "conform"

[{
  "modid": "LotsOfFood",
  "name": "Lots of Food",
  "description": "A mod adding lots of food in Minecraft !",
  "version": "1.7.2",
  "url": "http://www.minecraftforum.net/topic/1144076-132-lots-of-food/",
  "authorList": ["pifou92000"],
  "credits": "",
  "logoFile": "/logoAliments.png",
  "dependencies": ["mod_MinecraftForge"]
}]

In that case, could prompt the user to select a version if mcversion is not present. I'm glad to see the other fields were reasonably filled.

sshipway commented 8 years ago

How about this.

You can keep a library of mods in the container yard, probably on a mounted volume. You can upload new mods to this via the UI.

The modules are parsed for the mcmod.info file, which grabs mcversion, version, name, description etc. If any or all are not present, they have sane defaults. If no mcversion, then it defaults to 'any'.

Then, when the user selects 'Forge' in the UI, it does two things --

When a user selects a Version, hide the modules from the multiselect dropdown that are not 'any' or a corresponding version. Most mods should have the mcversion, and even if Forge does not enforce it, the container year UI can do its best to prevent incompatible choices.

If the user de-selects Forge then you'd need to re-populate the version dropdown of course.

itzg commented 8 years ago

:+1:

itzg commented 8 years ago

We'll spin off new issues for further evolution of this capability.