本文整理汇总了Java中cpw.mods.fml.common.FMLLog.severe方法的典型用法代码示例。如果您正苦于以下问题:Java FMLLog.severe方法的具体用法?Java FMLLog.severe怎么用?Java FMLLog.severe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cpw.mods.fml.common.FMLLog
的用法示例。
在下文中一共展示了FMLLog.severe方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: syncConfig
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
public static void syncConfig()
{
try
{
ConfigManagerMicCore.enableSmallMoons = ConfigManagerMicCore.configuration.get(Configuration.CATEGORY_GENERAL, "Enable Small Moons", true, "This will cause some dimensions to appear round, disable if render transformations cause a conflict.").getBoolean(true);
ConfigManagerMicCore.enableDebug = ConfigManagerMicCore.configuration.get(Configuration.CATEGORY_GENERAL, "Enable Debug messages", false, "Enable debug messages during Galacticraft bytecode injection at startup.").getBoolean(false);
}
catch (final Exception e)
{
FMLLog.severe("Problem loading core config (\"miccore.conf\")");
}
finally
{
if (ConfigManagerMicCore.configuration.hasChanged())
{
ConfigManagerMicCore.configuration.save();
}
ConfigManagerMicCore.loaded = true;
}
}
示例2: registerGlobalEntityID
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
public static void registerGlobalEntityID(Class <? extends Entity > entityClass, String entityName, int id)
{
if (EntityList.field_75626_c.containsKey(entityClass))
{
ModContainer activeModContainer = Loader.instance().activeModContainer();
String modId = "unknown";
if (activeModContainer != null)
{
modId = activeModContainer.getModId();
}
else
{
FMLLog.severe("There is a rogue mod failing to register entities from outside the context of mod loading. This is incredibly dangerous and should be stopped.");
}
FMLLog.warning("The mod %s tried to register the entity class %s which was already registered - if you wish to override default naming for FML mod entities, register it here first", modId, entityClass);
return;
}
id = instance().validateAndClaimId(id);
EntityList.func_75618_a(entityClass, entityName, id);
}
示例3: addSubstitutionAlias
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
void addSubstitutionAlias(String modId, String nameToReplace, Object toReplace) throws ExistingSubstitutionException {
if (getPersistentSubstitutions().containsKey(nameToReplace) || getPersistentSubstitutions().containsValue(toReplace))
{
FMLLog.severe("The substitution of %s has already occured. You cannot duplicate substitutions", nameToReplace);
throw new ExistingSubstitutionException(nameToReplace, toReplace);
}
I replacement = cast(toReplace);
I original = getRaw(nameToReplace);
if (original == null)
{
throw new NullPointerException("The replacement target is not present. This won't work");
}
if (!original.getClass().isAssignableFrom(replacement.getClass()))
{
FMLLog.severe("The substitute %s for %s (type %s) is type incompatible. This won't work", replacement.getClass().getName(), nameToReplace, original.getClass().getName());
throw new IncompatibleSubstitutionException(nameToReplace, replacement, original);
}
int existingId = getId(replacement);
if (existingId != -1)
{
FMLLog.severe("The substitute %s for %s is registered into the game independently. This won't work", replacement.getClass().getName(), nameToReplace);
throw new IllegalArgumentException("The object substitution is already registered. This won't work");
}
getPersistentSubstitutions().put(nameToReplace, replacement);
}
示例4: loadModel
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
/**
* Load the model from the supplied classpath resolvable resource name
* @param resource The resource name
* @return A model
* @throws IllegalArgumentException if the resource name cannot be understood
* @throws ModelFormatException if the underlying model handler cannot parse the model format
*/
public static IModelCustom loadModel(ResourceLocation resource) throws IllegalArgumentException, ModelFormatException
{
String name = resource.func_110623_a();
int i = name.lastIndexOf('.');
if (i == -1)
{
FMLLog.severe("The resource name %s is not valid", resource);
throw new IllegalArgumentException("The resource name is not valid");
}
String suffix = name.substring(i+1);
IModelCustomLoader loader = instances.get(suffix);
if (loader == null)
{
FMLLog.severe("The resource name %s is not supported", resource);
throw new IllegalArgumentException("The resource name is not supported");
}
return loader.loadInstance(resource);
}
示例5: refresh
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
/**
* This function is called to refresh all conductors in this network
*/
@Override
public void refresh()
{
this.hydrogenTiles.clear();
try
{
Iterator<ITransmitter> it = this.pipes.iterator();
while (it.hasNext())
{
ITransmitter transmitter = it.next();
if (transmitter == null)
{
it.remove();
continue;
}
transmitter.onNetworkChanged();
if (((TileEntity) transmitter).isInvalid() || ((TileEntity) transmitter).getWorldObj() == null)
{
it.remove();
continue;
}
else
{
transmitter.setNetwork(this);
}
}
}
catch (Exception e)
{
FMLLog.severe("Failed to refresh hydrogen pipe network.");
e.printStackTrace();
}
}
示例6: refreshHydrogenTiles
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
public void refreshHydrogenTiles()
{
try
{
Iterator<ITransmitter> it = this.pipes.iterator();
while (it.hasNext())
{
ITransmitter transmitter = it.next();
if (transmitter == null || ((TileEntity) transmitter).isInvalid() || ((TileEntity) transmitter).getWorldObj() == null)
{
it.remove();
continue;
}
/* if (!(((TileEntity) transmitter).getWorldObj().getBlock(((TileEntity) transmitter).xCoord, ((TileEntity) transmitter).yCoord, ((TileEntity) transmitter).zCoord) instanceof BlockTransmitter))
{
it.remove();
continue;
}
*/
for (int i = 0; i < transmitter.getAdjacentConnections().length; i++)
{
TileEntity acceptor = transmitter.getAdjacentConnections()[i];
if (!(acceptor instanceof ITransmitter) && acceptor instanceof IConnector)
{
this.hydrogenTiles.put(acceptor, ForgeDirection.getOrientation(i));
}
}
}
}
catch (Exception e)
{
FMLLog.severe("Failed to refresh hydrogen pipe network.");
e.printStackTrace();
}
}
示例7: preinit
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
@EventHandler
public void preinit(FMLPreInitializationEvent event)
{
Configuration config = null;
File cfgFile = event.getSuggestedConfigurationFile();
try {
config = new Configuration(cfgFile);
isOcean = config.getBoolean("is ocean", "general", true, "Enabling this will cause the overworld to be an ocean world");
instantDrown = config.getBoolean("instant drown", "general", true, "Enabling this will cause you to drown instantly when you run out of air bubbles");
//treasureItems = config.getStringList("items", "treasure", new String[] {"minecraft:gold_nugget:0=50,1:4", "minecraft:melon_seeds:0=10,1:10", "minecraft:gold_ingot:0=10,1:2", "minecraft:golden_apple:0=10,1:1"}, "List of items to use in treasure generation. Use this format: modid:itemName:metaId=weight,qtyMin:qtyMax");
} catch(Exception e) {
FMLLog.severe("[EvilOcean] Error loading config, deleting file and resetting");
e.printStackTrace();
if(cfgFile.exists()) {
cfgFile.delete();
}
config = new Configuration(cfgFile);
}
if(config.hasChanged()) {
config.save();
}
generators.put("raft", new RaftPlatform());
MinecraftForge.EVENT_BUS.register(this);
}
示例8: forceChunk
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
/**
* Force the supplied chunk coordinate to be loaded by the supplied ticket. If the ticket's {@link Ticket#maxDepth} is exceeded, the least
* recently registered chunk is unforced and may be unloaded.
* It is safe to force the chunk several times for a ticket, it will not generate duplication or change the ordering.
*
* @param ticket The ticket registering the chunk
* @param chunk The chunk to force
*/
public static void forceChunk(Ticket ticket, ChunkCoordIntPair chunk)
{
if (ticket == null || chunk == null)
{
return;
}
if (ticket.ticketType == Type.ENTITY && ticket.entity == null)
{
throw new RuntimeException("Attempted to use an entity ticket to force a chunk, without an entity");
}
if (ticket.isPlayerTicket() ? !playerTickets.containsValue(ticket) : !tickets.get(ticket.world).containsEntry(ticket.modId, ticket))
{
FMLLog.severe("The mod %s attempted to force load a chunk with an invalid ticket. This is not permitted.", ticket.modId);
return;
}
ticket.requestedChunks.add(chunk);
MinecraftForge.EVENT_BUS.post(new ForceChunkEvent(ticket, chunk));
ImmutableSetMultimap<ChunkCoordIntPair, Ticket> newMap = ImmutableSetMultimap.<ChunkCoordIntPair,Ticket>builder().putAll(forcedChunks.get(ticket.world)).put(chunk, ticket).build();
forcedChunks.put(ticket.world, newMap);
if (ticket.maxDepth > 0 && ticket.requestedChunks.size() > ticket.maxDepth)
{
ChunkCoordIntPair removed = ticket.requestedChunks.iterator().next();
unforceChunk(ticket,removed);
}
}
示例9: Configuration
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
/**
* Create a configuration file for the file given in parameter with the provided config version number.
*/
public Configuration(File file, String configVersion)
{
this.file = file;
this.definedConfigVersion = configVersion;
String basePath = ((File)(FMLInjectionData.data()[6])).getAbsolutePath().replace(File.separatorChar, '/').replace("/.", "");
String path = file.getAbsolutePath().replace(File.separatorChar, '/').replace("/./", "/").replace(basePath, "");
if (PARENT != null)
{
PARENT.setChild(path, this);
isChild = true;
}
else
{
fileName = path;
try
{
load();
}
catch (Throwable e)
{
File fileBak = new File(file.getAbsolutePath() + "_" +
new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()) + ".errored");
FMLLog.severe("An exception occurred while loading config file %s. This file will be renamed to %s " +
"and a new config file will be generated.", file.getName(), fileBak.getName());
e.printStackTrace();
file.renameTo(fileBak);
load();
}
}
}
示例10: setupCapes
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
public static void setupCapes()
{
try
{
ClientProxyCore.updateCapeList();
}
catch (Exception e)
{
FMLLog.severe("Error while setting up Galacticraft donor capes");
e.printStackTrace();
}
/**
if (Loader.isModLoaded("CoFHCore"))
{
for (Entry<String, String> e : ClientProxyCore.capeMap.entrySet())
{
try
{
Object capeRegistry = Class.forName("cofh.api.core.RegistryAccess").getField("capeRegistry").get(null);
Class.forName("cofh.api.core.ISimpleRegistry").getMethod("register", String.class, String.class).invoke(capeRegistry, e.getKey(), e.getValue());
}
catch (Exception e1)
{
e1.printStackTrace();
break;
}
}
}
**/
}
示例11: onLivingUpdate
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
@Override
public void onLivingUpdate()
{
ClientProxyCore.playerClientHandler.onLivingUpdatePre(this);
try {
super.onLivingUpdate();
} catch (RuntimeException e)
{
FMLLog.severe("A mod has crashed while Minecraft was doing a normal player tick update. See details below. GCEntityClientPlayerMP is in this because that is the player class name when Galacticraft is installed. This is =*NOT*= a bug in Galacticraft, please report it to the mod indicated by the first lines of the crash report.");
throw (e);
}
ClientProxyCore.playerClientHandler.onLivingUpdatePost(this);
}
示例12: requestTicket
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
/**
* Request a chunkloading ticket of the appropriate type for the supplied mod
*
* @param mod The mod requesting a ticket
* @param world The world in which it is requesting the ticket
* @param type The type of ticket
* @return A ticket with which to register chunks for loading, or null if no further tickets are available
*/
public static Ticket requestTicket(Object mod, World world, Type type)
{
ModContainer container = getContainer(mod);
if (container == null)
{
FMLLog.log(Level.ERROR, "Failed to locate the container for mod instance %s (%s : %x)", mod, mod.getClass().getName(), System.identityHashCode(mod));
return null;
}
String modId = container.getModId();
if (!callbacks.containsKey(modId))
{
FMLLog.severe("The mod %s has attempted to request a ticket without a listener in place", modId);
throw new RuntimeException("Invalid ticket request");
}
int allowedCount = getMaxTicketLengthFor(modId);
if (tickets.get(world).get(modId).size() >= allowedCount)
{
if (!warnedMods.contains(modId))
{
FMLLog.info("The mod %s has attempted to allocate a chunkloading ticket beyond it's currently allocated maximum : %d", modId, allowedCount);
warnedMods.add(modId);
}
return null;
}
Ticket ticket = new Ticket(modId, type, world);
tickets.get(world).put(modId, ticket);
return ticket;
}
示例13: func_148833_a
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
@Override
public void func_148833_a(INetHandler inethandler)
{
this.netHandler = inethandler;
EmbeddedChannel internalChannel = NetworkRegistry.INSTANCE.getChannel(this.channel, this.target);
if (internalChannel != null)
{
internalChannel.attr(NetworkRegistry.NET_HANDLER).set(this.netHandler);
try
{
if (internalChannel.writeInbound(this))
{
badPackets.add(this.channel);
if (badPackets.size() % packetCountWarning == 0)
{
FMLLog.severe("Detected ongoing potential memory leak. %d packets have leaked. Top offenders", badPackets.size());
int i = 0;
for (Entry<String> s : Multisets.copyHighestCountFirst(badPackets).entrySet())
{
if (i++ > 10) break;
FMLLog.severe("\t %s : %d", s.getElement(), s.getCount());
}
}
}
internalChannel.inboundMessages().clear();
}
catch (FMLNetworkException ne)
{
FMLLog.log(Level.ERROR, ne, "There was a network exception handling a packet on channel %s", channel);
dispatcher.rejectHandshake(ne.getMessage());
}
catch (Throwable t)
{
FMLLog.log(Level.ERROR, t, "There was a critical exception handling a packet on channel %s", channel);
dispatcher.rejectHandshake("A fatal error has occured, this connection is terminated");
}
}
}
示例14: testMessageValidity
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
@Override
protected void testMessageValidity(FMLProxyPacket msg)
{
if (msg.payload().getByte(0) == 0 && msg.payload().readableBytes() > 2)
{
FMLLog.severe("The connection appears to have sent an invalid FML packet of type 0, this is likely because it think's it's talking to 1.6.4 FML");
FMLLog.info("Bad data :");
for (String l : Splitter.on('\n').split(ByteBufUtils.getContentDump(msg.payload()))) {
FMLLog.info("\t%s",l);
}
throw new FMLNetworkException("Invalid FML packet");
}
}
示例15: explore
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
public static <T> void explore(T node, DirectedGraph<T> graph, List<T> sortedResult, Set<T> visitedNodes, Set<T> expandedNodes)
{
// Have we been here before?
if (visitedNodes.contains(node))
{
// And have completed this node before
if (expandedNodes.contains(node))
{
// Then we're fine
return;
}
FMLLog.severe("Mod Sorting failed.");
FMLLog.severe("Visting node %s", node);
FMLLog.severe("Current sorted list : %s", sortedResult);
FMLLog.severe("Visited set for this node : %s", visitedNodes);
FMLLog.severe("Explored node set : %s", expandedNodes);
SetView<T> cycleList = Sets.difference(visitedNodes, expandedNodes);
FMLLog.severe("Likely cycle is in : %s", cycleList);
throw new ModSortingException("There was a cycle detected in the input graph, sorting is not possible", node, cycleList);
}
// Visit this node
visitedNodes.add(node);
// Recursively explore inbound edges
for (T inbound : graph.edgesFrom(node))
{
explore(inbound, graph, sortedResult, visitedNodes, expandedNodes);
}
// Add ourselves now
sortedResult.add(node);
// And mark ourselves as explored
expandedNodes.add(node);
}