Java Code Examples for net.minecraft.block.SoundType#METAL

The following examples show how to use net.minecraft.block.SoundType#METAL . 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: BlockCompressed.java    From GregTech with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public SoundType getSoundType(IBlockState state, World world, BlockPos pos, @Nullable Entity entity) {
    Material material = state.getValue(variantProperty);
    if (material instanceof GemMaterial) {
        return SoundType.STONE;
    } else if (material instanceof IngotMaterial) {
        return SoundType.METAL;
    } else if (material instanceof DustMaterial) {
        return SoundType.SAND;
    }
    return SoundType.STONE;
}
 
Example 2
Source File: SoundPhysics.java    From Sound-Physics with GNU General Public License v3.0 5 votes vote down vote up
private static float getBlockReflectivity(Int3 blockPos)
{
	Block block = mc.theWorld.getBlockState(new BlockPos(blockPos.x, blockPos.y, blockPos.z)).getBlock();
	SoundType soundType = block.getSoundType();
	
	float reflectivity = 0.5f;
	
	if (soundType == SoundType.STONE)
		reflectivity = SoundPhysicsCore.Config.stoneReflectivity;
	else if (soundType == SoundType.WOOD)
		reflectivity = SoundPhysicsCore.Config.woodReflectivity;
	else if (soundType == SoundType.GROUND)
		reflectivity = SoundPhysicsCore.Config.groundReflectivity;
	else if (soundType == SoundType.PLANT)
		reflectivity = SoundPhysicsCore.Config.plantReflectivity;
	else if (soundType == SoundType.METAL)
		reflectivity = SoundPhysicsCore.Config.metalReflectivity;
	else if (soundType == SoundType.GLASS)
		reflectivity = SoundPhysicsCore.Config.glassReflectivity;
	else if (soundType == SoundType.CLOTH)
		reflectivity = SoundPhysicsCore.Config.clothReflectivity;
	else if (soundType == SoundType.SAND)	
		reflectivity = SoundPhysicsCore.Config.sandReflectivity;
	else if (soundType == SoundType.SNOW)
		reflectivity = SoundPhysicsCore.Config.snowReflectivity;
	else if (soundType == SoundType.LADDER)
		reflectivity = SoundPhysicsCore.Config.woodReflectivity;
	else if (soundType == SoundType.ANVIL)
		reflectivity = SoundPhysicsCore.Config.metalReflectivity;
	
	reflectivity *= SoundPhysicsCore.Config.globalBlockReflectance;
	
	return reflectivity;
}
 
Example 3
Source File: BlockMetalPlate.java    From BaseMetals with GNU Lesser General Public License v2.1 5 votes vote down vote up
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 4
Source File: BlockMetalTrapDoor.java    From BaseMetals with GNU Lesser General Public License v2.1 5 votes vote down vote up
public BlockMetalTrapDoor(MetalMaterial metal) {
	super(Material.IRON);
	this.metal = metal;
	this.blockHardness = metal.getMetalBlockHardness();
	this.blockResistance = metal.getBlastResistance();
	this.blockSoundType = SoundType.METAL;
	this.setHarvestLevel("pickaxe", metal.getRequiredHarvestLevel());
	this.disableStats();
}