Java Code Examples for net.minecraft.crash.CrashReportCategory#addCrashSection()

The following examples show how to use net.minecraft.crash.CrashReportCategory#addCrashSection() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GenLayerTofu.java    From TofuCraftReload with MIT License 6 votes vote down vote up
protected static boolean compareBiomesById(final int p_151616_0_, final int p_151616_1_)
{
    if (p_151616_0_ == p_151616_1_)
    {
        return true;
    }
    else
    {
        try
        {
            return BiomeTofu.getBiome(p_151616_0_) != null && BiomeTofu.getBiome(p_151616_1_) != null ? isEqualTo(BiomeTofu.getBiome(p_151616_0_), BiomeTofu.getBiome(p_151616_1_)) : 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(p_151616_0_));
            crashreportcategory.addCrashSection("Biome B ID", Integer.valueOf(p_151616_1_));
            throw new ReportedException(crashreport);
        }
    }
}
 
Example 2
Source File: BlockModelRendererSchematic.java    From litematica with GNU Lesser General Public License v3.0 6 votes vote down vote up
public boolean renderModel(IBlockAccess worldIn, IBakedModel modelIn, IBlockState stateIn, BlockPos posIn, BufferBuilder buffer)
{
    boolean ao = Minecraft.isAmbientOcclusionEnabled() && stateIn.getLightValue() == 0 && modelIn.isAmbientOcclusion();
    long rand = MathHelper.getPositionRandom(posIn);

    try
    {
        if (ao)
        {
            return this.renderModelSmooth(worldIn, modelIn, stateIn, posIn, buffer, rand);
        }
        else
        {
            return this.renderModelFlat(worldIn, modelIn, stateIn, posIn, buffer, 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(ao));
        throw new ReportedException(crashreport);
    }
}
 
Example 3
Source File: Entity.java    From TickDynamic with MIT License 6 votes vote down vote up
public void addEntityCrashInfo(CrashReportCategory p_85029_1_)
{
    p_85029_1_.addCrashSectionCallable("Entity Type", new Callable()
    {
        private static final String __OBFID = "CL_00001534";
        public String call()
        {
            return EntityList.getEntityString(Entity.this) + " (" + Entity.this.getClass().getCanonicalName() + ")";
        }
    });
    p_85029_1_.addCrashSection("Entity ID", Integer.valueOf(this.entityId));
    p_85029_1_.addCrashSectionCallable("Entity Name", new Callable()
    {
        private static final String __OBFID = "CL_00001535";
        public String call()
        {
            return Entity.this.getCommandSenderName();
        }
    });
    p_85029_1_.addCrashSection("Entity\'s Exact location", String.format("%.2f, %.2f, %.2f", new Object[] {Double.valueOf(this.posX), Double.valueOf(this.posY), Double.valueOf(this.posZ)}));
    p_85029_1_.addCrashSection("Entity\'s Block location", CrashReportCategory.getLocationInfo(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)));
    p_85029_1_.addCrashSection("Entity\'s Momentum", String.format("%.2f, %.2f, %.2f", new Object[] {Double.valueOf(this.motionX), Double.valueOf(this.motionY), Double.valueOf(this.motionZ)}));
}
 
Example 4
Source File: BiomeProviderTofu.java    From TofuCraftReload with MIT License 5 votes vote down vote up
/**
 * Returns an array of biomes for the location input.
 */
@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] = Biome.getBiome(aint[i], TofuBiomes.TOFU_RIVER);
        }

        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);
    }
}
 
Example 5
Source File: BiomeProviderTofu.java    From TofuCraftReload with MIT License 5 votes vote down vote up
/**
 * checks given Chunk's Biomes against List of allowed ones
 */
@Override
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);
    }
}
 
Example 6
Source File: ChunkManagerPlanet.java    From AdvancedRocketry with MIT License 5 votes vote down vote up
public Biome[] getBiomesForGeneration(Biome[] biomes, int x, int z, int width, int height)
{
	GenLayerBiomePlanet.setupBiomesForUse(this.biomes);
	//return super.getBiomesForGeneration(p_76937_1_, p_76937_2_, p_76937_3_, p_76937_4_, p_76937_5_);

	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 i1 = 0; i1 < width * height; ++i1)
		{
			biomes[i1] = Biome.getBiome(aint[i1], Biomes.OCEAN);//AdvancedRocketryBiomes.instance.getBiomeById(aint[i1]);
		}

		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);
	}
}
 
Example 7
Source File: HyperiumCrashReport.java    From Hyperium with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void add() {
    CrashReportCategory category = parent.makeCategoryDepth("Affected level", 1);
    category.addCrashSection("Hyperium Version", Metadata.getVersion() + " (" + Metadata.getVersionID() + ")");
    category.addCrashSection("Everything else", CommandDebug.get());
}