net.minecraft.crash.CrashReport Java Examples

The following examples show how to use net.minecraft.crash.CrashReport. 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: MixinMinecraft.java    From VanillaFix with MIT License 6 votes vote down vote up
public void displayCrashScreen(CrashReport report) {
    try {
        CrashUtils.outputReport(report);

        // Reset hasCrashed, debugCrashKeyPressTime, and crashIntegratedServerNextTick
        hasCrashed = false;
        debugCrashKeyPressTime = -1;
        crashIntegratedServerNextTick = false;

        // Vanilla does this when switching to main menu but not our custom crash screen
        // nor the out of memory screen (see https://bugs.mojang.com/browse/MC-128953)
        gameSettings.showDebugInfo = false;
        ingameGUI.getChatGUI().clearChatMessages(true);

        // Display the crash screen
        runGUILoop(new GuiCrashScreen(report));
    } catch (Throwable t) {
        // The crash screen has crashed. Report it normally instead.
        LOGGER.error("An uncaught exception occured while displaying the crash screen, making normal report instead", t);
        displayCrashReport(report);
        System.exit(report.getFile() != null ? -1 : -2);
    }
}
 
Example #2
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 #3
Source File: ChargebackStopper.java    From Hyperium with GNU Lesser General Public License v3.0 6 votes vote down vote up
public ChargebackStopper() {
    Multithreading.runAsync(() -> {
            UUID clientUUID = UUIDUtil.getClientUUID();
            if (clientUUID != null) {
                JsonHolder holder = Utils.get("https://api.hyperium.cc/banned");
                JsonArray bans = holder.optJSONArray("bans");

                for (JsonElement ban : bans) {
                    JsonHolder holder1 = new JsonHolder(ban.getAsJsonObject());
                    if (holder1.optString("uuid").equalsIgnoreCase(clientUUID.toString())) {
                        //Banned
                        Minecraft.getMinecraft().crashed(new CrashReport(
                            "You are currently blocked from using Hyperium for a chargeback." +
                                " Please contact Hyperium Administrators to resolve this.", new Throwable()));
                    }
                }
            }
        }
    );
}
 
Example #4
Source File: ChunkRenderWorkerLitematica.java    From litematica with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public void run()
{
    while (this.shouldRun)
    {
        try
        {
            this.processTask(this.chunkRenderDispatcher.getNextChunkUpdate());
        }
        catch (InterruptedException e)
        {
            LOGGER.debug("Stopping chunk worker due to interrupt");
            return;
        }
        catch (Throwable throwable)
        {
            CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Batching chunks");
            Minecraft.getMinecraft().crashed(Minecraft.getMinecraft().addGraphicsAndWorldToCrashReport(crashreport));
            return;
        }
    }
}
 
Example #5
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 #6
Source File: MixinUtil.java    From VanillaFix with MIT License 6 votes vote down vote up
/**
 * @reason Warn the player (configurable to crash or log too) instead of only logging a
 * message a scheduled task throws an exception. The default vanilla behaviour is dangerous
 * as things will fail silently, making future bugs much harder to solve. In fact, it may
 * actually be a vanilla bug that the client doesn't crash, since they are using the "fatal"
 * log level, which is otherwise used only for problems which crash the game.
 */
@Overwrite
@Nullable
// TODO: Utils shouldn't depend on minecraft, redirect individual calls to runTask instead
public static <V> V runTask(FutureTask<V> task, Logger logger) {
    task.run();
    try {
        return task.get();
    } catch (InterruptedException | ExecutionException e) {
        ModConfig.ProblemAction action = ModConfig.crashes.scheduledTaskAction;

        if (action == ModConfig.ProblemAction.CRASH) {
            CrashUtils.crash(new CrashReport("Error executing task", e));
        } else if (action == ModConfig.ProblemAction.WARNING_SCREEN) {
            CrashUtils.warn(new CrashReport("Error executing task", e));
        } else if (action == ModConfig.ProblemAction.NOTIFICATION) {
            CrashUtils.notify(new CrashReport("Error executing task", e));
        } else if (action == ModConfig.ProblemAction.LOG) {
            logger.fatal("Error executing task", e);
        }
        return null;
    }
}
 
