Files
2019-02-24 22:29:41 +08:00

23 lines
1.2 KiB
Diff

--- ../src-base/minecraft/net/minecraft/item/ItemSnow.java
+++ ../src-work/minecraft/net/minecraft/item/ItemSnow.java
@@ -51,7 +51,7 @@
if (axisalignedbb != Block.NULL_AABB && worldIn.checkNoEntityCollision(axisalignedbb.offset(blockpos)) && worldIn.setBlockState(blockpos, iblockstate1, 10))
{
- SoundType soundtype = this.block.getSoundType();
+ SoundType soundtype = this.block.getSoundType(iblockstate1, worldIn, pos, player);
worldIn.playSound(player, blockpos, soundtype.getPlaceSound(), SoundCategory.BLOCKS, (soundtype.getVolume() + 1.0F) / 2.0F, soundtype.getPitch() * 0.8F);
if (player instanceof EntityPlayerMP)
@@ -77,4 +77,10 @@
{
return damage;
}
+
+ public boolean canPlaceBlockOnSide(World world, BlockPos pos, EnumFacing side, EntityPlayer player, ItemStack stack)
+ {
+ IBlockState state = world.getBlockState(pos);
+ return (state.getBlock() != net.minecraft.init.Blocks.SNOW_LAYER || ((Integer)state.getValue(BlockSnow.LAYERS)) > 7) ? super.canPlaceBlockOnSide(world, pos, side, player, stack) : true;
+ }
}