本文整理汇总了Java中cpw.mods.fml.common.ModContainer.getSource方法的典型用法代码示例。如果您正苦于以下问题:Java ModContainer.getSource方法的具体用法?Java ModContainer.getSource怎么用?Java ModContainer.getSource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cpw.mods.fml.common.ModContainer
的用法示例。
在下文中一共展示了ModContainer.getSource方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadLanguagesFor
import cpw.mods.fml.common.ModContainer; //导入方法依赖的package包/类
public void loadLanguagesFor(ModContainer container, Side side)
{
File source = container.getSource();
try
{
if (source.isDirectory())
{
searchDirForLanguages(source, "", side);
}
else
{
searchZipForLanguages(source, side);
}
}
catch (IOException ioe)
{
}
}
示例2: packMod
import cpw.mods.fml.common.ModContainer; //导入方法依赖的package包/类
private void packMod(ModContainer mod) throws Exception{
String modPath = modCache.toAbsolutePath().toString()
+ File.separator
+ Utils.getFilename(mod.getModId(), mod.getVersion());
if(new File(modPath + ".zip").exists())
return;
FileOutputStream fos = new FileOutputStream(modPath + ".zip");
ZipOutputStream zos = new ZipOutputStream(fos);
File src = mod.getSource();
String fname = "mods/" + src.getName();
if("Forge".equals(mod.getModId()))
fname = "bin/modpack.jar";
zos.putNextEntry(new ZipEntry(fname));
Files.copy(src.toPath(), zos);
zos.closeEntry();
zos.close();
fos.close();
}
示例3: applyModContainer
import cpw.mods.fml.common.ModContainer; //导入方法依赖的package包/类
@Override
public void applyModContainer(ModContainer activeContainer)
{
this.modContainer = activeContainer;
this.modMetadata = activeContainer.getMetadata();
this.sourceFile = activeContainer.getSource();
this.suggestedConfigFile = new File(configurationDir, activeContainer.getModId()+".cfg");
}
示例4: FMLFileResourcePack
import cpw.mods.fml.common.ModContainer; //导入方法依赖的package包/类
public FMLFileResourcePack(ModContainer container)
{
super(container.getSource());
this.container = container;
}
示例5: FMLFolderResourcePack
import cpw.mods.fml.common.ModContainer; //导入方法依赖的package包/类
public FMLFolderResourcePack(ModContainer container)
{
super(container.getSource());
this.container = container;
}