本文整理匯總了Java中net.minecraft.crash.CrashReportCategory.addCrashSection方法的典型用法代碼示例。如果您正苦於以下問題:Java CrashReportCategory.addCrashSection方法的具體用法?Java CrashReportCategory.addCrashSection怎麽用?Java CrashReportCategory.addCrashSection使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.crash.CrashReportCategory
的用法示例。
在下文中一共展示了CrashReportCategory.addCrashSection方法的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: playAuxSFXAtEntity
import net.minecraft.crash.CrashReportCategory; //導入方法依賴的package包/類
public void playAuxSFXAtEntity(EntityPlayer player, int sfxType, BlockPos pos, int p_180498_4_)
{
try
{
for (int i = 0; i < this.worldAccesses.size(); ++i)
{
((IWorldAccess)this.worldAccesses.get(i)).playAuxSFX(player, sfxType, pos, p_180498_4_);
}
}
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(sfxType));
crashreportcategory.addCrashSection("Event data", Integer.valueOf(p_180498_4_));
throw new ReportedException(crashreport);
}
}
示例3: readNBT
import net.minecraft.crash.CrashReportCategory; //導入方法依賴的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);
}
}
示例4: 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.addCrashSectionCallable("Tag type found", new Callable<String>()
{
public String call() throws Exception
{
return NBTBase.NBT_TYPES[((NBTBase)NBTTagCompound.this.tagMap.get(key)).getId()];
}
});
crashreportcategory.addCrashSectionCallable("Tag type expected", new Callable<String>()
{
public String call() throws Exception
{
return NBTBase.NBT_TYPES[expectedType];
}
});
crashreportcategory.addCrashSection("Tag name", key);
return crashreport;
}
示例5: extendCrashReport
import net.minecraft.crash.CrashReportCategory; //導入方法依賴的package包/類
public static void extendCrashReport(CrashReportCategory p_extendCrashReport_0_)
{
p_extendCrashReport_0_.addCrashSection("OptiFine Version", Config.getVersion());
if (Config.getGameSettings() != null)
{
p_extendCrashReport_0_.addCrashSection("Render Distance Chunks", "" + Config.getChunkViewDistance());
p_extendCrashReport_0_.addCrashSection("Mipmaps", "" + Config.getMipmapLevels());
p_extendCrashReport_0_.addCrashSection("Anisotropic Filtering", "" + Config.getAnisotropicFilterLevel());
p_extendCrashReport_0_.addCrashSection("Antialiasing", "" + Config.getAntialiasingLevel());
p_extendCrashReport_0_.addCrashSection("Multitexture", "" + Config.isMultiTexture());
}
p_extendCrashReport_0_.addCrashSection("Shaders", "" + Shaders.getShaderPackName());
p_extendCrashReport_0_.addCrashSection("OpenGlVersion", "" + Config.openGlVersion);
p_extendCrashReport_0_.addCrashSection("OpenGlRenderer", "" + Config.openGlRenderer);
p_extendCrashReport_0_.addCrashSection("OpenGlVendor", "" + Config.openGlVendor);
p_extendCrashReport_0_.addCrashSection("CpuCount", "" + Config.getAvailableProcessors());
}
示例6: func_152455_a
import net.minecraft.crash.CrashReportCategory; //導入方法依賴的package包/類
private static NBTBase func_152455_a(DataInput p_152455_0_, int p_152455_1_, NBTSizeTracker p_152455_2_) throws IOException
{
byte b0 = p_152455_0_.readByte();
if (b0 == 0)
{
return new NBTTagEnd();
}
else
{
p_152455_0_.readUTF();
NBTBase nbtbase = NBTBase.createNewByType(b0);
try
{
nbtbase.read(p_152455_0_, p_152455_1_, p_152455_2_);
return nbtbase;
}
catch (IOException ioexception)
{
CrashReport crashreport = CrashReport.makeCrashReport(ioexception, "Loading NBT data");
CrashReportCategory crashreportcategory = crashreport.makeCategory("NBT Tag");
crashreportcategory.addCrashSection("Tag name", "[UNNAMED TAG]");
crashreportcategory.addCrashSection("Tag type", Byte.valueOf(b0));
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.addCrashSectionCallable("All players", new Callable<String>()
{
public String call()
{
return World.this.playerEntities.size() + " total; " + World.this.playerEntities.toString();
}
});
crashreportcategory.addCrashSectionCallable("Chunk stats", new Callable<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: 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);
}
}
示例9: areBiomesViable
import net.minecraft.crash.CrashReportCategory; //導入方法依賴的package包/類
/**
* checks given Chunk's Biomes against List of allowed ones
*/
public boolean areBiomesViable(int x, int z, int radius, List<Biome> allowed)
{
IntCache.resetIntCache();
int i = x - radius >> 2;
int j = z - radius >> 2;
int k = x + radius >> 2;
int l = z + radius >> 2;
int i1 = k - i + 1;
int j1 = l - j + 1;
int[] aint = this.genBiomes.getInts(i, j, i1, j1);
try
{
for (int k1 = 0; k1 < i1 * j1; ++k1)
{
Biome biome = Biome.getBiome(aint[k1]);
if (!allowed.contains(biome))
{
return false;
}
}
return true;
}
catch (Throwable throwable)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Layer");
crashreportcategory.addCrashSection("Layer", this.genBiomes.toString());
crashreportcategory.addCrashSection("x", Integer.valueOf(x));
crashreportcategory.addCrashSection("z", Integer.valueOf(z));
crashreportcategory.addCrashSection("radius", Integer.valueOf(radius));
crashreportcategory.addCrashSection("allowed", allowed);
throw new ReportedException(crashreport);
}
}
示例10: getBiomesForGeneration
import net.minecraft.crash.CrashReportCategory; //導入方法依賴的package包/類
/**
* Returns an array of biomes for the location input.
*/
public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] biomes, int x, int z, int width, int height)
{
IntCache.resetIntCache();
if (biomes == null || biomes.length < width * height)
{
biomes = new BiomeGenBase[width * height];
}
int[] aint = this.genBiomes.getInts(x, z, width, height);
try
{
for (int i = 0; i < width * height; ++i)
{
biomes[i] = BiomeGenBase.getBiomeFromBiomeList(aint[i], BiomeGenBase.field_180279_ad);
}
return biomes;
}
catch (Throwable throwable)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id");
CrashReportCategory crashreportcategory = crashreport.makeCategory("RawBiomeBlock");
crashreportcategory.addCrashSection("biomes[] size", Integer.valueOf(biomes.length));
crashreportcategory.addCrashSection("x", Integer.valueOf(x));
crashreportcategory.addCrashSection("z", Integer.valueOf(z));
crashreportcategory.addCrashSection("w", Integer.valueOf(width));
crashreportcategory.addCrashSection("h", Integer.valueOf(height));
throw new ReportedException(crashreport);
}
}
示例11: doRenderEntity
import net.minecraft.crash.CrashReportCategory; //導入方法依賴的package包/類
public void doRenderEntity(Entity entityIn, double x, double y, double z, float yaw, float partialTicks, boolean p_188391_10_)
{
Render<Entity> render = null;
try
{
render = this.<Entity>getEntityRenderObject(entityIn);
if (render != null && this.renderEngine != null)
{
try
{
render.setRenderOutlines(this.renderOutlines);
if (CustomEntityModels.isActive())
{
this.renderEntity = entityIn;
this.renderRender = render;
}
render.doRender(entityIn, x, y, z, yaw, partialTicks);
}
catch (Throwable throwable2)
{
throw new ReportedException(CrashReport.makeCrashReport(throwable2, "Rendering entity in world"));
}
try
{
if (!this.renderOutlines)
{
render.doRenderShadowAndFire(entityIn, x, y, z, yaw, partialTicks);
}
}
catch (Throwable throwable1)
{
throw new ReportedException(CrashReport.makeCrashReport(throwable1, "Post-rendering entity in world"));
}
if (this.debugBoundingBox && !entityIn.isInvisible() && !p_188391_10_ && !Minecraft.getMinecraft().isReducedDebug())
{
try
{
this.renderDebugBoundingBox(entityIn, x, y, z, yaw, partialTicks);
}
catch (Throwable throwable)
{
throw new ReportedException(CrashReport.makeCrashReport(throwable, "Rendering entity hitbox in world"));
}
}
}
}
catch (Throwable throwable3)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable3, "Rendering entity in world");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Entity being rendered");
entityIn.addEntityCrashInfo(crashreportcategory);
CrashReportCategory crashreportcategory1 = crashreport.makeCategory("Renderer details");
crashreportcategory1.addCrashSection("Assigned renderer", render);
crashreportcategory1.addCrashSection("Location", CrashReportCategory.getCoordinateInfo(x, y, z));
crashreportcategory1.addCrashSection("Rotation", Float.valueOf(yaw));
crashreportcategory1.addCrashSection("Delta", Float.valueOf(partialTicks));
throw new ReportedException(crashreport);
}
}
示例12: recursiveGenerate
import net.minecraft.crash.CrashReportCategory; //導入方法依賴的package包/類
/**
* Recursively called by generate()
*/
protected final synchronized void recursiveGenerate(World worldIn, final int chunkX, final int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn)
{
this.initializeStructureData(worldIn);
if (!this.structureMap.containsKey(ChunkPos.asLong(chunkX, chunkZ)))
{
this.rand.nextInt();
try
{
if (this.canSpawnStructureAtCoords(chunkX, chunkZ))
{
StructureStart structurestart = this.getStructureStart(chunkX, chunkZ);
this.structureMap.put(ChunkPos.asLong(chunkX, chunkZ), structurestart);
if (structurestart.isSizeableStructure())
{
this.setStructureStart(chunkX, chunkZ, structurestart);
}
}
}
catch (Throwable throwable)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Exception preparing structure feature");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Feature being prepared");
crashreportcategory.setDetail("Is feature chunk", new ICrashReportDetail<String>()
{
public String call() throws Exception
{
return MapGenStructure.this.canSpawnStructureAtCoords(chunkX, chunkZ) ? "True" : "False";
}
});
crashreportcategory.addCrashSection("Chunk location", String.format("%d,%d", new Object[] {Integer.valueOf(chunkX), Integer.valueOf(chunkZ)}));
crashreportcategory.setDetail("Chunk pos hash", new ICrashReportDetail<String>()
{
public String call() throws Exception
{
return String.valueOf(ChunkPos.asLong(chunkX, chunkZ));
}
});
crashreportcategory.setDetail("Structure type", new ICrashReportDetail<String>()
{
public String call() throws Exception
{
return MapGenStructure.this.getClass().getCanonicalName();
}
});
throw new ReportedException(crashreport);
}
}
}
示例13: biomesEqualOrMesaPlateau
import net.minecraft.crash.CrashReportCategory; //導入方法依賴的package包/類
protected static boolean biomesEqualOrMesaPlateau(int biomeIDA, int biomeIDB)
{
if (biomeIDA == biomeIDB)
{
return true;
}
else if (biomeIDA != BiomeGenBase.mesaPlateau_F.biomeID && biomeIDA != BiomeGenBase.mesaPlateau.biomeID)
{
final BiomeGenBase biomegenbase = BiomeGenBase.getBiome(biomeIDA);
final BiomeGenBase biomegenbase1 = BiomeGenBase.getBiome(biomeIDB);
try
{
return biomegenbase != null && biomegenbase1 != null ? biomegenbase.isEqualTo(biomegenbase1) : false;
}
catch (Throwable throwable)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Comparing biomes");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Biomes being compared");
crashreportcategory.addCrashSection("Biome A ID", Integer.valueOf(biomeIDA));
crashreportcategory.addCrashSection("Biome B ID", Integer.valueOf(biomeIDB));
crashreportcategory.addCrashSectionCallable("Biome A", new Callable<String>()
{
public String call() throws Exception
{
return String.valueOf((Object)biomegenbase);
}
});
crashreportcategory.addCrashSectionCallable("Biome B", new Callable<String>()
{
public String call() throws Exception
{
return String.valueOf((Object)biomegenbase1);
}
});
throw new ReportedException(crashreport);
}
}
else
{
return biomeIDB == BiomeGenBase.mesaPlateau_F.biomeID || biomeIDB == BiomeGenBase.mesaPlateau.biomeID;
}
}
示例14: recursiveGenerate
import net.minecraft.crash.CrashReportCategory; //導入方法依賴的package包/類
/**
* Recursively called by generate()
*/
protected final void recursiveGenerate(World worldIn, final int chunkX, final int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn)
{
this.func_143027_a(worldIn);
if (!this.structureLongMap.containsItem(ChunkCoordIntPair.chunkXZ2Int(chunkX, chunkZ)))
{
this.rand.nextInt();
try
{
if (this.canSpawnStructureAtCoords(chunkX, chunkZ))
{
StructureStart structurestart = this.getStructureStart(chunkX, chunkZ);
this.structureMap.put(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(chunkX, chunkZ)), structurestart);
this.structureLongMap.add(ChunkCoordIntPair.chunkXZ2Int(chunkX, chunkZ), structurestart);
this.func_143026_a(chunkX, chunkZ, structurestart);
}
}
catch (Throwable throwable)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Exception preparing structure feature");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Feature being prepared");
crashreportcategory.addCrashSectionCallable("Is feature chunk", new Callable()
{
private static final String __OBFID = "CL_00000506";
public String call() throws Exception
{
return MapGenStructure.this.canSpawnStructureAtCoords(chunkX, chunkZ) ? "True" : "False";
}
});
crashreportcategory.addCrashSection("Chunk location", String.format("%d,%d", new Object[] {Integer.valueOf(chunkX), Integer.valueOf(chunkZ)}));
crashreportcategory.addCrashSectionCallable("Chunk pos hash", new Callable()
{
private static final String __OBFID = "CL_00000507";
public String call() throws Exception
{
return String.valueOf(ChunkCoordIntPair.chunkXZ2Int(chunkX, chunkZ));
}
});
crashreportcategory.addCrashSectionCallable("Structure type", new Callable()
{
private static final String __OBFID = "CL_00000508";
public String call() throws Exception
{
return MapGenStructure.this.getClass().getCanonicalName();
}
});
throw new ReportedException(crashreport);
}
}
}
示例15: addItemStackToInventory
import net.minecraft.crash.CrashReportCategory; //導入方法依賴的package包/類
/**
* Adds the item stack to the inventory, returns false if it is impossible.
*/
public boolean addItemStackToInventory(final ItemStack itemStackIn)
{
if (itemStackIn.func_190926_b())
{
return false;
}
else
{
try
{
if (itemStackIn.isItemDamaged())
{
int j = this.getFirstEmptyStack();
if (j >= 0)
{
this.mainInventory.set(j, itemStackIn.copy());
((ItemStack)this.mainInventory.get(j)).func_190915_d(5);
itemStackIn.func_190920_e(0);
return true;
}
else if (this.player.capabilities.isCreativeMode)
{
itemStackIn.func_190920_e(0);
return true;
}
else
{
return false;
}
}
else
{
int i;
while (true)
{
i = itemStackIn.func_190916_E();
itemStackIn.func_190920_e(this.storePartialItemStack(itemStackIn));
if (itemStackIn.func_190926_b() || itemStackIn.func_190916_E() >= i)
{
break;
}
}
if (itemStackIn.func_190916_E() == i && this.player.capabilities.isCreativeMode)
{
itemStackIn.func_190920_e(0);
return true;
}
else
{
return itemStackIn.func_190916_E() < i;
}
}
}
catch (Throwable throwable)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Adding item to inventory");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Item being added");
crashreportcategory.addCrashSection("Item ID", Integer.valueOf(Item.getIdFromItem(itemStackIn.getItem())));
crashreportcategory.addCrashSection("Item data", Integer.valueOf(itemStackIn.getMetadata()));
crashreportcategory.setDetail("Item name", new ICrashReportDetail<String>()
{
public String call() throws Exception
{
return itemStackIn.getDisplayName();
}
});
throw new ReportedException(crashreport);
}
}
}