Skip to content

Commit

Permalink
Fixed API CommitChanges not triggering render updates.
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/java/mod/chiselsandbits/core/api/BitAccess.java
  • Loading branch information
AlgorithmX2 committed Jan 14, 2017
1 parent 8aecea2 commit 617ee1f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
Expand Up @@ -879,4 +879,9 @@ public void invalidate()
}
}

public void finishUpdate()
{
// nothin.
}

}
Expand Up @@ -191,7 +191,12 @@ public void completeEditOperation(
final VoxelBlob vb )
{
super.completeEditOperation( vb );
finishUpdate();
}

@Override
public void finishUpdate()
{
if ( renderChunk != null )
{
if ( renderChunk.singleInstanceMode )
Expand Down
19 changes: 10 additions & 9 deletions src/main/java/mod/chiselsandbits/core/api/BitAccess.java
Expand Up @@ -109,22 +109,23 @@ public void commitChanges(
final boolean triggerUpdates )
{
TileEntityBlockChiseled tile = ModUtil.getChiseledTileEntity( world, pos, true );
final BlobStats cb = blob.getVoxelStats();
final BlobStats cb = blob.getVoxelStats();

if ( tile == null && BlockChiseled.replaceWithChisled( world, pos, world.getBlockState( pos ), cb.mostCommonState, false ) )
{
{
tile = ModUtil.getChiseledTileEntity( world, pos, true );
}
}

if ( tile != null )
{
final VoxelBlobStateReference before = tile.getBlobStateReference();
tile.setBlob( blob, triggerUpdates );
final VoxelBlobStateReference after = tile.getBlobStateReference();
if ( tile != null )
{
final VoxelBlobStateReference before = tile.getBlobStateReference();
tile.setBlob( blob, triggerUpdates );
tile.finishUpdate();
final VoxelBlobStateReference after = tile.getBlobStateReference();

UndoTracker.getInstance().add( world, pos, before, after );
}
}
}

@Override
public void commitChanges()
Expand Down

0 comments on commit 617ee1f

Please sign in to comment.