Fix #1202 Greenhouse doors, glass and sprinkler should use glass breaking sound

This commit is contained in:
Nedelosk committed 2016-05-24 21:44:26 +02:00
1 parent 69cf513e51
commit 33051d09b2
2 files changed
+12

No files matched your search

@@ -17,6 +17,7 @@ import java.util.Locale;
import java.util.Map;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyEnum;
@@ -101,6 +102,15 @@ public abstract class BlockGreenhouse extends BlockStructure implements ISpriteR
public BlockGreenhouseType getGreenhouseType() {
return type;
}
@Nonnull
@Override
public SoundType getSoundType() {
if(type == BlockGreenhouseType.SPRINKLER || type == BlockGreenhouseType.GLASS){
return SoundType.GLASS;
}
return super.getSoundType();
}
};
}
blockMap.put(type, block);
@@ -15,6 +15,7 @@ import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockDoor;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.EnumPushReaction;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.properties.PropertyDirection;
@@ -60,6 +61,7 @@ public class BlockGreenhouseDoor extends BlockGreenhouse implements IStateMapper
protected static final AxisAlignedBB EAST_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.1875D, 1.0D, 1.0D);
public BlockGreenhouseDoor() {
setSoundType(SoundType.GLASS);
setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(OPEN, false).withProperty(HINGE, BlockDoor.EnumHingePosition.LEFT).withProperty(POWERED, false).withProperty(HALF, BlockDoor.EnumDoorHalf.LOWER));
}