forked from KryptonCaptain/Et-Futurum
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite potion/lava cauldron renderer, fix tipped arrow bugs
When using the potion cauldron to make tipped arrows it now makes sounds, and possible bugs when tipped arrows are not enabled.
- Loading branch information
1 parent
aef5968
commit 63e6a4a
Showing
4 changed files
with
58 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/main/java/ganymedes01/etfuturum/client/renderer/block/BlockCauldronBaseRenderer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package ganymedes01.etfuturum.client.renderer.block; | ||
|
||
import net.minecraft.block.Block; | ||
import net.minecraft.block.BlockCauldron; | ||
import net.minecraft.client.renderer.EntityRenderer; | ||
import net.minecraft.client.renderer.RenderBlocks; | ||
import net.minecraft.client.renderer.Tessellator; | ||
import net.minecraft.util.IIcon; | ||
import net.minecraft.world.IBlockAccess; | ||
|
||
public class BlockCauldronBaseRenderer extends BlockModelBase { | ||
public BlockCauldronBaseRenderer(int modelID) { | ||
super(modelID); | ||
} | ||
|
||
@Override | ||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { | ||
renderer.renderStandardBlock(block, x, y, z); | ||
Tessellator tessellator = Tessellator.instance; | ||
tessellator.setBrightness(block.getMixedBrightnessForBlock(renderer.blockAccess, x, y, z)); | ||
int l = block.colorMultiplier(renderer.blockAccess, x, y, z); | ||
float f = (float) (l >> 16 & 255) / 255.0F; | ||
float f1 = (float) (l >> 8 & 255) / 255.0F; | ||
float f2 = (float) (l & 255) / 255.0F; | ||
float f4; | ||
|
||
if (EntityRenderer.anaglyphEnable) { | ||
float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; | ||
f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; | ||
float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; | ||
f = f3; | ||
f1 = f4; | ||
f2 = f5; | ||
} | ||
|
||
tessellator.setColorOpaque_F(f, f1, f2); | ||
IIcon iicon1 = block.getBlockTextureFromSide(2); | ||
f4 = 0.125F; | ||
renderer.renderFaceXPos(block, (double) x - 1.0F + f4, y, z, iicon1); | ||
renderer.renderFaceXNeg(block, (double) x + 1.0F - f4, y, z, iicon1); | ||
renderer.renderFaceZPos(block, x, y, (double) z - 1.0F + f4, iicon1); | ||
renderer.renderFaceZNeg(block, x, y, (double) z + 1.0F - f4, iicon1); | ||
IIcon iicon2 = BlockCauldron.getCauldronIcon("inner"); | ||
renderer.renderFaceYPos(block, x, (double) y - 1.0F + 0.25F, z, iicon2); | ||
renderer.renderFaceYNeg(block, x, (double) y + 1.0F - 0.75F, z, iicon2); | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters