sp614x / optifine

1.79k stars 418 forks source link

[1.8.9] Game crashes for all nearby players when breaking Immersive Engineering multiblock structure #224

Open petakii opened 8 years ago

petakii commented 8 years ago

A crash happens in 1.8.9 (latest IE version) when you break a multiblock structure (any type, doesn't matter). All nearby players are dropped down and the game crashes.

Crash log: http://pastebin.com/VipmuuWM

I don't know if the 1.8.9 is updated still, but I think it would remain the same if IE releases 1.9/1.10 version.

sp614x commented 8 years ago

The crash is inside IE when rendering a Metal Press. It tries to set a property "dynamicrender" in a piston block state which only supports properties "extended" and "facing". Not related to optifine.

malte0811 commented 8 years ago

From the crash I would guess that the metal press tile render is called for a piston block. Maybe Optifine changes the point at which the TE is removed? Or calls the TESR once after the TE is removed? While this does not happen without Optifine AFAIK, it might be fixable, the metal press TESR is missing a check to see whether the press is formed... Wait, any IE multiblock? Have you tried a sheetmetal tank? If that crashes, then I don't know how to fix it.

MrCrayfish commented 7 years ago

I believe this is still genuinely an issue. I've experienced a similar problem everytime I want to access a property from a block state, and to fix it I've got to add an extra check just because Optifine is installed.

The crash occurs when the block is destroyed. When Optifine is installed, TESR seems to get an extra call. The block at the TE's position is air.

java.lang.IllegalArgumentException: Cannot get property PropertyDirection{name=facing, clazz=class net.minecraft.util.EnumFacing, values=[north, south, west, east]} as it does not exist in BlockStateContainer{block=minecraft:air, properties=[]}
    at net.minecraft.block.state.BlockStateContainer$StateImplementation.func_177229_b(BlockStateContainer.java:197)
    at com.mrcrayfish.skateboarding.block.BlockCornerSlope.func_176201_c(BlockCornerSlope.java:215)
    at com.mrcrayfish.skateboarding.tileentity.renderer.CornerSlopeRenderer.renderTileEntityAt(CornerSlopeRenderer.java:31)
    at com.mrcrayfish.skateboarding.tileentity.renderer.CornerSlopeRenderer.func_180535_a(CornerSlopeRenderer.java:22)
    at net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.func_178469_a(TileEntityRendererDispatcher.java:142)
    at net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.func_180546_a(TileEntityRendererDispatcher.java:120)
    at net.minecraft.client.renderer.RenderGlobal.func_180446_a(RenderGlobal.java:988)
    at shadersmod.client.ShadersRender.renderShadowMap(ShadersRender.java:349)
    at shadersmod.client.Shaders.beginRender(Shaders.java:3735)
    at net.minecraft.client.renderer.EntityRenderer.func_78471_a(EntityRenderer.java:1534)
    at net.minecraft.client.renderer.EntityRenderer.func_181560_a(EntityRenderer.java:1334)
    at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1077)
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:369)
    at net.minecraft.client.main.Main.main(SourceFile:124)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
@Override
    public void renderTileEntityAt(TileEntityCornerSlope te, double x, double y, double z, float partialTicks, int destroyStage) 
    {
        IBlockState state = te.getWorld().getBlockState(te.getPos());
        int meta = te.getBlockType().getMetaFromState(state);
                ...
sp614x commented 7 years ago

This looks like a race condition between TE add/remove and TESR rendering. No idea why it should behave differently with OptiFine.