Skip to content

Commit

Permalink
Refresh client caches when fancy graphics changes ( leaf fix )
Browse files Browse the repository at this point in the history
Clear Side Cache as well, this was a missing cache clear.
  • Loading branch information
AlgorithmX2 committed Dec 27, 2016
1 parent dabbcea commit cb0b67b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Expand Up @@ -317,6 +317,7 @@ public void clearCache()
modelCache[l.ordinal()].clear();
}

sideCache.clear();
solidCache.clear();
itemToModel.clear();
}
Expand Down
Expand Up @@ -23,6 +23,7 @@
import mod.chiselsandbits.chiseledblock.EnumTESRRenderState;
import mod.chiselsandbits.chiseledblock.TileEntityBlockChiseled;
import mod.chiselsandbits.chiseledblock.TileEntityBlockChiseledTESR;
import mod.chiselsandbits.chiseledblock.data.VoxelBlob;
import mod.chiselsandbits.core.ChiselsAndBits;
import mod.chiselsandbits.core.ClientSide;
import mod.chiselsandbits.core.Log;
Expand Down Expand Up @@ -220,13 +221,24 @@ public void debugScreen(
}
}

int lastFancy = -1;

@SubscribeEvent
public void nextFrame(
final RenderWorldLastEvent e )
{
runJobs( getTracker().nextFrameTasks );

uploadDisplaylists();

// this seemingly stupid check fixes leaves, other wise we use fast
// until the atlas refreshes.
final int currentFancy = Minecraft.getMinecraft().gameSettings.fancyGraphics ? 1 : 0;
if ( currentFancy != lastFancy )
{
lastFancy = currentFancy;
VoxelBlob.clearCache();
}
}

private void uploadDisplaylists()
Expand Down

0 comments on commit cb0b67b

Please sign in to comment.