本文整理汇总了Java中com.enderio.core.common.util.EnderFileUtils类的典型用法代码示例。如果您正苦于以下问题:Java EnderFileUtils类的具体用法?Java EnderFileUtils怎么用?Java EnderFileUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EnderFileUtils类属于com.enderio.core.common.util包,在下文中一共展示了EnderFileUtils类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addCustoms
import com.enderio.core.common.util.EnderFileUtils; //导入依赖的package包/类
private static void addCustoms(ResourcePackAssembler assembler)
{
initialize("recordMusic");
JsonObject root = new JsonObject();
for (File f : new File(baseDir.getAbsolutePath() + "/recordMusic").listFiles((FileFilter) FileFilterUtils.suffixFileFilter(".ogg")))
{
assembler.addCustomFile("assets/minecraft/sounds/records", f); // add record .ogg
JsonObject event = new JsonObject();
event.addProperty("category", "record"); // put under the "record" category for sound options
JsonArray sounds = new JsonArray(); // array of sounds (will only ever be one)
JsonObject sound = new JsonObject(); // sound object (instead of primitive to use 'stream' flag)
sound.addProperty("name", "records/" + getSimpleName(f)); // path to file
sound.addProperty("stream", true); // prevents lag for large files
sounds.add(sound);
event.add("sounds", sounds);
root.add("records." + CustomThings.MODID + "." + getSimpleName(f), event); // event name (same as name sent to ItemCustomRecord)
}
assembler.addCustomFile("assets/minecraft", EnderFileUtils.writeToFile(baseDir.getAbsolutePath() + "/recordMusic/sounds.json", gson.toJson(root)));
}
示例2: preInit
import com.enderio.core.common.util.EnderFileUtils; //导入依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
if (Loader.isModLoaded("ttCore")) {
proxy.throwModCompatibilityError(lang.localize("error.ttcore.1"), lang.localize("error.ttcore.2"), lang.localize("error.ttcore.3"));
}
if (event.getSide().isClient()) {
TextureErrorRemover.beginIntercepting();
}
ConfigHandler.configFolder = event.getModConfigurationDirectory();
ConfigHandler.enderConfigFolder = new File(ConfigHandler.configFolder.getPath() + "/" + MODID);
ConfigHandler.configFile = new File(ConfigHandler.enderConfigFolder.getPath() + "/" + event.getSuggestedConfigurationFile().getName());
if (!ConfigHandler.configFile.exists() && event.getSuggestedConfigurationFile().exists()) {
try {
FileUtils.copyFile(event.getSuggestedConfigurationFile(), ConfigHandler.configFile);
} catch (IOException e) {
Throwables.propagate(e);
}
EnderFileUtils.safeDelete(event.getSuggestedConfigurationFile());
}
ConfigHandler.instance().initialize(ConfigHandler.configFile);
Handlers.preInit(event);
CompatRegistry.INSTANCE.handle(event);
OreDict.registerVanilla();
EnchantXPBoost.INSTANCE.register();
EnchantAutoSmelt.INSTANCE.register();
}
示例3: initialize
import com.enderio.core.common.util.EnderFileUtils; //导入依赖的package包/类
private void initialize(ModToken mod, File file) {
this.file = file;
if (!file.exists()) {
file.getParentFile().mkdirs();
String assetPath = mod.getAssetPath();
if (!assetPath.endsWith("/")) {
assetPath = assetPath + "/";
}
EnderFileUtils.copyFromJar(mod.getMainClass(), assetPath + file.getName(), file);
}
refresh();
}
示例4: addIcons
import com.enderio.core.common.util.EnderFileUtils; //导入依赖的package包/类
private static void addIcons(ResourcePackAssembler assembler)
{
initialize("icons");
for (File f : new File(baseDir.getAbsolutePath() + "/icons").listFiles((FileFilter) FileFilterUtils.or((IOFileFilter) EnderFileUtils.pngFilter, FileFilterUtils.suffixFileFilter(".mcmeta"))))
{
assembler.addIcon(f);
}
}
示例5: addLangs
import com.enderio.core.common.util.EnderFileUtils; //导入依赖的package包/类
private static void addLangs(ResourcePackAssembler assembler)
{
initialize("lang");
for (File f : new File(baseDir.getAbsolutePath() + "/lang").listFiles(EnderFileUtils.langFilter))
{
assembler.addLang(f);
}
}