Skip to content

Commit

Permalink
fix graphical glitch when breaking blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
octarine-noise committed Aug 6, 2014
1 parent ffa8dd7 commit 6623bee
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block b
// store world for later use
blockAccess = world;

// use original renderer for block breaking overlay
if (renderer.hasOverrideBlockTexture()) {
renderer.setRenderBoundsFromBlock(block);
renderer.renderStandardBlock(block, x, y, z);
return true;
}

// render dirt block
setPassCounters(1);
setRenderBoundsFromBlock(block);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,14 @@ public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block b
// store world for later use
blockAccess = world;

// use original renderer for block breaking overlay
if (renderer.hasOverrideBlockTexture()) {
renderer.renderBlockCactus(block, x, y, z);
return true;
}

// render cactus center
setPassCounters(1);
setRenderBoundsFromBlock(block);

Double3 blockCenter = new Double3(x + 0.5, y + 0.5, z + 0.5);
renderStandardBlock(block, x, y, z);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block b
// store world for later use
blockAccess = world;

// use original renderer for block breaking overlay
if (renderer.hasOverrideBlockTexture()) {
renderer.setRenderBoundsFromBlock(block);
renderer.renderStandardBlock(block, x, y, z);
return true;
}

// render sand block
setPassCounters(1);
setRenderBoundsFromBlock(block);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block b
// store world for later use
blockAccess = world;

// use original renderer for block breaking overlay
if (renderer.hasOverrideBlockTexture()) {
renderer.setRenderBoundsFromBlock(block);
renderer.renderStandardBlock(block, x, y, z);
return true;
}

// render grass block
setPassCounters(1);
setRenderBoundsFromBlock(block);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block b
// store world for later use
blockAccess = world;

// use original renderer for block breaking overlay
if (renderer.hasOverrideBlockTexture()) {
renderer.setRenderBoundsFromBlock(block);
renderer.renderStandardBlock(block, x, y, z);
return true;
}

// render leaves center
setPassCounters(1);
setRenderBoundsFromBlock(block);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block b
// store world for later use
blockAccess = world;

// use original renderer for block breaking overlay
if (renderer.hasOverrideBlockTexture()) {
renderer.renderBlockLilyPad(block, x, y, z);
return true;
}

// render lilypad block
renderBlockLilyPad(block, x, y, z);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block b
// store world for later use
blockAccess = world;

// use original renderer for block breaking overlay
if (renderer.hasOverrideBlockTexture()) {
renderer.setRenderBoundsFromBlock(block);
renderer.renderStandardBlock(block, x, y, z);
return true;
}

// render dirt block
setPassCounters(1);
setRenderBoundsFromBlock(block);
Expand Down

0 comments on commit 6623bee

Please sign in to comment.