不能引用在封闭作用域中定义的非最终局部变量textureobj

yc0p9oo0  于 2021-06-29  发布在  Java
关注(0)|答案(0)|浏览(183)
public boolean loadTexture(ResourceLocation textureLocation, final ITextureObject textureObj)
{
    boolean flag = true;
    ITextureObject itextureobject = textureObj;

    try
    {
        textureObj.loadTexture(this.theResourceManager);
    }
    catch (IOException ioexception)
    {
        logger.warn((String)("Failed to load texture: " + textureLocation), (Throwable)ioexception);
        itextureobject = TextureUtil.missingTexture;
        this.mapTextureObjects.put(textureLocation, itextureobject);
        flag = false;
    }
    catch (Throwable throwable)
    {
        CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Registering texture");
        CrashReportCategory crashreportcategory = crashreport.makeCategory("Resource location being registered");
        crashreportcategory.addCrashSection("Resource location", textureLocation);
        crashreportcategory.addCrashSectionCallable("Texture object class", new Callable()
        {
            private static final String __OBFID = "CL_00001065";
            public String call() throws Exception
            {
                return textureObj.getClass().getName();
            }
        });
        throw new ReportedException(crashreport);
    }

我在编码时出错了
我最近添加了optfine,由于这个错误,我无法运行我的程序

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题