本文整理汇总了Java中cpw.mods.fml.common.LoaderException类的典型用法代码示例。如果您正苦于以下问题:Java LoaderException类的具体用法?Java LoaderException怎么用?Java LoaderException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LoaderException类属于cpw.mods.fml.common包,在下文中一共展示了LoaderException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setBlock
import cpw.mods.fml.common.LoaderException; //导入依赖的package包/类
public Fluid setBlock(Block block)
{
if (this.block == null || this.block == block)
{
this.block = block;
}
else if (!ForgeModContainer.forceDuplicateFluidBlockCrash)
{
FMLLog.warning("A mod has attempted to assign Block " + block + " to the Fluid '" + fluidName + "' but this Fluid has already been linked to BlockID "
+ this.block + ". Configure your mods to prevent this from happening.");
}
else
{
FMLLog.severe("A mod has attempted to assign BlockID " + block + " to the Fluid '" + fluidName + "' but this Fluid has already been linked to BlockID "
+ this.block + ". Configure your mods to prevent this from happening.");
throw new LoaderException(new RuntimeException("A mod has attempted to assign BlockID " + block + " to the Fluid '" + fluidName
+ "' but this Fluid has already been linked to BlockID " + this.block + ". Configure your mods to prevent this from happening."));
}
return this;
}
示例2: setName
import cpw.mods.fml.common.LoaderException; //导入依赖的package包/类
public void setName(String name, String modId)
{
if (name == null)
{
this.forcedName = null;
this.forcedModId = null;
return;
}
String localModId = modId;
if (modId == null)
{
localModId = Loader.instance().activeModContainer().getModId();
}
if (modOrdinals.get(localModId).count(name)>0)
{
FMLLog.severe("The mod %s is attempting to redefine the item at id %d with a non-unique name (%s.%s)", Loader.instance().activeModContainer(), itemId, localModId, name);
throw new LoaderException();
}
modOrdinals.get(localModId).add(name);
this.forcedModId = modId;
this.forcedName = name;
}
示例3: setBlockID
import cpw.mods.fml.common.LoaderException; //导入依赖的package包/类
public Fluid setBlockID(int blockID)
{
if (this.blockID == -1 || this.blockID == blockID)
{
this.blockID = blockID;
}
else if (!ForgeDummyContainer.forceDuplicateFluidBlockCrash)
{
FMLLog.warning("A mod has attempted to assign BlockID " + blockID + " to the Fluid '" + fluidName + "' but this Fluid has already been linked to BlockID "
+ this.blockID + ". Configure your mods to prevent this from happening.");
}
else
{
FMLLog.severe("A mod has attempted to assign BlockID " + blockID + " to the Fluid '" + fluidName + "' but this Fluid has already been linked to BlockID "
+ this.blockID + ". Configure your mods to prevent this from happening.");
throw new LoaderException(new RuntimeException("A mod has attempted to assign BlockID " + blockID + " to the Fluid '" + fluidName
+ "' but this Fluid has already been linked to BlockID " + this.blockID + ". Configure your mods to prevent this from happening."));
}
return this;
}
示例4: registerFluidContainers
import cpw.mods.fml.common.LoaderException; //导入依赖的package包/类
public static void registerFluidContainers(Class<? extends Catalog> catalogClass) {
Field[] fields = catalogClass.getFields();
for (Field field : fields) {
try {
Object value = field.get(null);
if (value instanceof IFluidBlock) {
IFluidBlock block = (IFluidBlock)value;
if (!block.getFluid().isGaseous()) {
registerBucket(block);
registerFlask(block.getFluid());
}
}
} catch (Exception e) {
throw new LoaderException(e);
}
}
}
示例5: identifyMods
import cpw.mods.fml.common.LoaderException; //导入依赖的package包/类
public List<ModContainer> identifyMods()
{
List<ModContainer> modList = Lists.newArrayList();
for (ModCandidate candidate : candidates)
{
try
{
List<ModContainer> mods = candidate.explore(dataTable);
if (mods.isEmpty() && !candidate.isClasspath())
{
nonModLibs.add(candidate.getModContainer());
}
else
{
modList.addAll(mods);
}
}
catch (LoaderException le)
{
FMLLog.log(Level.WARN, le, "Identified a problem with the mod candidate %s, ignoring this source", candidate.getModContainer());
}
catch (Throwable t)
{
Throwables.propagate(t);
}
}
return modList;
}
示例6: ASMModParser
import cpw.mods.fml.common.LoaderException; //导入依赖的package包/类
public ASMModParser(InputStream stream) throws IOException
{
try
{
ClassReader reader = new ClassReader(stream);
reader.accept(new ModClassVisitor(this), 0);
}
catch (Exception ex)
{
FMLLog.log(Level.ERROR, ex, "Unable to read a class file correctly");
throw new LoaderException(ex);
}
}
示例7: parseRange
import cpw.mods.fml.common.LoaderException; //导入依赖的package包/类
public static VersionRange parseRange(String range)
{
try
{
return VersionRange.createFromVersionSpec(range);
}
catch (InvalidVersionSpecificationException e)
{
FMLLog.log(Level.ERROR, e, "Unable to parse a version range specification successfully %s", range);
throw new LoaderException(e);
}
}
示例8: init
import cpw.mods.fml.common.LoaderException; //导入依赖的package包/类
public static void init() {
if (!isDevEnviroment())
throw new RuntimeException("Can't use SideChecker in a non-deobfuscated enviroment.");
logger.info("Starting SideChecker Routine");
filter = System.getProperty(propFilter);
crashOnWarning = System.getProperty(propCrashWarning) != null;
crashOnSeriousError = crashOnWarning || (System.getProperty(propCrashError) != null);
String altName = System.getProperty(propClientSafeAnnotation);
if (altName != null) {
clientSafeName = 'L' + altName.replace('.', '/') + ';';
}
files = new ArrayList<File>();
List<URL> urls = classLoader.getSources();
File[] sources = new File[urls.size()];
try {
for (int i = 0; i < urls.size(); i++) {
sources[i] = new File(urls.get(i).toURI());
if (sources[i].isDirectory()) files.add(sources[i]);
}
} catch (URISyntaxException e) {
FMLLog.log(Level.ERROR, e, "Unable to process our input to locate the minecraft code");
throw new LoaderException(e);
}
ClassInfo.init();
needsInit = false;
}
示例9: finishMinecraftLoading
import cpw.mods.fml.common.LoaderException; //导入依赖的package包/类
/**
* Called a bit later on during initialization to finish loading mods
* Also initializes key bindings
*
*/
@SuppressWarnings("deprecation")
public void finishMinecraftLoading()
{
if (modsMissing != null || wrongMC != null || customError!=null || dupesFound!=null || modSorting!=null)
{
return;
}
try
{
Loader.instance().initializeMods();
}
catch (CustomModLoadingErrorDisplayException custom)
{
FMLLog.log(Level.SEVERE, custom, "A custom exception was thrown by a mod, the game will now halt");
customError = custom;
return;
}
catch (LoaderException le)
{
haltGame("There was a severe problem during mod loading that has caused the game to fail", le);
return;
}
client.field_71416_A.LOAD_SOUND_SYSTEM = true;
// Reload resources
client.func_110436_a();
RenderingRegistry.instance().loadEntityRenderers((Map<Class<? extends Entity>, Render>)RenderManager.field_78727_a.field_78729_o);
loading = false;
KeyBindingRegistry.instance().uploadKeyBindingsToGame(client.field_71474_y);
}
示例10: identifyMods
import cpw.mods.fml.common.LoaderException; //导入依赖的package包/类
public List<ModContainer> identifyMods()
{
List<ModContainer> modList = Lists.newArrayList();
for (ModCandidate candidate : candidates)
{
try
{
List<ModContainer> mods = candidate.explore(dataTable);
if (mods.isEmpty() && !candidate.isClasspath())
{
nonModLibs.add(candidate.getModContainer());
}
else
{
modList.addAll(mods);
}
}
catch (LoaderException le)
{
FMLLog.log(Level.WARNING, le, "Identified a problem with the mod candidate %s, ignoring this source", candidate.getModContainer());
}
catch (Throwable t)
{
Throwables.propagate(t);
}
}
return modList;
}
示例11: ASMModParser
import cpw.mods.fml.common.LoaderException; //导入依赖的package包/类
public ASMModParser(InputStream stream) throws IOException
{
try
{
ClassReader reader = new ClassReader(stream);
reader.accept(new ModClassVisitor(this), 0);
}
catch (Exception ex)
{
FMLLog.log(Level.SEVERE, ex, "Unable to read a class file correctly");
throw new LoaderException(ex);
}
}
示例12: parseRange
import cpw.mods.fml.common.LoaderException; //导入依赖的package包/类
public static VersionRange parseRange(String range)
{
try
{
return VersionRange.createFromVersionSpec(range);
}
catch (InvalidVersionSpecificationException e)
{
FMLLog.log(Level.SEVERE, e, "Unable to parse a version range specification successfully %s", range);
throw new LoaderException(e);
}
}
示例13: finishMinecraftLoading
import cpw.mods.fml.common.LoaderException; //导入依赖的package包/类
/**
* Called a bit later on during initialization to finish loading mods
* Also initializes key bindings
*
*/
@SuppressWarnings("deprecation")
public void finishMinecraftLoading()
{
if (modsMissing != null || wrongMC != null || customError!=null || dupesFound!=null || modSorting!=null)
{
return;
}
try
{
Loader.instance().initializeMods();
}
catch (CustomModLoadingErrorDisplayException custom)
{
FMLLog.log(Level.SEVERE, custom, "A custom exception was thrown by a mod, the game will now halt");
customError = custom;
return;
}
catch (LoaderException le)
{
haltGame("There was a severe problem during mod loading that has caused the game to fail", le);
return;
}
client.sndManager.LOAD_SOUND_SYSTEM = true;
// Reload resources
client.refreshResources();
RenderingRegistry.instance().loadEntityRenderers((Map<Class<? extends Entity>, Render>)RenderManager.instance.entityRenderMap);
loading = false;
KeyBindingRegistry.instance().uploadKeyBindingsToGame(client.gameSettings);
}
示例14: createGeoBlock
import cpw.mods.fml.common.LoaderException; //导入依赖的package包/类
private static <T extends GeoBlock> T createGeoBlock(Class<T> blockClass, Strength strength, Class<? extends IndustrialMaterial> composition, Material material) {
T block = null;
try {
Constructor<T> constructor = blockClass.getConstructor(Strength.class, Class.class, Material.class);
block = constructor.newInstance(strength, composition, material);
} catch (Exception e) {
Geologica.log.fatal("Failed to construct GeoBlock");
throw new LoaderException(e);
}
return block;
}
示例15: createDerivedBlock
import cpw.mods.fml.common.LoaderException; //导入依赖的package包/类
private static <T extends Block> T createDerivedBlock(Class<T> blockClass, CompositeBlock modelBlock) {
T block = null;
try {
Constructor<T> constructor = blockClass.getConstructor(CompositeBlock.class);
block = constructor.newInstance(modelBlock);
} catch (Exception e) {
Geologica.log.fatal("Failed to construct derived block");
throw new LoaderException(e);
}
return block;
}