本文整理汇总了Java中cpw.mods.fml.common.FMLLog.fine方法的典型用法代码示例。如果您正苦于以下问题:Java FMLLog.fine方法的具体用法?Java FMLLog.fine怎么用?Java FMLLog.fine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cpw.mods.fml.common.FMLLog
的用法示例。
在下文中一共展示了FMLLog.fine方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findClasspathMods
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
private void findClasspathMods() {
List<String> knownLibraries = ImmutableList.<String>builder()
.addAll(modClassLoader.getDefaultLibraries())
.addAll(CoreModManager.getLoadedCoremods()).build();
File[] minecraftSources = modClassLoader.getParentSources();
HashSet<String> searchedSources = new HashSet<String>();
for (File minecraftSource : minecraftSources) {
if (searchedSources.contains(minecraftSource.getAbsolutePath()))
continue;
searchedSources.add(minecraftSource.getAbsolutePath());
if (minecraftSource.isFile()) {
if (!knownLibraries.contains(minecraftSource.getName())) {
FMLLog.fine("Found a minecraft related file at %s, examining for codechicken classes", minecraftSource.getAbsolutePath());
try {
readFromZipFile(minecraftSource);
} catch (Exception e) {
CodeChickenCorePlugin.logger.error("Failed to scan " + minecraftSource.getAbsolutePath() + ", the zip file is invalid", e);
}
}
} else if (minecraftSource.isDirectory()) {
FMLLog.fine("Found a minecraft related directory at %s, examining for codechicken classes", minecraftSource.getAbsolutePath());
readFromDirectory(minecraftSource, minecraftSource);
}
}
}
示例2: testConsistency
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
private void testConsistency() {
// test if there's an entry for every set bit in availabilityMap
for (int i = availabilityMap.nextSetBit(0); i >= 0; i = availabilityMap.nextSetBit(i+1))
{
if (iBlockRegistry.getRaw(i) == null && iItemRegistry.getRaw(i) == null && !blockedIds.contains(i))
{
throw new IllegalStateException(String.format("availabilityMap references empty entries for id %d.", i));
}
}
for (int pass = 0; pass < 2; pass++)
{
boolean isBlock = pass == 0;
String type = isBlock ? "block" : "item";
FMLControlledNamespacedRegistry<?> registry = isBlock ? iBlockRegistry : iItemRegistry;
registry.validateContent((isBlock ? MAX_BLOCK_ID : MAX_ITEM_ID), type, availabilityMap, blockedIds, iBlockRegistry);
}
FMLLog.fine("Registry consistency check successful");
}
示例3: searchZipForLanguages
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
private void searchZipForLanguages(File source, Side side) throws IOException
{
ZipFile zf = new ZipFile(source);
List<String> added = Lists.newArrayList();
for (ZipEntry ze : Collections.list(zf.entries()))
{
Matcher matcher = assetENUSLang.matcher(ze.getName());
if (matcher.matches())
{
String lang = matcher.group(2);
//FMLLog.fine("Injecting found translation data for lang %s in zip file %s at %s into language system", lang, source.getName(), ze.getName());
added.add(lang);
LanguageRegistry.instance().injectLanguage(lang, StringTranslate.parseLangFile(zf.getInputStream(ze)));
// Ensure en_US is available to StringTranslate on the server
if ("en_US".equals(lang) && side == Side.SERVER)
{
StringTranslate.inject(zf.getInputStream(ze));
}
}
}
if (added.size() > 0)
FMLLog.fine("Found translations in %s [%s]", source.getName(), Joiner.on(", ").join(added));
zf.close();
}
示例4: searchDirForLanguages
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
private void searchDirForLanguages(File source, String path, Side side) throws IOException
{
for (File file : source.listFiles())
{
String currPath = path+file.getName();
if (file.isDirectory())
{
searchDirForLanguages(file, currPath+'/', side);
}
Matcher matcher = assetENUSLang.matcher(currPath);
if (matcher.matches())
{
String lang = matcher.group(2);
FMLLog.fine("Injecting found translation assets for lang %s at %s into language system", lang, currPath);
LanguageRegistry.instance().injectLanguage(lang, StringTranslate.parseLangFile(new FileInputStream(file)));
// Ensure en_US is available to StringTranslate on the server
if ("en_US".equals(lang) && side == Side.SERVER)
{
StringTranslate.inject(new FileInputStream(file));
}
}
}
}
示例5: fromBytes
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buffer)
{
serverProtocolVersion = buffer.readByte();
// Extended dimension support during login
if (serverProtocolVersion > 1)
{
overrideDimension = buffer.readInt();
FMLLog.fine("Server FML protocol version %d, 4 byte dimension received %d", serverProtocolVersion, overrideDimension);
}
else
{
FMLLog.info("Server FML protocol version %d, no additional data received", serverProtocolVersion);
}
}
示例6: transform
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
@Override
public byte[] transform(String name, String transformedName, byte[] basicClass) {
if (basicClass == null)
return null;
ClassNode classNode = new ClassNode();
ClassReader classReader = new ClassReader(basicClass);
classReader.accept(classNode, 0);
for (MethodNode m: classNode.methods)
{
for (ListIterator<AbstractInsnNode> it = m.instructions.iterator(); it.hasNext(); )
{
AbstractInsnNode insnNode = it.next();
if (insnNode.getType() == AbstractInsnNode.FIELD_INSN)
{
FieldInsnNode fi = (FieldInsnNode)insnNode;
if (FLUID_TYPE.equals(fi.owner) && LEGACY_FIELDNAME.equals(fi.name) && fi.getOpcode() == Opcodes.GETFIELD)
{
FMLLog.fine("Method %s.%s%s: Replacing GETFIELD fluidID with INVOKEVIRTUAL getFluidID", name, m.name, m.desc);
it.remove();
MethodInsnNode replace = new MethodInsnNode(Opcodes.INVOKEVIRTUAL, FLUID_TYPE, GETID_NAME, GETID_DESC, false);
it.add(replace);
}
}
}
}
ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS);
classNode.accept(writer);
return writer.toByteArray();
}
示例7: getPriority
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
private static int getPriority(IRecipe recipe)
{
Class<?> cls = recipe.getClass();
Integer ret = priorities.get(cls);
if (ret == null)
{
if (!warned.contains(cls))
{
FMLLog.info(" Unknown recipe class! %s Modder please refer to %s", cls.getName(), RecipeSorter.class.getName());
warned.add(cls);
}
cls = cls.getSuperclass();
while (cls != Object.class)
{
ret = priorities.get(cls);
if (ret != null)
{
priorities.put(recipe.getClass(), ret);
FMLLog.fine(" Parent Found: %d - %s", ret.intValue(), cls.getName());
return ret.intValue();
}
}
}
return ret == null ? 0 : ret.intValue();
}
示例8: discover
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
@Override
public List<ModContainer> discover(ModCandidate candidate, ASMDataTable table)
{
this.table = table;
List<ModContainer> found = Lists.newArrayList();
FMLLog.fine("Examining directory %s for potential mods", candidate.getModContainer().getName());
exploreFileSystem("", candidate.getModContainer(), found, candidate, null);
for (ModContainer mc : found)
{
table.addContainer(mc);
}
return found;
}
示例9: freezeData
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
public static void freezeData()
{
FMLLog.fine("Freezing block and item id maps");
getMain().testConsistency();
frozen = new GameData(getMain());
frozen.testConsistency();
}
示例10: revertToFrozen
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
public static void revertToFrozen()
{
if (frozen == null)
{
FMLLog.warning("Can't revert to frozen GameData state without freezing first.");
}
else
{
FMLLog.fine("Reverting to frozen data state.");
getMain().set(frozen);
}
// the id mapping has reverted, ensure we sync up the object holders
ObjectHolderRegistry.INSTANCE.applyObjectHolders();
}
示例11: registerBlock
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
private int registerBlock(Block block, String name, int idHint)
{
// handle ItemBlock-before-Block registrations
ItemBlock itemBlock = null;
for (Item item : iItemRegistry.typeSafeIterable()) // find matching ItemBlock
{
if (item instanceof ItemBlock && ((ItemBlock) item).field_150939_a == block)
{
itemBlock = (ItemBlock) item;
break;
}
}
if (itemBlock != null) // has ItemBlock, adjust id and clear the slot already occupied by the corresponding item
{
idHint = iItemRegistry.getId(itemBlock);
FMLLog.fine("Found matching ItemBlock %s for Block %s at id %d", itemBlock, block, idHint);
freeSlot(idHint, block); // temporarily free the slot occupied by the Item for the block registration
}
// add
int blockId = iBlockRegistry.add(idHint, name, block, availabilityMap);
if (itemBlock != null) // verify
{
if (blockId != idHint) throw new IllegalStateException(String.format("Block at itemblock id %d insertion failed, got id %d.", idHint, blockId));
verifyItemBlockName(itemBlock);
}
useSlot(blockId);
((RegistryDelegate.Delegate<Block>) block.delegate).setName(name);
return blockId;
}
示例12: doModEntityRegistration
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private void doModEntityRegistration(Class<? extends Entity> entityClass, String entityName, int id, Object mod, int trackingRange, int updateFrequency, boolean sendsVelocityUpdates)
{
ModContainer mc = FMLCommonHandler.instance().findContainerFor(mod);
EntityRegistration er = new EntityRegistration(mc, entityClass, entityName, id, trackingRange, updateFrequency, sendsVelocityUpdates);
try
{
entityClassRegistrations.put(entityClass, er);
entityNames.put(entityName, mc);
if (!EntityList.field_75626_c.containsKey(entityClass))
{
String entityModName = String.format("%s.%s", mc.getModId(), entityName);
EntityList.field_75626_c.put(entityClass, entityModName);
EntityList.field_75625_b.put(entityModName, entityClass);
FMLLog.finer("Automatically registered mod %s entity %s as %s", mc.getModId(), entityName, entityModName);
}
else
{
FMLLog.fine("Skipping automatic mod %s entity registration for already registered class %s", mc.getModId(), entityClass.getName());
}
}
catch (IllegalArgumentException e)
{
FMLLog.log(Level.WARN, e, "The mod %s tried to register the entity (name,class) (%s,%s) one or both of which are already registered", mc.getModId(), entityName, entityClass.getName());
return;
}
entityRegistrations.put(mc, er);
}
示例13: sortCraftManager
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public static void sortCraftManager()
{
bake();
FMLLog.fine("Sorting recipies");
warned.clear();
Collections.sort(CraftingManager.func_77594_a().func_77592_b(), INSTANCE);
}
示例14: loadTexture
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
public void loadTexture(IResourceManager p_110551_1_)
{
try
{
if (this.bufferedImage == null && this.textureLocation != null)
{
super.loadTexture(p_110551_1_);
}
}
catch (Exception e)
{
e.printStackTrace();
}
if (this.imageThread == null)
{
if (this.field_152434_e != null && this.field_152434_e.isFile())
{
FMLLog.fine("Loading http texture from local cache (%s)", this.field_152434_e);
try
{
this.bufferedImage = ImageIO.read(this.field_152434_e);
if (this.imageBuffer != null)
{
this.setBufferedImage(this.imageBuffer.parseUserSkin(this.bufferedImage));
}
}
catch (IOException ioexception)
{
logger.error("Couldn\'t load skin " + this.field_152434_e, ioexception);
this.func_152433_a();
}
}
else
{
this.func_152433_a();
}
}
}
示例15: func_152433_a
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
protected void func_152433_a()
{
this.imageThread = new Thread("Texture Downloader #" + threadDownloadCounter.incrementAndGet())
{
public void run()
{
HttpURLConnection httpurlconnection = null;
FMLLog.fine("Downloading http texture from %s to %s", ThreadDownloadImageDataGC.this.imageUrl, ThreadDownloadImageDataGC.this.field_152434_e);
try
{
httpurlconnection = (HttpURLConnection) (new URL(ThreadDownloadImageDataGC.this.imageUrl)).openConnection();
httpurlconnection.setDoInput(true);
httpurlconnection.setDoOutput(false);
httpurlconnection.connect();
if (httpurlconnection.getResponseCode() / 100 == 2)
{
BufferedImage bufferedimage;
if (ThreadDownloadImageDataGC.this.field_152434_e != null)
{
FileUtils.copyInputStreamToFile(httpurlconnection.getInputStream(), ThreadDownloadImageDataGC.this.field_152434_e);
bufferedimage = ImageIO.read(ThreadDownloadImageDataGC.this.field_152434_e);
}
else
{
bufferedimage = ImageIO.read(httpurlconnection.getInputStream());
}
if (ThreadDownloadImageDataGC.this.imageBuffer != null)
{
bufferedimage = ThreadDownloadImageDataGC.this.imageBuffer.parseUserSkin(bufferedimage);
}
ThreadDownloadImageDataGC.this.setBufferedImage(bufferedimage);
return;
}
}
catch (Exception exception)
{
ThreadDownloadImageDataGC.logger.error("Couldn\'t download http texture", exception);
return;
}
finally
{
if (httpurlconnection != null)
{
httpurlconnection.disconnect();
}
}
}
};
this.imageThread.setDaemon(true);
this.imageThread.start();
}