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-04-21 19:13:15 +01:00
|
|
|
import net.minecraft.block.BlockPane;
|
|
|
|
|
import net.minecraft.block.material.Material;
|
|
|
|
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
|
|
|
|
import net.minecraft.creativetab.CreativeTabs;
|
|
|
|
|
import net.minecraft.item.Item;
|
|
|
|
|
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.api.ICarvable;
|
2015-04-24 17:05:12 -04:00
|
|
|
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
2015-04-23 20:33:29 -04:00
|
|
|
import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
2015-04-23 17:31:25 -04:00
|
|
|
import com.cricketcraft.chisel.client.render.RendererCTMPane;
|
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-07-26 09:17:49 +01:00
|
|
|
|
2015-01-07 19:50:18 -05:00
|
|
|
public class BlockCarvablePane extends BlockPane implements ICarvable {
|
|
|
|
|
|
|
|
|
|
public CarvableHelper carverHelper;
|
|
|
|
|
public boolean isAlpha;
|
|
|
|
|
|
|
|
|
|
public BlockCarvablePane(Material material, boolean drops) {
|
|
|
|
|
super("", "", material, drops);
|
|
|
|
|
|
2015-04-23 20:33:29 -04:00
|
|
|
carverHelper = new CarvableHelper(this);
|
2015-01-07 19:50:18 -05:00
|
|
|
|
2015-01-08 05:46:10 -05:00
|
|
|
setCreativeTab(ChiselTabs.tabOtherChiselBlocks);
|
2015-01-07 19:50:18 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public BlockCarvablePane setStained(boolean a) {
|
|
|
|
|
this.isAlpha = a;
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
|
public int getRenderBlockPass() {
|
|
|
|
|
return isAlpha ? 1 : 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int getRenderType() {
|
2015-04-23 17:31:25 -04:00
|
|
|
return RendererCTMPane.id;
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
2015-08-06 00:00:22 -04:00
|
|
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
2015-01-07 19:50:18 -05:00
|
|
|
@Override
|
|
|
|
|
public void getSubBlocks(Item item, CreativeTabs tabs, List list) {
|
|
|
|
|
carverHelper.registerSubBlocks(this, tabs, list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2015-07-15 00:35:00 -04:00
|
|
|
public IVariationInfo getManager(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
|
2015-07-15 00:35:00 -04:00
|
|
|
public IVariationInfo getManager(int meta) {
|
|
|
|
|
return carverHelper.getVariation(meta);
|
2015-01-15 13:09:34 -05:00
|
|
|
}
|
2014-04-21 19:13:15 +01:00
|
|
|
}
|