Class ModDefinition
- java.lang.Object
-
- de.extio.spacecraft.shared.model.managers.ModDefinition
-
public final class ModDefinition extends Object
-
-
Constructor Summary
Constructors Constructor Description ModDefinition()ModDefinition(ModDefinition other)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)List<ModBoDef>getClientBusinessObjects()Business objects implement various game mechanicsList<String>getClientModules()IntegergetCompatibility()Technical compatible version of your mod.List<String>getCompositeEntityFactories()Discovered automatically for groovy scripts, don't setStringgetDescription()Name of the mod that is displayed to the user.StringgetDescriptionFallback()Fallback text displayed as name of your mod if localization id could not be found.List<GameModeDef>getGameModeDefs()Defines game modes.List<String>getGroovyPackageLoadOrder()Defines the order of loading of your groovy packages containing source code
Content is package source code folder name relative to groovy base directory ./mod/storage/src.IntegergetLoadingPriority()The order of loading of all mods is determined by the loadingPriority element in mod.xml.StringgetLogo()Logo of your mod, displayed in mods manager view and mods list in lobby.List<MenuLaunchEntry>getMenuLaunchEntries()This optional section is used to register your mod at the menu launcher.StringgetName()Technical name of your mod.List<String>getScriptingCompositeEntityFactorySelectables()List<ModBoDef>getServerBusinessObjects()Business objects implement various game mechanicsList<String>getServerModules()StringgetVersion()Version of your mod, only for documentation purpose.inthashCode()booleanisClient()true if your mod is relevant for the game client, otherwise false.booleanisDefaultMod()booleanisEntitiesIncremental()Set this to true to only override existing entities with your entities definition.booleanisMandatory()Set to true if you are hosting a multiplayer game and all other game clients must also have this mod activated that everything works as expected.booleanisServer()true if your mod is relevant for the game server, otherwise false.booleanisShipClassesIncremental()Set this to true to only override existing ship classes with your own definition.voidsetClient(boolean client)voidsetClientBusinessObjects(List<ModBoDef> clientBusinessObjects)voidsetClientModules(List<String> clientModules)Discovered automatically for groovy scripts, don't setvoidsetCompatibility(Integer compatibility)voidsetCompositeEntityFactories(List<String> compositeEntityFactories)voidsetDefaultMod(boolean defaultMod)voidsetDescription(String description)voidsetDescriptionFallback(String descriptionFallback)voidsetEntitiesIncremental(boolean entitiesIncremental)voidsetGameModeDefs(List<GameModeDef> gameModeDefs)voidsetGroovyPackageLoadOrder(List<String> groovyPackageLoadOrder)voidsetLoadingPriority(Integer loadingPriority)voidsetLogo(String logo)voidsetMandatory(boolean mandatory)voidsetMenuLaunchEntries(List<MenuLaunchEntry> menuLaunchEntries)voidsetName(String name)voidsetScriptingCompositeEntityFactorySelectables(List<String> scriptingCompositeEntityFactorySelectables)Discovered automatically for groovy scripts, don't setvoidsetServer(boolean server)voidsetServerBusinessObjects(List<ModBoDef> serverBusinessObjects)voidsetServerModules(List<String> serverModules)Discovered automatically for groovy scripts, don't setvoidsetShipClassesIncremental(boolean shipClassesIncremental)voidsetVersion(String version)StringtoString()
-
-
-
Constructor Detail
-
ModDefinition
public ModDefinition()
-
ModDefinition
public ModDefinition(ModDefinition other)
-
-
Method Detail
-
getName
public String getName()
Technical name of your mod. This is not displayed to the user. It is recommended to use lower case letters and separate words with hyphen character '-'
-
setName
public void setName(String name)
-
getVersion
public String getVersion()
Version of your mod, only for documentation purpose. I recommend to release with version 1.0.0
-
setVersion
public void setVersion(String version)
-
isEntitiesIncremental
public boolean isEntitiesIncremental()
Set this to true to only override existing entities with your entities definition. When set to false, all entities defined previously (also by game core) will be discarded, even if your mod does not define own entities. Setting it to false is only useful for total conversion mods.
-
setEntitiesIncremental
public void setEntitiesIncremental(boolean entitiesIncremental)
-
isShipClassesIncremental
public boolean isShipClassesIncremental()
Set this to true to only override existing ship classes with your own definition. When set to false, all ship classes defined previously (also by game core) will be discarded, even if your mod does not define own classes. Setting it to false is only useful for total conversion mods.
-
setShipClassesIncremental
public void setShipClassesIncremental(boolean shipClassesIncremental)
-
getDescription
public String getDescription()
Name of the mod that is displayed to the user. This is a localization id, you need to create a localization entry with i18n editor.
-
setDescription
public void setDescription(String description)
-
isDefaultMod
public boolean isDefaultMod()
-
setDefaultMod
public void setDefaultMod(boolean defaultMod)
-
getGameModeDefs
public List<GameModeDef> getGameModeDefs()
Defines game modes. Custom game modes require groovy scripting. Game modes are for example "Custom Game", "The Last Outpost", "Race", ...
-
setGameModeDefs
public void setGameModeDefs(List<GameModeDef> gameModeDefs)
-
setClientModules
public void setClientModules(List<String> clientModules)
Discovered automatically for groovy scripts, don't set
-
setServerModules
public void setServerModules(List<String> serverModules)
Discovered automatically for groovy scripts, don't set
-
getMenuLaunchEntries
public List<MenuLaunchEntry> getMenuLaunchEntries()
This optional section is used to register your mod at the menu launcher. If you define a custom game mode and want players to be able to switch to your game mode in lobby, this section is not required. Menu launcher is only needed to provide embedded views to other mods or to add entries in the main menu.
-
setMenuLaunchEntries
public void setMenuLaunchEntries(List<MenuLaunchEntry> menuLaunchEntries)
-
getClientBusinessObjects
public List<ModBoDef> getClientBusinessObjects()
Business objects implement various game mechanics
-
setClientBusinessObjects
public void setClientBusinessObjects(List<ModBoDef> clientBusinessObjects)
-
getServerBusinessObjects
public List<ModBoDef> getServerBusinessObjects()
Business objects implement various game mechanics
-
setServerBusinessObjects
public void setServerBusinessObjects(List<ModBoDef> serverBusinessObjects)
-
getCompositeEntityFactories
public List<String> getCompositeEntityFactories()
Discovered automatically for groovy scripts, don't set
-
setCompositeEntityFactories
public void setCompositeEntityFactories(List<String> compositeEntityFactories)
-
getCompatibility
public Integer getCompatibility()
Technical compatible version of your mod. Increment it if you introduce breaking changes that players with previous versions cannot play with other players using the latest version. The game server will check compatibility when a player joins and return an error message if necessary.
-
setCompatibility
public void setCompatibility(Integer compatibility)
-
isServer
public boolean isServer()
true if your mod is relevant for the game server, otherwise false. A mod is usually relevant for the game server if it contains entity-, shipclass- , achievements- or game mode (gameModeDefs) definitions or implements groovy code.
-
setServer
public void setServer(boolean server)
-
isClient
public boolean isClient()
true if your mod is relevant for the game client, otherwise false. A mod is usually relevant for the game client if it contains images, sounds, scenes, ships / stations, actions, entities, achievements, ship classes, i18n or implements groovy code.
-
setClient
public void setClient(boolean client)
-
isMandatory
public boolean isMandatory()
Set to true if you are hosting a multiplayer game and all other game clients must also have this mod activated that everything works as expected. This is usually only the case if your mod contains groovy code.
-
setMandatory
public void setMandatory(boolean mandatory)
-
getLogo
public String getLogo()
Logo of your mod, displayed in mods manager view and mods list in lobby. Place the logo in ./gfx/ui/ folder. If the filename is logo.png, the value for this element would be gfx/ui/logo.png
-
setLogo
public void setLogo(String logo)
-
getDescriptionFallback
public String getDescriptionFallback()
Fallback text displayed as name of your mod if localization id could not be found. It is recommended to use English language.
-
setDescriptionFallback
public void setDescriptionFallback(String descriptionFallback)
-
getGroovyPackageLoadOrder
public List<String> getGroovyPackageLoadOrder()
Defines the order of loading of your groovy packages containing source code
Content is package source code folder name relative to groovy base directory ./mod/storage/src. E.g. groovy package de.extio.spacecraft.mod.mymodname.something would result in de/extio/spacecraft/mod/mymodname/something if you place your groovy source code file in that directory (which is recommended)
-
setGroovyPackageLoadOrder
public void setGroovyPackageLoadOrder(List<String> groovyPackageLoadOrder)
-
getScriptingCompositeEntityFactorySelectables
public List<String> getScriptingCompositeEntityFactorySelectables()
-
setScriptingCompositeEntityFactorySelectables
public void setScriptingCompositeEntityFactorySelectables(List<String> scriptingCompositeEntityFactorySelectables)
Discovered automatically for groovy scripts, don't set
-
getLoadingPriority
public Integer getLoadingPriority()
The order of loading of all mods is determined by the loadingPriority element in mod.xml. Mods with higher values are loaded after mods with lower values and therefore can override all mods loaded before. Shipped official mods have priority 100.
-
setLoadingPriority
public void setLoadingPriority(Integer loadingPriority)
-
-