public class Mod extends java.lang.Object implements java.lang.Comparable, java.lang.Iterable<GRUP>
Modifier and Type | Class and Description |
---|---|
static class |
Mod.Mod_Flags
The various flags found in the Mod header.
|
Constructor and Description |
---|
Mod(ModListing info)
Creates an empty Mod with the name and master flag set to match info.
|
Mod(java.lang.String name,
java.lang.Boolean master)
Creates an empty Mod with the name and master flag set to parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
addAsOverrides(java.util.ArrayList<Mod> in,
GRUP_TYPE... grup_types)
Iterates through each mod in the ArrayList, in order, and merges them in
one by one.
This means any conflicting records within the list will end up with the last mod's version. NOTE: Merging will NOT add records from a mod with a matching ModListing. |
void |
addAsOverrides(java.util.Collection<Mod> in,
GRUP_TYPE... grup_types)
NOTE: To sort the mods in load order, use a TreeSet.
Iterates through each mod in the Set and merges them in one by one. This means any conflicting records within the set will end up with the last mod's version. NOTE: Merging will NOT add records from a mod with a matching ModListing. |
void |
addAsOverrides(Mod rhs,
GRUP_TYPE... grup_types)
This function will merge all GRUPs from the rhs mod into the calling
mod.
Any records already in the mod will be overwritten by the version from rhs. NOTE: Merging will NOT add records from a mod with a matching ModListing. |
void |
addAsOverrides(SPDatabase db,
GRUP_TYPE... grup_types)
Iterates through each mod in the SPDatabase, in load order, and merges
them in one by one.
This means any conflicting records within the database will end up with the last mod's version. NOTE: Merging will NOT add records from a mod with a matching ModListing. |
void |
addRecord(MajorRecord m)
This function requires there to be a GlobalDB set, as it adds the
necessary masters from it.
|
int |
compareTo(java.lang.Object o)
A compare function used for sorting Mods in load order.
|
boolean |
contains(FormID id) |
boolean |
equals(java.lang.Object obj)
An equals function that compares only mod name.
|
boolean |
exists() |
void |
export()
Exports the mod to the path designated by SPGlobal.pathToData.
|
void |
export(java.lang.String path)
Exports the mod to the path given by the parameter.
|
void |
exportMasterList(java.lang.String path)
Exports the master list of this mod to "Files/Last Masterlist.txt"
Used for checking if patches are needed. |
GRUP<AVIF> |
getActorValues() |
GRUP<ALCH> |
getAlchemy() |
GRUP<AMMO> |
getAmmo() |
GRUP<ARMA> |
getArmatures() |
GRUP<ARMO> |
getArmors() |
GRUP<BOOK> |
getBooks() |
GRUP<COBJ> |
getConstructibleObjects() |
java.util.ArrayList<GRUP_TYPE> |
getContainedTypes() |
GRUP<CONT> |
getContainers() |
GRUP<DLBR> |
getDialogBranches() |
GRUP<DIAL> |
getDialogs() |
GRUP<DLVW> |
getDialogViews() |
GRUP<ENCH> |
getEnchantments() |
GRUP<ECZN> |
getEncounterZones() |
GRUP<FACT> |
getFactions() |
GRUP<FLST> |
getFormLists() |
GRUP<GMST> |
getGameSettings() |
GRUP<GLOB> |
getGlobals() |
java.util.Map<GRUP_TYPE,GRUP> |
getGRUPs() |
GRUP<HDPT> |
getHeadParts() |
GRUP<IMGS> |
getImageSpaces() |
ModListing |
getInfo() |
GRUP<INGR> |
getIngredients() |
GRUP<KYWD> |
getKeywords() |
GRUP<LVLN> |
getLeveledCreatures() |
GRUP<LVLI> |
getLeveledItems() |
GRUP<LGTM> |
getLightingTemplates() |
GRUP<MGEF> |
getMagicEffects() |
MajorRecord |
getMajor(FormID query,
GRUP_TYPE... grup_types) |
MajorRecord |
getMajor(java.lang.String edid,
GRUP_TYPE... grup_types) |
java.util.ArrayList<ModListing> |
getMasters()
Returns the ModListings of all the masters of the mod.
|
java.util.ArrayList<java.lang.String> |
getMastersStrings() |
GRUP<MISC> |
getMiscObjects() |
java.lang.String |
getName() |
java.lang.String |
getNameNoSuffix() |
GRUP<NPC_> |
getNPCs() |
ModListing |
getNthMaster(int i)
Returns the ModListing associated with the nth master of this mod.
|
GRUP<OTFT> |
getOutfits() |
GRUP<PERK> |
getPerks() |
GRUP<PROJ> |
getProjectiles() |
GRUP<RACE> |
getRaces() |
java.util.ArrayList<MajorRecord> |
getRecords() |
GRUP<SPEL> |
getSpells() |
GRUP<STAT> |
getStatics() |
GRUP<TXST> |
getTextureSets() |
GRUP<VTYP> |
getVoiceTypes() |
GRUP<WEAP> |
getWeapons() |
GRUP<WTHR> |
getWeathers() |
int |
hashCode()
A custom hash function that takes the mod header into account for better
hashing.
|
boolean |
isEmpty() |
boolean |
isFlag(Mod.Mod_Flags flag)
Returns whether the given flag is on or off.
|
java.util.Iterator<GRUP> |
iterator() |
void |
keep(GRUP_TYPE... grup_type)
Clears all GRUPS in the Mod except for the GRUPs specified in the
parameter.
|
java.util.ArrayList<MajorRecord> |
makeCopy(GRUP g)
This function requires there to be a GlobalDB set, as it adds the
necessary masters from it.
|
MajorRecord |
makeCopy(MajorRecord m,
java.lang.String newEDID)
Makes a copy of the Major Record and loads it into the mod, giving a new
Major Record a FormID originating from the mod.
|
int |
numMasters() |
int |
numRecords() |
void |
print()
Prints each GRUP in the mod to the asynchronous log.
|
void |
remove(FormID id) |
void |
setAuthor(java.lang.String in)
Sets the author name of the mod.
|
void |
setFlag(Mod.Mod_Flags flag,
boolean on)
Sets the given flag in the mod.
|
java.lang.String |
toString() |
public Mod(ModListing info)
info
- ModListing object containing name and master flag.ModListing
public Mod(java.lang.String name, java.lang.Boolean master)
name
- String to set the Mod name to.master
- Sets the Mod's master flag (which appends ".esp" and ".esm"
to the modname as appropriate)public ModListing getNthMaster(int i)
i
- The index of the master to return.public int numMasters()
public boolean isEmpty()
public boolean exists()
public MajorRecord getMajor(FormID query, GRUP_TYPE... grup_types)
query
- FormID to look in the mod for.grup_types
- Types of GRUPs to look in. (Optional - searches all if
left blank)public MajorRecord getMajor(java.lang.String edid, GRUP_TYPE... grup_types)
edid
- EDID to look in the mod for.grup_types
- Types of GRUPs to look in. (Optional - searches all if
left blank)public MajorRecord makeCopy(MajorRecord m, java.lang.String newEDID)
m
- Major Record to make a copy of and add to the mod.newEDID
- EDID to assign to the new record. Make sure it's unique.public java.util.ArrayList<MajorRecord> makeCopy(GRUP g)
g
- GRUP to make a copy of.public java.util.ArrayList<GRUP_TYPE> getContainedTypes()
public void addRecord(MajorRecord m)
m
- Major Record to add as an override.public void print()
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.ArrayList<java.lang.String> getMastersStrings()
ModListing
public java.util.ArrayList<ModListing> getMasters()
ModListing
public java.util.Map<GRUP_TYPE,GRUP> getGRUPs()
public void keep(GRUP_TYPE... grup_type)
grup_type
- Any amount of GRUPs to keep, separated by commaspublic void addAsOverrides(Mod rhs, GRUP_TYPE... grup_types)
rhs
- Mod whose GRUPs to add in.grup_types
- Any amount of GRUPs to merge in, separated by commas.
Leave this empty if you want all GRUPs merged.public void addAsOverrides(java.util.ArrayList<Mod> in, GRUP_TYPE... grup_types)
in
- ArrayList of mods to merge in.grup_types
- Any amount of GRUPs to merge in, separated by commas.
Leave this empty if you want all GRUPs merged.public void addAsOverrides(java.util.Collection<Mod> in, GRUP_TYPE... grup_types)
in
- Set of mods to merge in.grup_types
- Any amount of GRUPs to merge in, separated by commas.
Leave this empty if you want all GRUPs merged.public void addAsOverrides(SPDatabase db, GRUP_TYPE... grup_types)
db
- The SPDatabase to merge in.grup_types
- Any amount of GRUPs to merge in, separated by commas.
Leave this empty if you want all GRUPs merged.public int numRecords()
public java.util.ArrayList<MajorRecord> getRecords()
public boolean contains(FormID id)
id
- FormID to look for.public void export() throws java.io.IOException, BadRecord
public void export(java.lang.String path) throws java.io.IOException, BadRecord
path
- java.io.IOException
BadRecord
- If duplicate EDIDs are found in the mod. This has been
deemed an unacceptable mod format, and is thrown to promote the
investigation and elimination of duplicate EDIDs.public void exportMasterList(java.lang.String path) throws java.io.IOException
path
- java.io.IOException
public void setAuthor(java.lang.String in)
in
- Your name here.public boolean isFlag(Mod.Mod_Flags flag)
flag
- Mod_Flags enum to check.Mod.Mod_Flags
public final void setFlag(Mod.Mod_Flags flag, boolean on)
flag
- Mod_Flags enum to set.on
- What to set the flag to.Mod.Mod_Flags
public GRUP<LVLN> getLeveledCreatures()
GRUP
public GRUP<IMGS> getImageSpaces()
GRUP
public GRUP<ARMA> getArmatures()
GRUP
public GRUP<TXST> getTextureSets()
GRUP
public GRUP<KYWD> getKeywords()
GRUP
public GRUP<FLST> getFormLists()
GRUP
public GRUP<MGEF> getMagicEffects()
GRUP
public GRUP<INGR> getIngredients()
GRUP
public GRUP<FACT> getFactions()
GRUP
public GRUP<GMST> getGameSettings()
GRUP
public GRUP<ENCH> getEnchantments()
GRUP
public GRUP<LVLI> getLeveledItems()
GRUP
public GRUP<AVIF> getActorValues()
GRUP
public GRUP<ECZN> getEncounterZones()
GRUP
public GRUP<COBJ> getConstructibleObjects()
GRUP
public GRUP<MISC> getMiscObjects()
GRUP
public GRUP<HDPT> getHeadParts()
GRUP
public GRUP<PROJ> getProjectiles()
GRUP
public GRUP<LGTM> getLightingTemplates()
GRUP
public java.lang.String getName()
public ModListing getInfo()
ModListing
public java.lang.String getNameNoSuffix()
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
o
- Another Mod objectpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- public void remove(FormID id)
id
- public int hashCode()
hashCode
in class java.lang.Object