Example #7
Source File: CrashUtils.java    From VanillaFix with MIT License 6 votes vote down vote up
public static void outputReport(CrashReport report) {
    try {
        if (report.getFile() == null) {
            String reportName = "crash-";
            reportName += new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss").format(new Date());
            reportName += Minecraft.getMinecraft().isCallingFromMinecraftThread() ? "-client" : "-server";
            reportName += ".txt";

            File reportsDir = isClient() ? new File(Minecraft.getMinecraft().gameDir, "crash-reports") : new File("crash-reports");
            File reportFile = new File(reportsDir, reportName);

            report.saveToFile(reportFile);
        }
    } catch (Throwable e) {
        log.fatal("Failed saving report", e);
    }

    log.fatal("Minecraft ran into a problem! " + (report.getFile() != null ? "Report saved to: " + report.getFile() : "Crash report could not be saved.")
            + "\n" + report.getCompleteReport());
}
 
Example #8
Source File: Entity.java    From TickDynamic with MIT License 5 votes vote down vote up
protected void func_145775_I()
{
    int i = MathHelper.floor_double(this.boundingBox.minX + 0.001D);
    int j = MathHelper.floor_double(this.boundingBox.minY + 0.001D);
    int k = MathHelper.floor_double(this.boundingBox.minZ + 0.001D);
    int l = MathHelper.floor_double(this.boundingBox.maxX - 0.001D);
    int i1 = MathHelper.floor_double(this.boundingBox.maxY - 0.001D);
    int j1 = MathHelper.floor_double(this.boundingBox.maxZ - 0.001D);

    if (this.worldObj.checkChunksExist(i, j, k, l, i1, j1))
    {
        for (int k1 = i; k1 <= l; ++k1)
        {
            for (int l1 = j; l1 <= i1; ++l1)
            {
                for (int i2 = k; i2 <= j1; ++i2)
                {
                    Block block = this.worldObj.getBlock(k1, l1, i2);

                    try
                    {
                        block.onEntityCollidedWithBlock(this.worldObj, k1, l1, i2, this);
                    }
                    catch (Throwable throwable)
                    {
                        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Colliding entity with block");
                        CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being collided with");
                        CrashReportCategory.func_147153_a(crashreportcategory, k1, l1, i2, block, this.worldObj.getBlockMetadata(k1, l1, i2));
                        throw new ReportedException(crashreport);
                    }
                }
            }
        }
    }
}
 
Example #9
Source File: MixinIntegratedServer.java    From VanillaFix with MIT License 5 votes vote down vote up
/**
 * @reason Checks if an integrated server crash was scheduled for this tick by the
 * client, if Alt + F3 + C was pressed.
 */
@Inject(method = "tick", at = @At("HEAD"))
private void beforeTick(CallbackInfo ci) {
    if (((IPatchedMinecraft) mc).shouldCrashIntegratedServerNextTick()) {
        throw new ReportedException(new CrashReport("Manually triggered server-side debug crash", new Throwable()));
    }
}
 
Example #10
Source File: MixinMinecraft.java    From VanillaFix with MIT License 5 votes vote down vote up
/**
 * @reason Replaces the vanilla F3 + C logic to immediately crash rather than requiring
 * that the buttons are pressed for 6 seconds and add more crash types:
 * F3 + C - Client crash
 * Alt + F3 + C - Integrated server crash
 * Shift + F3 + C - Scheduled client task exception
 * Alt + Shift + F3 + C - Scheduled server task exception
 * <p>
 * Note: Left Shift + F3 + C doesn't work on most keyboards, see http://keyboardchecker.com/
 * Use the right shift instead.
 * <p>
 * TODO: Make this work outside the game too (for example on the main menu).
 */
@Redirect(method = "runTickKeyboard", at = @At(value = "FIELD", target = "Lnet/minecraft/client/Minecraft;debugCrashKeyPressTime:J", ordinal = 0))
private long checkForF3C(Minecraft mc) {
    // Fix: Check if keys are down before checking time pressed
    if (Keyboard.isKeyDown(Keyboard.KEY_F3) && Keyboard.isKeyDown(Keyboard.KEY_C)) {
        debugCrashKeyPressTime = getSystemTime();
        actionKeyF3 = true;
    } else {
        debugCrashKeyPressTime = -1L;
    }

    if (debugCrashKeyPressTime > 0L) {
        if (getSystemTime() - debugCrashKeyPressTime >= 0) {
            if (GuiScreen.isShiftKeyDown()) {
                if (GuiScreen.isAltKeyDown()) {
                    if (integratedServerIsRunning) integratedServer.addScheduledTask(() -> {
                        throw new ReportedException(new CrashReport("Manually triggered server-side scheduled task exception", new Throwable()));
                    });
                } else {
                    scheduledTasks.add(ListenableFutureTask.create(() -> {
                        throw new ReportedException(new CrashReport("Manually triggered client-side scheduled task exception", new Throwable()));
                    }));
                }
            } else {
                if (GuiScreen.isAltKeyDown()) {
                    if (integratedServerIsRunning) crashIntegratedServerNextTick = true;
                } else {
                    throw new ReportedException(new CrashReport("Manually triggered client-side debug crash", new Throwable()));
                }
            }
        }
    }
    return -1;
}
 
