本文整理汇总了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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例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);
}
}
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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();
}
}
}
}
}
示例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;
}
}
示例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;
}
}
}
示例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);
}
}
}