Files
MinecraftForge/src/main/java/cpw/mods/fml/common/ModMetadata.java
T

81 lines
2.1 KiB
Java
Raw Normal View History

2012-05-11 15:18:26 -04:00
/*
2013-03-07 19:25:48 -05:00
* Forge Mod Loader
* Copyright (c) 2012-2013 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser Public License v2.1
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
2013-03-07 19:25:48 -05:00
* Contributors:
* cpw - implementation
2012-05-11 15:18:26 -04:00
*/
package cpw.mods.fml.common;
import java.util.List;
import java.util.Set;
2012-07-22 11:56:38 -02:30
import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
2013-12-02 23:46:42 -05:00
import com.google.gson.annotations.SerializedName;
2012-07-22 11:56:38 -02:30
import cpw.mods.fml.common.functions.ModNameFunction;
import cpw.mods.fml.common.versioning.ArtifactVersion;
2012-07-22 11:56:38 -02:30
2012-05-11 15:18:26 -04:00
/**
* @author cpw
*
2012-05-11 15:18:26 -04:00
*/
public class ModMetadata
{
2013-12-02 23:46:42 -05:00
@SerializedName("modid")
2012-07-22 11:56:38 -02:30
public String modId;
2012-05-11 15:18:26 -04:00
public String name;
public String description = "";
2012-07-22 11:56:38 -02:30
public String url = "";
public String updateUrl = "";
public String logoFile = "";
public String version = "";
public List<String> authorList = Lists.newArrayList();
public String credits = "";
public String parent = "";
public String[] screenshots;
2012-07-22 11:56:38 -02:30
// this field is not for use in the json
public transient ModContainer parentMod;
// this field is not for use in the json
public transient List<ModContainer> childMods = Lists.newArrayList();
2012-07-22 11:56:38 -02:30
public boolean useDependencyInformation;
public Set<ArtifactVersion> requiredMods;
public List<ArtifactVersion> dependencies;
public List<ArtifactVersion> dependants;
// this field is not for use in the json
public transient boolean autogenerated;
2012-05-11 15:18:26 -04:00
public ModMetadata()
2012-07-22 11:56:38 -02:30
{
2012-05-25 15:25:35 -04:00
}
public String getChildModCountString()
{
2012-07-22 11:56:38 -02:30
return String.format("%d child mod%s", childMods.size(), childMods.size() != 1 ? "s" : "");
2012-05-25 15:25:35 -04:00
}
2012-07-22 11:56:38 -02:30
public String getAuthorList()
{
return Joiner.on(", ").join(authorList);
2012-05-25 15:25:35 -04:00
}
2012-07-22 11:56:38 -02:30
2012-05-25 15:25:35 -04:00
public String getChildModList()
{
2012-07-22 11:56:38 -02:30
return Joiner.on(", ").join(Lists.transform(childMods, new ModNameFunction()));
}
public String printableSortingRules()
{
return "";
2012-05-25 15:25:35 -04:00
}
2012-05-11 15:18:26 -04:00
}