123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- package me.km.blocks;
- import me.km.KajetansMod;
- import net.minecraft.block.*;
- import net.minecraft.block.material.MapColor;
- import net.minecraft.block.material.Material;
- import net.minecraft.block.state.IBlockState;
- import net.minecraft.creativetab.CreativeTabs;
- import net.minecraft.entity.Entity;
- import net.minecraft.item.Item;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.world.IBlockAccess;
- import net.minecraft.world.World;
- public class BlockBase extends Block implements IBlockBase
- {
- protected String name;
- private SoundType type;
- private MapColor mapColor;
- public BlockBase(Material material, String name, String local)
- {
- super(material);
- this.name = name;
- this.setRegistryName(name);
- super.setUnlocalizedName(local);
- super.setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
- this.type = super.getSoundType();
- this.mapColor = blockMapColor;
- }
- public BlockBase setMapColor(MapColor mapColor)
- {
- this.mapColor = mapColor;
- return this;
- }
- @Override
- public MapColor getMapColor(IBlockState state, IBlockAccess worldIn, BlockPos pos)
- {
- return this.mapColor;
- }
-
- @Override
- public void registerItemModel(Item itemBlock)
- {
- KajetansMod.proxy.registerItemRenderer(itemBlock, 0, name);
- }
- @Override
- public BlockBase setCreativeTab(CreativeTabs tab)
- {
- super.setCreativeTab(tab);
- return this;
- }
- @Override
- public BlockBase setSoundType(SoundType sound)
- {
- this.type = sound;
- return this;
- }
- @Override
- public SoundType getSoundType(IBlockState state, World world, BlockPos pos, Entity entity)
- {
- return type;
- }
- }
|