本文整理汇总了Java中cpw.mods.fml.common.FMLLog.warning方法的典型用法代码示例。如果您正苦于以下问题:Java FMLLog.warning方法的具体用法?Java FMLLog.warning怎么用?Java FMLLog.warning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cpw.mods.fml.common.FMLLog
的用法示例。
在下文中一共展示了FMLLog.warning方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerGlobalEntityID
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
public static void registerGlobalEntityID(Class <? extends Entity > entityClass, String entityName, int id, int backgroundEggColour, int foregroundEggColour)
{
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;
}
instance().validateAndClaimId(id);
EntityList.func_75614_a(entityClass, entityName, id, backgroundEggColour, foregroundEggColour);
}
示例2: onTextureLoadPre
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
/**
* This is added for Optifine's convenience. And to explode if a ModMaker is developing.
* @param texture
*/
public static void onTextureLoadPre(String texture)
{
if (Tessellator.renderingWorldRenderer)
{
FMLLog.warning("Warning: Texture %s not preloaded, will cause render glitches!", texture);
if (Tessellator.class.getPackage() != null)
{
if (Tessellator.class.getPackage().getName().startsWith("net.minecraft."))
{
Minecraft mc = FMLClientHandler.instance().getClient();
if (mc.field_71456_v != null)
{
mc.field_71456_v.func_146158_b().func_146227_a(new ChatComponentTranslation("forge.texture.preload.warning", texture));
}
}
}
}
}
示例3: requestPlayerTicket
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
public static Ticket requestPlayerTicket(Object mod, String player, World world, Type type)
{
ModContainer mc = getContainer(mod);
if (mc == 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;
}
if (playerTickets.get(player).size()>playerTicketLength)
{
FMLLog.warning("Unable to assign further chunkloading tickets to player %s (on behalf of mod %s)", player, mc.getModId());
return null;
}
Ticket ticket = new Ticket(mc.getModId(),type,world,player);
playerTickets.put(player, ticket);
tickets.get(world).put("Forge", ticket);
return ticket;
}
示例4: getItem
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
public static ItemStack getItem(String itemString, int meta) {
ItemStack item = null;
try {
String itemClass = "thaumcraft.common.config.ConfigItems";
Object obj = Class.forName(itemClass).getField(itemString).get(null);
if (obj instanceof Item) {
item = new ItemStack((Item) obj, 1, meta);
}
else if (obj instanceof ItemStack) {
item = (ItemStack) obj;
}
}
catch (Exception ex) {
FMLLog.warning("[Thaumcraft] Could not retrieve item identified by: " + itemString);
}
return item;
}
示例5: getBlock
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
public static ItemStack getBlock(String itemString, int meta) {
ItemStack item = null;
try {
String itemClass = "thaumcraft.common.config.ConfigBlocks";
Object obj = Class.forName(itemClass).getField(itemString).get(null);
if (obj instanceof Block) {
item = new ItemStack((Block) obj, 1, meta);
}
else if (obj instanceof ItemStack) {
item = (ItemStack) obj;
}
}
catch (Exception ex) {
FMLLog.warning("[Thaumcraft] Could not retrieve block identified by: " + itemString);
}
return item;
}
示例6: getBaubles
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
public static IInventory getBaubles(final EntityPlayer player) {
IInventory ot = null;
try {
if (BaublesApi.getBaubles == null) {
final Class fake = Class.forName("baubles.common.lib.PlayerHandler");
BaublesApi.getBaubles = fake.getMethod("getPlayerBaubles", EntityPlayer.class);
}
ot = (IInventory)BaublesApi.getBaubles.invoke(null, player);
}
catch (Exception ex) {
FMLLog.warning("[Baubles API] Could not invoke baubles.common.lib.PlayerHandler method getPlayerBaubles", new Object[0]);
}
return ot;
}
示例7: 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();
}
示例8: validateAndClaimId
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
private int validateAndClaimId(int id)
{
// workaround for broken ML
int realId = id;
if (id < Byte.MIN_VALUE)
{
FMLLog.warning("Compensating for modloader out of range compensation by mod : entityId %d for mod %s is now %d", id, Loader.instance().activeModContainer().getModId(), realId);
realId += 3000;
}
if (realId < 0)
{
realId += Byte.MAX_VALUE;
}
try
{
UnsignedBytes.checkedCast(realId);
}
catch (IllegalArgumentException e)
{
FMLLog.log(Level.ERROR, "The entity ID %d for mod %s is not an unsigned byte and may not work", id, Loader.instance().activeModContainer().getModId());
}
if (!availableIndicies.get(realId))
{
FMLLog.severe("The mod %s has attempted to register an entity ID %d which is already reserved. This could cause severe problems", Loader.instance().activeModContainer().getModId(), id);
}
availableIndicies.clear(realId);
return realId;
}
示例9: setBlock
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
public Fluid setBlock(Block block)
{
if (this.block == null || this.block == block)
{
this.block = block;
}
else
{
FMLLog.warning("A mod has attempted to assign Block " + block + " to the Fluid '" + fluidName + "' but this Fluid has already been linked to the Block "
+ this.block + ". You may have duplicate Fluid Blocks as a result. It *may* be possible to configure your mods to avoid this.");
}
return this;
}
示例10: setChunkListDepth
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
/**
* The chunk list depth can be manipulated up to the maximal grant allowed for the mod. This value is configurable. Once the maximum is reached,
* the least recently forced chunk, by original registration time, is removed from the forced chunk list.
*
* @param depth The new depth to set
*/
public void setChunkListDepth(int depth)
{
if (depth > getMaxChunkDepthFor(modId) || (depth <= 0 && getMaxChunkDepthFor(modId) > 0))
{
FMLLog.warning("The mod %s tried to modify the chunk ticket depth to: %d, its allowed maximum is: %d", modId, depth, getMaxChunkDepthFor(modId));
}
else
{
this.maxDepth = depth;
}
}
示例11: setForcedChunkLoadingCallback
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
/**
* Set a chunkloading callback for the supplied mod object
*
* @param mod The mod instance registering the callback
* @param callback The code to call back when forced chunks are loaded
*/
public static void setForcedChunkLoadingCallback(Object mod, LoadingCallback callback)
{
ModContainer container = getContainer(mod);
if (container == null)
{
FMLLog.warning("Unable to register a callback for an unknown mod %s (%s : %x)", mod, mod.getClass().getName(), System.identityHashCode(mod));
return;
}
callbacks.put(container.getModId(), callback);
}
示例12: unloadWorlds
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
public static void unloadWorlds(Hashtable<Integer, long[]> worldTickTimes) {
for (int id : unloadQueue) {
WorldServer w = worlds.get(id);
try {
if (w != null)
{
w.func_73044_a(true, null);
}
else
{
FMLLog.warning("Unexpected world unload - world %d is already unloaded", id);
}
} catch (MinecraftException e) {
e.printStackTrace();
}
finally
{
if (w != null)
{
MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(w));
w.func_73041_k();
setWorld(id, null);
}
}
}
unloadQueue.clear();
}
示例13: getEMCProxy
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
/**
* Retrieves the proxy for EMC-based API queries.
*
* @return The proxy for EMC-based API queries
*/
public static IEMCProxy getEMCProxy() {
if (emcProxy == null) {
try {
Class<?> clazz = Class.forName("moze_intel.projecte.impl.EMCProxyImpl");
emcProxy = (IEMCProxy) clazz.getField("instance").get(null);
}
catch (ReflectiveOperationException ex) {
FMLLog.warning("[ProjectEAPI] Error retrieving EMCProxyImpl, ProjectE may be absent, damaged, or outdated.");
}
}
return emcProxy;
}
示例14: getConversionProxy
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
/**
* Retrieves the proxy for EMC-Recipe-Calculation-based API queries.
*
* @return The proxy for EMC-Recipe-Calculation-based API queries
*/
public static IConversionProxy getConversionProxy() {
if (recipeProxy == null) {
try {
Class<?> clazz = Class.forName("moze_intel.projecte.impl.ConversionProxyImpl");
recipeProxy = (IConversionProxy) clazz.getField("instance").get(null);
}
catch (ReflectiveOperationException ex) {
FMLLog.warning("[ProjectEAPI] Error retrieving ConversionProxyImpl, ProjectE may be absent, damaged, or outdated.");
}
}
return recipeProxy;
}
示例15: getTransmutationProxy
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
/**
* Retrieves the proxy for Transmutation-based API queries.
*
* @return The proxy for Transmutation-based API queries
*/
public static ITransmutationProxy getTransmutationProxy() {
if (transProxy == null) {
try {
Class<?> clazz = Class.forName("moze_intel.projecte.impl.TransmutationProxyImpl");
transProxy = (ITransmutationProxy) clazz.getField("instance").get(null);
}
catch (ReflectiveOperationException ex) {
FMLLog.warning("[ProjectEAPI] Error retrieving TransmutationProxyImpl, ProjectE may be absent, damaged, or outdated.");
}
}
return transProxy;
}