當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。