本文整理汇总了Java中net.minecraft.crash.CrashReport类的典型用法代码示例。如果您正苦于以下问题:Java CrashReport类的具体用法?Java CrashReport怎么用?Java CrashReport使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CrashReport类属于net.minecraft.crash包,在下文中一共展示了CrashReport类的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: playEvent
import net.minecraft.crash.CrashReport; //导入依赖的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);
}
}
示例3: getEntry
import net.minecraft.crash.CrashReport; //导入依赖的package包/类
private <T> EntityDataManager.DataEntry<T> getEntry(DataParameter<T> key)
{
this.lock.readLock().lock();
EntityDataManager.DataEntry<T> dataentry;
try
{
dataentry = (EntityDataManager.DataEntry)this.entries.get(Integer.valueOf(key.getId()));
}
catch (Throwable throwable)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Getting synched entity data");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Synched entity data");
crashreportcategory.addCrashSection("Data ID", key);
throw new ReportedException(crashreport);
}
this.lock.readLock().unlock();
return dataentry;
}
示例4: playAuxSFXAtEntity
import net.minecraft.crash.CrashReport; //导入依赖的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);
}
}
示例5: readNBT
import net.minecraft.crash.CrashReport; //导入依赖的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);
}
}
示例6: captureFramebuffer
import net.minecraft.crash.CrashReport; //导入依赖的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);
}
}
示例7: displayCrashReport
import net.minecraft.crash.CrashReport; //导入依赖的package包/类
/**
* Wrapper around displayCrashReportInternal
*/
public void displayCrashReport(CrashReport crashReportIn)
{
File file1 = new File(getMinecraft().mcDataDir, "crash-reports");
File file2 = new File(file1, "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-client.txt");
Bootstrap.printToSYSOUT(crashReportIn.getCompleteReport());
if (crashReportIn.getFile() != null)
{
Bootstrap.printToSYSOUT("#@[email protected]# Game crashed! Crash report saved to: #@[email protected]# " + crashReportIn.getFile());
System.exit(-1);
}
else if (crashReportIn.saveToFile(file2))
{
Bootstrap.printToSYSOUT("#@[email protected]# Game crashed! Crash report saved to: #@[email protected]# " + file2.getAbsolutePath());
System.exit(-1);
}
else
{
Bootstrap.printToSYSOUT("#@[email protected]# Game crashed! Crash report could not be saved. #@[email protected]#");
System.exit(-2);
}
}
示例8: makeSummary
import net.minecraft.crash.CrashReport; //导入依赖的package包/类
private static String makeSummary(CrashReport p_makeSummary_0_)
{
Throwable throwable = p_makeSummary_0_.getCrashCause();
if (throwable == null)
{
return "Unknown";
}
else
{
StackTraceElement[] astacktraceelement = throwable.getStackTrace();
String s = "unknown";
if (astacktraceelement.length > 0)
{
s = astacktraceelement[0].toString().trim();
}
String s1 = throwable.getClass().getName() + ": " + throwable.getMessage() + " (" + p_makeSummary_0_.getDescription() + ")" + " [" + s + "]";
return s1;
}
}
示例9: addServerInfoToCrashReport
import net.minecraft.crash.CrashReport; //导入依赖的package包/类
/**
* Adds the server info, including from theWorldServer, to the crash report.
*/
public CrashReport addServerInfoToCrashReport(CrashReport report)
{
report = super.addServerInfoToCrashReport(report);
report.getCategory().addCrashSectionCallable("Is Modded", new Callable<String>()
{
public String call() throws Exception
{
String s = DedicatedServer.this.getServerModName();
return !s.equals("vanilla") ? "Definitely; Server brand changed to \'" + s + "\'" : "Unknown (can\'t tell)";
}
});
report.getCategory().addCrashSectionCallable("Type", new Callable<String>()
{
public String call() throws Exception
{
return "Dedicated Server (map_server.txt)";
}
});
return report;
}
示例10: getWatchedObject
import net.minecraft.crash.CrashReport; //导入依赖的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;
}
示例11: 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.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;
}
示例12: initialize
import net.minecraft.crash.CrashReport; //导入依赖的package包/类
/**
* Method invoked by FML before any other mods are loaded.
*/
public static void initialize()
{
FMLLog.info("MinecraftForge v%s Initialized", ForgeVersion.getVersion());
OreDictionary.getOreName(0);
UsernameCache.load();
// Load before all the mods, so MC owns the MC fluids
FluidRegistry.validateFluidRegistry();
ForgeHooks.initTools();
//For all the normal CrashReport classes to be defined. We're in MC's classloader so this should all be fine
new CrashReport("ThisIsFake", new Exception("Not real"));
}
示例13: renderModel
import net.minecraft.crash.CrashReport; //导入依赖的package包/类
public boolean renderModel(IBlockAccess worldIn, IBakedModel modelIn, IBlockState stateIn, BlockPos posIn, VertexBuffer buffer, boolean checkSides, long rand)
{
boolean flag = Minecraft.isAmbientOcclusionEnabled() && stateIn.getLightValue() == 0 && modelIn.isAmbientOcclusion();
try
{
return flag ? this.renderModelSmooth(worldIn, modelIn, stateIn, posIn, buffer, checkSides, rand) : this.renderModelFlat(worldIn, modelIn, stateIn, posIn, buffer, checkSides, rand);
}
catch (Throwable throwable)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Tesselating block model");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Block model being tesselated");
CrashReportCategory.addBlockInfo(crashreportcategory, posIn, stateIn);
crashreportcategory.addCrashSection("Using AO", Boolean.valueOf(flag));
throw new ReportedException(crashreport);
}
}
示例14: 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
{
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);
}
}
}
示例15: ModManager
import net.minecraft.crash.CrashReport; //导入依赖的package包/类
public ModManager()
{
try
{
for(Field field : ModManager.class.getFields())
if(field.getName().endsWith("Mod"))
{
Mod mod = (Mod)field.get(this);
mods.put(mod.getName(), mod);
mod.initSettings();
}
}catch(Exception e)
{
throw new ReportedException(
CrashReport.makeCrashReport(e, "Initializing Wurst mods"));
}
}