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 boolean
equals(Object obj)
List<ModBoDef>
getClientBusinessObjects()
Business objects implement various game mechanicsList<String>
getClientModules()
Integer
getCompatibility()
Technical compatible version of your mod.List<String>
getCompositeEntityFactories()
Discovered automatically for groovy scripts, don't setString
getDescription()
Name of the mod that is displayed to the user.String
getDescriptionFallback()
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.Integer
getLoadingPriority()
The order of loading of all mods is determined by the loadingPriority element in mod.xml.String
getLogo()
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.String
getName()
Technical name of your mod.List<String>
getScriptingCompositeEntityFactorySelectables()
List<ModBoDef>
getServerBusinessObjects()
Business objects implement various game mechanicsList<String>
getServerModules()
String
getVersion()
Version of your mod, only for documentation purpose.int
hashCode()
boolean
isClient()
true if your mod is relevant for the game client, otherwise false.boolean
isDefaultMod()
boolean
isEntitiesIncremental()
Set this to true to only override existing entities with your entities definition.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.boolean
isServer()
true if your mod is relevant for the game server, otherwise false.boolean
isShipClassesIncremental()
Set this to true to only override existing ship classes with your own definition.void
setClient(boolean client)
void
setClientBusinessObjects(List<ModBoDef> clientBusinessObjects)
void
setClientModules(List<String> clientModules)
Discovered automatically for groovy scripts, don't setvoid
setCompatibility(Integer compatibility)
void
setCompositeEntityFactories(List<String> compositeEntityFactories)
void
setDefaultMod(boolean defaultMod)
void
setDescription(String description)
void
setDescriptionFallback(String descriptionFallback)
void
setEntitiesIncremental(boolean entitiesIncremental)
void
setGameModeDefs(List<GameModeDef> gameModeDefs)
void
setGroovyPackageLoadOrder(List<String> groovyPackageLoadOrder)
void
setLoadingPriority(Integer loadingPriority)
void
setLogo(String logo)
void
setMandatory(boolean mandatory)
void
setMenuLaunchEntries(List<MenuLaunchEntry> menuLaunchEntries)
void
setName(String name)
void
setScriptingCompositeEntityFactorySelectables(List<String> scriptingCompositeEntityFactorySelectables)
Discovered automatically for groovy scripts, don't setvoid
setServer(boolean server)
void
setServerBusinessObjects(List<ModBoDef> serverBusinessObjects)
void
setServerModules(List<String> serverModules)
Discovered automatically for groovy scripts, don't setvoid
setShipClassesIncremental(boolean shipClassesIncremental)
void
setVersion(String version)
String
toString()
-
-
-
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)
-
-