Example #11
Source File: MixinMinecraft.java    From VanillaFix with MIT License 5 votes vote down vote up
@Override
public void makeErrorNotification(CrashReport report) {
    if (ModConfig.crashes.replaceErrorNotifications) {
        ProblemToast lastToast = getToastGui().getToast(ProblemToast.class, IToast.NO_TOKEN);
        if (lastToast != null) lastToast.hide = true;
    }

    getToastGui().add(new ProblemToast(report));
}
 
Example #12
Source File: CrashUtils.java    From VanillaFix with MIT License 5 votes vote down vote up
public static void notify(CrashReport report) {
    if (isClient()) {
        outputReport(report);

        ((IPatchedMinecraft) Minecraft.getMinecraft()).makeErrorNotification(report);
    } else {
        log.fatal(report.getDescription(), report.getCrashCause());
    }
}
 
Example #13
Source File: CrashUtils.java    From VanillaFix with MIT License 5 votes vote down vote up
public static void warn(CrashReport report) {
    if (isClient()) {
        outputReport(report);
        // Don't inline showWarningScreen, that will cause Java to load the GuiScreen
        // class on servers, because of the lambda!
        ((IPatchedMinecraft) Minecraft.getMinecraft()).showWarningScreen(report);
        } else {
        log.fatal(report.getDescription(), report.getCrashCause());
    }
}
 
Example #14
Source File: RenderGlobalSchematic.java    From litematica with GNU Lesser General Public License v3.0 5 votes vote down vote up
public boolean renderBlock(IBlockState state, BlockPos pos, IBlockAccess blockAccess, BufferBuilder bufferBuilderIn)
{
    try
    {
        EnumBlockRenderType renderType = state.getRenderType();

        if (renderType == EnumBlockRenderType.INVISIBLE)
        {
            return false;
        }
        else
        {
            switch (renderType)
            {
                case MODEL:
                    return this.blockModelRenderer.renderModel(blockAccess, this.getModelForState(state), state, pos, bufferBuilderIn);
                case ENTITYBLOCK_ANIMATED:
                    return false;
                case LIQUID:
                    return this.fluidRenderer.renderFluid(blockAccess, state, pos, bufferBuilderIn);
                default:
                    return false;
            }
        }
    }
    catch (Throwable throwable)
    {
        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Tesselating block in world");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being tesselated");
        CrashReportCategory.addBlockInfo(crashreportcategory, pos, state.getBlock(), state.getBlock().getMetaFromState(state));
        throw new ReportedException(crashreport);
    }
}
 
Example #15
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 #16
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 #17
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 #18
Source File: MixinBlockModelRenderer.java    From MinecraftX-RAY with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Inject(method="renderModel", at=@At("HEAD"), cancellable=true)
private void onRenderModel(IBlockAccess worldIn, IBakedModel modelIn, IBlockState stateIn, BlockPos posIn, WorldRenderer buffer, boolean checkSides, CallbackInfoReturnable<Boolean> ci) {
    if (UyjuliansXrayModMain.xrayEnabled()) {
        Block blockIn = stateIn.getBlock();
        if (!UyjuliansXrayModMain.checkBlockList(blockIn)) {
            try {
                boolean flag = false;
                BitSet bitset = new BitSet(3);

                for (EnumFacing enumfacing : EnumFacing.values())
                {
                    List<BakedQuad> list = modelIn.func_177551_a(enumfacing);

                    if (!list.isEmpty())
                    {
                        BlockPos blockpos = posIn.offset(enumfacing);

                        if (!checkSides || UyjuliansXrayModMain.checkBlockList(worldIn.getBlockState(posIn.offset(enumfacing)).getBlock()))
                        {
                            int i = 15 << 20 | 15 << 4;
                            this.func_178260_a(worldIn, blockIn, posIn, enumfacing, i, false, buffer, list, bitset);
                            flag = true;
                        }
                    }
                }

                List<BakedQuad> list1 = modelIn.func_177550_a();

                if (list1.size() > 0)
                {
                    this.func_178260_a(worldIn, blockIn, posIn, null, -1, true, buffer, list1, bitset);
                    flag = true;
                }

                ci.setReturnValue(flag);
            } catch (Throwable throwable) {
                CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Tesselating block model while using uyjulian's X-ray mod");
                CrashReportCategory crashreportcategory = crashreport.makeCategory("Block model being tesselated");
                CrashReportCategory.addBlockInfo(crashreportcategory, posIn, stateIn);
                throw new ReportedException(crashreport);
            }
        }
        else {
            ci.setReturnValue(false);
        }
    }
}
 
