2014-12-15 00:11:48 +00:00
|
|
|
package com.cricketcraft.chisel.block;
|
2014-12-14 20:05:39 +00:00
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
2014-10-27 16:26:14 -04:00
|
|
|
import net.minecraft.block.BlockGlass;
|
|
|
|
|
import net.minecraft.block.material.Material;
|
|
|
|
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
|
|
|
|
import net.minecraft.creativetab.CreativeTabs;
|
|
|
|
|
import net.minecraft.item.Item;
|
2015-01-15 13:09:34 -05:00
|
|
|
import net.minecraft.item.ItemStack;
|
2014-10-27 16:26:14 -04:00
|
|
|
import net.minecraft.util.IIcon;
|
2015-01-15 13:09:34 -05:00
|
|
|
import net.minecraft.world.IBlockAccess;
|
2014-12-16 22:27:44 +00:00
|
|
|
|
|
|
|
|
import com.cricketcraft.chisel.Chisel;
|
|
|
|
|
import com.cricketcraft.chisel.api.ICarvable;
|
|
|
|
|
import com.cricketcraft.chisel.carving.CarvableHelper;
|
|
|
|
|
import com.cricketcraft.chisel.carving.CarvableVariation;
|
2015-01-08 05:46:10 -05:00
|
|
|
import com.cricketcraft.chisel.init.ChiselTabs;
|
2014-12-16 22:27:44 +00:00
|
|
|
|
2014-12-14 20:05:39 +00:00
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
2014-10-27 16:26:14 -04:00
|
|
|
|
2015-01-07 19:50:18 -05:00
|
|
|
public class BlockCarvableGlass extends BlockGlass implements ICarvable {
|
|
|
|
|
|
|
|
|
|
public CarvableHelper carverHelper;
|
|
|
|
|
private boolean isAlpha = false;
|
|
|
|
|
|
|
|
|
|
public BlockCarvableGlass() {
|
|
|
|
|
super(Material.glass, false);
|
|
|
|
|
|
|
|
|
|
carverHelper = new CarvableHelper();
|
2015-01-08 05:46:10 -05:00
|
|
|
setCreativeTab(ChiselTabs.tabOtherChiselBlocks);
|
2015-01-07 19:50:18 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public BlockCarvableGlass setStained(boolean a) {
|
|
|
|
|
this.isAlpha = a;
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean renderAsNormalBlock() {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2015-01-15 13:09:34 -05:00
|
|
|
|
2015-01-12 23:52:53 -05:00
|
|
|
@Override
|
|
|
|
|
public boolean isNormalCube() {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2015-01-07 19:50:18 -05:00
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int getRenderType() {
|
2015-01-08 01:59:50 -05:00
|
|
|
return Chisel.renderCTMId;
|
2015-01-07 19:50:18 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public IIcon getIcon(int side, int metadata) {
|
|
|
|
|
return carverHelper.getIcon(side, metadata);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int damageDropped(int i) {
|
|
|
|
|
return i;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void registerBlockIcons(IIconRegister register) {
|
|
|
|
|
carverHelper.registerBlockIcons("Chisel", this, register);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void getSubBlocks(Item item, CreativeTabs tabs, List list) {
|
|
|
|
|
carverHelper.registerSubBlocks(this, tabs, list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2015-01-15 13:09:34 -05:00
|
|
|
public CarvableVariation getVariation(IBlockAccess world, int x, int y, int z, int metadata) {
|
2015-01-07 19:50:18 -05:00
|
|
|
return carverHelper.getVariation(metadata);
|
|
|
|
|
}
|
|
|
|
|
|
2015-01-15 13:09:34 -05:00
|
|
|
@Override
|
|
|
|
|
public CarvableVariation getVariation(ItemStack stack) {
|
|
|
|
|
return carverHelper.getVariation(stack.getItemDamage());
|
|
|
|
|
}
|
|
|
|
|
|
2015-01-07 19:50:18 -05:00
|
|
|
@Override
|
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
|
public int getRenderBlockPass() {
|
|
|
|
|
return isAlpha ? 1 : 0;
|
|
|
|
|
}
|
2014-10-27 16:26:14 -04:00
|
|
|
}
|