本文整理汇总了Java中net.minecraftforge.fml.common.FMLLog.bigWarning方法的典型用法代码示例。如果您正苦于以下问题:Java FMLLog.bigWarning方法的具体用法?Java FMLLog.bigWarning怎么用?Java FMLLog.bigWarning使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.fml.common.FMLLog
的用法示例。
在下文中一共展示了FMLLog.bigWarning方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addPrefix
import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
/**
* Prefix the supplied name with the current mod id.
* <p/>
* If no mod id can be determined, minecraft will be assumed.
* The prefix is separated with a colon.
* <p/>
* If there's already a prefix, it'll be prefixed again if the new prefix
* doesn't match the old prefix, as used by vanilla calls to addObject.
*
* @param name name to prefix.
* @return prefixed name.
*/
private ResourceLocation addPrefix(String name)
{
int index = name.lastIndexOf(':');
String oldPrefix = index == -1 ? "" : name.substring(0, index);
name = index == -1 ? name : name.substring(index + 1);
String prefix;
ModContainer mc = Loader.instance().activeModContainer();
if (mc != null)
{
prefix = mc.getModId().toLowerCase();
}
else // no mod container, assume minecraft
{
prefix = "minecraft";
}
if (!oldPrefix.equals(prefix) && oldPrefix.length() > 0)
{
FMLLog.bigWarning("Dangerous alternative prefix %s for name %s, invalid registry invocation/invalid name?", prefix, name);
prefix = oldPrefix;
}
return new ResourceLocation(prefix, name);
}
示例2: setRegistryName
import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
public final T setRegistryName(String name)
{
if (getRegistryName() != null)
throw new IllegalStateException("Attempted to set registry name with existing registry name! New: " + name + " Old: " + getRegistryName());
int index = name.lastIndexOf(':');
String oldPrefix = index == -1 ? "" : name.substring(0, index);
name = index == -1 ? name : name.substring(index + 1);
ModContainer mc = Loader.instance().activeModContainer();
String prefix = mc == null || (mc instanceof InjectedModContainer && ((InjectedModContainer)mc).wrappedContainer instanceof FMLContainer) ? "minecraft" : mc.getModId().toLowerCase();
if (!oldPrefix.equals(prefix) && oldPrefix.length() > 0)
{
FMLLog.bigWarning("Dangerous alternative prefix `%s` for name `%s`, expected `%s` invalid registry invocation/invalid name?", oldPrefix, name, prefix);
prefix = oldPrefix;
}
this.registryName = new ResourceLocation(prefix, name);
return (T)this;
}
示例3: getPriority
import net.minecraftforge.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.bigWarning("Unknown recipe class! %s Modders need to register their recipe types with %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, cls.getName());
return ret;
}
}
}
return ret == null ? 0 : ret;
}
示例4: registerFluidContainer
import net.minecraftforge.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.getItem().getUnlocalizedName(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;
}
示例5: putObject
import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
/**
* Register an object on this registry.
*/
@Override
@Deprecated
public void putObject(ResourceLocation name, I thing)
{
if (name == null)
{
throw new NullPointerException("Can't use a null-name for the registry.");
}
if (thing == null)
{
throw new NullPointerException("Can't add null-object to the registry.");
}
ResourceLocation existingName = getNameForObject(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);
}
}
示例6: FluidStack
import net.minecraftforge.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;
}
示例7: reflectImpactTileData
import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
public void reflectImpactTileData(BlockPos pos)
{
// Accessibility flag removes security manager checks that offers a significant performance boost
if (!reflectFlds[0].isAccessible())
{
for (Field f : reflectFlds)
{
f.setAccessible(true);
}
}
try
{
reflectFlds[0].setInt(this, pos.getX());
reflectFlds[1].setInt(this, pos.getY());
reflectFlds[2].setInt(this, pos.getZ());
reflectFlds[3].set(this, this.world.getBlockState(pos).getBlock());
}
catch (Exception ex)
{
if (warningDone)
{
return;
}
FMLLog.bigWarning(
"ExPetrum was unable to reflect some(first 4) fields(expected I,I,I,Lnet.minecraft.block.Block) at EntityThrowable class! \n"
+ "Currently this will not crash your game. /n"
+ "However this is a severe issue most likely caused by one of your coremods! /n"
+ "DO NOT REPORT THIS TO AUTHOR OF EX PERTUM(v0id)! /n"
+ "Find which coremod does this and complain to their author! /n"
+ "Exception was: %s (%s)",
ex.getClass().getName(), ex.getMessage());
warningDone = true;
}
}
示例8: onFingerprintViolation
import net.minecraftforge.fml.common.FMLLog; //导入方法依赖的package包/类
@EventHandler
public void onFingerprintViolation(FMLFingerprintViolationEvent event)
{
FMLLog.bigWarning("Invalid fingerprint detected! The file " + event.getSource().getName() + " may have been tampered with. This version will NOT be supported by Proxy!");
}
示例9: registerOreImpl
import net.minecraftforge.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 ore The ore's ItemStack
*/
private static void registerOreImpl(String name, ItemStack ore)
{
if ("Unknown".equals(name)) return; //prevent bad IDs.
if (ore == null || ore.getItem() == 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);
// HACK: use the registry name's ID. It is unique and it knows about substitutions. Fallback to a -1 value (what Item.getIDForItem would have returned) in the case where the registry is not aware of the item yet
// IT should be noted that -1 will fail the gate further down, if an entry already exists with value -1 for this name. This is what is broken and being warned about.
// APPARENTLY it's quite common to do this. OreDictionary should be considered alongside Recipes - you can't make them properly until you've registered with the game.
ResourceLocation registryName = ore.getItem().delegate.name();
int hash;
if (registryName == null)
{
FMLLog.bigWarning("A broken ore dictionary registration with name %s has occurred. It adds an item (type: %s) which is currently unknown to the game registry. This dictionary item can only support a single value when"
+ " registered with ores like this, and NO I am not going to turn this spam off. Just register your ore dictionary entries after the GameRegistry.\n"
+ "TO USERS: YES this is a BUG in the mod "+Loader.instance().activeModContainer().getName()+" report it to them!", name, ore.getItem().getClass());
hash = -1;
}
else
{
hash = GameData.getItemRegistry().getId(registryName);
}
if (ore.getItemDamage() != WILDCARD_VALUE)
{
hash |= ((ore.getItemDamage() + 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.copy();
idToStack.get(oreID).add(ore);
MinecraftForge.EVENT_BUS.post(new OreRegisterEvent(name, ore));
}