本文整理匯總了Java中net.minecraft.crash.CrashReport.makeCrashReport方法的典型用法代碼示例。如果您正苦於以下問題:Java CrashReport.makeCrashReport方法的具體用法?Java CrashReport.makeCrashReport怎麽用?Java CrashReport.makeCrashReport使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.crash.CrashReport
的用法示例。
在下文中一共展示了CrashReport.makeCrashReport方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: provideChunk
import net.minecraft.crash.CrashReport; //導入方法依賴的package包/類
@Override
public Chunk provideChunk(int x, int z) {
Chunk chunk = this.loadChunk(x, z);
if (chunk == null) {
long i = ChunkPos.asLong(x, z);
try {
chunk = ((IChunkProvider) chunkGenerator).provideChunk(x, z);
}
catch (Throwable throwable) {
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Exception generating new chunk");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Chunk to be generated");
crashreportcategory.addCrashSection("Location",
String.format("%d,%d", new Object[] { Integer.valueOf(x), Integer.valueOf(z) }));
crashreportcategory.addCrashSection("Position hash", Long.valueOf(i));
crashreportcategory.addCrashSection("Generator", chunkGenerator);
throw new ReportedException(crashreport);
}
id2ChunkMap.put(i, chunk);
chunk.onLoad();
}
return chunk;
}
示例2: renderTileEntityAt
import net.minecraft.crash.CrashReport; //導入方法依賴的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
{
if(drawingBatch && tileEntityIn.hasFastRenderer())
{
tileentityspecialrenderer.renderTileEntityFast(tileEntityIn, x, y, z, partialTicks, destroyStage, batchBuffer.getBuffer());
}
else
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);
}
}
}
示例3: createCrashReport
import net.minecraft.crash.CrashReport; //導入方法依賴的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;
}
示例4: getBiomeGenForCoords
import net.minecraft.crash.CrashReport; //導入方法依賴的package包/類
public BiomeGenBase getBiomeGenForCoords(final BlockPos pos)
{
if (this.isBlockLoaded(pos))
{
Chunk chunk = this.getChunkFromBlockCoords(pos);
try
{
return chunk.getBiome(pos, this.provider.getWorldChunkManager());
}
catch (Throwable throwable)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Getting biome");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Coordinates of biome request");
crashreportcategory.addCrashSectionCallable("Location", new Callable<String>()
{
public String call() throws Exception
{
return CrashReportCategory.getCoordinateInfo(pos);
}
});
throw new ReportedException(crashreport);
}
}
else
{
return this.provider.getWorldChunkManager().getBiomeGenerator(pos, BiomeGenBase.plains);
}
}
示例5: areBiomesViable
import net.minecraft.crash.CrashReport; //導入方法依賴的package包/類
/**
* checks given Chunk's Biomes against List of allowed ones
*/
public boolean areBiomesViable(int p_76940_1_, int p_76940_2_, int p_76940_3_, List<BiomeGenBase> p_76940_4_)
{
IntCache.resetIntCache();
int i = p_76940_1_ - p_76940_3_ >> 2;
int j = p_76940_2_ - p_76940_3_ >> 2;
int k = p_76940_1_ + p_76940_3_ >> 2;
int l = p_76940_2_ + p_76940_3_ >> 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)
{
BiomeGenBase biomegenbase = BiomeGenBase.getBiome(aint[k1]);
if (!p_76940_4_.contains(biomegenbase))
{
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(p_76940_1_));
crashreportcategory.addCrashSection("z", Integer.valueOf(p_76940_2_));
crashreportcategory.addCrashSection("radius", Integer.valueOf(p_76940_3_));
crashreportcategory.addCrashSection("allowed", p_76940_4_);
throw new ReportedException(crashreport);
}
}
示例6: read
import net.minecraft.crash.CrashReport; //導入方法依賴的package包/類
private static NBTBase read(DataInput input, int depth, NBTSizeTracker accounter) throws IOException
{
byte b0 = input.readByte();
accounter.read(8); // Forge: Count everything!
if (b0 == 0)
{
return new NBTTagEnd();
}
else
{
NBTSizeTracker.readUTF(accounter, input.readUTF()); //Forge: Count this string.
accounter.read(32); //Forge: 4 extra bytes for the object allocation.
NBTBase nbtbase = NBTBase.createNewByType(b0);
try
{
nbtbase.read(input, depth, accounter);
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: doBlockCollisions
import net.minecraft.crash.CrashReport; //導入方法依賴的package包/類
protected void doBlockCollisions()
{
BlockPos blockpos = new BlockPos(this.getEntityBoundingBox().minX + 0.001D, this.getEntityBoundingBox().minY + 0.001D, this.getEntityBoundingBox().minZ + 0.001D);
BlockPos blockpos1 = new BlockPos(this.getEntityBoundingBox().maxX - 0.001D, this.getEntityBoundingBox().maxY - 0.001D, this.getEntityBoundingBox().maxZ - 0.001D);
if (this.worldObj.isAreaLoaded(blockpos, blockpos1))
{
for (int i = blockpos.getX(); i <= blockpos1.getX(); ++i)
{
for (int j = blockpos.getY(); j <= blockpos1.getY(); ++j)
{
for (int k = blockpos.getZ(); k <= blockpos1.getZ(); ++k)
{
BlockPos blockpos2 = new BlockPos(i, j, k);
IBlockState iblockstate = this.worldObj.getBlockState(blockpos2);
try
{
iblockstate.getBlock().onEntityCollidedWithBlock(this.worldObj, blockpos2, iblockstate, this);
}
catch (Throwable throwable)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Colliding entity with block");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being collided with");
CrashReportCategory.addBlockInfo(crashreportcategory, blockpos2, iblockstate);
throw new ReportedException(crashreport);
}
}
}
}
}
}
示例8: spawnParticle
import net.minecraft.crash.CrashReport; //導入方法依賴的package包/類
public void spawnParticle(int particleID, boolean ignoreRange, final double xCoord, final double yCoord, final double zCoord, double xOffset, double yOffset, double zOffset, int... p_180442_15_)
{
try
{
this.spawnEntityFX(particleID, ignoreRange, xCoord, yCoord, zCoord, xOffset, yOffset, zOffset, p_180442_15_);
}
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 (p_180442_15_ != null)
{
crashreportcategory.addCrashSection("Parameters", p_180442_15_);
}
crashreportcategory.addCrashSectionCallable("Position", new Callable()
{
private static final String __OBFID = "CL_00000955";
public String call() throws Exception
{
return CrashReportCategory.getCoordinateInfo(xCoord, yCoord, zCoord);
}
});
throw new ReportedException(crashreport);
}
}
示例9: getRainfall
import net.minecraft.crash.CrashReport; //導入方法依賴的package包/類
/**
* Returns a list of rainfall values for the specified blocks. Args: listToReuse, x, z, width, length.
*/
public float[] getRainfall(float[] listToReuse, int x, int z, int width, int length)
{
IntCache.resetIntCache();
if (listToReuse == null || listToReuse.length < width * length)
{
listToReuse = new float[width * length];
}
int[] aint = this.biomeIndexLayer.getInts(x, z, width, length);
for (int i = 0; i < width * length; ++i)
{
try
{
float f = (float)BiomeGenBase.getBiomeFromBiomeList(aint[i], BiomeGenBase.field_180279_ad).getIntRainfall() / 65536.0F;
if (f > 1.0F)
{
f = 1.0F;
}
listToReuse[i] = f;
}
catch (Throwable throwable)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id");
CrashReportCategory crashreportcategory = crashreport.makeCategory("DownfallBlock");
crashreportcategory.addCrashSection("biome id", Integer.valueOf(i));
crashreportcategory.addCrashSection("downfalls[] size", Integer.valueOf(listToReuse.length));
crashreportcategory.addCrashSection("x", Integer.valueOf(x));
crashreportcategory.addCrashSection("z", Integer.valueOf(z));
crashreportcategory.addCrashSection("w", Integer.valueOf(width));
crashreportcategory.addCrashSection("h", Integer.valueOf(length));
throw new ReportedException(crashreport);
}
}
return listToReuse;
}
示例10: updateTimeLightAndEntities
import net.minecraft.crash.CrashReport; //導入方法依賴的package包/類
public void updateTimeLightAndEntities()
{
this.theProfiler.startSection("jobs");
synchronized (this.futureTaskQueue)
{
while (!this.futureTaskQueue.isEmpty())
{
Util.runTask((FutureTask)this.futureTaskQueue.poll(), LOG);
}
}
this.theProfiler.endStartSection("levels");
for (int j = 0; j < this.worldServers.length; ++j)
{
long i = System.nanoTime();
if (j == 0 || this.getAllowNether())
{
WorldServer worldserver = this.worldServers[j];
this.theProfiler.startSection(worldserver.getWorldInfo().getWorldName());
if (this.tickCounter % 20 == 0)
{
this.theProfiler.startSection("timeSync");
this.playerList.sendPacketToAllPlayersInDimension(new SPacketTimeUpdate(worldserver.getTotalWorldTime(), worldserver.getWorldTime(), worldserver.getGameRules().getBoolean("doDaylightCycle")), worldserver.provider.getDimensionType().getId());
this.theProfiler.endSection();
}
this.theProfiler.startSection("tick");
try
{
worldserver.tick();
}
catch (Throwable throwable1)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable1, "Exception ticking world");
worldserver.addWorldInfoToCrashReport(crashreport);
throw new ReportedException(crashreport);
}
try
{
worldserver.updateEntities();
}
catch (Throwable throwable)
{
CrashReport crashreport1 = CrashReport.makeCrashReport(throwable, "Exception ticking world entities");
worldserver.addWorldInfoToCrashReport(crashreport1);
throw new ReportedException(crashreport1);
}
this.theProfiler.endSection();
this.theProfiler.startSection("tracker");
worldserver.getEntityTracker().updateTrackedEntities();
this.theProfiler.endSection();
this.theProfiler.endSection();
}
this.timeOfLastDimensionTick[j][this.tickCounter % 100] = System.nanoTime() - i;
}
this.theProfiler.endStartSection("connection");
this.getNetworkSystem().networkTick();
this.theProfiler.endStartSection("players");
this.playerList.onTick();
this.theProfiler.endStartSection("tickables");
for (int k = 0; k < this.tickables.size(); ++k)
{
((ITickable)this.tickables.get(k)).update();
}
this.theProfiler.endSection();
}
示例11: loadChunk
import net.minecraft.crash.CrashReport; //導入方法依賴的package包/類
/**
* loads or generates the chunk at the chunk location specified
*/
public Chunk loadChunk(int p_73158_1_, int p_73158_2_)
{
long i = ChunkCoordIntPair.chunkXZ2Int(p_73158_1_, p_73158_2_);
this.droppedChunksSet.remove(Long.valueOf(i));
Chunk chunk = (Chunk)this.id2ChunkMap.getValueByKey(i);
if (chunk == null)
{
chunk = this.loadChunkFromFile(p_73158_1_, p_73158_2_);
if (chunk == null)
{
if (this.serverChunkGenerator == null)
{
chunk = this.dummyChunk;
}
else
{
try
{
chunk = this.serverChunkGenerator.provideChunk(p_73158_1_, p_73158_2_);
}
catch (Throwable throwable)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Exception generating new chunk");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Chunk to be generated");
crashreportcategory.addCrashSection("Location", String.format("%d,%d", new Object[] {Integer.valueOf(p_73158_1_), Integer.valueOf(p_73158_2_)}));
crashreportcategory.addCrashSection("Position hash", Long.valueOf(i));
crashreportcategory.addCrashSection("Generator", this.serverChunkGenerator.makeString());
throw new ReportedException(crashreport);
}
}
}
this.id2ChunkMap.add(i, chunk);
this.loadedChunks.add(chunk);
chunk.onChunkLoad();
chunk.populateChunk(this, this, p_73158_1_, p_73158_2_);
}
return chunk;
}
示例12: addItemStackToInventory
import net.minecraft.crash.CrashReport; //導入方法依賴的package包/類
/**
* Adds the item stack to the inventory, returns false if it is impossible.
*/
public boolean addItemStackToInventory(final ItemStack itemStackIn)
{
if (itemStackIn != null && itemStackIn.stackSize != 0 && itemStackIn.getItem() != null)
{
try
{
if (itemStackIn.isItemDamaged())
{
int j = this.getFirstEmptyStack();
if (j >= 0)
{
this.mainInventory[j] = ItemStack.copyItemStack(itemStackIn);
this.mainInventory[j].animationsToGo = 5;
itemStackIn.stackSize = 0;
return true;
}
else if (this.player.capabilities.isCreativeMode)
{
itemStackIn.stackSize = 0;
return true;
}
else
{
return false;
}
}
else
{
int i;
while (true)
{
i = itemStackIn.stackSize;
itemStackIn.stackSize = this.storePartialItemStack(itemStackIn);
if (itemStackIn.stackSize <= 0 || itemStackIn.stackSize >= i)
{
break;
}
}
if (itemStackIn.stackSize == i && this.player.capabilities.isCreativeMode)
{
itemStackIn.stackSize = 0;
return true;
}
else
{
return itemStackIn.stackSize < 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.addCrashSectionCallable("Item name", new Callable<String>()
{
public String call() throws Exception
{
return itemStackIn.getDisplayName();
}
});
throw new ReportedException(crashreport);
}
}
else
{
return false;
}
}
示例13: recursiveGenerate
import net.minecraft.crash.CrashReport; //導入方法依賴的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.structureMap.containsKey(Long.valueOf(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.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<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.addCrashSectionCallable("Chunk pos hash", new Callable<String>()
{
public String call() throws Exception
{
return String.valueOf(ChunkCoordIntPair.chunkXZ2Int(chunkX, chunkZ));
}
});
crashreportcategory.addCrashSectionCallable("Structure type", new Callable<String>()
{
public String call() throws Exception
{
return MapGenStructure.this.getClass().getCanonicalName();
}
});
throw new ReportedException(crashreport);
}
}
}
示例14: run
import net.minecraft.crash.CrashReport; //導入方法依賴的package包/類
public void run()
{
this.running = true;
try
{
this.startGame();
Client.init();
}
catch (Throwable throwable)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Initializing game");
crashreport.makeCategory("Initialization");
this.displayCrashReport(this.addGraphicsAndWorldToCrashReport(crashreport));
return;
}
while (true)
{
try
{
while (this.running)
{
if (!this.hasCrashed || this.crashReporter == null)
{
try
{
this.runGameLoop();
}
catch (OutOfMemoryError var10)
{
this.freeMemory();
this.displayGuiScreen(new GuiMemoryErrorScreen());
System.gc();
}
}
else
{
this.displayCrashReport(this.crashReporter);
}
}
}
catch (MinecraftError var12)
{
break;
}
catch (ReportedException reportedexception)
{
this.addGraphicsAndWorldToCrashReport(reportedexception.getCrashReport());
this.freeMemory();
logger.fatal((String)"Reported exception thrown!", (Throwable)reportedexception);
this.displayCrashReport(reportedexception.getCrashReport());
break;
}
catch (Throwable throwable1)
{
CrashReport crashreport1 = this.addGraphicsAndWorldToCrashReport(new CrashReport("Unexpected error", throwable1));
this.freeMemory();
logger.fatal("Unreported exception thrown!", throwable1);
this.displayCrashReport(crashreport1);
break;
}
finally
{
this.shutdownMinecraftApplet();
}
return;
}
}
示例15: renderItemAndEffectIntoGUI
import net.minecraft.crash.CrashReport; //導入方法依賴的package包/類
public void renderItemAndEffectIntoGUI(final ItemStack stack, int xPosition, int yPosition)
{
if (stack != null && stack.getItem() != null)
{
this.zLevel += 50.0F;
try
{
this.renderItemIntoGUI(stack, xPosition, yPosition);
}
catch (Throwable throwable)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Rendering item");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Item being rendered");
crashreportcategory.addCrashSectionCallable("Item Type", new Callable<String>()
{
public String call() throws Exception
{
return String.valueOf((Object)stack.getItem());
}
});
crashreportcategory.addCrashSectionCallable("Item Aux", new Callable<String>()
{
public String call() throws Exception
{
return String.valueOf(stack.getMetadata());
}
});
crashreportcategory.addCrashSectionCallable("Item NBT", new Callable<String>()
{
public String call() throws Exception
{
return String.valueOf((Object)stack.getTagCompound());
}
});
crashreportcategory.addCrashSectionCallable("Item Foil", new Callable<String>()
{
public String call() throws Exception
{
return String.valueOf(stack.hasEffect());
}
});
throw new ReportedException(crashreport);
}
this.zLevel -= 50.0F;
}
}