Example #19
Source File: Entity.java    From TickDynamic with MIT License 4 votes vote down vote up
/**
 * Save the entity to NBT (calls an abstract helper method to write extra data)
 */
public void writeToNBT(NBTTagCompound p_70109_1_)
{
    try
    {
        p_70109_1_.setTag("Pos", this.newDoubleNBTList(new double[] {this.posX, this.posY + (double)this.ySize, this.posZ}));
        p_70109_1_.setTag("Motion", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ}));
        p_70109_1_.setTag("Rotation", this.newFloatNBTList(new float[] {this.rotationYaw, this.rotationPitch}));
        p_70109_1_.setFloat("FallDistance", this.fallDistance);
        p_70109_1_.setShort("Fire", (short)this.fire);
        p_70109_1_.setShort("Air", (short)this.getAir());
        p_70109_1_.setBoolean("OnGround", this.onGround);
        p_70109_1_.setInteger("Dimension", this.dimension);
        p_70109_1_.setBoolean("Invulnerable", this.invulnerable);
        p_70109_1_.setInteger("PortalCooldown", this.timeUntilPortal);
        p_70109_1_.setLong("UUIDMost", this.getUniqueID().getMostSignificantBits());
        p_70109_1_.setLong("UUIDLeast", this.getUniqueID().getLeastSignificantBits());
        if (customEntityData != null)
        {
            p_70109_1_.setTag("ForgeData", customEntityData);
        }

       for (String identifier : this.extendedProperties.keySet())
       {
            try
            {
                IExtendedEntityProperties props = this.extendedProperties.get(identifier);
                props.saveNBTData(p_70109_1_);
            }
            catch (Throwable t)
            {
                FMLLog.severe("Failed to save extended properties for %s.  This is a mod issue.", identifier);
                t.printStackTrace();
            }
        }

       this.writeEntityToNBT(p_70109_1_);

        if (this.ridingEntity != null)
        {
            NBTTagCompound nbttagcompound1 = new NBTTagCompound();

            if (this.ridingEntity.writeMountToNBT(nbttagcompound1))
            {
                p_70109_1_.setTag("Riding", nbttagcompound1);
            }
        }
    }
    catch (Throwable throwable)
    {
        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Saving entity NBT");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("Entity being saved");
        this.addEntityCrashInfo(crashreportcategory);
        throw new ReportedException(crashreport);
    }
}
 
Example #20
Source File: Entity.java    From TickDynamic with MIT License 4 votes vote down vote up
/**
 * Reads the entity from NBT (calls an abstract helper method to read specialized data)
 */
