net.minecraft.block.SoundType Java Examples
The following examples show how to use
net.minecraft.block.SoundType.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BlockBlueprintArchive.java From Cyberware with MIT License | 6 votes |
public BlockBlueprintArchive() { super(Material.IRON); setHardness(5.0F); setResistance(10.0F); setSoundType(SoundType.METAL); String name = "blueprintArchive"; this.setRegistryName(name); GameRegistry.register(this); ItemBlock ib = new ItemBlockCyberware(this, "cyberware.tooltip.blueprintArchive"); ib.setRegistryName(name); GameRegistry.register(ib); this.setUnlocalizedName(Cyberware.MODID + "." + name); this.setCreativeTab(Cyberware.creativeTab); GameRegistry.registerTileEntity(TileEntityBlueprintArchive.class, Cyberware.MODID + ":" + name); CyberwareContent.blocks.add(this); this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); }
Example #2
Source File: BlockSurgery.java From Cyberware with MIT License | 6 votes |
public BlockSurgery() { super(Material.IRON); setHardness(5.0F); setResistance(10.0F); setSoundType(SoundType.METAL); String name = "surgery"; this.setRegistryName(name); GameRegistry.register(this); ItemBlock ib = new ItemBlockCyberware(this); ib.setRegistryName(name); GameRegistry.register(ib); this.setUnlocalizedName(Cyberware.MODID + "." + name); this.setCreativeTab(Cyberware.creativeTab); GameRegistry.registerTileEntity(TileEntitySurgery.class, Cyberware.MODID + ":" + name); CyberwareContent.blocks.add(this); }
Example #3
Source File: BlockTofuDoor.java From TofuCraftReload with MIT License | 6 votes |
public BlockTofuDoor(Material material,TofuType tofuType){ super(material); this.tofuType = tofuType; this.setCreativeTab(CommonProxy.tab); if(material== Material.WOOD) { this.setSoundType(SoundType.CLOTH); if(tofuType == TofuType.kinu){ this.setHardness(0.6F); this.setResistance(2.0F); }else { this.setHardness(0.4F); this.setResistance(1.0F); } }else { if(material== Material.IRON){ this.setSoundType(SoundType.METAL); this.setHardness(5.0F); this.setResistance(11.0F); }else { this.setSoundType(SoundType.STONE); this.setHardness(1.8F); this.setResistance(9.0F); } } }
Example #4
Source File: BlockTraverseWoodFence.java From Traverse-Legacy-1-12-2 with MIT License | 5 votes |
public BlockTraverseWoodFence(String name) { super(Material.WOOD, MapColor.WOOD); setRegistryName(new ResourceLocation(TraverseConstants.MOD_ID, name + "_fence")); setUnlocalizedName(getRegistryName().toString()); setCreativeTab(TraverseTab.TAB); setSoundType(SoundType.WOOD); setHardness(2.0F); setResistance(5.0F); ShootingStar.registerModel(new ModelCompound(TraverseConstants.MOD_ID, this, "fence")); }
Example #5
Source File: ShreddedStarchBlock.java From EmergingTechnology with MIT License | 5 votes |
public ShreddedStarchBlock() { super(Material.PLANTS); this.setHardness(1.0f); this.setRegistryName(EmergingTechnology.MODID, _name); this.setUnlocalizedName(EmergingTechnology.MODID + "." + _name); this.setCreativeTab(EmergingTechnology.TECHNOLOGYTAB); this.setSoundType(SoundType.PLANT); }
Example #6
Source File: BlockMetalPlate.java From BaseMetals with GNU Lesser General Public License v2.1 | 5 votes |
public BlockMetalPlate(MetalMaterial metal) { super(Material.IRON); this.blockSoundType = SoundType.METAL; this.metal = metal; this.blockHardness = metal.getMetalBlockHardness(); this.blockResistance = metal.getBlastResistance(); this.setHarvestLevel("pickaxe", metal.getRequiredHarvestLevel()); this.setDefaultState(this.blockState.getBaseState() .withProperty(FACING,EnumFacing.NORTH)); this.useNeighborBrightness = true; }
Example #7
Source File: BlockSurfaceRock.java From GregTech with GNU Lesser General Public License v3.0 | 5 votes |
public BlockSurfaceRock() { super(net.minecraft.block.material.Material.ROCK); setHardness(1.5f); setSoundType(SoundType.STONE); setUnlocalizedName("surface_rock"); setLightOpacity(1); }
Example #8
Source File: ItemTraverseWoodDoor.java From CommunityMod with GNU Lesser General Public License v2.1 | 5 votes |
public EnumActionResult onItemUse(EntityPlayer player, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { if (facing != EnumFacing.UP) { return EnumActionResult.FAIL; } else { IBlockState iblockstate = worldIn.getBlockState(pos); Block block = iblockstate.getBlock(); if (!block.isReplaceable(worldIn, pos)) { pos = pos.offset(facing); } ItemStack itemstack = player.getHeldItem(hand); if (player.canPlayerEdit(pos, facing, itemstack) && this.block.canPlaceBlockAt(worldIn, pos)) { EnumFacing enumfacing = EnumFacing.fromAngle((double) player.rotationYaw); int i = enumfacing.getXOffset(); int j = enumfacing.getYOffset(); boolean flag = i < 0 && hitZ < 0.5F || i > 0 && hitZ > 0.5F || j < 0 && hitX > 0.5F || j > 0 && hitX < 0.5F; placeDoor(worldIn, pos, enumfacing, this.block, flag); SoundType soundtype = worldIn.getBlockState(pos).getBlock().getSoundType(worldIn.getBlockState(pos), worldIn, pos, player); worldIn.playSound(player, pos, soundtype.getPlaceSound(), SoundCategory.BLOCKS, (soundtype.getVolume() + 1.0F) / 2.0F, soundtype.getPitch() * 0.8F); itemstack.shrink(1); return EnumActionResult.SUCCESS; } else { return EnumActionResult.FAIL; } } }
Example #9
Source File: BlockCactus.java From TFC2 with GNU General Public License v3.0 | 5 votes |
public BlockCactus() { super(Material.VINE, META_PROPERTY); this.setCreativeTab(TFCTabs.TFCBuilding); setSoundType(SoundType.GROUND); this.setTickRandomly(true); this.setDefaultState(this.blockState.getBaseState().withProperty(META_PROPERTY, DesertCactusType.Barrel).withProperty(BLOOM, false)); float f = 0.35F; this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.8F, 0.5F + f); }
Example #10
Source File: BlockTorikkiGrass.java From Wizardry with GNU Lesser General Public License v3.0 | 5 votes |
public BlockTorikkiGrass() { super("torikki_grass", Material.GRASS); setSoundType(SoundType.PLANT); setHardness(0.6f); setResistance(3.0f); setHarvestLevel("shovel", 0); setTickRandomly(true); }
Example #11
Source File: BlockSound.java From CommunityMod with GNU Lesser General Public License v2.1 | 5 votes |
public BlockSound(String name, SoundEvent sound) { super(Material.ROCK); this.setCreativeTab(CommunityGlobals.TAB); this.setSoundType(new SoundType(2.0F, 1.0F, sound, sound, sound, sound, sound)); this.setRegistryName(name); this.setTranslationKey(getRegistryName().toString()); }
Example #12
Source File: BlockGrass.java From TFC2 with GNU General Public License v3.0 | 5 votes |
public BlockGrass() { super(Material.GROUND, META_PROPERTY); this.setCreativeTab(TFCTabs.TFCBuilding); setSoundType(SoundType.GROUND); this.setTickRandomly(true); this.setDefaultState(this.blockState.getBaseState().withProperty(META_PROPERTY, StoneType.Granite).withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false)).withProperty(SPARSE, false)); this.collapseType = CollapsibleType.Nature; this.setShowInCreative(false); }
Example #13
Source File: BlockWaterHyacinth.java From Production-Line with MIT License | 5 votes |
public BlockWaterHyacinth() { super(Material.PLANTS); this.setUnlocalizedName("productionline.block.WaterHyacinth"); this.setCreativeTab(creativeTabPL); //this.setBlockTextureName(ProductionLine.RESOURCE_DOMAIN + ":" + "BlockWaterHyacinth"); this.setHardness(0.0F); this.setResistance(0.0F); this.setSoundType(SoundType.PLANT); this.setTickRandomly(true); }
Example #14
Source File: FWBlock.java From NOVA-Core with GNU Lesser General Public License v3.0 | 5 votes |
@Override public TileEntity createTileEntity(World world, IBlockState state) { FWTile fwTile = FWTileLoader.loadTile(dummy.getID()); fwTile.getBlock().components.getOrAdd(new TEBlockTransform(fwTile)); if (!fwTile.getBlock().components.has(BlockProperty.BlockSound.class)) { BlockProperty.BlockSound properties = fwTile.getBlock().components.add(new BlockProperty.BlockSound()); properties.setBlockSound(BlockProperty.BlockSound.BlockSoundTrigger.BREAK, new Sound(SoundType.STONE.getBreakSound().getSoundName().getResourceDomain(), SoundType.STONE.getBreakSound().getSoundName().getResourcePath())); properties.setBlockSound(BlockProperty.BlockSound.BlockSoundTrigger.PLACE, new Sound(SoundType.STONE.getPlaceSound().getSoundName().getResourceDomain(), SoundType.STONE.getPlaceSound().getSoundName().getResourcePath())); properties.setBlockSound(BlockProperty.BlockSound.BlockSoundTrigger.WALK, new Sound(SoundType.STONE.getStepSound().getSoundName().getResourceDomain(), SoundType.STONE.getStepSound().getSoundName().getResourcePath())); } return fwTile; }
Example #15
Source File: ENBlocks.java From ExNihiloAdscensio with MIT License | 5 votes |
public static void init() { dust = new BlockBaseFalling(SoundType.CLOTH, "blockDust"); dust.setCreativeTab(ExNihiloAdscensio.tabExNihilo); dust.setHardness(0.7F); netherrackCrushed = new BlockBaseFalling(SoundType.GROUND, "blockNetherrackCrushed"); netherrackCrushed.setCreativeTab(ExNihiloAdscensio.tabExNihilo); netherrackCrushed.setHardness(0.7F); endstoneCrushed = new BlockBaseFalling(SoundType.GROUND, "blockEndstoneCrushed"); endstoneCrushed.setCreativeTab(ExNihiloAdscensio.tabExNihilo); endstoneCrushed.setHardness(0.7F); barrelWood = new BlockBarrel(0, Material.WOOD); barrelWood.setCreativeTab(ExNihiloAdscensio.tabExNihilo); GameRegistry.registerTileEntity(TileBarrel.class, "blockBarrel0"); barrelStone = new BlockBarrel(1, Material.ROCK); barrelStone.setCreativeTab(ExNihiloAdscensio.tabExNihilo); GameRegistry.registerTileEntity(TileBarrel.class, "blockBarrel1"); infestedLeaves = new BlockInfestedLeaves(); GameRegistry.registerTileEntity(TileInfestedLeaves.class, "blockInfestedLeaves"); infestedLeaves.setCreativeTab(ExNihiloAdscensio.tabExNihilo); crucible = new BlockCrucible(); crucible.setCreativeTab(ExNihiloAdscensio.tabExNihilo); GameRegistry.registerTileEntity(TileCrucible.class, "blockCrucible"); sieve = new BlockSieve(); sieve.setCreativeTab(ExNihiloAdscensio.tabExNihilo); GameRegistry.registerTileEntity(TileSieve.class, "blockSieve"); fluidWitchwater = new FluidWitchWater(); blockWitchwater = new BlockFluidWitchwater(); FluidRegistry.addBucketForFluid(fluidWitchwater); }
Example #16
Source File: BlockMetalDoor.java From BaseMetals with GNU Lesser General Public License v2.1 | 5 votes |
public BlockMetalDoor(MetalMaterial metal) { super((metal.getToolHarvestLevel() > 0) ? Material.IRON : Material.ROCK); this.setSoundType(SoundType.METAL); this.metal = metal; this.blockHardness = metal.getMetalBlockHardness(); this.blockResistance = metal.getBlastResistance(); this.setHarvestLevel("pickaxe", metal.getRequiredHarvestLevel()); this.disableStats(); }
Example #17
Source File: BlockTraverseDeadGrass.java From Traverse-Legacy-1-12-2 with MIT License | 5 votes |
public BlockTraverseDeadGrass() { super(); setRegistryName(new ResourceLocation(TraverseConstants.MOD_ID, "dead_grass")); setUnlocalizedName(getRegistryName().toString()); setCreativeTab(TraverseTab.TAB); setSoundType(SoundType.PLANT); useNeighborBrightness = true; ShootingStar.registerModel(new ModelCompound(TraverseConstants.MOD_ID, this, "plant", TYPE)); }
Example #18
Source File: ItemEngineeringTable.java From Cyberware with MIT License | 5 votes |
/** * Called when a Block is right-clicked with this Item */ public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { if (facing != EnumFacing.UP) { return EnumActionResult.FAIL; } else { IBlockState iblockstate = worldIn.getBlockState(pos); Block block = iblockstate.getBlock(); if (!block.isReplaceable(worldIn, pos)) { pos = pos.offset(facing); } if (playerIn.canPlayerEdit(pos, facing, stack) && this.block.canPlaceBlockAt(worldIn, pos)) { EnumFacing enumfacing = EnumFacing.fromAngle((double)playerIn.rotationYaw); int i = enumfacing.getFrontOffsetX(); int j = enumfacing.getFrontOffsetZ(); placeDoor(worldIn, pos, enumfacing, this.block); SoundType soundtype = this.block.getSoundType(); worldIn.playSound(playerIn, pos, soundtype.getPlaceSound(), SoundCategory.BLOCKS, (soundtype.getVolume() + 1.0F) / 2.0F, soundtype.getPitch() * 0.8F); --stack.stackSize; return EnumActionResult.SUCCESS; } else { return EnumActionResult.FAIL; } } }
Example #19
Source File: BlockFireboxCasing.java From GregTech with GNU Lesser General Public License v3.0 | 5 votes |
public BlockFireboxCasing() { super(Material.IRON); setUnlocalizedName("boiler_casing"); setHardness(5.0f); setResistance(10.0f); setSoundType(SoundType.METAL); setHarvestLevel("wrench", 2); setDefaultState(getState(FireboxCasingType.BRONZE_FIREBOX).withProperty(ACTIVE, false)); }
Example #20
Source File: BlockCampfirePot.java From Sakura_mod with MIT License | 5 votes |
public BlockCampfirePot(boolean isBurning) { super(Material.WOOD); this.setHardness(0.5F); this.setSoundType(SoundType.WOOD); this.isBurning = isBurning; if (isBurning) { this.setLightLevel(0.85F); } else { this.setCreativeTab(CommonProxy.tab); } }
Example #21
Source File: BlockThatch.java From TFC2 with GNU General Public License v3.0 | 5 votes |
public BlockThatch() { super(Material.GRASS, null); this.setCreativeTab(TFCTabs.TFCBuilding); this.setSoundType(SoundType.PLANT); this.lightOpacity = 255; }
Example #22
Source File: BlockWoodSupport.java From TFC2 with GNU General Public License v3.0 | 5 votes |
protected BlockWoodSupport(Material material, PropertyHelper meta) { super(material, meta); this.setCreativeTab(TFCTabs.TFCBuilding); compressionBreak = true; this.collapseType = CollapsibleType.Structure; setSoundType(SoundType.WOOD); }
Example #23
Source File: BlockHalfTatami.java From Sakura_mod with MIT License | 5 votes |
public BlockHalfTatami(boolean ns) { super(Material.CLOTH); this.setTickRandomly(true); this.setSoundType(SoundType.PLANT); setHardness(0.25F).setResistance(0.5F); isNS = ns; }
Example #24
Source File: BlockAltarConfession.java From Wizardry with GNU Lesser General Public License v3.0 | 5 votes |
public BlockAltarConfession() { super("altar_confession", Material.WOOD); setHardness(2.0F); setResistance(15.0f); setSoundType(SoundType.WOOD); getItemForm().setMaxStackSize(1); }
Example #25
Source File: BlockAltarSacrament.java From Wizardry with GNU Lesser General Public License v3.0 | 5 votes |
public BlockAltarSacrament() { super("altar_sacrament", Material.WOOD); setHardness(2.0F); setResistance(15.0f); setSoundType(SoundType.WOOD); getItemForm().setMaxStackSize(1); }
Example #26
Source File: BlockBeaconPost.java From Cyberware with MIT License | 5 votes |
public BlockBeaconPost() { super(Material.IRON); setHardness(5.0F); setResistance(10.0F); setSoundType(SoundType.METAL); String name = "radioPost"; this.setRegistryName(name); GameRegistry.register(this); ItemBlock ib = new ItemBlockCyberware(this, "cyberware.tooltip.beaconPost.0", "cyberware.tooltip.beaconPost.1", "cyberware.tooltip.beaconPost.2"); ib.setRegistryName(name); GameRegistry.register(ib); this.setUnlocalizedName(Cyberware.MODID + "." + name); this.setCreativeTab(Cyberware.creativeTab); CyberwareContent.blocks.add(this); GameRegistry.registerTileEntity(TileEntityBeaconPost.class, Cyberware.MODID + ":" + name); GameRegistry.registerTileEntity(TileEntityBeaconPostMaster.class, Cyberware.MODID + ":" + name + "_master"); this.setDefaultState(this.blockState.getBaseState() .withProperty(TRANSFORMED, 0) .withProperty(NORTH, Boolean.valueOf(false)) .withProperty(EAST, Boolean.valueOf(false)) .withProperty(SOUTH, Boolean.valueOf(false)) .withProperty(WEST, Boolean.valueOf(false))); }
Example #27
Source File: BlockCloud.java From Wizardry with GNU Lesser General Public License v3.0 | 5 votes |
public BlockCloud() { super("cloud", Material.CLOTH); setHardness(0.5f); setSoundType(SoundType.CLOTH); setDefaultState(blockState.getBaseState().withProperty(HAS_LIGHT_VALUE, false)); setLightOpacity(0); }
Example #28
Source File: PollutedDirt.java From EmergingTechnology with MIT License | 5 votes |
public PollutedDirt() { super(Material.GROUND); this.setHardness(1.0f); this.setRegistryName(EmergingTechnology.MODID, _name); this.setUnlocalizedName(EmergingTechnology.MODID + "." + _name); this.setCreativeTab(EmergingTechnology.TECHNOLOGYTAB); this.setSoundType(SoundType.GROUND); }
Example #29
Source File: BlockGrapeLeaves.java From Sakura_mod with MIT License | 5 votes |
public BlockGrapeLeaves() { super(Material.WOOD,false); this.setDefaultState(this.blockState.getBaseState().withProperty(this.getAgeProperty(), Integer.valueOf(0))); this.setTickRandomly(true); this.setCreativeTab((CreativeTabs) null); this.setHardness(2.0F); this.setSoundType(SoundType.WOOD); }
Example #30
Source File: Light.java From EmergingTechnology with MIT License | 5 votes |
public Light() { super(Material.GLASS, "light"); this.setSoundType(SoundType.GLASS); this.setLightLevel(1.0f); this.setLightOpacity(0); setDefaultState(blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(POWERED, false) .withProperty(BULBTYPE, 0)); }