2015-01-01 00:58:55 +00:00
|
|
|
package com.cricketcraft.chisel.block;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
2015-01-29 16:58:45 -05:00
|
|
|
import java.util.Random;
|
2015-01-01 00:58:55 +00:00
|
|
|
|
|
|
|
|
import net.minecraft.block.Block;
|
|
|
|
|
import net.minecraft.block.material.Material;
|
|
|
|
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
|
|
|
|
import net.minecraft.creativetab.CreativeTabs;
|
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
|
import net.minecraft.item.Item;
|
2015-01-15 13:09:34 -05:00
|
|
|
import net.minecraft.item.ItemStack;
|
2015-01-01 00:58:55 +00:00
|
|
|
import net.minecraft.stats.StatList;
|
|
|
|
|
import net.minecraft.util.IIcon;
|
2015-01-15 13:09:34 -05:00
|
|
|
import net.minecraft.world.IBlockAccess;
|
2015-01-01 00:58:55 +00:00
|
|
|
import net.minecraft.world.World;
|
|
|
|
|
|
|
|
|
|
import com.cricketcraft.chisel.api.ICarvable;
|
|
|
|
|
import com.cricketcraft.chisel.carving.CarvableHelper;
|
|
|
|
|
import com.cricketcraft.chisel.carving.CarvableVariation;
|
|
|
|
|
|
2015-01-12 18:36:30 +00:00
|
|
|
public class BlockCarvablePackedIce extends Block implements ICarvable {
|
2015-01-01 00:58:55 +00:00
|
|
|
|
2015-01-07 19:50:18 -05:00
|
|
|
public CarvableHelper carverHelper;
|
2015-01-01 00:58:55 +00:00
|
|
|
|
2015-01-12 18:36:30 +00:00
|
|
|
public BlockCarvablePackedIce() {
|
2015-01-07 19:50:18 -05:00
|
|
|
super(Material.ice);
|
|
|
|
|
carverHelper = new CarvableHelper();
|
|
|
|
|
}
|
2015-01-01 00:58:55 +00:00
|
|
|
|
2015-01-07 19:50:18 -05:00
|
|
|
@Override
|
|
|
|
|
public IIcon getIcon(int side, int metadata) {
|
|
|
|
|
return carverHelper.getIcon(side, metadata);
|
|
|
|
|
}
|
2015-01-01 00:58:55 +00:00
|
|
|
|
2015-01-07 19:50:18 -05:00
|
|
|
@Override
|
2015-01-29 16:58:45 -05:00
|
|
|
public int quantityDropped(int meta, int fortune, Random random) {
|
2015-01-07 19:50:18 -05:00
|
|
|
return 0;
|
|
|
|
|
}
|
2015-01-01 00:58:55 +00:00
|
|
|
|
2015-01-07 19:50:18 -05:00
|
|
|
@Override
|
|
|
|
|
public void registerBlockIcons(IIconRegister register) {
|
|
|
|
|
carverHelper.registerBlockIcons("Chisel", this, register);
|
|
|
|
|
}
|
2015-01-01 00:58:55 +00:00
|
|
|
|
2015-01-07 19:50:18 -05:00
|
|
|
@Override
|
|
|
|
|
public void getSubBlocks(Item item, CreativeTabs tabs, List list) {
|
|
|
|
|
carverHelper.registerSubBlocks(this, tabs, list);
|
|
|
|
|
}
|
2015-01-01 00:58:55 +00:00
|
|
|
|
2015-01-07 19:50:18 -05:00
|
|
|
@Override
|
|
|
|
|
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) {
|
|
|
|
|
super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
|
2015-01-01 00:58:55 +00:00
|
|
|
|
2015-01-07 19:50:18 -05:00
|
|
|
par2EntityPlayer.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1);
|
|
|
|
|
par2EntityPlayer.addExhaustion(0.025F);
|
2015-01-01 00:58:55 +00:00
|
|
|
|
2015-01-07 19:50:18 -05:00
|
|
|
/*
|
2015-01-15 13:09:34 -05:00
|
|
|
* if(this.canSilkHarvest(par1World, par2EntityPlayer, par3, par4, par5, par6) && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer)) { ItemStack itemstack =
|
|
|
|
|
* this.createStackedBlock(par6);
|
2015-01-07 19:50:18 -05:00
|
|
|
*
|
2015-01-15 13:09:34 -05:00
|
|
|
* if(itemstack != null) { this.dropBlockAsItem(par1World, par3, par4, par5, itemstack); } }
|
2015-01-07 19:50:18 -05:00
|
|
|
*/
|
|
|
|
|
}
|
2015-01-01 00:58:55 +00:00
|
|
|
|
2015-01-07 19:50:18 -05:00
|
|
|
@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-01 00:58:55 +00:00
|
|
|
|
2015-01-15 13:09:34 -05:00
|
|
|
@Override
|
|
|
|
|
public CarvableVariation getVariation(ItemStack stack) {
|
|
|
|
|
return carverHelper.getVariation(stack.getItemDamage());
|
|
|
|
|
}
|
2015-01-01 00:58:55 +00:00
|
|
|
}
|