本文整理汇总了Java中cpw.mods.fml.common.FMLLog.bigWarning方法的典型用法代码示例。如果您正苦于以下问题:Java FMLLog.bigWarning方法的具体用法?Java FMLLog.bigWarning怎么用?Java FMLLog.bigWarning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cpw.mods.fml.common.FMLLog
的用法示例。
在下文中一共展示了FMLLog.bigWarning方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: FluidStack
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
public FluidStack(Fluid fluid, int amount)
{
if (fluid == null)
{
FMLLog.bigWarning("Null fluid supplied to fluidstack. Did you try and create a stack for an unregistered fluid?");
throw new IllegalArgumentException("Cannot create a fluidstack from a null fluid");
}
else if (!FluidRegistry.isFluidRegistered(fluid))
{
FMLLog.bigWarning("Failed attempt to create a FluidStack for an unregistered Fluid %s (type %s)", fluid.getName(), fluid.getClass().getName());
throw new IllegalArgumentException("Cannot create a fluidstack from an unregistered fluid");
}
this.fluidDelegate = FluidRegistry.makeDelegate(fluid);
this.amount = amount;
this.fluid = fluid;
}
示例2: registerFluidContainer
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
/**
* Register a new fluid containing item.
*
* @param data
* See {@link FluidContainerData}.
* @return True if container was successfully registered; false if it already is, or an invalid parameter was passed.
*/
public static boolean registerFluidContainer(FluidContainerData data)
{
if (isFilledContainer(data.filledContainer) || data.filledContainer == null)
{
return false;
}
if (data.fluid == null || data.fluid.getFluid() == null)
{
FMLLog.bigWarning("Invalid registration attempt for a fluid container item %s has occurred. The registration has been denied to prevent crashes. The mod responsible for the registration needs to correct this.", data.filledContainer.func_77973_b().func_77667_c(data.filledContainer));
return false;
}
containerFluidMap.put(new ContainerKey(data.filledContainer), data);
if (data.emptyContainer != null && data.emptyContainer != NULL_EMPTYCONTAINER)
{
filledContainerMap.put(new ContainerKey(data.emptyContainer, data.fluid), data);
emptyContainers.add(new ContainerKey(data.emptyContainer));
}
MinecraftForge.EVENT_BUS.post(new FluidContainerRegisterEvent(data));
return true;
}
示例3: registerItem
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
int registerItem(Item item, String name) // from GameRegistry
{
int index = name.indexOf(':');
if (name.indexOf(':') != -1) FMLLog.bigWarning("Illegal extra prefix %s for name %s, invalid registry invocation/invalid name?", name.substring(0, index), name);
name = addPrefix(name);
return registerItem(item, name, -1);
}
示例4: registerBlock
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
int registerBlock(Block block, String name) // from GameRegistry
{
int index = name.indexOf(':');
if (name.indexOf(':') != -1) FMLLog.bigWarning("Illegal extra prefix %s for name %s, invalid registry invocation/invalid name?", name.substring(0, index), name);
name = addPrefix(name);
return registerBlock(block, name, -1);
}
示例5: verifyItemBlockName
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
private void verifyItemBlockName(ItemBlock item)
{
String blockName = iBlockRegistry.func_148750_c(item.field_150939_a);
String itemName = iItemRegistry.func_148750_c(item);
if (blockName != null && !blockName.equals(itemName))
{
FMLLog.bigWarning("Block <-> ItemBlock name mismatch, block name %s, item name %s", blockName, itemName);
}
}
示例6: func_82595_a
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
/**
* DANGEROUS! EVIL! DO NOT USE!
*
* @deprecated register through {@link GameRegistry} instead.
*/
@Override
@Deprecated
public void func_82595_a(Object objName, Object obj)
{
String name = (String) objName;
I thing = cast(obj);
if (name == null) throw new NullPointerException("Can't use a null-name for the registry.");
if (name.isEmpty()) throw new IllegalArgumentException("Can't use an empty name for the registry.");
if (thing == null) throw new NullPointerException("Can't add null-object to the registry.");
name = func_148755_c(name);
String existingName = func_148750_c(thing);
if (existingName == null)
{
FMLLog.bigWarning("Ignoring putObject(%s, %s), not resolvable", name, thing);
}
else if (existingName.equals(name))
{
FMLLog.bigWarning("Ignoring putObject(%s, %s), already added", name, thing);
}
else
{
FMLLog.bigWarning("Ignoring putObject(%s, %s), adding alias to %s instead", name, thing, existingName);
addAlias(name, existingName);
}
}
示例7: registerOreImpl
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
/**
* Registers a ore item into the dictionary.
* Raises the registerOre function in all registered handlers.
*
* @param name The name of the ore
* @param id The ID of the ore
* @param ore The ore's ItemStack
*/
private static void registerOreImpl(String name, ItemStack ore)
{
if (name == null || name.isEmpty() || "Unknown".equals(name)) return; //prevent bad IDs.
if (ore == null || ore.func_77973_b() == null)
{
FMLLog.bigWarning("Invalid registration attempt for an Ore Dictionary item with name %s has occurred. The registration has been denied to prevent crashes. The mod responsible for the registration needs to correct this.", name);
return; //prevent bad ItemStacks.
}
int oreID = getOreID(name);
int hash = Item.func_150891_b(ore.func_77973_b());
if (ore.func_77960_j() != WILDCARD_VALUE)
{
hash |= ((ore.func_77960_j() + 1) << 16); // +1 so 0 is significant
}
//Add things to the baked version, and prevent duplicates
List<Integer> ids = stackToId.get(hash);
if (ids != null && ids.contains(oreID)) return;
if (ids == null)
{
ids = Lists.newArrayList();
stackToId.put(hash, ids);
}
ids.add(oreID);
//Add to the unbaked version
ore = ore.func_77946_l();
idToStack.get(oreID).add(ore);
MinecraftForge.EVENT_BUS.post(new OreRegisterEvent(name, ore));
}
示例8: add
import cpw.mods.fml.common.FMLLog; //导入方法依赖的package包/类
/**
* Add the specified object to the registry.
*
* @param id ID to use if available, auto-assigned otherwise.
* @param name Name to use, prefixed by the mod id.
* @param thing Object to add.
* @param availabilityMap Map marking available IDs for auto assignment.
* @return ID eventually allocated.
*/
int add(int id, String name, I thing, BitSet availabilityMap)
{
if (name == null) throw new NullPointerException(String.format("Can't use a null-name for the registry, object %s.", thing));
if (name.isEmpty()) throw new IllegalArgumentException(String.format("Can't use an empty name for the registry, object %s.", thing));
if (name.indexOf(':') == -1) throw new IllegalArgumentException(String.format("Can't add the name (%s) without a prefix, object %s", name, thing));
if (thing == null) throw new NullPointerException(String.format("Can't add null-object to the registry, name %s.", name));
if (name.equals(optionalDefaultName) && this.optionalDefaultObject == null)
{
this.optionalDefaultObject = thing;
}
if (getPersistentSubstitutions().containsValue(thing))
{
throw new IllegalArgumentException(String.format("The object %s (%s) cannot be added to the registry. It is already being used as a substitute for %s", thing.getClass(), name, getPersistentSubstitutions().inverse().get(thing)));
}
int idToUse = id;
if (idToUse < 0 || availabilityMap.get(idToUse))
{
idToUse = availabilityMap.nextClearBit(minId);
}
if (idToUse > maxId)
{
throw new RuntimeException(String.format("Invalid id %d - maximum id range exceeded.", idToUse));
}
if (getRaw(name) == thing) // already registered, return prev registration's id
{
FMLLog.bigWarning("The object %s has been registered twice for the same name %s.", thing, name);
return getId(thing);
}
if (getRaw(name) != null) // duplicate name
{
throw new IllegalArgumentException(String.format("The name %s has been registered twice, for %s and %s.", name, getRaw(name), thing));
}
if (getId(thing) >= 0) // duplicate object - but only if it's not being substituted
{
int foundId = getId(thing);
Object otherThing = getRaw(foundId);
throw new IllegalArgumentException(String.format("The object %s{%x} has been registered twice, using the names %s and %s. (Other object at this id is %s{%x})", thing, System.identityHashCode(thing), func_148750_c(thing), name, otherThing, System.identityHashCode(otherThing)));
}
if (GameData.isFrozen(this))
{
FMLLog.bigWarning("The object %s (name %s) is being added too late.", thing, name);
}
if (activeSubstitutions.containsKey(name))
{
thing = activeSubstitutions.get(name);
}
addObjectRaw(idToUse, name, thing);
if (DEBUG)
FMLLog.finer("Registry add: %s %d %s (req. id %d)", name, idToUse, thing, id);
return idToUse;
}