本文整理汇总了Java中net.minecraftforge.fml.common.FMLLog.severe方法的典型用法代码示例。如果您正苦于以下问题:Java FMLLog.severe方法的具体用法?Java FMLLog.severe怎么用?Java FMLLog.severe使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.fml.common.FMLLog
的用法示例。
在下文中一共展示了FMLLog.severe方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: completeHandshake
import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
public void completeHandshake(Side target)
{
if (state == ConnectionState.CONNECTED)
{
FMLLog.severe("Attempt to double complete the network connection!");
throw new FMLNetworkException("Attempt to double complete!");
}
if (side == Side.CLIENT)
{
completeClientSideConnection(ConnectionType.MODDED);
}
else
{
this.state = ConnectionState.FINALIZING; //Delay and finalize in the world tick loop.
}
}
示例2: processPacket
import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
/**
* Passes this Packet on to the NetHandler for processing.
*/
@Override
public void processPacket(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 occurred, this connection is terminated");
}
}
}
示例3: createRegistry
import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
private <T extends IForgeRegistryEntry<T>> FMLControlledNamespacedRegistry<T> createRegistry(ResourceLocation registryName, Class<T> type, ResourceLocation defaultObjectKey, int minId, int maxId, IForgeRegistry.AddCallback<T> addCallback, IForgeRegistry.ClearCallback<T> clearCallback, IForgeRegistry.CreateCallback<T> createCallback, IForgeRegistry.SubstitutionCallback<T> substitutionCallback)
{
Set<Class<?>> parents = Sets.newHashSet();
findSuperTypes(type, parents);
SetView<Class<?>> overlappedTypes = Sets.intersection(parents, registrySuperTypes.keySet());
if (!overlappedTypes.isEmpty())
{
Class<?> foundType = overlappedTypes.iterator().next();
FMLLog.severe("Found existing registry of type %1s named %2s, you cannot create a new registry (%3s) with type %4s, as %4s has a parent of that type", foundType, registrySuperTypes.get(foundType), registryName, type);
throw new IllegalArgumentException("Duplicate registry parent type found - you can only have one registry for a particular super type");
}
FMLControlledNamespacedRegistry<T> fmlControlledNamespacedRegistry = new FMLControlledNamespacedRegistry<T>(defaultObjectKey, minId, maxId, type, registries, addCallback, clearCallback, createCallback, substitutionCallback);
registries.put(registryName, fmlControlledNamespacedRegistry);
registrySuperTypes.put(type, registryName);
return getRegistry(registryName, type);
}
示例4: addSubstitutionAlias
import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
void addSubstitutionAlias(String modId, ResourceLocation nameToReplace, I replacement) throws ExistingSubstitutionException
{
if (getPersistentSubstitutions().containsKey(nameToReplace) || getPersistentSubstitutions().containsValue(replacement))
{
FMLLog.severe("The substitution of %s has already occurred. You cannot duplicate substitutions", nameToReplace);
throw new ExistingSubstitutionException(nameToReplace, replacement);
}
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");
}
FMLLog.log(Level.DEBUG, "Adding substitution %s with %s (name %s)", original, replacement, nameToReplace);
getPersistentSubstitutions().put(nameToReplace, replacement);
}
示例5: bake
import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
@Override
public IBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter)
{
ImmutableMap.Builder<String, TextureAtlasSprite> builder = ImmutableMap.builder();
builder.put(ModelLoader.White.LOCATION.toString(), ModelLoader.White.INSTANCE);
TextureAtlasSprite missing = bakedTextureGetter.apply(new ResourceLocation("missingno"));
for (Map.Entry<String, Material> e : matLib.materials.entrySet())
{
if (e.getValue().getTexture().getTextureLocation().getResourcePath().startsWith("#"))
{
FMLLog.severe("OBJLoader: Unresolved texture '%s' for obj model '%s'", e.getValue().getTexture().getTextureLocation().getResourcePath(), modelLocation);
builder.put(e.getKey(), missing);
}
else
{
builder.put(e.getKey(), bakedTextureGetter.apply(e.getValue().getTexture().getTextureLocation()));
}
}
builder.put("missingno", missing);
return new OBJBakedModel(this, state, format, builder.build());
}
示例6: bake
import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
@Override
public IBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter)
{
ImmutableMap.Builder<String, TextureAtlasSprite> builder = ImmutableMap.builder();
TextureAtlasSprite missing = bakedTextureGetter.apply(new ResourceLocation("missingno"));
for(Map.Entry<String, ResourceLocation> e : textures.entrySet())
{
if(e.getValue().getResourcePath().startsWith("#"))
{
FMLLog.severe("unresolved texture '%s' for b3d model '%s'", e.getValue().getResourcePath(), modelLocation);
builder.put(e.getKey(), missing);
}
else
{
builder.put(e.getKey(), bakedTextureGetter.apply(e.getValue()));
}
}
builder.put("missingno", missing);
return new BakedWrapper(model.getRoot(), state, smooth, gui3d, format, meshes, builder.build());
}
示例7: getSlabItem
import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
private Item getSlabItem() {
if (this.slabItem == null) {
FMLLog.severe("getting item for slab: %s, %s", this.getRegistryName().getResourceDomain(), this.wood.getName() + "_slab");
this.slabItem = Item.REGISTRY.getObject(new ResourceLocation(this.getRegistryName().getResourceDomain(), this.wood.getName() + "_slab"));
}
return this.slabItem;
}
示例8: testMessageValidity
import net.minecraftforge.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");
}
}
示例9: explore
import net.minecraftforge.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("Visiting 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);
}
示例10: register
import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
@Override
public void register(I value)
{
ResourceLocation key = value.getRegistryName();
if (key == null)
{
FMLLog.severe("Attempted to register a entry with a null name: %s", value);
throw new NullPointerException(String.format("Attempted to register a entry with a null name: %s", value));
}
add(-1, key, value);
}
示例11: preDraw
import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
public static void preDraw(EnumUsage attrType, VertexFormat format, int element, int stride, ByteBuffer buffer)
{
VertexFormatElement attr = format.getElement(element);
int count = attr.getElementCount();
int constant = attr.getType().getGlConstant();
buffer.position(format.getOffset(element));
switch(attrType)
{
case POSITION:
glVertexPointer(count, constant, stride, buffer);
glEnableClientState(GL_VERTEX_ARRAY);
break;
case NORMAL:
if(count != 3)
{
throw new IllegalArgumentException("Normal attribute should have the size 3: " + attr);
}
glNormalPointer(constant, stride, buffer);
glEnableClientState(GL_NORMAL_ARRAY);
break;
case COLOR:
glColorPointer(count, constant, stride, buffer);
glEnableClientState(GL_COLOR_ARRAY);
break;
case UV:
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + attr.getIndex());
glTexCoordPointer(count, constant, stride, buffer);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
break;
case PADDING:
break;
case GENERIC:
glEnableVertexAttribArray(attr.getIndex());
glVertexAttribPointer(attr.getIndex(), count, constant, false, stride, buffer);
default:
FMLLog.severe("Unimplemented vanilla attribute upload: %s", attrType.getDisplayName());
}
}
示例12: postDraw
import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
public static void postDraw(EnumUsage attrType, VertexFormat format, int element, int stride, ByteBuffer buffer)
{
VertexFormatElement attr = format.getElement(element);
switch(attrType)
{
case POSITION:
glDisableClientState(GL_VERTEX_ARRAY);
break;
case NORMAL:
glDisableClientState(GL_NORMAL_ARRAY);
break;
case COLOR:
glDisableClientState(GL_COLOR_ARRAY);
// is this really needed?
GlStateManager.resetColor();
break;
case UV:
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + attr.getIndex());
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
break;
case PADDING:
break;
case GENERIC:
glDisableVertexAttribArray(attr.getIndex());
default:
FMLLog.severe("Unimplemented vanilla attribute upload: %s", attrType.getDisplayName());
}
}
示例13: getLocation
import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
private ModelResourceLocation getLocation(String json)
{
JsonElement e = new JsonParser().parse(json);
if(e.isJsonPrimitive() && e.getAsJsonPrimitive().isString())
{
return new ModelResourceLocation(e.getAsString());
}
FMLLog.severe("Expect ModelResourceLocation, got: ", json);
return new ModelResourceLocation("builtin/missing", "missing");
}
示例14: process
import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
@Override
public ModelFluid process(ImmutableMap<String, String> customData)
{
if(!customData.containsKey("fluid")) return this;
String fluidStr = customData.get("fluid");
JsonElement e = new JsonParser().parse(fluidStr);
String fluid = e.getAsString();
if(!FluidRegistry.isFluidRegistered(fluid))
{
FMLLog.severe("fluid '%s' not found", fluid);
return WATER;
}
return new ModelFluid(FluidRegistry.getFluid(fluid));
}
示例15: requestTicket
import net.minecraftforge.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;
}