当前位置: 首页>>代码示例>>Java>>正文


Java ReportedException类代码示例

本文整理汇总了Java中net.minecraft.util.ReportedException的典型用法代码示例。如果您正苦于以下问题:Java ReportedException类的具体用法?Java ReportedException怎么用?Java ReportedException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ReportedException类属于net.minecraft.util包,在下文中一共展示了ReportedException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTagList

import net.minecraft.util.ReportedException; //导入依赖的package包/类
/**
 * Gets the NBTTagList object with the given name.
 */
public NBTTagList getTagList(String key, int type)
{
    try
    {
        if (this.getTagId(key) == 9)
        {
            NBTTagList nbttaglist = (NBTTagList)this.tagMap.get(key);

            if (!nbttaglist.hasNoTags() && nbttaglist.getTagType() != type)
            {
                return new NBTTagList();
            }

            return nbttaglist;
        }
    }
    catch (ClassCastException classcastexception)
    {
        throw new ReportedException(this.createCrashReport(key, 9, classcastexception));
    }

    return new NBTTagList();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:27,代码来源:NBTTagCompound.java

示例2: getBlock

import net.minecraft.util.ReportedException; //导入依赖的package包/类
public Block getBlock(final int x, final int y, final int z)
{
    try
    {
        return this.getBlock0(x & 15, y, z & 15);
    }
    catch (ReportedException reportedexception)
    {
        CrashReportCategory crashreportcategory = reportedexception.getCrashReport().makeCategory("Block being got");
        crashreportcategory.addCrashSectionCallable("Location", new Callable<String>()
        {
            public String call() throws Exception
            {
                return CrashReportCategory.getCoordinateInfo(new BlockPos(Chunk.this.xPosition * 16 + x, y, Chunk.this.zPosition * 16 + z));
            }
        });
        throw reportedexception;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:20,代码来源:Chunk.java

示例3: readNBT

import net.minecraft.util.ReportedException; //导入依赖的package包/类
static NBTBase readNBT(byte id, String key, DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException
{
    NBTBase nbtbase = NBTBase.createNewByType(id);

    try
    {
        nbtbase.read(input, depth, sizeTracker);
        return nbtbase;
    }
    catch (IOException ioexception)
    {
        CrashReport crashreport = CrashReport.makeCrashReport(ioexception, "Loading NBT data");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("NBT Tag");
        crashreportcategory.addCrashSection("Tag name", key);
        crashreportcategory.addCrashSection("Tag type", Byte.valueOf(id));
        throw new ReportedException(crashreport);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:19,代码来源:NBTTagCompound.java

示例4: getByteArray

import net.minecraft.util.ReportedException; //导入依赖的package包/类
/**
 * Retrieves a byte array using the specified key, or a zero-length array if no such key was stored.
 */
public byte[] getByteArray(String key)
{
    try
    {
        if (this.hasKey(key, 7))
        {
            return ((NBTTagByteArray)this.tagMap.get(key)).getByteArray();
        }
    }
    catch (ClassCastException classcastexception)
    {
        throw new ReportedException(this.createCrashReport(key, 7, classcastexception));
    }

    return new byte[0];
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:20,代码来源:NBTTagCompound.java

示例5: getIntArray

import net.minecraft.util.ReportedException; //导入依赖的package包/类
/**
 * Retrieves an int array using the specified key, or a zero-length array if no such key was stored.
 */
public int[] getIntArray(String key)
{
    try
    {
        if (this.hasKey(key, 11))
        {
            return ((NBTTagIntArray)this.tagMap.get(key)).getIntArray();
        }
    }
    catch (ClassCastException classcastexception)
    {
        throw new ReportedException(this.createCrashReport(key, 11, classcastexception));
    }

    return new int[0];
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:20,代码来源:NBTTagCompound.java

示例6: getWatchedObject

import net.minecraft.util.ReportedException; //导入依赖的package包/类
/**
 * is threadsafe, unless it throws an exception, then
 */
private DataWatcher.WatchableObject getWatchedObject(int id)
{
    this.lock.readLock().lock();
    DataWatcher.WatchableObject datawatcher$watchableobject;

    try
    {
        datawatcher$watchableobject = (DataWatcher.WatchableObject)this.watchedObjects.get(Integer.valueOf(id));
    }
    catch (Throwable throwable)
    {
        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Getting synched entity data");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("Synched entity data");
        crashreportcategory.addCrashSection("Data ID", Integer.valueOf(id));
        throw new ReportedException(crashreport);
    }

    this.lock.readLock().unlock();
    return datawatcher$watchableobject;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:24,代码来源:DataWatcher.java

示例7: playEvent

import net.minecraft.util.ReportedException; //导入依赖的package包/类
public void playEvent(@Nullable EntityPlayer player, int type, BlockPos pos, int data)
{
    try
    {
        for (int i = 0; i < this.eventListeners.size(); ++i)
        {
            ((IWorldEventListener)this.eventListeners.get(i)).playEvent(player, type, pos, data);
        }
    }
    catch (Throwable throwable)
    {
        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Playing level event");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("Level event being played");
        crashreportcategory.addCrashSection("Block coordinates", CrashReportCategory.getCoordinateInfo(pos));
        crashreportcategory.addCrashSection("Event source", player);
        crashreportcategory.addCrashSection("Event type", Integer.valueOf(type));
        crashreportcategory.addCrashSection("Event data", Integer.valueOf(data));
        throw new ReportedException(crashreport);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:21,代码来源:World.java

示例8: getBlock0

import net.minecraft.util.ReportedException; //导入依赖的package包/类
/**
 * Returns the block corresponding to the given coordinates inside a chunk.
 */
private Block getBlock0(int x, int y, int z)
{
    Block block = Blocks.air;

    if (y >= 0 && y >> 4 < this.storageArrays.length)
    {
        ExtendedBlockStorage extendedblockstorage = this.storageArrays[y >> 4];

        if (extendedblockstorage != null)
        {
            try
            {
                block = extendedblockstorage.getBlockByExtId(x, y & 15, z);
            }
            catch (Throwable throwable)
            {
                CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Getting block");
                throw new ReportedException(crashreport);
            }
        }
    }

    return block;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:28,代码来源:Chunk.java

示例9: renderModel

import net.minecraft.util.ReportedException; //导入依赖的package包/类
public boolean renderModel(IBlockAccess blockAccessIn, IBakedModel modelIn, IBlockState blockStateIn, BlockPos blockPosIn, WorldRenderer worldRendererIn, boolean checkSides)
{
    boolean flag = Minecraft.isAmbientOcclusionEnabled() && blockStateIn.getBlock().getLightValue() == 0 && modelIn.isAmbientOcclusion();

    try
    {
        Block block = blockStateIn.getBlock();

        if (Config.isTreesSmart() && blockStateIn.getBlock() instanceof BlockLeavesBase)
        {
            modelIn = SmartLeaves.getLeavesModel(modelIn);
        }

        return flag ? this.renderModelAmbientOcclusion(blockAccessIn, modelIn, block, blockStateIn, blockPosIn, worldRendererIn, checkSides) : this.renderModelStandard(blockAccessIn, modelIn, block, blockStateIn, blockPosIn, worldRendererIn, checkSides);
    }
    catch (Throwable throwable)
    {
        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Tesselating block model");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("Block model being tesselated");
        CrashReportCategory.addBlockInfo(crashreportcategory, blockPosIn, blockStateIn);
        crashreportcategory.addCrashSection("Using AO", Boolean.valueOf(flag));
        throw new ReportedException(crashreport);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:25,代码来源:BlockModelRenderer.java

示例10: getCompoundTag

import net.minecraft.util.ReportedException; //导入依赖的package包/类
/**
 * Retrieves a NBTTagCompound subtag matching the specified key, or a new empty NBTTagCompound if no such key was
 * stored.
 */
public NBTTagCompound getCompoundTag(String key)
{
    try
    {
        if (this.hasKey(key, 10))
        {
            return (NBTTagCompound)this.tagMap.get(key);
        }
    }
    catch (ClassCastException classcastexception)
    {
        throw new ReportedException(this.createCrashReport(key, 10, classcastexception));
    }

    return new NBTTagCompound();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:21,代码来源:NBTTagCompound.java

示例11: getTagList

import net.minecraft.util.ReportedException; //导入依赖的package包/类
/**
 * Gets the NBTTagList object with the given name. Args: name, NBTBase type
 */
public NBTTagList getTagList(String key, int type)
{
    try
    {
        if (this.getTagId(key) != 9)
        {
            return new NBTTagList();
        }
        else
        {
            NBTTagList nbttaglist = (NBTTagList)this.tagMap.get(key);
            return nbttaglist.tagCount() > 0 && nbttaglist.getTagType() != type ? new NBTTagList() : nbttaglist;
        }
    }
    catch (ClassCastException classcastexception)
    {
        throw new ReportedException(this.createCrashReport(key, 9, classcastexception));
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:23,代码来源:NBTTagCompound.java

示例12: captureFramebuffer

import net.minecraft.util.ReportedException; //导入依赖的package包/类
/**
 * caputres the current framebuffer
 */
public void captureFramebuffer(FrameBuffer p_152846_1_)
{
    try
    {
        this.field_152873_i.captureFrameBuffer_ReadPixels(p_152846_1_);
    }
    catch (Throwable throwable)
    {
        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Trying to submit a frame to Twitch");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("Broadcast State");
        crashreportcategory.addCrashSection("Last reported errors", Arrays.toString(field_152862_C.func_152756_c()));
        crashreportcategory.addCrashSection("Buffer", p_152846_1_);
        crashreportcategory.addCrashSection("Free buffer count", Integer.valueOf(this.field_152875_k.size()));
        crashreportcategory.addCrashSection("Capture buffer count", Integer.valueOf(this.field_152874_j.size()));
        throw new ReportedException(crashreport);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:21,代码来源:BroadcastController.java

示例13: renderTileEntityAt

import net.minecraft.util.ReportedException; //导入依赖的package包/类
public void renderTileEntityAt(TileEntity tileEntityIn, double x, double y, double z, float partialTicks, int destroyStage)
{
    TileEntitySpecialRenderer<TileEntity> tileentityspecialrenderer = this.<TileEntity>getSpecialRenderer(tileEntityIn);

    if (tileentityspecialrenderer != null)
    {
        try
        {
            tileentityspecialrenderer.renderTileEntityAt(tileEntityIn, x, y, z, partialTicks, destroyStage);
        }
        catch (Throwable throwable)
        {
            CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Rendering Block Entity");
            CrashReportCategory crashreportcategory = crashreport.makeCategory("Block Entity Details");
            tileEntityIn.addInfoToCrashReport(crashreportcategory);
            throw new ReportedException(crashreport);
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:20,代码来源:TileEntityRendererDispatcher.java

示例14: renderModel

import net.minecraft.util.ReportedException; //导入依赖的package包/类
public boolean renderModel(IBlockAccess blockAccessIn, IBakedModel modelIn, IBlockState blockStateIn, BlockPos blockPosIn, WorldRenderer worldRendererIn, boolean checkSides)
{
    boolean flag = Minecraft.isAmbientOcclusionEnabled() && blockStateIn.getBlock().getLightValue() == 0 && modelIn.isAmbientOcclusion();

    try
    {
        Block block = blockStateIn.getBlock();
        return flag ? this.renderModelAmbientOcclusion(blockAccessIn, modelIn, block, blockPosIn, worldRendererIn, checkSides) : this.renderModelStandard(blockAccessIn, modelIn, block, blockPosIn, worldRendererIn, checkSides);
    }
    catch (Throwable throwable)
    {
        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Tesselating block model");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("Block model being tesselated");
        CrashReportCategory.addBlockInfo(crashreportcategory, blockPosIn, blockStateIn);
        crashreportcategory.addCrashSection("Using AO", Boolean.valueOf(flag));
        throw new ReportedException(crashreport);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:19,代码来源:BlockModelRenderer.java

示例15: makeCrashReport

import net.minecraft.util.ReportedException; //导入依赖的package包/类
/**
 * Creates a crash report for the exception
 */
public static CrashReport makeCrashReport(Throwable causeIn, String descriptionIn)
{
    CrashReport crashreport;

    if (causeIn instanceof ReportedException)
    {
        crashreport = ((ReportedException)causeIn).getCrashReport();
    }
    else
    {
        crashreport = new CrashReport(descriptionIn, causeIn);
    }

    return crashreport;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:19,代码来源:CrashReport.java


注:本文中的net.minecraft.util.ReportedException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。