mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-12 00:07:37 +00:00
Add missing files
This commit is contained in:
1 parent
89ed8e94ac
commit
d394a9a6e7
3 files changed
+95
No files matched your search
@@ -0,0 +1,41 @@
|
||||
package com.cricketcraft.chisel.block;
|
||||
|
||||
import com.cricketcraft.chisel.Chisel;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockCarvableGlow extends BlockCarvable {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon glowTexture;
|
||||
|
||||
private String glowTexturePath;
|
||||
|
||||
public BlockCarvableGlow(String glowTexture) {
|
||||
super();
|
||||
this.glowTexturePath = glowTexture;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
super.registerBlockIcons(register);
|
||||
glowTexture = register.registerIcon(Chisel.MOD_ID + ":" + glowTexturePath);
|
||||
}
|
||||
|
||||
public IIcon getGlowTexture() {
|
||||
return glowTexture;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return Chisel.renderGlowId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.cricketcraft.chisel.client.render;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.item.ItemDye;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import com.cricketcraft.chisel.Chisel;
|
||||
import com.cricketcraft.chisel.block.BlockCarvableGlow;
|
||||
import com.cricketcraft.chisel.utils.Drawing;
|
||||
import com.cricketcraft.chisel.utils.GeneralClient;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
|
||||
public class BlockGlowRenderer implements ISimpleBlockRenderingHandler {
|
||||
|
||||
public BlockGlowRenderer() {
|
||||
Chisel.renderGlowId = RenderingRegistry.getNextAvailableRenderId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
Drawing.drawBlock(block, metadata, renderer);
|
||||
GeneralClient.setGLColorFromInt(ItemDye.field_150922_c[metadata]);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
Drawing.drawBlock(block, ((BlockCarvableGlow)block).getGlowTexture(), renderer);
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
|
||||
@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.instance.setColorOpaque_I(ItemDye.field_150922_c[world.getBlockMetadata(x, y, z)]);
|
||||
Tessellator.instance.setBrightness(0xF000F0);
|
||||
Drawing.renderAllFaces(renderer, block, x, y, z, ((BlockCarvableGlow) block).getGlowTexture());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return Chisel.renderGlowId;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user