(ItemStack stack, World worldIn, BlockPos pos, Object variantInStack)
| 109 | } |
| 110 | |
| 111 | private boolean tryPlace(ItemStack stack, World worldIn, BlockPos pos, Object variantInStack) |
| 112 | { |
| 113 | IBlockState iblockstate = worldIn.getBlockState(pos); |
| 114 | |
| 115 | if (iblockstate.getBlock() == this.singleSlab) |
| 116 | { |
| 117 | Comparable comparable = iblockstate.getValue(this.singleSlab.getVariantProperty()); |
| 118 | |
| 119 | if (comparable == variantInStack) |
| 120 | { |
| 121 | IBlockState iblockstate1 = this.doubleSlab.getDefaultState().withProperty((IProperty)this.singleSlab.getVariantProperty(), comparable); |
| 122 | |
| 123 | if (worldIn.checkNoEntityCollision(this.doubleSlab.getCollisionBoundingBox(worldIn, pos, iblockstate1)) && worldIn.setBlockState(pos, iblockstate1, 3)) |
| 124 | { |
| 125 | worldIn.playSoundEffect((float)pos.getX() + 0.5F, (float)pos.getY() + 0.5F, (float)pos.getZ() + 0.5F, this.doubleSlab.stepSound.getPlaceSound(), (this.doubleSlab.stepSound.getVolume() + 1.0F) / 2.0F, this.doubleSlab.stepSound.getFrequency() * 0.8F); |
| 126 | --stack.stackSize; |
| 127 | } |
| 128 | |
| 129 | return true; |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | return false; |
| 134 | } |
| 135 | } |
no test coverage detected