當前位置: 首頁>>代碼示例>>Java>>正文


Java CrashReportCategory.setDetail方法代碼示例

本文整理匯總了Java中net.minecraft.crash.CrashReportCategory.setDetail方法的典型用法代碼示例。如果您正苦於以下問題:Java CrashReportCategory.setDetail方法的具體用法?Java CrashReportCategory.setDetail怎麽用?Java CrashReportCategory.setDetail使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.crash.CrashReportCategory的用法示例。


在下文中一共展示了CrashReportCategory.setDetail方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createCrashReport

import net.minecraft.crash.CrashReportCategory; //導入方法依賴的package包/類
/**
 * Create a crash report which indicates a NBT read error.
 */
private CrashReport createCrashReport(final String key, final int expectedType, ClassCastException ex)
{
    CrashReport crashreport = CrashReport.makeCrashReport(ex, "Reading NBT data");
    CrashReportCategory crashreportcategory = crashreport.makeCategoryDepth("Corrupt NBT tag", 1);
    crashreportcategory.setDetail("Tag type found", new ICrashReportDetail<String>()
    {
        public String call() throws Exception
        {
            return NBTBase.NBT_TYPES[((NBTBase)NBTTagCompound.this.tagMap.get(key)).getId()];
        }
    });
    crashreportcategory.setDetail("Tag type expected", new ICrashReportDetail<String>()
    {
        public String call() throws Exception
        {
            return NBTBase.NBT_TYPES[expectedType];
        }
    });
    crashreportcategory.addCrashSection("Tag name", key);
    return crashreport;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:25,代碼來源:NBTTagCompound.java

示例2: sendPacket

import net.minecraft.crash.CrashReportCategory; //導入方法依賴的package包/類
public void sendPacket(final Packet<?> packetIn)
{
    if (packetIn instanceof SPacketChat)
    {
        SPacketChat spacketchat = (SPacketChat)packetIn;
        EntityPlayer.EnumChatVisibility entityplayer$enumchatvisibility = this.playerEntity.getChatVisibility();

        if (entityplayer$enumchatvisibility == EntityPlayer.EnumChatVisibility.HIDDEN)
        {
            return;
        }

        if (entityplayer$enumchatvisibility == EntityPlayer.EnumChatVisibility.SYSTEM && !spacketchat.isSystem())
        {
            return;
        }
    }

    try
    {
        this.netManager.sendPacket(packetIn);
    }
    catch (Throwable throwable)
    {
        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Sending packet");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("Packet being sent");
        crashreportcategory.setDetail("Packet class", new ICrashReportDetail<String>()
        {
            public String call() throws Exception
            {
                return packetIn.getClass().getCanonicalName();
            }
        });
        throw new ReportedException(crashreport);
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:37,代碼來源:NetHandlerPlayServer.java

示例3: loadTexture

import net.minecraft.crash.CrashReportCategory; //導入方法依賴的package包/類
public boolean loadTexture(ResourceLocation textureLocation, ITextureObject textureObj)
{
    boolean flag = true;

    try
    {
        ((ITextureObject)textureObj).loadTexture(this.theResourceManager);
    }
    catch (IOException ioexception)
    {
        LOGGER.warn("Failed to load texture: {}", new Object[] {textureLocation, ioexception});
        textureObj = TextureUtil.MISSING_TEXTURE;
        this.mapTextureObjects.put(textureLocation, (ITextureObject)textureObj);
        flag = false;
    }
    catch (Throwable throwable)
    {
        final ITextureObject textureObjf = textureObj;
        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Registering texture");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("Resource location being registered");
        crashreportcategory.addCrashSection("Resource location", textureLocation);
        crashreportcategory.setDetail("Texture object class", new ICrashReportDetail<String>()
        {
            public String call() throws Exception
            {
                return textureObjf.getClass().getName();
            }
        });
        throw new ReportedException(crashreport);
    }

    this.mapTextureObjects.put(textureLocation, (ITextureObject)textureObj);
    return flag;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:35,代碼來源:TextureManager.java

示例4: loadTexture

import net.minecraft.crash.CrashReportCategory; //導入方法依賴的package包/類
public boolean loadTexture(ResourceLocation textureLocation, ITextureObject textureObj)
{
    boolean flag = true;

    try
    {
        ((ITextureObject)textureObj).loadTexture(this.theResourceManager);
    }
    catch (IOException ioexception)
    {
        LOGGER.warn("Failed to load texture: {}", new Object[] {textureLocation, ioexception});
        textureObj = TextureUtil.MISSING_TEXTURE;
        this.mapTextureObjects.put(textureLocation, (ITextureObject)textureObj);
        flag = false;
    }
    catch (Throwable throwable)
    {
        final ITextureObject p_110579_2_f = textureObj;
        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Registering texture");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("Resource location being registered");
        crashreportcategory.addCrashSection("Resource location", textureLocation);
        crashreportcategory.setDetail("Texture object class", new ICrashReportDetail<String>()
        {
            public String call() throws Exception
            {
                return p_110579_2_f.getClass().getName();
            }
        });
        throw new ReportedException(crashreport);
    }

    this.mapTextureObjects.put(textureLocation, (ITextureObject)textureObj);
    return flag;
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:35,代碼來源:TextureManager.java

示例5: tickParticle

import net.minecraft.crash.CrashReportCategory; //導入方法依賴的package包/類
private void tickParticle(final Particle particle)
{
    try
    {
        particle.onUpdate();
    }
    catch (Throwable throwable)
    {
        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Ticking Particle");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("Particle being ticked");
        final int i = particle.getFXLayer();
        crashreportcategory.setDetail("Particle", new ICrashReportDetail<String>()
        {
            public String call() throws Exception
            {
                return particle.toString();
            }
        });
        crashreportcategory.setDetail("Particle Type", new ICrashReportDetail<String>()
        {
            public String call() throws Exception
            {
                return i == 0 ? "MISC_TEXTURE" : (i == 1 ? "TERRAIN_TEXTURE" : (i == 3 ? "ENTITY_PARTICLE_TEXTURE" : "Unknown - " + i));
            }
        });
        throw new ReportedException(crashreport);
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:29,代碼來源:ParticleManager.java

示例6: func_190524_a

import net.minecraft.crash.CrashReportCategory; //導入方法依賴的package包/類
public void func_190524_a(BlockPos p_190524_1_, final Block p_190524_2_, BlockPos p_190524_3_)
{
    if (!this.isRemote)
    {
        IBlockState iblockstate = this.getBlockState(p_190524_1_);

        try
        {
            iblockstate.neighborChanged(this, p_190524_1_, p_190524_2_, p_190524_3_);
        }
        catch (Throwable throwable)
        {
            CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Exception while updating neighbours");
            CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being updated");
            crashreportcategory.setDetail("Source block type", new ICrashReportDetail<String>()
            {
                public String call() throws Exception
                {
                    try
                    {
                        return String.format("ID #%d (%s // %s)", new Object[] {Integer.valueOf(Block.getIdFromBlock(p_190524_2_)), p_190524_2_.getUnlocalizedName(), p_190524_2_.getClass().getCanonicalName()});
                    }
                    catch (Throwable var2)
                    {
                        return "ID #" + Block.getIdFromBlock(p_190524_2_);
                    }
                }
            });
            CrashReportCategory.addBlockInfo(crashreportcategory, p_190524_1_, iblockstate);
            throw new ReportedException(crashreport);
        }
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:34,代碼來源:World.java

示例7: addWorldInfoToCrashReport

import net.minecraft.crash.CrashReportCategory; //導入方法依賴的package包/類
/**
 * Adds some basic stats of the world to the given crash report.
 */
public CrashReportCategory addWorldInfoToCrashReport(CrashReport report)
{
    CrashReportCategory crashreportcategory = report.makeCategoryDepth("Affected level", 1);
    crashreportcategory.addCrashSection("Level name", this.worldInfo == null ? "????" : this.worldInfo.getWorldName());
    crashreportcategory.setDetail("All players", new ICrashReportDetail<String>()
    {
        public String call()
        {
            return World.this.playerEntities.size() + " total; " + World.this.playerEntities;
        }
    });
    crashreportcategory.setDetail("Chunk stats", new ICrashReportDetail<String>()
    {
        public String call()
        {
            return World.this.chunkProvider.makeString();
        }
    });

    try
    {
        this.worldInfo.addToCrashReport(crashreportcategory);
    }
    catch (Throwable throwable)
    {
        crashreportcategory.addCrashSectionThrowable("Level Data Unobtainable", throwable);
    }

    return crashreportcategory;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:34,代碼來源:World.java

示例8: spawnParticle

import net.minecraft.crash.CrashReportCategory; //導入方法依賴的package包/類
public void spawnParticle(int particleID, boolean ignoreRange, final double xCoord, final double yCoord, final double zCoord, double xSpeed, double ySpeed, double zSpeed, int... parameters)
{
    try
    {
        this.spawnEntityFX(particleID, ignoreRange, xCoord, yCoord, zCoord, xSpeed, ySpeed, zSpeed, parameters);
    }
    catch (Throwable throwable)
    {
        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Exception while adding particle");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("Particle being added");
        crashreportcategory.addCrashSection("ID", Integer.valueOf(particleID));

        if (parameters != null)
        {
            crashreportcategory.addCrashSection("Parameters", parameters);
        }

        crashreportcategory.setDetail("Position", new ICrashReportDetail<String>()
        {
            public String call() throws Exception
            {
                return CrashReportCategory.getCoordinateInfo(xCoord, yCoord, zCoord);
            }
        });
        throw new ReportedException(crashreport);
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:28,代碼來源:RenderGlobal.java

示例9: func_190570_a

import net.minecraft.crash.CrashReportCategory; //導入方法依賴的package包/類
public void func_190570_a(int p_190570_1_, boolean p_190570_2_, boolean p_190570_3_, final double p_190570_4_, final double p_190570_6_, final double p_190570_8_, double p_190570_10_, double p_190570_12_, double p_190570_14_, int... p_190570_16_)
{
    try
    {
        this.func_190571_b(p_190570_1_, p_190570_2_, p_190570_3_, p_190570_4_, p_190570_6_, p_190570_8_, p_190570_10_, p_190570_12_, p_190570_14_, p_190570_16_);
    }
    catch (Throwable throwable)
    {
        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Exception while adding particle");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("Particle being added");
        crashreportcategory.addCrashSection("ID", Integer.valueOf(p_190570_1_));

        if (p_190570_16_ != null)
        {
            crashreportcategory.addCrashSection("Parameters", p_190570_16_);
        }

        crashreportcategory.setDetail("Position", new ICrashReportDetail<String>()
        {
            public String call() throws Exception
            {
                return CrashReportCategory.getCoordinateInfo(p_190570_4_, p_190570_6_, p_190570_8_);
            }
        });
        throw new ReportedException(crashreport);
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:28,代碼來源:RenderGlobal.java

示例10: sendPacket

import net.minecraft.crash.CrashReportCategory; //導入方法依賴的package包/類
public void sendPacket(final Packet<?> packetIn)
{
    if (packetIn instanceof SPacketChat)
    {
        SPacketChat spacketchat = (SPacketChat)packetIn;
        EntityPlayer.EnumChatVisibility entityplayer$enumchatvisibility = this.playerEntity.getChatVisibility();

        if (entityplayer$enumchatvisibility == EntityPlayer.EnumChatVisibility.HIDDEN && spacketchat.getType() != 2)
        {
            return;
        }

        if (entityplayer$enumchatvisibility == EntityPlayer.EnumChatVisibility.SYSTEM && !spacketchat.isSystem())
        {
            return;
        }
    }

    try
    {
        this.netManager.sendPacket(packetIn);
    }
    catch (Throwable throwable)
    {
        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Sending packet");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("Packet being sent");
        crashreportcategory.setDetail("Packet class", new ICrashReportDetail<String>()
        {
            public String call() throws Exception
            {
                return packetIn.getClass().getCanonicalName();
            }
        });
        throw new ReportedException(crashreport);
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:37,代碼來源:NetHandlerPlayServer.java

示例11: addWorldInfoToCrashReport

import net.minecraft.crash.CrashReportCategory; //導入方法依賴的package包/類
/**
 * Adds some basic stats of the world to the given crash report.
 */
public CrashReportCategory addWorldInfoToCrashReport(CrashReport report)
{
    CrashReportCategory crashreportcategory = super.addWorldInfoToCrashReport(report);
    crashreportcategory.setDetail("Forced entities", new ICrashReportDetail<String>()
    {
        public String call()
        {
            return WorldClient.this.entityList.size() + " total; " + WorldClient.this.entityList;
        }
    });
    crashreportcategory.setDetail("Retry entities", new ICrashReportDetail<String>()
    {
        public String call()
        {
            return WorldClient.this.entitySpawnQueue.size() + " total; " + WorldClient.this.entitySpawnQueue;
        }
    });
    crashreportcategory.setDetail("Server brand", new ICrashReportDetail<String>()
    {
        public String call() throws Exception
        {
            return WorldClient.this.mc.thePlayer.getServerBrand();
        }
    });
    crashreportcategory.setDetail("Server type", new ICrashReportDetail<String>()
    {
        public String call() throws Exception
        {
            return WorldClient.this.mc.getIntegratedServer() == null ? "Non-integrated multiplayer server" : "Integrated singleplayer server";
        }
    });
    return crashreportcategory;
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:37,代碼來源:WorldClient.java

示例12: networkTick

import net.minecraft.crash.CrashReportCategory; //導入方法依賴的package包/類
/**
 * Will try to process the packets received by each NetworkManager, gracefully manage processing failures and cleans
 * up dead connections
 */
public void networkTick()
{
    synchronized (this.networkManagers)
    {
        Iterator<NetworkManager> iterator = this.networkManagers.iterator();

        while (iterator.hasNext())
        {
            final NetworkManager networkmanager = (NetworkManager)iterator.next();

            if (!networkmanager.hasNoChannel())
            {
                if (networkmanager.isChannelOpen())
                {
                    try
                    {
                        networkmanager.processReceivedPackets();
                    }
                    catch (Exception exception)
                    {
                        if (networkmanager.isLocalChannel())
                        {
                            CrashReport crashreport = CrashReport.makeCrashReport(exception, "Ticking memory connection");
                            CrashReportCategory crashreportcategory = crashreport.makeCategory("Ticking connection");
                            crashreportcategory.setDetail("Connection", new ICrashReportDetail<String>()
                            {
                                public String call() throws Exception
                                {
                                    return networkmanager.toString();
                                }
                            });
                            throw new ReportedException(crashreport);
                        }

                        LOGGER.warn("Failed to handle packet for {}", new Object[] {networkmanager.getRemoteAddress(), exception});
                        final TextComponentString textcomponentstring = new TextComponentString("Internal server error");
                        networkmanager.sendPacket(new SPacketDisconnect(textcomponentstring), new GenericFutureListener < Future <? super Void >> ()
                        {
                            public void operationComplete(Future <? super Void > p_operationComplete_1_) throws Exception
                            {
                                networkmanager.closeChannel(textcomponentstring);
                            }
                        }, new GenericFutureListener[0]);
                        networkmanager.disableAutoRead();
                    }
                }
                else
                {
                    iterator.remove();
                    networkmanager.checkDisconnected();
                }
            }
        }
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:60,代碼來源:NetworkSystem.java

示例13: renderItemAndEffectIntoGUI

import net.minecraft.crash.CrashReportCategory; //導入方法依賴的package包/類
public void renderItemAndEffectIntoGUI(@Nullable EntityLivingBase p_184391_1_, final ItemStack p_184391_2_, int p_184391_3_, int p_184391_4_)
{
    if (p_184391_2_ != null && p_184391_2_.getItem() != null)
    {
        this.zLevel += 50.0F;

        try
        {
            this.renderItemModelIntoGUI(p_184391_2_, p_184391_3_, p_184391_4_, this.getItemModelWithOverrides(p_184391_2_, (World)null, p_184391_1_));
        }
        catch (Throwable throwable)
        {
            CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Rendering item");
            CrashReportCategory crashreportcategory = crashreport.makeCategory("Item being rendered");
            crashreportcategory.setDetail("Item Type", new ICrashReportDetail<String>()
            {
                public String call() throws Exception
                {
                    return String.valueOf((Object)p_184391_2_.getItem());
                }
            });
            crashreportcategory.setDetail("Item Aux", new ICrashReportDetail<String>()
            {
                public String call() throws Exception
                {
                    return String.valueOf(p_184391_2_.getMetadata());
                }
            });
            crashreportcategory.setDetail("Item NBT", new ICrashReportDetail<String>()
            {
                public String call() throws Exception
                {
                    return String.valueOf((Object)p_184391_2_.getTagCompound());
                }
            });
            crashreportcategory.setDetail("Item Foil", new ICrashReportDetail<String>()
            {
                public String call() throws Exception
                {
                    return String.valueOf(p_184391_2_.hasEffect());
                }
            });
            throw new ReportedException(crashreport);
        }

        this.zLevel -= 50.0F;
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:49,代碼來源:RenderItem.java

示例14: trigger

import net.minecraft.crash.CrashReportCategory; //導入方法依賴的package包/類
public void trigger(World worldIn)
{
    if (worldIn.isRemote)
    {
        this.successCount = 0;
    }
    else if ("Searge".equalsIgnoreCase(this.commandStored))
    {
        this.lastOutput = new TextComponentString("#itzlipofutzli");
        this.successCount = 1;
    }
    else
    {
        MinecraftServer minecraftserver = this.getServer();

        if (minecraftserver != null && minecraftserver.isAnvilFileSet() && minecraftserver.isCommandBlockEnabled())
        {
            ICommandManager icommandmanager = minecraftserver.getCommandManager();

            try
            {
                this.lastOutput = null;
                this.successCount = icommandmanager.executeCommand(this, this.commandStored);
            }
            catch (Throwable throwable)
            {
                CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Executing command block");
                CrashReportCategory crashreportcategory = crashreport.makeCategory("Command to be executed");
                crashreportcategory.setDetail("Command", new ICrashReportDetail<String>()
                {
                    public String call() throws Exception
                    {
                        return CommandBlockBaseLogic.this.getCommand();
                    }
                });
                crashreportcategory.setDetail("Name", new ICrashReportDetail<String>()
                {
                    public String call() throws Exception
                    {
                        return CommandBlockBaseLogic.this.getName();
                    }
                });
                throw new ReportedException(crashreport);
            }
        }
        else
        {
            this.successCount = 0;
        }
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:52,代碼來源:CommandBlockBaseLogic.java

示例15: getBlockState

import net.minecraft.crash.CrashReportCategory; //導入方法依賴的package包/類
public IBlockState getBlockState(final int x, final int y, final int z)
{
    if (this.worldObj.getWorldType() == WorldType.DEBUG_WORLD)
    {
        IBlockState iblockstate = null;

        if (y == 60)
        {
            iblockstate = Blocks.BARRIER.getDefaultState();
        }

        if (y == 70)
        {
            iblockstate = ChunkProviderDebug.getBlockStateFor(x, z);
        }

        return iblockstate == null ? Blocks.AIR.getDefaultState() : iblockstate;
    }
    else
    {
        try
        {
            if (y >= 0 && y >> 4 < this.storageArrays.length)
            {
                ExtendedBlockStorage extendedblockstorage = this.storageArrays[y >> 4];

                if (extendedblockstorage != NULL_BLOCK_STORAGE)
                {
                    return extendedblockstorage.get(x & 15, y & 15, z & 15);
                }
            }

            return Blocks.AIR.getDefaultState();
        }
        catch (Throwable throwable)
        {
            CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Getting block state");
            CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being got");
            crashreportcategory.setDetail("Location", new ICrashReportDetail<String>()
            {
                public String call() throws Exception
                {
                    return CrashReportCategory.getCoordinateInfo(x, y, z);
                }
            });
            throw new ReportedException(crashreport);
        }
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:50,代碼來源:Chunk.java


注:本文中的net.minecraft.crash.CrashReportCategory.setDetail方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。