The great format and clean up. IMPORTANT: Read below.

All devs and contributors should use the provided formatter settings. 
If your IDE does not support the format, the rules are simple, it is the
default java formatting rules, with 200char line lengths and 1 extra
line after class definitions.
This commit is contained in:
tterrag1098 committed 2015-01-07 19:50:18 -05:00
1 parent 06c5f5930f
commit 82792ed22e
136 files changed
+10365 -11272

No files matched your search

@@ -13,127 +13,111 @@ import com.cricketcraft.chisel.utils.Drawing;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
public class BlockRoadLineRenderer implements ISimpleBlockRenderingHandler
{
public static int id;
public class BlockRoadLineRenderer implements ISimpleBlockRenderingHandler {
public BlockRoadLineRenderer()
{
id = RenderingRegistry.getNextAvailableRenderId();
}
public static int id;
@Override
public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer)
{
renderer.setRenderBoundsFromBlock(block);
Drawing.drawBlock(block, meta, renderer);
}
public BlockRoadLineRenderer() {
id = RenderingRegistry.getNextAvailableRenderId();
}
public void renderTopFace(double y, IIcon icon)
{
Tessellator tessellator = Tessellator.instance;
@Override
public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) {
renderer.setRenderBoundsFromBlock(block);
Drawing.drawBlock(block, meta, renderer);
}
tessellator.addVertexWithUV(1, y, 0, icon.getMaxU(), icon.getMinV());
tessellator.addVertexWithUV(0, y, 0, icon.getMinU(), icon.getMinV());
tessellator.addVertexWithUV(0, y, 1, icon.getMinU(), icon.getMaxV());
tessellator.addVertexWithUV(1, y, 1, icon.getMaxU(), icon.getMaxV());
}
public void renderTopFace(double y, IIcon icon) {
Tessellator tessellator = Tessellator.instance;
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block b, int modelId, RenderBlocks renderer)
{
int meta = world.getBlockMetadata(x, y, z);
BlockRoadLine block = (BlockRoadLine) b;
Tessellator tessellator = Tessellator.instance;
tessellator.addVertexWithUV(1, y, 0, icon.getMaxU(), icon.getMinV());
tessellator.addVertexWithUV(0, y, 0, icon.getMinU(), icon.getMinV());
tessellator.addVertexWithUV(0, y, 1, icon.getMinU(), icon.getMaxV());
tessellator.addVertexWithUV(1, y, 1, icon.getMaxU(), icon.getMaxV());
}
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block b, int modelId, RenderBlocks renderer) {
int meta = world.getBlockMetadata(x, y, z);
BlockRoadLine block = (BlockRoadLine) b;
Tessellator tessellator = Tessellator.instance;
float f = 1.0F;
int i1 = block.colorMultiplier(world, x, y, z);
float f1 = (i1 >> 16 & 255) / 255.0F;
float f2 = (i1 >> 8 & 255) / 255.0F;
float f3 = (i1 & 255) / 255.0F;
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
if(EntityRenderer.anaglyphEnable)
{
float f4 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F;
float f5 = (f1 * 30.0F + f2 * 70.0F) / 100.0F;
float f6 = (f1 * 30.0F + f3 * 70.0F) / 100.0F;
f1 = f4;
f2 = f5;
f3 = f6;
}
tessellator.setColorOpaque_F(f * f1, f * f2, f * f3);
float f = 1.0F;
int i1 = block.colorMultiplier(world, x, y, z);
float f1 = (i1 >> 16 & 255) / 255.0F;
float f2 = (i1 >> 8 & 255) / 255.0F;
float f3 = (i1 & 255) / 255.0F;
boolean N = world.getBlock(x, y, z - 1).equals(block);
boolean S = world.getBlock(x, y, z + 1).equals(block);
boolean W = world.getBlock(x - 1, y, z).equals(block);
boolean E = world.getBlock(x + 1, y, z).equals(block);
if (EntityRenderer.anaglyphEnable) {
float f4 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F;
float f5 = (f1 * 30.0F + f2 * 70.0F) / 100.0F;
float f6 = (f1 * 30.0F + f3 * 70.0F) / 100.0F;
f1 = f4;
f2 = f5;
f3 = f6;
}
tessellator.setColorOpaque_F(f * f1, f * f2, f * f3);
if(!N && !S && !W && !E)
{
renderer.renderStandardBlock(block, x, y, z);
return true;
}
boolean N = world.getBlock(x, y, z - 1).equals(block);
boolean S = world.getBlock(x, y, z + 1).equals(block);
boolean W = world.getBlock(x - 1, y, z).equals(block);
boolean E = world.getBlock(x + 1, y, z).equals(block);
if(N && S)
{
renderer.uvRotateTop = 0;
renderer.overrideBlockTexture = block.fullLineIcon;
renderer.renderStandardBlock(block, x, y, z);
if (!N && !S && !W && !E) {
renderer.renderStandardBlock(block, x, y, z);
return true;
}
} else
{
if(N)
{
renderer.uvRotateTop = 0;
renderer.overrideBlockTexture = block.halfLineIcon;
renderer.renderStandardBlock(block, x, y, z);
}
if(S)
{
renderer.uvRotateTop = 3;
renderer.overrideBlockTexture = block.halfLineIcon;
renderer.renderStandardBlock(block, x, y, z);
}
if (N && S) {
renderer.uvRotateTop = 0;
renderer.overrideBlockTexture = block.fullLineIcon;
renderer.renderStandardBlock(block, x, y, z);
}
} else {
if (N) {
renderer.uvRotateTop = 0;
renderer.overrideBlockTexture = block.halfLineIcon;
renderer.renderStandardBlock(block, x, y, z);
}
if (S) {
renderer.uvRotateTop = 3;
renderer.overrideBlockTexture = block.halfLineIcon;
renderer.renderStandardBlock(block, x, y, z);
}
if(E && W)
{
renderer.uvRotateTop = 1;
renderer.overrideBlockTexture = block.fullLineIcon;
renderer.renderStandardBlock(block, x, y, z);
} else
{
if(E)
{
renderer.uvRotateTop = 1;
renderer.overrideBlockTexture = block.halfLineIcon;
renderer.renderStandardBlock(block, x, y, z);
}
if(W)
{
renderer.uvRotateTop = 2;
renderer.overrideBlockTexture = block.halfLineIcon;
renderer.renderStandardBlock(block, x, y, z);
}
}
}
renderer.uvRotateTop = 0;
renderer.overrideBlockTexture = null;
return true;
}
if (E && W) {
renderer.uvRotateTop = 1;
renderer.overrideBlockTexture = block.fullLineIcon;
renderer.renderStandardBlock(block, x, y, z);
} else {
if (E) {
renderer.uvRotateTop = 1;
renderer.overrideBlockTexture = block.halfLineIcon;
renderer.renderStandardBlock(block, x, y, z);
}
if (W) {
renderer.uvRotateTop = 2;
renderer.overrideBlockTexture = block.halfLineIcon;
renderer.renderStandardBlock(block, x, y, z);
}
}
@Override
public boolean shouldRender3DInInventory(int renderId)
{
return false;
}
renderer.uvRotateTop = 0;
renderer.overrideBlockTexture = null;
return true;
}
@Override
public int getRenderId()
{
return id;
}
@Override
public boolean shouldRender3DInInventory(int renderId) {
return false;
}
@Override
public int getRenderId() {
return id;
}
}