Files
Chisel/src/main/java/com/cricketcraft/chisel/block/BlockCarvableGlow.java
T

50 lines
1.1 KiB
Java
Raw Normal View History

2015-01-08 18:36:23 -05:00
package com.cricketcraft.chisel.block;
2015-01-09 02:09:22 -05:00
import net.minecraft.block.material.Material;
2015-01-08 18:36:23 -05:00
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
2015-01-09 02:09:22 -05:00
import com.cricketcraft.chisel.Chisel;
2015-01-08 18:36:23 -05:00
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockCarvableGlow extends BlockCarvableColor {
2015-01-08 18:36:23 -05:00
@SideOnly(Side.CLIENT)
private IIcon glowTexture;
private String glowTexturePath;
private boolean isColored;
2015-01-08 18:36:23 -05:00
public BlockCarvableGlow(String glowTexture, boolean colorized) {
2015-01-08 18:36:23 -05:00
super();
setLightLevel(0.5f);
2015-01-08 18:36:23 -05:00
this.glowTexturePath = glowTexture;
this.isColored = colorized;
2015-01-08 18:36:23 -05:00
}
2015-01-09 02:09:22 -05:00
public BlockCarvableGlow(Material mat, String glowTexture) {
super(mat);
this.glowTexturePath = glowTexture;
}
2015-01-08 18:36:23 -05:00
@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() {
if(this.isColored){
return Chisel.renderGlowId;
} else {
return Chisel.renderNoColorGlowId;
}
2015-01-08 18:36:23 -05:00
}
}