Fix dispensers checking valid cocoa directions on own pos, closes #3159

This commit is contained in:
Hubry committed 2020-01-30 19:50:05 +01:00
1 parent 12e67ab394
commit 4f5adbe992
1 file changed
+1 -1
@@ -33,7 +33,7 @@ public class BehaviourCocoaBeans extends DefaultDispenseItemBehavior {
Direction facing = source.getBlockState().get(DispenserBlock.FACING);
BlockPos pos = source.getBlockPos().offset(facing);
World world = source.getWorld();
BlockItemUseContext ctx = new DirectionalPlaceContext(source.getWorld(), source.getBlockPos(), facing, new ItemStack(block), facing.getOpposite());
BlockItemUseContext ctx = new DirectionalPlaceContext(source.getWorld(), source.getBlockPos().offset(facing), facing, new ItemStack(block), facing.getOpposite());
BlockState cocoa = block.getStateForPlacement(ctx);
if(cocoa != null && world.isAirBlock(pos)) {
world.setBlockState(pos, cocoa);