I think I see your problem.
They have to be planted within 2 blocks of a WATER BLOCK. The code check is this.
Code:
for (var x = -2; x <= 2; x++)
{
for (var z = -2; z <= 2; z++)
{
if (_world.GetBlock(_blockPos + new Vector3i(x, 0, z)).Block.blockMaterial.id == "water") return false;
if (_world.GetBlock(_blockPos + new Vector3i(x, -1, z)).Block.blockMaterial.id == "water") return false;
if (_world.GetBlock(_blockPos + new Vector3i(x, 1, z)).Block.blockMaterial.id == "water") return false;
}
}
So when you can't pick up the water barrel anymore, break it. You'll get a bucket of water AND an empty barrel back.
Dig a hole, place the water from the bucket in the hole and then plant around that.
EDIT: For the record, this is what the code for the full water barrel looks like.
Code:
<block id="2038" name="waterBarrel3">
<property name="LightOpacity" value="0"/>
<property name="Material" value="wood"/>
<property name="Shape" value="ModelEntity"/>
<property name="Model" value="#WaterBarrel?WaterBarrel" />
<property name="RotationAllowed" value="pivotOnFloor" />
<property name="RandomTintColor1" value="255,255,255"/>
<drop event="Destroy" name="waterBarrel1" count="1" />
<drop event="Harvest" name="bucketRain" count="1" />
<property name="MaxDamage" value="40" />
</block>
So the reason it's not working is because the full Water Barrel is Material=wood and plants are looking for Materlal=water or they die.