Skip to content

Commit

Permalink
Fix Model Cache Clearing, and Leaves Fancy/Fast Code, #251
Browse files Browse the repository at this point in the history
  • Loading branch information
AlgorithmX2 committed Mar 25, 2017
1 parent ab733a6 commit ec90ce2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 18 deletions.
19 changes: 3 additions & 16 deletions src/main/java/mod/chiselsandbits/render/SmartModelManager.java
Expand Up @@ -26,22 +26,9 @@ public class SmartModelManager

public SmartModelManager()
{
add( new ResourceLocation( ChiselsAndBits.MODID, "chiseled_iron" ), new ChiseledBlockSmartModel() );
add( new ResourceLocation( ChiselsAndBits.MODID, "chiseled_clay" ), new ChiseledBlockSmartModel() );
add( new ResourceLocation( ChiselsAndBits.MODID, "chiseled_cloth" ), new ChiseledBlockSmartModel() );
add( new ResourceLocation( ChiselsAndBits.MODID, "chiseled_packedIce" ), new ChiseledBlockSmartModel() );
add( new ResourceLocation( ChiselsAndBits.MODID, "chiseled_ice" ), new ChiseledBlockSmartModel() );
add( new ResourceLocation( ChiselsAndBits.MODID, "chiseled_wood" ), new ChiseledBlockSmartModel() );
add( new ResourceLocation( ChiselsAndBits.MODID, "chiseled_rock" ), new ChiseledBlockSmartModel() );
add( new ResourceLocation( ChiselsAndBits.MODID, "chiseled_glass" ), new ChiseledBlockSmartModel() );
add( new ResourceLocation( ChiselsAndBits.MODID, "chiseled_ground" ), new ChiseledBlockSmartModel() );
add( new ResourceLocation( ChiselsAndBits.MODID, "chiseled_sand" ), new ChiseledBlockSmartModel() );
add( new ResourceLocation( ChiselsAndBits.MODID, "chiseled_grass" ), new ChiseledBlockSmartModel() );
add( new ResourceLocation( ChiselsAndBits.MODID, "chiseled_fluid" ), new ChiseledBlockSmartModel() );
add( new ResourceLocation( ChiselsAndBits.MODID, "chiseled_snow" ), new ChiseledBlockSmartModel() );
add( new ResourceLocation( ChiselsAndBits.MODID, "chiseled_leaves" ), new ChiseledBlockSmartModel() );

add( new ResourceLocation( ChiselsAndBits.MODID, "models/item/block_chiseled" ), new ChiseledBlockSmartModel() );
ChiseledBlockSmartModel smartModel = new ChiseledBlockSmartModel();
add( new ResourceLocation( ChiselsAndBits.MODID, "models/item/block_chiseled" ), smartModel );
ChiselsAndBits.getInstance().addClearable( smartModel );

add( new ResourceLocation( ChiselsAndBits.MODID, "models/item/block_bit" ), new BitItemSmartModel() );
add( new ResourceLocation( ChiselsAndBits.MODID, "models/item/positiveprint_written_preview" ), new PrintSmartModel( "positiveprint", ChiselsAndBits.getItems().itemPositiveprint ) );
Expand Down
Expand Up @@ -23,7 +23,6 @@
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 @@ -237,7 +236,14 @@ public void nextFrame(
if ( currentFancy != lastFancy )
{
lastFancy = currentFancy;
VoxelBlob.clearCache();

// destroy the cache, and start over.
ChiselsAndBits.getInstance().clearCache();

// another dumb thing, MC has probobly already tried reloading
// things, so we need to tell it to start that over again.
Minecraft mc = Minecraft.getMinecraft();
mc.renderGlobal.loadRenderers();
}
}

Expand Down

0 comments on commit ec90ce2

Please sign in to comment.