public void readFromNBT(NBTTagCompound p_70020_1_)
{
    try
    {
        NBTTagList nbttaglist = p_70020_1_.getTagList("Pos", 6);
        NBTTagList nbttaglist1 = p_70020_1_.getTagList("Motion", 6);
        NBTTagList nbttaglist2 = p_70020_1_.getTagList("Rotation", 5);
        this.motionX = nbttaglist1.func_150309_d(0);
        this.motionY = nbttaglist1.func_150309_d(1);
        this.motionZ = nbttaglist1.func_150309_d(2);

        if (Math.abs(this.motionX) > 10.0D)
        {
            this.motionX = 0.0D;
        }

        if (Math.abs(this.motionY) > 10.0D)
        {
            this.motionY = 0.0D;
        }

        if (Math.abs(this.motionZ) > 10.0D)
        {
            this.motionZ = 0.0D;
        }

        this.prevPosX = this.lastTickPosX = this.posX = nbttaglist.func_150309_d(0);
        this.prevPosY = this.lastTickPosY = this.posY = nbttaglist.func_150309_d(1);
        this.prevPosZ = this.lastTickPosZ = this.posZ = nbttaglist.func_150309_d(2);
        this.prevRotationYaw = this.rotationYaw = nbttaglist2.func_150308_e(0);
        this.prevRotationPitch = this.rotationPitch = nbttaglist2.func_150308_e(1);
        this.fallDistance = p_70020_1_.getFloat("FallDistance");
        this.fire = p_70020_1_.getShort("Fire");
        this.setAir(p_70020_1_.getShort("Air"));
        this.onGround = p_70020_1_.getBoolean("OnGround");
        this.dimension = p_70020_1_.getInteger("Dimension");
        this.invulnerable = p_70020_1_.getBoolean("Invulnerable");
        this.timeUntilPortal = p_70020_1_.getInteger("PortalCooldown");

        if (p_70020_1_.hasKey("UUIDMost", 4) && p_70020_1_.hasKey("UUIDLeast", 4))
        {
            this.entityUniqueID = new UUID(p_70020_1_.getLong("UUIDMost"), p_70020_1_.getLong("UUIDLeast"));
        }

        this.setPosition(this.posX, this.posY, this.posZ);
        this.setRotation(this.rotationYaw, this.rotationPitch);
        if (p_70020_1_.hasKey("ForgeData"))
        {
            customEntityData = p_70020_1_.getCompoundTag("ForgeData");
        }

        for (String identifier : this.extendedProperties.keySet())
        {
            try
            {
                IExtendedEntityProperties props = this.extendedProperties.get(identifier);
                props.loadNBTData(p_70020_1_);
            }
            catch (Throwable t)
            {
                FMLLog.severe("Failed to load extended properties for %s.  This is a mod issue.", identifier);
                t.printStackTrace();
            }
        }

        //Rawr, legacy code, Vanilla added a UUID, keep this so older maps will convert properly
        if (p_70020_1_.hasKey("PersistentIDMSB") && p_70020_1_.hasKey("PersistentIDLSB"))
        {
            this.entityUniqueID = new UUID(p_70020_1_.getLong("PersistentIDMSB"), p_70020_1_.getLong("PersistentIDLSB"));
        }
        this.readEntityFromNBT(p_70020_1_);

        if (this.shouldSetPosAfterLoading())
        {
            this.setPosition(this.posX, this.posY, this.posZ);
        }
    }
    catch (Throwable throwable)
    {
        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Loading entity NBT");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("Entity being loaded");
        this.addEntityCrashInfo(crashreportcategory);
        throw new ReportedException(crashreport);
    }
}
 
Example #21
Source File: MixinMinecraft.java    From VanillaFix with MIT License 4 votes vote down vote up
@Override
public void showWarningScreen(CrashReport report) {
    // TODO: runGuiLoop instead, to prevent errors from happening while the warning screen is open?
    addScheduledTask(() -> displayGuiScreen(new GuiWarningScreen(report, currentScreen)));
}
 
Example #22
Source File: MixinMinecraft.java    From VanillaFix with MIT License 4 votes vote down vote up
@Overwrite
public void displayCrashReport(CrashReport report) {
    CrashUtils.outputReport(report);
}
 
Example #23
Source File: MixinMinecraft.java    From VanillaFix with MIT License 4 votes vote down vote up
public void addInfoToCrash(CrashReport report) {
    report.getCategory().addDetail("Client Crashes Since Restart", () -> String.valueOf(clientCrashCount));
    report.getCategory().addDetail("Integrated Server Crashes Since Restart", () -> String.valueOf(serverCrashCount));
}
 
Example #24
Source File: GuiInitErrorScreen.java    From VanillaFix with MIT License 4 votes vote down vote up
public GuiInitErrorScreen(CrashReport report) {
    super(report);
}
 
Example #25
Source File: GuiCrashScreen.java    From VanillaFix with MIT License 4 votes vote down vote up
public GuiCrashScreen(CrashReport report) {
    super(report);
}
 
Example #26
Source File: ProblemToast.java    From VanillaFix with MIT License 4 votes vote down vote up
public ProblemToast(CrashReport report) {
    this.report = report;
}
 
Example #27
Source File: CrashUtils.java    From VanillaFix with MIT License 4 votes vote down vote up
public static void crash(CrashReport report) {
    throw new ReportedException(report);
}
 
Example #28
Source File: GuiProblemScreen.java    From VanillaFix with MIT License 4 votes vote down vote up
public GuiProblemScreen(CrashReport report) {
    this.report = report;
}
 
Example #29
Source File: GuiWarningScreen.java    From VanillaFix with MIT License 4 votes vote down vote up
public GuiWarningScreen(CrashReport report, GuiScreen nextScreen) {
    super(report);
}
 
Example #30
Source File: MixinMinecraft.java    From Hyperium with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * @author Mojang & Cubxity
 * @reason Hyperium's crash-report screen
 */
@Overwrite
public void displayCrashReport(CrashReport crashReportIn) {
    hyperiumMinecraft.displayCrashReport(crashReportIn);
}