12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- package me.km.blocks;
- import me.km.KajetansMod;
- import net.minecraft.block.*;
- 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.ItemBlock;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.world.World;
- public class BlockBase extends Block
- {
- protected String name;
- private SoundType type;
- 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();
- }
- public void registerItemModel(ItemBlock 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;
- }
- }
|