[ci skip] spotlessApply with the new settings

This commit is contained in:
Jason Mitchell committed 2023-01-29 10:09:28 -08:00
1 parent a314fccd1b
commit 8f026dad8f
161 files changed
+14073 -12846

No files matched your search

@@ -1,81 +1,82 @@
package team.chisel.client.render;
import team.chisel.block.BlockMultiLayerBase;
import team.chisel.ctmlib.Drawing;
import static org.lwjgl.opengl.GL11.*;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.init.Blocks;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.client.MinecraftForgeClient;
import team.chisel.block.BlockMultiLayerBase;
import team.chisel.ctmlib.Drawing;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
import static org.lwjgl.opengl.GL11.*;
public class RendererMultiLayer implements ISimpleBlockRenderingHandler {
float bot = -0.001f, top = 1.0f - bot;
public static int id;
float bot = -0.001f, top = 1.0f - bot;
public static int id;
public RendererMultiLayer() {
id = RenderingRegistry.getNextAvailableRenderId();
}
public RendererMultiLayer() {
id = RenderingRegistry.getNextAvailableRenderId();
}
@Override
public void renderInventoryBlock(Block blck, int meta, int modelID, RenderBlocks renderer) {
if (blck == null || !(blck instanceof BlockMultiLayerBase))
return;
@Override
public void renderInventoryBlock(Block blck, int meta, int modelID, RenderBlocks renderer) {
if (blck == null || !(blck instanceof BlockMultiLayerBase)) return;
BlockMultiLayerBase block = (BlockMultiLayerBase) blck;
BlockMultiLayerBase block = (BlockMultiLayerBase) blck;
if (block.icon != null) {
renderer.overrideBlockTexture = block.icon;
renderer.renderBlockAsItem(Blocks.stone, meta, 1.0f);
renderer.overrideBlockTexture = null;
} else if (block.base != null) {
renderer.renderBlockAsItem(block.base, meta, 1.0f);
}
if (block.icon != null) {
renderer.overrideBlockTexture = block.icon;
renderer.renderBlockAsItem(Blocks.stone, meta, 1.0f);
renderer.overrideBlockTexture = null;
} else if (block.base != null) {
renderer.renderBlockAsItem(block.base, meta, 1.0f);
}
glPushMatrix();
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
renderer.setRenderBounds(bot, bot, bot, top, top, top);
glTranslatef(-0.5F, -0.5F, -0.5F);
Drawing.drawBlock(block, meta, renderer);
glDisable(GL_BLEND);
glPopMatrix();
}
glPushMatrix();
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
renderer.setRenderBounds(bot, bot, bot, top, top, top);
glTranslatef(-0.5F, -0.5F, -0.5F);
Drawing.drawBlock(block, meta, renderer);
glDisable(GL_BLEND);
glPopMatrix();
}
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block blck, int modelId, RenderBlocks renderer) {
if (blck == null || !(blck instanceof BlockMultiLayerBase))
return false;
BlockMultiLayerBase block = (BlockMultiLayerBase) blck;
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block blck, int modelId,
RenderBlocks renderer) {
if (blck == null || !(blck instanceof BlockMultiLayerBase)) return false;
BlockMultiLayerBase block = (BlockMultiLayerBase) blck;
if (MinecraftForgeClient.getRenderPass() == 0) {
if (block.icon != null) {
renderer.overrideBlockTexture = block.icon;
renderer.renderStandardBlock(block, x, y, z);
renderer.overrideBlockTexture = null;
return true;
} else if (block.base != null) {
renderer.renderBlockByRenderType(block.base, x, y, z);
return true;
}
} else {
renderer.setRenderBounds(0, 0, 0, 1, 1, 1);
return renderer.renderStandardBlock(block, x, y, z);
}
if (MinecraftForgeClient.getRenderPass() == 0) {
if (block.icon != null) {
renderer.overrideBlockTexture = block.icon;
renderer.renderStandardBlock(block, x, y, z);
renderer.overrideBlockTexture = null;
return true;
} else if (block.base != null) {
renderer.renderBlockByRenderType(block.base, x, y, z);
return true;
}
} else {
renderer.setRenderBounds(0, 0, 0, 1, 1, 1);
return renderer.renderStandardBlock(block, x, y, z);
}
return false;
}
return false;
}
@Override
public boolean shouldRender3DInInventory(int modelId) {
return true;
}
@Override
public boolean shouldRender3DInInventory(int modelId) {
return true;
}
@Override
public int getRenderId() {
return id;
}
@Override
public int getRenderId() {
return id;
}
}