本文整理匯總了Java中net.minecraft.crash.CrashReport.makeCategory方法的典型用法代碼示例。如果您正苦於以下問題:Java CrashReport.makeCategory方法的具體用法?Java CrashReport.makeCategory怎麽用?Java CrashReport.makeCategory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.crash.CrashReport
的用法示例。
在下文中一共展示了CrashReport.makeCategory方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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);
}
}
示例2: fire
import net.minecraft.crash.CrashReport; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
public <T extends Event> void fire(T event)
{
if(!WurstClient.INSTANCE.isEnabled())
return;
try
{
event.fire(listenerMap.get(event.getListenerType()));
}catch(Throwable e)
{
e.printStackTrace();
CrashReport report =
CrashReport.makeCrashReport(e, "Firing Wurst event");
CrashReportCategory category =
report.makeCategory("Affected event");
category.setDetail("Event class", () -> event.getClass().getName());
throw new ReportedException(report);
}
}
示例3: getBiomesForGeneration
import net.minecraft.crash.CrashReport; //導入方法依賴的package包/類
@Override
public Biome[] getBiomesForGeneration(Biome[] biomes, int x, int z, int width, int height)
{
IntCache.resetIntCache();
if (biomes == null || biomes.length < width * height)
{
biomes = new Biome[width * height];
}
int[] aint = this.genBiomes.getInts(x, z, width, height);
try
{
for (int i = 0; i < width * height; ++i)
{
biomes[i] = swapHackBiome(Biome.getBiome(aint[i], Biomes.DEFAULT));
}
return biomes;
}
catch (Throwable throwable)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id");
CrashReportCategory crashreportcategory = crashreport.makeCategory("RawBiomeBlock");
crashreportcategory.addCrashSection("biomes[] size", biomes.length);
crashreportcategory.addCrashSection("x", x);
crashreportcategory.addCrashSection("z", z);
crashreportcategory.addCrashSection("w", width);
crashreportcategory.addCrashSection("h", height);
throw new ReportedException(crashreport);
}
}
示例4: provideChunk
import net.minecraft.crash.CrashReport; //導入方法依賴的package包/類
public Chunk provideChunk(int x, int z)
{
Chunk chunk = this.loadChunk(x, z);
if (chunk == null)
{
long i = ChunkPos.asLong(x, z);
try
{
chunk = this.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", this.chunkGenerator);
throw new ReportedException(crashreport);
}
this.id2ChunkMap.put(i, chunk);
chunk.onChunkLoad();
chunk.populateChunk(this, this.chunkGenerator);
}
return chunk;
}
示例5: 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);
}
}
示例6: sendPacket
import net.minecraft.crash.CrashReport; //導入方法依賴的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);
}
}
示例7: sendPacket
import net.minecraft.crash.CrashReport; //導入方法依賴的package包/類
public void sendPacket(final Packet packetIn)
{
if (packetIn instanceof S02PacketChat)
{
S02PacketChat s02packetchat = (S02PacketChat)packetIn;
EntityPlayer.EnumChatVisibility entityplayer$enumchatvisibility = this.playerEntity.getChatVisibility();
if (entityplayer$enumchatvisibility == EntityPlayer.EnumChatVisibility.HIDDEN)
{
return;
}
if (entityplayer$enumchatvisibility == EntityPlayer.EnumChatVisibility.SYSTEM && !s02packetchat.isChat())
{
return;
}
}
try
{
this.netManager.sendPacket(packetIn);
}
catch (Throwable throwable)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Sending packet");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Packet being sent");
crashreportcategory.addCrashSectionCallable("Packet class", new Callable<String>()
{
public String call() throws Exception
{
return packetIn.getClass().getCanonicalName();
}
});
throw new ReportedException(crashreport);
}
}
示例8: tickParticle
import net.minecraft.crash.CrashReport; //導入方法依賴的package包/類
private void tickParticle(final EntityFX p_178923_1_)
{
try
{
p_178923_1_.onUpdate();
}
catch (Throwable throwable)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Ticking Particle");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Particle being ticked");
final int i = p_178923_1_.getFXLayer();
crashreportcategory.addCrashSectionCallable("Particle", new Callable<String>()
{
public String call() throws Exception
{
return p_178923_1_.toString();
}
});
crashreportcategory.addCrashSectionCallable("Particle Type", new Callable<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);
}
}
示例9: setBlocked
import net.minecraft.crash.CrashReport; //導入方法依賴的package包/類
public void setBlocked(boolean blocked)
{
this.blocked = blocked;
active = enabled && !blocked;
if(!(this instanceof NavigatorMod))
UIRenderer.modList.updateState(this);
if(enabled)
try
{
onToggle();
if(blocked)
onDisable();
else
onEnable();
}catch(Throwable e)
{
CrashReport report =
CrashReport.makeCrashReport(e, "Toggling Wurst mod");
CrashReportCategory category =
report.makeCategory("Affected mod");
category.setDetail("Mod name", () -> name);
category.setDetail("Attempted action",
() -> blocked ? "Block" : "Unblock");
throw new ReportedException(report);
}
}
示例10: areBiomesViable
import net.minecraft.crash.CrashReport; //導入方法依賴的package包/類
@Override
public boolean areBiomesViable(int x, int z, int radius, List<Biome> allowed)
{
IntCache.resetIntCache();
int xmin = x - (radius >> 2);
int zmin = z - (radius >> 2);
int xmax = x + (radius >> 2);
int zmax = z + (radius >> 2);
int xdiff = xmax - xmin + 1;
int zdiff = zmax - zmin + 1;
Biome[] biomes = this.getBiomes(null, xmin,zmin,xdiff,zdiff, true);
try
{
for (int index = 0; index < xdiff * zdiff; ++index)
{
if (!allowed.contains(biomes[index]))
{
return false;
}
}
return true;
}
catch (Throwable throwable)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Layer");
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);
}
}
示例11: renderItemAndEffectIntoGUI
import net.minecraft.crash.CrashReport; //導入方法依賴的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_.func_190926_b())
{
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;
}
}
示例12: networkTick
import net.minecraft.crash.CrashReport; //導入方法依賴的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: getBlockState
import net.minecraft.crash.CrashReport; //導入方法依賴的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);
}
}
}
示例14: run
import net.minecraft.crash.CrashReport; //導入方法依賴的package包/類
public void run()
{
this.running = true;
try
{
this.startGame();
}
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: onUpdateEntity
import net.minecraft.crash.CrashReport; //導入方法依賴的package包/類
public void onUpdateEntity()
{
try
{
super.onUpdate();
for (int i = 0; i < this.inventory.getSizeInventory(); ++i)
{
ItemStack itemstack = this.inventory.getStackInSlot(i);
if (itemstack != null && itemstack.getItem().isMap())
{
Packet packet = ((ItemMapBase)itemstack.getItem()).createMapDataPacket(itemstack, this.worldObj, this);
if (packet != null)
{
this.playerNetServerHandler.sendPacket(packet);
}
}
}
if (this.getHealth() != this.lastHealth || this.lastFoodLevel != this.foodStats.getFoodLevel() || this.foodStats.getSaturationLevel() == 0.0F != this.wasHungry)
{
this.playerNetServerHandler.sendPacket(new S06PacketUpdateHealth(this.getHealth(), this.foodStats.getFoodLevel(), this.foodStats.getSaturationLevel()));
this.lastHealth = this.getHealth();
this.lastFoodLevel = this.foodStats.getFoodLevel();
this.wasHungry = this.foodStats.getSaturationLevel() == 0.0F;
}
if (this.getHealth() + this.getAbsorptionAmount() != this.combinedHealth)
{
this.combinedHealth = this.getHealth() + this.getAbsorptionAmount();
for (ScoreObjective scoreobjective : this.getWorldScoreboard().getObjectivesFromCriteria(IScoreObjectiveCriteria.health))
{
this.getWorldScoreboard().getValueFromObjective(this.getName(), scoreobjective).func_96651_a(Arrays.<EntityPlayer>asList(new EntityPlayer[] {this}));
}
}
if (this.experienceTotal != this.lastExperience)
{
this.lastExperience = this.experienceTotal;
this.playerNetServerHandler.sendPacket(new S1FPacketSetExperience(this.experience, this.experienceTotal, this.experienceLevel));
}
if (this.ticksExisted % 20 * 5 == 0 && !this.getStatFile().hasAchievementUnlocked(AchievementList.exploreAllBiomes))
{
this.updateBiomesExplored();
}
}
catch (Throwable throwable)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Ticking player");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Player being ticked");
this.addEntityCrashInfo(crashreportcategory);
throw new ReportedException(crashreport);
}
}